<font color="#000000"><font size="2"><font face="tahoma,sans-serif">Hi<br><br>I'm trying to build 2 independent views with the option of independent filtering <b>and </b>joined filtering of the same data/object. I want 2 users to use ParaView with independent head-tracking, allow them to independently apply filters to the same dataset, have the option of sharing the filters between them and sharing the views.<br>
<br>In my test code attached below, the trackers are not able to control the viewpoint of either windows. <br>The actual plugin code with 1 tracker and 1 view works: <a href="https://github.com/alexisylchan/ParaView/blob/master/Plugins/VRPN/pqVRPNStarter.cxx">https://github.com/alexisylchan/ParaView/blob/master/Plugins/VRPN/pqVRPNStarter.cxx</a><br>
<br><br><b>Test code:</b></font></font></font><br> <font size="1"><span style="font-family: tahoma,sans-serif;"> // Normal geometry creation</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkConeSource* cone = vtkConeSource::New();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkPolyDataMapper * coneMapper = vtkPolyDataMapper::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> coneMapper->SetInputConnection(cone->GetOutputPort());</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkActor* coneActor = vtkActor::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> coneActor->SetMapper(coneMapper);</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> coneActor->SetPosition(10,0,0);</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkPolyDataReader* reader = vtkPolyDataReader::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> reader->SetFileName("D:/alexisc/good-spindle.vtk");</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> mapper->SetInputConnection(reader->GetOutputPort());</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkActor* actor = vtkActor::New();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> actor->SetMapper(mapper);</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> actor->SetScale(0.01, 0.01, 0.01);</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkAxesActor* axesActor = vtkAxesActor::New(); </span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkRenderer* renderer = vtkRenderer::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> renderer->AddViewProp(actor); </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> renderer->AddViewProp(axesActor);</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> renderer->AddViewProp(coneActor);</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkRenderWindow* window = vtkRenderWindow::New();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> window->SetSize(1000,1000);</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> window->AddRenderer(renderer); </span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //Add second window</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkRenderWindow* window2 = vtkRenderWindow::New();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> window2->SetSize(1000,1000);</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> window2->AddRenderer(renderer); </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> /////////////////////////FIRST TRACKER////////////////////////////</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> //Create connection to VRPN Tracker using vtkInteractionDevice.lib</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkVRPNTracker* tracker = vtkVRPNTracker::New();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> tracker->SetDeviceName("Tracker0@tracker1-cs:3883"); </span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> //My custom Tracker placement</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker->SetTracker2WorldTranslation(-7.47, 0, -1.5);</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> // Rotate 90 around x so that tracker is pointing upwards instead of towards view direction.</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> double t2w[3][3] = { 1, 0, 0,</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> 0, 0, -1, </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> 0, 1, 0 };</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> double t2wQuat[4];</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkMath::Matrix3x3ToQuaternion(t2w, t2wQuat);</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker->SetTracker2WorldRotation(t2wQuat);</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker->Initialize();</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //Create device interactor style (defined in vtkInteractionDevice.lib) that determines how the device manipulates camera viewpoint</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkVRPNTrackerStyleCamera* trackerStyleCamera = vtkVRPNTrackerStyleCamera::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> trackerStyleCamera->SetTracker(tracker);</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> trackerStyleCamera->SetRenderer(renderer);</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> /////////////////////////SECOND TRACKER////////////////////////////</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> //Create connection to VRPN Tracker using vtkInteractionDevice.lib</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkVRPNTracker* tracker2 = vtkVRPNTracker::New();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> tracker2->SetDeviceName("Tracker1@tracker1-cs:3883"); </span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> //My custom Tracker placement</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker2->SetTracker2WorldTranslation(-7.0, 0, -1.5);</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> // Rotate 90 around x so that tracker is pointing upwards instead of towards view direction.</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> double t2w2[3][3] = { 1, 0, 0,</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> 0, 0, -1, </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> 0, 1, 0 };</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> double t2wQuat2[4];</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkMath::Matrix3x3ToQuaternion(t2w2, t2wQuat2);</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker2->SetTracker2WorldRotation(t2wQuat2);</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker2->Initialize(); </span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //Create device interactor style (defined in vtkInteractionDevice.lib) that determines how the device manipulates camera viewpoint</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkVRPNTrackerStyleCamera* trackerStyleCamera2 = vtkVRPNTrackerStyleCamera::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> trackerStyleCamera2->SetTracker(tracker2);</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> trackerStyleCamera2->SetRenderer(renderer);</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //////////////////////////////////////////////////////////////////////////////</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkDeviceInteractor* inputInteractor = vtkDeviceInteractor::New();</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> //Add first tracker to Device Interactor</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> inputInteractor->AddInteractionDevice(tracker);</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> inputInteractor->AddDeviceInteractorStyle(trackerStyleCamera);</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkDeviceInteractor* inputInteractor2 = vtkDeviceInteractor::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //Add second tracker to second Device Interactor</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> inputInteractor2->AddInteractionDevice(tracker2);</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> inputInteractor2->AddDeviceInteractorStyle(trackerStyleCamera2);</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkInteractionDeviceManager* idManager = vtkInteractionDeviceManager::New();</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //Get vtkRenderWindowInteractor from the Interaction Device Manager (defined in vtkInteractionDevice.lib)</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkRenderWindowInteractor* interactor = idManager->GetInteractor(inputInteractor);</span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> //Get second interactor</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> vtkRenderWindowInteractor* interactor2 = idManager->GetInteractor(inputInteractor2);</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //Set the vtkRenderWindowInteractor's style (trackballcamera) and window </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkInteractorStyleTrackballCamera* interactorStyle = vtkInteractorStyleTrackballCamera::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> interactor->SetRenderWindow(window);</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> interactor->SetInteractorStyle(interactorStyle); </span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> //Get second interactorStyle</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> vtkInteractorStyleTrackballCamera* interactorStyle2 = vtkInteractorStyleTrackballCamera::New();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> interactor2->SetRenderWindow(window2);</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> interactor2->SetInteractorStyle(interactorStyle2); </span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> interactor->Initialize(); </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> interactor2->Initialize();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> // Clean up</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> // cone->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> reader->Delete();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> mapper->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> actor->Delete();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> renderer->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> </span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> window->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker->Delete();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> trackerStyleCamera->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> inputInteractor->Delete();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> idManager->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> interactorStyle->Delete();</span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> window2->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> tracker2->Delete();</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> trackerStyleCamera2->Delete();</span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> inputInteractor2->Delete(); </span><br style="font-family: tahoma,sans-serif;">
<br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> interactorStyle2->Delete(); </span><br style="font-family: tahoma,sans-serif;"><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> // Start interacting</span><br style="font-family: tahoma,sans-serif;">
<span style="font-family: tahoma,sans-serif;"> interactor->Start(); </span><br style="font-family: tahoma,sans-serif;"><span style="font-family: tahoma,sans-serif;"> interactor2->Start();</span><br style="font-family: tahoma,sans-serif;">
</font><br><br><div class="gmail_quote">On Mon, Feb 28, 2011 at 10:49 AM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
What exactly are you trying to do? vtkSMMultiViewRenderModuleProxy is<br>
deprecated, but it was never meant to be used directly anyways -- one<br>
simply created a view proxy and used it. Which is still true. Simply<br>
create multiple "RenderView" proxies and set "ViewPosition" and<br>
"ViewSize" properties on them to set up the layout.<br>
<br>
Utkarsh<br>
<div><div></div><div class="h5"><br>
<br>
On Sun, Feb 27, 2011 at 4:44 PM, Alexis Chan <<a href="mailto:alexisc@stanfordalumni.org">alexisc@stanfordalumni.org</a>> wrote:<br>
> Hi<br>
><br>
> I am interested in implementing multiple views (multiple interactors and<br>
> multiple renderers). I think this is a pretty good example for me to follow:<br>
> <a href="http://www.paraview.org/Wiki/Multiple_views" target="_blank">http://www.paraview.org/Wiki/Multiple_views</a><br>
><br>
> But I cannot find vtkSMMultiViewRenderModuleProxy in my clone of the<br>
> ParaView git repository.<br>
><br>
> Has the class been deprecated?<br>
><br>
><br>
> --<br>
> Alexis YL Chan<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br>Alexis YL Chan <a href="http://alexisylchan.wordpress.com/" target="_blank"></a><br>