MCPcopy Create free account
hub / github.com/Kitware/VTK / CellSourceToJSON

Function CellSourceToJSON

IO/CellGrid/vtkDGIOResponder.cxx:81–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81nlohmann::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
111vtkDGCell::Source JSONToCellSource(const nlohmann::json& jSpec, vtkCellGrid* grid)
112{

Callers 1

QueryMethod · 0.85

Calls 2

PutArrayFunction · 0.85
DataMethod · 0.45

Tested by

no test coverage detected