[vtkusers] Accessing actor

Waldo Valenzuela waldo.valenzuela at hotmail.com
Fri Apr 25 05:42:34 EDT 2014


Hi Guys,

I have several meshes in a scene, someone know how I can access to the actor in a vtkSelectionNode element. 

I am using the following code to select some vertexes of the current view, but I want to know the actor that the vertexs belong.
        vtkSmartPointer<vtkHardwareSelector> selector =
          vtkSmartPointer<vtkHardwareSelector>::New();
        selector->SetRenderer(this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer());
        int* temp = this->Interactor->GetRenderWindow()->GetSize();
        unsigned int windowSize[4];
        windowSize[0] = temp[2];
        windowSize[1] = temp[3];
        windowSize[2] = temp[0];
        windowSize[3] = temp[1];

        selector->SetArea(windowSize);
        selector->SetFieldAssociation(vtkDataObject::FIELD_ASSOCIATION_CELLS);
        vtkSelection* selection = selector->Select();
        std::cout << "Selection has " << selection->GetNumberOfNodes() << " nodes." << std::endl;
	vtkSelectionNode  *node = selection->GetNode(0);
Best regards,

Waldo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140425/fb3342a6/attachment.html>


More information about the vtkusers mailing list