[vtkusers] set points for vtkContourWidget without interactions

-Daniel- ich_daniel at habmalnefrage.de
Tue May 6 14:19:02 EDT 2014


Hello vtk-users,

I use following code-snippet to show a contour on a surface with mouse
interactions.

//*******************
vtkContourWidget contourWidget = new vtkContourWidget();
contourWidget.SetInteractor(view.getRenderWindowInteractor());
contourWidget.On();
		
vtkOrientedGlyphContourRepresentation rep = 
	(vtkOrientedGlyphContourRepresentation) contourWidget.GetRepresentation();
rep.GetLinesProperty().SetColor(0.8, 0.2, 0);
rep.GetLinesProperty().SetLineWidth(3.0);
rep.ShowSelectedNodesOn();
		
vtkPolygonalSurfacePointPlacer pointPlacer = new
vtkPolygonalSurfacePointPlacer();
vtkImageActorPointPlacer imagePlacer = new vtkImageActorPointPlacer();
			
vtkPolyDataMapper clipMapper = new vtkPolyDataMapper();
clipMapper.SetInputData((vtkPolyData) object);
clipMapper.ImmediateModeRenderingOn();
	
vtkActor actor = new vtkActor();
actor.SetMapper(clipMapper);  	

pointPlacer.AddProp(actor);
pointPlacer.SnapToClosestPointOn();
rep.SetPointPlacer(pointPlacer);
        
vtkPolygonalSurfaceContourLineInterpolator interpolator = new
	vtkPolygonalSurfaceContourLineInterpolator();
				
rep.SetLineInterpolator(interpolator);
//********************

Now I would like to set points without mouse clicks. For example like
"setPoint(indexOfPointA, pointACoordinate[])"
 
I thought this functions are helpful, but they didn't.
rep.AddNodeAtWorldPosition(a.getKoords());
rep.AddNodeAtWorldPosition(b.getKoords());
  Or
pointPlacer.UpdateNodeWorldPosition(a.getKoords(), 0);
pointPlacer.UpdateNodeWorldPosition(b.getKoords(), 1);

Is there a way to do this?






--
View this message in context: http://vtk.1045678.n5.nabble.com/set-points-for-vtkContourWidget-without-interactions-tp5726998.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list