21 #include "vtkRenderWindow.h"
26 #include <vtkCubeSource.h>
38 class mitkRenderingManagerTestClass
46 "Testing if the constructor set the propertylist")
56 "Testing if the propertylist has changed during the last tests")
64 double planeBounds[] = {-1.0, 1.0, -1.0, 1.0, 0.0, 0.0};
65 double cubeBounds[] = {-0.5, 0.5, -0.5, 0.5, -0.5, 0.5};
66 plane->SetBounds(planeBounds);
67 plane->SetCenter(0.0, 0.0, 0.0);
69 vtkPolyData *polys = plane->GetOutput();
71 mitkPlane->SetVtkPolyData(polys);
75 planeNode->SetData(mitkPlane);
77 renderingManager->GetDataStorage()->Add(planeNode);
80 planeGeometry->SetFloatBounds(planeBounds);
83 "Testing if two dimensional Geometry3Ds can be displayed")
86 renderingManager->GetDataStorage()->Remove(planeNode);
88 renderingManager->InitializeViews();
92 cube->SetBounds(cubeBounds);
93 cube->SetCenter(0.0, 0.0, 0.0);
95 vtkPolyData *polyCube = cube->GetOutput();
97 mitkCube->SetVtkPolyData(polyCube);
101 cubeNode->SetData(mitkCube);
103 renderingManager->GetDataStorage()->Add(cubeNode);
106 cubeGeometry->SetFloatBounds(cubeBounds);
109 "Testing if three dimensional Geometry3Ds can be displayed")
112 renderingManager->GetDataStorage()->Remove(cubeNode);
114 renderingManager->InitializeViews();
117 static void TestAddRemoveRenderWindow()
129 "Render window list must be empty")
132 myRenderingManager->AddRenderWindow(vtkRenWin);
135 "Render window list must contain one item")
138 myRenderingManager->RemoveRenderWindow(vtkRenWin);
141 "Render window list must be empty")
145 myRenderingManager->RequestUpdate(vtkRenWin);
147 myRenderingManager->ForceImmediateUpdate(vtkRenWin);
150 "Render window list must be empty")
159 myRenderingManager->RequestUpdateAll();
160 MITK_TEST_OUTPUT(<< "Call ForceImmediateUpdateAll after deleting render window")
161 myRenderingManager->ForceImmediateUpdateAll();
170 mitkRenderingManagerTestClass::TestAddRemoveRenderWindow();
181 "Testing whether global instance equals new local instance (must not be!)")
186 myRenderingManager->SetDataStorage(ds);
192 myRenderingManager->AddRenderWindow(vtkRenWin);
195 "Testing if internal DataStorage has been set correctly for registered BaseRenderer")
196 myRenderingManager->SetDataStorage(ds2);
198 br->GetDataStorage() == ds2,
199 "Testing if change of internal DataStorage has been forwarded correctly to registered BaseRenderer")
201 mitkRenderingManagerTestClass::TestPropertyList(myRenderingManager);
203 mitkRenderingManagerTestClass::TestSurfaceLoading(myRenderingManager);
209 myRenderingManager->RemoveRenderWindow(vtkRenWin);
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
int mitkRenderingManagerTest(int, char *[])
#define MITK_TEST_OUTPUT(x)
Output some text.
#define MITK_TEST_CONDITION(COND, MSG)
static RenderingManager * GetInstance()
static Pointer New(const char *_arga, vtkRenderWindow *_argb, mitk::RenderingManager *_argc)
static void AddInstance(vtkRenderWindow *renWin, BaseRenderer *baseRenderer)
virtual T GetValue() const
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.