20 #include <sofa/core/visual/VisualParams.h>
21 #include <vtkObjectFactory.h>
22 #include <vtkRenderer.h>
23 #include <vtkRenderWindow.h>
30 mitk::vtkSimulationPolyDataMapper3D::vtkSimulationPolyDataMapper3D()
35 mitk::vtkSimulationPolyDataMapper3D::~vtkSimulationPolyDataMapper3D()
41 vtkRenderWindow* renderWindow = renderer->GetRenderWindow();
43 if (renderWindow->CheckAbortStatus() == 1)
46 if (renderWindow->SupportsOpenGL() == 0)
49 if (m_Simulation.IsNull())
52 if (!renderWindow->IsCurrent())
53 renderWindow->MakeCurrent();
55 m_SimulationService->SetActiveSimulation(m_Simulation);
57 sofa::core::visual::VisualParams* vParams = sofa::core::visual::VisualParams::defaultInstance();
58 sofa::simulation::Simulation::SPtr sofaSimulation = m_Simulation->GetSOFASimulation();
59 sofa::simulation::Node::SPtr rootNode = m_Simulation->GetRootNode();
61 sofaSimulation->updateVisual(rootNode.get());
62 sofaSimulation->draw(vParams, rootNode.get());
74 m_Simulation = simulation;
79 if (m_Simulation.IsNull())
80 return Superclass::GetBounds();
82 sofa::simulation::Node::SPtr rootNode = m_Simulation->GetRootNode();
84 const sofa::defaulttype::Vector3&
min = bbox.minBBox();
85 const sofa::defaulttype::Vector3&
max = bbox.maxBBox();
void Render(vtkRenderer *renderer, vtkActor *actor) override
DataCollection - Class to facilitate loading/accessing structured data.
double * GetBounds() override
MITKSIMULATION_EXPORT ISimulationService * GetSimulationService(us::ModuleContext *moduleContext=us::GetModuleContext())
vtkStandardNewMacro(AnatomicalStructureColorPresets)
itk::BoundingBox< unsigned long, 3, mitk::ScalarType > BoundingBox
void RenderPiece(vtkRenderer *, vtkActor *) override
void SetSimulation(mitk::Simulation::Pointer simulation)