Program: bbtk
Module: $RCSfile: bbwxvtkViewer3D.cxx,v $
Language: C++
- Date: $Date: 2008/12/03 13:35:35 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2009/03/23 12:55:54 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void Viewer3D::bbUserConstructor()
{
+ firsttime=true;
bbSetInputIn1(NULL);
bbSetInputIn2(NULL);
bbSetInputIn3(NULL);
void Viewer3D::Process()
{
+ printf("EED Viewer3D::Process() 0\n");
+
+//EED
+// Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
+// if (w) w->Update();
+
+
+
Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
- if (w) w->Update();
+ if ((firsttime==true) && (w!=NULL)){
+ firsttime=false;
+ printf("EED Viewer3D::Process() 1\n");
+
+ vtkRenderWindowInteractor *interactor = w->GetInteractor();
+ if (interactor!=NULL)
+ {
+ if (bbGetInputObs1()!=NULL)
+ {
+ bbGetInputObs1()->SetInteractor(interactor);
+ bbGetInputObs1()->EnabledOn();
+ }
+ if (bbGetInputObs2()!=NULL)
+ {
+ bbGetInputObs2()->SetInteractor(interactor);
+ bbGetInputObs2()->EnabledOn();
+ }
+ if (bbGetInputObs3()!=NULL)
+ {
+ bbGetInputObs3()->SetInteractor(interactor);
+ bbGetInputObs3()->EnabledOn();
+ }
+ if (bbGetInputObs4()!=NULL)
+ {
+ bbGetInputObs4()->SetInteractor(interactor);
+ bbGetInputObs4()->EnabledOn();
+ }
+ if (bbGetInputObs5()!=NULL)
+ {
+ bbGetInputObs5()->SetInteractor(interactor);
+ bbGetInputObs5()->EnabledOn();
+ }
+ bbSetOutputInteractor( w->GetInteractor() );
+ } // interactor
+
+ vtkRenderer *renderer = w->GetRenderer();
+ if (renderer!=NULL)
+ {
+ bbSetOutputRenderer( renderer );
+
+ if (bbGetInputIn1()!=NULL) {renderer->AddActor( bbGetInputIn1() ); }
+ if (bbGetInputIn2()!=NULL) {renderer->AddActor( bbGetInputIn2() ); }
+ if (bbGetInputIn3()!=NULL) {renderer->AddActor( bbGetInputIn3() ); }
+ if (bbGetInputIn4()!=NULL) {renderer->AddActor( bbGetInputIn4() ); }
+ if (bbGetInputIn5()!=NULL) {renderer->AddActor( bbGetInputIn5() ); }
+ renderer->ResetCamera();
+ double bounds[6];
+ renderer->ComputeVisiblePropBounds(bounds);
+ renderer->ResetCameraClippingRange(bounds);
+
+ } // renderer
+
+
+ } // w && firsttime
+
+ if (w!=NULL) w->Update();
+
}
*/
void Viewer3D::CreateWidget(wxWindow* parent)
{
+ printf("EED Viewer3D::CreateWidget() 0\n");
+
bbtkDebugMessageInc("Core",9,"Viewer3D::CreateWidget()"<<std::endl);
Viewer3DWidget* w = new Viewer3DWidget(this,parent,
//bbGetWxParent(),
bbGetInputStereo());
- w->Update();
-
-
- vtkRenderWindowInteractor *interactor = w->GetInteractor();
- if (interactor!=NULL)
- {
- if (bbGetInputObs1()!=NULL)
- {
- bbGetInputObs1()->SetInteractor(interactor);
- bbGetInputObs1()->EnabledOn();
- }
- if (bbGetInputObs2()!=NULL)
- {
- bbGetInputObs2()->SetInteractor(interactor);
- bbGetInputObs2()->EnabledOn();
- }
- if (bbGetInputObs3()!=NULL)
- {
- bbGetInputObs3()->SetInteractor(interactor);
- bbGetInputObs3()->EnabledOn();
- }
- if (bbGetInputObs4()!=NULL)
- {
- bbGetInputObs4()->SetInteractor(interactor);
- bbGetInputObs4()->EnabledOn();
- }
- if (bbGetInputObs5()!=NULL)
- {
- bbGetInputObs5()->SetInteractor(interactor);
- bbGetInputObs5()->EnabledOn();
- }
- bbSetOutputInteractor( w->GetInteractor() );
- }
-
-
- vtkRenderer *renderer = w->GetRenderer();
- if (renderer!=NULL)
- {
- bbSetOutputRenderer( renderer );
+ //EED w->Update();
+ //...
- if (bbGetInputIn1()!=NULL) {renderer->AddActor( bbGetInputIn1() ); }
- if (bbGetInputIn2()!=NULL) {renderer->AddActor( bbGetInputIn2() ); }
- if (bbGetInputIn3()!=NULL) {renderer->AddActor( bbGetInputIn3() ); }
- if (bbGetInputIn4()!=NULL) {renderer->AddActor( bbGetInputIn4() ); }
- if (bbGetInputIn5()!=NULL) {renderer->AddActor( bbGetInputIn5() ); }
- renderer->ResetCamera();
- double bounds[6];
- renderer->ComputeVisiblePropBounds(bounds);
- renderer->ResetCameraClippingRange(bounds);
-
- }
-
bbSetOutputWidget(w);
bbtkDebugDecTab("Core",9);
// when window is shown
void Viewer3D::OnShowWidget()
{
- // Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
+ printf("EED Viewer3D::OnShowWidget() 0\n");
+
+ // Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget();
// if (w) w->Update();
}