KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
This class defines the Oriented bounding box class. More...
#include <oriented_bounding_box.h>
Public Member Functions | |
OrientedBoundingBox (const GeometryType &rGeometry, const double BoundingBoxFactor, const bool BuildFromBoundingBox) | |
OrientedBoundingBox (const GeometryType &rGeometry, const double BoundingBoxFactor, const bool BuildFromBoundingBox) | |
bool | IsInside (const OrientedBoundingBox< 2 > &rOtherOrientedBoundingBox) const |
bool | IsInside (const OrientedBoundingBox< 3 > &rOtherOrientedBoundingBox) const |
Quadrilateral2D4< Point > | GetEquivalentGeometry () const |
Hexahedra3D8< Point > | GetEquivalentGeometry () const |
void | GetEquivalentRotatedGeometry (OutputType &rGeometry) |
void | GetEquivalentRotatedGeometry (OutputType &rGeometry) |
Life Cycle | |
OrientedBoundingBox (const array_1d< double, 3 > &rCenterCoords, const array_1d< array_1d< double, 3 >, TDim > &rOrientationVectors, const array_1d< double, TDim > &rHalfLength) | |
Default constructors. More... | |
OrientedBoundingBox (const array_1d< double, 3 > &rCenterCoords, const array_1d< array_1d< double, 3 >, TDim > &rAxisCoordinates) | |
Default constructors. More... | |
OrientedBoundingBox (const GeometryType &rGeometry, const double BoundingBoxFactor, const bool BuildFromBoundingBox=true) | |
Default constructors (with geometry) More... | |
OrientedBoundingBox (const OrientedBoundingBox &rhs) | |
Copy constructor (not really required) More... | |
~OrientedBoundingBox () | |
Destructor. More... | |
Operations | |
const array_1d< double, 3 > & | GetCenter () const |
Returns the point that defines the center of the OrientedBoundingBox. More... | |
void | SetCenter (const array_1d< double, 3 > &rCenterCoords) |
Set the point that defines the center of the OrientedBoundingBox. More... | |
const array_1d< array_1d< double, 3 >, TDim > & | GetOrientationVectors () const |
Returns the vector that defines the orientation of the axis. More... | |
void | SetOrientationVectors (const array_1d< array_1d< double, 3 >, TDim > &rOrientationVectors) |
Set the vector that defines the orientation of the axis. More... | |
const array_1d< double, TDim > & | GetHalfLength () const |
Returns the length of the half of the diagonal. More... | |
void | SetHalfLength (const array_1d< double, TDim > &rHalfLength) |
Set the length of the half of the diagonal. More... | |
bool | IsInside (const OrientedBoundingBox &rOtherOrientedBoundingBox) const |
Computes the intersection between two OrientedBoundingBox (current and new) More... | |
bool | HasIntersection (const OrientedBoundingBox &rOtherOrientedBoundingBox, const OBBHasIntersectionType OBBType=OBBHasIntersectionType::SeparatingAxisTheorem) const |
Computes the intersection between two OrientedBoundingBox (current and new) More... | |
OutputType | GetEquivalentGeometry () const |
This method egnerates an equiavelent geometry (debugging) More... | |
void | GetEquivalentRotatedGeometry (OutputType &rGeometry) |
This method egnerates an equiavelent geometry (debugging) More... | |
Input and output | |
virtual std::string | Info () const |
Turn back information as a string. More... | |
virtual void | PrintInfo (std::ostream &rOStream) const |
Print information about this object. More... | |
virtual void | PrintData (std::ostream &rOStream) const |
Print object's data. More... | |
Type Definitions | |
typedef Node | NodeType |
typedef Geometry< NodeType > | GeometryType |
Definition of geometries. More... | |
typedef std::size_t | IndexType |
Index type definition. More... | |
typedef std::size_t | SizeType |
Size type definition. More... | |
typedef std::conditional< TDim==2, Quadrilateral2D4< Point >, Hexahedra3D8< Point > >::type | OutputType |
Definition of the output type. More... | |
static constexpr double | ZeroTolerance = std::numeric_limits<double>::epsilon() |
Zero tolerance. More... | |
KRATOS_CLASS_POINTER_DEFINITION (OrientedBoundingBox) | |
Counted pointer of OrientedBoundingBox. More... | |
This class defines the Oriented bounding box class.
The geometrical definition of the OrientedBoundingBox can be done as the * directions /
*C *
/ \
/ *
For more detailshttps://www.geometrictools.com/Documentation/DynamicCollisionDetection.pdf
TDim | The dimension of the space |
typedef Geometry<NodeType> Kratos::OrientedBoundingBox< TDim >::GeometryType |
Definition of geometries.
typedef std::size_t Kratos::OrientedBoundingBox< TDim >::IndexType |
Index type definition.
typedef Node Kratos::OrientedBoundingBox< TDim >::NodeType |
typedef std::conditional<TDim == 2, Quadrilateral2D4<Point>, Hexahedra3D8<Point> >::type Kratos::OrientedBoundingBox< TDim >::OutputType |
Definition of the output type.
typedef std::size_t Kratos::OrientedBoundingBox< TDim >::SizeType |
Size type definition.
Kratos::OrientedBoundingBox< TDim >::OrientedBoundingBox | ( | const array_1d< double, 3 > & | rCenterCoords, |
const array_1d< array_1d< double, 3 >, TDim > & | rOrientationVectors, | ||
const array_1d< double, TDim > & | rHalfLength | ||
) |
Default constructors.
rCenterPoint | The center of the OrientedBoundingBox |
rOrientationVectors | The orientation vector of the diagonal |
rHalfLength | The half sides |
Kratos::OrientedBoundingBox< TDim >::OrientedBoundingBox | ( | const array_1d< double, 3 > & | rCenterCoords, |
const array_1d< array_1d< double, 3 >, TDim > & | rAxisCoordinates | ||
) |
Default constructors.
rCenterPoint | The center of the OrientedBoundingBox |
rAxisCoordinates | The coordinates that define the axis (orientation vectors and half lengths) |
Kratos::OrientedBoundingBox< TDim >::OrientedBoundingBox | ( | const GeometryType & | rGeometry, |
const double | BoundingBoxFactor, | ||
const bool | BuildFromBoundingBox = true |
||
) |
Default constructors (with geometry)
rGeometry | The geometry to be considered to build a OBB |
BoundingBoxFactor | The bounding box factor |
|
inline |
Copy constructor (not really required)
|
inline |
Destructor.
Kratos::OrientedBoundingBox< 2 >::OrientedBoundingBox | ( | const GeometryType & | rGeometry, |
const double | BoundingBoxFactor, | ||
const bool | BuildFromBoundingBox | ||
) |
Kratos::OrientedBoundingBox< 3 >::OrientedBoundingBox | ( | const GeometryType & | rGeometry, |
const double | BoundingBoxFactor, | ||
const bool | BuildFromBoundingBox | ||
) |
const array_1d< double, 3 > & Kratos::OrientedBoundingBox< TDim >::GetCenter |
Returns the point that defines the center of the OrientedBoundingBox.
Quadrilateral2D4< Point > Kratos::OrientedBoundingBox< 2 >::GetEquivalentGeometry | ( | ) | const |
Hexahedra3D8< Point > Kratos::OrientedBoundingBox< 3 >::GetEquivalentGeometry | ( | ) | const |
OutputType Kratos::OrientedBoundingBox< TDim >::GetEquivalentGeometry | ( | ) | const |
This method egnerates an equiavelent geometry (debugging)
void Kratos::OrientedBoundingBox< 2 >::GetEquivalentRotatedGeometry | ( | OutputType & | rGeometry | ) |
void Kratos::OrientedBoundingBox< 3 >::GetEquivalentRotatedGeometry | ( | OutputType & | rGeometry | ) |
void Kratos::OrientedBoundingBox< TDim >::GetEquivalentRotatedGeometry | ( | OutputType & | rGeometry | ) |
This method egnerates an equiavelent geometry (debugging)
rGeometry | Geometry to rotate |
const array_1d< double, TDim > & Kratos::OrientedBoundingBox< TDim >::GetHalfLength |
Returns the length of the half of the diagonal.
const array_1d< array_1d< double, 3 >, TDim > & Kratos::OrientedBoundingBox< TDim >::GetOrientationVectors |
Returns the vector that defines the orientation of the axis.
bool Kratos::OrientedBoundingBox< TDim >::HasIntersection | ( | const OrientedBoundingBox< TDim > & | rOtherOrientedBoundingBox, |
const OBBHasIntersectionType | OBBType = OBBHasIntersectionType::SeparatingAxisTheorem |
||
) | const |
Computes the intersection between two OrientedBoundingBox (current and new)
rOtherOrientedBoundingBox | The other Oriented Bounding Box considered |
OBBType | The OBB intersection type considered |
|
inlinevirtual |
Turn back information as a string.
bool Kratos::OrientedBoundingBox< TDim >::IsInside | ( | const OrientedBoundingBox< TDim > & | rOtherOrientedBoundingBox | ) | const |
Computes the intersection between two OrientedBoundingBox (current and new)
bool Kratos::OrientedBoundingBox< 2 >::IsInside | ( | const OrientedBoundingBox< 2 > & | rOtherOrientedBoundingBox | ) | const |
bool Kratos::OrientedBoundingBox< 3 >::IsInside | ( | const OrientedBoundingBox< 3 > & | rOtherOrientedBoundingBox | ) | const |
Kratos::OrientedBoundingBox< TDim >::KRATOS_CLASS_POINTER_DEFINITION | ( | OrientedBoundingBox< TDim > | ) |
Counted pointer of OrientedBoundingBox.
|
inlinevirtual |
Print object's data.
|
inlinevirtual |
Print information about this object.
void Kratos::OrientedBoundingBox< TDim >::SetCenter | ( | const array_1d< double, 3 > & | rCenterCoords | ) |
Set the point that defines the center of the OrientedBoundingBox.
rCenterCoords | The coordinates that defines the center of the OrientedBoundingBox |
void Kratos::OrientedBoundingBox< TDim >::SetHalfLength | ( | const array_1d< double, TDim > & | rHalfLength | ) |
Set the length of the half of the diagonal.
rHalfLength | The length of the half of the diagonal |
void Kratos::OrientedBoundingBox< TDim >::SetOrientationVectors | ( | const array_1d< array_1d< double, 3 >, TDim > & | rOrientationVectors | ) |
Set the vector that defines the orientation of the axis.
rOrientationVectors | The orientation vector |
|
staticconstexpr |
Zero tolerance.