[Paraview-developers] Help to create a textsource proxy and to display it in C++

PULVERAIL, Sebastien sebastien.pulverail at sogeti.com
Thu Jun 11 04:21:16 EDT 2015


Hello,

Thank you for your help.

I have two questions about the piece of code you gave me :

1/ Where can I find the property helper to set for a given proxy?

2/ You are using a variable renderView. I assume that it matches to the current active render view.
How can I get it? With something like pqActiveObjects::instance().activeView()??

Thank you in advance.

Sébastien

De : Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]
Envoyé : mercredi 10 juin 2015 19:47
À : PULVERAIL, Sebastien; paraview-developers at paraview.org
Objet : Re: [Paraview-developers] Help to create a textsource proxy and to display it in C++

Oops...use "TextSourceRepresentation" instead of "DataLabelRepresentation".
Utkarsh

On Wed, Jun 10, 2015 at 1:46 PM Utkarsh Ayachit <utkarsh.ayachit at kitware.com<mailto:utkarsh.ayachit at kitware.com>> wrote:
Something like following should do the trick:
       vtkSMProxy* labelRepresentation = sessionProxyManager->NewProxy("representations", "DataLabelRepresentation");
      vtkSMPropertyHelper(labelRepresentation, "Input").Set(title);
      vtkSMPropertyHelper(labelRepresentation, "PointLabelMode").Set("IDs");
      vtkSMPropertyHelper(labelRepresentation, "PointLabelVisibility").Set(1);
      labelRepresentation->UpdateVTKObjects();
      vtkSMPropertyHelper(renderView, "Representations").Add(labelRepresentation);
      renderView->UpdateVTKObjects();




On Wed, Jun 10, 2015 at 12:11 PM PULVERAIL, Sebastien <sebastien.pulverail at sogeti.com<mailto:sebastien.pulverail at sogeti.com>> wrote:
Hello,

I’m trying to display a label in my render scene programmatically speaking.
Let’s assume that the label to display is my scene title.

If I’m right, the first step is to create my source proxy :
        vtkSMProxyManager* proxyManager = vtkSMProxyManager::GetProxyManager();
        vtkSMSessionProxyManager* sessionProxyManager = proxyManager->GetActiveSessionProxyManager();

        vtkSmartPointer<vtkSMSourceProxy> title;
        title.TakeReference(vtkSMSourceProxy::SafeDownCast(sessionProxyManager->NewProxy("sources", "TextSource")));
        vtkSMPropertyHelper(title, "Text").Set("MyTitle");

Then I assume that I have to create a TextSourceRepresentation and to tell my application that there is a new representation to render.
I don’t know how to do the last two steps.

Can you please help me to make this work?

Thank you in advance.

Sébastien.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=Paraview-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview-developers
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20150611/20a3042e/attachment.html>


More information about the Paraview-developers mailing list