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

Method UpdateContour

Modules/ContourModel/src/DataManagement/mitkContourModel.cpp:147–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void mitk::ContourModel::UpdateContour(const ContourModel* sourceModel, TimeStepType destinationTimeStep, TimeStepType sourceTimeStep)
148{
149 if (nullptr == sourceModel)
150 {
151 mitkThrow() << "Cannot update contour. Passed source model is invalid.";
152 }
153
154 if (!sourceModel->GetTimeGeometry()->IsValidTimeStep(sourceTimeStep))
155 {
156 mitkThrow() << "Cannot update contour. Source contour time geometry does not support passed time step. Invalid time step: " << sourceTimeStep;
157 }
158
159 if (!this->GetTimeGeometry()->IsValidTimeStep(destinationTimeStep))
160 {
161 MITK_WARN << "Cannot update contour. Contour time geometry does not support passed time step. Invalid time step: " << destinationTimeStep;
162 return;
163 }
164
165 this->Clear(destinationTimeStep);
166
167 std::for_each(sourceModel->Begin(sourceTimeStep), sourceModel->End(sourceTimeStep), [this, destinationTimeStep](ContourElement::VertexType* vertex) {
168 this->m_ContourSeries[destinationTimeStep]->AddVertex(vertex->Coordinates, vertex->IsControlPoint);
169 });
170
171 this->InvokeEvent(ContourModelSizeChangeEvent());
172 this->Modified();
173 this->m_UpdateBoundingBox = true;
174}
175
176bool mitk::ContourModel::IsEmpty(TimeStepType timestep) const
177{

Callers

nothing calls this directly

Calls 6

ClearMethod · 0.95
IsValidTimeStepMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
AddVertexMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected