<div dir="ltr">Nenad,<br><br><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">DataLabelRepresentation is a subproxy of the </span><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">GeometryRepresentation and that has been the case since as long as I remember. That means that when you iterate over representations in the view, you'll never see a separate DataLabelRepresentation proxy. Each source proxy has a </span>GetSelectionOutput method that you can use to get the source proxy which is doing the "extracting" tasks to extract selected points. To see if the source proxy has a "selection" set, you can use the vtkSMSourceProxy::GetSelectionInput() method.<br><div><br></div><div>Hope that helps.</div><div>Utkarsh</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, May 22, 2015 at 7:15 AM Nenad Vujicic <<a href="mailto:nenadus@gmail.com">nenadus@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Utkarsh,<br>
<br>
Thank you very much for answers about creating and initializing<br>
DataLabelRepresentation. Now my source plugin works perfectly.<br>
<br>
But, my exporting plugin (my first message) is still unable to export<br>
labels which I get when try selecting several points. Here is what I<br>
do:<br>
<br>
1. Create Sphere and apply Elevation filter on it (I turn OFF 3d widget),<br>
2. I select several points and in Selection Manager I select Elevation<br>
for Point Labels,<br>
3. In following code snippet I get only 2 message boxes (one of Sphere<br>
and one for Elevation - both GeometryRepresentation),, but, there is<br>
no DataLabelRepresentation.<br>
4. I know how to extract labels parameters at this level (Selection*<br>
parameters from representation), but not set of points over which are<br>
generated labels,<br>
<br>
// for all sources<br>
for(i = 0; i < sources.size(); i++)<br>
{<br>
// get source<br>
pqPipelineSource* source = <a href="http://sources.at" target="_blank">sources.at</a>(i);<br>
<br>
// for every source's output port, process it<br>
for(output_port = 0; output_port <<br>
source->getNumberOfOutputPorts(); output_port++)<br>
{<br>
// traverse all representations<br>
for(j = 0; j < source->getRepresentations(output_port,<br>
active_view).count(); j++)<br>
{<br>
QMessageBox::about(NULL, "",<br>
GetCurrentSourceRepresentationSMName());<br>
}<br>
}<br>
}<br>
<br>
Should I try to catch<br>
pqSelectionManager::selectionChanged(pqOutputPort*) to get data<br>
structure over which are points which I can compare with data<br>
structures extracted from vtkRenderWindow to generate labels?<br>
<br>
Thanks for help in advance!<br>
<br>
Nenad.<br>
<br>
On Mon, May 18, 2015 at 3:49 PM, Utkarsh Ayachit<br>
<<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>> wrote:<br>
>> - Strange 1: I don't have anymore instance in<br>
>> DataLabelRepresentation for Elevation pipeline source (btw, during<br>
>> this traversing I get only one actor),<br>
><br>
> I don't follow. DataLableRepresentation is indeed created for every<br>
> representation shown in the render view.<br>
><br>
><br>
>> - Strange 2: When I traverse vtkRenderer's actors, I get 2 actors<br>
>> (sphere mesh and actor with selected points), but, I'm unable to<br>
>> connect selection label properties (which are tied with Elevation<br>
>> pipeline source actor - sphere mesh) and mesh with selected points /<br>
>> cells.<br>
><br>
> Remember that label actors are added to the 2D / non-composited<br>
> renderer, not the same as the 3D renderer. Which renderer are you<br>
> looking at?<br>
><br>
>> Q1: How to identify actor from vtkRenderer which contains selection<br>
>> points / cells and get selection properties from this actor or<br>
>><br>
>> Q2: How to identify actor from pqPipeline source on which are selected<br>
>> points and how from appropriate representations to get actor which<br>
>> contains selected points / cells?<br>
><br>
> Neither of these are really supported. Look at<br>
> vtkSelectionRepresentation. If you can think of ways of "tagging" the<br>
> actors added by the representations used internally by this class, I<br>
> am all ears.<br>
</blockquote></div>