The subclass of PhyObject2DWrapper wrapping a box. More...

Inheritance diagram for Box2DWrapper:

Public Member Functions

const wVector & centerOnPlane () const
 Returns the coordinates of the center of the box on the plane in the global frame of reference.
 
virtual void computeLinearViewFieldOccupiedRange (const wMatrix &cameraMtr, double &minAngle, double &maxAngle, double &distance) const
 Computes the portion of a linear the view field occupied by this object.
 
virtual PhyBoxphyObject ()
 Returns a pointer to the wrapper PhyObject.
 
virtual const PhyBoxphyObject () const
 Returns a pointer to the wrapper PhyObject (const version)
 
virtual void setPosition (real x, real y)
 Sets the position of the object in the plane.
 
virtual void setStatic (bool s)
 Sets whether the object is static or not.
 
virtual Type type () const
 Returns the type of this wrapped object.
 
const wVector & vertex (int i) const
 Returns the coordinates of the i-th vertex of the box on the plane in the global frame of reference.
 
- Public Member Functions inherited from PhyObject2DWrapper
QColor color () const
 Returns the color to use when rendering this.
 
bool getStatic () const
 Returns true if the object is static.
 
wVector position () const
 Returns the position of the object.
 
void setColor (QColor color)
 Sets the color to use when rendering this.
 
void setPosition (wVector pos)
 Sets the position of the object in the plane.
 
void setTexture (QString textureName)
 Set the texture to use when rendering this.
 
void setUseColorTextureOfOwner (bool b)
 Sets whether this will be rendered with the color and texture of our owner (if we have one)
 
QString texture () const
 Returns the name of the texture.
 
bool useColorTextureOfOwner () const
 Returns whether this will be rendered with the color and texture of the owner (if we have one)
 

Protected Member Functions

 Box2DWrapper (PhyBox *box, Type type)
 Constructor.
 
 ~Box2DWrapper ()
 Destructor.
 
- Protected Member Functions inherited from PhyObject2DWrapper
 PhyObject2DWrapper ()
 Constructor.
 
virtual ~PhyObject2DWrapper ()
 Destructor.
 

Friends

class Arena
 The Arena class is friend to be able to instantiate and delete this class.
 

Additional Inherited Members

- Public Types inherited from PhyObject2DWrapper
enum  Type {
  Plane = 0, Wall, Box, RectangularTargetArea,
  Cylinder, SmallCylinder, BigCylinder, CircularTargetArea,
  NumberOfDifferentTypes
}
 The possible type of wrapped objects. More...
 

Detailed Description

The subclass of PhyObject2DWrapper wrapping a box.

Definition at line 235 of file wheeledexperimenthelper.h.

Constructor & Destructor Documentation

Box2DWrapper ( PhyBox box,
Type  type 
)
protected

Constructor.

Parameters
boxthe box to wrap
typethe type of box. This can only be one of Plane, Wall, Box, RectangularTargetArea. This can only be made non-static if the type is Box. This can only be moved if the type is Box of RectangularTargetArea

Definition at line 157 of file wheeledexperimenthelper.cpp.

References PhyBox::setStatic().

~Box2DWrapper ( )
protected

Destructor.

Definition at line 169 of file wheeledexperimenthelper.cpp.

Member Function Documentation

const wVector& centerOnPlane ( ) const
inline

Returns the coordinates of the center of the box on the plane in the global frame of reference.

Returns
the coordinates of the center of the box on the plane in the global frame of reference

Definition at line 324 of file wheeledexperimenthelper.h.

void computeLinearViewFieldOccupiedRange ( const wMatrix cameraMtr,
double &  minAngle,
double &  maxAngle,
double &  distance 
) const
virtual

Computes the portion of a linear the view field occupied by this object.

This function returns the angular range occupied by this object on a linear camera described by the given matrix. The Z axis of the matrix is the upvector, the camera lies on the XY plane and points towars the X axis (i.e. angles start from the X axis). If the object is not visible by the camera, this function returns a negative distance. The min angle can be greater than the max angle if the object is behind the camera. Here we make the assumption that the camera is outside the box (otherwise the algorithm gives wrong results). The matrix representing the camera is translated so that it is on the same plane as the vertexes of the box before doing computations

Parameters
cameraMtrthe matrix describing the camera (see function description)
minAnglethis is set to the minimum angle of the view field occupied by the object
maxAnglethis is set to the maximum angle of the view field occupied by the object
distancethis is set to the distance of the object from the camera. It is negative if the object is not visible by the camera

Implements PhyObject2DWrapper.

Definition at line 220 of file wheeledexperimenthelper.cpp.

References PhyBox::matrix(), wVectorT< Shared >::scale(), wMatrix::w_pos, wVectorT< Shared >::z, and wMatrix::z_ax.

PhyBox * phyObject ( )
virtual

Returns a pointer to the wrapper PhyObject.

You should avoid changing the PhyObject directly, use the methods of this class, instead

Returns
a pointer to the wrapper PhyObject

Implements PhyObject2DWrapper.

Definition at line 174 of file wheeledexperimenthelper.cpp.

Referenced by Arena::createRectangularTargetArea(), Arena::createWall(), MarXbot::orientation(), Epuck::orientation(), RobotOnPlane::orientationOnPlane(), RobotOnPlane::positionOnPlane(), Box2DWrapper::setPosition(), and Box2DWrapper::setStatic().

const PhyBox * phyObject ( ) const
virtual

Returns a pointer to the wrapper PhyObject (const version)

Returns
a const pointer to the wrapper PhyObject

Implements PhyObject2DWrapper.

Definition at line 179 of file wheeledexperimenthelper.cpp.

void setPosition ( real  x,
real  y 
)
virtual

Sets the position of the object in the plane.

Whether this can be moved or not depends on the type of box

Parameters
xthe new x coordinate
ythe new y coordinate

Implements PhyObject2DWrapper.

Definition at line 199 of file wheeledexperimenthelper.cpp.

References PhyBox::matrix(), Box2DWrapper::phyObject(), wVectorT< Shared >::scale(), PhyBox::setPosition(), PhyBox::sideZ(), wMatrix::w_pos, wVectorT< Shared >::x, and wMatrix::z_ax.

void setStatic ( bool  s)
virtual

Sets whether the object is static or not.

Whether this can be made static or not depends on the type of box

Parameters
sif true the object will be static

Reimplemented from PhyObject2DWrapper.

Definition at line 189 of file wheeledexperimenthelper.cpp.

References Box2DWrapper::phyObject(), and PhyBox::setStatic().

Box2DWrapper::Type type ( ) const
virtual

Returns the type of this wrapped object.

Returns
the type of this wrapped object

Implements PhyObject2DWrapper.

Definition at line 184 of file wheeledexperimenthelper.cpp.

const wVector& vertex ( int  i) const
inline

Returns the coordinates of the i-th vertex of the box on the plane in the global frame of reference.

Parameters
ithe index of the vertex, between 0 and 3
Returns
the coordinates of the i-th vertex of the box on the plane in the global frame of reference.

Definition at line 312 of file wheeledexperimenthelper.h.

Friends And Related Function Documentation

friend class Arena
friend

The Arena class is friend to be able to instantiate and delete this class.

Definition at line 380 of file wheeledexperimenthelper.h.


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