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

Nenad Vujicic nenadus at gmail.com
Tue May 19 04:37:36 EDT 2015


Utkarsh,

Thank you very much for your response.

Here is what I'm trying to do:

1. I create source plugin by creating appropriate .xml, CMakeLists.txt
and derived class from vtkPolyDataAlgorithm,
2. This new algorithm has 2 output ports (first port is for points
(over which I would like to see floating labels) and second for
lines),
3. In RequestData() routine I generate poly-data for both ports and
call EventHandlers::SetDataLabelParameters(...) (I made instance of it
in constructor of derived class) with labels' parameters,
4. After creating source by pushing Apply, code from EventHandlers is
executed. Lines and Points are displayed fine, but, there are no
labels. Only 2 representations are created (I think both
GeometryRepresentation) and it stops.
5. When I tried to move code from DataRepresentationCreated() to
execute after mptrLabelsPointsRepresentation is initialized in
RepresentationAdded(), it reported "Missing required attribute.".

1-4 worked fine with earlier versions, but, now, labels are not
created. Even DataRepresentationCreated() is not called.

Thanks for any help!

Nenad.



On Mon, May 18, 2015 at 3:51 PM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> I am not sure I follow you description. Do you have some example code
> to share/demonstrate the issue?
>
> On Sat, May 16, 2015 at 6:54 AM, Nenad Vujicic <nenadus at gmail.com> wrote:
>> Hello again,
>>
>> I have one another problem with the latest PV sources (v4.3.1, I used
>> VS2008 x64 built with most of extra packages from super-build enabled)
>> and creating labels. Again everything worked fine on v4.0 (and I think
>> v4.2), but now, not anymore .. Here is what I tried:
>>
>> 1. I created a source plugin which outputs on output port 0 set of
>> points and on output port 1 set of lines.
>> 2. I registered handlers to catch signals sourceAdded(),
>> sourceCreated(), representationAdded(), representationRemoved() etc,
>> 3. In handler for RepresentationAdded, when representation for output
>> port 0 (set of points) is created, I previously created
>> DataLabelRepresentation and initialized, but now it just reports data
>> representation is reported and does nothing..
>> 4. Now, I tried to set some parameters of representation subproxy by:
>>
>> // set representation's properties
>> pqSMAdaptor::setElementProperty(mptrPointsRepresentation->getProxy()->GetProperty("SelectionVisibility"),
>> true);
>> pqSMAdaptor::setElementProperty(mptrPointsRepresentation->getProxy()->GetProperty("SelectionPointLabelVisibility"),
>> true);
>> pqSMAdaptor::setMultipleElementProperty(mptrPointsRepresentation->getProxy()->GetProperty("SelectionPointLabelColor"),
>> rPointLabelColor);
>> pqSMAdaptor::setElementProperty(mptPointsRepresentation->getProxy()->GetProperty("SelectionPointLabelFontSize"),
>> iPointLabelSize);
>> pqSMAdaptor::setElementProperty(mptrPointsRepresentation->getProxy()->GetProperty("SelectionPointLabelFormat"),
>> strPointLabelFormat);
>> pqSMAdaptor::setElementProperty(mptrPointsRepresentation->getProxy()->GetProperty("SelectionPointLabelJustification"),
>> iPointLabelJustification);
>>
>> // update underlying VTK objects
>> mptrPointsRepresentation->getProxy()->UpdateVTKObjects();
>>
>> But, it still doesn't work.
>>
>> Btw, when I create sphere, apply elevation and select some points
>> (with started tracing), I don't see any of these parameters turned ON.
>> I don't see anything about selected points .. Also, I noticed
>> selections are not preserved in state files.
>>
>> Thanks in advance for any help!
>>
>> Nenad.
>>
>>
>> On Wed, May 13, 2015 at 2:21 PM, Nenad Vujicic <nenadus at gmail.com> wrote:
>>> Hello everyone,
>>>
>>> It has been a long time ParaView sources worked excellent with my
>>> patches and the plugin (3D exporter). However, I'm having troubles
>>> with the latest version (v4.3.1) to export labels which are shown over
>>> selected points (both per point and per cell). This was my approach
>>> which worked with v4.0.1 (100% sure) and v4.2 (I think, but, I'm not
>>> definitely sure):
>>>
>>> 1. I traverse all visible pipeline sources and for all their
>>> representations in currently active view do next,
>>> 2. For every representation, I check if it is DataLabelRepresentation
>>> and if it is I save PointLabelVisibility, PointFieldDataArrayName, etc
>>> properties ..
>>> 3. From other representations, I get vtkLODActor for which I bind my
>>> labels properties,
>>> 4. In exporting code, I get current view, traverse its actors and
>>> export them, however, there is one problem now. Let me give an
>>> example:
>>>
>>>     - If I have Sphere on which I applied Elevation filter and
>>> selected several points with turned on labels (with e.g. Elevation
>>> selected as array),
>>>
>>>     - Strange 1: I don't have anymore instance in
>>> DataLabelRepresentation for Elevation pipeline source (btw, during
>>> this traversing I get only one actor),
>>>     - 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.
>>>
>>> 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?
>>>
>>> Thanks everyone for possible answers!
>>>
>>> Nenad.
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>
>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/paraview
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EventHandlers.zip
Type: application/zip
Size: 2895 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150519/dc519df3/attachment.zip>


More information about the ParaView mailing list