Hello all,<div><br></div><div>I'm developing a ParaView plugin that modifies the camera position with data coming from a interaction device. I'm using C++ and Linux 64 bit. I have tested it with the build in server and it works without a hitch. However, when I connect the client to a server used for visualizing data in a tiled display, I run on some issues, namely a Segmentation Fault :(. </div>
<div><br></div><div>When I connect my client to the remote server, I load my plugin and connect it to the server used for reading the data from the interaction device. It works well if I use a build-in source for test (like a cylinder), and nothing wrong happen. However, If I try to load a ParaView state of a more complex model, the client collapses (Almost every time, sometimes it works just fine and I can use the interaction device with the tile display). When I run gdb, It says that the segmentation fault is triggered by a call to vtkCamera::Roll or some other method of vtkCamera. Since I'm doing this at the constructor of my plugin:</div>
<div><br></div><div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> pqView * theView = pqActiveView::instance().current();</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> vtkSMRenderViewProxy* myProxy = (vtkSMRenderViewProxy*)theView->getViewProxy();</span></div>
<div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> *theCamera = myProxy->GetActiveCamera();</span></div><div><br></div><div>and theCamera is a member of my plugin class, I thought that maybe the pqView is changing when I load the state, and the vtkCamera address is no longer valid. Obviously, I would get a Segmentation Fault.</div>
<div><br></div><div>Since It seems like pqView changes when I load a state, then I changed my code in order to obtain the new pqView each time my method that changes the camera position is called (It is a SLOT, by the way). So I changed it like this:</div>
<div><br></div><div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;">void myClass::changeCameraPosition(const float roll, const float elevation, const float azimuth)</span></div>
<div><span class="Apple-style-span" style="font-family: 'courier new', monospace;">{</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> pqView * theView = pqActiveView::instance().current();<br>
</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> vtkSMRenderViewProxy* myProxy = (vtkSMRenderViewProxy*)theView->getViewProxy();</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> vtkCamera *newCamera = myProxy->GetActiveCamera();</span></div>
<div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> cout << "AddNewCam "<<newCamera<<" endNC"<<endl;</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> newCamera->Roll(roll);</span></div>
<div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> newCamera->Elevation(elevation);</span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> newCamera->Azimuth(azimuth);</span></div>
<div><span class="Apple-style-span" style="font-family: 'courier new', monospace;"> newCamera->OrthogonalizeViewUp(); </span></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace;">}</span></div>
<div><span class="Apple-style-span" style="font-family: 'courier new'; font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-size: 12px;">As you can see, I have added a cout in order to show the new address of theCamera. However, when I tried this solution, the client would die even before printing the new camera address.</span></div>
<div><span class="Apple-style-span" style="font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-size: 12px;">So, I wanted to ask you, What I'm doing wrong? Is there something different with pqView in a local setting opposed to a remote setting? And, more importantly, why it works sometimes? I would expect a bad behaving code to break every single time, not working in isolated occasions.</span></div>
<div><span class="Apple-style-span" style="font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-size: 12px;">Thanks a lot in advance for your help.</span></div><div><span class="Apple-style-span" style="font-size: 12px;"><br>
</span></div><div><span class="Apple-style-span" style="font-size: 12px;">Best Regards,</span></div><div><span class="Apple-style-span" style="font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-size: 12px;">Andrés Padilla</span></div>
<div><span class="Apple-style-span" style="font-size: 12px;">Universidad de los Andes, Graduate Student</span></div></div></div>