WMesh class. More...

Inheritance diagram for WMesh:

Classes

struct  Material
 Material properties. More...
 
struct  Mesh
 Mesh struct. More...
 
struct  Triangle
 Triangle struct. More...
 
struct  Vertex
 Vertex struct. More...
 

Public Member Functions

 WMesh (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity())
 Create a WMesh. More...
 
virtual ~WMesh ()
 Destroy this object. More...
 
WObjectattachedTo ()
 Return the attached WObject (NULL is there isn't) More...
 
void attachTo (WObject *obj)
 Attach to the WObject specified,. More...
 
bool loadMS3DModel (QString filename)
 Load the mesh from a MS3D file (MilkShape-3D) More...
 
Materialmaterials ()
 Return Materials (for now are ignored during rendering) More...
 
int materialsCount ()
 Number of materials. More...
 
Meshmeshes ()
 Return Meshes. More...
 
int meshesCount ()
 Number of meshes. More...
 
Triangletriangles ()
 Return Triangles composing the mesh. More...
 
int trianglesCount ()
 Number of triangles. More...
 
Vertexvertices ()
 Return Vertices composing the triangles of the mesh. More...
 
int verticesCount ()
 Number of vertices. More...
 
- 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 More...
 
virtual ~WObject ()
 destroy the Object and drop it from the world More...
 
QColor color () const
 return the color of this object More...
 
void drawLocalAxes (bool d)
 Sets whether the object local frame of reference should be drawn or not. More...
 
bool isInvisible () const
 return if it is invisible More...
 
const QString & label () const
 Returns the text label to render along with the object. More...
 
const QColor & labelColor () const
 Returns the color of the label. More...
 
const wVectorlabelPosition () const
 Returns the label position relative to this object. More...
 
bool labelShown () const
 Returns whether the label is shown or not. More...
 
bool localAxesDrawn () const
 Returns true if the local frame of refecence of the object should be drawn. More...
 
const wMatrixmatrix () const
 return a reference to the transformation matrix More...
 
QString name () const
 Return the name of this object. More...
 
virtual void postUpdate ()
 postUpdate the WObject this method is called at each step of the world just after the physic update More...
 
virtual void preUpdate ()
 preUpdate the WObject this method is called at each step of the world just before the physic update More...
 
void setAlpha (int alpha)
 set the value of alpha channel (the transparency) More...
 
void setColor (QColor c)
 Set the color to use on rendering. More...
 
void setInvisible (bool b)
 set invisibility More...
 
void setLabel (QString label)
 Sets a text label to render along with the object. More...
 
void setLabel (QString label, wVector pos)
 Sets a text label to render along with the object and its position. More...
 
void setLabel (QString label, wVector pos, QColor color)
 Sets a text label to render along with the object and its position and color. More...
 
void setLabelColor (const QColor &color)
 Sets the color of the label. More...
 
void setLabelPosition (const wVector &pos)
 Sets the label position relative to this object. More...
 
void setMatrix (const wMatrix &newm)
 set a new matrix More...
 
void setPosition (const wVector &newpos)
 set the position specified in global coordinate frame More...
 
void setPosition (real x, real y, real z)
 set the position specified in global coordinate frame More...
 
void setTexture (QString textureName)
 Set the texture to use for this WObject when rendered. More...
 
void setUseColorTextureOfOwner (bool b)
 set if the object will be rendered with the color and texture of our owner (if we have one) More...
 
void showLabel (bool show)
 Sets whether to show the label or not. More...
 
QString texture () const
 Return the texture name. More...
 
bool useColorTextureOfOwner () const
 if true, we will use color and texture of our owner (if we have one) More...
 
Worldworld ()
 Return the world. More...
 
const Worldworld () const
 Return the world (const version) More...
 
- Public Member Functions inherited from Ownable
 Ownable ()
 Constructor. More...
 
virtual ~Ownable ()
 Destructor. More...
 
const QList< Owned > & owned () const
 Returns the list of objects owned by this one. More...
 
Ownableowner () const
 Returns the owner of this object. More...
 
void setOwner (Ownable *owner, bool destroy=true)
 Sets the owner of this object. More...
 

Additional Inherited Members

- Public Types inherited from Ownable
typedef QList< OwnedOwnedList
 The type for the list of owned objects. More...
 
- Protected Member Functions inherited from WObject
virtual void changedMatrix ()
 virtual function called when the transformation matrix change More...
 
- Protected Attributes inherited from WObject
QColor colorv
 Color, it contains also alpha channel. More...
 
bool invisible
 if TRUE it will not renderized More...
 
QColor labelcol
 The color of the label. More...
 
bool labeldrawn
 Whether the label should be rendered or not. More...
 
wVector labelpos
 The position of the label in the object frame of reference. More...
 
QString labelv
 The text label of the object. More...
 
bool localFrameOfReferenceDrawn
 If true, the local frame of reference of the object is drawn. More...
 
QString namev
 Name of the WObject. More...
 
QString texturev
 Texture name. More...
 
wMatrix tm
 Trasformation matrix. More...
 
bool usecolortextureofowner
 if true, we will use color and texture of our owner (if we have one). More...
 
Worldworldv
 World. More...
 

Detailed Description

WMesh class.

\

Motivation
WMesh represent a 3D shape using a triangle mesh. It is just for graphic purpose, but it is subclass of WObject and it is contained into a World for share it amongs WCameras and for attach it to other object (like iCub's cover)
Description
Warnings
Warnings

Definition at line 41 of file wmesh.h.

Constructor & Destructor Documentation

WMesh ( World world,
QString  name = "unamed",
const wMatrix tm = wMatrix::identity() 
)

Create a WMesh.

Parameters
worldThe World which object will be inserted
tmrotation and position at the moment of creation

Definition at line 99 of file wmesh.cpp.

~WMesh ( )
virtual

Destroy this object.

Definition at line 113 of file wmesh.cpp.

Member Function Documentation

WObject* attachedTo ( )
inline

Return the attached WObject (NULL is there isn't)

Definition at line 58 of file wmesh.h.

void attachTo ( WObject obj)

Attach to the WObject specified,.

Note
when WMesh is attached to a WObject, the WMesh matrix is considered as the offset matrix respect to the matrix of WObject attached

Definition at line 140 of file wmesh.cpp.

bool loadMS3DModel ( QString  filename)

Load the mesh from a MS3D file (MilkShape-3D)

Definition at line 144 of file wmesh.cpp.

Material* materials ( )
inline

Return Materials (for now are ignored during rendering)

Definition at line 94 of file wmesh.h.

int materialsCount ( )
inline

Number of materials.

Definition at line 98 of file wmesh.h.

Mesh* meshes ( )
inline

Return Meshes.

Definition at line 86 of file wmesh.h.

int meshesCount ( )
inline

Number of meshes.

Definition at line 90 of file wmesh.h.

Triangle* triangles ( )
inline

Return Triangles composing the mesh.

Definition at line 102 of file wmesh.h.

int trianglesCount ( )
inline

Number of triangles.

Definition at line 106 of file wmesh.h.

Vertex* vertices ( )
inline

Return Vertices composing the triangles of the mesh.

Definition at line 110 of file wmesh.h.

int verticesCount ( )
inline

Number of vertices.

Definition at line 114 of file wmesh.h.


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