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

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Jun 10 13:46:49 EDT 2015


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

Utkarsh

On Wed, Jun 10, 2015 at 1:46 PM Utkarsh Ayachit <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> 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
>>
>> 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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20150610/01f673a2/attachment.html>


More information about the Paraview-developers mailing list