MOAB: Mesh Oriented datABase  (version 5.4.1)
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

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

Definition at line 1285 of file BSPTree.cpp.

References operator++().

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

Definition at line 1290 of file BSPTree.cpp.

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

Member Function Documentation

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

Definition at line 1303 of file BSPTree.cpp.

References pathPos.

    {
        return pathPos != other.pathPos;
    }
BSPTreePlaneIter & moab::BSPTreePlaneIter::operator++ ( )

Definition at line 1310 of file BSPTree.cpp.

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().

{
    if( --pathPos < 0 ) return *this;

    EntityHandle prev = pathToRoot[pathPos + 1];
    EntityHandle curr = pathToRoot[pathPos];

    ErrorCode rval = toolPtr->get_split_plane( curr, tmpPlane );
    if( MB_SUCCESS != rval )
    {
        assert( false );
        pathPos = 0;
        return *this;
    }

    tmpChildren.clear();
    rval = toolPtr->moab()->get_child_meshsets( curr, tmpChildren );
    if( MB_SUCCESS != rval || tmpChildren.size() != 2 )
    {
        assert( false );
        pathPos = 0;
        return *this;
    }

    if( tmpChildren[1] == prev ) tmpPlane.flip();
    return *this;
}
const BSPTree::Plane* moab::BSPTreePlaneIter::operator-> ( ) const [inline]

Definition at line 1295 of file BSPTree.cpp.

References tmpPlane.

    {
        return &tmpPlane;
    }
bool moab::BSPTreePlaneIter::operator== ( const BSPTreePlaneIter other) const [inline]

Definition at line 1299 of file BSPTree.cpp.

References pathPos.

    {
        return pathPos == other.pathPos;
    }

Member Data Documentation

Definition at line 1280 of file BSPTree.cpp.

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

Definition at line 1279 of file BSPTree.cpp.

Referenced by operator++().

Definition at line 1282 of file BSPTree.cpp.

Referenced by operator++().

Definition at line 1281 of file BSPTree.cpp.

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

Definition at line 1278 of file BSPTree.cpp.

Referenced by operator++().

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines