]> Creatis software - creaMaracasVisu.git/commitdiff
Clean code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 1 Oct 2024 08:42:14 +0000 (10:42 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 1 Oct 2024 08:42:14 +0000 (10:42 +0200)
bbtk/bbs/boxes/HelpViewerNV.bbg
bbtk/bbs/boxes/HelpViewerNV.bbs
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp

index 6760666aad66f46369dbf6574163cd3820e6d17f..59f148221f5bfd819b517668dd2a98ffa18d2e40 100644 (file)
@@ -14,13 +14,13 @@ PACKAGENAME:creaMaracasVisu
 COMPLEXOUTPUTS:1
 COMPLEX_PORT
 widget
--24.795296:-21.753245:-900.000000
+-21.902812:-32.105295:-900.000000
 FIN_COMPLEX_PORT
 COMPLEXINPUTS:0
-BOXES:10
+BOXES:11
 BOX
 wx:LayoutLine:Box02
-ISEXEC:TRUE
+ISEXEC:FALSE
 -27.103714:-11.307555:-900.000000
 6.216286:-13.807555:-900.000000
 FIN_BOX
@@ -96,7 +96,15 @@ ISEXEC:FALSE
 PORT
 In:"-Brightness / Contrast&&2P&& Drag middle click mouse (ctrl reset)"
 FIN_BOX
-CONNECTIONS:10
+BOX
+wx:StaticBox:Box12
+ISEXEC:FALSE
+-25.804006:-20.627981:-900.000000
+-4.289006:-23.127981:-900.000000
+PORT
+BoxTitle:"Viewer"
+FIN_BOX
+CONNECTIONS:11
 CONNECTION
 Box11:Widget:Box02:Widget1
 NumberOfControlPoints:0
@@ -125,6 +133,9 @@ CONNECTION
 Box10:Widget:Box02:Widget9
 NumberOfControlPoints:0
 CONNECTION
-Box02:Widget:widget:widget
+Box02:Widget:Box12:BoxContent
+NumberOfControlPoints:0
+CONNECTION
+Box12:Widget:widget:widget
 NumberOfControlPoints:0
 APP_END
index af06a5ca54bf91ca23ac51d3c7d8490bef54be33..95edde025d07404fd418456c21ac18c1178d5579 100644 (file)
@@ -43,6 +43,9 @@ new wx:OutputText Box10
 new wx:OutputText Box11
   set Box11.In "-Brightness / Contrast: Drag middle click mouse (ctrl reset)"
 
+new wx:StaticBox Box12
+  set Box12.BoxTitle "Viewer"
+
 
 connect Box11.Widget Box02.Widget1
 connect Box03.Widget Box02.Widget2
@@ -53,12 +56,12 @@ connect Box07.Widget Box02.Widget6
 connect Box08.Widget Box02.Widget7
 connect Box09.Widget Box02.Widget8
 connect Box10.Widget Box02.Widget9
+connect Box02.Widget Box12.BoxContent
 
 # Complex input ports
 
 # Complex output ports
-output widget Box02.Widget " "
+output widget Box12.Widget " "
 
-exec Box02
 
 endefine
index 6c2083f1cc4078f93496e6c6d1e85107e01755c7..f356db286a0edc9d7046a831cb4dca4a4d813cbf 100644 (file)
@@ -300,7 +300,6 @@ void manualViewBaseContour::ConstructVTKObjects()
        _lineCell->InsertNextCell(2);
        _lineCell->InsertCellPoint(0);
        _lineCell->InsertCellPoint(1);
-
        _pd = vtkPolyData::New();
        _pd->SetPoints( _pts );
        _pd->SetLines( _splineCell );
@@ -315,7 +314,6 @@ void manualViewBaseContour::ConstructVTKObjects()
     _bboxMapper                        =       vtkPolyDataMapper::New();
     _bboxMapper->ScalarVisibilityOff( );
 
-
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _bboxMapper->SetInput(_pd);
@@ -324,14 +322,10 @@ void manualViewBaseContour::ConstructVTKObjects()
        _bboxMapper->SetInputData(_pd);
 #endif
 
-
        _contourVtkActor->SetMapper(_bboxMapper);
        _contourVtkActor->GetProperty()->BackfaceCullingOff();
-
        UpdateColorActor();
-
        _pd->ComputeBounds();
-
        InitTextActor();
 }
 
@@ -358,13 +352,11 @@ void manualViewBaseContour::InitTextActor()
 //     _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
        _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
 //     _textActor->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
-
        vtkTextProperty *tprop = _textActor->GetTextProperty();
        tprop->SetFontSize(12);
        tprop->SetFontFamilyToArial();
        tprop->SetColor(1, 1, 0);
 
-
        //      Text 2
        _textActor2 = vtkTextActor::New();
 //     _textActor->SetDisplayPosition(200, 200);
@@ -374,12 +366,10 @@ void manualViewBaseContour::InitTextActor()
 //     _textActor2->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
        _textActor2->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
 //     _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
-
        vtkTextProperty *tprop2 = _textActor2->GetTextProperty();
        tprop2->SetFontSize(12);
        tprop2->SetFontFamilyToArial();
        tprop2->SetColor(1, 1, 0);
-
 }
 
 // ----------------------------------------------------------------------------
@@ -391,16 +381,15 @@ void manualViewBaseContour::CreateNewContour()
        _wxvtkbaseview->GetRenderer()->AddActor2D(_textActor);*/
        AddCompleteContourActor();
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::UpdateViewPoint(int id) // virtual
 {
        manualPoint             *mp             = _manContModel->GetManualPoint(id);
-
 //EEDx6
                        double XX=mp->GetX(),YY=mp->GetY(),ZZ=mp->GetZ();
 //                     wxVtk2DBaseView *wxvtk2Dbasevie = (wxVtk2DBaseView*)this->GetWxVtkBaseView();
 //                     wxvtk2Dbasevie->TransformCoordinate_spacing_ModelToView(XX,YY,ZZ);
-
        _lstViewPoints[id]->SetPositionXY( XX , YY ,_range, ZZ );
 }
 
@@ -444,6 +433,7 @@ void manualViewBaseContour::InsertPoint(int id)
        _lstViewPoints.insert(itNum,mvp);
        _wxvtkbaseview->GetRenderer()->AddActor( mvp->CreateVtkPointActor() );
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::DeleteContour()
 {
@@ -458,6 +448,7 @@ void manualViewBaseContour::DeleteContour()
        }
        Refresh();
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::DeletePoint(int id) // virtual
 {
@@ -481,36 +472,43 @@ void manualViewBaseContour::DeletePoint(int x, int y, int z)
                DeletePoint(id);
        }
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetSelected(bool selected)
 {
        _selected=selected;
+    
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetPosibleSelected(bool posibleSelected)
 {
        _posibleSelected=posibleSelected;
 }
+
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour::GetEditable()
 {
        return *_editable;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetEditable( bool * condition )
 {
        _editable = condition;
 }
+
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour::GetSelected()
 {
        return _selected;
 }
+
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour::GetPosibleSelected()
 {
        return _posibleSelected;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::DeleteSelectedPoints()
 {
@@ -522,16 +520,19 @@ void manualViewBaseContour::DeleteSelectedPoints()
        }
        Refresh();
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SelectPoint(int i, bool select)
 {
        _lstViewPoints[i]->SetSelected(select);
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SelectLstPoints()
 {
        // ToDo
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SelectAllPoints(bool select)
 {
@@ -540,11 +541,13 @@ void manualViewBaseContour::SelectAllPoints(bool select)
                SelectPoint(i,select);
        }
 }
+
 //-----------------------------------------------------------------------------
 void manualViewBaseContour:: SetIfViewControlPoints(bool ifShow)
 {
        _viewControlPoints = ifShow;
 }
+
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour:: GetIfViewControlPoints()
 {
@@ -556,11 +559,13 @@ void manualViewBaseContour::SetPointPosibleSelected(int id,bool select)
 {
        _lstViewPoints[id]->SetPosibleSelected(select);
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetPointSelected(int id,bool select)
 {
        _lstViewPoints[id]->SetSelected(select);
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SelectAllPossibleSelected(bool select)
 {
@@ -569,6 +574,7 @@ void manualViewBaseContour::SelectAllPossibleSelected(bool select)
                SetPointPosibleSelected(i,select);
        }
 }
+
 // ----------------------------------------------------------------------------
 int manualViewBaseContour::SelectPosiblePoint(int x, int y, int z)  // virtual
 {
@@ -581,6 +587,7 @@ int manualViewBaseContour::SelectPosiblePoint(int x, int y, int z)  // virtual
        }
        return id;
 }
+
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
 {
@@ -632,20 +639,24 @@ bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
     
        return result;
 }
+
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour::ifTouchContour(int x,int y, int z) // virtual
 {
        return false;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::UnSelectPoint(int i){
        _lstViewPoints[i]->SetSelected(false);
        Refresh();
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::UnSelectLstPoints(){
        // ToDo
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::UnSelectAllPoints(){
        int i,size=_lstViewPoints.size();
@@ -655,18 +666,22 @@ void manualViewBaseContour::UnSelectAllPoints(){
        }
        Refresh();
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetModel(manualBaseModel *manContModel){
        _manContModel=manContModel;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview){
        _wxvtkbaseview = wxvtkbaseview;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::RefreshContour()  // Virtual
 {
 }
+
 // ----------------------------------------------------------------------------
 double* manualViewBaseContour::GetVectorPointsXManualContour(){
        double pp[3];
@@ -679,6 +694,7 @@ double* manualViewBaseContour::GetVectorPointsXManualContour(){
        } // for i
        return vx;
 }
+
 // ----------------------------------------------------------------------------
 double* manualViewBaseContour::GetVectorPointsYManualContour()
 {
@@ -692,6 +708,7 @@ double* manualViewBaseContour::GetVectorPointsYManualContour()
        } // for i
        return vy;
 }
+
 // ----------------------------------------------------------------------------
 double* manualViewBaseContour::GetVectorPointsZManualContour()
 {
@@ -705,6 +722,7 @@ double* manualViewBaseContour::GetVectorPointsZManualContour()
        } // for i
        return vz;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::Refresh() // virtual
 {
@@ -719,20 +737,18 @@ void manualViewBaseContour::Refresh() // virtual
                _lstViewPoints[i]->UpdateColorActor();
        } // for i
        UpdateColorActor();
-
        if (_show_text==true)
        {
                RefreshText();
        }
-
        vtkRenderWindowInteractor *vri = _wxvtkbaseview->GetWxVTKRenderWindowInteractor ();
        if (vri==NULL)
        {
                _wxvtkbaseview->GetRenWin()->Render();
                printf("EED %p How to optimize manualViewBaseContour::Refresh() \n",this);
        }
-
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::RefreshText()  // virtual
 {
@@ -742,6 +758,7 @@ void manualViewBaseContour::RefreshText()  // virtual
                _textActor2 -> SetInput("00");
        }
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetColorNormalContour(double r, double g, double b)
 {
@@ -749,6 +766,7 @@ void manualViewBaseContour::SetColorNormalContour(double r, double g, double b)
        _coulorNormal_g = g;
        _coulorNormal_b = b;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::GetColorNormalContour(double &r, double &g, double &b)
 {
@@ -756,6 +774,7 @@ void manualViewBaseContour::GetColorNormalContour(double &r, double &g, double &
        g = _coulorNormal_g;
        b = _coulorNormal_b;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetColorEditContour(double r, double g, double b)
 {
@@ -763,6 +782,7 @@ void manualViewBaseContour::SetColorEditContour(double r, double g, double b)
        _coulorEdit_g = g;
        _coulorEdit_b = b;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::GetColorEditContour(double &r, double &g, double &b)
 {
@@ -770,6 +790,7 @@ void manualViewBaseContour::GetColorEditContour(double &r, double &g, double &b)
        g = _coulorEdit_g;
        b = _coulorEdit_b;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetColorSelectContour(double r, double g, double b)
 {
@@ -777,6 +798,7 @@ void manualViewBaseContour::SetColorSelectContour(double r, double g, double b)
        _coulorSelection_g = g;
        _coulorSelection_b = b;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::GetColorSelectContour(double &r, double &g, double &b)
 {
@@ -784,6 +806,7 @@ void manualViewBaseContour::GetColorSelectContour(double &r, double &g, double &
        g = _coulorSelection_g;
        b = _coulorSelection_b;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::UpdateColorActor()
 {
@@ -801,6 +824,7 @@ void manualViewBaseContour::UpdateColorActor()
                }
        }
 }
+
 // ----------------------------------------------------------------------------
 int    manualViewBaseContour::GetIdPoint(int x, int y, int z) // virtual
 {
@@ -816,8 +840,6 @@ int manualViewBaseContour::GetIdPoint(int x, int y, int z) // virtual
 }
 
 // ----------------------------------------------------------------------------
-
-
 int manualViewBaseContour::GetNumberOfPoints()
 {
        return _lstViewPoints.size();
@@ -837,54 +859,58 @@ int manualViewBaseContour::GetNumberOfPoints()
 {
        _sizePointsContour = size;
 }*/
+
 //----------------------------------------------------------------------------
 // virtual
 void manualViewBaseContour::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type)  // Virtual
 {
        _wxvtkbaseview->TransFromCoordScreenToWorld(X, Y, Z,false, type);
-
-
 //EED 27 sep 2007
 //   //EEDx6
 //     wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview;
 //     wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z);
-
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetRange(double range)
 {
        _range=range;
 }
+
 // ----------------------------------------------------------------------------
 double manualViewBaseContour::GetRange()
 {
        return _range;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetZ(int z)
 {
 //     _Z=z;
 }
+
 // ----------------------------------------------------------------------------
 int    manualViewBaseContour::GetZ()
 {
 //     return _Z;
        return 0;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::InitMove(int x, int y, int z) // virtual
 {
-
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::MoveContour(int x, int y, int z) // virtual
 {
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )// virtual
 {
-
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ )// virtual
 {
@@ -956,6 +982,7 @@ void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ,
                maxZ = 0;
        }
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::ClearContour()
 {
@@ -969,11 +996,13 @@ void manualViewBaseContour::ClearContour()
        }
        Refresh();
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::ClearPoint(int id)
 {
        DeletePoint(id);
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetVisible(bool ok)
 {
@@ -998,8 +1027,8 @@ void manualViewBaseContour::SetVisible(bool ok)
        _textActor->SetInput("00");
        _textActor2->GetProperty()->SetOpacity( opacity );
        _textActor2->SetInput("00");
-
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetShowText(bool ok)
 {
@@ -1010,18 +1039,21 @@ void manualViewBaseContour::SetShowText(bool ok)
                _textActor2->SetInput("");
        }
 }
 // ----------------------------------------------------------------------------
 wxVtkBaseView *manualViewBaseContour::GetWxVtkBaseView()
 {
        return this->_wxvtkbaseview;
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::GetSpacing(double spc[3])
 {
-       spc[0] = _spc[0];
-       spc[1] = _spc[1];
-       spc[2] = _spc[2];
+    spc[0] = _spc[0];
+    spc[1] = _spc[1];
+    spc[2] = _spc[2];
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetSpacing(double spc[3])
 {
index 960b70bda6aafdca76fd55368602f59738361cb7..17df8e818c02bf9867a9d1c7fa42bcd42865a5ed 100644 (file)
@@ -101,6 +101,10 @@ void manualViewContour::RefreshContour() // virtual
        //double t,delta, x,y,z;
        double x,y,z;
        double xx,yy,zz;
+    
+    
+//    printf("EEDmanualViewContour::RefreshContour spc %f %f %f \n", _spc[0],_spc[1],_spc[2]);
+
 //----------------------------------
        if ( ShowLineVersion()==true ) 
        {