From: Eduardo DAVILA Date: Thu, 4 Aug 2022 13:17:21 +0000 (+0200) Subject: #3487 vtk9itk5wx3-macos X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=86293f1d4f90b8ffec0f243b8b48d55f477d2de0;p=creaMaracasVisu.git #3487 vtk9itk5wx3-macos --- diff --git a/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.cxx b/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.cxx index 93d7220..69b42a7 100644 --- a/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.cxx +++ b/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.cxx @@ -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){ diff --git a/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h b/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h index 34f0b73..6ea94bd 100644 --- a/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h +++ b/lib/GUI/Base/SurfaceRenderer/wxMaracasSurfaceRenderingManager.h @@ -49,6 +49,7 @@ #include #include + //EED 2022-07-21 //#include @@ -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); diff --git a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.cxx b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.cxx index 1678768..dfe4d3a 100644 --- a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.cxx +++ b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.cxx @@ -376,7 +376,12 @@ void VolumeRendererManager::GetImages(vtkImageData* img, vector& /** ** 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 greylevel,std::vector 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 greylevel,std::vector value) throw(char*) +void VolumeRendererManager::setVolumeOpacity(int propid, std::vector greylevel,std::vector 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 greylevel, +// std::vector red, +// std::vector green, +// std::vector blue)throw(char*) void VolumeRendererManager::setVolumeColor(int volid, std::vector greylevel, std::vector red, std::vector green, - std::vector 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 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 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 greylevel, std::vector value, int propid){ - if(propid == -1){ +void VolumeRendererManager::setVolumeOpacity(std::vector greylevel, std::vector 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(); } diff --git a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.h b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.h index 5556f1c..de7aa1b 100644 --- a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.h +++ b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanager.h @@ -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 greylevel,std::vector value) throw(char*); +// EED 2022-08-04 +// void setVolumeOpacity(int propid, std::vector greylevel,std::vector value) throw(char*); + void setVolumeOpacity(int propid, std::vector greylevel,std::vector value); /** ** Set Volume Color **/ - void setVolumeColor(int volid, std::vector greylevel, +// EED 2022-08-04 +// void setVolumeColor(int volid, std::vector greylevel, +// std::vector red, +// std::vector green, +// std::vector blue)throw(char*); + void setVolumeColor(int volid, std::vector greylevel, std::vector red, std::vector green, - std::vector blue)throw(char*); + std::vector 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 diff --git a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx index 6db6e91..7d81953 100644 --- a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx +++ b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx @@ -341,24 +341,30 @@ void VolumeRendererManagerData::setVolumeOpacity(std::vector 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"; - } } diff --git a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h index c4a8c2b..4689322 100644 --- a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h +++ b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h @@ -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 diff --git a/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx b/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx index c1a3dfd..0562da6 100644 --- a/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx +++ b/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.cxx @@ -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"<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(); } diff --git a/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.h b/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.h index 3809d4f..7c645e5 100644 --- a/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.h +++ b/lib/maracasVisuLib/src/CutModule/interface/CutModelMainPanel.h @@ -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; diff --git a/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx b/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx index 265d327..901f756 100644 --- a/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx +++ b/lib/maracasVisuLib/src/CutModule/interface/CutModelView.cxx @@ -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 diff --git a/lib/maracasVisuLib/src/CutModule/interface/CutModelView.h b/lib/maracasVisuLib/src/CutModule/interface/CutModelView.h index 1e71add..8374e65 100644 --- a/lib/maracasVisuLib/src/CutModule/interface/CutModelView.h +++ b/lib/maracasVisuLib/src/CutModule/interface/CutModelView.h @@ -60,69 +60,48 @@ 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 diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx b/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx index ccd3698..8d27a5c 100644 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx +++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx @@ -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 "<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 "<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() "<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() "<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 ; + } } diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.h b/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.h index d505628..06042df 100644 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.h +++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelData.h @@ -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 diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx index 05e92d8..f8b4dec 100644 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx +++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.cxx @@ -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:: "<getId()<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:: "<getId()<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:"<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 ); diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h index 674bde4..9498b8f 100644 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h +++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelManager.h @@ -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 _vectordata; std::vector _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 ; diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.cxx b/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.cxx index 06c9eea..94216f8 100644 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.cxx +++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.cxx @@ -44,30 +44,27 @@ /** ** 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()"<getSTDFileName()<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 "<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()"<getSTDFileName()<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 "<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(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(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(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 ; + } } + diff --git a/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.h b/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.h index 8c5f1fa..849dcdf 100644 --- a/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.h +++ b/lib/maracasVisuLib/src/CutModule/kernel/CutModelSaveBinInfo.h @@ -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; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx index 618bd36..684dc15 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.cxx @@ -65,7 +65,10 @@ void PlaneDirectionViewer::SetVectors( std::vector 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 vectdata = manager->GetPlanesData(); int i; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.h index 86e76ef..40dbb0f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/PlaneDirectionViewer.h @@ -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 lstPointsx, std::vector lstPointsy, std::vector 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; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.h index 1e6ef4d..54e9eb5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.h @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx index c0690bd..093961f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.cxx @@ -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 greylevel,std::vector value) throw(char*) +// EED 2022-08-04 throw +// void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector greylevel,std::vector value) throw(char*) +void wxMaracasMultipleVolumeRendererManager::setVolumeOpacity(int propid, std::vector greylevel,std::vector 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 greylevel, +// std::vector red, +// std::vector green, +// std::vector blue)throw(char*) void wxMaracasMultipleVolumeRendererManager::setVolumeColor(int volid, std::vector greylevel, std::vector red, std::vector green, - std::vector blue)throw(char*) + std::vector 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 ; + } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h index 2ed4cd8..985d98a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManager.h @@ -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 greylevel,std::vector value) throw(char*); +// EED 2022-08-04 throw +// void setVolumeOpacity(int propid, std::vector greylevel,std::vector value) throw(char*); + void setVolumeOpacity(int propid, std::vector greylevel,std::vector value); /** ** Set Volume Color **/ +// EED 2022-08-04 throw +// void setVolumeColor(int volid, std::vector greylevel, +// std::vector red, +// std::vector green, +// std::vector blue)throw(char*); void setVolumeColor(int volid, std::vector greylevel, std::vector red, std::vector green, - std::vector blue)throw(char*); + std::vector 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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx index d71d3e9..58c77b3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx @@ -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 greylevel,std::vector value){ - +void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vector greylevel,std::vector 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::vectorSetVolumeRayCastFunction(_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 } + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h index 712cd0e..3473e0f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.h @@ -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 greylevel,std::vector 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_*/ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.cpp index a59cd60..2d648e5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.cpp @@ -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(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.h index aec7cf7..7313f2a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.h @@ -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; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx index ce9dfaa..f226ef3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx @@ -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; } /** diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.h index 3b33ab4..c3b49b0 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.h @@ -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); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index 81ff519..99c7a36 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h index de70a52..e78285f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h @@ -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(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx index a9a493a..ccbecf8 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx @@ -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; } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h index dcff3c9..b821488 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.h @@ -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 gf, vector vf, vtkColorTransferFunction* ctfun); + void UpdateVolumeBox(vector gf, vector vf, vtkColorTransferFunction* ctfun); private: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index 23b6ce1..1525055 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -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; } //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h index b7bffd4..6c4b906 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h @@ -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); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.cxx b/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.cxx index b6b82ac..469a616 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.cxx @@ -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(); } //---------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.h b/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.h index f84c15d..925af43 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasMPR.h @@ -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); diff --git a/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx b/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx index 6cd2047..860cf2e 100644 --- a/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx +++ b/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.cxx @@ -51,11 +51,17 @@ void PlaneDirectionManager::SetVectors( std::vector 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() diff --git a/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.h b/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.h index 261a186..3e1e25a 100644 --- a/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.h +++ b/lib/maracasVisuLib/src/kernel/PlaneDirectionManager.h @@ -27,59 +27,47 @@ #define PlaneDirectionManager_H_ #include - #include - #include "PlaneDirectionManagerData.h" - #include - #include -class PlaneDirectionManager { - +class PlaneDirectionManager +{ public: PlaneDirectionManager(int radio, double colour[3], int opacity); - ~PlaneDirectionManager(); - + ~PlaneDirectionManager(); void SetRenderer(vtkRenderer* render); void SetVectors( std::vector lstPointsx, std::vector lstPointsy, std::vector lstPointsz); - - void UpdateDirections() throw (std::exception); - - std::vector GetPlanesData(){ +// EED 2022-08-04 throw +// void UpdateDirections() throw (std::exception); + void UpdateDirections(); + std::vector 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 _lstPointsx; std::vector _lstPointsy; std::vector _lstPointsz; - std::vector _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_*/