Blender V2.61 - r43446
Public Member Functions | Protected Member Functions | Protected Attributes

BOP_BSPNode Class Reference

#include <BOP_BSPNode.h>

List of all members.

Public Member Functions

 BOP_BSPNode (const MT_Plane3 &plane)
 ~BOP_BSPNode ()
unsigned int addFace (const BOP_BSPPoints &pts, const MT_Plane3 &plane)
BOP_TAG classifyFace (const MT_Point3 &p1, const MT_Point3 &p2, const MT_Point3 &p3, const MT_Plane3 &plane) const
BOP_TAG simplifiedClassifyFace (const MT_Point3 &p1, const MT_Point3 &p2, const MT_Point3 &p3, const MT_Plane3 &plane) const
void setInChild (BOP_BSPNode *inChild)
void setOutChild (BOP_BSPNode *outChild)
BOP_BSPNodegetInChild ()
BOP_BSPNodegetOutChild ()
bool isLeaf () const
void setPlane (const MT_Plane3 &plane)
MT_Plane3getPlane ()
unsigned int getDeep () const
void print (unsigned int deep)

Protected Member Functions

BOP_TAG testPoint (const MT_Point3 &p) const
BOP_TAG classifyFaceIN (const MT_Point3 &p1, const MT_Point3 &p2, const MT_Point3 &p3, const MT_Plane3 &plane) const
BOP_TAG classifyFaceOUT (const MT_Point3 &p1, const MT_Point3 &p2, const MT_Point3 &p3, const MT_Plane3 &plane) const
BOP_TAG simplifiedClassifyFaceIN (const MT_Point3 &p1, const MT_Point3 &p2, const MT_Point3 &p3, const MT_Plane3 &plane) const
BOP_TAG simplifiedClassifyFaceOUT (const MT_Point3 &p1, const MT_Point3 &p2, const MT_Point3 &p3, const MT_Plane3 &plane) const
bool hasSameOrientation (const MT_Plane3 &plane) const
int compChildren () const
int splitTriangle (MT_Point3 *res, const MT_Plane3 &plane, const MT_Point3 &p1, const MT_Point3 &p2, const MT_Point3 &p3, const BOP_TAG tag) const

Protected Attributes

BOP_BSPNodem_inChild
BOP_BSPNodem_outChild
MT_Plane3 m_plane
unsigned int m_deep

Detailed Description

Definition at line 43 of file BOP_BSPNode.h.


Constructor & Destructor Documentation

BOP_BSPNode::BOP_BSPNode ( const MT_Plane3 plane)

Constructs a new BSP node.

Parameters:
planesplit plane.

Definition at line 43 of file BOP_BSPNode.cpp.

References m_deep, m_inChild, m_outChild, m_plane, and NULL.

Referenced by addFace().

BOP_BSPNode::~BOP_BSPNode ( )

Destroys a BSP tree.

Definition at line 54 of file BOP_BSPNode.cpp.

References m_inChild, m_outChild, and NULL.


Member Function Documentation

unsigned int BOP_BSPNode::addFace ( const BOP_BSPPoints pts,
const MT_Plane3 plane 
)

Adds a new face to this BSP tree.

Parameters:
ptsvector containing face points
planeface plane.

Definition at line 66 of file BOP_BSPNode.cpp.

References addFace(), BOP_BSPNode(), BOP_intersectPlane(), IN, m_deep, m_inChild, m_outChild, m_plane, MT_max(), NULL, ON, OUT, and testPoint().

Referenced by addFace(), and BOP_BSPTree::addFace().

BOP_TAG BOP_BSPNode::classifyFace ( const MT_Point3 p1,
const MT_Point3 p2,
const MT_Point3 p3,
const MT_Plane3 plane 
) const
BOP_TAG BOP_BSPNode::classifyFaceIN ( const MT_Point3 p1,
const MT_Point3 p2,
const MT_Point3 p3,
const MT_Plane3 plane 
) const [protected]

Classifies a face through IN subtree.

Parameters:
p1firts face vertex.
p2second face vertex.
p3third face vertex.
planeface plane.

Definition at line 375 of file BOP_BSPNode.cpp.

References classifyFace(), IN, m_inChild, and NULL.

Referenced by classifyFace().

BOP_TAG BOP_BSPNode::classifyFaceOUT ( const MT_Point3 p1,
const MT_Point3 p2,
const MT_Point3 p3,
const MT_Plane3 plane 
) const [protected]

Classifies a face through OUT subtree.

Parameters:
p1firts face vertex.
p2second face vertex.
p3third face vertex.
planeface plane.

Definition at line 393 of file BOP_BSPNode.cpp.

References classifyFace(), m_outChild, NULL, and OUT.

Referenced by classifyFace().

int BOP_BSPNode::compChildren ( ) const [protected]

Comparation between both childrens.

Returns:
0 equal deep, 1 inChild more deep than outChild and -1 otherwise.

Definition at line 500 of file BOP_BSPNode.cpp.

References getDeep(), m_inChild, m_outChild, and NULL.

Referenced by splitTriangle().

unsigned int BOP_BSPNode::getDeep ( ) const [inline]

Definition at line 103 of file BOP_BSPNode.h.

References m_deep.

Referenced by compChildren(), and BOP_BSPTree::getDeep().

BOP_BSPNode* BOP_BSPNode::getInChild ( ) [inline]

Definition at line 97 of file BOP_BSPNode.h.

References m_inChild.

BOP_BSPNode* BOP_BSPNode::getOutChild ( ) [inline]

Definition at line 98 of file BOP_BSPNode.h.

References m_outChild.

MT_Plane3& BOP_BSPNode::getPlane ( ) [inline]

Definition at line 101 of file BOP_BSPNode.h.

References m_plane.

bool BOP_BSPNode::hasSameOrientation ( const MT_Plane3 plane) const [protected]

Determine if the input plane have the same orientation of the node plane.

Parameters:
planeplane to test.
Returns:
TRUE if have the same orientation, FALSE otherwise.

Definition at line 491 of file BOP_BSPNode.cpp.

References BOP_orientation(), and m_plane.

Referenced by classifyFace(), and simplifiedClassifyFace().

bool BOP_BSPNode::isLeaf ( ) const [inline]

Definition at line 99 of file BOP_BSPNode.h.

References m_inChild, and m_outChild.

void BOP_BSPNode::print ( unsigned int  deep)

Debug info.

Definition at line 707 of file BOP_BSPNode.cpp.

References m_inChild, m_outChild, m_plane, NULL, and print().

Referenced by print(), and BOP_BSPTree::print().

void BOP_BSPNode::setInChild ( BOP_BSPNode inChild) [inline]

Definition at line 95 of file BOP_BSPNode.h.

References m_inChild.

void BOP_BSPNode::setOutChild ( BOP_BSPNode outChild) [inline]

Definition at line 96 of file BOP_BSPNode.h.

References m_outChild.

void BOP_BSPNode::setPlane ( const MT_Plane3 plane) [inline]

Definition at line 100 of file BOP_BSPNode.h.

References m_plane.

BOP_TAG BOP_BSPNode::simplifiedClassifyFace ( const MT_Point3 p1,
const MT_Point3 p2,
const MT_Point3 p3,
const MT_Plane3 plane 
) const

Simplified classification (optimized but requires that the face is not INOUT; only works correctly with faces completely IN or OUT).

Parameters:
p1firts face vertex.
p2second face vertex.
p3third face vertex.
planeface plane.
Returns:
TAG result: IN or OUT.

Definition at line 413 of file BOP_BSPNode.cpp.

References BOP_createTAG(), hasSameOrientation(), IN, IN_IN_IN, m_plane, OUT_OUT_OUT, simplifiedClassifyFaceIN(), simplifiedClassifyFaceOUT(), splitTriangle(), and testPoint().

Referenced by BOP_BSPTree::simplifiedClassifyFace(), simplifiedClassifyFaceIN(), and simplifiedClassifyFaceOUT().

BOP_TAG BOP_BSPNode::simplifiedClassifyFaceIN ( const MT_Point3 p1,
const MT_Point3 p2,
const MT_Point3 p3,
const MT_Plane3 plane 
) const [protected]

Simplified classify through IN subtree.

Parameters:
p1firts face vertex.
p2second face vertex.
p3third face vertex.
planeface plane.

Definition at line 457 of file BOP_BSPNode.cpp.

References IN, m_inChild, NULL, and simplifiedClassifyFace().

Referenced by simplifiedClassifyFace().

BOP_TAG BOP_BSPNode::simplifiedClassifyFaceOUT ( const MT_Point3 p1,
const MT_Point3 p2,
const MT_Point3 p3,
const MT_Plane3 plane 
) const [protected]

Simplified classify through OUT subtree.

Parameters:
p1firts face vertex.
p2second face vertex.
p3third face vertex.
planeface plane.

Definition at line 475 of file BOP_BSPNode.cpp.

References m_outChild, NULL, OUT, and simplifiedClassifyFace().

Referenced by simplifiedClassifyFace().

int BOP_BSPNode::splitTriangle ( MT_Point3 res,
const MT_Plane3 plane,
const MT_Point3 p1,
const MT_Point3 p2,
const MT_Point3 p3,
const BOP_TAG  tag 
) const [protected]

Extract a subtriangle from input triangle, is used for simplified classification. The subtriangle is obtained spliting the input triangle by input plane.

Parameters:
resoutput subtriangle result.
planespliter plane.
p1first triangle point.
p2second triangle point.
p3third triangle point.
tagtriangle orientation respect the plane.

Definition at line 523 of file BOP_BSPNode.cpp.

References BOP_intersectPlane(), compChildren(), IN_IN_OUT, IN_ON_OUT, IN_OUT_IN, IN_OUT_ON, IN_OUT_OUT, ON_IN_OUT, ON_OUT_IN, OUT_IN_IN, OUT_IN_ON, OUT_IN_OUT, OUT_ON_IN, and OUT_OUT_IN.

Referenced by simplifiedClassifyFace().

BOP_TAG BOP_BSPNode::testPoint ( const MT_Point3 p) const [protected]

Tests the point situation respect the node plane.

Parameters:
ppoint to test.
Returns:
TAG result: IN, OUT or ON.

Definition at line 155 of file BOP_BSPNode.cpp.

References BOP_classify(), BOP_createTAG(), and m_plane.

Referenced by addFace(), classifyFace(), and simplifiedClassifyFace().


Member Data Documentation

unsigned int BOP_BSPNode::m_deep [protected]

Definition at line 49 of file BOP_BSPNode.h.

Referenced by addFace(), BOP_BSPNode(), and getDeep().


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