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

Method Expand

Modules/Core/src/DataManagement/mitkPointSet.cpp:87–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void mitk::PointSet::Expand(unsigned int timeSteps)
88{
89 // Check if the vector is long enough to contain the new element
90 // at the given position. If not, expand it with sufficient pre-initialized
91 // elements.
92 //
93 // NOTE: This method will never REDUCE the vector size; it should only
94 // be used to make sure that the vector has enough elements to include the
95 // specified time step.
96
97 unsigned int oldSize = m_PointSetSeries.size();
98
99 if (timeSteps > oldSize)
100 {
101 Superclass::Expand(timeSteps);
102
103 m_PointSetSeries.resize(timeSteps);
104 for (unsigned int i = oldSize; i < timeSteps; ++i)
105 {
106 m_PointSetSeries[i] = DataType::New();
107 PointDataContainer::Pointer pointData = PointDataContainer::New();
108 m_PointSetSeries[i]->SetPointData(pointData);
109 }
110
111 // if the size changes, then compute the bounding box
112 m_CalculateBoundingBox = true;
113
114 this->InvokeEvent(PointSetExtendTimeRangeEvent());
115 }
116}
117
118unsigned int mitk::PointSet::GetPointSetSeriesSize() const
119{

Callers 3

SetPointMethod · 0.95
InsertPointMethod · 0.95
ExecuteOperationMethod · 0.95

Calls 2

NewFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected