GLC_Disc : OpenGL 3D Disc. More...
#include <glc_disc.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_Disc (double radius, double angle=2.0 *glc::PI) | |
| Construct a disc with the given radius. | |
| GLC_Disc (const GLC_Disc &disc) | |
| Copy constructor. | |
| virtual | ~GLC_Disc () |
| Destructor. | |
Get Functions | |
| virtual const GLC_BoundingBox & | boundingBox (void) |
| Return this disc bounding box. | |
| virtual GLC_Geometry * | clone () const |
| Return a copy of this Disc. | |
| double | radius () const |
| Return the radius of this disc. | |
| int | discretion () const |
| Return the discretion of this disc. | |
| double | angle () const |
| Return the angle of this disc. | |
Set Functions | |
| GLC_Disc & | operator= (const GLC_Disc &disc) |
| Set this disc from the given disc and return a reference of this disc. | |
| void | setRadius (double radius) |
| Set this disc radius to the given radius. | |
| void | setDiscretion (int targetDiscret) |
| Set this disc discretion to the given discretion. | |
| void | setAngle (double angle) |
| Set this disc angle in radians. | |
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 |
| Disc radius. | |
| int | m_Discret |
| Disc polygon discretisation. | |
| double | m_Angle |
| Angle of disc in radians. | |
| GLuint | m_Step |
| Disc Step. | |
GLC_Disc : OpenGL 3D Disc.
An GLC_Disc is a polygonnal disc
Definition at line 36 of file glc_disc.h.
| GLC_Disc::GLC_Disc | ( | double | radius, | |
| double | angle = 2.0 * glc::PI | |||
| ) |
Construct a disc with the given radius.
Definition at line 26 of file glc_disc.cpp.
Referenced by clone().
| GLC_Disc::GLC_Disc | ( | const GLC_Disc & | disc | ) |
Copy constructor.
Definition at line 36 of file glc_disc.cpp.
| GLC_Disc::~GLC_Disc | ( | ) | [virtual] |
Destructor.
Definition at line 46 of file glc_disc.cpp.
| double GLC_Disc::angle | ( | ) | const [inline] |
Return the angle of this disc.
Definition at line 73 of file glc_disc.h.
Referenced by createMeshAndWire().
| const GLC_BoundingBox & GLC_Disc::boundingBox | ( | void | ) | [virtual] |
Return this disc bounding box.
Reimplemented from GLC_Mesh.
Definition at line 55 of file glc_disc.cpp.
References createMeshAndWire(), and GLC_Mesh::isEmpty().
| GLC_Geometry * GLC_Disc::clone | ( | ) | const [virtual] |
Return a copy of this Disc.
Reimplemented from GLC_Mesh.
Definition at line 64 of file glc_disc.cpp.
References GLC_Disc().
| void GLC_Disc::createMeshAndWire | ( | ) | [private] |
Create the cylinder mesh and wire.
Definition at line 128 of file glc_disc.cpp.
References GLC_Mesh::addNormals(), GLC_Mesh::addTexels(), GLC_Mesh::addTrianglesFan(), GLC_Mesh::addVertice(), GLC_Geometry::addVerticeGroup(), angle(), GLC_Mesh::finish(), GLC_Geometry::firstMaterial(), GLC_Geometry::hasMaterial(), GLC_WireData::isEmpty(), GLC_Mesh::isEmpty(), m_Angle, m_Discret, m_Radius, m_Step, GLC_Geometry::m_WireData, glc::PI, and GLC_Mesh::texelVector().
Referenced by boundingBox(), and glDraw().
| int GLC_Disc::discretion | ( | void | ) | const [inline] |
Return the discretion of this disc.
Definition at line 69 of file glc_disc.h.
| void GLC_Disc::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 117 of file glc_disc.cpp.
References createMeshAndWire(), and GLC_Mesh::isEmpty().
| double GLC_Disc::radius | ( | void | ) | const [inline] |
Return the radius of this disc.
Definition at line 65 of file glc_disc.h.
| void GLC_Disc::setAngle | ( | double | angle | ) |
Set this disc angle in radians.
Definition at line 107 of file glc_disc.cpp.
References GLC_Mesh::clearMeshWireAndBoundingBox(), and m_Angle.
Referenced by GLC_CuttingPlane::create3DviewInstance().
| void GLC_Disc::setDiscretion | ( | int | targetDiscret | ) |
Set this disc discretion to the given discretion.
Definition at line 95 of file glc_disc.cpp.
References GLC_Mesh::clearMeshWireAndBoundingBox(), and m_Discret.
| void GLC_Disc::setRadius | ( | double | radius | ) |
Set this disc radius to the given radius.
Definition at line 87 of file glc_disc.cpp.
References GLC_Mesh::clearMeshWireAndBoundingBox(), and m_Radius.
double GLC_Disc::m_Angle [private] |
Angle of disc in radians.
Definition at line 130 of file glc_disc.h.
Referenced by createMeshAndWire(), operator=(), and setAngle().
int GLC_Disc::m_Discret [private] |
Disc polygon discretisation.
Definition at line 127 of file glc_disc.h.
Referenced by createMeshAndWire(), operator=(), and setDiscretion().
double GLC_Disc::m_Radius [private] |
Disc radius.
Definition at line 124 of file glc_disc.h.
Referenced by createMeshAndWire(), operator=(), and setRadius().
GLuint GLC_Disc::m_Step [private] |
Disc Step.
Definition at line 133 of file glc_disc.h.
Referenced by createMeshAndWire(), and operator=().