35 textAnnotation->SetText(text);
36 textAnnotation->SetFontSize(fontsize);
37 textAnnotation->SetColor(red, green, blue);
38 textAnnotation->SetOpacity(1);
41 Annotation.push_back(textAnnotation);
46 CPPUNIT_TEST_SUITE(mitkLayoutAnnotationRendererTestSuite);
49 CPPUNIT_TEST_SUITE_END();
54 std::vector<std::string> m_CommandlineArgs;
55 std::string m_PathToBall;
56 std::string m_PathToImage;
57 std::string m_ReferenceImagePath;
65 mitkLayoutAnnotationRendererTestSuite() : m_RenderingTestHelper(500, 500) {}
76 m_ReferenceImagePath =
"RenderingTestData/ReferenceScreenshots/Annotation/";
84 m_CommandlineArgs.push_back(
"-V");
88 void Render2DAnnotation()
98 std::string refImagePath =
GetTestDataFilePath(m_ReferenceImagePath +
"LayoutAnnotationRenderer.png");
100 m_CommandlineArgs.push_back(refImagePath);
105 std::vector<mitk::TextAnnotation2D::Pointer> Annotation;
152 m_RenderingTestHelper.
Render();
void SetViewDirection(mitk::SliceNavigationController::ViewDirection viewDirection)
Set the view direction of the renderwindow (e.g. sagittal, coronal, axial)
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
void createTextAnnotationWithLayouter(std::vector< mitk::TextAnnotation2D::Pointer > &Annotation, mitk::LayoutAnnotationRenderer::Alignment align, mitk::BaseRenderer *renderer, int fontsize, float red, float green, float blue, int prio, std::string text)
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
vtkRenderWindow * GetVtkRenderWindow()
Getter for the vtkRenderWindow which should be used to call vtkRegressionTestImage.
Organizes the rendering process.
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
static void AddAnnotation(Annotation *annotation, const std::string &rendererID, Alignment alignment=TopLeft, double marginX=5, double marginY=5, int priority=-1)
static std::string GetTestDataFilePath(const std::string &testData)
Get the absolute path for test data.
bool CompareRenderWindowAgainstReference(int argc, char *argv[], double threshold=10.0)
CompareRenderWindowAgainstReference Convenience method to compare the image rendered in the internal ...
void Render()
Render everything into an mitkRenderWindow. Call SetViewDirection() and SetProperty() before this met...
Test fixture for parameterized tests.
The ArgcHelperClass class is a convinience class to convert a vector of strings to the standard c++ a...
void SetAutomaticallyCloseRenderWindow(bool automaticallyCloseRenderWindow)
SetStopRenderWindow Convenience method to make the renderwindow hold after rendering. Usefull for debugging.
void AddNodeToStorage(mitk::DataNode::Pointer node)
AddNodeToStorage Add a node to the datastorage and perform a reinit which is necessary for rendering...
static DataStorage::SetOfObjects::Pointer Load(const std::string &path, DataStorage &storage, const ReaderOptionsFunctorBase *optionsCallback=nullptr)
Load a file into the given DataStorage.