]> Creatis software - creaMaracasVisu.git/commitdiff
#3317 creaMaracasVisu Feature New Normal - plane information inf viewerNV
authorEduardo DAVILA <davila@dhcp-21.creatis.insa-lyon.fr>
Fri, 25 Oct 2019 15:48:49 +0000 (17:48 +0200)
committerEduardo DAVILA <davila@dhcp-21.creatis.insa-lyon.fr>
Fri, 25 Oct 2019 15:48:49 +0000 (17:48 +0200)
bbtk/src/bbmaracasvisuSliderMinMax.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx

index 16cd7e25e05fdf25e776f69da2f3b93bfe3c2a77..4eac20e540fa233b23b70b45f0c5220cade62060 100644 (file)
@@ -43,7 +43,7 @@ namespace bbcreaMaracasVisu
                        modBarRange         = modelBarRange;
                        mbbtkSliderMinMax   = bbParent;
                        Connect(modBarRange->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxWidgetSliderMinMax::onBarrange );
-//                     Connect(modBarRange->GetId(),98765,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onActualChange_Bar );
+ //                    Connect(modBarRange->GetId(),98765,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onActualChange_Bar );
                        Connect(modBarRange->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onActualChange_Bar );
                        Connect(modBarRange->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onStartChange_Bar );            
                        Connect(modBarRange->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxWidgetSliderMinMax::onEndChange_Bar );
index 8f62478e089105f4a839b4358359454d25d8b302..42db92071198e13c6a40271af51cb959ae9c1972 100644 (file)
@@ -70,7 +70,8 @@ END_EVENT_TABLE()
 
 //wxDefaultSize
 mBarRange::mBarRange(wxWindow *parent, int w, int h)
-:wxScrolledWindow(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
+//EED-2019-10-25 :wxScrolledWindow(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
+ :wxPanel(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
 {
        acceptedClick           =       true;
        _bitmap_bar                     =       NULL;
@@ -108,6 +109,8 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
 
 mBarRange::~mBarRange()
 {
+       DeletePendingEvents ();
+       RemoveEventHandler ( GetEventHandler() );       
 }
 
 //---------------------------------------------------------------------------
@@ -119,15 +122,12 @@ void mBarRange::DrawBar()
        if(_orientation)
        {
                SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
-               _bitmap_bar             = new wxBitmap(_w+1280,_h+100);
+               _bitmap_bar                     = new wxBitmap(_w+1280,_h+100);
                //SIL//_bitmap_info     = new wxBitmap(_w+100+1280, _h+100);
-       }
-       //vertical
-       else
-       {
+       } else {
                SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
-               _bitmap_bar = new wxBitmap(_h+deviceStart_y+100,_w+1280);
-               _bitmap_info = new wxBitmap(_h+deviceStart_y+100, _w+1280);
+               _bitmap_bar             = new wxBitmap(_h+deviceStart_y+100,_w+1280);
+               _bitmap_info            = new wxBitmap(_h+deviceStart_y+100, _w+1280);
        }
 }
 //----------------------------------------------------------------------------
@@ -143,7 +143,7 @@ bool mBarRange::GetInRangeProperty()
 //----------------------------------------------------------------------------
 void mBarRange::SetInRangeProperty(bool in)
 {
-       _in_rangeProperty=in;
+       _in_rangeProperty = in;
 }
 //----------------------------------------------------------------------------
 //the information about the actual triangle in range or not, true if is between start and end
@@ -386,7 +386,8 @@ void mBarRange::OnSize( wxSizeEvent &WXUNUSED(event) )
 
 void mBarRange::Refresh(bool eraseBackground, const wxRect* rect)
 {
-       wxScrolledWindow::Refresh(false);
+//EED2019-10-25        wxScrolledWindow::Refresh(false);
+       wxPanel::Refresh(false);
 }
 
 
@@ -838,9 +839,9 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
                        if (barHeight <=_h)
                        {
                                bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
-                               bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
-                               bool in_actualT= withActualDrawed && (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
-                               bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
+                               bool in_EndTri   = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
+                               bool in_actualT  = withActualDrawed && (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
+                               bool in_movingBar= (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
 
                                if( in_actualT )
                                        _selectionMoveId = 3;
@@ -851,9 +852,7 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
                                else if( in_movingBar )
                                        _selectionMoveId = 4;
                        }
-               }
-               else
-               {
+               } else {
                        if(acceptedClick)
                        {
                                //is in start triagle
@@ -1040,10 +1039,10 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
 */
 void mBarRange :: setRepresentedValues ( double minRealValue, double maxRealValue)
 {
-       _min = minRealValue;
-       _max = maxRealValue;
-       _start=_min;
-       _end=_max;
+       _min    = minRealValue;
+       _max    = maxRealValue;
+       _start  =_min;
+       _end    =_max;
 }
 
 /*
@@ -1080,9 +1079,7 @@ void mBarRange :: setVisibleLabels ( bool setVisibleLB )
                                SetPixelStart(deviceStart_x);
                                SetPixelEnd(_w+deviceStart_x);
                                SetPixelActual(deviceStart_x);
-                       }
-                       else
-                       {
+                       } else {
                                SetPixelStart(deviceStart_x);
                                SetPixelEnd(_h+deviceStart_x);
                                SetPixelActual(deviceStart_x);
@@ -1116,10 +1113,10 @@ void mBarRange :: setVisibleLabels ( bool setVisibleLB )
 
                                if (getClickedX()<=_h)
                                {                                               
-                                       bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
-                                       bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
-                                       bool in_actualT= (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
-                                       bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
+                                       bool in_StartTri        = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
+                                       bool in_EndTri          = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
+                                       bool in_actualT         = (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
+                                       bool in_movingBar       = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
 
                                        if(in_StartTri)
                                                _selectionMoveId = 1;
index 1f61b51259340f20dfd73b5ff23bd4e50bc2d089..25d4e2f276f34a0dec2a90ec3043167c90728ef7 100644 (file)
@@ -79,7 +79,8 @@ enum
 };
 
 
-class creaMaracasVisu_EXPORT mBarRange :public  wxScrolledWindow{
+class creaMaracasVisu_EXPORT mBarRange :public  wxPanel{
+//EED-2019-10-25 class creaMaracasVisu_EXPORT mBarRange :public  wxScrolledWindow{
 public:
        //------------------------------------
        //Constructors & Destructors
index 7d76ca9aa5761f2cf9dcca7faaea4254fc1bdb0b..33d6f4c269780f9d8cf7dff67d64dad7b043d9bb 100644 (file)
@@ -37,6 +37,7 @@ vtkInfoTextImage::vtkInfoTextImage()
        _vtkText_ColorLevel             = NULL;
        _vtkText_position               = NULL;
        _vtkText_pixelIntensity = NULL;
+       _vtkText_plane                  = NULL;
        _marimagedata                   = NULL;
 }
 
@@ -51,10 +52,11 @@ vtkInfoTextImage::~vtkInfoTextImage()
 void vtkInfoTextImage::Configure()
 {
        if(_vtkText_WindowLevel == NULL){
-               _vtkText_WindowLevel    = Create_Text_Label( 10 , 55 );
-               _vtkText_ColorLevel             = Create_Text_Label( 10 , 40 );
-               _vtkText_position               = Create_Text_Label( 10 , 25 );
-               _vtkText_pixelIntensity = Create_Text_Label( 10 , 10 );
+               _vtkText_WindowLevel    = Create_Text_Label( 10 , 60 );
+               _vtkText_ColorLevel             = Create_Text_Label( 10 , 45 );
+               _vtkText_position               = Create_Text_Label( 10 , 30 );
+               _vtkText_pixelIntensity = Create_Text_Label( 10 , 15 );
+               _vtkText_plane                  = Create_Text_Label( 10 , 0 );
        }
 }
 
@@ -63,14 +65,14 @@ void vtkInfoTextImage::Configure()
 
 void vtkInfoTextImage::SetMarImageData(marImageData *marimagedata)
 {
-       _marimagedata=marimagedata;
+       _marimagedata = marimagedata;
 }
 
 //-------------------------------------------------------------------
 
 void vtkInfoTextImage::SetWxVtk2DBaseView(wxVtk2DBaseView *wxvtk2Dbaseview)
 {
-       _wxvtk2Dbaseview=wxvtk2Dbaseview;
+       _wxvtk2Dbaseview = wxvtk2Dbaseview;
 }
 
 //-------------------------------------------------------------------
@@ -118,6 +120,7 @@ void vtkInfoTextImage::PutWindowLevel()
 void vtkInfoTextImage::PutColorLevel()
 {
        double value = _wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->GetLevel();
+
        char zTzxt[20];
        char resultText[50];
 
@@ -130,6 +133,24 @@ void vtkInfoTextImage::PutColorLevel()
        _vtkText_ColorLevel             -> SetInput(resultText);
 }
 
+//-------------------------------------------------------------------
+void vtkInfoTextImage::PutPlane()
+{
+       int plane = _wxvtk2Dbaseview->GetDirection();
+       char zTzxt[20];
+       char resultText[50];
+
+       if (plane==0) { strcpy(resultText,"plane:YZ"); }
+       if (plane==1) { strcpy(resultText,"plane:XZ"); }
+       if (plane==2) { strcpy(resultText,"plane:XY"); }
+
+//     itoa (value,zTzxt,10);
+//     sprintf(zTzxt,"%d",value);
+
+//     strcat(resultText,zTzxt);
+       _vtkText_plane          -> SetInput(resultText);
+}
+
 //-------------------------------------------------------------------
 
 void vtkInfoTextImage::PutPosition(int xx,int yy, int zz)
@@ -187,9 +208,6 @@ void vtkInfoTextImage::PutPosition(int xx,int yy, int zz)
        strcat(resultText,zTzxt);
        strcat(resultText,")");
 
-
-
-
        _vtkText_position               -> SetInput(resultText);
 }
 
index e4578df9f6ab577e06430ba725c3458964ed7322..e0a761db2bd7a9a10a76684ca45a49d67830a087 100644 (file)
@@ -40,6 +40,7 @@ public:
        void PutPosition(int x, int y, int z);
        void PutColorLevel();
        void PutWindowLevel();
+       void PutPlane();
 
 
 protected:
@@ -51,6 +52,7 @@ private:
        vtkTextActor    *_vtkText_ColorLevel;
        vtkTextActor    *_vtkText_position;
        vtkTextActor    *_vtkText_pixelIntensity;
+       vtkTextActor    *_vtkText_plane;
 
        vtkTextActor    *Create_Text_Label(int px, int py);
 };
index 41026ca30e344f02c3dc595149cb785712cd3e3a..ecff31a32554fea3de5783d35dd60de2bb1c4be6 100644 (file)
@@ -71,6 +71,7 @@ bool vtkInfoTextImageInteractor::OnMouseMove()
        
        GetVtkInfoTextImage()->PutWindowLevel();
        GetVtkInfoTextImage()->PutColorLevel();
+       GetVtkInfoTextImage()->PutPlane();
 
        int tempext[6];
        ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetImageData()->GetExtent(tempext);