[Paraview] Troubles with exporting selection labels from current ParaView render view

Nenad Vujicic nenadus at gmail.com
Wed May 20 05:49:24 EDT 2015


Utkarsh,

>>     - Strange 1: I don't have anymore instance in
>> DataLabelRepresentation for Elevation pipeline source (btw, during
>> this traversing I get only one actor),

> I don't follow. DataLableRepresentation is indeed created for every
> representation shown in the render view.

It seems it is not. When I execute my code snipped (passed down) I get
only 2 sources (good), every source with 1 output port (good) and for
every output port only one GeometryRepresentation (bad). No traces of
DataLabelRepresentation. Btw, my test case is:

1. Create Sphere source with default parameters,
2. Apply Elevation filter on it and turn off its 3d widget line,
3. Select several points on Elevation1 sphere and execute code snippet.

Here is my code snippet:

------------------ START OF CODE SNIPPET ------------------

// pass through all pipeline sources and pass all its representations
for all output ports
for(i = 0; i < sources.size(); i++)
{
    // get pipeline source
    pqPipelineSource* source = sources.at(i);

    QMessageBox::about(NULL, "1", source->getSMName());

    // for every output port, traverse all its representations
    for(output_port = 0; output_port <
source->getNumberOfOutputPorts(); output_port++)
    {
         QMessageBox::about(NULL, "2", source->getSMName() +
QString("_port_") + QString::number(output_port));

         // traverse all representations for this
         for(j = 0; j < source->getRepresentations(output_port,
active_view).count(); j++)
         {
             // get representation
             // I got active_view with
pqApplicationCore::instance()->getServerManagerModel()->getNumberOfItems<pqView*>
             pqDataRepresentation* current_representation =
source->getRepresentations(output_port, active_view)[j];

             QMessageBox::about(NULL, "3", current_representation->getSMName());
          }
    }
}

------------------ END OF CODE SNIPPET ------------------

Thank you very much for your response!


Nenad.

p.s. sorry for duplicated messages in your inbox:-).





On Mon, May 18, 2015 at 3:49 PM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
>>     - Strange 1: I don't have anymore instance in
>> DataLabelRepresentation for Elevation pipeline source (btw, during
>> this traversing I get only one actor),
>
> I don't follow. DataLableRepresentation is indeed created for every
> representation shown in the render view.
>
>
>>     - Strange 2: When I traverse vtkRenderer's actors, I get 2 actors
>> (sphere mesh and actor with selected points), but, I'm unable to
>> connect selection label properties (which are tied with Elevation
>> pipeline source actor - sphere mesh) and mesh with selected points /
>> cells.
>
> Remember that label actors are added to the 2D / non-composited
> renderer, not the same as the 3D renderer. Which renderer are you
> looking at?
>
>> Q1: How to identify actor from vtkRenderer which contains selection
>> points / cells and get selection properties from this actor or
>>
>> Q2: How to identify actor from pqPipeline source on which are selected
>> points and how from appropriate representations to get actor which
>> contains selected points / cells?
>
> Neither of these are really supported. Look at
> vtkSelectionRepresentation. If you can think of ways of "tagging" the
> actors added by the representations used internally by this class, I
> am all ears.


More information about the ParaView mailing list