36 #include "vtkAnnotatedCubeActor.h"
37 #include "vtkCornerAnnotation.h"
39 #include "vtkOrientationMarkerWidget.h"
40 #include "vtkProperty.h"
41 #include "vtkRenderWindow.h"
42 #include "vtkRenderWindowInteractor.h"
43 #include "vtkTextProperty.h"
87 mitkWidget1->GetSliceNavigationController()->ConnectGeometrySendEvent(
91 mitkWidget1->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController,
false);
92 mitkWidget2->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController,
false);
93 mitkWidget3->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController,
false);
94 mitkWidget4->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController,
false);
96 mitkWidget4->GetRenderer()->GetVtkRenderer()->SetBackground(0.1, 0.1, 0.1);
97 mitkWidget4->GetRenderer()->GetVtkRenderer()->SetBackground(0.5, 0.5, 0.5);
98 mitkWidget4->GetRenderer()->GetVtkRenderer()->GradientBackgroundOn();
122 float white[3] = {1.0f, 1.0f, 1.0f};
134 m_PlaneNode1->SetProperty(
"layer", layer);
135 m_PlaneNode1->SetColor(1.0, 0.0, 0.0);
147 m_PlaneNode2->SetProperty(
"layer", layer);
148 m_PlaneNode2->SetColor(0.0, 1.0, 0.0);
160 m_PlaneNode3->SetProperty(
"layer", layer);
161 m_PlaneNode3->SetColor(0.0, 0.0, 1.0);
166 if (m_PlaneNode1.IsNotNull() && m_PlaneNode2.IsNotNull() && m_PlaneNode3.IsNotNull() && m_Node.IsNotNull())
168 if (m_DataStorage.IsNotNull())
170 m_DataStorage->Add(m_PlaneNode1);
171 m_DataStorage->Add(m_PlaneNode2);
172 m_DataStorage->Add(m_PlaneNode3);
179 vtkRenderer *vtkrenderer;
185 int w = vtkObject::GetGlobalWarningDisplay();
186 vtkObject::GlobalWarningDisplayOff();
189 if (vtkrenderer != NULL)
190 vtkrenderer->ResetCamera();
193 if (vtkrenderer != NULL)
194 vtkrenderer->ResetCamera();
197 if (vtkrenderer != NULL)
198 vtkrenderer->ResetCamera();
201 if (vtkrenderer != NULL)
202 vtkrenderer->ResetCamera();
204 vtkObject::SetGlobalWarningDisplay(w);
207 int main(
int argc,
char *argv[])
211 fprintf(stderr,
"Usage: %s [filename1] [filename2] ...\n\n",
"");
222 for (i = 1; i < argc; ++i)
225 if (strcmp(argv[i],
"-testing") == 0)
234 for (mitk::DataStorage::SetOfObjects::Iterator nodeIter = nodes->Begin(), nodeIterEnd = nodes->End();
235 nodeIter != nodeIterEnd;
240 if (image.IsNotNull())
251 std::cerr <<
"Could not open file " << filename << std::endl;
266 mitkWidget1->GetRenderer()->PrepareRender();
267 mitkWidget2->GetRenderer()->PrepareRender();
268 mitkWidget3->GetRenderer()->PrepareRender();
271 mitkWidget1->GetRenderer()->SetDataStorage(m_DataStorage);
272 mitkWidget2->GetRenderer()->SetDataStorage(m_DataStorage);
273 mitkWidget3->GetRenderer()->SetDataStorage(m_DataStorage);
274 mitkWidget4->GetRenderer()->SetDataStorage(m_DataStorage);
277 if (m_DisplayInteractor.IsNull())
280 m_DisplayInteractor->LoadStateMachine(
"DisplayInteraction.xml");
281 m_DisplayInteractor->SetEventConfig(
"DisplayConfigMITK.xml");
293 mitkWidget1->SetSize(400, 400);
295 mitkWidget2->GetVtkRenderWindow()->SetPosition(mitkWidget1->GetVtkRenderWindow()->GetPosition()[0] + 420,
296 mitkWidget1->GetVtkRenderWindow()->GetPosition()[1]);
297 mitkWidget2->SetSize(400, 400);
299 mitkWidget3->GetVtkRenderWindow()->SetPosition(mitkWidget1->GetVtkRenderWindow()->GetPosition()[0],
300 mitkWidget1->GetVtkRenderWindow()->GetPosition()[1] + 450);
301 mitkWidget3->SetSize(400, 400);
303 mitkWidget4->GetVtkRenderWindow()->SetPosition(mitkWidget1->GetVtkRenderWindow()->GetPosition()[0] + 420,
304 mitkWidget1->GetVtkRenderWindow()->GetPosition()[1] + 450);
305 mitkWidget4->SetSize(400, 400);
317 m_DataStorage->Print(std::cout);
323 mitkWidget1->ReinitEventProvider();
324 mitkWidget2->ReinitEventProvider();
325 mitkWidget3->ReinitEventProvider();
327 mitkWidget1->GetVtkRenderWindow()->Render();
328 mitkWidget2->GetVtkRenderWindow()->Render();
329 mitkWidget3->GetVtkRenderWindow()->Render();
330 mitkWidget4->GetVtkRenderWindow()->Render();
331 mitkWidget4->GetVtkRenderWindowInteractor()->Start();
mitk::RenderWindow::Pointer mitkWidget4
virtual bool InitializeViews(const BaseGeometry *geometry, RequestType type=REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace=false)
const SliceNavigationController * GetTimeNavigationController() const
Base class to implement InteractionEventObservers.
itk::SmartPointer< Self > Pointer
mitk::DisplayInteractor::Pointer m_DisplayInteractor
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
void AddDisplayPlaneSubTree()
mitk::RenderWindow::Pointer mitkWidget2
mitk::DataNode::Pointer m_PlaneNode3
vtkSmartPointer< vtkMitkRectangleProp > m_RectangleRendering4
Constants for most interaction classes, due to the generic StateMachines.
Controls the selection of the slice the associated BaseRenderer will display.
vtkSmartPointer< vtkMitkRectangleProp > m_RectangleRendering2
mitk::DataNode::Pointer m_Node
mitk::DataNode::Pointer m_PlaneNode1
void ConnectGeometryTimeEvent(T *receiver, bool connectSendEvent=true)
mitk::DataStorage::Pointer m_DataStorage
mitk::RenderWindow::Pointer mitkWidget1
Example of a NON QT DEPENDENT MITK RENDERING APPLICATION.
static RenderingManager * GetInstance()
static const std::string filename
Image class for storing images.
mitk::RenderWindow::Pointer mitkWidget3
vtkSmartPointer< vtkMitkRectangleProp > m_RectangleRendering1
mitk::DataNode::Pointer m_PlaneNode2
vtkSmartPointer< vtkMitkRectangleProp > m_RectangleRendering3
static DataStorage::SetOfObjects::Pointer Load(const std::string &path, DataStorage &storage)
Load a file into the given DataStorage.
mitk::SliceNavigationController * m_TimeNavigationController
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
int main(int argc, char *argv[])
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.