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

Method GetPureMask

Common/DataModel/vtkHyperTreeGrid.cxx:1233–1297  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1231
1232//------------------------------------------------------------------------------
1233vtkBitArray* vtkHyperTreeGrid::GetPureMask()
1234{
1235 // Check whether a pure material mask was initialized
1236 // If not, then create one
1237 if (this->PureMask)
1238 {
1239 // Return existing pure material mask
1240 return this->PureMask;
1241 }
1242 else
1243 {
1244 this->PureMask = vtkBitArray::New();
1245 this->PureMask->SetName("vtkPureMask");
1246 }
1247 // Do not use GetNumberOfCells method because it is not the real size of a value
1248 // field due to the possible use of an indirection array (GlobalNodeIndex
1249 // not implicit).
1250 // Prefer to use GetGlobalNodeIndexMax()+1 which is one value above the highest
1251 // index
1252 this->PureMask->SetNumberOfTuples(this->GetGlobalNodeIndexMax() + 1);
1253
1254 // Check material interface intercepts
1255 // The first two fields of Intercepts describe the first and the
1256 // second distance interface to origin.
1257 // The third field describes the type of interface. If the type
1258 // value is greater than or equal to 2, the cell does not describe
1259 // an interface. She is pure material.
1260 // For more detail look at the vtkHyperTreeGridGeometry filter.
1261 vtkDataArray* intercepts = nullptr;
1262 if (this->HasInterface)
1263 {
1264 intercepts = this->GetCellData()->GetArray(this->InterfaceInterceptsName);
1265 if (intercepts)
1266 {
1267 if (intercepts->GetNumberOfComponents() != 3)
1268 {
1269 intercepts = nullptr;
1270 }
1271 else
1272 {
1273 vtkDataArray* normals = this->GetCellData()->GetArray(this->InterfaceNormalsName);
1274 if (!normals || normals->GetNumberOfComponents() != 3)
1275 {
1276 intercepts = nullptr;
1277 }
1278 }
1279 }
1280 }
1281
1282 // Iterate over hyper tree grid
1283 vtkIdType index;
1284 vtkHyperTreeGridIterator it;
1285 it.Initialize(this);
1286 vtkNew<vtkHyperTreeGridNonOrientedCursor> cursor;
1287 while (it.GetNextTree(index))
1288 {
1289 // Create cursor instance over current hyper tree
1290 this->InitializeNonOrientedCursor(cursor, index);

Callers 2

CopyStructureMethod · 0.80

Calls 11

GetGlobalNodeIndexMaxMethod · 0.95
GetCellDataMethod · 0.95
GetNextTreeMethod · 0.80
NewFunction · 0.50
SetNameMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetArrayMethod · 0.45
GetNumberOfComponentsMethod · 0.45
InitializeMethod · 0.45

Tested by

no test coverage detected