Program: bbtk
Module: $RCSfile: bbwxvtkViewer3D.cxx,v $
Language: C++
- Date: $Date: 2009/05/15 14:58:08 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2009/05/28 08:12:18 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-------------------------------------------------------------------------
Viewer3DWidget::~Viewer3DWidget()
{
+ mBox->DisableObservers();
+ mBox->bbSetOutputWidget(NULL);
renderwindow->Delete();
renderer->Delete();
interactorstyle->Delete();
//-----------------------------------------------------------------
void Viewer3D::bbUserFinalizeProcessing()
- {
- }
+ {
+ DisableObservers();
+ }
+
+ void Viewer3D::DisableObservers()
+ {
+ Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
+ if (w!=NULL)
+ {
+ vtkRenderWindowInteractor *interactor = w->GetInteractor();
+ if (interactor!=NULL)
+ {
+ if (bbGetInputObs1()!=NULL)
+ {
+ if (bbGetInputObs1()->GetInteractor()!=NULL)
+ bbGetInputObs1()->EnabledOff();
+ }
+ if (bbGetInputObs2()!=NULL)
+ {
+ if (bbGetInputObs2()->GetInteractor()!=NULL)
+ //bbGetInputObs2()->SetInteractor(NULL);
+ bbGetInputObs2()->EnabledOff();
+ }
+ if (bbGetInputObs3()!=NULL)
+ {
+ if (bbGetInputObs3()->GetInteractor()!=NULL)
+ //bbGetInputObs3()->SetInteractor(NULL);
+ bbGetInputObs3()->EnabledOff();
+ }
+ if (bbGetInputObs4()!=NULL)
+ {
+ if (bbGetInputObs4()->GetInteractor()!=NULL)
+ //bbGetInputObs4()->SetInteractor(NULL);
+ bbGetInputObs4()->EnabledOff();
+ }
+ if (bbGetInputObs5()!=NULL)
+ {
+ if (bbGetInputObs5()->GetInteractor()!=NULL)
+ //bbGetInputObs5()->SetInteractor(NULL);
+ bbGetInputObs5()->EnabledOff();
+ }
+ }
+ }
+ }
//--------------------------------------------------------------------------
void Viewer3D::Process()
{
-
+ if (!bbIsShown()) return;
//EED
// Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
// if (w) w->Update();
bbtkDebugMessageInc("Core",9,"Viewer3D::CreateWidget()"<<std::endl);
- Viewer3DWidget* w = new Viewer3DWidget(this,parent,
- //bbGetWxParent(),
- bbGetInputStereo());
- //EED w->Update();
- //...
+ Viewer3DWidget* w = new Viewer3DWidget(this,
+ parent,
+ //bbGetWxParent(),
+ bbGetInputStereo());
+ //EED w->Update();
+ //...
bbSetOutputWidget(w);
// when window is shown
void Viewer3D::OnShowWidget()
{
-
+ Process();
// Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
// if (w) w->Update();
}