Blender V2.61 - r43446
|
#include <BOP_BSPNode.h>
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_BSPNode * | getInChild () |
BOP_BSPNode * | getOutChild () |
bool | isLeaf () const |
void | setPlane (const MT_Plane3 &plane) |
MT_Plane3 & | getPlane () |
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_BSPNode * | m_inChild |
BOP_BSPNode * | m_outChild |
MT_Plane3 | m_plane |
unsigned int | m_deep |
Definition at line 43 of file BOP_BSPNode.h.
BOP_BSPNode::BOP_BSPNode | ( | const MT_Plane3 & | plane | ) |
Constructs a new BSP node.
plane | split 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.
unsigned int BOP_BSPNode::addFace | ( | const BOP_BSPPoints & | pts, |
const MT_Plane3 & | plane | ||
) |
Adds a new face to this BSP tree.
pts | vector containing face points |
plane | face 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 |
Classifies a face using its coordinates and plane.
p1 | first point. |
p2 | second point. |
p3 | third point. |
plane | face plane. |
Definition at line 169 of file BOP_BSPNode.cpp.
References BOP_addON(), BOP_compTAG(), BOP_createTAG(), BOP_intersectPlane(), BOP_isInsideCircle(), classifyFaceIN(), classifyFaceOUT(), hasSameOrientation(), 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, m_plane, 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, testPoint(), and UNCLASSIFIED.
Referenced by BOP_BSPTree::classifyFace(), classifyFaceIN(), classifyFaceOUT(), and BOP_BSPTree::filterFace().
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.
p1 | firts face vertex. |
p2 | second face vertex. |
p3 | third face vertex. |
plane | face 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.
p1 | firts face vertex. |
p2 | second face vertex. |
p3 | third face vertex. |
plane | face 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.
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.
plane | plane to test. |
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).
p1 | firts face vertex. |
p2 | second face vertex. |
p3 | third face vertex. |
plane | face plane. |
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.
p1 | firts face vertex. |
p2 | second face vertex. |
p3 | third face vertex. |
plane | face 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.
p1 | firts face vertex. |
p2 | second face vertex. |
p3 | third face vertex. |
plane | face 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.
res | output subtriangle result. |
plane | spliter plane. |
p1 | first triangle point. |
p2 | second triangle point. |
p3 | third triangle point. |
tag | triangle 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().
Tests the point situation respect the node plane.
p | point to test. |
Definition at line 155 of file BOP_BSPNode.cpp.
References BOP_classify(), BOP_createTAG(), and m_plane.
Referenced by addFace(), classifyFace(), and simplifiedClassifyFace().
unsigned int BOP_BSPNode::m_deep [protected] |
Definition at line 49 of file BOP_BSPNode.h.
Referenced by addFace(), BOP_BSPNode(), and getDeep().
BOP_BSPNode* BOP_BSPNode::m_inChild [protected] |
Definition at line 46 of file BOP_BSPNode.h.
Referenced by addFace(), BOP_BSPNode(), classifyFaceIN(), compChildren(), getInChild(), isLeaf(), print(), setInChild(), simplifiedClassifyFaceIN(), and ~BOP_BSPNode().
BOP_BSPNode* BOP_BSPNode::m_outChild [protected] |
Definition at line 47 of file BOP_BSPNode.h.
Referenced by addFace(), BOP_BSPNode(), classifyFaceOUT(), compChildren(), getOutChild(), isLeaf(), print(), setOutChild(), simplifiedClassifyFaceOUT(), and ~BOP_BSPNode().
MT_Plane3 BOP_BSPNode::m_plane [protected] |
Definition at line 48 of file BOP_BSPNode.h.
Referenced by addFace(), BOP_BSPNode(), classifyFace(), getPlane(), hasSameOrientation(), print(), setPlane(), simplifiedClassifyFace(), and testPoint().