Murl::Math::Box< DataType > Class Template Reference

A box class describing the minimum and maximum coordinate of a 3d-box. More...

#include "murl_math_box.h"

Public Types

typedef DataType ValueType
 The template parameter value type. More...
 

Public Member Functions

 Box ()
 The default constructor.
 
 Box (const Box &b1, const Box &b2)
 Constructor uniting two given boxes. More...
 
 Box (const Vector< DataType > &point)
 Constructor taking a single coordinate. More...
 
 Box (const Vector< DataType > &min, const Vector< DataType > &max)
 Constructor taking minimum and maximum coordinates. More...
 
 Box (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c)
 Constructor taking the three points of a triangle. More...
 
 Box (const Sphere< DataType > &sphere)
 Constructor taking a sphere. More...
 
template<class DataType2 >
 Box (const Box< DataType2 > &b)
 The copy constructor using a box of different type. More...
 
void Clear ()
 Clear the box.
 
void Set (const Box &other)
 Set the coordinates from a box. More...
 
void Set (const Box &b1, const Box &b2)
 Set the coordinates by uniting two given boxes. More...
 
void Set (const Vector< DataType > &point)
 Set the coordinates to a single coordinate. More...
 
void Set (const Vector< DataType > &min, const Vector< DataType > &max)
 Set the minimum and maximum coordinates. More...
 
void Set (const Vector< DataType > &a, const Vector< DataType > &b, const Vector< DataType > &c)
 Set the coordinates by the three points of a triangle. More...
 
void Set (const Sphere< DataType > &sphere)
 Set the coordinates by a sphere. More...
 
void SetMinimum (const Vector< DataType > &min)
 Set the minimum coordinate. More...
 
void SetMaximum (const Vector< DataType > &max)
 Set the maximum coordinate. More...
 
const Vector< DataType > & GetMinimum () const
 Get the minimum coordinate. More...
 
const Vector< DataType > & GetMaximum () const
 Get the maximum coordinate. More...
 
void Unite (const Box &other)
 Unite this box with another box. More...
 
void Include (const Vector< DataType > &point)
 Include a point in this box. More...
 
Bool IsIntersecting (const Box &other) const
 Check if a given box is intersecting this box. More...
 
Bool IsEmpty () const
 Check if a the box is empty. More...
 
UInt32 GetFlags () const
 Get the flags. More...
 
String ToString () const
 Get the string representation of the object. More...
 

Protected Attributes

Vector< DataType > mMin
 The minimum position. More...
 
Vector< DataType > mMax
 The maximum position. More...
 
UInt32 mFlags
 Box flags. More...
 

Detailed Description

template<class DataType>
class Murl::Math::Box< DataType >

A box class describing the minimum and maximum coordinate of a 3d-box.

Member Typedef Documentation

◆ ValueType

template<class DataType>
typedef DataType Murl::Math::Box< DataType >::ValueType

The template parameter value type.

Constructor & Destructor Documentation

◆ Box() [1/6]

template<class DataType>
Murl::Math::Box< DataType >::Box ( const Box< DataType > &  b1,
const Box< DataType > &  b2 
)
inline

Constructor uniting two given boxes.

Parameters
b1The first box.
b2The second box.

◆ Box() [2/6]

template<class DataType>
Murl::Math::Box< DataType >::Box ( const Vector< DataType > &  point)
inline

Constructor taking a single coordinate.

Parameters
pointThe coordinate for minimum and maximum.

◆ Box() [3/6]

template<class DataType>
Murl::Math::Box< DataType >::Box ( const Vector< DataType > &  min,
const Vector< DataType > &  max 
)
inline

Constructor taking minimum and maximum coordinates.

Parameters
minThe minimum coordinate.
maxThe maximum coordinate.

◆ Box() [4/6]

template<class DataType>
Murl::Math::Box< DataType >::Box ( const Vector< DataType > &  a,
const Vector< DataType > &  b,
const Vector< DataType > &  c 
)
inline

Constructor taking the three points of a triangle.

Parameters
aThe first triangle coordinate.
bThe second triangle coordinate.
cThe third triangle coordinate.

◆ Box() [5/6]

template<class DataType>
Murl::Math::Box< DataType >::Box ( const Sphere< DataType > &  sphere)
inline

Constructor taking a sphere.

The box is only approximated and slightly larger than it needs to be.

Parameters
sphereThe sphere to enclose.

◆ Box() [6/6]

template<class DataType>
template<class DataType2 >
Murl::Math::Box< DataType >::Box ( const Box< DataType2 > &  b)
inline

The copy constructor using a box of different type.

Parameters
bThe box to copy.

Member Function Documentation

◆ Set() [1/6]

template<class DataType>
void Murl::Math::Box< DataType >::Set ( const Box< DataType > &  other)
inline

Set the coordinates from a box.

Parameters
otherThe box to copy from.

Referenced by Murl::Math::Box< Real >::Box(), and Murl::Math::Box< Real >::Unite().

◆ Set() [2/6]

template<class DataType>
void Murl::Math::Box< DataType >::Set ( const Box< DataType > &  b1,
const Box< DataType > &  b2 
)
inline

Set the coordinates by uniting two given boxes.

Parameters
b1The first box.
b2The second box.

◆ Set() [3/6]

template<class DataType>
void Murl::Math::Box< DataType >::Set ( const Vector< DataType > &  point)
inline

Set the coordinates to a single coordinate.

Parameters
pointThe coordinate for minimum and maximum.

◆ Set() [4/6]

template<class DataType>
void Murl::Math::Box< DataType >::Set ( const Vector< DataType > &  min,
const Vector< DataType > &  max 
)
inline

Set the minimum and maximum coordinates.

Parameters
minThe minimum coordinate.
maxThe maximum coordinate.

◆ Set() [5/6]

template<class DataType>
void Murl::Math::Box< DataType >::Set ( const Vector< DataType > &  a,
const Vector< DataType > &  b,
const Vector< DataType > &  c 
)
inline

Set the coordinates by the three points of a triangle.

Parameters
aThe first triangle coordinate.
bThe second triangle coordinate.
cThe third triangle coordinate.

◆ Set() [6/6]

template<class DataType>
void Murl::Math::Box< DataType >::Set ( const Sphere< DataType > &  sphere)
inline

Set the coordinates by a sphere.

The box is only approximated and slightly larger than it needs to be.

Parameters
sphereThe sphere to enclose.

◆ SetMinimum()

template<class DataType>
void Murl::Math::Box< DataType >::SetMinimum ( const Vector< DataType > &  min)
inline

Set the minimum coordinate.

Parameters
minThe minimum coordinate.

◆ SetMaximum()

template<class DataType>
void Murl::Math::Box< DataType >::SetMaximum ( const Vector< DataType > &  max)
inline

Set the maximum coordinate.

Parameters
maxThe maximum coordinate.

◆ GetMinimum()

template<class DataType>
const Vector<DataType>& Murl::Math::Box< DataType >::GetMinimum ( ) const
inline

◆ GetMaximum()

template<class DataType>
const Vector<DataType>& Murl::Math::Box< DataType >::GetMaximum ( ) const
inline

◆ Unite()

template<class DataType>
void Murl::Math::Box< DataType >::Unite ( const Box< DataType > &  other)
inline

Unite this box with another box.

Parameters
otherThe other box to unite.

Referenced by Murl::Math::Box< Real >::Box(), and Murl::Math::Box< Real >::Set().

◆ Include()

template<class DataType>
void Murl::Math::Box< DataType >::Include ( const Vector< DataType > &  point)
inline

Include a point in this box.

Parameters
pointThe point to include.

Referenced by Murl::Math::Sphere< Real >::SetBounding().

◆ IsIntersecting()

template<class DataType>
Bool Murl::Math::Box< DataType >::IsIntersecting ( const Box< DataType > &  other) const
inline

Check if a given box is intersecting this box.

Parameters
otherThe other box to check.
Returns
true if the other box is intersecting this box.

◆ IsEmpty()

template<class DataType>
Bool Murl::Math::Box< DataType >::IsEmpty ( ) const
inline

Check if a the box is empty.

A box is only empty when created with the default constructor, explicitly cleared by calling Clear(), or duplicated from another empty box or sphere. As soon as a single point is included, the box is considered "not empty".

Returns
true if the box is empty.

Referenced by Murl::Math::Sphere< Real >::Set(), and Murl::Math::Box< Real >::Unite().

◆ GetFlags()

template<class DataType>
UInt32 Murl::Math::Box< DataType >::GetFlags ( ) const
inline

Get the flags.

Returns
The bit-mask of flags.

◆ ToString()

template<class DataType>
String Murl::Math::Box< DataType >::ToString ( ) const
inline

Get the string representation of the object.

Returns
The string representation of the object.

Member Data Documentation

◆ mMin

◆ mMax

◆ mFlags


The documentation for this class was generated from the following files:
  • murl_graph_types.h
  • murl_math_box.h


Copyright © 2011-2018 Spraylight GmbH.