<div dir="ltr">One more update, after calling view->UpdateVTKObjects() and view->MakeRenderWindowInteractor(), the example below runs without errors.<br>But still, the sphere source is not visible, only the grey background. What is missing to show the sphere in the view?<br><br>#include "vtkInitializationHelper.h"<br>#include "vtkProcessModule.h"<br>#include "vtkPVOptions.h"<br>#include "vtkSMProxyManager.h"<br>#include "vtkSMSession.h"<br>#include "vtkSMSessionClient.h"<br>#include "vtkSMSessionProxyManager.h"<br>#include "vtkSMSourceProxy.h"<br>#include "vtkSMProperty.h"<br>#include "vtkSMRenderViewProxy.h"<br><br>#include "vtkRenderWindow.h"<br>#include "vtkRenderWindowInteractor.h"<br><br>int main(int argc, char* argv[])<br>{<br> // Initialization<br> vtkPVOptions* options = vtkPVOptions::New();<br> vtkInitializationHelper::Initialize(argc, argv,<br> vtkProcessModule::PROCESS_CLIENT,<br> options);<br><br> vtkSMSessionClient* session = vtkSMSessionClient::New();<br> vtkProcessModule::GetProcessModule()->RegisterSession(session);<br> session->Connect(options->GetServerURL());<br> cout<<"Connected to: "<<options->GetServerURL()<<endl;<br><br> vtkSMSessionProxyManager *pxm = session->GetSessionProxyManager();<br> vtkSMProxy *sphere = pxm->NewProxy("sources", "SphereSource");<br> cout<<"SphereSource created."<<endl;<br> vtkSMRenderViewProxy* view=(vtkSMRenderViewProxy*)pxm->NewProxy("views", "RenderView");<br> bool ok=view->MakeRenderWindowInteractor(false);<br> cout<<"RenderView created. "<<ok<<endl;<br> vtkSMRepresentationProxy* repr=view->CreateDefaultRepresentation(sphere,0);<br> view->UpdateVTKObjects();<br> cout<<"DefaultRepresentation created."<<endl;<br><br>//Alternative 2:<br>/*<br> view->ResetCamera(); //no crash, but only background visible.<br> view->StillRender(); while(1);<br>*/<br><br>//Alternative 3:<br><br> view->InteractiveRender();<br> view->GetInteractor()->Initialize();<br> view->GetInteractor()->Start();<br><br> //TODO: clean up stuff<br>}<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 2:49 PM, Peter Vogt <span dir="ltr"><<a href="mailto:vogtpeter5@gmail.com" target="_blank">vogtpeter5@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello again,<br>thanks to your help, I was able to establish a connection to a pvserver and create a SphereSource proxy. Now I cannot figure out how to view the rendered scene on the client.<br><br>My attempt, "TestConnection.cxx", is attached below. I have tried three alternatives, which I have marked in the code:<br>Alternative 1 calls "view->StillRender()", which shows the greyish background, maybe because the sphere is outside the viewport?<br>Alternative 2 calls "view->ResetCamera()" before the StillRender(), but ResetCamera crashes with the following output:<br>>ERROR: In /opt/ParaView-v5.0.1-source/ParaViewCore/ServerImplementation/Core/vtkPVSessionCoreInterpreterHelper.cxx, line 63<br>>vtkPVSessionCoreInterpreterHelper (0x976950): No vtkSIProxy for id : 257<br>><br>>ERROR: In /opt/ParaView-v5.0.1-source/ParaViewCore/ServerImplementation/Core/vtkPVSessionCore.cxx, line 390<br>>vtkPVSessionCore (0x8ca480): Wrapper function not found for class "(vtk object is NULL)".<br>>while processing<br>>Message 0 = Invoke<br>> Argument 0 = stream_value {<br>> Message 0 = Invoke<br>> Argument 0 = id_value {1}<br>> Argument 1 = string_value {GetVTKObject}<br>> Argument 2 = uint32_value {257}<br>> }<br>> Argument 1 = string_value {ResetCamera}<br>><br>><br>>ERROR: In /opt/ParaView-v5.0.1-source/ParaViewCore/ServerImplementation/Core/vtkPVSessionCore.cxx, line 391<br>>vtkPVSessionCore (0x8ca480): Aborting execution for debugging purposes.<br>><br>>############ ABORT #############<br>>Wrong tag but don't know how to handle it... 188971<br>>Aborted (core dumped)<br>Alternative 3 tries to show an interactive RenderWindow, but crashes, because view->GetInteractor() returns NULL.<br><br>Apparently I am missing some important step. Can somebody point out how to modify the example (below) in order to render the sphere source visible?<br><br>Thank you<br>Peter<br><br>TestConnection.cxx:<br><br>#include "vtkInitializationHelper.h"<br>#include "vtkProcessModule.h"<br>#include "vtkPVOptions.h"<br>#include "vtkSMProxyManager.h"<br>#include "vtkSMSession.h"<br>#include "vtkSMSessionClient.h"<br>#include "vtkSMSessionProxyManager.h"<br>#include "vtkSMSourceProxy.h"<br>#include "vtkSMProperty.h"<br>#include "vtkSMRenderViewProxy.h"<br><br>#include "vtkRenderWindow.h"<br>#include "vtkRenderWindowInteractor.h"<br><br>int main(int argc, char* argv[])<br>{<br> // Initialization<br> vtkPVOptions* options = vtkPVOptions::New();<br> vtkInitializationHelper::Initialize(argc, argv,<br> vtkProcessModule::PROCESS_CLIENT,<br> options);<br><br> vtkSMSessionClient* session = vtkSMSessionClient::New();<br> vtkProcessModule::GetProcessModule()->RegisterSession(session);<br> session->Connect(options->GetServerURL());<br> cout<<"Connected to: "<<options->GetServerURL()<<endl;<br><br> vtkSMSessionProxyManager *pxm = session->GetSessionProxyManager();<br> vtkSMProxy *sphere = pxm->NewProxy("sources", "SphereSource");<br> cout<<"SphereSource created."<<endl;<br> vtkSMRenderViewProxy* view=(vtkSMRenderViewProxy*)pxm->NewProxy("views", "RenderView");<br> cout<<"RenderView created."<<endl;<br> vtkSMRepresentationProxy* repr=view->CreateDefaultRepresentation(sphere,0);<br> cout<<"DefaultRepresentation created."<<endl;<br><br>//Alternative 1:<br> view->StillRender(); while(1); //no crash, but only background visible.<br><br>//Alternative 2:<br>/*<br> view->ResetCamera(); //crash here<br> view->StillRender(); while(1);<br>*/<br><br>//Alternative 3:<br>/*<br> view->InteractiveRender();<br> view->GetInteractor()->Initialize(); //crash here, because view->GetInteractor()==NULL<br> view->GetInteractor()->Start();<br>*/<br> //TODO: clean up stuff<br>}<br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Apr 20, 2016 at 5:26 PM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span> wrote:<br></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>> Thank you, but we need a pure C++ solution. There is plenty of information<br>
> how this is done with python scripting, but I can't find anything for C++.<br>
> I really need nothing more than a minimal example.<br>
<br>
</span>Peter, look at TestComparativeAnimationCueProxy.cxx[1] file in the<br>
ParaView source. It demonstrates how the initialization needs to<br>
happen. If you have further questions on how to use anything specific<br>
in this application, feel free to holler :).<br>
<br>
[1] <a href="https://gitlab.kitware.com/paraview/paraview/blob/master/ParaViewCore/ServerManager/Default/Testing/Cxx/TestComparativeAnimationCueProxy.cxx" rel="noreferrer" target="_blank">https://gitlab.kitware.com/paraview/paraview/blob/master/ParaViewCore/ServerManager/Default/Testing/Cxx/TestComparativeAnimationCueProxy.cxx</a><br>
<span><font color="#888888"><br>
Utkarsh<br>
</font></span></blockquote></div></div></div><br></div>
</blockquote></div><br></div>