[vtkusers] Exception throw with vtkPolygonalSurfaceContourLineInterpolator
Karthik Krishnan
karthik.krishnan at kitware.com
Thu Jan 13 13:44:57 EST 2011
Can you post the polygonal dataset, along with the StartVertex and EndVertex
Id's that were passed onto vtkDijkstraGraphGeodesicPath
thx
--
karthik
On Thu, Jan 13, 2011 at 11:36 PM, Nicolas Sarrasin <
nsarrasin at phenix-systems.com> wrote:
> Hi all,
>
> I'm coding an application to select edges on a vtkPolyData.
>
> For my needs, I first have to build a wireframe vtkPolyData of the input
> (vtkPolyline->GetPointIds(...); vtkCellArray->InsertNextCell(vtkPolyLine); vtkPolyData->SetPoints(..);
> vtkPolyData->SetLines(vtkCellArray);...)
>
> This part is ok. Then I use vtkContourWidget with vtkPolygonalSurfacePointPlacer
> and vtkPolygonalSurfaceContourLineInterpolator :
>
>
> vtkSmartPointer<vtkContourWidget> contourWidget =
> vtkSmartPointer<vtkContourWidget>::New();
> contourWidget->SetInteractor(interactor);
>
> vtkSmartPointer<vtkOrientedGlyphContourRepresentation> rep =
>
> vtkOrientedGlyphContourRepresentation::SafeDownCast(contourWidget->GetRepresentation());
> rep->GetLinesProperty()->SetColor(1, 0.2, 0);
> rep->GetLinesProperty()->SetLineWidth(3.0);
>
> vtkSmartPointer<vtkPolygonalSurfacePointPlacer> pointPlacer =
> vtkSmartPointer<vtkPolygonalSurfacePointPlacer>::New();
> pointPlacer->AddProp(actor);
> pointPlacer->GetPolys()->AddItem( my_polydata );
>
> vtkSmartPointer<vtkPolygonalSurfaceContourLineInterpolator>
> interpolator =
> vtkSmartPointer<vtkPolygonalSurfaceContourLineInterpolator>::New();
> interpolator->GetPolys()->AddItem( my_polydata );
>
> rep->SetPointPlacer(pointPlacer);
> rep->SetLineInterpolator(interpolator);
>
> contourWidget->EnabledOn();
>
> When I pick one point it's ok but after the second picking I get an
> exception : "vector subscript out of range" thrown in the function
> vtkDijkstraGraphGeodesicPath::TraceShortestPath().
>
> It appears only if I the LineInterPolator is vtkPolygonalSurfaceContourLineInterpolator.
> It seems that Dijkstra can't find the path allong the lines.
>
> So I'm asking where does this comes from ?
>
> When I compute a vtkpolyDataConnectivityFilter, it says me I have only one
> region, so my data is right connected (i means I have no holes on my
> polylines).
>
> Is there a filter I can pass to my polydata to make it works ??
>
> Thanks by advance for helping me.
>
> Nicolas
>
> _______________________________________________
> 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/20110114/9d89b375/attachment.htm>
More information about the vtkusers
mailing list