-----------------------------------------------------------------------------
| 274 | |
| 275 | //----------------------------------------------------------------------------- |
| 276 | Json::Value pqCameraKeyFrameWidget::serializeToJSON() const |
| 277 | { |
| 278 | Json::Value keyFrame; |
| 279 | |
| 280 | auto addJSONVector = [&keyFrame](const char* name, const double* value, size_t size) |
| 281 | { |
| 282 | for (unsigned int idx = 0; idx < size; idx++) |
| 283 | { |
| 284 | keyFrame[name].insert(idx, value[idx]); |
| 285 | } |
| 286 | }; |
| 287 | |
| 288 | if (this->usePathBasedMode()) |
| 289 | { |
| 290 | auto positions = vtkSMPropertyHelper(this->Internal->PSplineProxy, "Points").GetDoubleArray(); |
| 291 | addJSONVector("positions", positions.data(), positions.size()); |
| 292 | keyFrame["positionPathClosed"] = |
| 293 | vtkSMPropertyHelper(this->Internal->PSplineProxy, "Closed").GetAsInt(); |
| 294 | auto focalPoints = vtkSMPropertyHelper(this->Internal->FSplineProxy, "Points").GetDoubleArray(); |
| 295 | addJSONVector("focalPoints", focalPoints.data(), focalPoints.size()); |
| 296 | keyFrame["focalPointPathClosed"] = |
| 297 | vtkSMPropertyHelper(this->Internal->FSplineProxy, "Closed").GetAsInt(); |
| 298 | addJSONVector("viewUp", this->Internal->viewUp_Path(), 3); |
| 299 | } |
| 300 | else |
| 301 | { |
| 302 | keyFrame["parallelScale"] = this->Internal->getParallelScale(); |
| 303 | keyFrame["viewAngle"] = this->Internal->getViewAngle(); |
| 304 | addJSONVector("viewUp", this->Internal->viewUp_NonPath(), 3); |
| 305 | addJSONVector("position", this->Internal->position(), 3); |
| 306 | addJSONVector("focalPoint", this->Internal->focalPoint(), 3); |
| 307 | } |
| 308 | return keyFrame; |
| 309 | } |
| 310 | |
| 311 | //----------------------------------------------------------------------------- |
| 312 | void pqCameraKeyFrameWidget::setPositionPoints(const std::vector<double>& positions) |
nothing calls this directly
no test coverage detected