ContRap-Libraries
|
Class GLPrimitive represents all OpenGL geometric primitives. More...
#include <glprimitive.h>
Public Member Functions | |
GLPrimitive (const GLVertex &position, double yaw=0.0, double pitch=0.0, double roll=0.0) | |
Initializes a primitive given the coordinates of the center point. | |
virtual | ~GLPrimitive () |
Virtual destructor. | |
virtual void | make_display_list (int flags=GL_NO_STYLE) const =0 |
Performs operations needed to create a display list of the model. | |
void | draw (int flags=GL_NO_STYLE) const |
Drawing method is the same for each primitive. | |
void | set_color (double r, double g, double b) |
Sets the line color. | |
double | get_r () const |
Returns the red line color of the primitive. | |
double | get_g () const |
Returns the green line color of the primitive. | |
double | get_b () const |
Returns the blue line color of the primitive. | |
void | set_outline_color (double r, double g, double b) |
Sets the outline color. | |
double | get_line_r () const |
Returns the red outline color of the primitive. | |
double | get_line_g () const |
Returns the green outline color of the primitive. | |
double | get_line_b () const |
Returns the blue outline color of the primitive. | |
virtual GLPrimitiveType | get_type () const =0 |
Type of the primitive. | |
void | set_style (int style) |
Sets the objects style. | |
int | get_style () const |
Returns the style of the object. | |
GLVertex & | get_position () |
Accessor to the position. | |
const GLVertex & | get_position () const |
Accessor to the position. | |
GLfloat | get_x () const |
Accessor to the x-coordinate. | |
GLfloat | get_y () const |
Accessor to the y-coordinate. | |
GLfloat | get_z () const |
Accessor to the z-coordinate. | |
void | set_position (const GLVertex &position) |
Sets the position of the object. | |
void | set_position (double x, double y, double z) |
Sets the position of the object. | |
int | get_index () const |
Returns the index of the primitive. | |
void | set_index (int index) |
Sets the index of the primitive. | |
void | set_rotation_unoriented (double dx, double dy, double dz) |
Changes to an unoriented model view, which rotates given normal vector to the Y-Axis. | |
void | set_angles (double yaw, double pitch, double roll) |
Sets the Euler-angles in DIN 9300 norm (Yaw-Pitch-Roll) | |
void | set_angles_xyz (double phi_x, double phi_y, double phi_z) |
Sets the Euler-angles in XYZ-norm. | |
double | get_opacity () const |
Returns the opacity of the entity. | |
void | set_opacity (double opacity) |
Sets the opacity of the entity. | |
double | get_scale () const |
Returns the scale of the entity. | |
void | set_scale (double scale) |
Sets the scale of the entity. | |
void | set_granularity (int value) |
Sets the granularity for all objects. | |
Protected Attributes | |
GLfloat | T [16] |
Homogeneous 4x4-matrix, which represents the transformation from the coordinate system of the primitive into the OpenGL coordinate system. | |
GLVertex | position |
Position coordinates. | |
double | r |
Line color. | |
double | g |
double | b |
double | lr |
Outline colors. | |
double | lg |
double | lb |
int | style |
Style of the drawn object. | |
double | opacity |
Opacity of the primitive if transparent. | |
double | scale |
Overall scale of the entity. | |
int | index |
Index of the primitive. | |
int | granularity |
Granularity. |
Class GLPrimitive represents all OpenGL geometric primitives.
crp::GLPrimitive::GLPrimitive | ( | const GLVertex & | position, |
double | yaw = 0.0 , |
||
double | pitch = 0.0 , |
||
double | roll = 0.0 |
||
) | [inline] |
Initializes a primitive given the coordinates of the center point.
Notice: The angles are given in radian!
position | Position of the primitive |
yaw | Yaw angle |
pitch | Pitch angle |
roll | Roll angle |
virtual crp::GLPrimitive::~GLPrimitive | ( | ) | [inline, virtual] |
Virtual destructor.
void crp::GLPrimitive::draw | ( | int | flags = GL_NO_STYLE | ) | const [inline] |
Drawing method is the same for each primitive.
flags | Style flags used to filter out drawing |
double crp::GLPrimitive::get_b | ( | ) | const [inline] |
Returns the blue line color of the primitive.
double crp::GLPrimitive::get_g | ( | ) | const [inline] |
Returns the green line color of the primitive.
int crp::GLPrimitive::get_index | ( | ) | const [inline] |
Returns the index of the primitive.
double crp::GLPrimitive::get_line_b | ( | ) | const [inline] |
Returns the blue outline color of the primitive.
double crp::GLPrimitive::get_line_g | ( | ) | const [inline] |
Returns the green outline color of the primitive.
double crp::GLPrimitive::get_line_r | ( | ) | const [inline] |
Returns the red outline color of the primitive.
double crp::GLPrimitive::get_opacity | ( | ) | const [inline] |
Returns the opacity of the entity.
GLVertex& crp::GLPrimitive::get_position | ( | ) | [inline] |
Accessor to the position.
const GLVertex& crp::GLPrimitive::get_position | ( | ) | const [inline] |
Accessor to the position.
double crp::GLPrimitive::get_r | ( | ) | const [inline] |
Returns the red line color of the primitive.
double crp::GLPrimitive::get_scale | ( | ) | const [inline] |
Returns the scale of the entity.
int crp::GLPrimitive::get_style | ( | ) | const [inline] |
Returns the style of the object.
virtual GLPrimitiveType crp::GLPrimitive::get_type | ( | ) | const [pure virtual] |
Type of the primitive.
Implemented in crp::GLCSystem, crp::GLCube, crp::GLCuboid, crp::GLDisk, crp::GLLine, crp::GLMesh, crp::GLPicture, crp::GLPlane, crp::GLPoint, crp::GLPointList, crp::GLScene, crp::GLSphere, crp::GLSquare, crp::GLSTLModel, crp::GLSurface, crp::GLText, crp::GLTorus, and crp::GLTriangle.
GLfloat crp::GLPrimitive::get_x | ( | ) | const [inline] |
Accessor to the x-coordinate.
GLfloat crp::GLPrimitive::get_y | ( | ) | const [inline] |
Accessor to the y-coordinate.
GLfloat crp::GLPrimitive::get_z | ( | ) | const [inline] |
Accessor to the z-coordinate.
virtual void crp::GLPrimitive::make_display_list | ( | int | flags = GL_NO_STYLE | ) | const [pure virtual] |
Performs operations needed to create a display list of the model.
flags | Style flags used to filter out drawing |
Implemented in crp::GLCSystem, crp::GLCube, crp::GLCuboid, crp::GLDisk, crp::GLLine, crp::GLMesh, crp::GLPicture, crp::GLPlane, crp::GLPoint, crp::GLPointList, crp::GLScene, crp::GLSphere, crp::GLSquare, crp::GLSTLModel, crp::GLSurface, crp::GLText, crp::GLTorus, and crp::GLTriangle.
void crp::GLPrimitive::set_angles | ( | double | yaw, |
double | pitch, | ||
double | roll | ||
) | [inline] |
Sets the Euler-angles in DIN 9300 norm (Yaw-Pitch-Roll)
Notice: The angles are given in radian!
yaw | Yaw angle |
pitch | Pitch angle |
roll | Roll angle |
void crp::GLPrimitive::set_angles_xyz | ( | double | phi_x, |
double | phi_y, | ||
double | phi_z | ||
) | [inline] |
Sets the Euler-angles in XYZ-norm.
Notice: The angles are given in radian!
phi_x | Rotation angle around the X-Axis |
phi_y | Rotation angle around the Y-Axis |
phi_z | Rotation angle around the Z-Axis |
void crp::GLPrimitive::set_color | ( | double | r, |
double | g, | ||
double | b | ||
) | [inline] |
Sets the line color.
r | Red amount between 0.0 and 1.0 |
g | Green amount between 0.0 and 1.0 |
b | Blue amount between 0.0 and 1.0 |
void crp::GLPrimitive::set_granularity | ( | int | value | ) | [inline] |
Sets the granularity for all objects.
value | New granularity |
void crp::GLPrimitive::set_index | ( | int | index | ) | [inline] |
Sets the index of the primitive.
index | New index |
void crp::GLPrimitive::set_opacity | ( | double | opacity | ) | [inline] |
Sets the opacity of the entity.
opacity | New opacity |
void crp::GLPrimitive::set_outline_color | ( | double | r, |
double | g, | ||
double | b | ||
) | [inline] |
Sets the outline color.
r | Red amount between 0.0 and 1.0 |
g | Green amount between 0.0 and 1.0 |
b | Blue amount between 0.0 and 1.0 |
void crp::GLPrimitive::set_position | ( | double | x, |
double | y, | ||
double | z | ||
) | [inline] |
Sets the position of the object.
x | X-Coordinate of the position |
y | Y-Coordinate of the position |
z | Z-Coordinate of the position |
void crp::GLPrimitive::set_position | ( | const GLVertex & | position | ) | [inline] |
Sets the position of the object.
x | X-Coordinate of the position |
y | Y-Coordinate of the position |
z | Z-Coordinate of the position |
void crp::GLPrimitive::set_rotation_unoriented | ( | double | dx, |
double | dy, | ||
double | dz | ||
) | [inline] |
Changes to an unoriented model view, which rotates given normal vector to the Y-Axis.
The intention is that the Y-Axis points up.
dx | X-coordinate of the normal |
dy | Y-coordinate of the normal |
dz | Z-coordinate of the normal |
void crp::GLPrimitive::set_scale | ( | double | scale | ) | [inline] |
Sets the scale of the entity.
scale | New scale |
void crp::GLPrimitive::set_style | ( | int | style | ) | [inline] |
Sets the objects style.
style | Transparency style |
double crp::GLPrimitive::b [protected] |
double crp::GLPrimitive::g [protected] |
int crp::GLPrimitive::granularity [protected] |
Granularity.
int crp::GLPrimitive::index [protected] |
Index of the primitive.
double crp::GLPrimitive::lb [protected] |
double crp::GLPrimitive::lg [protected] |
double crp::GLPrimitive::lr [protected] |
Outline colors.
double crp::GLPrimitive::opacity [protected] |
Opacity of the primitive if transparent.
GLVertex crp::GLPrimitive::position [protected] |
Position coordinates.
double crp::GLPrimitive::r [protected] |
Line color.
double crp::GLPrimitive::scale [protected] |
Overall scale of the entity.
int crp::GLPrimitive::style [protected] |
Style of the drawn object.
GLfloat crp::GLPrimitive::T[16] [protected] |
Homogeneous 4x4-matrix, which represents the transformation from the coordinate system of the primitive into the OpenGL coordinate system.