Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::BSPTreePoly::Face Struct Reference
+ Collaboration diagram for moab::BSPTreePoly::Face:

Public Member Functions

 Face (Face *next)
 
 Face ()
 
 ~Face ()
 
double signed_volume () const
 

Public Attributes

BSPTreePoly::EdgeUseusePtr
 
BSPTreePoly::FacenextPtr
 

Detailed Description

Definition at line 156 of file BSPTreePoly.cpp.

Constructor & Destructor Documentation

◆ Face() [1/2]

moab::BSPTreePoly::Face::Face ( Face next)
inline

Definition at line 158 of file BSPTreePoly.cpp.

159  : usePtr( 0 ), nextPtr( next )
160 #ifdef DEBUG_IDS
161  ,
162  id( nextID++ )
163 #endif
164  {
165  }

◆ Face() [2/2]

moab::BSPTreePoly::Face::Face ( )
inline

Definition at line 166 of file BSPTreePoly.cpp.

167  : usePtr( 0 ), nextPtr( 0 )
168 #ifdef DEBUG_IDS
169  ,
170  id( nextID++ )
171 #endif
172  {
173  }

◆ ~Face()

moab::BSPTreePoly::Face::~Face ( )

Definition at line 374 of file BSPTreePoly.cpp.

375 {
376  BSPTreePoly::EdgeUse* nextEdgeUsePtr = usePtr;
377  while( nextEdgeUsePtr )
378  {
379  delete nextEdgeUsePtr; // This is tricky: ~EdgeUse() might change the value of usePtr
380  if( usePtr && usePtr != nextEdgeUsePtr )
381  nextEdgeUsePtr = usePtr;
382  else
383  nextEdgeUsePtr = 0;
384  }
385  usePtr = 0;
386 }

Member Function Documentation

◆ signed_volume()

double moab::BSPTreePoly::Face::signed_volume ( ) const

Definition at line 486 of file BSPTreePoly.cpp.

487 {
488  CartVect sum( 0.0 );
489  const CartVect* base = usePtr->start();
490  CartVect d1 = ( *usePtr->end() - *base );
491  for( EdgeUse* coedge = usePtr->nextPtr; coedge != usePtr; coedge = coedge->nextPtr )
492  {
493  CartVect d2 = ( *coedge->end() - *base );
494  sum += d1 * d2;
495  d1 = d2;
496  }
497  return ( 1.0 / 6.0 ) * ( sum % *base );
498 }

References moab::BSPTreePoly::EdgeUse::nextPtr, and moab::sum().

Member Data Documentation

◆ nextPtr

◆ usePtr

BSPTreePoly::EdgeUse* moab::BSPTreePoly::Face::usePtr

Definition at line 175 of file BSPTreePoly.cpp.

Referenced by moab::split_face().


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