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

Method UpdateBoundingBox

Modules/Core/src/DataManagement/mitkTimeGeometry.cpp:120–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120void mitk::TimeGeometry::UpdateBoundingBox()
121{
122 assert(m_BoundingBox.IsNotNull());
123 typedef BoundingBox::PointsContainer ContainerType;
124
125 unsigned long lastModifiedTime = 0;
126 unsigned long currentModifiedTime = 0;
127
128 ContainerType::Pointer points = ContainerType::New();
129 const TimeStepType numberOfTimesteps = CountTimeSteps();
130
131 points->reserve(2*numberOfTimesteps);
132 for (TimeStepType step = 0; step <numberOfTimesteps; ++step)
133 {
134 currentModifiedTime = GetGeometryForTimeStep(step)->GetMTime();
135 if (currentModifiedTime > lastModifiedTime)
136 lastModifiedTime = currentModifiedTime;
137
138 for (int i = 0; i < 8; ++i)
139 {
140 Point3D cornerPoint = GetGeometryForTimeStep(step)->GetCornerPoint(i);
141 points->push_back(cornerPoint);
142 }
143 }
144 m_BoundingBox->SetPoints(points);
145 m_BoundingBox->ComputeBoundingBox();
146 if (this->GetMTime() < lastModifiedTime)
147 this->Modified();
148}
149
150mitk::ScalarType mitk::TimeGeometry::GetExtentInWorld(unsigned int direction) const
151{

Callers 7

UpdateMethod · 0.95
GenerateNewGroupImageMethod · 0.80
InitializeMethod · 0.80
FromXMLMethod · 0.80
CropFunction · 0.80

Calls 8

GetGeometryForTimeStepFunction · 0.85
IsNotNullMethod · 0.80
GetCornerPointMethod · 0.80
ComputeBoundingBoxMethod · 0.80
NewFunction · 0.50
GetMTimeMethod · 0.45
SetPointsMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected