Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
spat::Box< Valtype > Struct Template Reference

Axis aligned box. More...

#include <C:/Trend/Development/Trax3/Code/spat/Box.h>

Inheritance diagram for spat::Box< Valtype >:

Public Types

typedef Valtype value_type

Public Member Functions

BoxInit () noexcept
 Initializes the interval to origin.
bool Normal () const noexcept
 Is the box normalized?
BoxNormalize () noexcept
 Normalizes the box by changing the corners, so that the near corner has smaller coordinates than the far corner.
const Position< Valtype > Near () const noexcept
const Position< Valtype > Far () const noexcept
Valtype NearX () const noexcept
Valtype NearY () const noexcept
Valtype NearZ () const noexcept
Valtype FarX () const noexcept
Valtype FarY () const noexcept
Valtype FarZ () const noexcept
BoxNearX (Valtype val) noexcept
 Sets the near X dimension value of this Box.
BoxNearY (Valtype val) noexcept
 Sets the near Y dimension value of this Box.
BoxNearZ (Valtype val) noexcept
 Sets the near Z dimension value of this Box.
BoxFarX (Valtype val) noexcept
 Sets the far X dimension value of this Box.
BoxFarY (Valtype val) noexcept
 Sets the far Y dimension value of this Box.
BoxFarZ (Valtype val) noexcept
 Sets the far Z dimension value of this Box.
Valtype EdgeX () const noexcept
BoxEdgeX (Valtype width) noexcept
 Sets the width of the edge by centering it around 0.
Valtype EdgeY () const noexcept
BoxEdgeY (Valtype width) noexcept
 Sets the width of the edge by centering it around 0.
Valtype EdgeZ () const noexcept
BoxEdgeZ (Valtype width) noexcept
 Sets the width of the edge by centering it around 0.
auto Volume () const noexcept -> decltype(Valtype{} *Valtype{} *Valtype{})
Vector< Valtype > Diagonal () const noexcept
Position< Valtype > Center () const noexcept
BoxUnion (const Box &b1, const Box &b2) noexcept
 Calculates the union of the two Boxes.
BoxUnion (const Box &box) noexcept
 Calculates the union of this and rect.
bool Includes (Valtype x, Valtype y, Valtype z) const noexcept
bool Includes (const Position< Valtype > &pt) const noexcept
BoxExpand (Valtype x, Valtype y, Valtype z) noexcept
 Expands the box so that it touches (being included or laying on border) the point.
BoxExpand (const Position< Valtype > &pt) noexcept
 Expands the box so that it touches (being included or laying on border) the point.
BoxInflate (Valtype dx, Valtype dy, Valtype dz) noexcept
 Moves the edges to the outside of the box, thereyby inflating it.
BoxDeflate (Valtype dx, Valtype dy, Valtype dz) noexcept
 Moves the edges to the inward side of the box, thereyby deflating it.
BoxMove (const Vector< Valtype > &dPos) noexcept
 Moves the box by dPos.
BoxRound (int toDigit) noexcept
 Rounds the boxes values to a certain digit after the point.
Construction
Parameters
xext
yext
zext
cuboid
xnear
ynear
znear
xfar
yfar
zfar
nearCorner
farCorner
 Box () noexcept=default
 Does not initialize the members.
 Box (Valtype xext, Valtype yext, Valtype zext) noexcept
 Does not initialize the members.
 Box (const Vector< Valtype > &cuboid) noexcept
 Does not initialize the members.
 Box (Valtype xnear, Valtype ynear, Valtype znear, Valtype xfar, Valtype yfar, Valtype zfar) noexcept
 Does not initialize the members.
 Box (const Position< Valtype > &nearCorner, const Position< Valtype > &farCorner) noexcept
 Does not initialize the members.

Public Attributes

common::Interval< Valtype > m_WidthX
 width
common::Interval< Valtype > m_WidthY
 depth
common::Interval< Valtype > m_WidthZ
 height

Detailed Description

template<typename Valtype>
struct spat::Box< Valtype >

Axis aligned box.

Member Function Documentation

◆ Center()

template<typename Valtype>
Position< Valtype > spat::Box< Valtype >::Center ( ) const
inlinenoexcept
Returns
The geometric center of the box.

◆ Deflate()

template<typename Valtype>
Box< Valtype > & spat::Box< Valtype >::Deflate ( Valtype dx,
Valtype dy,
Valtype dz )
inlinenoexcept

Moves the edges to the inward side of the box, thereyby deflating it.

Parameters
dxDistance to move x edges.
dyDistance to move y edges.
dzDistance to move z edges.

◆ Diagonal()

template<typename Valtype>
Vector< Valtype > spat::Box< Valtype >::Diagonal ( ) const
inlinenoexcept
Returns
The diagonal vector.

◆ EdgeX()

template<typename Valtype>
Valtype spat::Box< Valtype >::EdgeX ( ) const
inlinenoexcept
Returns
The length of the edge aligned with the X-axis.

◆ EdgeY()

template<typename Valtype>
Valtype spat::Box< Valtype >::EdgeY ( ) const
inlinenoexcept
Returns
The length of the edge aligned with the Y-axis.

◆ EdgeZ()

template<typename Valtype>
Valtype spat::Box< Valtype >::EdgeZ ( ) const
inlinenoexcept
Returns
The length of the edge aligned with the Z-axis.

◆ Expand() [1/2]

template<typename Valtype>
Box< Valtype > & spat::Box< Valtype >::Expand ( const Position< Valtype > & pt)
inlinenoexcept

Expands the box so that it touches (being included or laying on border) the point.

If the point is allready included in the box, no changes are made. If val becomes m_Far Includes() will not return the value as beeing included.

◆ Expand() [2/2]

template<typename Valtype>
Box< Valtype > & spat::Box< Valtype >::Expand ( Valtype x,
Valtype y,
Valtype z )
inlinenoexcept

Expands the box so that it touches (being included or laying on border) the point.

If the point is allready included in the box, no changes are made. If val becomes m_Far Includes() will not return the value as beeing included.

◆ Far()

template<typename Valtype>
const Position< Valtype > spat::Box< Valtype >::Far ( ) const
inlinenoexcept
Returns
The position of the far corner.

◆ FarX()

template<typename Valtype>
Valtype spat::Box< Valtype >::FarX ( ) const
inlinenoexcept
Returns
The far X dimension value of this Box.

◆ FarY()

template<typename Valtype>
Valtype spat::Box< Valtype >::FarY ( ) const
inlinenoexcept
Returns
The far Y dimension value of this Box.

◆ FarZ()

template<typename Valtype>
Valtype spat::Box< Valtype >::FarZ ( ) const
inlinenoexcept
Returns
The far Z dimension value of this Box.

◆ Includes() [1/2]

template<typename Valtype>
bool spat::Box< Valtype >::Includes ( const Position< Valtype > & pt) const
inlinenoexcept
Returns
True if the point lays inside the box.

The near edges are inside the box; the far edges are not

◆ Includes() [2/2]

template<typename Valtype>
bool spat::Box< Valtype >::Includes ( Valtype x,
Valtype y,
Valtype z ) const
inlinenoexcept
Returns
True if the point lays inside the box.

The near edges are inside the box; the far edges are not

◆ Inflate()

template<typename Valtype>
Box< Valtype > & spat::Box< Valtype >::Inflate ( Valtype dx,
Valtype dy,
Valtype dz )
inlinenoexcept

Moves the edges to the outside of the box, thereyby inflating it.

Parameters
dxDistance to move x edges.
dyDistance to move y edges.
dzDistance to move z edges.

◆ Near()

template<typename Valtype>
const Position< Valtype > spat::Box< Valtype >::Near ( ) const
inlinenoexcept
Returns
The position of the near corner.

◆ NearX()

template<typename Valtype>
Valtype spat::Box< Valtype >::NearX ( ) const
inlinenoexcept
Returns
The near X dimension value of this Box.

◆ NearY()

template<typename Valtype>
Valtype spat::Box< Valtype >::NearY ( ) const
inlinenoexcept
Returns
The near Y dimension value of this Box.

◆ NearZ()

template<typename Valtype>
Valtype spat::Box< Valtype >::NearZ ( ) const
inlinenoexcept
Returns
The near Z dimension value of this Box.

◆ Volume()

template<typename Valtype>
auto spat::Box< Valtype >::Volume ( ) const->decltype(Valtype{} *Valtype{} *Valtype{})
inlinenoexcept
Returns
The volume of the box.

The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/spat/Box.h