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

Method GetCellDimension

Testing/GenericBridge/vtkBridgeDataSet.cxx:251–284  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Return -1 if the dataset is explicitly defined by cells of several dimensions or if there is no cell. If the dataset is explicitly defined by cells of a unique dimension, return this dimension. \post valid_range: (result>=-1) && (result<=3)

Source from the content-addressed store, hash-verified

249// cells of a unique dimension, return this dimension.
250// \post valid_range: (result>=-1) && (result<=3)
251int vtkBridgeDataSet::GetCellDimension()
252{
253 int result = 0;
254 int accu = 0;
255
256 this->ComputeNumberOfCellsAndTypes();
257
258 if (this->NumberOf0DCells != 0)
259 {
260 accu++;
261 result = 0;
262 }
263 if (this->NumberOf1DCells != 0)
264 {
265 accu++;
266 result = 1;
267 }
268 if (this->NumberOf2DCells != 0)
269 {
270 accu++;
271 result = 2;
272 }
273 if (this->NumberOf3DCells != 0)
274 {
275 accu++;
276 result = 3;
277 }
278 if (accu != 1) // no cells at all or several dimensions
279 {
280 result = -1;
281 }
282 assert("post: valid_range" && (result >= -1) && (result <= 3));
283 return result;
284}
285
286//------------------------------------------------------------------------------
287// Description:

Callers 3

NextMethod · 0.45
GetDimensionMethod · 0.45

Calls 2

assertFunction · 0.50

Tested by

no test coverage detected