Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
moab::BSPTreePlaneIter Class Reference
+ Collaboration diagram for moab::BSPTreePlaneIter:

Public Member Functions

 BSPTreePlaneIter (BSPTree *tool, const EntityHandle *path, int path_len)
 
 BSPTreePlaneIter ()
 
const BSPTree::Planeoperator-> () const
 
bool operator== (const BSPTreePlaneIter &other) const
 
bool operator!= (const BSPTreePlaneIter &other) const
 
BSPTreePlaneIteroperator++ ()
 

Private Attributes

BSPTreetoolPtr
 
const EntityHandle *const pathToRoot
 
int pathPos
 
BSPTree::Plane tmpPlane
 
std::vector< EntityHandletmpChildren
 

Detailed Description

Definition at line 1276 of file BSPTree.cpp.

Constructor & Destructor Documentation

◆ BSPTreePlaneIter() [1/2]

moab::BSPTreePlaneIter::BSPTreePlaneIter ( BSPTree tool,
const EntityHandle path,
int  path_len 
)
inline

Definition at line 1285 of file BSPTree.cpp.

1286  : toolPtr( tool ), pathToRoot( path ), pathPos( path_len - 1 )
1287  {
1288  operator++();
1289  }

References operator++().

◆ BSPTreePlaneIter() [2/2]

moab::BSPTreePlaneIter::BSPTreePlaneIter ( )
inline

Definition at line 1290 of file BSPTree.cpp.

1291  : toolPtr( 0 ), pathToRoot( 0 ), pathPos( -1 )
1292  {
1293  }

Member Function Documentation

◆ operator!=()

bool moab::BSPTreePlaneIter::operator!= ( const BSPTreePlaneIter other) const
inline

Definition at line 1303 of file BSPTree.cpp.

1304  {
1305  return pathPos != other.pathPos;
1306  }

References pathPos.

◆ operator++()

BSPTreePlaneIter & moab::BSPTreePlaneIter::operator++ ( )

Definition at line 1310 of file BSPTree.cpp.

1311 {
1312  if( --pathPos < 0 ) return *this;
1313 
1314  EntityHandle prev = pathToRoot[pathPos + 1];
1316 
1317  ErrorCode rval = toolPtr->get_split_plane( curr, tmpPlane );
1318  if( MB_SUCCESS != rval )
1319  {
1320  assert( false );
1321  pathPos = 0;
1322  return *this;
1323  }
1324 
1325  tmpChildren.clear();
1326  rval = toolPtr->moab()->get_child_meshsets( curr, tmpChildren );
1327  if( MB_SUCCESS != rval || tmpChildren.size() != 2 )
1328  {
1329  assert( false );
1330  pathPos = 0;
1331  return *this;
1332  }
1333 
1334  if( tmpChildren[1] == prev ) tmpPlane.flip();
1335  return *this;
1336 }

References ErrorCode, moab::BSPTree::Plane::flip(), moab::Interface::get_child_meshsets(), moab::BSPTree::get_split_plane(), MB_SUCCESS, moab::BSPTree::moab(), pathPos, pathToRoot, tmpChildren, tmpPlane, and toolPtr.

Referenced by BSPTreePlaneIter().

◆ operator->()

const BSPTree::Plane* moab::BSPTreePlaneIter::operator-> ( ) const
inline

Definition at line 1295 of file BSPTree.cpp.

1296  {
1297  return &tmpPlane;
1298  }

References tmpPlane.

◆ operator==()

bool moab::BSPTreePlaneIter::operator== ( const BSPTreePlaneIter other) const
inline

Definition at line 1299 of file BSPTree.cpp.

1300  {
1301  return pathPos == other.pathPos;
1302  }

References pathPos.

Member Data Documentation

◆ pathPos

int moab::BSPTreePlaneIter::pathPos
private

Definition at line 1280 of file BSPTree.cpp.

Referenced by operator!=(), operator++(), and operator==().

◆ pathToRoot

const EntityHandle* const moab::BSPTreePlaneIter::pathToRoot
private

Definition at line 1279 of file BSPTree.cpp.

Referenced by operator++().

◆ tmpChildren

std::vector< EntityHandle > moab::BSPTreePlaneIter::tmpChildren
private

Definition at line 1282 of file BSPTree.cpp.

Referenced by operator++().

◆ tmpPlane

BSPTree::Plane moab::BSPTreePlaneIter::tmpPlane
private

Definition at line 1281 of file BSPTree.cpp.

Referenced by operator++(), and operator->().

◆ toolPtr

BSPTree* moab::BSPTreePlaneIter::toolPtr
private

Definition at line 1278 of file BSPTree.cpp.

Referenced by operator++().


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