MCPcopy Create free account
hub / github.com/MITK/MITK / setUp

Method setUp

Modules/Core/test/mitkBaseGeometryTest.cpp:170–264  ·  view source on GitHub ↗

Set up for variables

Source from the content-addressed store, hash-verified

168public:
169 // Set up for variables
170 void setUp() override
171 {
172 mitk::FillVector3D(aFloatSpacing, 1, 1, 1);
173 mitk::FillVector3D(aSpacing, 1, 1, 1);
174 mitk::FillVector3D(aPoint, 0, 0, 0);
175
176 // Transform
177 aTransform = mitk::AffineTransform3D::New();
178 aTransform->SetIdentity();
179
180 aMatrix.SetIdentity();
181
182 anotherTransform = mitk::AffineTransform3D::New();
183
184 anotherMatrix.SetIdentity();
185 anotherMatrix(1, 1) = 2;
186 anotherTransform->SetMatrix(anotherMatrix);
187
188 aThirdTransform = mitk::AffineTransform3D::New();
189
190 aThirdMatrix.SetIdentity();
191 aThirdMatrix(1, 1) = 7;
192 aThirdTransform->SetMatrix(aThirdMatrix);
193
194 // Bounding Box
195 float bounds[6] = { 0, 1, 0, 1, 0, 1 };
196 mitk::BoundingBox::BoundsArrayType b;
197 const float* input = bounds;
198 int j = 0;
199 for (mitk::BoundingBox::BoundsArrayType::Iterator it = b.Begin(); j < 6; ++j)
200 *it++ = (mitk::ScalarType) * input++;
201
202 aBoundingBox = BoundingBoxType::New();
203
204 BoundingBoxType::PointsContainer::Pointer pointscontainer = BoundingBoxType::PointsContainer::New();
205 BoundingBoxType::PointType p;
206 BoundingBoxType::PointIdentifier pointid;
207 for (pointid = 0; pointid < 2; ++pointid)
208 {
209 unsigned int i;
210 for (i = 0; i < 3; ++i)
211 {
212 p[i] = bounds[2 * i + pointid];
213 }
214 pointscontainer->InsertElement(pointid, p);
215 }
216
217 aBoundingBox->SetPoints(pointscontainer);
218 aBoundingBox->ComputeBoundingBox();
219
220 anotherBoundingBox = BoundingBoxType::New();
221 p[0] = 11;
222 p[1] = 12;
223 p[2] = 13;
224 pointscontainer->InsertElement(1, p);
225 anotherBoundingBox->SetPoints(pointscontainer);
226 anotherBoundingBox->ComputeBoundingBox();
227

Callers

nothing calls this directly

Calls 13

FillVector3DFunction · 0.85
SetMatrixMethod · 0.80
ComputeBoundingBoxMethod · 0.80
GetMatrixColumnMethod · 0.80
NewFunction · 0.50
SetIdentityMethod · 0.45
BeginMethod · 0.45
SetPointsMethod · 0.45
InitializeMethod · 0.45
CloneMethod · 0.45
GetBoundsMethod · 0.45
SetBoundsMethod · 0.45

Tested by

no test coverage detected