MantisBT - ParaView
View Issue Details
0013087ParaViewFeaturepublic2012-04-13 09:592015-01-11 08:35
Ian Curington 
Utkarsh Ayachit 
highminorhave not tried
closedfixed 
3.14.1 
4.03.98.0 
ParaViewPro
13087_extend_representation_api
usability
0013087: Enable mapping PipelineSource with vtkActor names with 1-line patch adding inspector
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());
    }
}





No tags attached.
Issue History
2012-04-13 09:59Ian CuringtonNew Issue
2012-04-13 11:34Ian CuringtonNote Added: 0028477
2012-04-23 10:33Utkarsh AyachitAssigned To => Utkarsh Ayachit
2012-04-23 10:33Utkarsh AyachitStatusbacklog => todo
2012-04-23 10:33Utkarsh AyachitCategory(No Category) => Feature
2012-04-23 10:41Utkarsh AyachitProjectTBD => ParaViewPro
2012-07-19 06:37Ian CuringtonNote Added: 0028840
2012-08-17 15:39Ian CuringtonNote Added: 0029027
2012-10-18 14:11Utkarsh AyachitTarget Version => 4.0
2012-10-24 11:14Utkarsh AyachitTopic Name => 13534_fix_clip_planes
2012-10-24 11:14Utkarsh AyachitNote Added: 0029500
2012-10-24 11:14Utkarsh AyachitStatustodo => gatekeeper review
2012-10-24 11:14Utkarsh AyachitFixed in Version => git-next
2012-10-24 11:14Utkarsh AyachitResolutionopen => fixed
2012-10-26 08:05Ian CuringtonNote Added: 0029523
2012-10-26 10:00Utkarsh AyachitStatusgatekeeper review => backlog
2012-10-26 10:00Utkarsh AyachitResolutionfixed => reopened
2012-10-26 10:06Utkarsh AyachitTopic Name13534_fix_clip_planes => 13087_extend_representation_api
2012-10-26 10:06Utkarsh AyachitNote Added: 0029524
2012-10-26 10:06Utkarsh AyachitStatusbacklog => gatekeeper review
2012-10-26 10:06Utkarsh AyachitResolutionreopened => fixed
2012-10-26 10:10Ian CuringtonNote Added: 0029525
2012-10-26 10:11Utkarsh AyachitNote Added: 0029526
2012-10-29 10:50Utkarsh AyachitFixed in Versiongit-next => git-master
2012-10-29 10:50Utkarsh AyachitStatusgatekeeper review => customer review
2012-10-29 10:50Utkarsh AyachitNote Added: 0029546
2012-10-29 17:04Utkarsh AyachitFixed in Versiongit-master => 3.98.0
2013-01-17 19:17Alan ScottNote Added: 0030180
2013-01-17 19:17Alan ScottStatuscustomer review => closed
2015-01-11 08:34Utkarsh AyachitSource_changeset_attached => ParaView master 77ee8f9b
2015-01-11 08:35Utkarsh AyachitSource_changeset_attached => ParaView master 16e0bcfd
2015-01-11 08:35Utkarsh AyachitSource_changeset_attached => ParaView master e55d00d6

Notes
(0028477)
Ian Curington   
2012-04-13 11:34   
This one is actually very important to our project, as without it, we can only generate saved scenes with vtkActor#1, vtkActor#2, ..., instead of "Slice","Streamline", etc.

As far as we are aware, this is benign change, does not change any current behaviour, and should not break any other dependent layers, i.e., is pure add.
(0028840)
Ian Curington   
2012-07-19 06:37   
Do you have rough idea when this will be addressed, i.e. for 4.0 alpha?
(0029027)
Ian Curington   
2012-08-17 15:39   
Clarification of patch location in current development:
ParaView.Git\ParaView\ParaViewCore\ClientServerCore\Rendering\vtkGeometryRepresentation.h
line 173, in current Git Master as of 17 August 2012.

Please add the single line:
       vtkPVLODActor* GetActor(){return Actor;}

Thanks in advanced, much appreciated.
-Ian
(0029500)
Utkarsh Ayachit   
2012-10-24 11:14   
commit e55d00d66dbe9236865e0ce4a08c9ed8d3701adc
Author: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Date: Wed Oct 24 11:13:01 2012 -0400

    BUG 0013087. Added API to access the actor used by vtkGeometryRepresentation.
    
    Change-Id: If57fe462e55a9a85b37723d4eb3888bd92b4ad2e
(0029523)
Ian Curington   
2012-10-26 08:05   
Thank you Utkarsh! I thought I had added another note, but it seems to have been lost. We need exactly the same patch also in vtkImageSliceRepresentation.h
line 117:
  // Description:
  // Used in ConvertSelection to locate the prop used for actual rendering.
  virtual vtkPVLODActor* GetRenderedProp()
    { return this->Actor; }

Can I ask you to kindly reopen and make this change also?
Very sorry my previous note seems to have not been recorded.
Best Regards, Ian
(0029524)
Utkarsh Ayachit   
2012-10-26 10:06   
commit 16e0bcfd8f8c4630abbc3420b6e0af8b4e7f3584
Author: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Date: Fri Oct 26 10:04:54 2012 -0400

    BUG 0013087. Added API to access the actor defined in various representations.
    
    Change-Id: I3c0185145353d3f3a85bd35b5524596d3b63aeb4
(0029525)
Ian Curington   
2012-10-26 10:10   
Thank you very much!
(0029526)
Utkarsh Ayachit   
2012-10-26 10:11   
no problem at all!
(0029546)
Utkarsh Ayachit   
2012-10-29 10:50   
merged into master, if applicable.
(0030180)
Alan Scott   
2013-01-17 19:17   
Closing, as original reporter states it is fixed. Trusting Ian and Utkarsh.