FreeCAD C++
|
#include <Base/BoundBox.h>
The 3D bounding box class.
Public Member Functions | |
BoundBox3 (_Precision fMinX=std::numeric_limits< _Precision >::max(), _Precision fMinY=std::numeric_limits< _Precision >::max(), _Precision fMinZ=std::numeric_limits< _Precision >::max(), _Precision fMaxX=-std::numeric_limits< _Precision >::max(), _Precision fMaxY=-std::numeric_limits< _Precision >::max(), _Precision fMaxZ=-std::numeric_limits< _Precision >::max()) | |
BoundBox3 (const Vector3< _Precision > *pclVect, unsigned long ulCt) | |
BoundBox3 (const Vector3< _Precision > &rcCnt, _Precision fDistance) | |
BoundBox3< _Precision > & | operator= (const BoundBox3< _Precision > &rcBound) |
Assignment operator. | |
Vector3< _Precision > | CalcPoint (unsigned short usPoint) const |
void | CalcPlane (unsigned short usPlane, Vector3< _Precision > &rBase, Vector3< _Precision > &rNormal) const |
bool | CalcEdge (unsigned short usEdge, Vector3< _Precision > &rcP0, Vector3< _Precision > &rcP1) const |
bool | IntersectionPoint (const Vector3< _Precision > &rcVct, const Vector3< _Precision > &rcVctDir, Vector3< _Precision > &cVctRes, _Precision epsilon) const |
bool | IsCutLine (const Vector3< _Precision > &rcBase, const Vector3< _Precision > &rcDir, _Precision fTolerance=0.0f) const |
bool | IsCutPlane (const Vector3< _Precision > &rclBase, const Vector3< _Precision > &rclNormal) const |
bool | IntersectWithLine (const Vector3< _Precision > &rcBase, const Vector3< _Precision > &rcDir, Vector3< _Precision > &rcP0, Vector3< _Precision > &rcP1) const |
bool | IntersectPlaneWithLine (unsigned short usSide, const Vector3< _Precision > &rcBase, const Vector3< _Precision > &rcDir, Vector3< _Precision > &rcP0) const |
BoundBox3< _Precision >::SIDE | GetSideFromRay (const Vector3< _Precision > &rclPt, const Vector3< _Precision > &rclDir) const |
BoundBox3< _Precision >::SIDE | GetSideFromRay (const Vector3< _Precision > &rclPt, const Vector3< _Precision > &rclDir, Vector3< _Precision > &rcInt) const |
Vector3< _Precision > | ClosestPoint (const Vector3< _Precision > &rclPt) const |
BoundBox2d | ProjectBox (const ViewProjMethod *rclP) const |
BoundBox3< _Precision > | Transformed (const Matrix4D &mat) const |
Vector3< _Precision > | GetCenter (void) const |
_Precision | CalcDiagonalLength (void) const |
void | Enlarge (_Precision fLen) |
void | Shrink (_Precision fLen) |
_Precision | LengthX (void) const |
_Precision | LengthY (void) const |
_Precision | LengthZ (void) const |
void | MoveX (_Precision f) |
void | MoveY (_Precision f) |
void | MoveZ (_Precision f) |
void | ScaleX (_Precision f) |
void | ScaleY (_Precision f) |
void | ScaleZ (_Precision f) |
void | Print (std::ostream &) const |
bool | Intersect (const BoundBox3< _Precision > &rcBB) const |
bool | operator && (const BoundBox3< _Precision > &rcBB) const |
bool | Intersect (const BoundBox2d &rcBB) const |
bool | operator && (const BoundBox2d &rcBB) const |
BoundBox3< _Precision > | Intersected (const BoundBox3< _Precision > &rcBB) const |
BoundBox3< _Precision > | United (const BoundBox3< _Precision > &rcBB) const |
void | Add (const Vector3< _Precision > &rclVect) |
void | Add (const BoundBox3< _Precision > &rcBB) |
bool | IsInBox (const Vector3< _Precision > &rcVct) const |
bool | IsInBox (const BoundBox3< _Precision > &rcBB) const |
bool | IsInBox (const BoundBox2d &rcbb) const |
bool | IsValid (void) const |
Public Attributes | |
_Precision | MinX |
|
explicit |
Builds box from pairs of x,y,z values.
Base::BoundBox3< _Precision >::BoundBox3 | ( | const Vector3< _Precision > * | pclVect, |
unsigned long | ulCt | ||
) |
Builds box from an array of points.
Base::BoundBox3< _Precision >::BoundBox3 | ( | const Vector3< _Precision > & | rcCnt, |
_Precision | fDistance | ||
) |
Defines a bounding box around the center rcCnt with the distances fDistance in each coordinate.
void Base::BoundBox3< _Precision >::Add | ( | const Vector3< _Precision > & | rclVect | ) |
Appends the point to the box. The box can grow but not shrink.
void Base::BoundBox3< _Precision >::Add | ( | const BoundBox3< _Precision > & | rcBB | ) |
Appends the bounding box to this box. The box can grow but not shrink.
_Precision Base::BoundBox3< _Precision >::CalcDiagonalLength | ( | void | ) | const |
Compute the diagonal length of this bounding box.
bool Base::BoundBox3< _Precision >::CalcEdge | ( | unsigned short | usEdge, |
Vector3< _Precision > & | rcP0, | ||
Vector3< _Precision > & | rcP1 | ||
) | const |
Calculates the two points of an edge. 0. edge P0-P1 1. edge P1-P2 2. edge P2-P3
void Base::BoundBox3< _Precision >::CalcPlane | ( | unsigned short | usPlane, |
Vector3< _Precision > & | rBase, | ||
Vector3< _Precision > & | rNormal | ||
) | const |
Returns the plane of the given side.
Vector3< _Precision > Base::BoundBox3< _Precision >::CalcPoint | ( | unsigned short | usPoint | ) | const |
Returns the corner point usPoint. 0: front,bottom,left 1: front,bottom,right 2: front,top,right 3: front,top,left 4: back,bottom,left 5: back,bottom,right 6: back,top,right 7: back,top,left
Vector3< _Precision > Base::BoundBox3< _Precision >::ClosestPoint | ( | const Vector3< _Precision > & | rclPt | ) | const |
Searches for the closest point of the bounding box.
void Base::BoundBox3< _Precision >::Enlarge | ( | _Precision | fLen | ) |
Enlarges the box with factor fLen.
Vector3< _Precision > Base::BoundBox3< _Precision >::GetCenter | ( | void | ) | const |
Returns the center.of the box.
BoundBox3< _Precision >::SIDE Base::BoundBox3< _Precision >::GetSideFromRay | ( | const Vector3< _Precision > & | rclPt, |
const Vector3< _Precision > & | rclDir | ||
) | const |
Returns the side of the bounding box the ray exits.
BoundBox3< _Precision >::SIDE Base::BoundBox3< _Precision >::GetSideFromRay | ( | const Vector3< _Precision > & | rclPt, |
const Vector3< _Precision > & | rclDir, | ||
Vector3< _Precision > & | rcInt | ||
) | const |
Returns the side of the bounding box the ray exits.
bool Base::BoundBox3< _Precision >::Intersect | ( | const BoundBox3< _Precision > & | rcBB | ) | const |
Methods for intersection, cuttÃng and union of bounding boxes Checks for intersection.
bool Base::BoundBox3< _Precision >::Intersect | ( | const BoundBox2d & | rcBB | ) | const |
Checks for intersection.
BoundBox3< _Precision > Base::BoundBox3< _Precision >::Intersected | ( | const BoundBox3< _Precision > & | rcBB | ) | const |
Computes the intersection between two bounding boxes. The result is also a bounding box.
bool Base::BoundBox3< _Precision >::IntersectionPoint | ( | const Vector3< _Precision > & | rcVct, |
const Vector3< _Precision > & | rcVctDir, | ||
Vector3< _Precision > & | cVctRes, | ||
_Precision | epsilon | ||
) | const |
Intersection point of an inner search ray with the bounding box, built of the base rcVct and the direction rcVctDir. rcVct must lie inside the bounding box.
bool Base::BoundBox3< _Precision >::IntersectPlaneWithLine | ( | unsigned short | usSide, |
const Vector3< _Precision > & | rcBase, | ||
const Vector3< _Precision > & | rcDir, | ||
Vector3< _Precision > & | rcP0 | ||
) | const |
Computes the intersection point of line and a plane of the bounding box.
bool Base::BoundBox3< _Precision >::IntersectWithLine | ( | const Vector3< _Precision > & | rcBase, |
const Vector3< _Precision > & | rcDir, | ||
Vector3< _Precision > & | rcP0, | ||
Vector3< _Precision > & | rcP1 | ||
) | const |
Computes the intersection points of line and bounding box.
bool Base::BoundBox3< _Precision >::IsCutLine | ( | const Vector3< _Precision > & | rcBase, |
const Vector3< _Precision > & | rcDir, | ||
_Precision | fTolerance = 0.0f |
||
) | const |
Checks for intersection with line incl. search tolerance.
bool Base::BoundBox3< _Precision >::IsCutPlane | ( | const Vector3< _Precision > & | rclBase, |
const Vector3< _Precision > & | rclNormal | ||
) | const |
Checks if this plane specified by (point,normal) cuts this box.
bool Base::BoundBox3< _Precision >::IsInBox | ( | const Vector3< _Precision > & | rcVct | ) | const |
Test methods Checks if this point lies inside the box.
bool Base::BoundBox3< _Precision >::IsInBox | ( | const BoundBox3< _Precision > & | rcBB | ) | const |
Checks if this 3D box lies inside the box.
bool Base::BoundBox3< _Precision >::IsInBox | ( | const BoundBox2d & | rcbb | ) | const |
Checks if this 2D box lies inside the box.
bool Base::BoundBox3< _Precision >::IsValid | ( | void | ) | const |
Checks whether the bounding box is valid.
_Precision Base::BoundBox3< _Precision >::LengthX | ( | void | ) | const |
Calculates expansion in x-direction.
_Precision Base::BoundBox3< _Precision >::LengthY | ( | void | ) | const |
Calculates expansion in y-direction.
_Precision Base::BoundBox3< _Precision >::LengthZ | ( | void | ) | const |
Calculates expansion in z-direction.
void Base::BoundBox3< _Precision >::MoveX | ( | _Precision | f | ) |
Moves in x-direction.
void Base::BoundBox3< _Precision >::MoveY | ( | _Precision | f | ) |
Moves in y-direction.
void Base::BoundBox3< _Precision >::MoveZ | ( | _Precision | f | ) |
Moves in z-direction.
bool Base::BoundBox3< _Precision >::operator && | ( | const BoundBox3< _Precision > & | rcBB | ) | const |
Checks for intersection.
bool Base::BoundBox3< _Precision >::operator && | ( | const BoundBox2d & | rcBB | ) | const |
Checks for intersection.
void Base::BoundBox3< _Precision >::Print | ( | std::ostream & | out | ) | const |
Prints the values to stream.
BoundBox2d Base::BoundBox3< _Precision >::ProjectBox | ( | const ViewProjMethod * | rclP | ) | const |
Projects the box onto a plane and returns a 2D box.
void Base::BoundBox3< _Precision >::ScaleX | ( | _Precision | f | ) |
Scales in x-direction.
void Base::BoundBox3< _Precision >::ScaleY | ( | _Precision | f | ) |
Scales in y-direction.
void Base::BoundBox3< _Precision >::ScaleZ | ( | _Precision | f | ) |
Scales in z-direction.
void Base::BoundBox3< _Precision >::Shrink | ( | _Precision | fLen | ) |
Shrinks the box with factor fLen.
BoundBox3< _Precision > Base::BoundBox3< _Precision >::Transformed | ( | const Matrix4D & | mat | ) | const |
Transform the corners of this box with the given matrix and create a new bounding box.
BoundBox3< _Precision > Base::BoundBox3< _Precision >::United | ( | const BoundBox3< _Precision > & | rcBB | ) | const |
The union of two bounding boxes.
_Precision Base::BoundBox3< _Precision >::MinX |
Public attributes