PTEMS  0.1.0-dev+git.0df6b1e
PolyTopic Element Method Solver
ptems::BBox< DIM > Struct Template Reference

Defines a bounding box by opposite corners (minimum and maximum point) More...

#include <ptems/vector.hpp>

Collaboration diagram for ptems::BBox< DIM >:

Public Member Functions

constexpr BBox ()
 Create an undefined bounding box (has Maximum < Minimum) More...
 
constexpr BBox (const Vector< DIM > &min, const Vector< DIM > &max)
 Create a bounding box. More...
 
constexpr void AddPoint (const Vector< DIM > &point)
 Adds a point, expanding the bounding box as necessary. More...
 
constexpr BBoxoperator+= (const Vector< DIM > &point)
 Adds a point, expanding the bounding box as necessary. More...
 
constexpr BBoxoperator+= (const BBox< DIM > &rhs)
 Epands this bounding box to enclose the specefied bounding box as well. More...
 
constexpr Vector< DIM > ToLocal (const Vector< 2 > &pt)
 Convert a global coordinate to a local coordinate on the bounding box space \([-1,1]^D\). More...
 
constexpr double Volume () const
 Gets the area/volume/etc. More...
 
constexpr double BoundarySize () const
 Gets the length/area of the boundary of the bounding box. More...
 
constexpr BBox< DIM > Intersection (const BBox< DIM > &rhs)
 Creates a bounding box covering the intersection to this bounding box with the specified bounding box. More...
 
constexpr Vector< DIM > Barycentre () const
 Gets the centre of the bounding box. More...
 

Public Attributes

Vector< DIM > Minimum
 The minimum point of the bounding box. More...
 
Vector< DIM > Maximum
 The maximum point of the bounding box. More...
 

Detailed Description

template<std::size_t DIM>
struct ptems::BBox< DIM >

Defines a bounding box by opposite corners (minimum and maximum point)

Template Parameters
DIMThe dimension of the space the bounding box is in

Constructor & Destructor Documentation

◆ BBox() [1/2]

template<std::size_t DIM>
constexpr ptems::BBox< DIM >::BBox ( )
inlineconstexpr

Create an undefined bounding box (has Maximum < Minimum)

◆ BBox() [2/2]

template<std::size_t DIM>
constexpr ptems::BBox< DIM >::BBox ( const Vector< DIM > &  min,
const Vector< DIM > &  max 
)
inlineconstexpr

Create a bounding box.

Parameters
minMinimum point for the bounding box
maxMaximum point for the bounding box

Member Function Documentation

◆ AddPoint()

template<std::size_t DIM>
constexpr void ptems::BBox< DIM >::AddPoint ( const Vector< DIM > &  point)
inlineconstexpr

Adds a point, expanding the bounding box as necessary.

Parameters
pointPoint to ensure inside bounding box

◆ Barycentre()

template<std::size_t DIM>
constexpr Vector<DIM> ptems::BBox< DIM >::Barycentre ( ) const
inlineconstexpr

Gets the centre of the bounding box.

◆ BoundarySize()

template<std::size_t DIM>
constexpr double ptems::BBox< DIM >::BoundarySize ( ) const
inlineconstexpr

Gets the length/area of the boundary of the bounding box.

◆ Intersection()

template<std::size_t DIM>
constexpr BBox<DIM> ptems::BBox< DIM >::Intersection ( const BBox< DIM > &  rhs)
inlineconstexpr

Creates a bounding box covering the intersection to this bounding box with the specified bounding box.

Parameters
rhsBounding box to intersect with this bounding box
Returns
New bounding box covering just the intersection between the bounding boxes

◆ operator+=() [1/2]

template<std::size_t DIM>
constexpr BBox& ptems::BBox< DIM >::operator+= ( const BBox< DIM > &  rhs)
inlineconstexpr

Epands this bounding box to enclose the specefied bounding box as well.

Parameters
rhsBounding box to encluse within this bounding box
Returns
this

◆ operator+=() [2/2]

template<std::size_t DIM>
constexpr BBox& ptems::BBox< DIM >::operator+= ( const Vector< DIM > &  point)
inlineconstexpr

Adds a point, expanding the bounding box as necessary.

Parameters
pointPoint to ensure inside bounding box
Returns
this

◆ ToLocal()

template<std::size_t DIM>
constexpr Vector<DIM> ptems::BBox< DIM >::ToLocal ( const Vector< 2 > &  pt)
inlineconstexpr

Convert a global coordinate to a local coordinate on the bounding box space \([-1,1]^D\).

Parameters
ptThe point in global space
Returns
Point in local space defined by this bounding box

◆ Volume()

template<std::size_t DIM>
constexpr double ptems::BBox< DIM >::Volume ( ) const
inlineconstexpr

Gets the area/volume/etc.

of the bounding box

Member Data Documentation

◆ Maximum

template<std::size_t DIM>
Vector<DIM> ptems::BBox< DIM >::Maximum

The maximum point of the bounding box.

◆ Minimum

template<std::size_t DIM>
Vector<DIM> ptems::BBox< DIM >::Minimum

The minimum point of the bounding box.


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