In vtkOpenGLRenderer, there are already more than three plane images (vtkImageSlice). Among them, rotation, scaling, and translation can all be displayed correctly. However, after I added some vtkActors, the images could not be displayed in the 3D window when the angle was modified; the images could only be displayed correctly at the LPI angle.
void QImage3DWnd::InitWindow(QImage2DWnd* pView2D[3], QMultiPlaneProcess* pMultiPlanePro)
{
m_viewAxial = pView2D[0];
m_viewCoronal = pView2D[1];
m_viewSagittal = pView2D[2];
m_pMultiPlanePro = pMultiPlanePro;
m_Camera3D = vtkSmartPointer<vtkCamera>::New();
m_Render3D = vtkSmartPointer<vtkOpenGLRenderer>::New();
m_RendWindow3D = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
m_cubeAxes3D = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
m_style3D = vtkSmartPointer<mivInteractorStyleImage3D> ::New();
//m_renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
m_RendWindow3D->OpenGLInit();
m_Render3D->SetActiveCamera(m_Camera3D);
m_RendWindow3D->AddRenderer(m_Render3D);
m_viewWidgetVTK->setRenderWindow(m_RendWindow3D);
m_RendWindow3D->SetFrameBlitModeToBlitToHardware();
m_style3D->m_p3DImagWnd = this;
m_style3D->m_pMuiltPlanePro = m_pMultiPlanePro;
m_RendWindow3D->GetInteractor()->SetInteractorStyle(m_style3D);
m_Render3D->SetUseDepthPeeling(true);
m_Render3D->SetMaximumNumberOfPeels(100);
m_Render3D->SetOcclusionRatio(0.0);
//m_renderWindowInteractor->SetInteractorStyle(m_style3D);
//
// m_vPointPickerImg = vtkSmartPointer::New();
// m_renderWindowInteractor->SetPicker(m_vPointPickerImg);
InitCubeAxes();
SetBackgroundGradient(0xFFFFFF, 0x1E90FF);
m_Camera3D->SetFocalPoint(0, 0, 0);
m_Camera3D->SetPosition(1000, 0, 0);
m_Camera3D->SetViewUp(0,0, 1);
//m_Camera3D->ComputeViewPlaneNormal();
}
void QImage3DWnd::UpMeasureActorToWindow()
{
std::vector<vtkSmartPointer > vctActor;
m_pMeasurePro->GetPlaneAllMeasureActor(WindowType_3D, vctActor);
if (vctActor.size() <= 0)
return;
std::vector<vtkSmartPointer>::iterator it = vctActor.begin();
while (it != vctActor.end())
{
vtkSmartPointer actor = *it;
if (!FindActorInRender(m_Render3D, actor))
{
m_Render3D->AddViewProp(actor);
}
it++;
}
m_Render3D->ResetCameraClippingRange();
m_Render3D->ResetCameraScreenSpace();
m_Render3D->ResetCamera();
m_Render3D->Render();
}