[vtkusers] vtk contour representation in python

Jothy jothybasu at gmail.com
Thu Jun 24 16:14:53 EDT 2010


Should be

rep =contourWidget.GetRepresentation()


Jothy

On Thu, Jun 24, 2010 at 8:59 PM, Haider Syed <hsyed88 at yahoo.com> wrote:

> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100624/02a928c6/attachment.htm>


More information about the vtkusers mailing list