[IGSTK-Developers] View class refactoring

Torleif Sandnes torleif.sandnes at sintef.no
Thu Aug 16 05:31:38 EDT 2007


Hi Andinet.

Again, thanks for the update.

> I have added transitions to the InteractorInitializeState with  
> ValidAddObjectInput. You should be able to add spatial objects  
> after initializing the interactor.

Confirmed. This works fine now.

> I have committed a fix.  Now, when you set the view in the widget,  
> the reporter will be also connected.  So you can add an
> observer to the widget and you will be able to listen to  
> TransformModified events.

Great. This works fine too.
>
> I have added RequestSetRendererBackgroundColor( ... ) method.

Works, thanks.

> Let me know if you see other issues.

I am seeing two problems:

1. I have problems getting the renderwindowinteractor from  
igstk::QTWidget, but this is by design?
I use the method QVTKWidget::GetInteractor() but it returns null,  
(after having done RequestSetView() on the igstk::QTWidget.

I need this for setting the interactor of a vtkImagePlaneWidget in my  
3D scene.

2. If I start more than one igstk::ViewNew2D, the objects added to  
these disappear. No mentionis made in the log from the views.
Try something like this:

widget1 = new igstk::QTWidget();
view1 = igstk::ViewNew2D::New();
widget1->RequestSetView(view1);

widget2 = new igstk::QTWidget();
view2 = new igstk::ViewNew2D::New();
widget2->RequestSetView(view2);

igstk::EllipsoidObject::Pointer ellipsoid =  
igstk::EllipsoidObject::New();
ellipsoid->SetRadius(1,2,3);

igstk::EllipsoidObjectRepresentation::Pointer ellipsoidRepresentation1 =
	igstk::EllipsoidObjectRepresentation::New();
ellipsoidRepresentation1->RequestSetEllipsoidObject(ellipsoid);
ellipsoidRepresentation1->SetColor(0.0,1.0,0.0);

igstk::EllipsoidObjectRepresentation::Pointer ellipsoidRepresentation2 =
	igstk::EllipsoidObjectRepresentation::New();
ellipsoidRepresentation2->RequestSetEllipsoidObject(ellipsoid);
ellipsoidRepresentation2->SetColor(0.0,0.0,1.0);

widget1->RequestEnableInteractions();
view1->RequestSetOrientation(igstk::ViewNew2D::Axial);
view1->RequestInitializeRenderWindowInteractor();
view1->RequestStart();
view1->RequestAddObject(ellipsoidRepresentation1);

widget2->RequestEnableInteractions();
view2->RequestSetOrientation(igstk::ViewNew2D::Coronal);
view2->RequestInitializeRenderWindowInteractor();
view2->RequestStart();
view2->RequestAddObject(ellipsoidRepresentation2);

Torleif



More information about the IGSTK-Developers mailing list