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

Method copyGrid

ThirdParty/xdmf3/vtkxdmf3/XdmfGridCollection.cpp:86–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84const std::string XdmfGridCollection::ItemTag = "Grid";
85
86void
87XdmfGridCollection::copyGrid(shared_ptr<XdmfGrid> sourceGrid)
88{
89 XdmfGrid::copyGrid(sourceGrid);
90 if (shared_ptr<XdmfGridCollection> classedGrid = shared_dynamic_cast<XdmfGridCollection>(sourceGrid))
91 {
92 // Copy stucture from read grid to this grid
93 while (this->getNumberGridCollections() > 0)
94 {
95 this->removeGridCollection(0);
96 }
97 for (unsigned int i = 0; i < classedGrid->getNumberGridCollections(); ++i)
98 {
99 this->insert(classedGrid->getGridCollection(i));
100 }
101 while (this->getNumberCurvilinearGrids() > 0)
102 {
103 this->removeCurvilinearGrid(0);
104 }
105 for (unsigned int i = 0; i < classedGrid->getNumberCurvilinearGrids(); ++i)
106 {
107 this->insert(classedGrid->getCurvilinearGrid(i));
108 }
109 while (this->getNumberGraphs() > 0)
110 {
111 this->removeGraph(0);
112 }
113 for (unsigned int i = 0; i < classedGrid->getNumberGraphs(); ++i)
114 {
115 this->insert(classedGrid->getGraph(i));
116 }
117 while (this->getNumberRectilinearGrids() > 0)
118 {
119 this->removeRectilinearGrid(0);
120 }
121 for (unsigned int i = 0; i < classedGrid->getNumberRectilinearGrids(); ++i)
122 {
123 this->insert(classedGrid->getRectilinearGrid(i));
124 }
125 while (this->getNumberRegularGrids() > 0)
126 {
127 this->removeRegularGrid(0);
128 }
129 for (unsigned int i = 0; i < classedGrid->getNumberRegularGrids(); ++i)
130 {
131 this->insert(classedGrid->getRegularGrid(i));
132 }
133 while (this->getNumberUnstructuredGrids() > 0)
134 {
135 this->removeUnstructuredGrid(0);
136 }
137 for (unsigned int i = 0; i < classedGrid->getNumberUnstructuredGrids(); ++i)
138 {
139 this->insert(classedGrid->getUnstructuredGrid(i));
140 }
141 }
142}
143

Callers

nothing calls this directly

Calls 15

insertMethod · 0.95
removeGridCollectionMethod · 0.80
getGridCollectionMethod · 0.80
removeCurvilinearGridMethod · 0.80
getCurvilinearGridMethod · 0.80
removeRectilinearGridMethod · 0.80
getRectilinearGridMethod · 0.80
getNumberRegularGridsMethod · 0.80
removeRegularGridMethod · 0.80

Tested by

no test coverage detected