Blender  V2.59
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 44 of file BOP_BSPNode.cpp.

References NULL.

BOP_BSPNode::~BOP_BSPNode ( )

Destroys a BSP tree.

Definition at line 55 of file BOP_BSPNode.cpp.

References 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 67 of file BOP_BSPNode.cpp.

References BOP_intersectPlane(), IN, MT_max(), NULL, ON, and OUT.

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

Classifies a face using its coordinates and plane.

Parameters:
p1first point.
p2second point.
p3third point.
planeface plane.
Returns:
TAG result: IN, OUT or IN&OUT.

Definition at line 170 of file BOP_BSPNode.cpp.

References BOP_addON(), BOP_compTAG(), BOP_createTAG(), BOP_intersectPlane(), BOP_isInsideCircle(), IN_IN_IN, IN_IN_ON, IN_IN_OUT, IN_ON_IN, IN_ON_ON, IN_ON_OUT, IN_OUT_IN, IN_OUT_ON, IN_OUT_OUT, INOUT, ON_IN_IN, ON_IN_ON, ON_IN_OUT, ON_ON_IN, ON_ON_ON, ON_ON_OUT, ON_OUT_IN, ON_OUT_ON, ON_OUT_OUT, OUT_IN_IN, OUT_IN_ON, OUT_IN_OUT, OUT_ON_IN, OUT_ON_ON, OUT_ON_OUT, OUT_OUT_IN, OUT_OUT_ON, OUT_OUT_OUT, and UNCLASSIFIED.

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 376 of file BOP_BSPNode.cpp.

References IN, and NULL.

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 394 of file BOP_BSPNode.cpp.

References NULL, and OUT.

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 501 of file BOP_BSPNode.cpp.

References NULL.

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

Definition at line 103 of file BOP_BSPNode.h.

References m_deep.

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 492 of file BOP_BSPNode.cpp.

References BOP_orientation().

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 708 of file BOP_BSPNode.cpp.

References NULL.

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 414 of file BOP_BSPNode.cpp.

References BOP_createTAG(), IN, IN_IN_IN, and OUT_OUT_OUT.

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 458 of file BOP_BSPNode.cpp.

References IN, and NULL.

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 476 of file BOP_BSPNode.cpp.

References NULL, and OUT.

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 524 of file BOP_BSPNode.cpp.

References BOP_intersectPlane(), 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.

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 156 of file BOP_BSPNode.cpp.

References BOP_classify(), and BOP_createTAG().


Member Data Documentation

unsigned int BOP_BSPNode::m_deep [protected]

Definition at line 49 of file BOP_BSPNode.h.

Referenced by getDeep().

Definition at line 46 of file BOP_BSPNode.h.

Referenced by getInChild(), isLeaf(), and setInChild().

Definition at line 47 of file BOP_BSPNode.h.

Referenced by getOutChild(), isLeaf(), and setOutChild().

Definition at line 48 of file BOP_BSPNode.h.

Referenced by getPlane(), and setPlane().


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