41 MaterialTest() { myMP = NULL; }
42 void testConstructor()
48 void testConstructorWithColorOpacity()
52 double opacity = 1.0f;
55 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
56 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
59 void testConstructorWithRedGreenBlueOpacity()
63 double opacity = 1.0f;
68 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
69 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
72 void testConstructorRedGreenBlueColorCoefficientSpecularCoefficientSpecularPowerOpacity()
76 double opacity = 1.0f;
78 double colorCoefficient = 0;
79 double specularCoefficient = 0;
80 double specularPower = 0;
82 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
84 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
85 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
87 "Testing if a Coefficient object was set correctly")
89 "Testing if a SpecularPower object was set correctly")
91 "Testing if a colorCoefficient object was set correctly")
94 void testConstructorColorColorCoefficientSpecularCoefficientSpecularPowerOpacity()
98 double opacity = 1.0f;
100 double colorCoefficient = 0;
101 double specularCoefficient = 0;
102 double specularPower = 0;
104 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
106 MITK_TEST_CONDITION(color == myMP->GetColor(),
"Testing if a Color object was set correctly")
107 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
109 "Testing if a Coefficient object was set correctly")
111 "Testing if a SpecularPower object was set correctly")
114 void testConstructorPropertyRedGreenBlueOpacityAndName()
117 double opacity = 1.0f;
119 std::string name =
"Hans Wurst";
123 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity object was set correctly")
131 myMP->SetColor(color);
135 myMP->SetColor(color);
139 void testSetColorCoefficient()
141 double colorCoefficient = 0;
143 myMP->SetColorCoefficient(colorCoefficient);
145 "Testing if a colorcoefficent was set correctly")
147 void testSetSpecularColor()
152 myMP->SetSpecularColor(color);
153 MITK_TEST_CONDITION(color == myMP->GetSpecularColor(),
"Testing if a SpecularColor was set correctly")
156 void testSetSpecularCoefficient()
159 double specularCoefficient = 1;
160 myMP->SetSpecularCoefficient(specularCoefficient);
162 "Testing if a SpecularCoefficient was set correctly")
164 void testSetSpecularPower()
167 double specularPower = 1;
168 myMP->SetSpecularPower(specularPower);
169 MITK_TEST_CONDITION(specularPower == myMP->GetSpecularPower(),
"Testing if a SpecularPower was set correctly")
171 void testSetOpacity()
175 myMP->SetOpacity(opacity);
176 MITK_TEST_CONDITION(opacity == myMP->GetOpacity(),
"Testing if a Opacity was set correctly")
179 void testSetInterpolation()
183 myMP->SetInterpolation(interpolation);
184 MITK_TEST_CONDITION(interpolation == myMP->GetInterpolation(),
"Testing if a Interpolation was set correctly")
186 void testSetRepresentation()
190 myMP->SetRepresentation(representation);
191 MITK_TEST_CONDITION(representation == myMP->GetRepresentation(),
"Testing if a Representation was set correctly")
194 void testSetLineWidth()
197 double lineWidth = 1;
198 myMP->SetLineWidth(lineWidth);
199 MITK_TEST_CONDITION(lineWidth == myMP->GetLineWidth(),
"Testing if a LineWidth was set correctly")
202 void testInitialize()
206 double opacity = 1.0f;
208 double colorCoefficient = 0;
209 double specularCoefficient = 0;
210 double specularPower = 0;
212 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
213 double lineWidth = 1;
214 myMP->SetLineWidth(lineWidth);
216 myMP->SetRepresentation(representation);
218 myMP->SetInterpolation(interpolation);
219 myMP->SetSpecularColor(color);
220 std::string name =
"Hans Wurst";
223 myMP2->Initialize(*myMP);
226 void testOperatorequality()
231 double opacity = 1.0f;
233 double colorCoefficient = 0;
234 double specularCoefficient = 0;
235 double specularPower = 0;
237 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
238 double lineWidth = 1;
239 myMP->SetLineWidth(lineWidth);
241 myMP->SetRepresentation(representation);
243 myMP->SetInterpolation(interpolation);
244 myMP->SetSpecularColor(color);
245 std::string name =
"Hans Wurst";
250 double opacity2 = 1.0f;
252 double colorCoefficient2 = 0;
253 double specularCoefficient2 = 0;
254 double specularPower2 = 0;
257 mitk::Material::New(rgb2, rgb2, rgb2, colorCoefficient2, specularCoefficient2, specularPower2, opacity2);
258 double lineWidth2 = 1;
259 myMP2->SetLineWidth(lineWidth2);
261 myMP2->SetRepresentation(representation2);
263 myMP2->SetInterpolation(interpolation2);
264 myMP2->SetSpecularColor(color2);
265 std::string name2 =
"Hans Wurst";
266 myMP2->SetName(name2);
272 double opacity = 1.0f;
274 double colorCoefficient = 0;
275 double specularCoefficient = 0;
276 double specularPower = 0;
278 myMP =
mitk::Material::New(rgb, rgb, rgb, colorCoefficient, specularCoefficient, specularPower, opacity);
279 double lineWidth = 1;
280 myMP->SetLineWidth(lineWidth);
282 myMP->SetRepresentation(representation);
284 myMP->SetInterpolation(interpolation);
285 myMP->SetSpecularColor(color);
286 std::string name =
"Hans Wurst";
291 double opacity2 = 1.0f;
293 double colorCoefficient2 = 0;
294 double specularCoefficient2 = 0;
295 double specularPower2 = 0;
298 mitk::Material::New(rgb2, rgb2, rgb2, colorCoefficient2, specularCoefficient2, specularPower2, opacity2);
299 double lineWidth2 = 1;
300 myMP2->SetLineWidth(lineWidth2);
302 myMP2->SetRepresentation(representation2);
304 myMP2->SetInterpolation(interpolation2);
305 myMP2->SetSpecularColor(color2);
306 std::string name2 =
"Hans Wurst";
307 myMP2->SetName(name2);
312 void testAssignable()
318 void testOperatorAssign()
331 MaterialTest materialTest;
333 materialTest.testConstructor();
334 materialTest.testConstructorWithColorOpacity();
335 materialTest.testConstructorWithRedGreenBlueOpacity();
336 materialTest.testConstructorRedGreenBlueColorCoefficientSpecularCoefficientSpecularPowerOpacity();
337 materialTest.testConstructorColorColorCoefficientSpecularCoefficientSpecularPowerOpacity();
338 materialTest.testConstructorPropertyRedGreenBlueOpacityAndName();
339 materialTest.testAssignable();
340 materialTest.testOperatorAssign();
341 materialTest.testSetColor();
342 materialTest.testSetColorCoefficient();
343 materialTest.testSetSpecularColor();
344 materialTest.testSetSpecularCoefficient();
345 materialTest.testSetSpecularPower();
346 materialTest.testSetOpacity();
347 materialTest.testSetInterpolation();
348 materialTest.testSetRepresentation();
349 materialTest.testSetLineWidth();
350 materialTest.testInitialize();
351 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