Enable mapping PipelineSource with vtkActor names with 1-line patch adding inspector
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Please urgently add to: ParaView-3.14.0/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.h line 185: vtkPVLODActor* GetActor(){return Actor;}
SUMMARY: Request to add inspector routine to vtkGeometryRepresentation class to allow creating mapping of pqPipelineSource with vtkActor (from vtkRenderWindow) instances necessary in any 3D scene graph capturing Plugin. Such mapping allows captured scene graph (VTK, X3D, PDF3D, etc) to include meaningful originating Pipeline names.
DESCRIPTION: To export ParaView scene to 3D PDF or other similar full scene-graph systems with properly mapped names of pipeline sources with model tree names, mapping between pqPipelineSource and vtkActor (from vtkRenderWindow) instances needs to be created in the exporting plugin. One-line Inspector routine is added to the class to enable our plugin to calculate which vtkActor objects are represented by which pqPipelineSource objects, which is used later, to set model tree names, during exporting vtkRenderWindow's content to 3D PDF. This patch is very important to us because 3D pdf files we generate, with correct model tree names, are much more user friendly and allow to user to exactly know which path of 3D scene was exported from which part of ParaView scene.
EXAMPLE CODE SNIPPET of USE, in PLUGIN:
// // This code snippet describes how ACTORS NAME PATCH is used in // PDF3D ParaView Plugin. // // Following code retrieves list of pipeline sources currently // managed by ParaView's Server Manager and for each: // // 1. Retrieves coresponding data representation used for it's // displaying, // 2. If pipeline source is visible (i.e. data representation is // visible), it saves mapping (routine AddNameMapping) between // pipeline source's name and vtkActor's instance object which // is added to vtkRenderWindow. //
// get reference to application's object pqApplicationCore* application = pqApplicationCore::instance();
// get reference to server manager model's object pqServerManagerModel* server_manager_model = application->getServerManagerModel();
// get all sources QList<pqPipelineSource> sources = server_manager_model->findItems<pqPipelineSource>();
// pass through all sources and initialize name mapping int i; for(i = 0; i < sources.size(); i++) { // get source pqPipelineSource* source = sources.at(i);
// get representation
pqDataRepresentation* representation = source->getRepresentation(active_view);
if(representation == NULL || !representation->isVisible())
continue;
// get client side representation object - composite representation
vtkPVCompositeRepresentation* composite_representation = dynamic_cast<vtkPVCompositeRepresentation*>(representation->getProxy()->GetClientSideObject());
if(composite_representation != NULL)
{
// get currently active geometry representation and set name for its appropriate actor
vtkGeometryRepresentation* active_representation = dynamic_cast<vtkGeometryRepresentation*>(composite_representation->GetActiveRepresentation());
if(active_representation != NULL)
AddNameMapping(active_representation->GetActor(), source->getSMName().toAscii().data());
}
}