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.
Public Member Functions | List of all members
Kratos::OrientedBoundingBox< TDim > Class Template Reference

This class defines the Oriented bounding box class. More...

#include <oriented_bounding_box.h>

Collaboration diagram for Kratos::OrientedBoundingBox< TDim >:

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< PointGetEquivalentGeometry () const
 
Hexahedra3D8< PointGetEquivalentGeometry () 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< NodeTypeGeometryType
 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...
 

Detailed Description

template<std::size_t TDim>
class Kratos::OrientedBoundingBox< TDim >

This class defines the Oriented bounding box class.

The geometrical definition of the OrientedBoundingBox can be done as the * directions /

https://www.geometrictools.com/Documentation/DynamicCollisionDetection.pdf

Member Typedef Documentation

◆ GeometryType

template<std::size_t TDim>
typedef Geometry<NodeType> Kratos::OrientedBoundingBox< TDim >::GeometryType

Definition of geometries.

◆ IndexType

template<std::size_t TDim>
typedef std::size_t Kratos::OrientedBoundingBox< TDim >::IndexType

Index type definition.

◆ NodeType

template<std::size_t TDim>
typedef Node Kratos::OrientedBoundingBox< TDim >::NodeType

◆ OutputType

template<std::size_t TDim>
typedef std::conditional<TDim == 2, Quadrilateral2D4<Point>, Hexahedra3D8<Point> >::type Kratos::OrientedBoundingBox< TDim >::OutputType

Definition of the output type.

◆ SizeType

template<std::size_t TDim>
typedef std::size_t Kratos::OrientedBoundingBox< TDim >::SizeType

Size type definition.

Constructor & Destructor Documentation

◆ OrientedBoundingBox() [1/6]

template<std::size_t TDim>
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.

Parameters
rCenterPointThe center of the OrientedBoundingBox
rOrientationVectorsThe orientation vector of the diagonal
rHalfLengthThe half sides

◆ OrientedBoundingBox() [2/6]

template<std::size_t TDim>
Kratos::OrientedBoundingBox< TDim >::OrientedBoundingBox ( const array_1d< double, 3 > &  rCenterCoords,
const array_1d< array_1d< double, 3 >, TDim > &  rAxisCoordinates 
)

Default constructors.

Parameters
rCenterPointThe center of the OrientedBoundingBox
rAxisCoordinatesThe coordinates that define the axis (orientation vectors and half lengths)

◆ OrientedBoundingBox() [3/6]

template<std::size_t TDim>
Kratos::OrientedBoundingBox< TDim >::OrientedBoundingBox ( const GeometryType rGeometry,
const double  BoundingBoxFactor,
const bool  BuildFromBoundingBox = true 
)

Default constructors (with geometry)

Parameters
rGeometryThe geometry to be considered to build a OBB
BoundingBoxFactorThe bounding box factor

◆ OrientedBoundingBox() [4/6]

template<std::size_t TDim>
Kratos::OrientedBoundingBox< TDim >::OrientedBoundingBox ( const OrientedBoundingBox< TDim > &  rhs)
inline

Copy constructor (not really required)

◆ ~OrientedBoundingBox()

template<std::size_t TDim>
Kratos::OrientedBoundingBox< TDim >::~OrientedBoundingBox ( )
inline

Destructor.

◆ OrientedBoundingBox() [5/6]

Kratos::OrientedBoundingBox< 2 >::OrientedBoundingBox ( const GeometryType rGeometry,
const double  BoundingBoxFactor,
const bool  BuildFromBoundingBox 
)

◆ OrientedBoundingBox() [6/6]

Kratos::OrientedBoundingBox< 3 >::OrientedBoundingBox ( const GeometryType rGeometry,
const double  BoundingBoxFactor,
const bool  BuildFromBoundingBox 
)

Member Function Documentation

◆ GetCenter()

template<std::size_t TDim>
const array_1d< double, 3 > & Kratos::OrientedBoundingBox< TDim >::GetCenter

Returns the point that defines the center of the OrientedBoundingBox.

Returns
The center point of the OrientedBoundingBox

◆ GetEquivalentGeometry() [1/3]

Quadrilateral2D4< Point > Kratos::OrientedBoundingBox< 2 >::GetEquivalentGeometry ( ) const

◆ GetEquivalentGeometry() [2/3]

Hexahedra3D8< Point > Kratos::OrientedBoundingBox< 3 >::GetEquivalentGeometry ( ) const

◆ GetEquivalentGeometry() [3/3]

template<std::size_t TDim>
OutputType Kratos::OrientedBoundingBox< TDim >::GetEquivalentGeometry ( ) const

This method egnerates an equiavelent geometry (debugging)

Returns
Getting the OrientedBoundingBox geometry

◆ GetEquivalentRotatedGeometry() [1/3]

void Kratos::OrientedBoundingBox< 2 >::GetEquivalentRotatedGeometry ( OutputType rGeometry)

◆ GetEquivalentRotatedGeometry() [2/3]

void Kratos::OrientedBoundingBox< 3 >::GetEquivalentRotatedGeometry ( OutputType rGeometry)

◆ GetEquivalentRotatedGeometry() [3/3]

template<std::size_t TDim>
void Kratos::OrientedBoundingBox< TDim >::GetEquivalentRotatedGeometry ( OutputType rGeometry)

This method egnerates an equiavelent geometry (debugging)

Parameters
rGeometryGeometry to rotate

◆ GetHalfLength()

template<std::size_t TDim>
const array_1d< double, TDim > & Kratos::OrientedBoundingBox< TDim >::GetHalfLength

Returns the length of the half of the diagonal.

Returns
The length of the half of the diagonal

◆ GetOrientationVectors()

template<std::size_t TDim>
const array_1d< array_1d< double, 3 >, TDim > & Kratos::OrientedBoundingBox< TDim >::GetOrientationVectors

Returns the vector that defines the orientation of the axis.

Returns
The orientation vector

◆ HasIntersection()

template<std::size_t TDim>
bool Kratos::OrientedBoundingBox< TDim >::HasIntersection ( const OrientedBoundingBox< TDim > &  rOtherOrientedBoundingBox,
const OBBHasIntersectionType  OBBType = OBBHasIntersectionType::SeparatingAxisTheorem 
) const

Computes the intersection between two OrientedBoundingBox (current and new)

Parameters
rOtherOrientedBoundingBoxThe other Oriented Bounding Box considered
OBBTypeThe OBB intersection type considered

◆ Info()

template<std::size_t TDim>
virtual std::string Kratos::OrientedBoundingBox< TDim >::Info ( ) const
inlinevirtual

Turn back information as a string.

◆ IsInside() [1/3]

template<std::size_t TDim>
bool Kratos::OrientedBoundingBox< TDim >::IsInside ( const OrientedBoundingBox< TDim > &  rOtherOrientedBoundingBox) const

Computes the intersection between two OrientedBoundingBox (current and new)

◆ IsInside() [2/3]

bool Kratos::OrientedBoundingBox< 2 >::IsInside ( const OrientedBoundingBox< 2 > &  rOtherOrientedBoundingBox) const

◆ IsInside() [3/3]

bool Kratos::OrientedBoundingBox< 3 >::IsInside ( const OrientedBoundingBox< 3 > &  rOtherOrientedBoundingBox) const

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<std::size_t TDim>
Kratos::OrientedBoundingBox< TDim >::KRATOS_CLASS_POINTER_DEFINITION ( OrientedBoundingBox< TDim >  )

Counted pointer of OrientedBoundingBox.

◆ PrintData()

template<std::size_t TDim>
virtual void Kratos::OrientedBoundingBox< TDim >::PrintData ( std::ostream &  rOStream) const
inlinevirtual

Print object's data.

◆ PrintInfo()

template<std::size_t TDim>
virtual void Kratos::OrientedBoundingBox< TDim >::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.

◆ SetCenter()

template<std::size_t TDim>
void Kratos::OrientedBoundingBox< TDim >::SetCenter ( const array_1d< double, 3 > &  rCenterCoords)

Set the point that defines the center of the OrientedBoundingBox.

Parameters
rCenterCoordsThe coordinates that defines the center of the OrientedBoundingBox

◆ SetHalfLength()

template<std::size_t TDim>
void Kratos::OrientedBoundingBox< TDim >::SetHalfLength ( const array_1d< double, TDim > &  rHalfLength)

Set the length of the half of the diagonal.

Parameters
rHalfLengthThe length of the half of the diagonal

◆ SetOrientationVectors()

template<std::size_t TDim>
void Kratos::OrientedBoundingBox< TDim >::SetOrientationVectors ( const array_1d< array_1d< double, 3 >, TDim > &  rOrientationVectors)

Set the vector that defines the orientation of the axis.

Parameters
rOrientationVectorsThe orientation vector

Member Data Documentation

◆ ZeroTolerance

template<std::size_t TDim>
constexpr double Kratos::OrientedBoundingBox< TDim >::ZeroTolerance = std::numeric_limits<double>::epsilon()
staticconstexpr

Zero tolerance.


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