26 #include <vtkCamera.h>
27 #include <vtkFloatArray.h>
28 #include <vtkPointData.h>
29 #include <vtkPolyData.h>
30 #include <vtkRegressionTestImage.h>
31 #include <vtkSphereSource.h>
32 #include <vtkTextureMapToSphere.h>
48 textureCoordinates->SetNumberOfComponents(2);
49 textureCoordinates->SetName(
"TextureCoordinates");
55 unsigned int *dims = textureImage->GetDimensions();
56 for (
unsigned int j = 0; j < dims[1]; ++j)
58 for (
unsigned int i = 0; i < dims[0]; ++i)
60 int pixelID = i + j * dims[0];
61 float xNorm = (((float)i) / dims[0]);
62 float yNorm = ((float)j) / dims[1];
63 textureCoordinates->InsertTuple2(pixelID, xNorm, yNorm);
70 surfaceToPutTextureOn->GetVtkPolyData()->GetPointData()->SetTCoords(textureCoordinates);
74 ->SetProperty(
"Surface.Texture", textureProperty);
88 mitk::Point3D surfaceCenter = surfaceToPutTextureOn->GetGeometry()->GetCenter();
89 vtkCamera *camera3d = renderingHelper.
GetVtkRenderer()->GetActiveCamera();
91 camera3d->SetPosition(0, 0, -1000);
92 camera3d->SetViewUp(0, -1, 0);
93 camera3d->SetFocalPoint(0, 0, surfaceCenter[2]);
94 camera3d->SetViewAngle(40);
99 bool generateReferenceScreenshot =
false;
100 if (generateReferenceScreenshot)
107 "CompareRenderWindowAgainstReference test result positive?");
virtual bool InitializeViews(const BaseGeometry *geometry, RequestType type=REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace=false)
Class for storing surfaces (vtkPolyData).
void SetMapperID(mitk::BaseRenderer::StandardMapperSlot id)
SetMapperID Change between Standard2D and 3D mappers.
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
void SaveReferenceScreenShot(std::string fileName)
SaveReferenceScreenShot Convenience method to save a reference screen shot.
bool CompareRenderWindowAgainstReference(int argc, char *argv[], double threshold=10.0)
CompareRenderWindowAgainstReference Convenience method to compare the image rendered in the internal ...
#define MITK_TEST_CONDITION(COND, MSG)
static RenderingManager * GetInstance()
Image class for storing images.
mitk::DataStorage::Pointer GetDataStorage()
Returns the datastorage, in order to modify the data inside a rendering test.
static Pointer New(const char *_arg)
vtkRenderer * GetVtkRenderer()
Getter for the vtkRenderer.
int mitkSurfaceVtkMapper3DTest(int argc, char *argv[])
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.