37 MaterialTest() { myMP =
nullptr; }
38 void testConstructor()
44 void testConstructorWithColorOpacity()
48 double opacity = 1.0f;
51 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
52 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
55 void testConstructorWithRedGreenBlueOpacity()
59 double opacity = 1.0f;
64 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
65 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
68 void testConstructorRedGreenBlueColorCoefficientSpecularCoefficientSpecularPowerOpacity()
72 double opacity = 1.0f;
74 double colorCoefficient = 0;
75 double specularCoefficient = 0;
76 double specularPower = 0;
78 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
80 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
81 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
83 "Testing if a Coefficient object was set correctly")
85 "Testing if a SpecularPower object was set correctly")
87 "Testing if a colorCoefficient object was set correctly")
90 void testConstructorColorColorCoefficientSpecularCoefficientSpecularPowerOpacity()
94 double opacity = 1.0f;
96 double colorCoefficient = 0;
97 double specularCoefficient = 0;
98 double specularPower = 0;
100 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
102 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
103 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
105 "Testing if a Coefficient object was set correctly")
107 "Testing if a SpecularPower object was set correctly")
110 void testConstructorPropertyRedGreenBlueOpacityAndName()
113 double opacity = 1.0f;
115 std::string name =
"Hans Wurst";
119 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
127 myMP->SetColor(color);
131 myMP->SetColor(color);
135 void testSetColorCoefficient()
137 double colorCoefficient = 0;
139 myMP->SetColorCoefficient(colorCoefficient);
141 "Testing if a colorcoefficent was set correctly")
143 void testSetSpecularColor()
148 myMP->SetSpecularColor(color);
149 MITK_TEST_CONDITION(color == myMP->GetSpecularColor(),
"Testing if a SpecularColor was set correctly")
152 void testSetSpecularCoefficient()
155 double specularCoefficient = 1;
156 myMP->SetSpecularCoefficient(specularCoefficient);
158 "Testing if a SpecularCoefficient was set correctly")
160 void testSetSpecularPower()
163 double specularPower = 1;
164 myMP->SetSpecularPower(specularPower);
165 MITK_TEST_CONDITION(specularPower == myMP->GetSpecularPower(),
"Testing if a SpecularPower was set correctly")
167 void testSetOpacity()
171 myMP->SetOpacity(opacity);
172 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity was set correctly")
175 void testSetInterpolation()
179 myMP->SetInterpolation(interpolation);
180 MITK_TEST_CONDITION(interpolation == myMP->GetInterpolation(),
"Testing if a Interpolation was set correctly")
182 void testSetRepresentation()
186 myMP->SetRepresentation(representation);
187 MITK_TEST_CONDITION(representation == myMP->GetRepresentation(),
"Testing if a Representation was set correctly")
190 void testSetLineWidth()
193 double lineWidth = 1;
194 myMP->SetLineWidth(lineWidth);
195 MITK_TEST_CONDITION(lineWidth == myMP->GetLineWidth(),
"Testing if a LineWidth was set correctly")
198 void testInitialize()
202 double opacity = 1.0f;
204 double colorCoefficient = 0;
205 double specularCoefficient = 0;
206 double specularPower = 0;
208 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
209 double lineWidth = 1;
210 myMP->SetLineWidth(lineWidth);
212 myMP->SetRepresentation(representation);
214 myMP->SetInterpolation(interpolation);
215 myMP->SetSpecularColor(color);
216 std::string name =
"Hans Wurst";
219 myMP2->Initialize(*myMP);
222 void testOperatorequality()
227 double opacity = 1.0f;
229 double colorCoefficient = 0;
230 double specularCoefficient = 0;
231 double specularPower = 0;
233 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
234 double lineWidth = 1;
235 myMP->SetLineWidth(lineWidth);
237 myMP->SetRepresentation(representation);
239 myMP->SetInterpolation(interpolation);
240 myMP->SetSpecularColor(color);
241 std::string name =
"Hans Wurst";
246 double opacity2 = 1.0f;
248 double colorCoefficient2 = 0;
249 double specularCoefficient2 = 0;
250 double specularPower2 = 0;
253 mitk::Material::New(rgb2, rgb2, rgb2, colorCoefficient2, specularCoefficient2, specularPower2, opacity2);
254 double lineWidth2 = 1;
255 myMP2->SetLineWidth(lineWidth2);
257 myMP2->SetRepresentation(representation2);
259 myMP2->SetInterpolation(interpolation2);
260 myMP2->SetSpecularColor(color2);
261 std::string name2 =
"Hans Wurst";
262 myMP2->SetName(name2);
268 double opacity = 1.0f;
270 double colorCoefficient = 0;
271 double specularCoefficient = 0;
272 double specularPower = 0;
274 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
275 double lineWidth = 1;
276 myMP->SetLineWidth(lineWidth);
278 myMP->SetRepresentation(representation);
280 myMP->SetInterpolation(interpolation);
281 myMP->SetSpecularColor(color);
282 std::string name =
"Hans Wurst";
287 double opacity2 = 1.0f;
289 double colorCoefficient2 = 0;
290 double specularCoefficient2 = 0;
291 double specularPower2 = 0;
294 mitk::Material::New(rgb2, rgb2, rgb2, colorCoefficient2, specularCoefficient2, specularPower2, opacity2);
295 double lineWidth2 = 1;
296 myMP2->SetLineWidth(lineWidth2);
298 myMP2->SetRepresentation(representation2);
300 myMP2->SetInterpolation(interpolation2);
301 myMP2->SetSpecularColor(color2);
302 std::string name2 =
"Hans Wurst";
303 myMP2->SetName(name2);
308 void testAssignable()
314 void testOperatorAssign()
327 MaterialTest materialTest;
329 materialTest.testConstructor();
330 materialTest.testConstructorWithColorOpacity();
331 materialTest.testConstructorWithRedGreenBlueOpacity();
332 materialTest.testConstructorRedGreenBlueColorCoefficientSpecularCoefficientSpecularPowerOpacity();
333 materialTest.testConstructorColorColorCoefficientSpecularCoefficientSpecularPowerOpacity();
334 materialTest.testConstructorPropertyRedGreenBlueOpacityAndName();
335 materialTest.testAssignable();
336 materialTest.testOperatorAssign();
337 materialTest.testSetColor();
338 materialTest.testSetColorCoefficient();
339 materialTest.testSetSpecularColor();
340 materialTest.testSetSpecularCoefficient();
341 materialTest.testSetSpecularPower();
342 materialTest.testSetOpacity();
343 materialTest.testSetInterpolation();
344 materialTest.testSetRepresentation();
345 materialTest.testSetLineWidth();
346 materialTest.testInitialize();
347 materialTest.testOperatorequality();
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
#define MITK_TEST_CONDITION(COND, MSG)
int mitkMaterialTest(int, char *[])
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
itk::RGBPixel< double > Color