[vtkusers] BoxWidget + VolumeMapper errors

dean.inglis at camris.ca dean.inglis at camris.ca
Wed May 26 19:43:23 EDT 2004


I am trying to use vtkBoxWidget with a callback to send its vtkPlanes 
to a vtkVolumeMapper as in 
VTK/Examples/GUI/Tcl/VolumeRenderWithBoxWidget.tcl
Apparently, I should be passing in a vtkPlaneCollection, so I tried
modifying my callback:

class vtkBWCallback : public vtkCommand
{
public:
  static vtkBWCallback *New()
    { return new vtkBWCallback; }

  virtual void Execute(vtkObject *caller, unsigned long, void*)
    {
      vtkBoxWidget *box = reinterpret_cast<vtkBoxWidget*>(caller);
      box->GetPlanes( planes);
      collection->RemoveAllItems();
      for (int i = 0; i < planes->GetNumberOfPlanes(); i++)
        {
        collection->AddItem( planes->GetPlane(i) );
        }
      mapper->SetClippingPlanes( collection );
    }
  vtkBWCallback():planes(0),mapper(0),pc(0){};

  vtkPlanes* planes;
  vtkPlaneCollection* collection;
  vtkVolumeTextureMapper2D* mapper;
};

no luck!

I only get one plane acting as a clipping plane in both my .cxx app
 and in the above VTK tcl example.  The plane with unit normal
originally in the +z direction is the only valid plane.
Can anyone else verify this error?  This is seen on two builds: 

1) Borland C++ Builder vers. 5 , Win 2k Pro, Pentium 4,  
NVIDIA GeForce4 Ti 4400, driver 5.3.0.3, CMake 2.0.0, latest VTK cvs

2) Borland C++ Builder vers. 6 , Win 2k Pro, Pentium 4 mobile, 
NVIDIA Quadro4 500 GoGL,  driver 2.9.4.0, CMake 2.0.0, latest VTK cvs

Dean




More information about the vtkusers mailing list