WCamera Class Reference

WCamera class. More...

Inheritance diagram for WCamera:

Public Member Functions

 WCamera (World *world, QString name, WObject *attachTo, unsigned int width=200, unsigned int height=200)
 Construct a WCamera the point of view is positioned at 'attachTo' position and orientated as the Z axis of the 'attachTo' object.
 
 WCamera (World *world, QString name, unsigned int width=200, unsigned int height=200, const wMatrix &tm=wMatrix::identity())
 Construct a WCamera the point of view is positioned at 'attachTo' position and orientated as the Z axis of the 'attachTo' object.
 
 ~WCamera ()
 Destructor.
 
WObjectattachedTo ()
 Return the object on which the WCamera is attached on.
 
yarp::dev::IFrameGrabberImage * getFrameGrabber ()
 Returns the YARP frame grabber object.
 
virtual void postUpdate ()
 update the WCamera generating a new frame
 
virtual void preUpdate ()
 PreUpdate operations.
 
- Public Member Functions inherited from YarpObject
 YarpObject (World *world, QString name, const wMatrix &tm=wMatrix::identity())
 Create a YarpObject; The name is mandatory because it is used as root name for each devices of this object.
 
virtual ~YarpObject ()
 Destroy the YarpObject.
 
yarp::dev::PolyDriver * polydriver (QString name)
 return the PolyDriver with the given name associated to it
 
- Public Member Functions inherited from WObject
 WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true)
 create the object and automatically put this into the world
 
virtual ~WObject ()
 destroy the Object and drop it from the world
 
QColor color () const
 return the color of this object
 
bool isInvisible ()
 return if it is invisible
 
const wMatrixmatrix () const
 return a reference to the transformation matrix
 
QString name () const
 Return the name of this object.
 
void setAlpha (int alpha)
 set the value of alpha channel (the transparency)
 
void setColor (QColor c)
 Set the color to use on rendering.
 
void setInvisible (bool b)
 set invisibility
 
void setMatrix (const wMatrix &newm)
 set a new matrix
 
void setPosition (const wVector &newpos)
 set the position specified in global coordinate frame
 
void setPosition (real x, real y, real z)
 set the position specified in global coordinate frame
 
void setTexture (QString textureName)
 Set the texture to use for this WObject when rendered.
 
void setUseColorTextureOfOwner (bool b)
 set if the object will be rendered with the color and texture of our owner (if we have one)
 
QString texture () const
 Return the texture name.
 
bool useColorTextureOfOwner () const
 if true, we will use color and texture of our owner (if we have one)
 
Worldworld ()
 Return the world.
 
const Worldworld () const
 Return the world (const version)
 
- Public Member Functions inherited from Ownable
 Ownable ()
 Constructor.
 
virtual ~Ownable ()
 Destructor.
 
const QList< Owned > & owned () const
 Returns the list of objects owned by this one.
 
Ownableowner () const
 Returns the owner of this object.
 
void setOwner (Ownable *owner, bool destroy=true)
 Sets the owner of this object.
 

Additional Inherited Members

- Public Types inherited from Ownable
typedef QList< OwnedOwnedList
 The type for the list of owned objects.
 
- Protected Member Functions inherited from YarpObject
void registerServerControlBoard (yarp::dev::DeviceDriver *device, QString devicename)
 Add a DeviceDriver to the map of controllers
It automatically construct a ServerControlBoard, the port name for accessing the DeviceDriver will be /worldname/yarpobjectname/devicename.
 
void registerServerFrameGrabber (yarp::dev::DeviceDriver *device, QString devicename)
 Add a DeviceDriver to the map of controllers
It automatically construct a ServerFrameGrabber, the port name for accessing the DeviceDriver will be /worldname/yarpobjectname/devicename.
 
void removeServerControlBoard (QString devicename)
 Remove, and close the serverControlBoard registered and opened by above call.
 
- Protected Attributes inherited from WObject
QColor colorv
 Color, it contains also alpha channel.
 
bool invisible
 if TRUE it will not renderized
 
QString namev
 Name of the WObject.
 
QString texturev
 Texture name.
 
wMatrix tm
 Trasformation matrix.
 
bool usecolortextureofowner
 if true, we will use color and texture of our owner (if we have one).
 
Worldworldv
 World.
 

Detailed Description

WCamera class.

\

Motivation
The WCamera represent a camera.
Description
The images are sended via YARP port and they can be viewed as an image YARP image viewer.
Warnings
Warnings

Definition at line 109 of file wcamera.h.

Constructor & Destructor Documentation

WCamera ( World world,
QString  name,
WObject attachTo,
unsigned int  width = 200,
unsigned int  height = 200 
)

Construct a WCamera the point of view is positioned at 'attachTo' position and orientated as the Z axis of the 'attachTo' object.

Parameters
worldis the world that WCamera show to you
nameof the camera, this is mandatory because it will be used as the YARP port name
attachTois the WObject which this WCamera is mounted
widthis the pixel width of image produced by WCamera
heightis the pixel height of image produce by WCamera

Definition at line 163 of file wcamera.cpp.

References WObject::matrix(), WObject::name(), WObject::setColor(), WObject::setMatrix(), RenderWObjectContainer::setWorld(), and WObject::world().

WCamera ( World world,
QString  name,
unsigned int  width = 200,
unsigned int  height = 200,
const wMatrix tm = wMatrix::identity() 
)

Construct a WCamera the point of view is positioned at 'attachTo' position and orientated as the Z axis of the 'attachTo' object.

Parameters
worldis the world that WCamera show to you
nameof the camera, this is mandatory because it will be used as the YARP port name
widthis the pixel width of image produced by WCamera
heightis the pixel height of image produce by WCamera
tmrotation and position at the moment of creation

Definition at line 182 of file wcamera.cpp.

References WObject::name(), WObject::setMatrix(), RenderWObjectContainer::setWorld(), and WObject::world().

~WCamera ( )

Destructor.

Definition at line 200 of file wcamera.cpp.

Member Function Documentation

WObject* attachedTo ( )
inline

Return the object on which the WCamera is attached on.

Definition at line 141 of file wcamera.h.

yarp::dev::IFrameGrabberImage* getFrameGrabber ( )
inline

Returns the YARP frame grabber object.

Definition at line 145 of file wcamera.h.

Referenced by PhyiCub::leftEyeFrameGrabber(), and PhyiCub::rightEyeFrameGrabber().

void postUpdate ( )
virtual

update the WCamera generating a new frame

Note
I don't know if it's necessary to implement this, because doesn't matter if the World is changed or not, the WCamera should always generate 60 frame per seconds in real-time

Reimplemented from WObject.

Definition at line 210 of file wcamera.cpp.

References RenderCamera::paintGL().

void preUpdate ( )
virtual

PreUpdate operations.

Reimplemented from WObject.

Definition at line 204 of file wcamera.cpp.

References WObject::setMatrix().


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