]> Creatis software - creaMaracasVisu.git/commitdiff
#3487 vtk9itk5wx3-macos
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Thu, 4 Aug 2022 13:17:21 +0000 (15:17 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Thu, 4 Aug 2022 13:17:21 +0000 (15:17 +0200)
37 files changed:
lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.cxx
lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.cxx
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.h
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h
lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx
lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.h
lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx
lib/maracasVisuLib/src/CutModule/interface/CutModelView.h
lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelData.h
lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h
lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h
lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.cxx
lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.h
lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx
lib/maracasVisuLib/src/kernel/PlaneDirectionManager.h

index 93d7220f2e538b62815ffd9e36c5987a62f5e781..69b42a7313e46c0da4cf36e82a597bc8ce17a155 100644 (file)
@@ -80,35 +80,50 @@ vtkRenderer* wxMaracasSurfaceRenderingManager::getRenderer(){
 /**
 ** Updates volume
 **/
-void wxMaracasSurfaceRenderingManager::Update(int pid)throw(char*){
-       wxMaracasSurfaceRenderingManagerData* data = this->getViewData(pid);    
-       ((wxMaracasSurfaceRenderingManagerDataMhd*)data)->UpdateSurface();
-       _renderer->Render();
+// EED 2022-08-04      
+//void wxMaracasSurfaceRenderingManager::Update(int pid)throw(char *)
+void wxMaracasSurfaceRenderingManager::Update(int pid)
+{
+       try {
+               wxMaracasSurfaceRenderingManagerData* data = this->getViewData(pid);    
+               ((wxMaracasSurfaceRenderingManagerDataMhd*)data)->UpdateSurface();
+               _renderer->Render(); 
+       } catch (...) {
+         throw ;
+       }
 }
 
 /**
 **     Adds a prop3D to the manager and returns the identifier
 **/
-int wxMaracasSurfaceRenderingManager::addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname)  throw(char*){
+// EED 2022-08-04      
+//int wxMaracasSurfaceRenderingManager::addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname)  throw(char*){
+int wxMaracasSurfaceRenderingManager::addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname){
         //checkInvariant();
-       if(prop3D != NULL){
-               wxMaracasSurfaceRenderingManagerData* data = new wxMaracasSurfaceRenderingManagerData(prop3D, dataname, _interactor);
-               prop3Dvect.push_back(data);
-               _renderer->AddActor(data->getProp3D());
-               if(idTP == -1)
-               {
-                       data->setId(_idCount);
-                       _idCount++;
-               }
-               else
+       try {
+               if(prop3D != NULL)
                {
-                       data->setId(idTP);
+                       wxMaracasSurfaceRenderingManagerData* data = new wxMaracasSurfaceRenderingManagerData(prop3D, dataname, _interactor);
+                       prop3Dvect.push_back(data);
+                       _renderer->AddActor(data->getProp3D());
+                       if(idTP == -1)
+                       {
+                               data->setId(_idCount);
+                               _idCount++;
+                       }
+                       else
+                       {
+                               data->setId(idTP);
+                       }
+                       return data->getId();
+               }else{
+                       throw "Check vtkProp3D file or input";
                }
-               return data->getId();
-       }else{
-               throw "Check vtkProp3D file or input";
+               return -1;
+       } catch (...) {
+         throw ;
        }
-       return -1;
+
 }
 
 /**
@@ -139,83 +154,103 @@ int wxMaracasSurfaceRenderingManager::addProp3D(int idTP, std::string filename,
 
 }
 
-int wxMaracasSurfaceRenderingManager::addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*){
-       checkInvariant();
-       if(imagedata != NULL){                
-               image = imagedata;
-               wxMaracasSurfaceRenderingManagerData* data = new wxMaracasSurfaceRenderingManagerDataMhd(imagedata, dataname, _interactor);
-               prop3Dvect.push_back(data);     
-               _renderer->AddActor(data->getProp3D());
-               if(idTP == -1)
-               {
-                       data->setId(_idCount);
-                       _idCount++;
-               }
-               else
-               {
-                       data->setId(idTP);
+// EED 2022-08-04      
+//int wxMaracasSurfaceRenderingManager::addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*){
+int wxMaracasSurfaceRenderingManager::addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) {
+       try{
+               checkInvariant();
+               if(imagedata != NULL){                
+                       image = imagedata;
+                       wxMaracasSurfaceRenderingManagerData* data = new wxMaracasSurfaceRenderingManagerDataMhd(imagedata, dataname, _interactor);
+                       prop3Dvect.push_back(data);     
+                       _renderer->AddActor(data->getProp3D());
+                       if(idTP == -1)
+                       {
+                               data->setId(_idCount);
+                               _idCount++;
+                       }
+                       else
+                       {
+                               data->setId(idTP);
+                       }
+                       printf("wxMaracasSurfaceRenderingManager::addPropMHD->idSurfaceRender: %i\n", data->getId());
+                       return data->getId();
+               }else{
+                       throw "Check ImageData file or input";
                }
-               printf("wxMaracasSurfaceRenderingManager::addPropMHD->idSurfaceRender: %i\n", data->getId());
-               return data->getId();
-       }else{
-               throw "Check ImageData file or input";
-       }
-       return -1;
+               return -1;
+       } catch (...) {
+         throw ;
+       }       
 }
 /**
 **     adds or removes an actor depending of the bool value
 **/
-bool wxMaracasSurfaceRenderingManager::addRemoveActor(int propid, bool addremove)  throw(char*){
-       checkInvariant();
-       
-        wxMaracasSurfaceRenderingManagerData* data = this->getViewData(propid);
-        if(data && data->getProp3D()!=NULL){
-               if(addremove){
-                       _renderer->AddViewProp(data->getProp3D());
-               }else{
-                       _renderer->RemoveViewProp(data->getProp3D());
-               }
-               _renderer->Render();
-                return true;
-        }else {
-            if(addremove && propid == 0 && image){
-                addPropMHD(0, image, "id0");
-                return true;
-            }
-        }
-        return false;
+// EED 2022-08-04      
+//bool wxMaracasSurfaceRenderingManager::addRemoveActor(int propid, bool addremove)  throw(char*){
+bool wxMaracasSurfaceRenderingManager::addRemoveActor(int propid, bool addremove) {
+       try{
+               checkInvariant();
+               
+                   wxMaracasSurfaceRenderingManagerData* data = this->getViewData(propid);
+                   if(data && data->getProp3D()!=NULL){
+                       if(addremove){
+                               _renderer->AddViewProp(data->getProp3D());
+                       }else{
+                               _renderer->RemoveViewProp(data->getProp3D());
+                       }
+                       _renderer->Render();
+                           return true;
+                   }else {
+                       if(addremove && propid == 0 && image){
+                           addPropMHD(0, image, "id0");
+                           return true;
+                       }
+                   }
+                   return false;
+       } catch (...) {
+               throw ;
+       }
 }
 /**
 **     adds or removes the surface box depending of the bool value
 **/
-void wxMaracasSurfaceRenderingManager::addRemoveSurfaceBox(int propid, bool addremove)  throw(char*){
-       checkInvariant();
-       
-       wxMaracasSurfaceRenderingManagerData* data = this->getViewData(propid);         
-       if(data->getProp3D()!=NULL){
-               data->addRemoveSurfaceBox(addremove);
-               /*if(addremove){
-                       data->
-                       _renderer->AddViewProp(data->getProp3D());
-               }else{
-                       _renderer->RemoveViewProp(data->getProp3D());
+// EED 2022-08-04      
+//void wxMaracasSurfaceRenderingManager::addRemoveSurfaceBox(int propid, bool addremove)  throw(char*){
+void wxMaracasSurfaceRenderingManager::addRemoveSurfaceBox(int propid, bool addremove) 
+{
+       try{
+               checkInvariant();       
+               wxMaracasSurfaceRenderingManagerData* data = this->getViewData(propid);         
+               if(data->getProp3D()!=NULL){
+                       data->addRemoveSurfaceBox(addremove);
+                       /*if(addremove){
+                               data->
+                               _renderer->AddViewProp(data->getProp3D());
+                       }else{
+                               _renderer->RemoveViewProp(data->getProp3D());
+                       }
+                       _renderer->Render();*/
                }
-               _renderer->Render();*/
-       }
-       
+       } catch (...) {
+               throw ;
+       }       
 }
 
 /**
 **     Changes the opacity in a prop3D
 **/
-void wxMaracasSurfaceRenderingManager::changeOpacity(int propid, int value)  throw(char*){
-       checkInvariant();       
-
-
-       this->getViewData(propid)->changeOpacity(value);
-       
-       _renderer->Render();
-
+// EED 2022-08-04      
+//void wxMaracasSurfaceRenderingManager::changeOpacity(int propid, int value)  throw(char*){
+void wxMaracasSurfaceRenderingManager::changeOpacity(int propid, int value)  
+{
+       try{
+               checkInvariant();       
+               this->getViewData(propid)->changeOpacity(value);
+               _renderer->Render();
+       } catch (...) {
+               throw ;
+       }       
 }
 
 /**
@@ -223,13 +258,10 @@ void wxMaracasSurfaceRenderingManager::changeOpacity(int propid, int value)  thr
 **/
 void wxMaracasSurfaceRenderingManager::changeIsoValue(int propid, double value ){
        checkInvariant();       
-
        wxMaracasSurfaceRenderingManagerData* data = this->getViewData(propid);         
-
        //_renderer->RemoveActor(data->getProp3D());
        ((wxMaracasSurfaceRenderingManagerDataMhd*)data)->changeIsoValue(value);
        //_renderer->AddActor(data->getProp3D());
-
        _renderer->Render();
 }
 
@@ -238,13 +270,10 @@ void wxMaracasSurfaceRenderingManager::changeIsoValue(int propid, double value )
 **/
 void wxMaracasSurfaceRenderingManager::changeIsoValue(int propid, double min, double max ){
         checkInvariant();
-
         wxMaracasSurfaceRenderingManagerData* data = this->getViewData(propid);
-
         //_renderer->RemoveActor(data->getProp3D());
         ((wxMaracasSurfaceRenderingManagerDataMhd*)data)->changeIsoValue(min, max);
         //_renderer->AddActor(data->getProp3D());
-
         _renderer->Render();
 }
 
@@ -282,9 +311,10 @@ void wxMaracasSurfaceRenderingManager::changeIsoValue(int propid, double min, do
        return NULL;
 }*/
 
-vtkImageData* wxMaracasSurfaceRenderingManager::getImageData(std::string filename){
-       if(filename.compare("")!= 0){   
-               
+vtkImageData* wxMaracasSurfaceRenderingManager::getImageData(std::string filename)
+{
+       if(filename.compare("")!= 0)
+       {               
                vtkMetaImageReader* reader =  vtkMetaImageReader::New();        
                reader->SetFileName(filename.c_str());
                reader->Update();
@@ -295,76 +325,108 @@ vtkImageData* wxMaracasSurfaceRenderingManager::getImageData(std::string filenam
        return NULL;
 }
 
-vtkImageData* wxMaracasSurfaceRenderingManager::getImageData(){
+vtkImageData* wxMaracasSurfaceRenderingManager::getImageData()
+{
        return image;
 }
 
-void wxMaracasSurfaceRenderingManager::setImageData(vtkImageData* img){
+void wxMaracasSurfaceRenderingManager::setImageData(vtkImageData* img)
+{
     image = img;
 }
 
-void wxMaracasSurfaceRenderingManager::checkInvariant()  throw(char*){
-       if(this->_renderer==NULL){
-               throw "Renderer not set";
-       }
+// EED 2022-08-04      
+//void wxMaracasSurfaceRenderingManager::checkInvariant()  throw(char*)
+void wxMaracasSurfaceRenderingManager::checkInvariant()  
+{
+       try{
+               if(this->_renderer==NULL)
+               {
+                       throw "Renderer not set";
+               }
+       } catch (...) {
+               throw ;
+       }       
 }
 
-wxMaracasSurfaceRenderingManagerData* wxMaracasSurfaceRenderingManager::getViewData(int id) throw(char*){
-    int i = 0;
-    for(i = 0; i < (int)(prop3Dvect.size());i++){
-            if(prop3Dvect[i]->getId() == id){
-                    return prop3Dvect[i];
-            }
-    }    
-#ifndef USE_QT
-    throw "id not found in the data";
-#else
-    return 0;
-#endif
-
-
+// EED 2022-08-04      
+//wxMaracasSurfaceRenderingManagerData* wxMaracasSurfaceRenderingManager::getViewData(int id) throw(char*)
+wxMaracasSurfaceRenderingManagerData* wxMaracasSurfaceRenderingManager::getViewData(int id) 
+{
+       try{
+               int i = 0;
+               for(i = 0; i < (int)(prop3Dvect.size());i++){
+                       if(prop3Dvect[i]->getId() == id){
+                               return prop3Dvect[i];
+                       }
+               }    
+       #ifndef USE_QT
+               throw "id not found in the data";
+       #else
+               return 0;
+       #endif
+       } catch (...) {
+               throw ;
+       }       
 }
 
-int wxMaracasSurfaceRenderingManager::getMaxIsoValue(int propid) throw(char*){
-       
-       return ((wxMaracasSurfaceRenderingManagerDataMhd*)this->getViewData(propid))->getMaxGreyLevel();
-
+// EED 2022-08-04      
+//int wxMaracasSurfaceRenderingManager::getMaxIsoValue(int propid) throw(char*)
+int wxMaracasSurfaceRenderingManager::getMaxIsoValue(int propid) 
+{      
+       try{
+               return ((wxMaracasSurfaceRenderingManagerDataMhd*)this->getViewData(propid))->getMaxGreyLevel();
+       } catch (...) {
+               throw ;
+       }       
 }
 
-void wxMaracasSurfaceRenderingManager::changeColor(int propid, double red, double green, double blue) throw(char*){
-       checkInvariant();       
-       this->getViewData(propid)->changeColor(red, green, blue);
-
-       _renderer->Render();
+// EED 2022-08-04      
+//void wxMaracasSurfaceRenderingManager::changeColor(int propid, double red, double green, double blue) throw(char*)
+void wxMaracasSurfaceRenderingManager::changeColor(int propid, double red, double green, double blue)
+{
+       try{
+               checkInvariant();       
+               this->getViewData(propid)->changeColor(red, green, blue);
+               _renderer->Render();
+       } catch (...) {
+               throw ;
+       }       
+               
 }
 
-void wxMaracasSurfaceRenderingManager::deleteActor(int propid) throw (char *){
-       checkInvariant();       
-
-       this->addRemoveActor(propid, false);
-
-       int i,n;
-       bool exit = false;
-       for(i = 0; i < (int)(prop3Dvect.size())&&!exit;i++){
-               if(prop3Dvect[i]->getId() == propid){                   
-                       n=i;
-                       exit = true;
+// EED 2022-08-04      
+//void wxMaracasSurfaceRenderingManager::deleteActor(int propid) throw (char *)
+void wxMaracasSurfaceRenderingManager::deleteActor(int propid) 
+{
+       try{
+               checkInvariant();       
+               this->addRemoveActor(propid, false);
+               int i,n;
+               bool exit = false;
+               for(i = 0; i < (int)(prop3Dvect.size())&&!exit;i++){
+                       if(prop3Dvect[i]->getId() == propid){                   
+                               n=i;
+                               exit = true;
+                       }
                }
-       }
-       if(exit){
-               wxMaracasSurfaceRenderingManagerData* data = prop3Dvect[n];                     
-               int j;
-               for(j = i; j < (int)(prop3Dvect.size())-1;j++){
-                       prop3Dvect[j] = prop3Dvect[j+1];
-               }               
-               delete data;
-               prop3Dvect.pop_back();
-       }else{
-#ifndef USE_QT
-                throw "id not found in the data";
-#endif
-
-       }   
+               if(exit){
+                       wxMaracasSurfaceRenderingManagerData* data = prop3Dvect[n];                     
+                       int j;
+                       for(j = i; j < (int)(prop3Dvect.size())-1;j++){
+                               prop3Dvect[j] = prop3Dvect[j+1];
+                       }               
+                       delete data;
+                       prop3Dvect.pop_back();
+               }else{
+       #ifndef USE_QT
+                           throw "id not found in the data";
+       #endif
+               } 
+       } catch (...) {
+               throw ;
+       }       
+         
 }
 
 void wxMaracasSurfaceRenderingManager::enableBoundingBox(int propid, bool enable){
index 34f0b736d5b0aea176c05038befcaf3c7bdfe0b3..6ea94bd18e5f37cb095b7c2ef07802c80abec572 100644 (file)
@@ -49,6 +49,7 @@
 #include <iostream>
 #include <vector>
 
+
 //EED 2022-07-21
 //#include <vtkMatrix4x4.h>
 
@@ -56,7 +57,6 @@
 
 
 
-
 class wxMaracasSurfaceRenderingManager  {
 
 public:
@@ -76,12 +76,16 @@ public:
        /**
        ** Updates surface
        **/
-       void Update(int pid)throw(char*);
+//     void Update(int pid)throw(char*);
+//     void Update(int pid)throw(int);
+       void Update(int pid);
        
        /**
        **      Adds a prop3D to the manager and returns the identifier
        **/
-       int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
+// EED 2022-08-04      
+//     int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname) throw (char*);
+       int addProp3D(int idTP, vtkProp3D* prop3D, std::string dataname);
 
         /**
         **     Adds a polydata and creates the prop3D (actor) to the manager and returns the identifier
@@ -91,11 +95,15 @@ public:
        /**
        **      Adds a prop3D to the manager and returns the identifier
        **/
-       int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
+// EED 2022-08-04      
+//     int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) throw(char*);
+       int addPropMHD(int idTP, vtkImageData* imagedata, std::string dataname) ;
        /**
        **      Changes the opacity in a prop3D
        **/
-       void changeOpacity(int propid, int value)throw(char*);
+// EED 2022-08-04      
+//     void changeOpacity(int propid, int value)throw(char*);
+       void changeOpacity(int propid, int value);
 
        /**
        **      changes the isovalue in a prop3D
@@ -124,21 +132,29 @@ public:
        /**
        **      adds or removes an actor depending of the bool value
        **/
-        bool addRemoveActor(int propid, bool addremove)throw(char*);
+// EED 2022-08-04      
+//        bool addRemoveActor(int propid, bool addremove)throw(char*);
+        bool addRemoveActor(int propid, bool addremove);
        /**
        **
        **/
-       void addRemoveSurfaceBox(int propid, bool addremove)  throw(char*);
+// EED 2022-08-04      
+//     void addRemoveSurfaceBox(int propid, bool addremove)  throw(char*);
+       void addRemoveSurfaceBox(int propid, bool addremove);
        /**
        **      Check if the variables are setted correctly
        **/
 
-       void checkInvariant()throw(char*);
+// EED 2022-08-04      
+//     void checkInvariant()throw(char*);
+       void checkInvariant();
 
        /**
        **      Given an id search the data in the vector
        **/
-       wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
+// EED 2022-08-04      
+//     wxMaracasSurfaceRenderingManagerData* getViewData(int id)throw(char*);
+       wxMaracasSurfaceRenderingManagerData* getViewData(int id);
 
        /**
        **
@@ -148,15 +164,21 @@ public:
        /**
        **      Given the id, return the max iso value from the imagedata
        **/
-       int getMaxIsoValue(int propid)throw(char*);
+// EED 2022-08-04      
+//     int getMaxIsoValue(int propid)throw(char*);
+       int getMaxIsoValue(int propid);
 
 
        /**
        **      Changes the color of the actor
        **/
-       void changeColor(int propid, double red, double green, double blue) throw(char*);
+// EED 2022-08-04      
+//     void changeColor(int propid, double red, double green, double blue) throw(char*);
+       void changeColor(int propid, double red, double green, double blue);
 
-       void deleteActor(int propid)throw (char *);
+// EED 2022-08-04      
+//     void deleteActor(int propid)throw (char *);
+       void deleteActor(int propid);
 
        void Transform(vtkMatrix4x4* tmatrix);
 
index 1678768c46e24e734c62821b28765b89f090f1ec..dfe4d3ac74cd6226c5cef5f3722c762fdca278c9 100644 (file)
@@ -376,7 +376,12 @@ void VolumeRendererManager::GetImages(vtkImageData* img, vector<vtkImageData* >&
 /**
 **     Adds a prop3D to the manager and returns the identifier
 **/
-int VolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string dataname) throw(char*){
+
+// EED 2022-08-04       C++17 throw
+//int VolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string dataname) throw(char*)
+int VolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string dataname) 
+{
+       try {
         checkInvariant();
         image = vol;
         if(vol != NULL){
@@ -397,15 +402,21 @@ int VolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string da
         }else{
                 throw "Check mhd imagefile file or input";
         }
-        return -1;
+        return -1;        
+       } catch (...) {
+         throw ;
+       }           
 }
 /**
 **     adds or removes an actor depending of the bool value
 **/
 
-void VolumeRendererManager::addRemoveActor(int propid, bool addremove)  throw(char*){
+// EED 2022-08-04       C++17 throw
+//void VolumeRendererManager::addRemoveActor(int propid, bool addremove)  throw(char*)
+void VolumeRendererManager::addRemoveActor(int propid, bool addremove)  
+{
+       try {
         checkInvariant();
-
         VolumeRendererManagerData* data = this->getViewData(propid);
         if(data->getProp3D()!=NULL){
                 if(addremove){
@@ -415,51 +426,59 @@ void VolumeRendererManager::addRemoveActor(int propid, bool addremove)  throw(ch
                 }
                 _renderer->Render();
         }
-
+       } catch (...) {
+         throw ;
+       }           
 }
 /**
 **     Changes the opacity in a prop3D
 **/
-void VolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value)  throw(char*){
-       checkInvariant();
-
-       printf("EED VolumeRendererManager::setVolumeOpacity %d\n",propid);
-       
-       VolumeRendererManagerData* volrenman = this->getViewData(propid);
-       if (volrenman!=NULL) 
-       {
-        volrenman->setVolumeOpacity(greylevel, value);
-       } else {
-               printf("EED  VolumeRendererManager::setVolumeOpacity  Warning volrenman NULL\n");
-       }
-       
-        _renderer->Render();
-
+// EED 2022-08-04       C++17 throw
+//void VolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value)  throw(char*)
+void VolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) 
+{
+       try {
+               checkInvariant();       
+               VolumeRendererManagerData* volrenman = this->getViewData(propid);
+               if (volrenman!=NULL) 
+               {
+                   volrenman->setVolumeOpacity(greylevel, value);
+               } else {
+                       printf("EED  VolumeRendererManager::setVolumeOpacity  Warning volrenman NULL\n");
+               }
+               _renderer->Render();
+       } catch (...) {
+         throw ;
+       }           
 }
 
 /**
 **     Set Volume Color
 **/
 
+// EED 2022-08-04       C++17 throw
+//void VolumeRendererManager::setVolumeColor(int volid, std::vector<double> greylevel,
+//                                                                std::vector<double> red,
+//                                                                std::vector<double> green,
+//                                                                std::vector<double> blue)throw(char*)
 void VolumeRendererManager::setVolumeColor(int volid, std::vector<double> greylevel,
                                                                 std::vector<double> red,
                                                                 std::vector<double> green,
-                                                                std::vector<double> blue)throw(char*){
-       printf("EED VolumeRendererManager::setVolumeColor  start \n");
-       checkInvariant();
-
-       printf("EED VolumeRendererManager::setVolumeColor %d\n",volid);
-       
-       VolumeRendererManagerData* volrenman = this->getViewData(volid);
-       if (volrenman!=NULL) 
-       {
-               this->getViewData(volid)->setVolumeColor(greylevel, red, green, blue);
-       } else {
-               printf("EED  VolumeRendererManager::setVolumeColor  Warning volrenman NULL\n");
-       }
-
-       _renderer->Render();
-       printf("EED VolumeRendererManager::setVolumeColor  end \n");
+                                                                std::vector<double> blue)
+{                                                                
+       try {
+               checkInvariant();
+               VolumeRendererManagerData* volrenman = this->getViewData(volid);
+               if (volrenman!=NULL) 
+               {
+                       this->getViewData(volid)->setVolumeColor(greylevel, red, green, blue);
+               } else {
+                       printf("EED  VolumeRendererManager::setVolumeColor  Warning volrenman NULL\n");
+               }
+               _renderer->Render();
+       } catch (...) {
+         throw ;
+       }           
 }
 
 vtkImageData* VolumeRendererManager::getImageData(std::string filename){
@@ -492,34 +511,49 @@ vtkImageData* VolumeRendererManager::getImageData(){
         return image;
 }
 
-void VolumeRendererManager::checkInvariant()  throw(char*){
-       printf("EED VolumeRendererManager::checkInvariant start\n");
-       if(this->_renderer==NULL){
-                throw "Renderer not set";
-        }
-       printf("EED VolumeRendererManager::checkInvariant end \n");
+// EED 2022-08-04       C++17 throw
+//void VolumeRendererManager::checkInvariant()  throw(char*)
+void VolumeRendererManager::checkInvariant()  
+{
+       try{
+               if(this->_renderer==NULL)
+               {
+                           throw "Renderer not set";
+               }
+       } catch (...) {
+         throw ;
+       }           
 }
 
-VolumeRendererManagerData* VolumeRendererManager::getViewData(int id) throw(char*){
-    int i;
-        for(i = 0; i < (int)(prop3Dvect.size());i++){
-                if(prop3Dvect[i]->getId() == id){
-                        return prop3Dvect[i];
-                }
-        }
-        throw "id not found in the data";
-
-        return NULL;
+// EED 2022-08-04       C++17 throw
+//VolumeRendererManagerData* VolumeRendererManager::getViewData(int id) throw(char*)
+VolumeRendererManagerData* VolumeRendererManager::getViewData(int id) 
+{
+       try{
+               int i;
+               for(i = 0; i < (int)(prop3Dvect.size());i++){
+                       if(prop3Dvect[i]->getId() == id){
+                               return prop3Dvect[i];
+                       }
+               }
+               throw "id not found in the data";
+               return NULL;
+       } catch (...) {
+         throw ;
+       }           
 }
 
-void VolumeRendererManager::deleteActor(int propid) throw (char *){
+// EED 2022-08-04       C++17 throw
+//void VolumeRendererManager::deleteActor(int propid) throw (char *)
+void VolumeRendererManager::deleteActor(int propid) 
+{
+       try{
         checkInvariant();
-
         this->addRemoveActor(propid, false);
-
         int i,n;
         bool exit = false;
-        for(i = 0; i < (int)(prop3Dvect.size())&&!exit;i++){
+        for(i = 0; i < (int)(prop3Dvect.size())&&!exit;i++)
+        {
                 if(prop3Dvect[i]->getId() == propid){
                         n=i;
                         exit = true;
@@ -528,7 +562,8 @@ void VolumeRendererManager::deleteActor(int propid) throw (char *){
         if(exit){
                 VolumeRendererManagerData* data = prop3Dvect[n];
                 int j;
-                for(j = i; j < (int)(prop3Dvect.size())-1;j++){
+                for(j = i; j < (int)(prop3Dvect.size())-1;j++)
+                {
                         prop3Dvect[j] = prop3Dvect[j+1];
                 }
                 delete data;
@@ -536,24 +571,37 @@ void VolumeRendererManager::deleteActor(int propid) throw (char *){
         }else{
                 throw "id not found in the data";
         }
+       } catch (...) {
+         throw ;
+       }           
 
 }
 
-vtkPiecewiseFunction* VolumeRendererManager::GetTransferFunction(int volumeid){
+vtkPiecewiseFunction* VolumeRendererManager::GetTransferFunction(int volumeid)
+{
         return getViewData(volumeid)->GetTransferFunction();
 }
-vtkColorTransferFunction* VolumeRendererManager::GetColorFunction(int volumeid){
 
+vtkColorTransferFunction* VolumeRendererManager::GetColorFunction(int volumeid)
+{
         return getViewData(volumeid)->GetColorFunction();
 }
 
-void VolumeRendererManager::changeCompositeMIPFunction(int id, int function) throw (char *){
-    if(id == -1){
-        for(unsigned i = 0; i < prop3Dvect.size(); i++)
-            prop3Dvect[i]->changeCompositeMIPFunction(function);
-    }else{
-        getViewData(id)->changeCompositeMIPFunction(function);
-    }
+// EED 2022-08-04       C++17 throw
+//void VolumeRendererManager::changeCompositeMIPFunction(int id, int function) throw (char *)
+void VolumeRendererManager::changeCompositeMIPFunction(int id, int function) 
+{
+       try{
+               if(id == -1)
+               {
+                   for(unsigned i = 0; i < prop3Dvect.size(); i++)
+                       prop3Dvect[i]->changeCompositeMIPFunction(function);
+               }else{
+                   getViewData(id)->changeCompositeMIPFunction(function);
+               }
+       } catch (...) {
+         throw ;
+       }                       
 }
 
 /**
@@ -561,11 +609,15 @@ void VolumeRendererManager::changeCompositeMIPFunction(int id, int function) thr
   type == 0 for linear interpolation
   type == 1 for nearest interpolation
   */
-void VolumeRendererManager::changeInterpolationType(int type, int propid){
-    if(propid == -1){
+void VolumeRendererManager::changeInterpolationType(int type, int propid)
+{
+    if(propid == -1)
+    {
         for(unsigned i = 0; i < prop3Dvect.size(); i++)
+        {
             prop3Dvect[i]->changeInterpolationType(type);
-    }else{
+        } // for i
+    } else {
         getViewData(propid)->changeInterpolationType(type);
     }
 }
@@ -601,29 +653,40 @@ vector< vtkProp3D* > VolumeRendererManager::getProps3D(){
   *  @param std::vector<double> value, the corresponding value for the opacity
   *  @param int propid, the correspoding id, by default it applies the changes to the first volume in the array
   */
-void VolumeRendererManager::setVolumeOpacity(std::vector<double> greylevel, std::vector<double> value, int propid){
-    if(propid == -1){
+void VolumeRendererManager::setVolumeOpacity(std::vector<double> greylevel, std::vector<double> value, int propid)
+{
+    if(propid == -1)
+    {
         for(unsigned i = 0; i < prop3Dvect.size(); i++)
+        {
             prop3Dvect[i]->setVolumeOpacity(greylevel, value);
+        } // for i
     }else{
         getViewData(propid)->setVolumeOpacity(greylevel, value);
     }
 }
 
-void VolumeRendererManager::EnableBoundingBox(vtkRenderWindowInteractor* interactor, int propid){
-    if(propid == -1){
+void VolumeRendererManager::EnableBoundingBox(vtkRenderWindowInteractor* interactor, int propid)
+{
+    if(propid == -1)
+    {
         for(unsigned i = 0; i < prop3Dvect.size(); i++)
+               {
             prop3Dvect[i]->EnableBoundingBox(interactor);
+        } // for i
     }else{
         getViewData(propid)->EnableBoundingBox(interactor);
     }
 }
 
-void VolumeRendererManager::DisableBoundingBox(int propid){
-
-    if(propid == -1){
+void VolumeRendererManager::DisableBoundingBox(int propid)
+{
+    if(propid == -1)
+    {
         for(unsigned i = 0; i < prop3Dvect.size(); i++)
+        {
             prop3Dvect[i]->DisableBoundingBox();
+        } // for i
     }else{
         getViewData(propid)->DisableBoundingBox();
     }
index 5556f1cddaf8bf7ab0d1e5b0004e19f76718616f..de7aa1b0a367d49d1c7b28d4518fae31948bb5bc 100644 (file)
@@ -72,7 +72,9 @@ public:
         /**
         **     Adds a volume
         **/
-        int addVolume(int idTP, vtkImageData* img, std::string dataname) throw (char*);
+// EED 2022-08-04      
+//        int addVolume(int idTP, vtkImageData* img, std::string dataname) throw (char*);
+        int addVolume(int idTP, vtkImageData* img, std::string dataname);
 
         /**
         * @pre   The image can have one or multiple components per voxel, and volume rendering is performed seprately over the
@@ -104,36 +106,53 @@ public:
         /**
         **     adds or removes an actor depending of the bool value
         **/
-        void addRemoveActor(int propid, bool addremove) throw(char*);
+// EED 2022-08-04      
+//        void addRemoveActor(int propid, bool addremove) throw(char*);
+        void addRemoveActor(int propid, bool addremove);
 
         /**
         **     Check if the variables are setted correctly
         **/
-        void checkInvariant()throw(char*);
+// EED 2022-08-04      
+//        void checkInvariant()throw(char*);
+        void checkInvariant();
 
         /**
         ** Set Volume Opacity
         **/
-        void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*);
+// EED 2022-08-04      
+//        void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*);
+        void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value);
         /**
         **     Set Volume Color
         **/
-        void setVolumeColor(int volid, std::vector<double> greylevel,
+// EED 2022-08-04      
+//        void setVolumeColor(int volid, std::vector<double> greylevel,
+//                                                                        std::vector<double> red,
+//                                                                        std::vector<double> green,
+//                                                                        std::vector<double> blue)throw(char*);
+       void setVolumeColor(int volid, std::vector<double> greylevel,
                                                                         std::vector<double> red,
                                                                         std::vector<double> green,
-                                                                        std::vector<double> blue)throw(char*);
+                                                                        std::vector<double> blue);
 
         /**
         ** Given an id search the data in the vector
         **/
-        VolumeRendererManagerData* getViewData(int id)throw(char*);
+// EED 2022-08-04      
+//        VolumeRendererManagerData* getViewData(int id)throw(char*);
+        VolumeRendererManagerData* getViewData(int id);
 
-        void changeCompositeMIPFunction(int id, int function) throw (char *);
+// EED 2022-08-04      
+//        void changeCompositeMIPFunction(int id, int function) throw (char *);
+        void changeCompositeMIPFunction(int id, int function);
 
         /**
         ** Deletes given actor
         **/
-        void deleteActor(int volumeid)throw (char *);
+// EED 2022-08-04      
+//        void deleteActor(int volumeid)throw (char *);
+        void deleteActor(int volumeid);
 
         /**
         ** Updates given volume
index 6db6e9142886ae10494201d18cbf4231f2d27826..7d81953e631ad3bf2e688ac7d8b58f2cd7c71458 100644 (file)
@@ -341,24 +341,30 @@ void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,d
 /**
 **     Check if the variables are setted correctly
 **/
-void VolumeRendererManagerData::checkInvariant()throw (char *)
+// EED 2022-08-04      throw
+//void VolumeRendererManagerData::checkInvariant()throw (char *)
+void VolumeRendererManagerData::checkInvariant()
 {
-#if (VTK_MAJOR_VERSION <= 7) 
-       if(!_compositeFunction)
-       {
-               throw "No composite function initialized";
-       }
-    if(!_MIPFunction)
-       {
-               throw "No MIP function initialized";
+       try {
+               #if (VTK_MAJOR_VERSION <= 7) 
+                       if(!_compositeFunction)
+                       {
+                               throw "No composite function initialized";
+                       }
+                       if(!_MIPFunction)
+                       {
+                               throw "No MIP function initialized";
+                       }
+               #else 
+                       // ..
+               #endif
+
+                   if(!VolumeMapper){
+                           throw "No volume mapper initialized";
+                   }
+       } catch (...) {
+         throw ;
        }
-#else 
-       // ..
-#endif
-
-        if(!VolumeMapper){
-                throw "No volume mapper initialized";
-        }
 }
 
 
index c4a8c2b2d0d756f68433d78c51e319993c222700..46893224f7ff38e06e380dfe0110e1f530c50cf9 100644 (file)
@@ -106,7 +106,9 @@ public:
         /**
         **     Check if the variables are setted correctly
         **/
-        void checkInvariant()throw (char *);
+// EED 2022-08-04      
+//        void checkInvariant()throw (char *);
+        void checkInvariant();
 
         /**
         ** Updates volume
index c1a3dfd8e8aa83747bc67e0b76d5f8854a22ea96..0562da600cce57fa8518fa6d876cd4b539d6d649 100644 (file)
@@ -135,21 +135,30 @@ void CutModelMainPanel::setRenderer(vtkRenderer* renderer){
        }
 }
 
-void CutModelMainPanel::checkInvariant()throw (CutModelException){
-       if(cutmanager==NULL){
-               throw CutModelException("The manager is not initialize");
+// EED 2022-08-04      throw
+//void CutModelMainPanel::checkInvariant()throw (CutModelException)
+void CutModelMainPanel::checkInvariant()
+{
+       try {
+               if(cutmanager==NULL)
+               {
+                       throw CutModelException("The manager is not initialize");
+               }
+       } catch (...) {
+         throw ;
        }
 }
 
-void CutModelMainPanel::showErrorDialog(std::string str){
+void CutModelMainPanel::showErrorDialog(std::string str)
+{
        wxMessageDialog* diag = new wxMessageDialog(this, wxString(str.c_str(),wxConvUTF8 ), wxString(str.c_str(),wxConvUTF8 ), wxICON_ERROR);
        diag->ShowModal();
 }
 
-void CutModelMainPanel::RemoveActor(int id){
+void CutModelMainPanel::RemoveActor(int id)
+{
        try{
                checkInvariant();
-
                if(!this->IsBeingDeleted()){
                        int i,j;
                        for(i = 0; i < (int)viewpanels.size()-1;i++){
@@ -164,33 +173,29 @@ void CutModelMainPanel::RemoveActor(int id){
                        viewpanels.pop_back();
                        cutmanager->RemoveActor(id);
                }
-
        }catch(CutModelException e){
                showErrorDialog(e.getCause());
        }
 }
 
 //RaC
-void CutModelMainPanel::onCheckChanged(){
-
-       if(_isFirstTime==true){
+void CutModelMainPanel::onCheckChanged()
+{
+       if(_isFirstTime==true)
+       {
                _isFirstTime=false;
                cutmanager->InitializePolygonInteractorStyle();
        }
-
        if(_isCheck==false)
        {
                _isCheck=true;
                //Draw Polygon
-
                cutmanager->ParallelProjectionOn();
                btnExecutePolygonCut->Enable(false);
                _notebook->GetPage(0)->Enable(false);
                _radioinsideout->Enable(false);
                lblMessagePolygon->SetLabel(_T("Drawing polygon..."));
-       }
-       else
-       {
+       } else {
                _isCheck=false;
                //Finish Drawing
                cout<<"Finish Drawing"<<endl;
@@ -200,12 +205,9 @@ void CutModelMainPanel::onCheckChanged(){
                _radioinsideout->Enable(true);
                lblMessagePolygon->SetLabel(_T("Contour saved! Click on Execute Cut"));
        }
-
        cutmanager->UpdatePolygon(_isCheck);
-
 }
 
-
 //RaC
 void CutModelMainPanel::onExecuteCutPolygon()
 {
@@ -214,18 +216,14 @@ void CutModelMainPanel::onExecuteCutPolygon()
        lblMessagePolygon->SetLabel(_T("No contour drawed"));
 }
 
-
-void CutModelMainPanel::onAddCutModel(){
+void CutModelMainPanel::onAddCutModel()
+{
        try{
                checkInvariant();
-
                int id = addNewViewPanel();
                cutmanager->onAddCutModel(id, getModelView(id));
-
                _panelid++;
-
                ShowCurrentPanel(id);
-
        }catch(CutModelException e){
                showErrorDialog(e.getCause());
        }
@@ -244,41 +242,50 @@ void CutModelMainPanel::ShowCurrentPanel(int id)
        }
        _wxauimanager->Update();
 }
-int CutModelMainPanel::addNewViewPanel()throw( CutModelException){
-
-       CutModelView* viewpanel = new CutModelView(this,cutmanager->getImageRange());
-
-       wxAuiPaneInfo paneinfo0;
-       _wxauimanager->AddPane(viewpanel, paneinfo0.DefaultPane().DestroyOnClose().Centre().Bottom());
-
-       viewpanel->setId(_panelid);
-       viewpanels.push_back(viewpanel);
-
-       return viewpanel->getId();
-
 
+// EED 2022-08-04      throw
+//int CutModelMainPanel::addNewViewPanel()throw( CutModelException)
+int CutModelMainPanel::addNewViewPanel()
+{
+       try {
+               CutModelView* viewpanel = new CutModelView(this,cutmanager->getImageRange());
+               wxAuiPaneInfo paneinfo0;
+               _wxauimanager->AddPane(viewpanel, paneinfo0.DefaultPane().DestroyOnClose().Centre().Bottom());
+               viewpanel->setId(_panelid);
+               viewpanels.push_back(viewpanel);
+               return viewpanel->getId();
+       } catch (...) {
+         throw ;
+       }
 }
-CutModelView* CutModelMainPanel::getModelView(int id)throw( CutModelException)
+
+// EED 2022-08-04      throw
+//CutModelView* CutModelMainPanel::getModelView(int id)throw( CutModelException)
+CutModelView* CutModelMainPanel::getModelView(int id)
 {
-       CutModelView* current = NULL;
-       int i;
-       for(i = 0; i < (int)viewpanels.size();i++)
-       {
-               if(viewpanels[i]->getId()==id)
+       try {
+               CutModelView* current = NULL;
+               int i;
+               for(i = 0; i < (int)viewpanels.size();i++)
                {
-                       current = viewpanels[i];
+                       if(viewpanels[i]->getId()==id)
+                       {
+                               current = viewpanels[i];
+                       }
                }
+               if(current == NULL)
+               {
+                       std::string s = "Id not found";
+                       throw CutModelException(s);
+               }
+               return current;
+       } catch (...) {
+         throw ;
        }
-       if(current == NULL)
-       {
-               std::string s = "Id not found";
-               throw CutModelException(s);
-       }
-       return current;
 }
 
 void CutModelMainPanel::onUndo()
-       {
+{
        try{
                checkInvariant();
                /*int result = */ cutmanager->Undo(); // result unused// JPR
@@ -318,12 +325,13 @@ void CutModelMainPanel::ShowViewBox(int id,bool check){
        }
 }
 
-void CutModelMainPanel::ShowPopUpMenu(int id){
+void CutModelMainPanel::ShowPopUpMenu(int id)
+{
        showErrorDialog("test");
 }
 
-void CutModelMainPanel::changeColor(int id,double r,double g,double b){
-
+void CutModelMainPanel::changeColor(int id,double r,double g,double b)
+{
        try{
                checkInvariant();
                cutmanager->changeColor(id, r, g, b);
@@ -333,7 +341,8 @@ void CutModelMainPanel::changeColor(int id,double r,double g,double b){
        }
 }
 
-void CutModelMainPanel::ChangeShape(int id,int selection){
+void CutModelMainPanel::ChangeShape(int id,int selection)
+{
        try{
                checkInvariant();
 
@@ -343,7 +352,9 @@ void CutModelMainPanel::ChangeShape(int id,int selection){
                showErrorDialog(e.getCause());
        }
 }
-void CutModelMainPanel::updateActorDirection(int id){
+
+void CutModelMainPanel::updateActorDirection(int id)
+{
        try{
                checkInvariant();
 
@@ -354,7 +365,8 @@ void CutModelMainPanel::updateActorDirection(int id){
        }
 }
 
-void CutModelMainPanel::ExecuteCut(int id, double* range, bool isinside){
+void CutModelMainPanel::ExecuteCut(int id, double* range, bool isinside)
+{
        try{
                checkInvariant();
 
@@ -364,14 +376,16 @@ void CutModelMainPanel::ExecuteCut(int id, double* range, bool isinside){
        }
 }
 
-void CutModelMainPanel::ExecuteAll(){
+void CutModelMainPanel::ExecuteAll()
+{
        int i;
        for(i = 0; i < (int)viewpanels.size(); i++){
                viewpanels[i]->ExecuteCut();
        }
 }
 
-vtkImageData* CutModelMainPanel::GetResultImage(){
+vtkImageData* CutModelMainPanel::GetResultImage()
+{
        try{
                checkInvariant();
                return cutmanager->GetResultImage();
@@ -381,67 +395,66 @@ vtkImageData* CutModelMainPanel::GetResultImage(){
        return NULL;
 }
 
-void CutModelMainPanel::ShowStatistics(int id){
-
+void CutModelMainPanel::ShowStatistics(int id)
+{
        checkInvariant();
        HistogramDialog *histo = new HistogramDialog(this, _T("Statistics"));
-
        histo->initializeHistogram(cutmanager->GetResultImage());
-
        histo->ShowModal();
-
        delete histo;
 }
 
-void CutModelMainPanel::SaveCutModelData(std::string filename){
+void CutModelMainPanel::SaveCutModelData(std::string filename)
+{
        cutmanager->SaveCutModelData(filename);
 }
 
-void CutModelMainPanel::LoadCutModelData(std::string filename){
+void CutModelMainPanel::LoadCutModelData(std::string filename)
+{
        cutmanager->LoadCutModelData(filename);
 }
 
-void CutModelMainPanel::SetType(int type){
+void CutModelMainPanel::SetType(int type)
+{
        _type = type;
 }
 
-int CutModelMainPanel::GetType(){
+int CutModelMainPanel::GetType()
+{
        return _type;
 }
 
-void CutModelMainPanel::addPolygonCutterTab(){
+void CutModelMainPanel::addPolygonCutterTab()
+{
        wxPanel *panel = new wxPanel(_notebook);
        panel->SetAutoLayout(true);
        wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
        panel->SetSizer(sizer);
        sizer->AddSpacer(20);
-
        wxCheckBox *item = new wxCheckBox(panel,10,_T("Draw Polygon"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,_T("") );
        item->SetValue(false);
        Connect(item->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)(&PolygonCutterEventHandlerCutModel::onCheckChanged));
        sizer->Add(item, 0, wxALIGN_LEFT);
-
        lblMessagePolygon = new wxStaticText(panel,30,_T("No contour drawed"),wxDefaultPosition,wxDefaultSize,0,_T("") );
        sizer->Add(lblMessagePolygon, 0, wxALIGN_LEFT);
-
        wxString choices0[2];
        choices0[0] = _T("inside");
        choices0[1] = _T("outside");
        _radioinsideout = new  wxRadioBox(panel,-1,_T(""), wxDefaultPosition, wxDefaultSize,2,choices0);
        sizer->Add(_radioinsideout, wxALIGN_LEFT);
-
        btnExecutePolygonCut = new wxButton(panel,20,_T("Execute Cut"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,_T("") );
        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){
+void PolygonCutterEventHandlerCutModel::onCheckChanged(wxCommandEvent& event)
+{
        CutModelMainPanel::getInstance()->onCheckChanged();
 }
 
-void PolygonCutterEventHandlerCutModel::onExecuteCutPolygon(wxCommandEvent& event){
+void PolygonCutterEventHandlerCutModel::onExecuteCutPolygon(wxCommandEvent& event)
+{
        CutModelMainPanel::getInstance()->onExecuteCutPolygon();
 }
 
@@ -453,48 +466,49 @@ ToolBarCutModel::ToolBarCutModel(wxWindow * parent)
 {
        wxBitmap bitmap10(Add_xpm);
        this->AddTool(10, wxString(_T("Add")),bitmap10);
-
        this->AddSeparator();
-
        wxBitmap bitmap20(Undo_xpm);
        this->AddTool(20, wxString(_T("Undo")),bitmap20);
-
        wxBitmap bitmap30(Redo_xpm);
        this->AddTool(30, wxString(_T("Redo")),bitmap30);
-
        this->AddSeparator();
-
        wxBitmap bitmap40(OkAll_xpm);
        this->AddTool(40, wxString(_T("Ok All")),bitmap40);
-
        this->Realize();
-
        _evthand = new ToolBarEventHandlerCutModel();
        this->SetEventHandler(_evthand);
 }
 
-ToolBarCutModel::~ToolBarCutModel(void){
+ToolBarCutModel::~ToolBarCutModel(void)
+{
 }
 
 ToolBarEventHandlerCutModel::ToolBarEventHandlerCutModel()
-: wxEvtHandler(){
+: wxEvtHandler()
+{
 }
-ToolBarEventHandlerCutModel::~ToolBarEventHandlerCutModel(){
+
+ToolBarEventHandlerCutModel::~ToolBarEventHandlerCutModel()
+{
 }
 
-void ToolBarEventHandlerCutModel::onAdd(wxCommandEvent& event){
+void ToolBarEventHandlerCutModel::onAdd(wxCommandEvent& event)
+{
        CutModelMainPanel::getInstance()->onAddCutModel();
 }
 
-void ToolBarEventHandlerCutModel::onUndo(wxCommandEvent& event){
+void ToolBarEventHandlerCutModel::onUndo(wxCommandEvent& event)
+{
        CutModelMainPanel::getInstance()->onUndo();
 }
 
-void ToolBarEventHandlerCutModel::onRedo(wxCommandEvent& event){
+void ToolBarEventHandlerCutModel::onRedo(wxCommandEvent& event)
+{
        CutModelMainPanel::getInstance()->onRedo();
 }
 
-void ToolBarEventHandlerCutModel::onExecuteAll(wxCommandEvent& event){
+void ToolBarEventHandlerCutModel::onExecuteAll(wxCommandEvent& event)
+{
        CutModelMainPanel::getInstance()->ExecuteAll();
 }
 
index 3809d4fa0debe0bf19354be46f371c535ce6abfa..7c645e58788ca1ac3e8cee78ff9e8e1cf2d20474 100644 (file)
@@ -139,7 +139,9 @@ private:
 
        CutModelManager* cutmanager;    
 
-       void checkInvariant() throw( CutModelException);
+// EED 2022-08-04      
+//     void checkInvariant() throw( CutModelException);
+       void checkInvariant();
 
        void showErrorDialog(std::string str);
 
@@ -151,9 +153,13 @@ private:
 
        wxAuiManager* _wxauimanager;
 
-       int addNewViewPanel()throw( CutModelException);
+// EED 2022-08-04      
+//     int addNewViewPanel()throw( CutModelException);
+       int addNewViewPanel();
 
-       CutModelView* getModelView(int id)throw( CutModelException);
+// EED 2022-08-04      
+//     CutModelView* getModelView(int id)throw( CutModelException);
+       CutModelView* getModelView(int id);
 
        int _panelid;
 
index 265d327d3a6ffa9562cd0a30f3840144f260589c..901f756ee7c9db940aac7a0ddff0a73b93871f54 100644 (file)
@@ -182,8 +182,14 @@ wxSizer* CutModelView::getColorChooseActor(wxWindow* parent){
        return sizercolor;
 }
 
-void CutModelView::checkInvariant()throw (CutModelException){
-       
+// EED 2022-08-04      throw
+//void CutModelView::checkInvariant()throw (CutModelException)
+void CutModelView::checkInvariant()
+{      
+       try {
+       } catch (...) {
+         throw ;
+       }
 }
 
 void CutModelView::Execute(vtkObject *wdg, unsigned long eventId, void* calldata) {  // virtual
index 1e71addf039a5f954aea3081236b0f9d4d60fd78..8374e65c4c3161a006187592d851d91a3fcd1307 100644 (file)
 
 class  creaMaracasVisu_EXPORT  CutModelView : public wxPanel, public vtkCommand
 {
-
 public:
        CutModelView( wxWindow* parent,double* range);
     ~CutModelView( );
-
        virtual void Execute(vtkObject *wdg, unsigned long eventId, void* calldata) ;
-       
        int getId(){
                return _id;
        }
        void setId(int id){
                _id = id;
        }
-       
        void ExecuteCut();
-
        void SetCurrentColor(wxColour colour);
-       
 private:       
-
        int _id;
-
        wxSlider* _sliderrange;
        wxRadioBox* _radioinsideout;
        //wxRadioBox* _radiocutstat;
        wxStaticText* _currentcolor;
-
        double* getRange();
        bool isCut();
        bool isInside();
-
-
-
        wxSizer* getBoxControls(wxWindow* parent, double* range);
-
-
        wxSizer* getActorProperties(wxWindow* parent);
        wxSizer* getColorChooseActor(wxWindow* parent);
        wxSizer* getOpacityActor(wxWindow* parent);
-
-       void checkInvariant() throw( CutModelException);
-
+// EED 2022-08-04      
+//     void checkInvariant() throw( CutModelException);
+       void checkInvariant();
 };
 
 class CutModelViewEventHandler : public wxEvtHandler{
-
        public:
                CutModelViewEventHandler(): wxEvtHandler(){};
                ~CutModelViewEventHandler(){};
-
                void onColorChange(wxCommandEvent& event);                      
                void onOpacityChange(wxScrollEvent& event);
                void onViewBoxChecked(wxCommandEvent& event);
                void onShapeChange(wxCommandEvent& event);
                void onStatistics(wxCommandEvent& event);
                void onExecute(wxCommandEvent& event);
-               
-
-
        private:
-               
 };
 
-
 #endif
 
index ccd36989a479e62849484c255e0a17ff5b793999..8d27a5c3e10bfb1900335d1b7729cfb27f24aff2 100644 (file)
@@ -101,32 +101,33 @@ void CutModelData::createBoxWidget(vtkRenderWindowInteractor* interactor, vtkCom
        //_boxWidgetVolume->GetOutlineProperty()->SetOpacity(0.5);      
 }
 
-void CutModelData::setTransform(vtkImageData* img)throw( CutModelException){
-       
-       currentmatrix = vtkTransform::New();
-       modeltransform = vtkTransform::New();
-       inversModel     = vtkTransform::New();    
-
-       vtkMatrix4x4* matrix = vtkMatrix4x4::New();  
-       matrix->Identity();
-        double *ori = img->GetOrigin();
-       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]);
-
-        double orgx = (ext[1]+ext[0])/2.*spc[0];
-        double orgy = (ext[3]+ext[2])/2.*spc[1];
-        double orgz = (ext[5]+ext[4])/2.*spc[2];
-
-       matrix->SetElement(0,3,orgx);
-       matrix->SetElement(1,3,orgy);
-       matrix->SetElement(2,3,orgz);
-
-       currentmatrix->SetMatrix(matrix);
-       _boxWidgetVolume->SetTransform(currentmatrix);                  
+// EED 2022-08-04      throw
+//void CutModelData::setTransform(vtkImageData* img)throw( CutModelException)
+void CutModelData::setTransform(vtkImageData* img)
+{      
+       try {
+               currentmatrix                   = vtkTransform::New();
+               modeltransform                  = vtkTransform::New();
+               inversModel                             = vtkTransform::New();    
+               vtkMatrix4x4* matrix    = vtkMatrix4x4::New();  
+               matrix->Identity();
+               double *ori                     = img->GetOrigin();
+               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]);
+               double orgx = (ext[1]+ext[0])/2.*spc[0];
+               double orgy = (ext[3]+ext[2])/2.*spc[1];
+               double orgz = (ext[5]+ext[4])/2.*spc[2];
+               matrix->SetElement(0,3,orgx);
+               matrix->SetElement(1,3,orgy);
+               matrix->SetElement(2,3,orgz);
+               currentmatrix->SetMatrix(matrix);
+               _boxWidgetVolume->SetTransform(currentmatrix);                  
+       } catch (...) {
+         throw ;
+       }
 }
 
 void CutModelData::createActor(){      
@@ -138,99 +139,148 @@ void CutModelData::createActor(){
        _Actor->GetProperty()->SetOpacity(0.5);         
 }
 
-void CutModelData::udapteActorDirection()throw( CutModelException){
-       checkInvariant();
-       
+// EED 2022-08-04      throw
+//void CutModelData::udapteActorDirection()throw( CutModelException)
+void CutModelData::udapteActorDirection()
+{
+       try {
+       checkInvariant();       
        _boxWidgetVolume->GetTransform(currentmatrix);          
-       _Actor->SetUserMatrix(currentmatrix->GetMatrix());//SetUserTransform(currentmatrix );
+       _Actor->SetUserMatrix(currentmatrix->GetMatrix());  //SetUserTransform(currentmatrix );
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelData::createShapes(){
+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);
+// EED 2022-08-04      throw
+//void CutModelData::changeOpacity(int opacity)throw( CutModelException)
+void CutModelData::changeOpacity(int opacity)
+{
+       try {
+               checkInvariant();       
+               _Actor->GetProperty()->SetOpacity((double)opacity/100.0);
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelData::ShowViewBox(bool check)throw( CutModelException){
-       checkInvariant();
-       if(check){
-               _boxWidgetVolume->On();
-       }else{
-               _boxWidgetVolume->Off();
-       }    
+// EED 2022-08-04      throw
+//void CutModelData::ShowViewBox(bool check)throw( CutModelException)
+void CutModelData::ShowViewBox(bool check)
+{
+       try {
+               checkInvariant();
+               if(check){
+                       _boxWidgetVolume->On();
+               }else{
+                       _boxWidgetVolume->Off();
+               }    
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelData::ChangeShape(int selection)throw( CutModelException){
-       checkInvariant();
-       
-       if(selection == 0)
-       {
-//EED 2017-01-01 Migration VTK7
-#if VTK_MAJOR_VERSION <= 5
-               _Mapper->SetInput(_spherefigure->getPolyData());
-#else
-               _Mapper->SetInputData(_spherefigure->getPolyData());
-#endif
-       }else if(selection == 1){
-
-#if VTK_MAJOR_VERSION <= 5
-               _Mapper->SetInput(_cylinderfigure->getPolyData());
-#else
-               _Mapper->SetInputData(_cylinderfigure->getPolyData());
-#endif
-
-       }else if(selection == 2){
-//EED 2017-01-01 Migration VTK7
-#if VTK_MAJOR_VERSION <= 5
-               _Mapper->SetInput(_cubefigure->getPolyData());
-#else
-               _Mapper->SetInputData(_cubefigure->getPolyData());
-#endif
-       }else{
-               throw CutModelException("Shape type not found");
+// EED 2022-08-04      throw
+//void CutModelData::ChangeShape(int selection)throw( CutModelException)
+void CutModelData::ChangeShape(int selection)
+{
+       try {
+                               checkInvariant();
+                               if(selection == 0)
+                               {
+                       //EED 2017-01-01 Migration VTK7
+                       #if VTK_MAJOR_VERSION <= 5
+                                       _Mapper->SetInput(_spherefigure->getPolyData());
+                       #else
+                                       _Mapper->SetInputData(_spherefigure->getPolyData());
+                       #endif
+                               }else if(selection == 1){
+
+                       #if VTK_MAJOR_VERSION <= 5
+                                       _Mapper->SetInput(_cylinderfigure->getPolyData());
+                       #else
+                                       _Mapper->SetInputData(_cylinderfigure->getPolyData());
+                       #endif
+
+                               }else if(selection == 2){
+                       //EED 2017-01-01 Migration VTK7
+                       #if VTK_MAJOR_VERSION <= 5
+                                       _Mapper->SetInput(_cubefigure->getPolyData());
+                       #else
+                                       _Mapper->SetInputData(_cubefigure->getPolyData());
+                       #endif
+                               }else{
+                                       throw CutModelException("Shape type not found");
+                               }
+                               _currentshape=selection;
+       } catch (...) {
+         throw ;
        }
-       _currentshape=selection;
+
 }
 
-void CutModelData::checkInvariant()throw( CutModelException){
-       if(_boxWidgetVolume==NULL){
-               throw CutModelException("Box Widget not created");
-       }
-       if(_Mapper==NULL){
-               throw CutModelException("Mapper not created");
-       }
-       if(_Actor==NULL){
-               throw CutModelException("Actor not created");
-       }
-       if(_cubefigure==NULL){
-               throw CutModelException("Cube not created");
-       }
-       if(_cylinderfigure==NULL){
-               throw CutModelException("Cylinder not created");
-       }
-       if(_spherefigure==NULL){
-               throw CutModelException("Sphere not created");
+// EED 2022-08-04      throw
+//void CutModelData::checkInvariant()throw( CutModelException)
+void CutModelData::checkInvariant()
+{
+       try {
+               if(_boxWidgetVolume==NULL){
+                       throw CutModelException("Box Widget not created");
+               }
+               if(_Mapper==NULL){
+                       throw CutModelException("Mapper not created");
+               }
+               if(_Actor==NULL){
+                       throw CutModelException("Actor not created");
+               }
+               if(_cubefigure==NULL){
+                       throw CutModelException("Cube not created");
+               }
+               if(_cylinderfigure==NULL){
+                       throw CutModelException("Cylinder not created");
+               }
+               if(_spherefigure==NULL){
+                       throw CutModelException("Sphere not created");
+               }
+       } catch (...) {
+         throw ;
        }
 }
 
-vtkActor* CutModelData::getActor()throw( CutModelException){
-       checkInvariant();
-       return _Actor;
+// EED 2022-08-04      throw
+//vtkActor* CutModelData::getActor()throw( CutModelException)
+vtkActor* CutModelData::getActor()
+{
+       try {
+               checkInvariant();
+               return _Actor;
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelData::changeColor(double r,double g,double b)throw( CutModelException){
-       checkInvariant();               
-       _Actor->GetProperty()->SetColor( r,g,b );       
+// EED 2022-08-04      throw
+//void CutModelData::changeColor(double r,double g,double b)throw( CutModelException)
+void CutModelData::changeColor(double r,double g,double b)
+{
+       try {
+               checkInvariant();               
+               _Actor->GetProperty()->SetColor( r,g,b );       
+       } catch (...) {
+         throw ;
+       }
 }
 
-CutModelFigure* CutModelData::getCurentCuttingModel(){
-    checkInvariant();
-       
+CutModelFigure* CutModelData::getCurentCuttingModel()
+{
+       checkInvariant();       
        if(_currentshape == 0){
                return _spherefigure;
        }else if(_currentshape == 1){
@@ -242,104 +292,103 @@ CutModelFigure* CutModelData::getCurentCuttingModel(){
        }       
 }
 
-void CutModelData::ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)throw( CutModelException)
+// EED 2022-08-04      throw
+//void CutModelData::ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)throw( CutModelException)
+void CutModelData::ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)
 {
-       wxBusyCursor wait;
-
-       CutModelFigure* actualCuttingModel = getCurentCuttingModel();
-
-       //_boxWidgetVolume->GetTransform(currentmatrix);        
-       actualCuttingModel->SetVtkTransform(getModelTransform(copyimage));
-       //actualCuttingModel->SetVtkTransform(currentmatrix);
-       actualCuttingModel->SetInversVtkTransform(getModelTransformInvers());   
-
-       bool                    inside;
-       //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++)
-       {
-                for (yy=ext[2];yy<=ext[3]; yy++)
+       try {
+               wxBusyCursor wait;
+               CutModelFigure* actualCuttingModel = getCurentCuttingModel();
+               //_boxWidgetVolume->GetTransform(currentmatrix);        
+               actualCuttingModel->SetVtkTransform(getModelTransform(copyimage));
+               //actualCuttingModel->SetVtkTransform(currentmatrix);
+               actualCuttingModel->SetInversVtkTransform(getModelTransformInvers());   
+               bool                    inside;
+               //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++)
                {
-                        for (zz=ext[4];zz<=ext[5];zz++)
+                           for (yy=ext[2];yy<=ext[3]; yy++)
                        {
-                               inside=actualCuttingModel->IfPointInside(xx,yy,zz);
-                               if (  ((inside==true)&&(isinside==true)) || ((!inside==true)&&(!isinside)) )
+                                   for (zz=ext[4];zz<=ext[5];zz++)
                                {
-                                       pOrg=(unsigned short*)copyimage->GetScalarPointer (xx,yy,zz); 
-
-                                       //std::cout<<"xx,yy,zz "<<xx<<","<<yy<<","<<zz<<" "<<*pOrg<<std::endl;
-                                       if ((unsigned short)minvalue <=(*pOrg)&&(*pOrg)<=(unsigned short)maxvalue)
-                                       {       
-                                               
-                                               *pOrg=(unsigned short)value;
-                                               
-                                       }                                       
-                               } // if inside
-                       } // for zz
-               } // for yy
-       } // for xx
+                                       inside=actualCuttingModel->IfPointInside(xx,yy,zz);
+                                       if (  ((inside==true)&&(isinside==true)) || ((!inside==true)&&(!isinside)) )
+                                       {
+                                               pOrg=(unsigned short*)copyimage->GetScalarPointer (xx,yy,zz); 
+
+                                               //std::cout<<"xx,yy,zz "<<xx<<","<<yy<<","<<zz<<" "<<*pOrg<<std::endl;
+                                               if ((unsigned short)minvalue <=(*pOrg)&&(*pOrg)<=(unsigned short)maxvalue)
+                                               {       
+                                                       
+                                                       *pOrg=(unsigned short)value;
+                                                       
+                                               }                                       
+                                       } // if inside
+                               } // for zz
+                       } // for yy
+               } // for xx
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelData::ExecuteUnCut(bool isinside, vtkImageData* image, vtkImageData* copyimage)throw( CutModelException)
+// EED 2022-08-04      throw
+//void CutModelData::ExecuteUnCut(bool isinside, vtkImageData* image, vtkImageData* copyimage)throw( CutModelException)
+void CutModelData::ExecuteUnCut(bool isinside, vtkImageData* image, vtkImageData* copyimage)
 {
-       wxBusyCursor wait;
-
-       CutModelFigure* actualCuttingModel = getCurentCuttingModel();
-
-       actualCuttingModel->SetVtkTransform(getModelTransform(copyimage));
-
-       actualCuttingModel->SetInversVtkTransform(getModelTransformInvers());   
-
-       bool                    inside;
-       // bool                 volInt, volExt; // unused // JPRx
-       int                     xx,yy,zz;
-       unsigned short* pOrg;   
-       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++)
+       try {
+               wxBusyCursor wait;
+               CutModelFigure* actualCuttingModel = getCurentCuttingModel();
+               actualCuttingModel->SetVtkTransform(getModelTransform(copyimage));
+               actualCuttingModel->SetInversVtkTransform(getModelTransformInvers());   
+               bool                    inside;
+               // bool                 volInt, volExt; // unused // JPRx
+               int                     xx,yy,zz;
+               unsigned short* pOrg;   
+               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 (zz=ext[4];zz<=ext[5];zz++)
+                           for (yy=ext[2];yy<=ext[3]; yy++)
                        {
-                               inside=actualCuttingModel->IfPointInside(xx,yy,zz);
-                               if (  ((inside==true)&&(isinside==true)) || ((!inside==true)&&(!isinside)) )
+                                   for (zz=ext[4];zz<=ext[5];zz++)
                                {
-                                       value = *((unsigned short*)image->GetScalarPointer (xx,yy,zz));
-                                       pOrg=(unsigned short*)copyimage->GetScalarPointer (xx,yy,zz); 
-                                       //std::cout<<"CutModelData::ExecuteUnCut() "<<value<<" "<<*pOrg<<std::endl;
-                                       *pOrg=(unsigned short)value;
-                               } // if inside
-                       } // for zz
-               } // for yy
-       } // for xx
-}
+                                       inside=actualCuttingModel->IfPointInside(xx,yy,zz);
+                                       if (  ((inside==true)&&(isinside==true)) || ((!inside==true)&&(!isinside)) )
+                                       {
+                                               value = *((unsigned short*)image->GetScalarPointer (xx,yy,zz));
+                                               pOrg=(unsigned short*)copyimage->GetScalarPointer (xx,yy,zz); 
+                                               //std::cout<<"CutModelData::ExecuteUnCut() "<<value<<" "<<*pOrg<<std::endl;
+                                               *pOrg=(unsigned short)value;
+                                       } // if inside
+                               } // for zz
+                       } // for yy
+               } // for xx
+       } catch (...) {
+         throw ;
+       }
 
-vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
+}
 
+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]);
@@ -353,14 +402,11 @@ vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
        matrixmodel->SetElement(0,3,matrix->GetElement(0,3)/spc[0]);
        matrixmodel->SetElement(1,3,matrix->GetElement(1,3)/spc[1]);
        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]);   
-
        double* scal = currentmatrix->GetScale();       
        modeltransform->Scale(scal[0]/spc[0],scal[1]/spc[1],scal[2]/spc[2]);
-
        //double* orient = currentmatrix->GetOrientation();
        //modeltransform->RotateZ(orient[2]);   
        //modeltransform->RotateY(orient[1]);   
@@ -368,58 +414,62 @@ vtkTransform* CutModelData::getModelTransform(vtkImageData* copyimage){
        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();  // spc unused // JPR
-
-       currentmatrix->Identity();      
-
-       /*double* orient = transform->GetOrientationWXYZ();
-       currentmatrix->RotateWXYZ(orient[0],orient[1],orient[2],orient[3]);     
-
-       double* pos = transform->GetPosition();
-       currentmatrix->Translate(pos[0]/spc[0],pos[1]/spc[1],pos[2]/spc[2]);
-
-       double* scal = transform->GetScale();   
-       currentmatrix->Scale(scal[0]/spc[0],scal[1]/spc[1],scal[2]/spc[2]);
-
-       currentmatrix->Update();        */
-
-       _boxWidgetVolume->SetTransform(transform);
-
-    /*vtkMatrix4x4* matrix = transform->GetMatrix();
-       vtkMatrix4x4* matrixcurrent = currentmatrix->GetMatrix();
-       matrixcurrent->SetElement(0,0,matrix->GetElement(0,0)/spc[0]);
-       matrixcurrent->SetElement(1,0,matrix->GetElement(1,0)/spc[0]);
-       matrixcurrent->SetElement(2,0,matrix->GetElement(2,0)/spc[0]);
-       matrixcurrent->SetElement(0,1,matrix->GetElement(0,1)/spc[1]);
-       matrixcurrent->SetElement(1,1,matrix->GetElement(1,1)/spc[1]);
-       matrixcurrent->SetElement(2,1,matrix->GetElement(2,1)/spc[1]);
-       matrixcurrent->SetElement(0,2,matrix->GetElement(0,2)/spc[2]);
-       matrixcurrent->SetElement(1,2,matrix->GetElement(1,2)/spc[2]);
-       matrixcurrent->SetElement(2,2,matrix->GetElement(2,2)/spc[2]);          
-       matrixcurrent->SetElement(0,3,matrix->GetElement(0,3)/spc[0]);
-       matrixcurrent->SetElement(1,3,matrix->GetElement(1,3)/spc[1]);
-       matrixcurrent->SetElement(2,3,matrix->GetElement(2,3)/spc[2]);  */
-
-       udapteActorDirection();
-       getModelTransform(img);
+// EED 2022-08-04      throw
+//void CutModelData::setTransform(vtkTransform* transform, vtkImageData* img)throw( CutModelException)
+void CutModelData::setTransform(vtkTransform* transform, vtkImageData* img)
+{      
+       try {
+               //      double *spc = img->GetSpacing();  // spc unused // JPR
+                       currentmatrix->Identity();      
+                       /*double* orient = transform->GetOrientationWXYZ();
+                       currentmatrix->RotateWXYZ(orient[0],orient[1],orient[2],orient[3]);     
+                       double* pos = transform->GetPosition();
+                       currentmatrix->Translate(pos[0]/spc[0],pos[1]/spc[1],pos[2]/spc[2]);
+                       double* scal = transform->GetScale();   
+                       currentmatrix->Scale(scal[0]/spc[0],scal[1]/spc[1],scal[2]/spc[2]);
+                       currentmatrix->Update();        */
+                       _boxWidgetVolume->SetTransform(transform);
+                       /*vtkMatrix4x4* matrix = transform->GetMatrix();
+                       vtkMatrix4x4* matrixcurrent = currentmatrix->GetMatrix();
+                       matrixcurrent->SetElement(0,0,matrix->GetElement(0,0)/spc[0]);
+                       matrixcurrent->SetElement(1,0,matrix->GetElement(1,0)/spc[0]);
+                       matrixcurrent->SetElement(2,0,matrix->GetElement(2,0)/spc[0]);
+                       matrixcurrent->SetElement(0,1,matrix->GetElement(0,1)/spc[1]);
+                       matrixcurrent->SetElement(1,1,matrix->GetElement(1,1)/spc[1]);
+                       matrixcurrent->SetElement(2,1,matrix->GetElement(2,1)/spc[1]);
+                       matrixcurrent->SetElement(0,2,matrix->GetElement(0,2)/spc[2]);
+                       matrixcurrent->SetElement(1,2,matrix->GetElement(1,2)/spc[2]);
+                       matrixcurrent->SetElement(2,2,matrix->GetElement(2,2)/spc[2]);          
+                       matrixcurrent->SetElement(0,3,matrix->GetElement(0,3)/spc[0]);
+                       matrixcurrent->SetElement(1,3,matrix->GetElement(1,3)/spc[1]);
+                       matrixcurrent->SetElement(2,3,matrix->GetElement(2,3)/spc[2]);  */
+                       udapteActorDirection();
+                       getModelTransform(img);
+       } catch (...) {
+         throw ;
+       }
 }
 
-vtkTransform* CutModelData::getModelTransformInvers(){
-       inversModel->Identity ();
-       inversModel->Concatenate ( modeltransform );
-       inversModel->Inverse(); 
-       return inversModel;
+vtkTransform* CutModelData::getModelTransformInvers()
+{
+               inversModel->Identity ();
+               inversModel->Concatenate ( modeltransform );
+               inversModel->Inverse(); 
+               return inversModel;
 }
 
-vtkPolyData* CutModelData::getPolyData()throw( CutModelException){
-       return _Mapper->GetInput();
+// EED 2022-08-04      throw
+//vtkPolyData* CutModelData::getPolyData()throw( CutModelException)
+vtkPolyData* CutModelData::getPolyData()
+{
+       try {
+               return _Mapper->GetInput();
+       } catch (...) {
+         throw ;
+       }
 }
 
index d505628df42b8f891c29b77185c0e28a4c71e98a..06042df9f8ad0347834aae5121df0600123b3ed5 100644 (file)
@@ -71,73 +71,67 @@ public:
        CutModelData(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img);
        ~CutModelData();
        void initializeData(int id, vtkRenderWindowInteractor* interactor, vtkCommand* observer, vtkImageData* img);
-
-
        int getId(){
                return _id;
        }
-
+// EED 2022-08-04      
+/*
        void changeOpacity(int opacity)throw( CutModelException);
-
        void ShowViewBox(bool check)throw( CutModelException);
-
        void ChangeShape(int selection)throw( CutModelException);
-
        vtkActor* getActor()throw( CutModelException);
-
        vtkPolyData* getPolyData()throw( CutModelException);
-       
        void changeColor(double r,double g,double b)throw( CutModelException);
-
        void udapteActorDirection()throw( CutModelException);
-
        void ExecuteCut( double* range, bool isinside, vtkImageData* copyimage)throw( CutModelException);
-
        void ExecuteUnCut(  bool isinside, vtkImageData* image, vtkImageData* copyimage)throw( CutModelException);
-
+       void setTransform(vtkTransform* transform,vtkImageData* img)throw( CutModelException);
+*/
+       void changeOpacity(int opacity);
+       void ShowViewBox(bool check);
+       void ChangeShape(int selection);
+       vtkActor* getActor();
+       vtkPolyData* getPolyData();
+       void changeColor(double r,double g,double b);
+       void udapteActorDirection();
+       void ExecuteCut( double* range, bool isinside, vtkImageData* copyimage);
+       void ExecuteUnCut(  bool isinside, vtkImageData* image, vtkImageData* copyimage);
+       void setTransform(vtkTransform* transform,vtkImageData* img);
+       
        void RefreshViewBox();
-
        vtkTransform* getCurrentMatrix(){
                return currentmatrix;
        }
-
        int getCurrentShape(){
                return _currentshape;
        }
-
        void setCurrentShape(int currentshape){
                _currentshape = currentshape;
        }
-
-       void setTransform(vtkTransform* transform,vtkImageData* img)throw( CutModelException);
 private:       
+// EED 2022-08-04      
+//     void checkInvariant()throw( CutModelException);
+//     void setTransform(vtkImageData* img)throw( CutModelException);
+       void checkInvariant();
+       void setTransform(vtkImageData* img);
        
-       void checkInvariant()throw( CutModelException);
-
        void createBoxWidget(vtkRenderWindowInteractor* interactor, vtkCommand* observer);
        void createActor();
-       void setTransform(vtkImageData* img)throw( CutModelException);
        void createShapes();    
-
-       vtkBoxWidget* _boxWidgetVolume;
-       vtkPolyDataMapper* _Mapper;     
-       vtkActor* _Actor;       
-       int _id;
-
-       int _currentshape;
-
-       CutModelFigureCube* _cubefigure;
-       CutModelFigureCylinder* _cylinderfigure;
-       CutModelFigureSphere* _spherefigure;
-       vtkTransform* currentmatrix;
-       vtkTransform* modeltransform;
-       vtkTransform* inversModel;
-
-
-       CutModelFigure* getCurentCuttingModel();
-
-       vtkTransform* getModelTransform(vtkImageData* copyimage);
-       vtkTransform* getModelTransformInvers();
+       vtkBoxWidget                    *_boxWidgetVolume;
+       vtkPolyDataMapper               *_Mapper;       
+       vtkActor                                *_Actor;        
+       int                                     _id;
+       int                                     _currentshape;
+       CutModelFigureCube              *_cubefigure;
+       CutModelFigureCylinder  *_cylinderfigure;
+       CutModelFigureSphere    *_spherefigure;
+       vtkTransform                    *currentmatrix;
+       vtkTransform                    *modeltransform;
+       vtkTransform                    *inversModel;
+       CutModelFigure* getCurentCuttingModel();
+       vtkTransform*   getModelTransform(vtkImageData* copyimage);
+       vtkTransform*   getModelTransformInvers();
 };
 
 #endif 
index 05e92d879559024a916ed787b3334c773ca60227..f8b4decf74e799bfe0718fdd2115bfa8bdd9ff38 100644 (file)
@@ -121,138 +121,204 @@ void CutModelManager::setRenderer(vtkRenderer* renderer){
        _render = renderer;
 }
 
-void CutModelManager::onAddCutModel(int id, vtkCommand* observer) throw( CutModelException){
-       checkInvariant();
-
-
-       CutModelData* data = new CutModelData(id,_interactor, observer, _img);
-       _vectordata.push_back(data);
-
-       _render->AddActor(data->getActor());
-
-       //_render->UpdateCamera();
-       _render->Render();
+// EED 2022-08-04      throw
+//void CutModelManager::onAddCutModel(int id, vtkCommand* observer) throw( CutModelException)
+void CutModelManager::onAddCutModel(int id, vtkCommand* observer) 
+{
+       try {
+               checkInvariant();
+               CutModelData* data = new CutModelData(id,_interactor, observer, _img);
+               _vectordata.push_back(data);
+               _render->AddActor(data->getActor());
+               //_render->UpdateCamera();
+               _render->Render();
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelManager::checkInvariant() throw( CutModelException){
-       if(_img==NULL){
-               throw CutModelException("The image is not set");
-       }
-       if(_img2==NULL){
-               throw CutModelException("The image is not set");
-       }
-       if(_interactor==NULL){
-               throw CutModelException("Interactor not set");
-       }
-       if(_render==NULL){
-               throw CutModelException("Render not set");
+// EED 2022-08-04      throw
+//void CutModelManager::checkInvariant() throw( CutModelException)
+void CutModelManager::checkInvariant() 
+{
+       try {
+               if(_img==NULL){
+                       throw CutModelException("The image is not set");
+               }
+               if(_img2==NULL){
+                       throw CutModelException("The image is not set");
+               }
+               if(_interactor==NULL){
+                       throw CutModelException("Interactor not set");
+               }
+               if(_render==NULL){
+                       throw CutModelException("Render not set");
+               }
+       } catch (...) {
+         throw ;
        }
 }
 
-double* CutModelManager::getImageRange()throw( CutModelException){
-       checkInvariant();
-       return _img->GetScalarRange();
+// EED 2022-08-04      throw
+//double* CutModelManager::getImageRange()throw( CutModelException)
+double* CutModelManager::getImageRange()
+{
+       try {
+               checkInvariant();
+               return _img->GetScalarRange();
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelManager::changeOpacity(int id,int opacity)throw( CutModelException){
-       checkInvariant();
-       CutModelData* current = getCutModelData(id);
-       current->changeOpacity(opacity);
+// EED 2022-08-04      throw
+//void CutModelManager::changeOpacity(int id,int opacity)throw( CutModelException)
+void CutModelManager::changeOpacity(int id,int opacity)
+{
+       try {
+               checkInvariant();
+               CutModelData* current = getCutModelData(id);
+               current->changeOpacity(opacity);
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelManager::ShowViewBox(int id,bool check)throw( CutModelException){
-       checkInvariant();
-       CutModelData* current = getCutModelData(id);
-       current->ShowViewBox(check);
+// EED 2022-08-04      throw
+//void CutModelManager::ShowViewBox(int id,bool check)throw( CutModelException)
+void CutModelManager::ShowViewBox(int id,bool check)
+{
+       try {
+               checkInvariant();
+               CutModelData* current = getCutModelData(id);
+               current->ShowViewBox(check);
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelManager::ChangeShape(int id,int selection)throw( CutModelException){
-       checkInvariant();
-       CutModelData* current = getCutModelData(id);
-       current->ChangeShape(selection);                        
-       _render->Render();
+// EED 2022-08-04      throw
+//void CutModelManager::ChangeShape(int id,int selection)throw( CutModelException)
+void CutModelManager::ChangeShape(int id,int selection)
+{
+       try {
+               checkInvariant();
+               CutModelData* current = getCutModelData(id);
+               current->ChangeShape(selection);                        
+               _render->Render();
+       } catch (...) {
+         throw ;
+       }
 }
 
-CutModelData* CutModelManager::getCutModelData(int id)throw( CutModelException){
-
-       CutModelData* current = NULL;
-       int i;
-       for(i= 0; i < (int)_vectordata.size();i++)
-       {
-               CutModelData* temp = _vectordata[i];
-               std::cout<<"id in CutModelManager:: "<<id<<std::endl;
-               std::cout<<"vectordataid in CutModelManager:: "<<temp->getId()<<std::endl;
-
-               if(temp->getId() == id){
-                       current =  temp;
+// EED 2022-08-04      throw
+//CutModelData* CutModelManager::getCutModelData(int id)throw( CutModelException)
+CutModelData* CutModelManager::getCutModelData(int id)
+{
+       try {
+               CutModelData* current = NULL;
+               int i;
+               for(i= 0; i < (int)_vectordata.size();i++)
+               {
+                       CutModelData* temp = _vectordata[i];
+                       std::cout<<"id in CutModelManager:: "<<id<<std::endl;
+                       std::cout<<"vectordataid in CutModelManager:: "<<temp->getId()<<std::endl;
+                       if(temp->getId() == id)
+                       {
+                               current =  temp;
+                       }
                }
+               if(current ==NULL)
+               {
+                       throw CutModelException("Data not found");
+               }
+               return current;
+       } catch (...) {
+         throw ;
        }
-       if(current ==NULL){
-
-               throw CutModelException("Data not found");
-       }
-       return current;
 }
 
-void CutModelManager::updateActorDirection(int id)throw( CutModelException){
-       checkInvariant();
-       CutModelData* current = getCutModelData(id);
-       current->udapteActorDirection();
-
+// EED 2022-08-04      throw
+//void CutModelManager::updateActorDirection(int id)throw( CutModelException)
+void CutModelManager::updateActorDirection(int id)
+{
+       try {
+               checkInvariant();
+               CutModelData* current = getCutModelData(id);
+               current->udapteActorDirection();
+       } catch (...) {
+         throw ;
+       }
 }
 
-void CutModelManager::changeColor(int id,double r,double g,double b)throw( CutModelException){
-
-       checkInvariant();
-       CutModelData* current = getCutModelData(id);
-       current->changeColor(r,g,b);
-       _render->Render();
+// EED 2022-08-04      throw
+//void CutModelManager::changeColor(int id,double r,double g,double b)throw( CutModelException)
+void CutModelManager::changeColor(int id,double r,double g,double b)
+{
+       try {
+               checkInvariant();
+               CutModelData* current = getCutModelData(id);
+               current->changeColor(r,g,b);
+               _render->Render();
+       } catch (...) {
+         throw ;
+       }
 }
-void CutModelManager::RemoveActor(int id)throw( CutModelException){
-
-       checkInvariant();
 
-       CutModelData* current = getCutModelData(id);
-       int i,j;
-       for(i = 0; i < (int)_vectordata.size()-1;i++)
-       {
-               if(_vectordata[i]->getId()==id){                                
-                       for(j = i; j < (int)_vectordata.size()-1;j++){
-                               _vectordata[j]=_vectordata[j+1];
+// EED 2022-08-04      throw
+//void CutModelManager::RemoveActor(int id)throw( CutModelException)
+void CutModelManager::RemoveActor(int id)
+{
+       try {
+               checkInvariant();
+               CutModelData* current = getCutModelData(id);
+               int i,j;
+               for(i = 0; i < (int)_vectordata.size()-1;i++)
+               {
+                       if(_vectordata[i]->getId()==id){                                
+                               for(j = i; j < (int)_vectordata.size()-1;j++){
+                                       _vectordata[j]=_vectordata[j+1];
+                               }
+                               i = _vectordata.size();
                        }
-                       i = _vectordata.size();
                }
+               _render->RemoveViewProp(current->getActor());           
+               //_render->RemoveViewProp(current->get
+               delete current;
+               _vectordata.pop_back();
+               _render->Render();
+       } catch (...) {
+         throw ;
        }
-       _render->RemoveViewProp(current->getActor());           
-       //_render->RemoveViewProp(current->get
-       delete current;
-       _vectordata.pop_back();
-       _render->Render();
-
 }
 
-void CutModelManager::ExecuteCut(int id, double* range, bool isinside)throw( CutModelException){
-       checkInvariant();
-
-       CutModelData* current = getCutModelData(id);
-       current->ExecuteCut(range, isinside,_img2);
-
-
-       /*
-       Setting extra information for the undo
-       */
-       CutModelSaveBinInfo* undoaction = this->AddActionUndo(id, CUTMODEL_CUT);
-       undoaction->setRange(range);
-       undoaction->setIsInside(isinside);
-
+// EED 2022-08-04      throw
+//void CutModelManager::ExecuteCut(int id, double* range, bool isinside)throw( CutModelException)
+void CutModelManager::ExecuteCut(int id, double* range, bool isinside)
+{
+       try {
+               checkInvariant();
+               CutModelData* current = getCutModelData(id);
+               current->ExecuteCut(range, isinside,_img2);
+               /*
+               Setting extra information for the undo
+               */
+               CutModelSaveBinInfo* undoaction = this->AddActionUndo(id, CUTMODEL_CUT);
+               undoaction->setRange(range);
+               undoaction->setIsInside(isinside);
+       } catch (...) {
+         throw ;
+       }
 }
 
-vtkImageData* CutModelManager::GetResultImage(){
+vtkImageData* CutModelManager::GetResultImage()
+{
        checkInvariant();
        return _img2;
 }
 
-void CutModelManager::RefreshActor(int id){
+void CutModelManager::RefreshActor(int id)
+{
        checkInvariant();
        CutModelData* current = getCutModelData(id);    
        _render->RemoveActor(current->getActor());
@@ -261,104 +327,117 @@ void CutModelManager::RefreshActor(int id){
        _render->Render();
 }
 
-void CutModelManager::SaveCutModelData(std::string filename)throw( CutModelException){ 
-
-
-       throw CutModelException("not implemented");
-
-
-
-
-}
-
-
-
-void CutModelManager::LoadCutModelData(std::string filename)throw( CutModelException){
-
-       throw CutModelException("not implemented");
-
+// EED 2022-08-04      throw
+//void CutModelManager::SaveCutModelData(std::string filename)throw( CutModelException)
+void CutModelManager::SaveCutModelData(std::string filename)
+{
+       try {
+               throw CutModelException("not implemented");
+       } catch (...) {
+         throw ;
+       }
 }
 
-CutModelSaveBinInfo* CutModelManager::AddActionUndo(int idc, UNDOTYPE type)throw( CutModelException){
-
-       for(int i = _undoredo.size()-1; i > _currentaction;i--){
-               delete _undoredo[i];
-               _undoredo.pop_back();           
+// EED 2022-08-04      throw
+//void CutModelManager::LoadCutModelData(std::string filename)throw( CutModelException)
+void CutModelManager::LoadCutModelData(std::string filename)
+{
+       try {
+               throw CutModelException("not implemented");
+       } catch (...) {
+         throw ;
        }
+}
 
-       CutModelSaveBinInfo* cutmodel = new CutModelSaveBinInfo(idc, _currentaction, type, _path);
-       if(type == CUTMODEL_CUT){
-               cutmodel->saveMatrix4x4(this->getCutModelData(idc)->getCurrentMatrix()->GetMatrix());
-               cutmodel->setCurrentShape(this->getCutModelData(idc)->getCurrentShape());
+// EED 2022-08-04      throw
+//CutModelSaveBinInfo* CutModelManager::AddActionUndo(int idc, UNDOTYPE type)throw( CutModelException)
+CutModelSaveBinInfo* CutModelManager::AddActionUndo(int idc, UNDOTYPE type)
+{
+       try {
+               for(int i = _undoredo.size()-1; i > _currentaction;i--)
+               {
+                       delete _undoredo[i];
+                       _undoredo.pop_back();           
+               }
+               CutModelSaveBinInfo* cutmodel = new CutModelSaveBinInfo(idc, _currentaction, type, _path);
+               if(type == CUTMODEL_CUT){
+                       cutmodel->saveMatrix4x4(this->getCutModelData(idc)->getCurrentMatrix()->GetMatrix());
+                       cutmodel->setCurrentShape(this->getCutModelData(idc)->getCurrentShape());
+               }
+               _undoredo.push_back(cutmodel);
+               _currentaction++;// = _undoredo.size();
+               //std::cout<<"current index "<<_currentaction;
+               return cutmodel;
+       } catch (...) {
+         throw ;
        }
-
-       _undoredo.push_back(cutmodel);
-
-       _currentaction++;// = _undoredo.size();
-       //std::cout<<"current index "<<_currentaction;
-
-       return cutmodel;
 }
 
-int CutModelManager::Undo()    throw( CutModelException){
-       //&& _currentaction < _undoredo.size()
-       if(_currentaction > 0){
-               int tempaction = _currentaction-1;
-               CutModelSaveBinInfo* currentundo = _undoredo[tempaction];
-               CutModelData* currentmodel;
-
-               if(currentundo->getActionType()==CUTMODEL_CUT){
-                       //Undo the cut
-                       vtkTransform* transform = currentundo->getTransformFromMatrixFile();
-
-                       currentmodel = getCutModelData(currentundo->getId());
-
-                       currentmodel->setTransform(transform, _img2);
-
-                       currentmodel->setCurrentShape(currentundo->getCurrentShape());
-
-                       currentmodel->ExecuteUnCut(currentundo->getIsInside(), _img, _img2);
-
+// EED 2022-08-04      throw
+//int CutModelManager::Undo()  throw( CutModelException)
+int CutModelManager::Undo()    
+{
+       try {
+               //&& _currentaction < _undoredo.size()
+               if(_currentaction > 0)
+               {
+                       int tempaction = _currentaction-1;
+                       CutModelSaveBinInfo* currentundo = _undoredo[tempaction];
+                       CutModelData* currentmodel;
+                       if(currentundo->getActionType()==CUTMODEL_CUT){
+                               //Undo the cut
+                               vtkTransform* transform = currentundo->getTransformFromMatrixFile();
+                               currentmodel = getCutModelData(currentundo->getId());
+                               currentmodel->setTransform(transform, _img2);
+                               currentmodel->setCurrentShape(currentundo->getCurrentShape());
+                               currentmodel->ExecuteUnCut(currentundo->getIsInside(), _img, _img2);
+                       }
+                       //Every thing ok
+                       _currentaction--;
+                       return 0;
                }
-               //Every thing ok
-               _currentaction--;
-               return 0;
+               return -1;
+       } catch (...) {
+         throw ;
        }
-       return -1;
 }
 
-int CutModelManager::Redo()    throw( CutModelException){
-
-       if(_currentaction >= 0 && _currentaction < (int)_undoredo.size()){
-
-               CutModelSaveBinInfo* currentundo = _undoredo[_currentaction];
-               CutModelData* currentmodel;
-
-               if(currentundo->getActionType()==CUTMODEL_CUT){
-                       //Redo the cut
-                       vtkTransform* transform = currentundo->getTransformFromMatrixFile();
-                       currentmodel = getCutModelData(currentundo->getId());
-                       currentmodel->setTransform(transform, _img2);
-                       currentmodel->setCurrentShape(currentundo->getCurrentShape());
-                       currentmodel->ExecuteCut(currentundo->getRange(), currentundo->getIsInside(), _img2);
+// EED 2022-08-04      throw
+//int CutModelManager::Redo()  throw( CutModelException)
+int CutModelManager::Redo()    
+{
+       try {
+               if(_currentaction >= 0 && _currentaction < (int)_undoredo.size())
+               {
+                       CutModelSaveBinInfo* currentundo = _undoredo[_currentaction];
+                       CutModelData* currentmodel;
+                       if(currentundo->getActionType()==CUTMODEL_CUT){
+                               //Redo the cut
+                               vtkTransform* transform = currentundo->getTransformFromMatrixFile();
+                               currentmodel = getCutModelData(currentundo->getId());
+                               currentmodel->setTransform(transform, _img2);
+                               currentmodel->setCurrentShape(currentundo->getCurrentShape());
+                               currentmodel->ExecuteCut(currentundo->getRange(), currentundo->getIsInside(), _img2);
+                       }
+                       _currentaction++;
+                       return 0;
                }
-
-               _currentaction++;
-
-               return 0;
+               return -1;
+       } catch (...) {
+         throw ;
        }
-       return -1;
 }
 
-void CutModelManager::ParallelProjectionOn(){
+void CutModelManager::ParallelProjectionOn()
+{
        _render->GetActiveCamera()->ParallelProjectionOn();
 }
 
-void CutModelManager::ParallelProjectionOff(){
+void CutModelManager::ParallelProjectionOff()
+{
        _render->GetActiveCamera()->ParallelProjectionOff();
 }
 
-
 //RaC
 void CutModelManager::UpdatePolygon(bool mode)
 {
@@ -366,14 +445,10 @@ void CutModelManager::UpdatePolygon(bool mode)
        {
                cutterstyle->Delete();
                cutterstyle = vtkInteractorStyleCutter::New();
-
                cutterstyle->SetInteractor ( _interactor );
                _interactor ->SetInteractorStyle( cutterstyle );
-       }
-       else
-       {
+       } else {
                cutterstyle->VisibilityOff();
-
                loop = vtkImplicitSelectionLoop::New();
                mapper = vtkPolyDataMapper::New();
                if(cutterstyle->Finished())
@@ -382,11 +457,8 @@ void CutModelManager::UpdatePolygon(bool mode)
                        {
                                _render->RemoveActor(actor3D);
                        }
-
                        loop->SetLoop( cutterstyle->GetLoopPoints() );
                        loop->SetNormal( cutterstyle->GetDirection());
-
-
                        /// Printing Points
                        int numPoints = cutterstyle->GetLoopPoints()->GetNumberOfPoints();
                        contourDirection = cutterstyle->GetDirection();
@@ -403,12 +475,9 @@ void CutModelManager::UpdatePolygon(bool mode)
                                cout<<"Initial Point:"<<t<<" XX:"<<point[0]<<" YY:"<<point[1]<<" ZZ:"<<point[2]<<endl;
                        }
                        cout<<endl;
-
                        sample = vtkSampleFunction::New();
-
                        sample->SetImplicitFunction(loop);
                        sample->CappingOn();                    
-
                        contour = vtkContourFilter::New();
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
@@ -417,9 +486,7 @@ void CutModelManager::UpdatePolygon(bool mode)
                        contour->SetInputData((vtkDataObject *)sample->GetOutput());
 #endif
                        contour->SetValue(0,1);
-
                        actor = contour->GetOutput();
-
                        actor3D = vtkActor::New();                      
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
@@ -431,24 +498,23 @@ void CutModelManager::UpdatePolygon(bool mode)
                        actor3D->SetMapper( mapper);
                        _render->AddActor(actor3D);                     
                }               
-
                interactorstyle->SetInteractor (  _interactor );
                _interactor->SetInteractorStyle( interactorstyle );
        } 
-
        _interactor->Render();
        _render->ResetCameraClippingRange();
 }
-void CutModelManager::ExecuteCutPolygon(bool inOutCut){
 
+void CutModelManager::ExecuteCutPolygon(bool inOutCut)
+{
        _polygonCutter->setInImage(_img2);
        _polygonCutter->setPoints(contourPoints);
        _polygonCutter->setDirection(contourDirection);
        _polygonCutter->processOutImage(inOutCut);
 }
 
-void CutModelManager::InitializePolygonInteractorStyle(){
-
+void CutModelManager::InitializePolygonInteractorStyle()
+{
        cutterstyle = vtkInteractorStyleCutter::New();          
        interactorstyle = vtkInteractorStyleTrackballCamera ::New();
        interactorstyle->SetInteractor (  _interactor );
index 674bde438914a2c60eb7bf1546bb2e58c39a2a0e..9498b8fdc9419c1d2b8b8631b2aeb4dfd9653914 100644 (file)
@@ -91,38 +91,40 @@ public:
 
        void setBaseView(wxVtkBaseView* baseView);
 
+// EED 2022-08-04      
+/*
        void onAddCutModel(int id, vtkCommand* observer) throw( CutModelException);
-
        double* getImageRange()throw( CutModelException);
-
        void changeOpacity(int id,int opacity)throw( CutModelException);
-
        void ShowViewBox(int id,bool check)throw( CutModelException);
-
        void ChangeShape(int id,int selection)throw( CutModelException);
-
        void changeColor(int id,double r,double g,double b)throw( CutModelException);
-
        void updateActorDirection(int id)throw( CutModelException);
-
        void RemoveActor(int id)throw( CutModelException);
-
        void ExecuteCut(int id, double* range, bool isinside)throw( CutModelException);
-
-       vtkImageData* GetResultImage();
-
-       void RefreshActor(int id);
-
        void SaveCutModelData(std::string filename)throw( CutModelException);
-
        void LoadCutModelData(std::string filename)throw( CutModelException);
-
        CutModelSaveBinInfo* AddActionUndo(int id, UNDOTYPE type)throw( CutModelException);
-
        int Undo()throw( CutModelException);
-
        int Redo()throw( CutModelException);
-
+*/
+       void onAddCutModel(int id, vtkCommand* observer);
+       double* getImageRange();
+       void changeOpacity(int id,int opacity);
+       void ShowViewBox(int id,bool check);
+       void ChangeShape(int id,int selection);
+       void changeColor(int id,double r,double g,double b);
+       void updateActorDirection(int id);
+       void RemoveActor(int id);
+       void ExecuteCut(int id, double* range, bool isinside);
+       void SaveCutModelData(std::string filename);
+       void LoadCutModelData(std::string filename);
+       CutModelSaveBinInfo* AddActionUndo(int id, UNDOTYPE type);
+       int Undo();
+       int Redo();
+       
+       vtkImageData* GetResultImage();
+       void RefreshActor(int id);
        void ParallelProjectionOn();
 
        void ParallelProjectionOff();
@@ -137,7 +139,9 @@ private:
 
        int _currentaction;
 
-       void checkInvariant() throw( CutModelException);
+// EED 2022-08-04      
+//     void checkInvariant() throw( CutModelException);
+       void checkInvariant();
        std::string _path;
        vtkImageData* _img;
        vtkImageData* _img2;
@@ -146,7 +150,9 @@ private:
 
        std::vector<CutModelData*> _vectordata;
        std::vector<CutModelSaveBinInfo*> _undoredo;
-       CutModelData* getCutModelData(int id)throw( CutModelException);
+// EED 2022-08-04      
+//     CutModelData* getCutModelData(int id)throw( CutModelException);
+       CutModelData* getCutModelData(int id);
 
        CutModelPolygon* _polygonCutter;
        vtkPoints *contourPoints ;
index 06c9eeafdb0b1386c2d41451f2d3d6b90260507f..94216f86a63090f215737c41e7068d0211ecb6da 100644 (file)
 /**
 **     Start of the manager class
 **/
-CutModelSaveBinInfo::CutModelSaveBinInfo(int id, int currentaction, UNDOTYPE actiontype, std::string path){
-
+CutModelSaveBinInfo::CutModelSaveBinInfo(int id, int currentaction, UNDOTYPE actiontype, std::string path)
+{
        _id = id;
-
        char c[100];
        sprintf(c,"/infounrd_%d_fig_%d.info",currentaction,id);
-
        _stdFilename = path;    
     _stdFilename+=c;
        _stdFilename+=".poly";
-
        _matrixFilename = path; 
        _matrixFilename+=c;
        _actiontype = actiontype;       
-
-       
 }
-CutModelSaveBinInfo::~CutModelSaveBinInfo(){
-       
+
+CutModelSaveBinInfo::~CutModelSaveBinInfo()
+{      
 }
-void CutModelSaveBinInfo::savePolyData(vtkPolyData* polydata){
+
+void CutModelSaveBinInfo::savePolyData(vtkPolyData* polydata)
+{
        vtkPolyDataWriter * writer = vtkPolyDataWriter ::New();
        writer->SetFileName(_stdFilename.c_str());      
-
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        writer->SetInput(polydata);
@@ -80,70 +77,96 @@ void CutModelSaveBinInfo::savePolyData(vtkPolyData* polydata){
        writer->Delete();
 }
 
-vtkTransform* CutModelSaveBinInfo::getPolyDataTransform()throw( CutModelException){
-       vtkPolyDataReader* reader = vtkPolyDataReader::New();
-       //std::cout<<"filename vtkTransform* CutModelSaveBinInfo::getPolyDataTransform()"<<this->getSTDFileName()<<std::endl;
-       reader->SetFileName(this->getSTDFileName().c_str());
-       vtkPolyData* poly = reader->GetOutput();
-
-       vtkPolyDataMapper* mapper       = vtkPolyDataMapper::New();     
-//EED 2017-01-01 Migration VTK7
-#if VTK_MAJOR_VERSION <= 5
-       mapper->SetInput(poly);
-#else
-       mapper->SetInputData(poly);
-#endif
-       vtkActor* actor = vtkActor::New();
-       actor->SetMapper(mapper);
-       vtkMatrix4x4* actmatrix = actor->GetMatrix();
-
-       std::cout<<"tkTransform* CutModelSaveBinInfo::getPolyDataTransform() Actor "<<actor<<std::endl;
-       std::cout<<"tkTransform* CutModelSaveBinInfo::getPolyDataTransform() Actor Matrix "<<actmatrix<<std::endl;
-
-       mapper->Update();
-
-       vtkTransform* transform = vtkTransform::New();
-
-       transform->Identity();
-
-       transform->GetMatrix()->SetElement(0,0,actmatrix->GetElement(0,0));
-       transform->GetMatrix()->SetElement(1,0,actmatrix->GetElement(1,0));
-       transform->GetMatrix()->SetElement(2,0,actmatrix->GetElement(2,0));
-       transform->GetMatrix()->SetElement(0,1,actmatrix->GetElement(0,1));
-       transform->GetMatrix()->SetElement(1,1,actmatrix->GetElement(1,1));
-       transform->GetMatrix()->SetElement(2,1,actmatrix->GetElement(2,1));
-       transform->GetMatrix()->SetElement(0,2,actmatrix->GetElement(0,2));
-       transform->GetMatrix()->SetElement(1,2,actmatrix->GetElement(1,2));
-       transform->GetMatrix()->SetElement(2,2,actmatrix->GetElement(2,2));             
-       transform->GetMatrix()->SetElement(0,3,actmatrix->GetElement(0,3));
-       transform->GetMatrix()->SetElement(1,3,actmatrix->GetElement(1,3));
-       transform->GetMatrix()->SetElement(2,3,actmatrix->GetElement(2,3));
-
-       actor->Delete();
-       mapper->Delete();
-       reader->Delete();
-       //poly->Delete();
-       
-
-       return transform;
-       
+// EED 2022-08-04      throw
+//vtkTransform* CutModelSaveBinInfo::getPolyDataTransform()throw( CutModelException)
+vtkTransform* CutModelSaveBinInfo::getPolyDataTransform()
+{
+       try {
+                       vtkPolyDataReader* reader = vtkPolyDataReader::New();
+                       //std::cout<<"filename vtkTransform* CutModelSaveBinInfo::getPolyDataTransform()"<<this->getSTDFileName()<<std::endl;
+                       reader->SetFileName(this->getSTDFileName().c_str());
+                       vtkPolyData* poly = reader->GetOutput();
+
+                       vtkPolyDataMapper* mapper       = vtkPolyDataMapper::New();     
+               //EED 2017-01-01 Migration VTK7
+               #if VTK_MAJOR_VERSION <= 5
+                       mapper->SetInput(poly);
+               #else
+                       mapper->SetInputData(poly);
+               #endif
+                       vtkActor* actor = vtkActor::New();
+                       actor->SetMapper(mapper);
+                       vtkMatrix4x4* actmatrix = actor->GetMatrix();
+
+                       std::cout<<"tkTransform* CutModelSaveBinInfo::getPolyDataTransform() Actor "<<actor<<std::endl;
+                       std::cout<<"tkTransform* CutModelSaveBinInfo::getPolyDataTransform() Actor Matrix "<<actmatrix<<std::endl;
+
+                       mapper->Update();
+
+                       vtkTransform* transform = vtkTransform::New();
+
+                       transform->Identity();
+
+                       transform->GetMatrix()->SetElement(0,0,actmatrix->GetElement(0,0));
+                       transform->GetMatrix()->SetElement(1,0,actmatrix->GetElement(1,0));
+                       transform->GetMatrix()->SetElement(2,0,actmatrix->GetElement(2,0));
+                       transform->GetMatrix()->SetElement(0,1,actmatrix->GetElement(0,1));
+                       transform->GetMatrix()->SetElement(1,1,actmatrix->GetElement(1,1));
+                       transform->GetMatrix()->SetElement(2,1,actmatrix->GetElement(2,1));
+                       transform->GetMatrix()->SetElement(0,2,actmatrix->GetElement(0,2));
+                       transform->GetMatrix()->SetElement(1,2,actmatrix->GetElement(1,2));
+                       transform->GetMatrix()->SetElement(2,2,actmatrix->GetElement(2,2));             
+                       transform->GetMatrix()->SetElement(0,3,actmatrix->GetElement(0,3));
+                       transform->GetMatrix()->SetElement(1,3,actmatrix->GetElement(1,3));
+                       transform->GetMatrix()->SetElement(2,3,actmatrix->GetElement(2,3));
+
+                       actor->Delete();
+                       mapper->Delete();
+                       reader->Delete();
+                       //poly->Delete();
+                       return transform;
+       } catch (...) {
+         throw ;
+       }
 }
 
-
-void CutModelSaveBinInfo::saveMatrix4x4(vtkMatrix4x4* matrix){
+void CutModelSaveBinInfo::saveMatrix4x4(vtkMatrix4x4* matrix)
+{
        fstream binary_file(_matrixFilename.c_str(),ios::out|ios::binary);
        binary_file.write(reinterpret_cast<char *>(matrix),sizeof(vtkMatrix4x4));
        binary_file.close();
 }
-vtkTransform* CutModelSaveBinInfo::getTransformFromMatrixFile()throw( CutModelException){
-       vtkMatrix4x4* matrix = vtkMatrix4x4::New();
-       fstream binary_file(_matrixFilename.c_str(),ios::binary|ios::in);
-       binary_file.read(reinterpret_cast<char *>(matrix),sizeof(vtkMatrix4x4));
-       binary_file.close();
 
-       vtkTransform* transform = vtkTransform::New();
-       transform->SetMatrix(matrix);
+// EED 2022-08-04      throw
+//vtkTransform* CutModelSaveBinInfo::getTransformFromMatrixFile()throw( CutModelException)
+vtkTransform* CutModelSaveBinInfo::getTransformFromMatrixFile()
+{
+       try {
+               vtkMatrix4x4* matrix = vtkMatrix4x4::New();
+               fstream binary_file(_matrixFilename.c_str(),ios::binary|ios::in);
+               binary_file.read(reinterpret_cast<char *>(matrix),sizeof(vtkMatrix4x4));
+               binary_file.close();
+               vtkTransform* transform = vtkTransform::New();
+               transform->SetMatrix(matrix);
+               return transform;
+       } catch (...) {
+         throw ;
+       }
+}
 
-       return transform;
+// EED 2022-08-04      throw
+//std::string CutModelSaveBinInfo::getSTDFileName()throw( CutModelException)
+std::string CutModelSaveBinInfo::getSTDFileName()
+{
+       try {
+               if(_stdFilename=="")
+               {
+                       throw new CutModelException("Filename undoredo does not exists");
+               }
+               return _stdFilename;
+       } catch (...) {
+         throw ;
+       }
 }
 
+
index 8c5f1fa00cc45c382f070561650ab93874fd505d..849dcdfb5721c9b09b0dce00b7c8fe62fd08c114 100644 (file)
@@ -80,12 +80,17 @@ public:
        UNDOTYPE getActionType(){
                return _actiontype;
        }
-       std::string getSTDFileName()throw( CutModelException){
-               if(_stdFilename==""){
-                       throw new CutModelException("Filename undoredo does not exists");
-               }
-               return _stdFilename;
-       }
+
+// EED 2022-08-04      
+//     std::string getSTDFileName()throw( CutModelException);
+//     std::string getSTDFileName()throw( CutModelException){
+//             if(_stdFilename==""){
+//                     throw new CutModelException("Filename undoredo does not exists");
+//             }
+//             return _stdFilename;
+//     }
+       std::string getSTDFileName();
+
 
        /*void setSTDFileName(std::string filename){
                _stdFilename = filename;
@@ -101,10 +106,14 @@ public:
 
        void savePolyData(vtkPolyData* polydata);
 
-       vtkTransform* getPolyDataTransform()throw( CutModelException);  
 
+// EED 2022-08-04      
+//     vtkTransform* getPolyDataTransform()throw( CutModelException);  
+//     vtkTransform* getTransformFromMatrixFile()throw( CutModelException);
+       vtkTransform* getPolyDataTransform();   
+       vtkTransform* getTransformFromMatrixFile();
+       
        void saveMatrix4x4(vtkMatrix4x4* matrix);
-       vtkTransform* getTransformFromMatrixFile()throw( CutModelException);
 
        void setRange(double* range){
                _range = range;
index 618bd36bd95a4cc6eda25f33af539a8ec26b03f1..684dc1562c4aed699f4962079d5f7d87e79b6812 100644 (file)
@@ -65,7 +65,10 @@ void PlaneDirectionViewer::SetVectors( std::vector<double> lstPointsx, std::vect
        manager->SetVectors(lstPointsx,lstPointsy,lstPointsz);
 }
 
-void PlaneDirectionViewer::UpdateDirections() throw (std::exception){
+// EED 2022-08-04      throw
+//void PlaneDirectionViewer::UpdateDirections() throw (std::exception)
+void PlaneDirectionViewer::UpdateDirections() 
+{
        manager->UpdateDirections();
        std::vector<PlaneDirectionManagerData*> vectdata = manager->GetPlanesData();
        int i;
index 86e76ef1d610103be7693a97cb41fe85c6f5688c..40dbb0f43e6fcf5162ec0477b4c5edb97c7e2b05 100644 (file)
@@ -43,22 +43,18 @@ class  creaMaracasVisu_EXPORT PlaneDirectionViewer : public wxPanel  {
 public:
        PlaneDirectionViewer(wxWindow* parent, int radio, double colour[3], int opacity);       
        ~PlaneDirectionViewer();        
-
        void SetRenderer(vtkRenderer* render);
        void SetVectors( std::vector<double> lstPointsx, std::vector<double> lstPointsy, std::vector<double> lstPointsz);
-
-       void UpdateDirections() throw (std::exception);
-
+       
+// EED 2022-08-04      throw
+//     void UpdateDirections() throw (std::exception);
+       void UpdateDirections();
+       
        static PlaneDirectionViewer* getInstance(wxWindow* parent,int radio, double colour[3], int opacity);
-
        static PlaneDirectionViewer* getInstance();
-       
        void addRemoveActor(int index, bool addremove);
-
        void changeColor(int index,double r,double g,double b);
-
        void WriteInformation(std::string filename,double* spc=NULL);
-
        void SetArrowSize(int arrowsize);
 private:
        static PlaneDirectionViewer* instance;
index 1e6ef4d645011bbd6467fc1915f34e3970d6f697..54e9eb555b0511786168a68c86160ec8d28c0d41 100644 (file)
@@ -225,7 +225,7 @@ void draw(wxDC & dc,mpWindow & w,double x1,double y1,double x2,double y2, int or
        Get Point list of the funcion
        @param return points
        */
-       virtual wxList* GetPointsPtr(){  }
+       virtual wxList* GetPointsPtr(){ return NULL; }
 #endif
 
 
index c0690bdaf5b9fbaeff30e98082365758127abde1..093961f5cf355fcd0dbe7f606cb0f27a75727cb9 100644 (file)
@@ -80,76 +80,97 @@ void wxMaracasMultipleVolumeRendererManager::Update(int ppid){
 /**
 **     Adds a prop3D to the manager and returns the identifier
 **/
-int wxMaracasMultipleVolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string dataname) throw(char*){
-       checkInvariant();
-       image = vol;
-       if(vol != NULL){
-               wxMaracasMultipleVolumeRendererManagerData* data = new wxMaracasMultipleVolumeRendererManagerData(vol, dataname);
-               prop3Dvect.push_back(data);
-               _renderer->AddActor(data->getProp3D());
-               if(idTP == -1)
-               {
-                       data->setId(_idCount);
-                       _idCount++;
-               }
-               else
-               {
-                       data->setId(idTP);
+// EED 2022-08-04      throw
+//int wxMaracasMultipleVolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string dataname) throw(char*)
+int wxMaracasMultipleVolumeRendererManager::addVolume(int idTP, vtkImageData* vol, std::string dataname) 
+{
+       try {
+               checkInvariant();
+               image = vol;
+               if(vol != NULL){
+                       wxMaracasMultipleVolumeRendererManagerData* data = new wxMaracasMultipleVolumeRendererManagerData(vol, dataname);
+                       prop3Dvect.push_back(data);
+                       _renderer->AddActor(data->getProp3D());
+                       if(idTP == -1)
+                       {
+                               data->setId(_idCount);
+                               _idCount++;
+                       }
+                       else
+                       {
+                               data->setId(idTP);
+                       }
+                       printf("wxMaracasMultipleVolumeRendererManager::addVolume->idVolumeRenderer: %i\n", data->getId());
+                       return data->getId();
+               }else{
+                       throw "Check mhd imagefile file or input";
                }
-               printf("wxMaracasMultipleVolumeRendererManager::addVolume->idVolumeRenderer: %i\n", data->getId());
-               return data->getId();
-       }else{
-               throw "Check mhd imagefile file or input";
+               return -1;
+       } catch (...) {
+         throw ;
        }
-       return -1;
 }
 /**
 **     adds or removes an actor depending of the bool value
 **/
 
-void wxMaracasMultipleVolumeRendererManager::addRemoveActor(int propid, bool addremove)  throw(char*)
+// EED 2022-08-04      throw
+//void wxMaracasMultipleVolumeRendererManager::addRemoveActor(int propid, bool addremove)  throw(char*)
+void wxMaracasMultipleVolumeRendererManager::addRemoveActor(int propid, bool addremove) 
 {
-       checkInvariant();
-       
-       wxMaracasMultipleVolumeRendererManagerData* data = this->getViewData(propid);           
-       if(data->getProp3D()!=NULL){
-               if(addremove){
-                       _renderer->AddViewProp(data->getProp3D());
-               }else{
-                       _renderer->RemoveViewProp(data->getProp3D());
-               }
-               _renderer->GetRenderWindow()->Render();
-       }
-       
+       try {
+               checkInvariant();
+               wxMaracasMultipleVolumeRendererManagerData* data = this->getViewData(propid);           
+               if(data->getProp3D()!=NULL){
+                       if(addremove){
+                               _renderer->AddViewProp(data->getProp3D());
+                       }else{
+                               _renderer->RemoveViewProp(data->getProp3D());
+                       }
+                       _renderer->GetRenderWindow()->Render();
+               }       
+       } catch (...) {
+         throw ;
+       }       
 }
 
 
 /**
 **     Changes the opacity in a prop3D
 **/
-void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value)  throw(char*)
+// EED 2022-08-04      throw
+// void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*)
+void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value)
 {
-       checkInvariant();               
-
-       this->getViewData(propid)->setVolumeOpacity(greylevel, value);
-       
-       _renderer->GetRenderWindow()->Render();
-
+       try {
+               checkInvariant();               
+               this->getViewData(propid)->setVolumeOpacity(greylevel, value);
+               _renderer->GetRenderWindow()->Render();
+       } catch (...) {
+         throw ;
+       }       
 }
 
 /**
 **     Set Volume Color
 **/
+// EED 2022-08-04      throw
+//void wxMaracasMultipleVolumeRendererManager::setVolumeColor(int volid, std::vector<double> greylevel,
+//                                                             std::vector<double> red,
+//                                                             std::vector<double> green,
+//                                                             std::vector<double> blue)throw(char*)
 void wxMaracasMultipleVolumeRendererManager::setVolumeColor(int volid, std::vector<double> greylevel,
                                                                std::vector<double> red,
                                                                std::vector<double> green,
-                                                               std::vector<double> blue)throw(char*)
+                                                               std::vector<double> blue)
 {
-       checkInvariant();               
-
-       this->getViewData(volid)->setVolumeColor(greylevel, red, green, blue);
-       
-       _renderer->GetRenderWindow()->Render();
+       try {
+               checkInvariant();               
+               this->getViewData(volid)->setVolumeColor(greylevel, red, green, blue);
+               _renderer->GetRenderWindow()->Render();
+       } catch (...) {
+         throw ;
+       }       
 }
 
 
@@ -180,79 +201,93 @@ vtkImageData* wxMaracasMultipleVolumeRendererManager::getImageData(std::string f
        return NULL;
 }
 
-
 vtkImageData* wxMaracasMultipleVolumeRendererManager::getImageData()
 {
        return image;
 }
 
-
-void wxMaracasMultipleVolumeRendererManager::checkInvariant()  throw(char*)
+// EED 2022-08-04      throw
+//void wxMaracasMultipleVolumeRendererManager::checkInvariant()  throw(char*)
+void wxMaracasMultipleVolumeRendererManager::checkInvariant() 
 {
-       if(this->_renderer==NULL){
-               throw "Renderer not set";
-       }
+       try {
+               if(this->_renderer==NULL)
+               {
+                       throw "Renderer not set";
+               }
+       } catch (...) {
+         throw ;
+       }       
 }
 
-
-wxMaracasMultipleVolumeRendererManagerData* wxMaracasMultipleVolumeRendererManager::getViewData(int id) throw(char*)
+// EED 2022-08-04      throw
+//wxMaracasMultipleVolumeRendererManagerData* wxMaracasMultipleVolumeRendererManager::getViewData(int id) throw(char*)
+wxMaracasMultipleVolumeRendererManagerData* wxMaracasMultipleVolumeRendererManager::getViewData(int id) 
 {
-    int i;
-       for(i = 0; i < (int)(prop3Dvect.size());i++){
-               if(prop3Dvect[i]->getId() == id){
-                       return prop3Dvect[i];
+       try {
+               int i;
+               for(i = 0; i < (int)(prop3Dvect.size());i++){
+                       if(prop3Dvect[i]->getId() == id){
+                               return prop3Dvect[i];
+                       }
                }
-       }
-       throw "id not found in the data";
-
-       return NULL;
+               throw "id not found in the data";
+               return NULL;
+       } catch (...) {
+         throw ;
+       }       
 }
 
-
-void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) throw (char *)
+// EED 2022-08-04      throw
+//void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) throw (char *)
+void wxMaracasMultipleVolumeRendererManager::deleteActor(int propid) 
 {
-       checkInvariant();       
-
-       this->addRemoveActor(propid, false);
-
-       int i,n;
-       bool exit = false;
-       for(i = 0; i < (int)(prop3Dvect.size())&&!exit;i++){
-               if(prop3Dvect[i]->getId() == propid){                   
-                       n=i;
-                       exit = true;
+       try {
+               checkInvariant();       
+               this->addRemoveActor(propid, false);
+               int i,n;
+               bool exit = false;
+               for(i = 0; i < (int)(prop3Dvect.size())&&!exit;i++){
+                       if(prop3Dvect[i]->getId() == propid){                   
+                               n=i;
+                               exit = true;
+                       }
                }
-       }
-       if(exit){
-               wxMaracasMultipleVolumeRendererManagerData* data = prop3Dvect[n];                       
-               int j;
-               for(j = i; j < (int)(prop3Dvect.size())-1;j++){
-                       prop3Dvect[j] = prop3Dvect[j+1];
-               }               
-               delete data;
-               prop3Dvect.pop_back();
-       }else{
-               throw "id not found in the data";
+               if(exit){
+                       wxMaracasMultipleVolumeRendererManagerData* data = prop3Dvect[n];                       
+                       int j;
+                       for(j = i; j < (int)(prop3Dvect.size())-1;j++){
+                               prop3Dvect[j] = prop3Dvect[j+1];
+                       }               
+                       delete data;
+                       prop3Dvect.pop_back();
+               }else{
+                       throw "id not found in the data";
+               }
+       } catch (...) {
+         throw ;
        }       
-    
 }
 
-
 vtkPiecewiseFunction* wxMaracasMultipleVolumeRendererManager::GetTransferFunction(int volumeid)
 {
        return getViewData(volumeid)->GetTransferFunction();
 }
 
-
 vtkColorTransferFunction* wxMaracasMultipleVolumeRendererManager::GetColorFunction(int volumeid)
 {
-
        return getViewData(volumeid)->GetColorFunction();
 }
 
 
-void wxMaracasMultipleVolumeRendererManager::changeCompositeMIPFunction(int id, int function) throw (char *)
+// EED 2022-08-04      throw
+//void wxMaracasMultipleVolumeRendererManager::changeCompositeMIPFunction(int id, int function) throw (char *)
+void wxMaracasMultipleVolumeRendererManager::changeCompositeMIPFunction(int id, int function) 
 {
-       getViewData(id)->changeCompositeMIPFunction(function);
-       Update(id);
+       try {
+               getViewData(id)->changeCompositeMIPFunction(function);
+               Update(id);
+       } catch (...) {
+         throw ;
+       }       
 }
index 2ed4cd8fa5d93e990c28d6ba1f4219dfb49c24f9..985d98ad3bf96d69ffeeb5b3550ea80c10bf140b 100644 (file)
@@ -72,7 +72,9 @@ public:
        /**
        **      Adds a volume
        **/
-       int addVolume(int idTP, vtkImageData* img, std::string dataname) throw (char*); 
+// EED 2022-08-04      throw
+//     int addVolume(int idTP, vtkImageData* img, std::string dataname) throw (char*); 
+       int addVolume(int idTP, vtkImageData* img, std::string dataname);       
        
        /**
        **      loads a prop3D from a nSTL file
@@ -92,36 +94,53 @@ public:
        /**
        **      adds or removes an actor depending of the bool value
        **/
-       void addRemoveActor(int propid, bool addremove) throw(char*);
-       
+// EED 2022-08-04      throw
+//     void addRemoveActor(int propid, bool addremove) throw(char*);
+       void addRemoveActor(int propid, bool addremove);
+               
        /**
        **      Check if the variables are setted correctly
        **/
-       void checkInvariant()throw(char*);
+// EED 2022-08-04      throw
+//     void checkInvariant()throw(char*);
+       void checkInvariant();
 
        /** 
        ** Set Volume Opacity
        **/
-       void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*);
+// EED 2022-08-04      throw
+//     void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value) throw(char*);
+       void setVolumeOpacity(int propid, std::vector<double> greylevel,std::vector<double> value);
        /**
        **      Set Volume Color
        **/
+// EED 2022-08-04      throw
+//     void setVolumeColor(int volid, std::vector<double> greylevel,
+//                                                                     std::vector<double> red,
+//                                                                     std::vector<double> green,
+//                                                                     std::vector<double> blue)throw(char*);  
        void setVolumeColor(int volid, std::vector<double> greylevel,
                                                                        std::vector<double> red,
                                                                        std::vector<double> green,
-                                                                       std::vector<double> blue)throw(char*);  
+                                                                       std::vector<double> blue);      
 
        /**
        ** Given an id search the data in the vector
        **/
-       wxMaracasMultipleVolumeRendererManagerData* getViewData(int id)throw(char*);
+// EED 2022-08-04      throw
+//     wxMaracasMultipleVolumeRendererManagerData* getViewData(int id)throw(char*);
+       wxMaracasMultipleVolumeRendererManagerData* getViewData(int id);
 
-       void changeCompositeMIPFunction(int id, int function) throw (char *);
+// EED 2022-08-04      throw
+//     void changeCompositeMIPFunction(int id, int function) throw (char *);
+       void changeCompositeMIPFunction(int id, int function) ;
        
        /**
        ** Deletes given actor
        **/
-       void deleteActor(int volumeid)throw (char *);
+// EED 2022-08-04      throw
+//     void deleteActor(int volumeid)throw (char *);
+       void deleteActor(int volumeid);
 
        /**
        ** Updates given volume
index d71d3e91bac1b45d89d1006f682f54a80932bf63..58c77b3a7f988aa9602029a323f88d20409509e8 100644 (file)
@@ -73,24 +73,20 @@ wxMaracasMultipleVolumeRendererManagerData::wxMaracasMultipleVolumeRendererManag
 }
 
 
-wxMaracasMultipleVolumeRendererManagerData::~wxMaracasMultipleVolumeRendererManagerData(){
-       
+wxMaracasMultipleVolumeRendererManagerData::~wxMaracasMultipleVolumeRendererManagerData()
+{      
        _tfun->Delete();
        _ctfun->Delete();
        _volumePlanes->Delete();
-
-
 #if (VTK_MAJOR_VERSION <= 7) 
        _compositeFunction->Delete();
 #else 
        // ..
 #endif
-
        _volumeMapper->Delete();
 
        _volumeProperty->Delete();
        _newvol->Delete();
-       
 }
 /**
 **     Set Volume Color
@@ -112,8 +108,8 @@ void wxMaracasMultipleVolumeRendererManagerData::setVolumeColor(std::vector<doub
 /**
 **     Volume Opacity
 **/
-void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,std::vector<double> value){
-               
+void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,std::vector<double> value)
+{              
        _tfun->RemoveAllPoints();
        for(int i = 0; i < greylevel.size();i++){
                _tfun->AddPoint(greylevel[i], value[i]);
@@ -125,25 +121,29 @@ void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vector<do
 /**
 **     Check if the variables are setted correctly
 **/
-void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *)
-{
-
-       
-#if (VTK_MAJOR_VERSION <= 7) 
-       if(!_compositeFunction)
-       {
-               throw "No composite function initialized";
-       }
-       if(!_MIPFunction)
-       {
-               throw "No MIP function initialized";
-       }
-#else 
-       // ..
-#endif
-       if(!_volumeMapper)
-       {
-               throw "No volume mapper initialized";
+// EED 2022-08-04      throw
+//void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *)
+void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()
+{      
+       try {
+               #if (VTK_MAJOR_VERSION <= 7) 
+                       if(!_compositeFunction)
+                       {
+                               throw "No composite function initialized";
+                       }
+                       if(!_MIPFunction)
+                       {
+                               throw "No MIP function initialized";
+                       }
+               #else 
+                       // ..
+               #endif
+                       if(!_volumeMapper)
+                       {
+                               throw "No volume mapper initialized";
+                       }
+       } catch (...) {
+         throw ;
        }
 }
 
@@ -185,17 +185,24 @@ void wxMaracasMultipleVolumeRendererManagerData::setDataname(std::string datanam
        _dataname = dataname;
 }
 
-void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *)
+// EED 2022-08-04      throw
+//void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *)
+void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) 
 {
-       checkInvariant();       
-#if (VTK_MAJOR_VERSION <= 7) 
-       if(function == 0)
-       {
-               _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
-       }else{
-               _volumeMapper->SetVolumeRayCastFunction(_MIPFunction);
+       try {
+                       checkInvariant();       
+               #if (VTK_MAJOR_VERSION <= 7) 
+                       if(function == 0)
+                       {
+                               _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+                       }else{
+                               _volumeMapper->SetVolumeRayCastFunction(_MIPFunction);
+                       }
+               #else 
+                       printf("EED   wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction   Composite MIP  ..... ??");
+               #endif
+       } catch (...) {
+         throw ;
        }
-#else 
-       printf("EED   wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction   Composite MIP  ..... ??");
-#endif
 }
+
index 712cd0e293def352ad9907b1e08a8edc984776a4..3473e0f468e0490899ea83386011517c9c87ce7d 100644 (file)
@@ -58,7 +58,9 @@ public:
        /**
        **      Check if the variables are setted correctly
        **/
-       void checkInvariant()throw (char *);
+// EED 2022-08-04      throw
+//     void checkInvariant()throw (char *);
+       void checkInvariant();
 
        /**
        ** Updates volume
@@ -102,16 +104,12 @@ public:
        **      Volume Opacity
        **/
        void setVolumeOpacity(std::vector<double> greylevel,std::vector<double> value);
-
-       vtkPiecewiseFunction* GetTransferFunction(){
-               return _tfun;
-       }
-
-       vtkColorTransferFunction* GetColorFunction(){
-               return _ctfun;
-       }
-
-       void changeCompositeMIPFunction(int function) throw (char *);
+       vtkPiecewiseFunction* GetTransferFunction(){    return _tfun;   }
+       vtkColorTransferFunction* GetColorFunction(){   return _ctfun;  }
+       
+// EED 2022-08-04      throw
+//     void changeCompositeMIPFunction(int function) throw (char *);
+       void changeCompositeMIPFunction(int function) ;
        
 protected:
        /**
@@ -122,23 +120,16 @@ protected:
         *  Dataname given by the user (ex. filename) 
         **/
        std::string _dataname;  
-       
-       
 private:
-       
        /*
         * id of the data
         */
        int _id;                
-
-
-
        vtkPlanes                                                       *_volumePlanes;
        vtkVolumeProperty                                       *_volumeProperty;
        vtkVolume                                                       *_newvol;
        vtkPiecewiseFunction                            *_tfun;
        vtkColorTransferFunction                        *_ctfun;
-       
 #if (VTK_MAJOR_VERSION <= 7) 
        vtkVolumeRayCastMIPFunction                     *_MIPFunction;
        vtkVolumeRayCastCompositeFunction       *_compositeFunction;
@@ -146,9 +137,6 @@ private:
 #else 
        vtkFixedPointVolumeRayCastMapper        *_volumeMapper;
 #endif
-       
-
-       
 };
 
 #endif /*wxMaracasMultipleVolumeRendererManagerData_H_*/
index a59cd60b3a2c304cac4d268a4032410c9c3597eb..2d648e5090701c706dbb05f9384de6709a5eb042 100644 (file)
@@ -130,22 +130,25 @@ void wxMaracasRenderImageTransformation::Translate(int tx, int ty, int tz, int r
 /**
 ** Updates each Matrix
 **/
-void wxMaracasRenderImageTransformation::Refresh()throw(char*)
+// EED 2022-08-04      throw
+//void wxMaracasRenderImageTransformation::Refresh()throw(char*)
+void wxMaracasRenderImageTransformation::Refresh()
 {
-       transformV->Update();
-       transformS1->Update();
-       transformS2->Update();
-       transformS3->Update();
+       try {
+               transformV->Update();
+               transformS1->Update();
+               transformS2->Update();
+               transformS3->Update();
+               vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+               //vol->Update(propID);
+               surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+               //surface1->Update(propID);
+               surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+               //surface2->getRenderer()->Render();
+               surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
+               //surface3->getRenderer()->Render();
+       } catch (...) {
+         throw ;
+       }
 
-       vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
-       //vol->Update(propID);
-
-       surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
-       //surface1->Update(propID);
-
-       surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
-       //surface2->getRenderer()->Render();
-
-       surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
-       //surface3->getRenderer()->Render();
 }
index aec7cf757db9e4770ba54937a8c5ffa97f2ad315..7313f2a3d23cf11319e1b677957cf8ab6ae6fe4c 100644 (file)
@@ -41,7 +41,9 @@ public:
        ~wxMaracasRenderImageTransformation();
 
        void Translate(int tx, int ty, int tz, int rx, int ry, int rz, int sx, int sy, int sz);
-       void Refresh()throw(char*);
+// EED 2022-08-04      
+//     void Refresh()throw(char*);
+       void Refresh();
 
 private:
         VolumeRendererManager* vol;
index ce9dfaa449db8a907803bbd7efa3ac9de19e57fc..f226ef3e15a4ea6497913c443aebaf62f4a28c21 100644 (file)
@@ -106,17 +106,22 @@ std::string wxMaracasRendererView::getPath()
 /**
 ** Returns internal panel
 **/
-wxMaracasRenderTabbedPanel* wxMaracasRendererView::getTabbedPanel(int id) throw(char*)
+// EED 2022-08-04      throw
+//wxMaracasRenderTabbedPanel* wxMaracasRendererView::getTabbedPanel(int id) throw(char*)
+wxMaracasRenderTabbedPanel* wxMaracasRendererView::getTabbedPanel(int id) 
 {
-       int i;
-       for(i = 0; i < (int)tabsVector.size(); i++)
-       {
-               if(tabsVector[i]->getPropIdV() == id)
-                       return tabsVector[i];
+       try {
+               int i;
+               for(i = 0; i < (int)tabsVector.size(); i++)
+               {
+                       if(tabsVector[i]->getPropIdV() == id)
+                               return tabsVector[i];
+               }
+               throw "id not found";
+               return NULL;
+       } catch (...) {
+         throw ;
        }
-       throw "id not found";
-
-       return NULL;
 }
 
 /**
index 3b33ab47ececb588fb06975a481133049413b577..c3b49b0036466ec6ace4feec8fff866b162cf142 100644 (file)
@@ -62,7 +62,10 @@ public:
        static wxMaracasRendererView* getInstance();
 
        std::string getPath();
-       wxMaracasRenderTabbedPanel* getTabbedPanel(int id) throw(char*);
+       
+// EED 2022-08-04      
+//     wxMaracasRenderTabbedPanel* getTabbedPanel(int id) throw(char*);
+       wxMaracasRenderTabbedPanel* getTabbedPanel(int id);
 
        void setRenderer(vtkRenderer*  renderer); /* throw(char*), */   // JPR
        void setVtkBaseView(wxVtk3DBaseView* base);
index 81ff519e9702ed1c18715219756b00988cd230df..99c7a36a4c2673912b80ed213a2148e1a35a98a2 100644 (file)
@@ -68,13 +68,21 @@ wxVtkBaseView::~wxVtkBaseView()
        //_iren=NULL;
 }
 //-------------------------------------------------------------------
-crea::wxVTKRenderWindowInteractor* wxVtkBaseView::GetWxVTKRenderWindowInteractor() throw (char*)
+
+// EED 2022-08-04      throw
+//crea::wxVTKRenderWindowInteractor* wxVtkBaseView::GetWxVTKRenderWindowInteractor() throw (char*)
+crea::wxVTKRenderWindowInteractor* wxVtkBaseView::GetWxVTKRenderWindowInteractor() 
 {
-       if(_iren==NULL)
-       {
-               throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren cwxVTKRenderWindowInteractorPlus =NULL";
+       try {
+               if(_iren==NULL)
+               {
+                       throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren cwxVTKRenderWindowInteractorPlus =NULL";
+               }
+          return _iren;
+       } catch (...) {
+         throw ;
        }
-   return _iren;
+   
 }
 //-------------------------------------------------------------------
 void wxVtkBaseView::Configure()  // virtual 
index de70a525c8b916d6a5709f8f40986d8f2409ff91..e78285f99bc9c47974f057ec4f32bdaa4b915f29 100644 (file)
@@ -69,7 +69,11 @@ public:
        wxVtkBaseView( );
        wxVtkBaseView( wxWindow *parent, bool TDxWindow=false );
        virtual ~wxVtkBaseView();
-       crea::wxVTKRenderWindowInteractor       *GetWxVTKRenderWindowInteractor() throw (char*);
+       
+// EED 2022-08-04      
+//     crea::wxVTKRenderWindowInteractor       *GetWxVTKRenderWindowInteractor() throw (char*);
+       crea::wxVTKRenderWindowInteractor       *GetWxVTKRenderWindowInteractor();
+       
        virtual void                            Configure();
        virtual void                            Refresh();
        virtual void                            RefreshView();
index a9a493a503a931f3d7516e48a3715fd2d052655a..ccbecf8a8b4ffc69fedb430a3e6f1faac6d082bf 100644 (file)
@@ -161,12 +161,18 @@ void wxVtkClipping3DView::VisibleVolumeActor( bool visVolume){
 }
 
 //-------------------------------------------------------------------
-wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview()throw(char*)
+// EED 2022-08-04      throw
+//wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview()throw(char*)
+wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview()
 {
-       if(_wxvtk3Dbaseview==NULL){
-               throw "wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview() _wxvtk3Dbaseview=NULL";
+       try {
+               if(_wxvtk3Dbaseview==NULL){
+                       throw "wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview() _wxvtk3Dbaseview=NULL";
+               }
+               return _wxvtk3Dbaseview;
+       } catch (...) {
+         throw ;
        }
-       return _wxvtk3Dbaseview;
 }
 
 //-------------------------------------------------------------------
index dcff3c9717765a75cc9f79c99d84bfe5f140fab9..b821488b6938213dbbb6bc0a3cfbfbe5e72be574 100644 (file)
@@ -57,14 +57,16 @@ public:
        void                                    SetVisibleBoxVolume(bool visible);
        void                                    SetRepSurfaceWireFrame(int idTissue , bool typeRepresentation );
 
-       wxVtk3DBaseView*                GetWxvtk3Dbaseview()throw(char*);
+// EED 2022-08-04      
+//     wxVtk3DBaseView*                GetWxvtk3Dbaseview()throw(char*);
+       wxVtk3DBaseView*                GetWxvtk3Dbaseview();
 
        void                    SetRayCasting(bool active);
        void                    SetMIPActive(bool active);
-   void                                SetInterpolation(bool active);
-   void                                SetShade(bool active);
+       void                            SetInterpolation(bool active);
+       void                            SetShade(bool active);
 
-   void                                UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
+       void                            UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
 
 
 private:
index 23b6ce1ad4b199dde4a41aa3525362bc8b08d38b..1525055731f564261d9b8d79a273b3ef89afce0f 100644 (file)
@@ -636,13 +636,19 @@ vtkMPR3DDataViewer* wxVtkMPR3DView::GetVtkMPR3DDataViewer()
        return _vtkmpr3Ddataviewer;
 }
 //-------------------------------------------------------------------
-wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() throw (char*)
+// EED 2022-08-04      throw
+//wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() throw (char*)
+wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() 
 {
-       if(_wxvtk3Dbaseview==NULL)
-       {
-               throw "wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() _wxvtk3Dbaseview=NULL";
+       try {
+               if(_wxvtk3Dbaseview==NULL)
+               {
+                       throw "wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() _wxvtk3Dbaseview=NULL";
+               }
+               return _wxvtk3Dbaseview;
+       } catch (...) {
+         throw ;
        }
-       return _wxvtk3Dbaseview;
 }
 //-------------------------------------------------------------------
 
index b7bffd41759de49345e2733b4d01d9b873864d93..6c4b9066ec844411f048a26c4a8c7e99020c1272 100644 (file)
@@ -58,7 +58,9 @@ public:
        void                            SetVtkMPR3DDataViewer( vtkMPR3DDataViewer *vtkmpr3Ddataviewer );
        wxPanel*                        CreateControlPanel(wxWindow *parent, bool align);
        vtkMPR3DDataViewer* GetVtkMPR3DDataViewer();
-       wxVtk3DBaseView*        GetWxvtk3Dbaseview() throw (char*);
+// EED 2020-08-04
+//     wxVtk3DBaseView*        GetWxvtk3Dbaseview() throw (char*);
+       wxVtk3DBaseView*        GetWxvtk3Dbaseview();
        void                            InitOrientationPointWidget(); 
        void                            showOutlineBoxActor(bool value);
        void                            showOutlinePlaneActor(bool value);
index b6b82acbc7fe6b5c517ec5ced1c3c0cb3774aa45..469a6164fcc2e27f250f3472faefe73d11dbc2be 100644 (file)
@@ -76,16 +76,23 @@ vtkPlane2DView *wxMaracasMPR::GetVtkPlane2DView()
 {
        return _MPR->GetVtkPlane2DView();
 }
+
 //----------------------------------------------------------------------------
-wxVtkMPR3DView  *wxMaracasMPR::GetWxvtkmpr3Dview_BB() throw(char*)
+// EED 2022-08-04      throw
+//wxVtkMPR3DView  *wxMaracasMPR::GetWxvtkmpr3Dview_BB() throw(char*)
+wxVtkMPR3DView  *wxMaracasMPR::GetWxvtkmpr3Dview_BB()
 { 
-       if(_MPR == NULL){ 
-        throw "wxVtkMPR3DView  *wxMaracasMPR::GetWxvtkmpr3Dview_BB() _MPR =NULL";
-       }
-       if(_MPR->GetWxvtkmpr3Dview_BB() ==NULL){
-               throw "wxVtkMPR3DView  *wxMaracasMPR::GetWxvtkmpr3Dview_BB() _MPR->GetWxvtkmpr3Dview_BB()=NULL";
+       try {
+               if(_MPR == NULL){ 
+                   throw "wxVtkMPR3DView  *wxMaracasMPR::GetWxvtkmpr3Dview_BB() _MPR =NULL";
+               }
+               if(_MPR->GetWxvtkmpr3Dview_BB() ==NULL){
+                       throw "wxVtkMPR3DView  *wxMaracasMPR::GetWxvtkmpr3Dview_BB() _MPR->GetWxvtkmpr3Dview_BB()=NULL";
+               }
+               return _MPR->GetWxvtkmpr3Dview_BB();
+       } catch (...) {
+         throw ;
        }
-       return _MPR->GetWxvtkmpr3Dview_BB();
 }
 
 //----------------------------------------------------------------------------
index f84c15d4c5dbfed19a4a9bd226a12f4b1c4f1a9c..925af43346ca4f07fe80ff4372685599e61667d2 100644 (file)
@@ -60,7 +60,11 @@ public:
        void ConfigureVTK();
        vtkMPRBaseData  *GetVtkMPRBaseData();
        vtkPlane2DView  *GetVtkPlane2DView();
-       wxVtkMPR3DView  *GetWxvtkmpr3Dview_BB()throw(char*);
+
+// EED 2022-08-04      throw
+//     wxVtkMPR3DView  *GetWxvtkmpr3Dview_BB()throw(char*);
+       wxVtkMPR3DView  *GetWxvtkmpr3Dview_BB();
+
        void                    RefreshView();
 
        void setImageData(vtkImageData *img, double voxelsize);
index 6cd2047a0705943a27f2bec54ea426d262657668..860cf2e24f311f04b82fe57db28898b855382e2c 100644 (file)
@@ -51,11 +51,17 @@ void PlaneDirectionManager::SetVectors( std::vector<double> lstPointsx, std::vec
        _lstPointsz = lstPointsz;
 }
 
-void PlaneDirectionManager::UpdateDirections() throw (std::exception){ 
-       UpdateVectors();
-       UpdateActors();
-       AddActors();
-
+// EED 2022-08-04      throw
+//void PlaneDirectionManager::UpdateDirections() throw (std::exception)
+void PlaneDirectionManager::UpdateDirections() 
+{
+       try {
+               UpdateVectors();
+               UpdateActors();
+               AddActors();
+       } catch (...) {
+         throw ;
+       }
 }
 
 void PlaneDirectionManager::AddActors(){
@@ -65,42 +71,57 @@ void PlaneDirectionManager::AddActors(){
        }
 }
 
-void PlaneDirectionManager::RemoveAllActorsFromIndex(int n)throw (std::exception){
-       /*due to incompleate set of points to create the plane
-       */                              
-       if(_render==NULL){
-               throw std::exception();
+// EED 2022-08-04      throw
+//void PlaneDirectionManager::RemoveAllActorsFromIndex(int n)throw (std::exception)
+void PlaneDirectionManager::RemoveAllActorsFromIndex(int n)
+{
+       try{
+               /*due to incompleate set of points to create the plane
+               */                              
+               if(_render==NULL){
+                       throw std::exception();
+               }
+               for(int i = _vectdata.size()-1; i >= n;i--){
+                       _render->RemoveViewProp(_vectdata[i]->GetActor());
+                       delete _vectdata[i];
+                       _vectdata.pop_back();
+               }       
+       } catch (...) {
+         throw ;
        }
-       for(int i = _vectdata.size()-1; i >= n;i--){
-               _render->RemoveViewProp(_vectdata[i]->GetActor());
-               delete _vectdata[i];
-               _vectdata.pop_back();
-       }       
 }
-void PlaneDirectionManager::UpdateVectors()throw (std::exception){
-       PlaneDirectionManagerData* temp;
-       bool deletelast = false;
-       int currentdata = 0;
-       int i;
-       for(i = 0; i < (int)_lstPointsx.size();i++){
-               if(i % 3 == 0){ 
-                       if((int)_vectdata.size()>currentdata){
-                               temp = _vectdata[currentdata];
-                       }else{
-                               temp = new PlaneDirectionManagerData(_radio, _colour, _opacity);
-                               _vectdata.push_back(temp);
+
+// EED 2022-08-04      throw
+//void PlaneDirectionManager::UpdateVectors()throw (std::exception)
+void PlaneDirectionManager::UpdateVectors()
+{
+       try{
+               PlaneDirectionManagerData* temp;
+               bool deletelast = false;
+               int currentdata = 0;
+               int i;
+               for(i = 0; i < (int)_lstPointsx.size();i++){
+                       if(i % 3 == 0){ 
+                               if((int)_vectdata.size()>currentdata){
+                                       temp = _vectdata[currentdata];
+                               }else{
+                                       temp = new PlaneDirectionManagerData(_radio, _colour, _opacity);
+                                       _vectdata.push_back(temp);
+                               }
+                               temp->setPoint0(_lstPointsx[i],_lstPointsy[i],_lstPointsz[i]);
+                               deletelast = true;
+                       }else if(i % 3 == 1){
+                       temp->setPoint1(_lstPointsx[i],_lstPointsy[i],_lstPointsz[i]);                  
+                       }else if(i % 3 == 2){
+                               temp->setPoint2(_lstPointsx[i],_lstPointsy[i],_lstPointsz[i]);                                          
+                               currentdata++;
+                               deletelast = false;
                        }
-                       temp->setPoint0(_lstPointsx[i],_lstPointsy[i],_lstPointsz[i]);
-                       deletelast = true;
-               }else if(i % 3 == 1){
-            temp->setPoint1(_lstPointsx[i],_lstPointsy[i],_lstPointsz[i]);                     
-               }else if(i % 3 == 2){
-                       temp->setPoint2(_lstPointsx[i],_lstPointsy[i],_lstPointsz[i]);                                          
-                       currentdata++;
-                       deletelast = false;
                }
+               RemoveAllActorsFromIndex(currentdata);
+       } catch (...) {
+         throw ;
        }
-       RemoveAllActorsFromIndex(currentdata);
 }
 
 void PlaneDirectionManager::UpdateActors()
index 261a1865ecd28aa94e1bbb782343956a36a94c00..3e1e25abf395b89f4d64a4b9bfb548f55def382f 100644 (file)
 #define PlaneDirectionManager_H_
 
 #include <math.h>
-
 #include <iostream>
-
 #include "PlaneDirectionManagerData.h"
-
 #include <vector>
-
 #include <vtkRenderer.h>
 
-class PlaneDirectionManager  {
-
+class PlaneDirectionManager  
+{
 public:
        PlaneDirectionManager(int radio, double colour[3], int opacity);        
-       ~PlaneDirectionManager();       
-       
+       ~PlaneDirectionManager();               
        void SetRenderer(vtkRenderer* render);
        void SetVectors( std::vector<double> lstPointsx, std::vector<double> lstPointsy, std::vector<double> lstPointsz);
-
-       void UpdateDirections() throw (std::exception);
-
-       std::vector<PlaneDirectionManagerData*> GetPlanesData(){
+// EED 2022-08-04      throw
+//     void UpdateDirections() throw (std::exception);
+       void UpdateDirections();
+       std::vector<PlaneDirectionManagerData*> GetPlanesData()
+       {
                return _vectdata;
        }
-
        void addRemoveActor(int index, bool addremove);
-
        void changeColor(int index,double r,double g,double b);
-
        PlaneDirectionManagerData* GetPlaneDirectionManagerData(int id);
-
        void WriteInformation(std::string  filename, double* spc=NULL);
-
        void SetArrowSize(int arrowsize);
 private:
-
        std::vector<double> _lstPointsx;
        std::vector<double> _lstPointsy;
        std::vector<double> _lstPointsz;
-
        std::vector<PlaneDirectionManagerData*> _vectdata;
-
-       void RemoveAllActorsFromIndex(int n=0)throw (std::exception);
-       void UpdateVectors()throw (std::exception);
-
+// EED 2022-08-04      throw
+//     void RemoveAllActorsFromIndex(int n=0)throw (std::exception);
+       void RemoveAllActorsFromIndex(int n=0);
+// EED 2022-08-04      throw
+//     void UpdateVectors()throw (std::exception);
+       void UpdateVectors();
        void UpdateActors();
        void AddActors();
-
-       vtkRenderer* _render;
-
-       int _radio;
-       double* _colour;
-       int _opacity;
-       
+       vtkRenderer             *_render;
+       int                     _radio;
+       double                  *_colour;
+       int                     _opacity;
 };
 
 #endif /*PlaneDirectionManager_H_*/