20 #include <vtkProperty.h>
26 std::cout <<
"Testing mitk::EnumerationProperty::AddEnum(...): ";
28 success = success && enumerationProperty->AddEnum(
"first", 1);
29 success = success && enumerationProperty->AddEnum(
"second", 2);
30 success = success && enumerationProperty->AddEnum(
"third", 3);
33 std::cout <<
"[FAILED]" << std::endl;
38 std::cout <<
"[PASSED]" << std::endl;
41 std::cout <<
"Testing mitk::EnumerationProperty::Size(): ";
42 if (enumerationProperty->Size() != 3)
44 std::cout <<
"[FAILED]" << std::endl;
49 std::cout <<
"[PASSED]" << std::endl;
52 std::cout <<
"Testing mitk::EnumerationProperty::AddEnum() with invalid entries: ";
53 if (enumerationProperty->AddEnum(
"first", 0))
55 std::cout <<
"[FAILED]" << std::endl;
60 std::cout <<
"[PASSED]" << std::endl;
63 std::cout <<
"Testing mitk::EnumerationProperty::SetValue(id): ";
64 if (!enumerationProperty->SetValue(2))
66 std::cout <<
"[FAILED]" << std::endl;
69 if (enumerationProperty->GetValueAsId() != 2)
71 std::cout <<
"[FAILED]" << std::endl;
74 if (enumerationProperty->GetValueAsString() !=
"second")
76 std::cout <<
"[FAILED]" << std::endl;
79 std::cout <<
"[PASSED]" << std::endl;
81 std::cout <<
"Testing mitk::EnumerationProperty::SetValue(name): ";
82 if (!enumerationProperty->SetValue(
"third"))
84 std::cout <<
"[FAILED]" << std::endl;
87 if (enumerationProperty->GetValueAsId() != 3)
89 std::cout <<
"[FAILED]" << std::endl;
92 if (enumerationProperty->GetValueAsString() !=
"third")
94 std::cout <<
"[FAILED]" << std::endl;
97 std::cout <<
"[PASSED]" << std::endl;
99 std::cout <<
"Testing mitk::EnumerationProperty::SetValue(invalid id): ";
100 if (enumerationProperty->SetValue(100))
102 std::cout <<
"[FAILED]" << std::endl;
105 std::cout <<
"[PASSED]" << std::endl;
107 std::cout <<
"Testing mitk::EnumerationProperty::SetValue(invalid name): ";
108 if (enumerationProperty->SetValue(
"madmax"))
110 std::cout <<
"[FAILED]" << std::endl;
113 std::cout <<
"[PASSED]" << std::endl;
115 std::cout <<
"Testing mitk::VtkInterpolationType::SetInterpolationToPhong(): ";
118 vtkInterpolationProperty->SetInterpolationToPhong();
119 if (vtkInterpolationProperty->GetValueAsString() !=
"Phong")
121 std::cout <<
"[FAILED]" << std::endl;
124 if (vtkInterpolationProperty->GetValueAsId() != 2)
126 std::cout <<
"[FAILED]" << std::endl;
129 if (vtkInterpolationProperty->GetVtkInterpolation() != VTK_PHONG)
131 std::cout <<
"[FAILED]" << std::endl;
134 std::cout <<
"[PASSED]" << std::endl;
136 std::cout <<
"Testing mitk::VtkRepresentationType::SetRepresentationToWireframe(): ";
138 vtkRepresentationProperty->SetRepresentationToWireframe();
139 if (vtkRepresentationProperty->GetValueAsString() !=
"Wireframe")
141 std::cout <<
"[FAILED]" << std::endl;
144 if (vtkRepresentationProperty->GetValueAsId() != 1)
146 std::cout <<
"[FAILED]" << std::endl;
149 if (vtkRepresentationProperty->GetVtkRepresentation() != VTK_WIREFRAME)
151 std::cout <<
"[FAILED]" << std::endl;
154 std::cout <<
"[PASSED]" << std::endl;
156 std::cout <<
"[TEST DONE]" << std::endl;
int mitkEnumerationPropertyTest(int, char *[])