| 133 | } |
| 134 | |
| 135 | void mitk::ContourModelReader::ReadPoints(mitk::ContourModel::Pointer newContourModel, |
| 136 | const tinyxml2::XMLElement *currentTimeSeries, |
| 137 | unsigned int currentTimeStep) |
| 138 | { |
| 139 | // check if the timesteps in contourModel have to be expanded |
| 140 | if (currentTimeStep != newContourModel->GetTimeSteps()) |
| 141 | { |
| 142 | newContourModel->Expand(currentTimeStep + 1); |
| 143 | } |
| 144 | |
| 145 | // read all points within controlPoints tag |
| 146 | if (currentTimeSeries->FirstChildElement("controlPoints")->FirstChildElement("point") != nullptr) |
| 147 | { |
| 148 | for (auto *currentPoint = |
| 149 | currentTimeSeries->FirstChildElement("controlPoints")->FirstChildElement("point")->ToElement(); |
| 150 | currentPoint != nullptr; |
| 151 | currentPoint = currentPoint->NextSiblingElement()) |
| 152 | { |
| 153 | double x(0.0); |
| 154 | double y(0.0); |
| 155 | double z(0.0); |
| 156 | |
| 157 | x = atof(currentPoint->FirstChildElement("x")->GetText()); |
| 158 | y = atof(currentPoint->FirstChildElement("y")->GetText()); |
| 159 | z = atof(currentPoint->FirstChildElement("z")->GetText()); |
| 160 | |
| 161 | int isActivePoint; |
| 162 | currentPoint->QueryIntAttribute("isActive", &isActivePoint); |
| 163 | |
| 164 | mitk::Point3D point; |
| 165 | mitk::FillVector3D(point, x, y, z); |
| 166 | newContourModel->AddVertex(point, isActivePoint, currentTimeStep); |
| 167 | } |
| 168 | } |
| 169 | else |
| 170 | { |
| 171 | // nothing to read |
| 172 | } |
| 173 | } |
no test coverage detected