| 79 | } |
| 80 | |
| 81 | nlohmann::json CellSourceToJSON(const vtkDGCell::Source& spec, |
| 82 | const std::unordered_map<vtkAbstractArray*, vtkStringToken>& arrayLocations) |
| 83 | { |
| 84 | nlohmann::json result; |
| 85 | PutArray(spec.Connectivity, "connectivity", result, arrayLocations); |
| 86 | if (spec.NodalGhostMarks) |
| 87 | { |
| 88 | PutArray(spec.NodalGhostMarks, "ghost-node", result, arrayLocations); |
| 89 | } |
| 90 | |
| 91 | result["shape"] = vtkDGCell::GetShapeName(spec.SourceShape).Data(); |
| 92 | if (spec.Offset != 0) |
| 93 | { |
| 94 | result["offset"] = spec.Offset; |
| 95 | } |
| 96 | if (spec.Blanked) |
| 97 | { |
| 98 | result["blanked"] = true; |
| 99 | } |
| 100 | if (spec.SideType >= 0) |
| 101 | { |
| 102 | result["side-type"] = spec.SideType; |
| 103 | } |
| 104 | if (spec.SelectionType != -1) |
| 105 | { |
| 106 | result["selection-type"] = spec.SelectionType; |
| 107 | } |
| 108 | return result; |
| 109 | } |
| 110 | |
| 111 | vtkDGCell::Source JSONToCellSource(const nlohmann::json& jSpec, vtkCellGrid* grid) |
| 112 | { |