[Paraview] [paraview] Question about pqView

Andrés Felipe Padilla anfeken at gmail.com
Wed May 20 19:28:18 EDT 2009


Hello all,
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 :(.

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:

  pqView * theView = pqActiveView::instance().current();
  vtkSMRenderViewProxy* myProxy =
(vtkSMRenderViewProxy*)theView->getViewProxy();
 *theCamera = myProxy->GetActiveCamera();

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.

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:

void myClass::changeCameraPosition(const float  roll, const float elevation,
const float  azimuth)
{
  pqView * theView = pqActiveView::instance().current();
  vtkSMRenderViewProxy* myProxy =
(vtkSMRenderViewProxy*)theView->getViewProxy();
  vtkCamera *newCamera = myProxy->GetActiveCamera();
  cout << "AddNewCam "<<newCamera<<" endNC"<<endl;
  newCamera->Roll(roll);
  newCamera->Elevation(elevation);
  newCamera->Azimuth(azimuth);
  newCamera->OrthogonalizeViewUp();
}

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.

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.

Thanks a lot in advance for your help.

Best Regards,

Andrés Padilla
Universidad de los Andes, Graduate Student
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090520/a852a3f6/attachment-0001.htm>


More information about the ParaView mailing list