Main Page | Class Hierarchy | Class List | File List | Class 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 Member Functions

 ObjectGL ()
virtual ~ObjectGL ()
ObjectGLoperator= (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 ObjectGLprevious () const
virtual ObjectGLnext () const
ObjectGLState getState () const
virtual void select ()
virtual void deselect ()
int isSelected () const
virtual void activate ()
virtual void deactivate ()
int isActive () const
virtual ObjectGLcopy ()
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
ObjectGLprev_
ObjectGLnext_
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


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

PLib::ObjectGL::~ObjectGL  )  [virtual]
 

The destructor.

Author:
Philippe Lavoie
Date:
30 September 1997


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 .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

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

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

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, PLib::NurbsCurveGL, PLib::NurbsSurfaceGL, and PLib::HNurbsSurfaceGL.

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, PLib::PointListGL, 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.

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

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

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, PLib::NurbsCurveGL, PLib::NurbsSurfaceGL, and PLib::HNurbsSurfaceGL.

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, PLib::PointListGL, and PLib::HNurbsSurfaceGL.


The documentation for this class was generated from the following files:
Generated on Sat Jan 3 20:02:58 2004 for NURBS++ by doxygen 1.3.4