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

Method ProcessLeaf3D

Filters/Hybrid/vtkAdaptiveDataSetSurfaceFilter.cxx:561–604  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

559
560//------------------------------------------------------------------------------
561void vtkAdaptiveDataSetSurfaceFilter::ProcessLeaf3D(
562 vtkHyperTreeGridNonOrientedVonNeumannSuperCursorLight* superCursor)
563{
564 // Cell at super cursor center is a leaf, retrieve its global index, level, and mask
565 vtkIdType idCenter = superCursor->GetGlobalNodeIndex();
566 unsigned level = superCursor->GetLevel();
567 int masked = this->Mask ? this->Mask->GetValue(idCenter) : 0;
568
569 // Iterate over all cursors of Von Neumann neighborhood around center
570 unsigned int nc = superCursor->GetNumberOfCursors() - 1;
571 for (unsigned int c = 0; c < nc; ++c)
572 {
573 if (this->CheckAbort())
574 {
575 break;
576 }
577 // Retrieve cursor to neighbor across face
578 // Retrieve tree, leaf flag, and mask of neighbor cursor
579 unsigned int levelN;
580 bool leafN;
581 vtkIdType idN;
582 vtkHyperTree* treeN = superCursor->GetInformation(VonNeumannCursors3D[c], levelN, leafN, idN);
583
584 int maskedN = 0;
585 if (treeN)
586 {
587 maskedN = this->Mask ? this->Mask->GetValue(idN) : 0;
588 }
589
590 // In 3D masked and unmasked cells are handled differently:
591 // - If cell is unmasked, and face neighbor is masked, or no such neighbor
592 // exists, then generate face.
593 // - If cell is masked, and face neighbor exists and is an unmasked leaf, then
594 // generate face, breaking ties at same level. This ensures that faces between
595 // unmasked and masked cells will be generated once and only once.
596 if ((!masked && (!treeN || maskedN)) ||
597 (masked && treeN && leafN && levelN < level && !maskedN))
598 {
599 // Generate face with corresponding normal and offset
600 this->AddFace(idCenter, superCursor->GetOrigin(), superCursor->GetSize(),
601 VonNeumannOffsets3D[c], VonNeumannOrientations3D[c]);
602 }
603 }
604}
605
606//------------------------------------------------------------------------------
607void vtkAdaptiveDataSetSurfaceFilter::AddFace(

Callers 1

Calls 8

AddFaceMethod · 0.95
CheckAbortMethod · 0.80
GetGlobalNodeIndexMethod · 0.45
GetLevelMethod · 0.45
GetValueMethod · 0.45
GetInformationMethod · 0.45
GetOriginMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected