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.
List of all members
Kratos::BoundingBox< TPointType > Class Template Reference

Representing a bounding box by storing the min and max points. More...

#include <bounding_box.h>

Collaboration diagram for Kratos::BoundingBox< TPointType >:

Public Member Functions

Type Definitions
 KRATOS_CLASS_POINTER_DEFINITION (BoundingBox)
 Pointer definition of BoundingBox. More...
 
Life Cycle
 BoundingBox ()
 Default constructor. More...
 
 BoundingBox (TPointType const &MinPoint, TPointType const &MaxPoint)
 Constructor with min and max points. More...
 
 BoundingBox (const BoundingBox &Other)
 Copy constructor. More...
 
template<typename TIteratorType >
 BoundingBox (TIteratorType const &itPointsBegin, TIteratorType const &itPointsEnd)
 Construction with container of points. More...
 
virtual ~BoundingBox ()
 Destructor. More...
 
Operators
BoundingBoxoperator= (BoundingBox const &rOther)
 Assignment operator. More...
 
Operations
template<typename TIteratorType >
void Set (TIteratorType const &itPointsBegin, TIteratorType const &itPointsEnd)
 Sets the minimum and maximum points based on a range of input points. More...
 
template<typename TIteratorType >
void Extend (TIteratorType const &itPointsBegin, TIteratorType const &itPointsEnd)
 Extends the bounding box to include a range of input points. More...
 
void Extend (const double Margin)
 Extends the bounding box by adding a margin to its dimensions. More...
 
Access
TPointType & GetMinPoint ()
 Gets a reference to the minimum point. More...
 
TPointType const & GetMinPoint () const
 Gets a constant reference to the minimum point (read-only). More...
 
TPointType & GetMaxPoint ()
 Gets a reference to the maximum point. More...
 
TPointType const & GetMaxPoint () const
 Gets a constant reference to the maximum point (read-only). 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...
 

Detailed Description

template<typename TPointType>
class Kratos::BoundingBox< TPointType >

Representing a bounding box by storing the min and max points.

It stores the min and max points and have constructor for it construction with any container of points. TPointType should provide access operator [] to its coordinate and deep copy operator=

Template Parameters
TPointTypeThe type of point considered
Author
Pooyan Dadvand

Constructor & Destructor Documentation

◆ BoundingBox() [1/4]

template<typename TPointType >
Kratos::BoundingBox< TPointType >::BoundingBox ( )
inline

Default constructor.

◆ BoundingBox() [2/4]

template<typename TPointType >
Kratos::BoundingBox< TPointType >::BoundingBox ( TPointType const &  MinPoint,
TPointType const &  MaxPoint 
)
inline

Constructor with min and max points.

◆ BoundingBox() [3/4]

template<typename TPointType >
Kratos::BoundingBox< TPointType >::BoundingBox ( const BoundingBox< TPointType > &  Other)
inline

Copy constructor.

◆ BoundingBox() [4/4]

template<typename TPointType >
template<typename TIteratorType >
Kratos::BoundingBox< TPointType >::BoundingBox ( TIteratorType const &  itPointsBegin,
TIteratorType const &  itPointsEnd 
)
inline

Construction with container of points.

◆ ~BoundingBox()

template<typename TPointType >
virtual Kratos::BoundingBox< TPointType >::~BoundingBox ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ Extend() [1/2]

template<typename TPointType >
void Kratos::BoundingBox< TPointType >::Extend ( const double  Margin)
inline

Extends the bounding box by adding a margin to its dimensions.

This function extends the bounding box by adding a specified margin to each dimension of both the minimum and maximum points. It effectively enlarges the bounding box in all directions.

Parameters
MarginThe margin value to be added to each dimension.

◆ Extend() [2/2]

template<typename TPointType >
template<typename TIteratorType >
void Kratos::BoundingBox< TPointType >::Extend ( TIteratorType const &  itPointsBegin,
TIteratorType const &  itPointsEnd 
)
inline

Extends the bounding box to include a range of input points.

This function extends the bounding box defined by the minimum and maximum points to include a range of input points specified by the iterators itPointsBegin and itPointsEnd. It adjusts the minimum and maximum points as necessary to encompass all input points.

Template Parameters
TIteratorTypeThe iterator type for the input points.
Parameters
itPointsBeginThe iterator pointing to the beginning of the input point range.
itPointsEndThe iterator pointing to the end of the input point range.

◆ GetMaxPoint() [1/2]

template<typename TPointType >
TPointType& Kratos::BoundingBox< TPointType >::GetMaxPoint ( )
inline

Gets a reference to the maximum point.

This function returns a reference to the maximum point stored in the object.

Returns
A reference to the maximum point.

◆ GetMaxPoint() [2/2]

template<typename TPointType >
TPointType const& Kratos::BoundingBox< TPointType >::GetMaxPoint ( ) const
inline

Gets a constant reference to the maximum point (read-only).

This function returns a constant reference to the maximum point stored in the object. It allows you to access the maximum point without modifying it.

Returns
A constant reference to the maximum point.

◆ GetMinPoint() [1/2]

template<typename TPointType >
TPointType& Kratos::BoundingBox< TPointType >::GetMinPoint ( )
inline

Gets a reference to the minimum point.

This function returns a reference to the minimum point stored in the object.

Returns
A reference to the minimum point.

◆ GetMinPoint() [2/2]

template<typename TPointType >
TPointType const& Kratos::BoundingBox< TPointType >::GetMinPoint ( ) const
inline

Gets a constant reference to the minimum point (read-only).

This function returns a constant reference to the minimum point stored in the object. It allows you to access the minimum point without modifying it.

Returns
A constant reference to the minimum point.

◆ Info()

template<typename TPointType >
virtual std::string Kratos::BoundingBox< TPointType >::Info ( ) const
inlinevirtual

Turn back information as a string.

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<typename TPointType >
Kratos::BoundingBox< TPointType >::KRATOS_CLASS_POINTER_DEFINITION ( BoundingBox< TPointType >  )

Pointer definition of BoundingBox.

◆ operator=()

template<typename TPointType >
BoundingBox& Kratos::BoundingBox< TPointType >::operator= ( BoundingBox< TPointType > const &  rOther)
inline

Assignment operator.

◆ PrintData()

template<typename TPointType >
virtual void Kratos::BoundingBox< TPointType >::PrintData ( std::ostream &  rOStream) const
inlinevirtual

Print object's data.

◆ PrintInfo()

template<typename TPointType >
virtual void Kratos::BoundingBox< TPointType >::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.

◆ Set()

template<typename TPointType >
template<typename TIteratorType >
void Kratos::BoundingBox< TPointType >::Set ( TIteratorType const &  itPointsBegin,
TIteratorType const &  itPointsEnd 
)
inline

Sets the minimum and maximum points based on a range of input points.

This function sets the minimum and maximum points of the object based on a range of input points specified by the iterators itPointsBegin and itPointsEnd. If the range is empty (itPointsBegin == itPointsEnd), it initializes both the minimum and maximum points to zero vectors.

Template Parameters
TIteratorTypeThe iterator type for the input points.
Parameters
itPointsBeginThe iterator pointing to the beginning of the input point range.
itPointsEndThe iterator pointing to the end of the input point range.

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