From: Eduardo DAVILA Date: Fri, 25 Oct 2019 15:48:49 +0000 (+0200) Subject: #3317 creaMaracasVisu Feature New Normal - plane information inf viewerNV X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e2f602be451f1017507d34aa338632800590f10a;p=creaMaracasVisu.git #3317 creaMaracasVisu Feature New Normal - plane information inf viewerNV --- diff --git a/bbtk/src/bbmaracasvisuSliderMinMax.cxx b/bbtk/src/bbmaracasvisuSliderMinMax.cxx index 16cd7e2..4eac20e 100644 --- a/bbtk/src/bbmaracasvisuSliderMinMax.cxx +++ b/bbtk/src/bbmaracasvisuSliderMinMax.cxx @@ -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 ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx index 8f62478..42db920 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx @@ -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) && (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=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=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_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); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.h index e4578df..e0a761d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImage.h @@ -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); }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx index 41026ca..ecff31a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx @@ -71,6 +71,7 @@ bool vtkInfoTextImageInteractor::OnMouseMove() GetVtkInfoTextImage()->PutWindowLevel(); GetVtkInfoTextImage()->PutColorLevel(); + GetVtkInfoTextImage()->PutPlane(); int tempext[6]; ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetImageData()->GetExtent(tempext);