----------------------------------------------------------------------------
| 1115 | |
| 1116 | //---------------------------------------------------------------------------- |
| 1117 | vtkSmartPointer<vtkPoints> CreatePoints(const conduit_cpp::Node& coords) |
| 1118 | { |
| 1119 | if (coords["type"].as_string() != "explicit") |
| 1120 | { |
| 1121 | throw std::runtime_error("invalid node!"); |
| 1122 | } |
| 1123 | |
| 1124 | conduit_cpp::Node values = coords["values"]; |
| 1125 | auto array = vtkConduitArrayUtilities::MCArrayToVTKArray(conduit_cpp::c_node(&values), "coords"); |
| 1126 | if (array == nullptr) |
| 1127 | { |
| 1128 | throw std::runtime_error("failed to convert to VTK array!"); |
| 1129 | } |
| 1130 | if (array->GetNumberOfComponents() < 3) |
| 1131 | { |
| 1132 | array = vtkConduitArrayUtilities::SetNumberOfComponents(array, 3); |
| 1133 | } |
| 1134 | else if (array->GetNumberOfComponents() > 3) |
| 1135 | { |
| 1136 | throw std::runtime_error("points cannot have more than 3 components!"); |
| 1137 | } |
| 1138 | |
| 1139 | auto pts = vtkSmartPointer<vtkPoints>::New(); |
| 1140 | pts->SetData(array); |
| 1141 | return pts; |
| 1142 | } |
| 1143 | |
| 1144 | //---------------------------------------------------------------------------- |
| 1145 | void SetPolyhedralCells( |
no test coverage detected