[vtkusers] vtk contour representation in python

Haider Syed hsyed88 at yahoo.com
Thu Jun 24 15:59:50 EDT 2010


Hi,

I am using the vtkContourWidget for segmentation and need to retrieve the node locations.  I have the following code in C++ which works! but I need to implement this in Python.  I am having trouble translating the last line of the code.

  // Create a contour widget
  vtkSmartPointer<vtkContourWidget> contourWidget = 
      vtkSmartPointer<vtkContourWidget>::New();
  contourWidget->SetInteractor(renderWindowInteractor);
  contourWidget->CreateDefaultRepresentation();
  contourWidget->ContinuousDrawOn();

vtkContourRepresentation* rep = static_cast<vtkContourRepresentation *>(contourWidget->GetRepresentation());

Since there is no casting in python, how do I create a vtkContourRepresentation in Python given the subclass vtkOrientedGlyphContourRepresentation, i.e. how do I translate:


vtkContourRepresentation* rep = static_cast<vtkContourRepresentation 
*>(contourWidget->GetRepresentation());


into python.

Any help would be appreciated.

Thanks,
Haider



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100624/568db6df/attachment.htm>


More information about the vtkusers mailing list