Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
TriCounter Class Reference
+ Inheritance diagram for TriCounter:
+ Collaboration diagram for TriCounter:

Public Member Functions

 TriCounter (Interface *mbi_p, OrientedBoxTreeTool *tool_p, const CartVect &p)
 
virtual ErrorCode visit (EntityHandle node, int, bool &descend)
 Visit a node in the tree during a traversal. More...
 
virtual ErrorCode leaf (EntityHandle node)
 Process a leaf node during tree traversal. More...
 
- Public Member Functions inherited from moab::OrientedBoxTreeTool::Op
virtual ~Op ()
 

Public Attributes

int count
 
Interfacembi
 
OrientedBoxTreeTooltool
 
const CartVectpt
 

Detailed Description

Definition at line 16 of file obb_analysis.cpp.

Constructor & Destructor Documentation

◆ TriCounter()

TriCounter::TriCounter ( Interface mbi_p,
OrientedBoxTreeTool tool_p,
const CartVect p 
)
inline

Definition at line 25 of file obb_analysis.cpp.

26  : OrientedBoxTreeTool::Op(), count( 0 ), mbi( mbi_p ), tool( tool_p ), pt( p )
27  {
28  }

Member Function Documentation

◆ leaf()

virtual ErrorCode TriCounter::leaf ( EntityHandle  node)
inlinevirtual

Process a leaf node during tree traversal.

Implements moab::OrientedBoxTreeTool::Op.

Definition at line 40 of file obb_analysis.cpp.

41  {
42 
43  int numtris;
45  count += numtris;
46  return rval;
47  }

References ErrorCode, moab::OrientedBoxTreeTool::get_moab_instance(), moab::Interface::get_number_entities_by_type(), and MBTRI.

◆ visit()

virtual ErrorCode TriCounter::visit ( EntityHandle  node,
int  depth,
bool &  descend 
)
inlinevirtual

Visit a node in the tree during a traversal.

This method is called for each node in the tree visited during a pre-order traversal.

Parameters
nodeThe EntityHandle for the entity set for the tree node.
depthThe current depth in the tree.
descendOutput: if false, traversal will skip children of the current node, or if the current node is a leaf, the 'leaf' method will not be called.

Implements moab::OrientedBoxTreeTool::Op.

Definition at line 30 of file obb_analysis.cpp.

31  {
32  OrientedBox box;
33  ErrorCode rval = tool->box( node, box );
34 
35  descend = box.contained( pt, 1e-6 );
36 
37  return rval;
38  }

References moab::OrientedBoxTreeTool::box(), moab::OrientedBox::contained(), and ErrorCode.

Member Data Documentation

◆ count

int TriCounter::count

Definition at line 20 of file obb_analysis.cpp.

Referenced by obbvis_create().

◆ mbi

Interface* TriCounter::mbi

Definition at line 21 of file obb_analysis.cpp.

◆ pt

const CartVect& TriCounter::pt

Definition at line 23 of file obb_analysis.cpp.

◆ tool

OrientedBoxTreeTool* TriCounter::tool

Definition at line 22 of file obb_analysis.cpp.


The documentation for this class was generated from the following file: