GLC_Cylinder : OpenGL 3D Cylinder. More...
#include <glc_cylinder.h>
Public Member Functions | |
Constructor / Destructor | |
GLC_Cylinder (double dRadius, double dLength) | |
Construct an GLC_Cylinder. | |
GLC_Cylinder (const GLC_Cylinder &sourceCylinder) | |
Copy contructor. | |
virtual | ~GLC_Cylinder () |
Destructor. | |
Set Functions | |
void | setLength (double Length) |
Set Cylinder length. | |
void | setRadius (double Radius) |
Set Cylinder radius. | |
void | setDiscretion (int TargetDiscret) |
Set Discretion. | |
void | setEndedCaps (bool CapsEnded) |
End Caps. | |
Private Member Functions | |
OpenGL Functions | |
virtual void | glDraw (const GLC_RenderProperties &) |
Virtual interface for OpenGL Geometry set up. | |
Private services Functions | |
void | createMeshAndWire () |
Create the cylinder mesh and wire. | |
Private Attributes | |
double | m_Radius |
Cylinder's radius. | |
double | m_Length |
Cylinder length (Z Axis direction). | |
int | m_Discret |
Cylinder polygon discretisation. | |
bool | m_EndedIsCaped |
Cylinder is capped. | |
Static Private Attributes | |
static quint32 | m_ChunkId = 0xA705 |
Class chunk id. | |
Get Functions | |
| |
double | length (void) const |
Get Lenght of the Cylinder. | |
double | radius (void) const |
Get Radius of cylinder. | |
int | discretion (void) const |
Get Cylinder discretion. | |
virtual GLC_Geometry * | clone () const |
Return a copy of the Cylinder. | |
bool | EndedIsCaped () const |
return true if cylinder's ended are capped | |
virtual const GLC_BoundingBox & | boundingBox (void) |
return the cylinder bounding box | |
static quint32 | chunckID () |
Return the class Chunk ID. |
GLC_Cylinder : OpenGL 3D Cylinder.
An GLC_Cylinder is a polygonnal geometry
It can be capped or not
Definition at line 39 of file glc_cylinder.h.
GLC_Cylinder::GLC_Cylinder | ( | double | dRadius, | |
double | dLength | |||
) |
Construct an GLC_Cylinder.
By default, discretion is set to GLC_POLYDISCRET
By default, Axis of Cylinder is Z Axis dRadius must be > 0 dLength must be > 0
Definition at line 39 of file glc_cylinder.cpp.
References createMeshAndWire(), m_Length, and m_Radius.
Referenced by clone().
GLC_Cylinder::GLC_Cylinder | ( | const GLC_Cylinder & | sourceCylinder | ) |
Copy contructor.
Definition at line 50 of file glc_cylinder.cpp.
References createMeshAndWire(), m_Discret, m_Length, and m_Radius.
GLC_Cylinder::~GLC_Cylinder | ( | ) | [virtual] |
Destructor.
Definition at line 61 of file glc_cylinder.cpp.
const GLC_BoundingBox & GLC_Cylinder::boundingBox | ( | void | ) | [virtual] |
return the cylinder bounding box
Reimplemented from GLC_Mesh.
Definition at line 82 of file glc_cylinder.cpp.
References createMeshAndWire(), and GLC_Mesh::isEmpty().
quint32 GLC_Cylinder::chunckID | ( | ) | [static] |
Return the class Chunk ID.
Reimplemented from GLC_Mesh.
Definition at line 70 of file glc_cylinder.cpp.
References m_ChunkId.
GLC_Geometry * GLC_Cylinder::clone | ( | ) | const [virtual] |
Return a copy of the Cylinder.
Reimplemented from GLC_Mesh.
Definition at line 76 of file glc_cylinder.cpp.
References GLC_Cylinder().
void GLC_Cylinder::createMeshAndWire | ( | ) | [private] |
Create the cylinder mesh and wire.
Definition at line 153 of file glc_cylinder.cpp.
References GLC_Mesh::addNormals(), GLC_Mesh::addTexels(), GLC_Mesh::addTrianglesStrip(), GLC_Mesh::addVertice(), GLC_Geometry::addVerticeGroup(), GLC_Mesh::finish(), GLC_Geometry::firstMaterial(), GLC_Geometry::hasMaterial(), GLC_WireData::isEmpty(), GLC_Mesh::isEmpty(), m_Discret, m_EndedIsCaped, m_Length, m_Radius, GLC_Geometry::m_WireData, glc::PI, and GLC_Mesh::texelVector().
Referenced by boundingBox(), GLC_Cylinder(), and glDraw().
int GLC_Cylinder::discretion | ( | void | ) | const [inline] |
Get Cylinder discretion.
Definition at line 79 of file glc_cylinder.h.
bool GLC_Cylinder::EndedIsCaped | ( | ) | const [inline] |
return true if cylinder's ended are capped
Definition at line 86 of file glc_cylinder.h.
void GLC_Cylinder::glDraw | ( | const GLC_RenderProperties & | renderProperties | ) | [private, virtual] |
Virtual interface for OpenGL Geometry set up.
This Virtual function is implemented here.
Throw GLC_OpenGlException
Reimplemented from GLC_Mesh.
Definition at line 141 of file glc_cylinder.cpp.
References createMeshAndWire(), and GLC_Mesh::isEmpty().
double GLC_Cylinder::length | ( | void | ) | const [inline] |
Get Lenght of the Cylinder.
Definition at line 71 of file glc_cylinder.h.
double GLC_Cylinder::radius | ( | void | ) | const [inline] |
Get Radius of cylinder.
Definition at line 75 of file glc_cylinder.h.
void GLC_Cylinder::setDiscretion | ( | int | TargetDiscret | ) |
Set Discretion.
Discretion must be > 0
Definition at line 113 of file glc_cylinder.cpp.
References GLC_Mesh::clearMeshWireAndBoundingBox(), and m_Discret.
void GLC_Cylinder::setEndedCaps | ( | bool | CapsEnded | ) |
End Caps.
Definition at line 126 of file glc_cylinder.cpp.
References GLC_Mesh::clearMeshWireAndBoundingBox(), and m_EndedIsCaped.
void GLC_Cylinder::setLength | ( | double | Length | ) |
Set Cylinder length.
Length must be > 0
Definition at line 95 of file glc_cylinder.cpp.
References GLC_Mesh::clearMeshWireAndBoundingBox(), and m_Length.
void GLC_Cylinder::setRadius | ( | double | Radius | ) |
Set Cylinder radius.
Radius must be > 0
Definition at line 104 of file glc_cylinder.cpp.
References GLC_Mesh::clearMeshWireAndBoundingBox(), and m_Radius.
quint32 GLC_Cylinder::m_ChunkId = 0xA705 [static, private] |
Class chunk id.
Reimplemented from GLC_Mesh.
Definition at line 154 of file glc_cylinder.h.
Referenced by chunckID().
int GLC_Cylinder::m_Discret [private] |
Cylinder polygon discretisation.
Definition at line 148 of file glc_cylinder.h.
Referenced by createMeshAndWire(), GLC_Cylinder(), and setDiscretion().
bool GLC_Cylinder::m_EndedIsCaped [private] |
Cylinder is capped.
Definition at line 151 of file glc_cylinder.h.
Referenced by createMeshAndWire(), and setEndedCaps().
double GLC_Cylinder::m_Length [private] |
Cylinder length (Z Axis direction).
Definition at line 145 of file glc_cylinder.h.
Referenced by createMeshAndWire(), GLC_Cylinder(), and setLength().
double GLC_Cylinder::m_Radius [private] |
Cylinder's radius.
Definition at line 142 of file glc_cylinder.h.
Referenced by createMeshAndWire(), GLC_Cylinder(), and setRadius().