MOAB: Mesh Oriented datABase  (version 5.2.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 1265 of file BSPTree.cpp.


Constructor & Destructor Documentation

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

Definition at line 1274 of file BSPTree.cpp.

References operator++().

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

Definition at line 1279 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 1292 of file BSPTree.cpp.

References pathPos.

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

Definition at line 1299 of file BSPTree.cpp.

References moab::BSPTree::Plane::flip(), 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 1284 of file BSPTree.cpp.

References tmpPlane.

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

Definition at line 1288 of file BSPTree.cpp.

References pathPos.

    {
        return pathPos == other.pathPos;
    }

Member Data Documentation

Definition at line 1269 of file BSPTree.cpp.

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

Definition at line 1268 of file BSPTree.cpp.

Referenced by operator++().

Definition at line 1271 of file BSPTree.cpp.

Referenced by operator++().

Definition at line 1270 of file BSPTree.cpp.

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

Definition at line 1267 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