]> Creatis software - creaMaracasVisu.git/commitdiff
Remove deprecated + re indent
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 31 Mar 2010 12:41:56 +0000 (12:41 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 31 Mar 2010 12:41:56 +0000 (12:41 +0000)
lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelFigureCube.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelFigureCube.h
lib/maracasVisuLib/src/CutModule/kernel/CutModelFigureCylinder.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelFigureCylinder.h
lib/maracasVisuLib/src/CutModule/kernel/CutModelFigureSphere.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelFigureSphere.h

index 188d243b465f98ac4ed33f6bb6603cc7a719c25a..c667375fec9c34125070b509f59d4f7e4c4cd3c3 100644 (file)
@@ -3,8 +3,8 @@
 Program:   wxMaracas
 Module:    $RCSfile: CutModelMainPanel.cxx,v $
 Language:  C++
-Date:      $Date: 2010/03/05 17:54:39 $
-Version:   $Revision: 1.7 $
+Date:      $Date: 2010/03/31 12:41:56 $
+Version:   $Revision: 1.8 $
 
 Copyright: (c) 2002, 2003
 License:
@@ -255,16 +255,14 @@ void CutModelMainPanel::onUndo()
        {
        try{
                checkInvariant();               
-               int result = cutmanager->Undo();
+               int result = cutmanager->Undo(); // result unused// JPR
 
        }catch(CutModelException e){
                showErrorDialog(e.getCause());
        }
-
 }
 
 void CutModelMainPanel::onRedo(){
-
        try{
                checkInvariant();               
                int result = cutmanager->Redo();
@@ -272,7 +270,6 @@ void CutModelMainPanel::onRedo(){
        }catch(CutModelException e){
                showErrorDialog(e.getCause());
        }
-
 }
 
 void CutModelMainPanel::changeOpacity(int id,int opacity){
@@ -294,9 +291,11 @@ void CutModelMainPanel::ShowViewBox(int id,bool check){
                showErrorDialog(e.getCause());
        }
 }
+
 void CutModelMainPanel::ShowPopUpMenu(int id){
        showErrorDialog("test");
 }
+
 void CutModelMainPanel::changeColor(int id,double r,double g,double b){
 
        try{
@@ -306,8 +305,8 @@ void CutModelMainPanel::changeColor(int id,double r,double g,double b){
        }catch(CutModelException e){
                showErrorDialog(e.getCause());
        }
-
 }
+
 void CutModelMainPanel::ChangeShape(int id,int selection){
        try{
                checkInvariant();
@@ -344,8 +343,8 @@ void CutModelMainPanel::ExecuteAll(){
        for(i = 0; i < (int)viewpanels.size(); i++){
                viewpanels[i]->ExecuteCut();
        }
-
 }
+
 vtkImageData* CutModelMainPanel::GetResultImage(){
        try{
                checkInvariant();
@@ -409,12 +408,9 @@ void CutModelMainPanel::addPolygonCutterTab(){
        Connect(btnExecutePolygonCut->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)(&PolygonCutterEventHandlerCutModel::onExecuteCutPolygon));  
        sizer->Add(btnExecutePolygonCut, 0, wxALIGN_LEFT);
 
-
        _notebook->AddPage(panel, _T("Polygon Cutter"), false);
-
 }
 
-
 void PolygonCutterEventHandlerCutModel::onCheckChanged(wxCommandEvent& event){
        CutModelMainPanel::getInstance()->onCheckChanged();
 }
@@ -423,8 +419,6 @@ void PolygonCutterEventHandlerCutModel::onExecuteCutPolygon(wxCommandEvent& even
        CutModelMainPanel::getInstance()->onExecuteCutPolygon();
 }
 
-
-
 /**
 **
 **/
@@ -451,7 +445,6 @@ ToolBarCutModel::ToolBarCutModel(wxWindow * parent)
 
        _evthand = new ToolBarEventHandlerCutModel();
        this->SetEventHandler(_evthand);
-
 }
 
 ToolBarCutModel::~ToolBarCutModel(void){
@@ -479,11 +472,9 @@ void ToolBarEventHandlerCutModel::onExecuteAll(wxCommandEvent& event){
        CutModelMainPanel::getInstance()->ExecuteAll();
 }
 
-
 BEGIN_EVENT_TABLE(ToolBarEventHandlerCutModel, wxEvtHandler)
        EVT_MENU(10, ToolBarEventHandlerCutModel::onAdd)
        EVT_MENU(20, ToolBarEventHandlerCutModel::onUndo)
        EVT_MENU(30, ToolBarEventHandlerCutModel::onRedo)
        EVT_MENU(40, ToolBarEventHandlerCutModel::onExecuteAll)
 END_EVENT_TABLE()
-
index d4b46fbd9c92845fc60ddca642e90cfa3db841b5..63fa92838a5aaab0c95cb70689138450d4ce8e47 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: CutModelData.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/11/25 16:35:37 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2010/03/31 12:41:58 $
+  Version:   $Revision: 1.6 $
 
   Copyright: (c) 2002, 2003
   License:
@@ -22,8 +22,8 @@
 CutModelData::CutModelData(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img){
        
        initializeData(id, interactor, observer, img);
-       
 }
+
 CutModelData::CutModelData(){
 
 }
@@ -37,6 +37,7 @@ void CutModelData::initializeData(int id, vtkRenderWindowInteractor* interactor,
        ChangeShape(0);
        checkInvariant();
 }
+
 CutModelData::~CutModelData(){
        checkInvariant();
        _boxWidgetVolume->RemoveAllObservers();
@@ -53,11 +54,11 @@ CutModelData::~CutModelData(){
        inversModel->Delete();
        _id = -1;
 }
+
 void CutModelData::RefreshViewBox(){
                
 }
 void CutModelData::createBoxWidget(vtkRenderWindowInteractor* interactor, vtkCommand* observer){
-
        _boxWidgetVolume = vtkBoxWidget::New();
        _boxWidgetVolume->SetInteractor( interactor );
        //_boxWidgetVolume->SetPlaceFactor(1);
@@ -73,6 +74,7 @@ void CutModelData::createBoxWidget(vtkRenderWindowInteractor* interactor, vtkCom
        //_boxWidgetVolume->GetHandleProperty()->SetOpacity(0.5);       
        //_boxWidgetVolume->GetOutlineProperty()->SetOpacity(0.5);      
 }
+
 void CutModelData::setTransform(vtkImageData* img)throw( CutModelException){
        
        currentmatrix = vtkTransform::New();
@@ -84,7 +86,6 @@ void CutModelData::setTransform(vtkImageData* img)throw( CutModelException){
        int *ext = img->GetExtent();
        double *spc = img->GetSpacing();
 
-       
        matrix->SetElement(0,0,(ext[1]-ext[0])/4*spc[0]);
        matrix->SetElement(1,1,(ext[3]-ext[2])/4*spc[1]);       
        matrix->SetElement(2,2,(ext[5]-ext[4])/4*spc[2]);
@@ -97,31 +98,32 @@ void CutModelData::setTransform(vtkImageData* img)throw( CutModelException){
        matrix->SetElement(1,3,orgy);
        matrix->SetElement(2,3,orgz);
 
-       
        currentmatrix->SetMatrix(matrix);
-       _boxWidgetVolume->SetTransform(currentmatrix);  
-               
+       _boxWidgetVolume->SetTransform(currentmatrix);                  
 }
+
 void CutModelData::createActor(){      
 
        _Mapper = vtkPolyDataMapper::New();     
        _Actor  = vtkActor::New();
        _Actor->SetMapper(_Mapper);     
        _Actor->GetProperty()->SetColor(1, 0, 0);
-       _Actor->GetProperty()->SetOpacity(0.5); 
-       
+       _Actor->GetProperty()->SetOpacity(0.5);         
 }
+
 void CutModelData::udapteActorDirection()throw( CutModelException){
        checkInvariant();
        
        _boxWidgetVolume->GetTransform(currentmatrix);          
        _Actor->SetUserMatrix(currentmatrix->GetMatrix());//SetUserTransform(currentmatrix );
 }
+
 void CutModelData::createShapes(){
        _cubefigure = new CutModelFigureCube();
        _cylinderfigure = new CutModelFigureCylinder();
        _spherefigure = new CutModelFigureSphere();
 }
+
 void CutModelData::changeOpacity(int opacity)throw( CutModelException){
        checkInvariant();       
        _Actor->GetProperty()->SetOpacity((double)opacity/100.0);
@@ -148,7 +150,6 @@ void CutModelData::ChangeShape(int selection)throw( CutModelException){
        }else{
                throw CutModelException("Shape type not found");
        }
-
        _currentshape=selection;
 }
 
@@ -170,8 +171,7 @@ void CutModelData::checkInvariant()throw( CutModelException){
        }
        if(_spherefigure==NULL){
                throw CutModelException("Sphere not created");
-       }        
-       
+       }
 }
 
 vtkActor* CutModelData::getActor()throw( CutModelException){
@@ -183,6 +183,7 @@ void CutModelData::changeColor(double r,double g,double b)throw( CutModelExcepti
        checkInvariant();               
        _Actor->GetProperty()->SetColor( r,g,b );       
 }
+
 CutModelFigure* CutModelData::getCurentCuttingModel(){
     checkInvariant();
        
@@ -196,9 +197,9 @@ CutModelFigure* CutModelData::getCurentCuttingModel(){
                throw CutModelException("Shape type not found");
        }       
 }
+
 void CutModelData::ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)throw( CutModelException)
 {
-
        wxBusyCursor wait;
 
        CutModelFigure* actualCuttingModel = getCurentCuttingModel();
@@ -209,19 +210,18 @@ void CutModelData::ExecuteCut( double* range, bool isinside, vtkImageData* copyi
        actualCuttingModel->SetInversVtkTransform(getModelTransformInvers());   
 
        bool                    inside;
-       bool                    volInt, volExt;
-       int                             xx,yy,zz;
-       unsigned short* pOrg;   
-       int                             ext[6];
-       double                  spc[3];
-       long int                contAfter = 0;
-       long int                contBefor = 0;
+       //bool                  volInt, volExt; // unused
+       int                     xx,yy,zz;
+       unsigned short*         pOrg;   
+       int                     ext[6];
+       //double                        spc[3]; // unused
+       //long int              contAfter = 0; // unused
+       //long int              contBefor = 0; // unused
        
        double minvalue = range[0]; 
        double value    = range[1];
        double maxvalue = range[2]; 
-
-               
+       
        copyimage->GetExtent(ext);        
        
        for (xx=ext[0];xx<ext[1]; xx++)
@@ -246,35 +246,31 @@ void CutModelData::ExecuteCut( double* range, bool isinside, vtkImageData* copyi
                        } // for zz
                } // for yy
        } // for xx
-       
 }
 
 void CutModelData::ExecuteUnCut(bool isinside, vtkImageData* image, vtkImageData* copyimage)throw( CutModelException)
 {
-
        wxBusyCursor wait;
 
        CutModelFigure* actualCuttingModel = getCurentCuttingModel();
-       
+
        actualCuttingModel->SetVtkTransform(getModelTransform(copyimage));
-       
+
        actualCuttingModel->SetInversVtkTransform(getModelTransformInvers());   
 
        bool                    inside;
-       bool                    volInt, volExt;
-       int                             xx,yy,zz;
+       // bool                 volInt, volExt; // unused // JPRx
+       int                     xx,yy,zz;
        unsigned short* pOrg;   
-       int                             ext[6];
-       double                  spc[3];
-       long int                contAfter = 0;
-       long int                contBefor = 0;  
-       
+       int                     ext[6];
+       //double                spc[3]; // unused // JPRx
+       //long int              contAfter = 0; // unused // JPRx
+       //long int              contBefor = 0;   // unused // JPRx
+
        double value;
-       
 
-               
        copyimage->GetExtent(ext);        
-       
+
        for (xx=ext[0];xx<ext[1]; xx++)
        {
                for (yy=ext[2];yy<ext[3]; yy++)
@@ -292,7 +288,6 @@ void CutModelData::ExecuteUnCut(bool isinside, vtkImageData* image, vtkImageData
                        } // for zz
                } // for yy
        } // for xx
-       
 }
 
 vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
@@ -300,7 +295,7 @@ vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
        double *spc = copyimage->GetSpacing();
        modeltransform->Identity();
 
-    vtkMatrix4x4* matrix = currentmatrix->GetMatrix();
+       vtkMatrix4x4* matrix = currentmatrix->GetMatrix();
        vtkMatrix4x4* matrixmodel = modeltransform->GetMatrix();
        matrixmodel->SetElement(0,0,matrix->GetElement(0,0)/spc[0]);
        matrixmodel->SetElement(1,0,matrix->GetElement(1,0)/spc[0]);
@@ -316,7 +311,6 @@ vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
        matrixmodel->SetElement(2,3,matrix->GetElement(2,3)/spc[2]);    
 
        /*
-       
        double* pos = currentmatrix->GetPosition();
        modeltransform->Translate(pos[0]/spc[0],pos[1]/spc[1],pos[2]/spc[2]);   
 
@@ -329,20 +323,16 @@ vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
        //modeltransform->RotateX(orient[0]);   
        double* orient = currentmatrix->GetOrientationWXYZ();   
        modeltransform->RotateWXYZ(orient[0],orient[1],orient[2],orient[3]);    
-       
        */
-               
 
        modeltransform->Update();
 
        return modeltransform;
-
-       
 }
-void CutModelData::setTransform(vtkTransform* transform, vtkImageData* img)throw( CutModelException){
-               
 
-       double *spc = img->GetSpacing();
+void CutModelData::setTransform(vtkTransform* transform, vtkImageData* img)throw( CutModelException){
+       
+       double *spc = img->GetSpacing();  // spc unused // JPR
 
        currentmatrix->Identity();      
 
@@ -356,7 +346,7 @@ void CutModelData::setTransform(vtkTransform* transform, vtkImageData* img)throw
        currentmatrix->Scale(scal[0]/spc[0],scal[1]/spc[1],scal[2]/spc[2]);
 
        currentmatrix->Update();        */
-               
+
        _boxWidgetVolume->SetTransform(transform);
 
     /*vtkMatrix4x4* matrix = transform->GetMatrix();
@@ -374,11 +364,10 @@ void CutModelData::setTransform(vtkTransform* transform, vtkImageData* img)throw
        matrixcurrent->SetElement(1,3,matrix->GetElement(1,3)/spc[1]);
        matrixcurrent->SetElement(2,3,matrix->GetElement(2,3)/spc[2]);  */
 
-
        udapteActorDirection();
        getModelTransform(img);
-
 }
+
 vtkTransform* CutModelData::getModelTransformInvers(){
        inversModel->Identity ();
        inversModel->Concatenate ( modeltransform );
index 48b10a87b5669b809fe9604050452c472f7a0164..bbcfcf4b9800d08b52bac5e17fc27214364ad3ef 100644 (file)
@@ -41,7 +41,7 @@ double CutModelFigureCube::GetTheoricVolume() // virtual
 }
 
 //----------------------------------------------------------------------------
-char *CutModelFigureCube::GetName() // virtual
+const char *CutModelFigureCube::GetName() // virtual
 {
        return "Cube";
 }
index 31858ccb309aeb0ad3bffb590cd795ae52cd4ea6..474606d46db821fcece1a04bcec2bbb3cbf9c22c 100644 (file)
@@ -12,7 +12,7 @@ public:
        virtual bool    IfPointInside(double x, double y, double z);
        virtual double  GetTheoricVolume();             
        virtual vtkPolyData* getPolyData();
-       virtual char *GetName();
+       virtual const char *GetName();
 private:
        vtkCubeSource* _vtkcube;
 protected:
index 4ef0a77a771e5663ed2431cff678380b60b77218..84e2faf6329572c323c06787d315aa980013c4e7 100644 (file)
@@ -35,7 +35,7 @@ double CutModelFigureCylinder::GetTheoricVolume() // virtual
        return piTMP*(_sx/2)*(_sz/2)*_sy;
 }
 //----------------------------------------------------------------------------
-char *CutModelFigureCylinder::GetName() // virtual
+const char *CutModelFigureCylinder::GetName() // virtual
 {
        return "Cylinder";
 }
index 410a4fad3e3ce9253193899aa850d7e069452e0d..df845e3bd357cb5be3c522bbf4c74949c3fb9496 100644 (file)
@@ -12,7 +12,7 @@ public:
        virtual bool    IfPointInside(double x, double y, double z);
        virtual double  GetTheoricVolume();
        virtual vtkPolyData* getPolyData();
-       virtual char *GetName();
+       virtual const char *GetName();
        
 private:
        vtkCylinderSource* _vtkcylinder;
index a0e1ee58f7381129af7deb2b4b67b1438db44c09..48e4c5360cbb23f1b466d456d058e132277e2970 100644 (file)
@@ -38,7 +38,7 @@ double CutModelFigureSphere::GetTheoricVolume() // virtual
        return (4.0/3.0) * piTMP * (_sx/2)*(_sy/2)*(_sz/2);
 }
 //----------------------------------------------------------------------------
-char *CutModelFigureSphere::GetName() // virtual
+const char *CutModelFigureSphere::GetName() // virtual
 {
        return "Sphere";
 }
index 4ce69c666c7c273157c9a3a104ee29a2ae80c3c8..845146a1c4cc1a6e3dc345f3c806b560f3a35587 100644 (file)
@@ -11,7 +11,7 @@ public:
        virtual ~CutModelFigureSphere();
        virtual bool IfPointInside(double x, double y, double z);
        virtual double  GetTheoricVolume();
-       virtual char *GetName();
+       virtual const char *GetName();
        virtual vtkPolyData* getPolyData();
 private:
        vtkSphereSource* _vtksphere;