[vtkusers] "trade" vtkPoints between actors

Renil renilac at gmail.com
Wed Aug 7 21:51:25 EDT 2013


Hi Sebastien,

Thank you for your reply.
I will try your suggestion tomorrow.

The way I showed spheres was using a vtkGlyph3d, and then added the
resulting vtkActors to the renderer, like this:

// Auxuliar method
void TypesManager::configureSpheres(vtkPolyData *spheresPositions,
vtkSmartPointer<vtkPoints> spheresPoints, double radius, vtkSphereSource
*sphereSource, int resT, int resP, vtkGlyph3D *spheresGlyphs,
vtkPolyDataMapper *spheresMapper, vtkActor *spheresActor, double color[]){
	
	// insert array of points
	spheresPositions->SetPoints(spheresPoints);

	// Create the spheres
	sphereSource->SetThetaResolution(resT);
	sphereSource->SetPhiResolution(resP);
	sphereSource->SetRadius(radius);
	
	spheresGlyphs ->SetInput(spheresPositions);
	spheresGlyphs ->SetSource(sphereSource->GetOutput());
	// Create the mapper & actor for the spheres
	spheresMapper->SetInput(spheresGlyphs->GetOutput());
	
	spheresActor->SetMapper(spheresMapper);
	spheresActor->GetProperty()->SetColor(color[0], color[1], color[2]);
}

After that I was calculating whether the points were inside or not on each
mousemove with:

vtkSmartPointer<vtkMouseMoveCallback> callback =
vtkSmartPointer<vtkMouseMoveCallback>::New();
renderer->GetRenderWindow()->GetInteractor()->AddObserver(vtkCommand::MouseMoveEvent,
callback);

and vtkMouseMoveCallback has all the calculations.




--
View this message in context: http://vtk.1045678.n5.nabble.com/trade-vtkPoints-between-actors-tp5722498p5722570.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list