vcg::Box< N, S > Class Template Reference
[Space]
#include <box.h>
List of all members.
Detailed Description
template<int N, class S>
class vcg::Box< N, S >
Templated class for 3D boxes. This is the class for definition of a axis aligned box in 2D or 3D space. Typically used as bounding boxes. It is stored just as two Points (at the opposite vertices).
- Parameters:
-
| S | (template parameter) Specifies the type of scalar used to represent coords. |
Definition at line 66 of file box.h.
Member Typedef Documentation
Definition at line 70 of file box.h.
the type used as scalar. Typically, float or double, but char or int are possible too.
Reimplemented from vcg::Space< N, S >.
Definition at line 69 of file box.h.
Member Enumeration Documentation
- Enumerator:
-
Definition at line 72 of file box.h.
Constructor & Destructor Documentation
The box constructor.
Definition at line 89 of file box.h.
Min Max constructor.
Definition at line 95 of file box.h.
The box distructor.
Definition at line 97 of file box.h.
Member Function Documentation
Add a point to a box. The box is modified is the added point is aoutside it.
- Parameters:
-
Definition at line 160 of file box.h.
template<int N, class S>
void vcg::Box< N, S >::Add |
( |
Box< N, S > const & |
b |
) |
[inline] |
Add two boxex: Returns minimal box that contains both operands.
- Parameters:
-
Definition at line 150 of file box.h.
template<int N, class S>
S vcg::Box< N, S >::Area |
( |
|
) |
const [inline] |
Calcola il centro del box.
Definition at line 264 of file box.h.
template<int N, class S>
bool vcg::Box< N, S >::Collide |
( |
Box< N, S > const & |
b |
) |
[inline] |
TODO: Move TO COLLIDE!!! Verifica se due box collidono cioe' se hanno una intersezione non vuota. Per esempio due box adiacenti non collidono.
- Parameters:
-
- Returns:
- True se collidoo, false altrimenti
Definition at line 239 of file box.h.
template<int N, class S>
template<int N0, class S0 >
static Box vcg::Box< N, S >::Construct |
( |
const Box< N0, S0 > & |
b |
) |
[inline, static] |
constructs a new ray importing it from an existing one
Definition at line 367 of file box.h.
template<int N, class S>
S vcg::Box< N, S >::Diag |
( |
|
) |
const [inline] |
Restituisce la lunghezza della diagonale del box.
Definition at line 254 of file box.h.
Returns local coords expressed in [0..1]^3 of a point in 3D.
Definition at line 277 of file box.h.
template<int N, class S>
template<int N0, class S0 >
void vcg::Box< N, S >::Import |
( |
const Box< N0, S0 > & |
b |
) |
[inline] |
imports the box
Definition at line 362 of file box.h.
Enlarges the box dimensions by a fixed delta.
- Parameters:
-
| delta | Point in D space. If delta > 0 box enlarges. If delta < 0 box reduces. |
Definition at line 129 of file box.h.
template<int N, class S>
void vcg::Box< N, S >::Inflate |
( |
const S |
s |
) |
[inline] |
Infaltes the box of a percentage..
- Parameters:
-
| s | Scalar value. E.g if s=0.1 the box enlarges of 10% in every direction if S==0.5 box doubles (+50% in every direction) if S < 0 box shrinks if S==0.5 box reduces to a point |
Definition at line 114 of file box.h.
template<int N, class S>
void vcg::Box< N, S >::InflateFix |
( |
const S |
s |
) |
[inline] |
Enlarges the box dimensions by k in every direction, with k = bbox.diag*s
Definition at line 120 of file box.h.
template<int N, class S>
void vcg::Box< N, S >::Intersect |
( |
const Box< N, S > & |
b |
) |
[inline] |
Coputes intersection of Boxes: the minimal box containing both operands.
- Parameters:
-
Definition at line 178 of file box.h.
template<int N, class S>
bool vcg::Box< N, S >::IsEmpty |
( |
|
) |
const [inline] |
Controlla se il box e' vuoto.
- Returns:
- True se il box e' vuoto, false altrimenti
Definition at line 252 of file box.h.
Check wheter a point is inside box.
- Parameters:
-
- Returns:
- True if inside, false otherwise
Definition at line 203 of file box.h.
Check wheter a point is inside box, open at left and closed at right [min..max)
- Parameters:
-
- Returns:
- True if inside, false otherwise
Definition at line 219 of file box.h.
template<int N, class S>
bool vcg::Box< N, S >::IsNull |
( |
|
) |
const [inline] |
Controlla se il box e' nullo.
- Returns:
- True se il box e' nullo, false altrimenti
Definition at line 248 of file box.h.
Returns global coords of a local point expressed in [0..1]^3.
Definition at line 270 of file box.h.
Definition at line 84 of file box.h.
Definition at line 83 of file box.h.
Definition at line 86 of file box.h.
Definition at line 85 of file box.h.
template<int N, class S>
bool vcg::Box< N, S >::operator!= |
( |
Box< N, S > const & |
p |
) |
const [inline] |
Operator to dispare two boxes.
Definition at line 104 of file box.h.
template<int N, class S>
Box vcg::Box< N, S >::operator* |
( |
const S |
s |
) |
const [inline] |
template<int N, class S>
Box& vcg::Box< N, S >::operator*= |
( |
const S |
s |
) |
[inline] |
template<int N, class S>
Box vcg::Box< N, S >::operator+ |
( |
Box< N, S > const & |
p |
) |
const [inline] |
template<int N, class S>
Box vcg::Box< N, S >::operator- |
( |
Box< N, S > const & |
p |
) |
const [inline] |
template<int N, class S>
Box vcg::Box< N, S >::operator/ |
( |
const S |
s |
) |
const [inline] |
template<int N, class S>
Box& vcg::Box< N, S >::operator/= |
( |
const S |
s |
) |
[inline] |
template<int N, class S>
bool vcg::Box< N, S >::operator== |
( |
Box< N, S > const & |
p |
) |
const [inline] |
Operator to compare two boxes.
Definition at line 99 of file box.h.
Initializing the box.
Definition at line 135 of file box.h.
template<int N, class S>
void vcg::Box< N, S >::SetNull |
( |
|
) |
[inline] |
Set the box to a null value.
Definition at line 140 of file box.h.
Compute box size.
Definition at line 295 of file box.h.
template<int N, class S>
S vcg::Box< N, S >::SizeX |
( |
|
) |
const [inline] |
Compute box size X.
Definition at line 300 of file box.h.
template<int N, class S>
S vcg::Box< N, S >::SizeY |
( |
|
) |
const [inline] |
Compute box size Y.
Definition at line 302 of file box.h.
template<int N, class S>
S vcg::Box< N, S >::SizeZ |
( |
|
) |
const [inline] |
Compute box size Z.
Definition at line 304 of file box.h.
template<int N, class S>
S vcg::Box< N, S >::SquaredDiag |
( |
|
) |
const [inline] |
Calcola il quadrato della diagonale del box.
Definition at line 259 of file box.h.
Traslalate the box.
- Parameters:
-
| p,: | the translation vector |
Definition at line 194 of file box.h.
Computes the Volume for the box.
Definition at line 285 of file box.h.
template<int N, class S>
void vcg::Box< N, S >::Zero |
( |
|
) |
[inline] |
sets a point to Zero
Definition at line 310 of file box.h.
Member Data Documentation
_max coordinate point
Definition at line 79 of file box.h.
The scalar type.
_min coordinate point
Definition at line 77 of file box.h.
The documentation for this class was generated from the following file: