Public Types | Public Member Functions | Public Attributes
vcg::Box2< BoxScalarType > Class Template Reference

#include <box2.h>

List of all members.

Public Types

typedef Point2< BoxScalarType > PointType
typedef BoxScalarType ScalarType
 The scalar type.

Public Member Functions

void Add (Box2 const &b)
void Add (const PointType &p)
ScalarType Area () const
 Computes area.
 Box2 ()
 Standard constructor.
 Box2 (const Box2 &b)
 Copy constructor.
 Box2 (const Point2< BoxScalarType > &mi, const Point2< BoxScalarType > &ma)
 Min Max constructor.
 Box2 (const Point2< BoxScalarType > &center, const BoxScalarType &radius)
PointType Center () const
 Computes box center.
bool Collide (Box2 const &b)
ScalarType Diag () const
 Computes length of diagonal.
PointType Dim () const
 Computes sizes (as a vector)
ScalarType DimX () const
 computes dimension on X axis.
ScalarType DimY () const
 computes dimension on Y axis.
PointType GlobalToLocal (PointType const &p) const
 Returns local coords expressed in [0..1]^2 of a point in R^2.
void Intersect (const Box2 &b)
bool IsEmpty () const
bool IsIn (PointType const &p) const
bool IsInEx (PointType const &p) const
bool IsNull () const
bool IsValid () const
PointType LocalToGlobal (PointType const &p) const
 Returns global coords of a local point expressed in [0..1]^2.
void MakeSquare ()
 Turns the bounding box into a square (conservatively)
void Normalize (PointType &p)
 Deprecated: use GlobalToLocal.
void Offset (const ScalarType s)
void Offset (const PointType &delta)
bool operator== (Box2 const &p) const
 Operator to compare two bounding box.
Point2< BoxScalarType > P (const int &i) const
void Set (const PointType &p)
 Initializing the bounding box with a point.
void Set (ScalarType minx, ScalarType miny, ScalarType maxx, ScalarType maxy)
void SetNull ()
 Set the bounding box to a null value.
void Translate (const PointType &p)
 ~Box2 ()
 Distructor.

Public Attributes

PointType max
 max coordinate point
PointType min
 min coordinate point

Detailed Description

template<class BoxScalarType>
class vcg::Box2< BoxScalarType >

Templated class for a 2D bounding box. It is stored just as two Point2

Parameters:
BoxScalarType(Template Parameter) Specifies the scalar field.

Definition at line 45 of file box2.h.


Member Typedef Documentation

template<class BoxScalarType>
typedef Point2<BoxScalarType> vcg::Box2< BoxScalarType >::PointType

Definition at line 50 of file box2.h.

template<class BoxScalarType>
typedef BoxScalarType vcg::Box2< BoxScalarType >::ScalarType

The scalar type.

Definition at line 49 of file box2.h.


Constructor & Destructor Documentation

template<class BoxScalarType>
vcg::Box2< BoxScalarType >::Box2 ( ) [inline]

Standard constructor.

Definition at line 57 of file box2.h.

template<class BoxScalarType>
vcg::Box2< BoxScalarType >::Box2 ( const Box2< BoxScalarType > &  b) [inline]

Copy constructor.

Definition at line 59 of file box2.h.

template<class BoxScalarType>
vcg::Box2< BoxScalarType >::Box2 ( const Point2< BoxScalarType > &  mi,
const Point2< BoxScalarType > &  ma 
) [inline]

Min Max constructor.

Definition at line 61 of file box2.h.

template<class BoxScalarType>
vcg::Box2< BoxScalarType >::Box2 ( const Point2< BoxScalarType > &  center,
const BoxScalarType &  radius 
) [inline]

Definition at line 63 of file box2.h.

template<class BoxScalarType>
vcg::Box2< BoxScalarType >::~Box2 ( ) [inline]

Distructor.

Definition at line 69 of file box2.h.


Member Function Documentation

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Add ( Box2< BoxScalarType > const &  b) [inline]

Function to add two bounding box the bounding box expand to include the other bounding box (if necessary)

Parameters:
bThe bounding box to be added

Definition at line 105 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Add ( const PointType p) [inline]

Adds a point to the bouning box. the bounding box expand to include the new point (if necessary)

Parameters:
pThe point 2D

Definition at line 125 of file box2.h.

template<class BoxScalarType>
ScalarType vcg::Box2< BoxScalarType >::Area ( ) const [inline]

Computes area.

Definition at line 236 of file box2.h.

template<class BoxScalarType>
PointType vcg::Box2< BoxScalarType >::Center ( ) const [inline]

Computes box center.

Definition at line 231 of file box2.h.

template<class BoxScalarType>
bool vcg::Box2< BoxScalarType >::Collide ( Box2< BoxScalarType > const &  b) [inline]

Check bbox collision. Note: just adjiacent bbox won't collide

Parameters:
bA bounding box
Returns:
True iff collision

Definition at line 204 of file box2.h.

template<class BoxScalarType>
ScalarType vcg::Box2< BoxScalarType >::Diag ( ) const [inline]

Computes length of diagonal.

Definition at line 226 of file box2.h.

template<class BoxScalarType>
PointType vcg::Box2< BoxScalarType >::Dim ( ) const [inline]

Computes sizes (as a vector)

Definition at line 246 of file box2.h.

template<class BoxScalarType>
ScalarType vcg::Box2< BoxScalarType >::DimX ( ) const [inline]

computes dimension on X axis.

Definition at line 241 of file box2.h.

template<class BoxScalarType>
ScalarType vcg::Box2< BoxScalarType >::DimY ( ) const [inline]

computes dimension on Y axis.

Definition at line 243 of file box2.h.

template<class BoxScalarType>
PointType vcg::Box2< BoxScalarType >::GlobalToLocal ( PointType const &  p) const [inline]

Returns local coords expressed in [0..1]^2 of a point in R^2.

Definition at line 263 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Intersect ( const Box2< BoxScalarType > &  b) [inline]

Computes intersection between this and another bounding box

Parameters:
bThe other bounding box

Definition at line 158 of file box2.h.

template<class BoxScalarType>
bool vcg::Box2< BoxScalarType >::IsEmpty ( ) const [inline]

Check if emptry.

Returns:
True iff empty

Definition at line 223 of file box2.h.

template<class BoxScalarType>
bool vcg::Box2< BoxScalarType >::IsIn ( PointType const &  p) const [inline]

Checks whether a 2D point p is inside the box

Parameters:
pThe point 2D
Returns:
True iff p inside

Definition at line 181 of file box2.h.

template<class BoxScalarType>
bool vcg::Box2< BoxScalarType >::IsInEx ( PointType const &  p) const [inline]

Checks whether a 2D point p is inside the box, closed at min but open at max

Parameters:
pThe point in 2D
Returns:
True iff p inside

Definition at line 192 of file box2.h.

template<class BoxScalarType>
bool vcg::Box2< BoxScalarType >::IsNull ( ) const [inline]

Check if emptry.

Returns:
True iff empty

Definition at line 213 of file box2.h.

template<class BoxScalarType>
bool vcg::Box2< BoxScalarType >::IsValid ( ) const [inline]

Check consistency.

Returns:
True iff consistent

Definition at line 218 of file box2.h.

template<class BoxScalarType>
PointType vcg::Box2< BoxScalarType >::LocalToGlobal ( PointType const &  p) const [inline]

Returns global coords of a local point expressed in [0..1]^2.

Definition at line 257 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::MakeSquare ( ) [inline]

Turns the bounding box into a square (conservatively)

Definition at line 271 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Normalize ( PointType p) [inline]

Deprecated: use GlobalToLocal.

Definition at line 249 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Offset ( const ScalarType  s) [inline]

Varies the dimension of the bounding box.

Parameters:
deltaThe size delta (if positive, box is enlarged)

Definition at line 141 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Offset ( const PointType delta) [inline]

Varies the dimension of the bounding box.

Parameters:
deltaThe size delta per dimension (if positive, box is enlarged)

Definition at line 149 of file box2.h.

template<class BoxScalarType>
bool vcg::Box2< BoxScalarType >::operator== ( Box2< BoxScalarType > const &  p) const [inline]

Operator to compare two bounding box.

Definition at line 71 of file box2.h.

template<class BoxScalarType>
Point2<BoxScalarType> vcg::Box2< BoxScalarType >::P ( const int &  i) const [inline]

Definition at line 81 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Set ( const PointType p) [inline]

Initializing the bounding box with a point.

Definition at line 76 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Set ( ScalarType  minx,
ScalarType  miny,
ScalarType  maxx,
ScalarType  maxy 
) [inline]

Definition at line 89 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::SetNull ( ) [inline]

Set the bounding box to a null value.

Definition at line 97 of file box2.h.

template<class BoxScalarType>
void vcg::Box2< BoxScalarType >::Translate ( const PointType p) [inline]

Traslate the bounding box by a vectore

Parameters:
pThe transolation vector

Definition at line 172 of file box2.h.


Member Data Documentation

template<class BoxScalarType>
PointType vcg::Box2< BoxScalarType >::max

max coordinate point

Definition at line 55 of file box2.h.

template<class BoxScalarType>
PointType vcg::Box2< BoxScalarType >::min

min coordinate point

Definition at line 53 of file box2.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:10