| 85 | } |
| 86 | |
| 87 | void 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 | |
| 118 | unsigned int mitk::PointSet::GetPointSetSeriesSize() const |
| 119 | { |
no test coverage detected