------------------------------------------------------------------------------
| 272 | |
| 273 | //------------------------------------------------------------------------------ |
| 274 | std::string vtkJSONSceneExporter::ExtractPiecewiseFunctionSetup(vtkPiecewiseFunction* function) |
| 275 | { |
| 276 | bool clamping = function->GetClamping(); |
| 277 | vtkIdType numberOfPoints = function->GetSize(); |
| 278 | constexpr const char* INDENT = " "; |
| 279 | std::stringstream configuration; |
| 280 | configuration << INDENT << " \"clamping\": " << (clamping ? "true" : "false") << ",\n"; |
| 281 | configuration << INDENT << " \"points\": [\n"; |
| 282 | for (vtkIdType pointId = 0; pointId < numberOfPoints; ++pointId) |
| 283 | { |
| 284 | double point[4]; |
| 285 | function->GetNodeValue(pointId, point); |
| 286 | configuration << INDENT << " ["; |
| 287 | for (int i = 0; i < 4; ++i) |
| 288 | { |
| 289 | configuration << point[i] << (i < 3 ? ", " : ""); |
| 290 | } |
| 291 | configuration << "]"; |
| 292 | if (pointId < numberOfPoints - 1) |
| 293 | { |
| 294 | configuration << ","; |
| 295 | } |
| 296 | configuration << "\n"; |
| 297 | } |
| 298 | configuration << INDENT << " ]\n"; |
| 299 | return configuration.str(); |
| 300 | } |
| 301 | |
| 302 | //------------------------------------------------------------------------------ |
| 303 | std::string vtkJSONSceneExporter::ExtractVolumeRenderingSetup(vtkVolume* volume) |
no test coverage detected