|
|
|
octree Class Template ReferenceInheritance diagram for octree:![]() ![]() Detailed Descriptiontemplate<class Type>
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public Types | |
| enum | volumeType { UNKNOWN, MIXED, INSIDE, OUTSIDE } |
| volume types More... | |
Public Member Functions | |
| octree (const treeBoundBox &octreeBb, const Type &shapes, const label minNLevels, const scalar maxLeafRatio, const scalar maxShapeRatio) | |
| Construct from components. | |
| ~octree () | |
| const Type & | shapes () const |
| const treeBoundBox & | octreeBb () const |
| scalar | maxShapeRatio () const |
| scalar | maxLeafRatio () const |
| label | minNLevels () const |
| treeNode< Type > * | topNode () const |
| label | deepestLevel () const |
| label | nEntries () const |
| label | nNodes () const |
| label | nLeaves () const |
| void | setEntries (const label n) |
| void | setNodes (const label n) |
| void | setLeaves (const label n) |
| label | getSampleType (const point &sample) const |
| Returns type of sample with respect to nearest shape. | |
| label | find (const point &sample) const |
| Find shape containing point in tree. | |
| bool | findTightest (const point &sample, treeBoundBox &tightest) const |
| Calculate tightest fitting bounding box. Uses. | |
| label | findNearest (const point &sample, treeBoundBox &tightest, scalar &tightestDist) const |
| Find nearest shape. Returns index of shape or -1 if not found. | |
| label | findNearest (const linePointRef &ln, treeBoundBox &tightest, point &linePoint, point &shapePoint) const |
| Find nearest to line. Returns -1 or index of shape and. | |
| labelList | findBox (const boundBox &bb) const |
| Find (in no particular order) indices of all shapes inside or. | |
| pointIndexHit | findLine (const point &start, const point &end) const |
| Find intersected shape along line. pointIndexHit contains index. | |
| pointIndexHit | findLineAny (const point &start, const point &end) const |
| Like above but just tests whether line hits anything. So. | |
| const treeLeaf< Type > * | findLeafLine (const point &start, const point &end, point &leafIntPoint) const |
| Find leaf along line. Set leafIntPoint to leave point of. | |
| void | writeOBJ (Ostream &os, label &vertNo) const |
| Dump graphical representation in .obj format. | |
| void | printStats (Ostream &os) const |
| Print some stats on octree. | |
| iterator | begin () |
| iterator set to the begining of the octree | |
| const iterator & | end () |
| iterator set to beyond the end of the octree | |
| const_iterator | begin () const |
| const_iterator set to the begining of the octree | |
| const const_iterator & | end () const |
| const_iterator set to beyond the end of the octree | |
Static Public Member Functions | |
| static string | volType (const label) |
| for debugging:return printable representation of volumeType | |
| static label | getVolType (const vector &geomNormal, const vector &vec) |
| Code the vector with respect to the geometry. geomNormal guaranteed. | |
Friends | |
| class | iterator |
| class | const_iterator |
| Ostream & | operator (Ostream &, const octree< Type > &) |
Classes | |
| class | const_iterator |
| class | iterator |
| enum volumeType |
| octree | ( | const treeBoundBox & | octreeBb, | |
| const Type & | shapes, | |||
| const label | minNLevels, | |||
| const scalar | maxLeafRatio, | |||
| const scalar | maxShapeRatio | |||
| ) |
Construct from components.
| ~octree | ( | ) |
| static string volType | ( | const | label | ) | [static] |
for debugging:return printable representation of volumeType
Code the vector with respect to the geometry. geomNormal guaranteed.
to point outside.
| const treeBoundBox& octreeBb | ( | ) | const [inline] |
Returns type of sample with respect to nearest shape.
Meaning of type is determined by shapes.getSampleType(). Normally based on outwards pointing normal. For e.g. octreeDataFace returns one of inside : on other side of normal on nearest face outside : on same side as normal on nearest face unknown : not above nearest face; surface probably not closed. mixed : should never happen
Find shape containing point in tree.
Returns -1 if not in found. Uses Type::contains.
| bool findTightest | ( | const point & | sample, | |
| treeBoundBox & | tightest | |||
| ) | const |
Calculate tightest fitting bounding box. Uses.
Type::findTightest.
| label findNearest | ( | const point & | sample, | |
| treeBoundBox & | tightest, | |||
| scalar & | tightestDist | |||
| ) | const |
Find nearest shape. Returns index of shape or -1 if not found.
tightestDist is both input and output. Uses Type::calcNearest.
| label findNearest | ( | const linePointRef & | ln, | |
| treeBoundBox & | tightest, | |||
| point & | linePoint, | |||
| point & | shapePoint | |||
| ) | const |
Find nearest to line. Returns -1 or index of shape and.
sets:
Find (in no particular order) indices of all shapes inside or.
overlapping bounding box (i.e. all shapes not outside box)
| pointIndexHit findLine | ( | const point & | start, | |
| const point & | end | |||
| ) | const |
Find intersected shape along line. pointIndexHit contains index.
of nearest shape intersected and the intersection point. Uses findLeafLine.
| pointIndexHit findLineAny | ( | const point & | start, | |
| const point & | end | |||
| ) | const |
Like above but just tests whether line hits anything. So.
returns first intersection found, not nessecarily nearest.
| const treeLeaf<Type>* findLeafLine | ( | const point & | start, | |
| const point & | end, | |||
| point & | leafIntPoint | |||
| ) | const |
Find leaf along line. Set leafIntPoint to leave point of.
| void printStats | ( | Ostream & | os | ) | const |
Print some stats on octree.
| iterator begin | ( | ) |
iterator set to the begining of the octree
| const iterator& end | ( | ) |
iterator set to beyond the end of the octree
| const_iterator begin | ( | ) | const [inline] |
const_iterator set to the begining of the octree
| const const_iterator& end | ( | ) | const [inline] |
const_iterator set to beyond the end of the octree
friend class const_iterator [friend] |