Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PLib::ObjectGL Class Reference

The base class for OpenGL objects. More...

#include <nurbsGL.h>

Inheritance diagram for PLib::ObjectGL:

PLib::BoundingBoxGL PLib::CPointGL PLib::KnotGL PLib::NurbsCpolygonGL PLib::NurbsGL PLib::NurbsSpolygonGL PLib::ObjectListGL PLib::ObjectRefGL PLib::PointGL PLib::PointListGL List of all members.

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 Methods

 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_

Detailed Description

The base class for OpenGL objects.

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.

Author:
Philippe Lavoie
Date:
28 September 1997

Definition at line 216 of file nurbsGL.h.


Constructor & Destructor Documentation

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.

Author:
Philippe Lavoie
Date:
20 September 1997

Definition at line 117 of file nurbsGL.cpp.

Referenced by PLib::ObjectListGL::activate, PLib::ObjectRefListGL::add, PLib::ObjectListGL::deactivate, PLib::ObjectListGL::deselect, PLib::NurbsListGL::display, PLib::ObjectListGL::display, PLib::ObjectListGL::displayName, PLib::NurbsListGL::glObject, PLib::ObjectListGL::glObject, PLib::ObjectListGL::goToNextActive, PLib::ObjectListGL::goToPreviousActive, PLib::ObjectListGL::hideAllObjects, PLib::HNurbsSurfaceGL::point, PLib::ObjectListGL::read, PLib::ObjectRefListGL::refList, PLib::ObjectRefListGL::remove, PLib::ObjectListGL::remove, PLib::ObjectListGL::reset, PLib::HNurbsSurfaceGL::resetCPoints, PLib::NurbsSurfaceGL::resetCPoints, PLib::NurbsListGL::resetDisplayFlags, PLib::ObjectListGL::select, PLib::NurbsSurfaceGL::setSym, PLib::HNurbsSurfaceGL::setSym, PLib::ObjectListGL::transformBy, PLib::ObjectListGL::transformTo, PLib::SPointHSurfaceGL::updateOthers, PLib::SPointSurfaceGL::updateOthers, PLib::ObjectListGL::viewAllObjects, PLib::ObjectListGL::write, PLib::ObjectListGL::writePOVRAY, and PLib::ObjectListGL::writeRIB.

PLib::ObjectGL::~ObjectGL   [virtual]
 

The destructor.

Author:
Philippe Lavoie
Date:
30 September 1997

Definition at line 207 of file nurbsGL.cpp.


Member Function Documentation

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 \verb.GL_COMPILE..

Returns:
The call list identification number for the object if the call was succesfull, 0 otherwise.
Author:
Philippe Lavoie
Date:
23 September 1997

Definition at line 1337 of file nurbsGL.cpp.

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.

Author:
Philippe Lavoie
Date:
20 September 1997

Definition at line 193 of file nurbsGL.cpp.

ObjectGL & PLib::ObjectGL::operator= const ObjectGL &    a
 

Copies another ObjectGL.

Copies another ObjectGL. This will not copy the prev and next pointers.

Parameters:
a  the object to copy
Author:
Philippe Lavoie
Date:
6 November 1997

Definition at line 2898 of file nurbsGL.cpp.

int PLib::ObjectGL::read ifstream &    fin [virtual]
 

Reads the information from a stream.

Parameters:
fin  the input stream
Returns:
1 on sucess, 0 on failure
Author:
Philippe Lavoie
Date:
19 June 1998

Reimplemented in PLib::PointListGL.

Definition at line 3837 of file nurbsGL.cpp.

References setName.

int PLib::ObjectGL::read const char *    filename [virtual]
 

Reads the information from a stream.

Parameters:
filename  the input file
Returns:
1 on sucess, 0 on failure
Author:
Philippe Lavoie
Date:
19 June 1998

Reimplemented in PLib::ObjectListGL.

Definition at line 3892 of file nurbsGL.cpp.

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.

Parameters:
n  the name of the object
Author:
Philippe Lavoie
Date:
20 September 1997

Definition at line 145 of file nurbsGL.cpp.

Referenced by read, PLib::HNurbsSurfaceGL::read, PLib::NurbsSurfaceGL::read, and PLib::NurbsCurveGL::read.

char * PLib::ObjectGL::typeName   const
 

Returns the name of the type of the class.

Returns:
the name of the type of the class, 0 if the type is unknown
Author:
Philippe Lavoie
Date:
20 September 1997

Definition at line 161 of file nurbsGL.cpp.

int PLib::ObjectGL::write ofstream &    fout const [virtual]
 

Writes a ObjectGL to a stream.

Parameters:
fout  the output stream
Returns:
0 if an error occurs, 1 otherwise
Author:
Philippe Lavoie
Date:
19 June 1998

Reimplemented in PLib::PointListGL.

Definition at line 3876 of file nurbsGL.cpp.

int PLib::ObjectGL::write const char *    filename const [virtual]
 

Writes a ObjectGL to a file.

Parameters:
filename  the filename to write to.
Returns:
0 if an error occurs, 1 otherwise
Author:
Philippe Lavoie
Date:
19 June 1998

Reimplemented in PLib::ObjectListGL.

Definition at line 3909 of file nurbsGL.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 13:27:01 2003 for NURBS++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002