| 113 | |
| 114 | |
| 115 | mitk::PointSet::Pointer mitk::PointSetReaderService::ReadPoints(mitk::PointSet::Pointer newPointSet, |
| 116 | tinyxml2::XMLElement *currentTimeSeries, |
| 117 | unsigned int currentTimeStep) |
| 118 | { |
| 119 | if (currentTimeSeries->FirstChildElement("point") != nullptr) |
| 120 | { |
| 121 | for (auto *currentPoint = currentTimeSeries->FirstChildElement("point"); currentPoint != nullptr; |
| 122 | currentPoint = currentPoint->NextSiblingElement()) |
| 123 | { |
| 124 | unsigned int id(0); |
| 125 | auto spec((mitk::PointSpecificationType)0); |
| 126 | double x(0.0); |
| 127 | double y(0.0); |
| 128 | double z(0.0); |
| 129 | |
| 130 | id = atoi(currentPoint->FirstChildElement("id")->GetText()); |
| 131 | if (currentPoint->FirstChildElement("specification") != nullptr) |
| 132 | { |
| 133 | spec = (mitk::PointSpecificationType)atoi(currentPoint->FirstChildElement("specification")->GetText()); |
| 134 | } |
| 135 | x = atof(currentPoint->FirstChildElement("x")->GetText()); |
| 136 | y = atof(currentPoint->FirstChildElement("y")->GetText()); |
| 137 | z = atof(currentPoint->FirstChildElement("z")->GetText()); |
| 138 | |
| 139 | mitk::Point3D point; |
| 140 | mitk::FillVector3D(point, x, y, z); |
| 141 | newPointSet->SetPoint(id, point, spec, currentTimeStep); |
| 142 | } |
| 143 | } |
| 144 | else |
| 145 | { |
| 146 | if (currentTimeStep != newPointSet->GetTimeSteps() + 1) |
| 147 | { |
| 148 | newPointSet->Expand(currentTimeStep + 1); // expand time step series with empty time step |
| 149 | } |
| 150 | } |
| 151 | return newPointSet; |
| 152 | } |
| 153 | |
| 154 | mitk::PointSetReaderService::PointSetReaderService(const mitk::PointSetReaderService &other) |
| 155 | : mitk::AbstractFileReader(other) |
no test coverage detected