The class rendering a PhyCylinder. More...

Inheritance diagram for RenderPhyCylinder:

Public Member Functions

 RenderPhyCylinder (WObject *wobj, RenderWObjectContainer *container)
 Constructor.
virtual ~RenderPhyCylinder ()
 Destructor.
virtual void calculateAABB (wVector &minPoint, wVector &maxPoint, const wMatrix tm)
 Computes and returns the AABB of the object.
virtual void calculateOBB (wVector &dimension, wVector &minPoint, wVector &maxPoint)
 Computes and returns the OBB of the object.
virtual void render (QGLContext *gw)
 The function performing the actual rendering.
virtual void renderAABB (RenderWorld *gw)
 Renders only the AABB of the object.
- Public Member Functions inherited from RenderWObject
 RenderWObject (WObject *o, RenderWObjectContainer *container)
RenderWObjectContainercontainer ()
 return the Container on which this object is, or the OpenGL windows where it is displayed
void drawLabel ()
 Draws the label of the object if it has to.
WObjectobject ()
 return the WObject that this RenderWObject display on OpenGL
virtual void objectAlreadyDestroyed ()
 This function is called before the destruction if the WObject we are supposed to draw has already been destroyed.

Protected Member Functions

void updateRepresentation ()
 Updates the representation of the cylinder.

Protected Attributes

PhyCylinder *const m_cylinder
 The cylinder we have to render.
QVector< GLfloat > m_cylinderColors
 The array of colors of vertexes of the cylinder.
QVector< GLfloat > m_cylinderNormals
 The array of normals to vertexes of the cylinder.
QVector< GLfloat > m_cylinderTextureCoords
 The arrayof texture coordinates for each vertex of the cylinder.
QVector< GLfloat > m_cylinderVertexes
 The array of vertexes of the cylinder.
const real m_height
 The height of the cylinder.
QVector< GLfloat > m_lowerBaseColors
 The array of colors of vertexes of the lower base.
QVector< GLfloat > m_lowerBaseNormals
 The array of normals to vertexes of the lower base.
QVector< unsigned int > m_lowerBaseSegmentsLength
 The array with the number of vertexes for each segment of the lower base (each segment has a different color)
QVector< GLfloat > m_lowerBaseTextureCoords
 The arrayof texture coordinates for each vertex of the lower base.
QVector< GLfloat > m_lowerBaseVertexes
 The array of vertexes of the lower base.
const real m_radius
 The radius of the cylinder.
QVector< GLfloat > m_upperBaseColors
 The array of colors of vertexes of the upper base.
QVector< GLfloat > m_upperBaseNormals
 The array of normals to vertexes of the upper base.
QVector< unsigned int > m_upperBaseSegmentsLength
 The array with the number of vertexes for each segment of the upper base (each segment has a different color)
QVector< GLfloat > m_upperBaseTextureCoords
 The arrayof texture coordinates for each vertex of the upper base.
QVector< GLfloat > m_upperBaseVertexes
 The array of vertexes of the upper base.
- Protected Attributes inherited from RenderWObject
RenderWObjectContainercontain
WObjectobj

Detailed Description

The class rendering a PhyCylinder.

Definition at line 470 of file renderwobjecthierarchy.cpp.

Constructor & Destructor Documentation

RenderPhyCylinder ( WObject wobj,
RenderWObjectContainer container 
)
inline

Constructor.

Parameters
wobjthe object to render. Bad crashes will happend if wobj is not a PhyCylinder
containerthe container of renderers

Definition at line 479 of file renderwobjecthierarchy.cpp.

virtual ~RenderPhyCylinder ( )
inlinevirtual

Destructor.

Definition at line 505 of file renderwobjecthierarchy.cpp.

Member Function Documentation

virtual void calculateAABB ( wVector minPoint,
wVector maxPoint,
const wMatrix  tm 
)
inlinevirtual

Computes and returns the AABB of the object.

Parameters
minPointmodified to store the minimum point of the AABB
maxPointmodified to store the maximum point of the AABB
tmthe transformation matrix of the object

Reimplemented from RenderWObject.

Definition at line 608 of file renderwobjecthierarchy.cpp.

virtual void calculateOBB ( wVector dimension,
wVector minPoint,
wVector maxPoint 
)
inlinevirtual

Computes and returns the OBB of the object.

Parameters
dimensionmodified to store the dimensions of the OBB
minPointmodified to store the minimum point of the OBB
maxPointmodified to store the maximum point of the OBB

Reimplemented from RenderWObject.

Definition at line 631 of file renderwobjecthierarchy.cpp.

virtual void render ( QGLContext *  gw)
inlinevirtual

The function performing the actual rendering.

Parameters
gwthe openGL context

Implements RenderWObject.

Definition at line 515 of file renderwobjecthierarchy.cpp.

References min().

virtual void renderAABB ( RenderWorld gw)
inlinevirtual

Renders only the AABB of the object.

Parameters
gwthe RenderWorld object in which we are rendered

Reimplemented from RenderWObject.

Definition at line 589 of file renderwobjecthierarchy.cpp.

References RenderWObjectContainer::drawWireBox().

void updateRepresentation ( )
inlineprotected

Updates the representation of the cylinder.

This regenerates the list of vertexes used to render the cylinder

Definition at line 652 of file renderwobjecthierarchy.cpp.

References WObject::color(), PhyCylinder::SegmentColor::color, Ownable::owner(), and WObject::useColorTextureOfOwner().

Member Data Documentation

PhyCylinder* const m_cylinder
protected

The cylinder we have to render.

Definition at line 1093 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_cylinderColors
protected

The array of colors of vertexes of the cylinder.

This is a plain array, each block of 3 values is a color

Definition at line 1125 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_cylinderNormals
protected

The array of normals to vertexes of the cylinder.

This is a plain array, each block of 3 values is a normal

Definition at line 1118 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_cylinderTextureCoords
protected

The arrayof texture coordinates for each vertex of the cylinder.

This is a plain array, each block of 2 values is a texture coordinate

Definition at line 1133 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_cylinderVertexes
protected

The array of vertexes of the cylinder.

Vertexes are meant to be drawn as TRIANGLE_STRIP. This is a plain array, each block of 3 values is a vertex

Definition at line 1111 of file renderwobjecthierarchy.cpp.

const real m_height
protected

The height of the cylinder.

Definition at line 1098 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_lowerBaseColors
protected

The array of colors of vertexes of the lower base.

This is a plain array, each block of 3 values is a color

Definition at line 1191 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_lowerBaseNormals
protected

The array of normals to vertexes of the lower base.

This is a plain array, each block of 3 values is a normal

Definition at line 1184 of file renderwobjecthierarchy.cpp.

QVector<unsigned int> m_lowerBaseSegmentsLength
protected

The array with the number of vertexes for each segment of the lower base (each segment has a different color)

Definition at line 1205 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_lowerBaseTextureCoords
protected

The arrayof texture coordinates for each vertex of the lower base.

This is a plain array, each block of 2 values is a texture coordinate

Definition at line 1199 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_lowerBaseVertexes
protected

The array of vertexes of the lower base.

Vertexes are meant to be drawn as TRIANGLE_FAN. This is a plain array, each block of 3 values is a vertex

Definition at line 1177 of file renderwobjecthierarchy.cpp.

const real m_radius
protected

The radius of the cylinder.

Definition at line 1103 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_upperBaseColors
protected

The array of colors of vertexes of the upper base.

This is a plain array, each block of 3 values is a color

Definition at line 1155 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_upperBaseNormals
protected

The array of normals to vertexes of the upper base.

This is a plain array, each block of 3 values is a normal

Definition at line 1148 of file renderwobjecthierarchy.cpp.

QVector<unsigned int> m_upperBaseSegmentsLength
protected

The array with the number of vertexes for each segment of the upper base (each segment has a different color)

Definition at line 1169 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_upperBaseTextureCoords
protected

The arrayof texture coordinates for each vertex of the upper base.

This is a plain array, each block of 2 values is a texture coordinate

Definition at line 1163 of file renderwobjecthierarchy.cpp.

QVector<GLfloat> m_upperBaseVertexes
protected

The array of vertexes of the upper base.

Vertexes are meant to be drawn as TRIANGLE_FAN. This is a plain array, each block of 3 values is a vertex

Definition at line 1141 of file renderwobjecthierarchy.cpp.


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