<div>Hi folks,</div><div><br></div><div>I'm trying to test the synchronization of two renderwindows.</div><div>I first made two renderwindow using vtkRenderWindow.</div><div>Then, below callback funcion is used when left mouse button is clicked.</div>
<div><br></div><div><br></div><div>---</div><div>in Main():</div><div>renderWindowInteractor->AddObserver(vtkCommand::LeftButtonPressEvent, callback, 1.0);</div><div>---</div><div><br></div><div>---</div><div>callback function:</div>
<div><br></div><div>static void interaction_test(vtkObject* obj, unsigned long, void*, void*)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(obj);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>if(iren && iren->GetRepeatCount()) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>cout << "Double Click";</div>
<div> }</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>cout<< "----" << endl;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkCollectionSimpleIterator si;</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer<vtkRendererCollection> renc = vtkSmartPointer<vtkRendererCollection>::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>renc = renderWindowInteractor2->GetRenderWindow()->GetRenderers();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>renc->InitTraversal(si);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer<vtkRenderer> ren1 = vtkSmartPointer<vtkRenderer>::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ren1 = ren->GetFirstRenderer();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer<vtkRenderer> ren2 = vtkSmartPointer<vtkRenderer>::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ren2 = ren->GetNextRenderer(si);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkMatrix4x4 *trmat1 = firstren->GetActiveCamera()->GetViewTransformMatrix();</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat1->GetElement(0,0) << " " << trmat1->GetElement(0,1)<< " " << trmat1->GetElement(0,2)<< " " << trmat1->GetElement(0,3) << endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat1->GetElement(1,0) << " "<< trmat1->GetElement(1,1)<< " " << trmat1->GetElement(1,2)<< " " << trmat1->GetElement(1,3) << endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat1->GetElement(2,0) << " "<< trmat1->GetElement(2,1)<< " " << trmat1->GetElement(2,2)<< " " << trmat1->GetElement(2,3) << endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat1->GetElement(3,0) << " "<< trmat1->GetElement(3,1)<< " " << trmat1->GetElement(3,2)<< " " << trmat1->GetElement(3,3) << endl;</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkMatrix4x4 *trmat2 = secondren->GetActiveCamera()->GetViewTransformMatrix();</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat2->GetElement(0,0) << " " << trmat2->GetElement(0,1)<< " " << trmat2->GetElement(0,2)<< " " << trmat2->GetElement(0,3) << endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat2->GetElement(1,0) << " "<< trmat2->GetElement(1,1)<< " " << trmat2->GetElement(1,2)<< " " << trmat2->GetElement(1,3) << endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat2->GetElement(2,0) << " "<< trmat2->GetElement(2,1)<< " " << trmat2->GetElement(2,2)<< " " << trmat2->GetElement(2,3) << endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout << trmat2->GetElement(3,0) << " "<< trmat2->GetElement(3,1)<< " " << trmat2->GetElement(3,2)<< " " << trmat2->GetElement(3,3) << endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>}</div><div><div><br></div><div>At this code, when I control the mouse in renderwindow A, I can obtain the information of renderwindow B.</div><div>
However, I cannot get the information of renderwindow A.</div><div>Two vtkMatrix4x4 instances showed same results.</div><div>How to get trmat1 of renderwindow A and trmat2 of renderwindow B?</div><div><br></div><div>regards,</div>
<div><br></div><div>JY</div></div>