#include <nurbsGL.h>
Inheritance diagram for PLib::ObjectGL:
Public Types | |
enum | ObjectCategory { badType, nurbsType, pointType, vectorType, listType } |
enum | ObjectType { badObject, curveObject, surfaceObject, pointObject, cpointObject, cpointPolygonObject, bboxObject, vectorObject, listObject, hSurfObject, hcpointObject, pointListObject, spointObject } |
Public Member Functions | |
ObjectGL () | |
virtual | ~ObjectGL () |
ObjectGL & | operator= (const ObjectGL &a) |
void | setObjectColor (const Color &c) |
void | setSelectColor (const Color &c) |
void | setCurrentColor (const Color &c) |
void | glSelectColor () const |
void | glObjectColor () const |
void | glCurrentColor () const |
void | hideObject () |
void | selectObject () |
void | viewObject () |
void | currentObject () |
virtual void | glColor () const |
void | glColor (const Color &c) const |
virtual void | glObject () const=0 |
virtual void | glTransform () const |
virtual void | display () const |
virtual void | displayList () |
virtual void | displayName () |
virtual void | glNewList () |
virtual ObjectGL *& | previous () |
virtual ObjectGL *& | next () |
virtual ObjectGL * | previous () const |
virtual ObjectGL * | next () const |
ObjectGLState | getState () const |
virtual void | select () |
virtual void | deselect () |
int | isSelected () const |
virtual void | activate () |
virtual void | deactivate () |
int | isActive () const |
virtual ObjectGL * | copy () |
virtual void | applyTransform () |
virtual int | read (const char *filename) |
virtual int | write (const char *filename) const |
virtual int | writeRIB (const char *filename) const |
virtual int | writePOVRAY (const char *filename) const |
virtual int | read (ifstream &fin) |
virtual int | write (ofstream &fout) const |
virtual int | writeRIB (ofstream &fout) const |
virtual int | writePOVRAY (ofstream &fout) const |
void | setName (const char *n) |
char * | name () const |
char * | typeName () const |
Public Attributes | |
Color | objectColor |
Color | selectColor |
Color | currentColor |
GLfloat * | materialColor |
ObjectType | type |
ObjectCategory | category |
GLfloat | tx |
GLfloat | ty |
GLfloat | tz |
GLfloat | rx |
GLfloat | ry |
GLfloat | rz |
GLfloat | sx |
GLfloat | sy |
GLfloat | sz |
int | callListId |
Protected Attributes | |
int | selected |
int | active |
ObjectGLState | state |
ObjectGL * | prev_ |
ObjectGL * | next_ |
char * | name_ |
This is the base virtual class for objects which can be displayed using OpenGL.
The class contains informations regarding the color of the object and the state of the object (selected, active, displayed, hidden). It also associates a color for each state.
Information about local transformations which should be applied to the objects are also given.
PLib::ObjectGL::ObjectGL | ( | ) |
The basic constructor.
It sets default values for the state and the colors. The default values are defined by the default global variables: objectColorDefault, selectColorDefault, currentColorDefault and objectStateDefault.
PLib::ObjectGL::~ObjectGL | ( | ) | [virtual] |
The destructor.
void PLib::ObjectGL::glTransform | ( | ) | const [virtual] |
Performs the local transformation.
Performs the local transformation in this order: scaling, translation, rotation in x, rotation in y and rotation in z.
void PLib::ObjectGL::glNewList | ( | ) | [virtual] |
generates a default call list
Generates a default call list. It generates a call list from the glObject() call using .GL_COMPILE..
int PLib::ObjectGL::read | ( | const char * | filename | ) | [virtual] |
Reads the information from a stream.
filename | the input file |
Reimplemented in PLib::ObjectListGL, PLib::PointListGL, and PLib::HNurbsSurfaceGL.
int PLib::ObjectGL::write | ( | const char * | filename | ) | const [virtual] |
Writes a ObjectGL to a file.
filename | the filename to write to. |
Reimplemented in PLib::ObjectListGL, PLib::PointListGL, and PLib::HNurbsSurfaceGL.
int PLib::ObjectGL::read | ( | ifstream & | fin | ) | [virtual] |
Reads the information from a stream.
fin | the input stream |
Reimplemented in PLib::PointListGL, PLib::NurbsCurveGL, PLib::NurbsSurfaceGL, and PLib::HNurbsSurfaceGL.
int PLib::ObjectGL::write | ( | ofstream & | fout | ) | const [virtual] |
Writes a ObjectGL to a stream.
fout | the output stream |
Reimplemented in PLib::PointListGL, PLib::NurbsCurveGL, PLib::NurbsSurfaceGL, and PLib::HNurbsSurfaceGL.
void PLib::ObjectGL::setName | ( | const char * | n | ) |
Sets the name of the object.
Sets the name of the object. The content of n is copied to the name.
n | the name of the object |
char * PLib::ObjectGL::typeName | ( | ) | const |
Returns the name of the type of the class.