[Paraview] Troubles with exporting selection labels from current ParaView render view
Nenad Vujicic
nenadus at gmail.com
Wed Jun 10 03:25:53 EDT 2015
Dear Utkarsh,
I'm sorry for delay, I was out of home for a while.
Yes, I think this will help. Thank you very much for your help!
Nenad.
On Sat, May 30, 2015 at 4:10 PM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> Nenad,
>
> DataLabelRepresentation is a subproxy of the 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 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.
>
> Hope that helps.
> Utkarsh
>
> On Fri, May 22, 2015 at 7:15 AM Nenad Vujicic <nenadus at gmail.com> wrote:
>>
>> Utkarsh,
>>
>> Thank you very much for answers about creating and initializing
>> DataLabelRepresentation. Now my source plugin works perfectly.
>>
>> But, my exporting plugin (my first message) is still unable to export
>> labels which I get when try selecting several points. Here is what I
>> do:
>>
>> 1. Create Sphere and apply Elevation filter on it (I turn OFF 3d widget),
>> 2. I select several points and in Selection Manager I select Elevation
>> for Point Labels,
>> 3. In following code snippet I get only 2 message boxes (one of Sphere
>> and one for Elevation - both GeometryRepresentation),, but, there is
>> no DataLabelRepresentation.
>> 4. I know how to extract labels parameters at this level (Selection*
>> parameters from representation), but not set of points over which are
>> generated labels,
>>
>> // for all sources
>> for(i = 0; i < sources.size(); i++)
>> {
>> // get source
>> pqPipelineSource* source = sources.at(i);
>>
>> // for every source's output port, process it
>> for(output_port = 0; output_port <
>> source->getNumberOfOutputPorts(); output_port++)
>> {
>> // traverse all representations
>> for(j = 0; j < source->getRepresentations(output_port,
>> active_view).count(); j++)
>> {
>> QMessageBox::about(NULL, "",
>> GetCurrentSourceRepresentationSMName());
>> }
>> }
>> }
>>
>> Should I try to catch
>> pqSelectionManager::selectionChanged(pqOutputPort*) to get data
>> structure over which are points which I can compare with data
>> structures extracted from vtkRenderWindow to generate labels?
>>
>> Thanks for help in advance!
>>
>> Nenad.
>>
>> 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