//vtkImageData* img1 = ;
- //bbSetOutputOut0(volview->GetOutputImages()[0]);
- //bbSetOutputOut1(volview->GetOutputImages()[1]);
- //bbSetOutputOut2(volview->GetOutputImages()[2]);
- //bbSetOutputOut3(volview->GetOutputImages()[3]);
- }
+ /*bbSetOutputOut0(volview->GetOutputImages()[0]);
+ bbSetOutputOut1(volview->GetOutputImages()[1]);
+ bbSetOutputOut2(volview->GetOutputImages()[2]);
+ bbSetOutputOut3(volview->GetOutputImages()[3]);*/
+
}
void VolumeRendering::CreateWidget(wxWindow* parent)
{
Program: wxMaracas
Module: $RCSfile: CutModelMainPanel.cxx,v $
Language: C++
- Date: $Date: 2009/09/08 08:14:25 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/11/25 16:35:36 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
initialize(path);
}
-CutModelMainPanel::~CutModelMainPanel( ){
-
+CutModelMainPanel::~CutModelMainPanel( ){
+ viewpanels.clear();
delete cutmanager;
}
try{
checkInvariant();
- for(int i = 0; i < viewpanels.size()-1;i++){
- if(viewpanels[i]->getId()==id){
- for(int j = i; j < viewpanels.size()-1;j++){
- viewpanels[j]=viewpanels[j+1];
+ if(!this->IsBeingDeleted()){
+ for(int i = 0; i < viewpanels.size()-1;i++){
+ CutModelView* view = viewpanels[i];
+ if(view->getId()==id){
+ for(int j = i; j < viewpanels.size()-1;j++){
+ viewpanels[j]=viewpanels[j+1];
+ }
+ i = viewpanels.size();
}
- i = viewpanels.size();
}
- }
- viewpanels.pop_back();
-
-
- cutmanager->RemoveActor(id);
+ viewpanels.pop_back();
+ cutmanager->RemoveActor(id);
+ }
}catch(CutModelException e){
showErrorDialog(e.getCause());
Program: wxMaracas
Module: $RCSfile: CutModelData.cxx,v $
Language: C++
- Date: $Date: 2009/10/16 15:17:56 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2009/11/25 16:35:37 $
+ Version: $Revision: 1.5 $
Copyright: (c) 2002, 2003
License:
}
CutModelData::~CutModelData(){
checkInvariant();
+ _boxWidgetVolume->RemoveAllObservers();
_boxWidgetVolume->Off();
+ _boxWidgetVolume->SetInteractor(NULL);
_boxWidgetVolume->Delete();
_Mapper->Delete();
_Actor->Delete();
delete _cylinderfigure;
delete _spherefigure;
currentmatrix->Delete();
+ modeltransform->Delete();
inversModel->Delete();
+ _id = -1;
}
void CutModelData::RefreshViewBox(){
Program: wxMaracas
Module: $RCSfile: CutModelManager.cxx,v $
Language: C++
- Date: $Date: 2009/09/08 08:14:27 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2009/11/25 16:35:37 $
+ Version: $Revision: 1.4 $
Copyright: (c) 2002, 2003
License:
CutModelManager::~CutModelManager(){
std::string files = _path;
files+="/infounrd_0_fig_0.info";
- remove(files.c_str());
+ remove(files.c_str());
+ _vectordata.clear();
+ _img = NULL;
+ _copyimg = NULL;
+ _interactor = NULL;
+ _render = NULL;
}
CutModelData* current = NULL;
for(int i= 0; i < _vectordata.size();i++){
+ CutModelData* temp = _vectordata[i];
std::cout<<"id in CutModelManager:: "<<id<<std::endl;
- std::cout<<"vectordataid in CutModelManager:: "<<_vectordata[i]->getId()<<std::endl;
+ std::cout<<"vectordataid in CutModelManager:: "<<temp->getId()<<std::endl;
- if(_vectordata[i]->getId()==id){
- current = _vectordata[i];
+ if(temp->getId() == id){
+ current = temp;
}
}
if(current ==NULL){
i = _vectordata.size();
}
}
- _render->RemoveActor(current->getActor());
+ _render->RemoveViewProp(current->getActor());
+ //_render->RemoveViewProp(current->get
delete current;
_vectordata.pop_back();
_render->Render();
_volumeMapper->AutoAdjustSampleDistancesOn();
_volumeProperty = vtkVolumeProperty::New();
_volumeProperty->SetInterpolationTypeToLinear();
- _volumeProperty->ShadeOn();
+ //_volumeProperty->ShadeOn();
_volumeProperty->DisableGradientOpacityOn();
_volumeProperty->SetColor(_ctfun);
_volumeProperty->SetScalarOpacity(_tfun );
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $
Language: C++
- Date: $Date: 2009/10/16 15:17:57 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2009/11/25 16:35:38 $
+ Version: $Revision: 1.19 $
Copyright: (c) 2002, 2003
License:
if (mwxsphereview) { delete mwxsphereview; }
if (mwxvtkmpr3Dview) { delete mwxvtkmpr3Dview; }
if (mwxvtkclipping3Dview) { delete mwxvtkclipping3Dview; }
- if (mwxvtk3Dbaseview_Clipping3D){ delete mwxvtk3Dbaseview_Clipping3D; }
+ if (mwxvtk3Dbaseview_Clipping3D){ delete mwxvtk3Dbaseview_Clipping3D; mwxvtk3Dbaseview_Clipping3D=NULL;}
}
//------------------------------------------------------------------------------------------------------------
// Methods
//-------------------------------------------------------------------
wxVtk3DBaseView::~wxVtk3DBaseView()
{
- if (_aCamera!=NULL) { _aCamera -> Delete(); }
- if (_aRenderer!=NULL) { _aRenderer -> Delete(); }
- if (_renWin!=NULL) { _renWin -> Delete(); }
+ if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
+ if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;}
+ if (_renWin!=NULL) {
+ if(_renWin->GetReferenceCount()==0){
+ _renWin -> Delete(); _renWin=NULL;
+ }
+ }
}
//-------------------------------------------------------------------
vtkCamera* wxVtk3DBaseView::GetCamera()