Ogl class

A virtual (window system-independent) OpenGL object. More...


Files

file  ogl.h
 Class Ogl: a virtual (window system-independent) OpenGL object.

Classes

struct  sOgl
 Class Ogl: Definition. More...

Typedefs

typedef struct sOgl Ogl
 Declaration of the Ogl class as the Ogl structure.

Functions

OglOgl_ctor (int frameMode, int orthoMode)
 Construct an Ogl object.
void Ogl_dtor (Ogl **thee)
 Ogl object destructor.
void Ogl_initBegin (Ogl *thee)
 Initialize the OpenGL context.
void Ogl_initEnd (Ogl *thee)
 Initialize the OpenGL context.
void Ogl_beginList (Ogl *thee, int list, int show)
 Make a generic display list.
void Ogl_endList (Ogl *thee)
 Make a generic display list.
void Ogl_addListObject (Ogl *thee, int type, int numPV, float vx[][3], float c[4], float r, char text[])
 Make a generic display list.
void Ogl_reshape (Ogl *thee, int w, int h)
 The main 3D==>2D Projection function.
void Ogl_display (Ogl *thee)
 Main OpenGL display driver.
int Ogl_lightModeOnOff (Ogl *thee)
 Some simple callback routines to manipulate the object.
int Ogl_orthoModeOnOff (Ogl *thee)
 Some simple callback routines to manipulate the object.
int Ogl_frameModeOnOff (Ogl *thee)
 Some simple callback routines to manipulate the object.
int Ogl_ballModeOnOff (Ogl *thee)
 Some simple callback routines to manipulate the object.
int Ogl_bboxModeOnOff (Ogl *thee)
 Some simple callback routines to manipulate the object.
int Ogl_listModeOnOff (Ogl *thee, int list)
 Some simple callback routines to manipulate the object.
int Ogl_isList (Ogl *thee, int list)
 Some simple callback routines to manipulate the object.
int Ogl_isListOn (Ogl *thee, int list)
 Some simple callback routines to manipulate the object.
void Ogl_setMouseMode (Ogl *thee, int value)
 Primary rotation/scaling/translation routines.
void Ogl_mouseDown (Ogl *thee, int x, int y)
 Primary rotation/scaling/translation routines.
void Ogl_mouseUp (Ogl *thee, int x, int y)
 Primary rotation/scaling/translation routines.
void Ogl_mouseMotion (Ogl *thee, int x, int y)
 Primary rotation/scaling/translation routines.
int Ogl_spin (Ogl *thee)
 Primary rotation/scaling/translation routines.
void Ogl_resetPos (Ogl *thee)
 Some simple callback routines to manipulate the object.

Detailed Description

A virtual (window system-independent) OpenGL object.


Typedef Documentation

typedef struct sOgl Ogl

Declaration of the Ogl class as the Ogl structure.

Author:
Michael Holst


Function Documentation

void Ogl_addListObject ( Ogl thee,
int  type,
int  numPV,
float  vx[][3],
float  c[4],
float  r,
char  text[] 
)

Make a generic display list.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
type index for type options type==0 ==> edges (a line strip) type==1 ==> filled polygon type==3 ==> text type==4 ==> 2-sphere (coarse resolution) type==5 ==> 2-sphere (medium resolution) type==6 ==> 2-sphere (fine resolution)
numPV number of different point/line/polygon
vx vertex coordinates
c parameter array
r coeficient to scale vertex coordinates.
text text char array

int Ogl_ballModeOnOff ( Ogl thee  ) 

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

int Ogl_bboxModeOnOff ( Ogl thee  ) 

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

void Ogl_beginList ( Ogl thee,
int  list,
int  show 
)

Make a generic display list.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
list index for list options.
show index for displaying the list or not.

Ogl* Ogl_ctor ( int  frameMode,
int  orthoMode 
)

Construct an Ogl object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
Pointer to a newly allocated (empty) Ogl object
Parameters:
frameMode frame (0=centered, 1=offset)
orthoMode projection (0=perspect, 1=ortho)

void Ogl_display ( Ogl thee  ) 

Main OpenGL display driver.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
 * Notes:    We use the Z-buffer here for hidden line and hidden surface
 *           removal.  We just have to make sure that we get a visual
 *           device with some Z-buffer bits, and that we don't mess up the
 *           transformations so that the Z-axis points somewhere other than
 *           positively straight at the eye.
 *
 * Frame codes:
 *
 *           If "frameMode==0", we draw only the frame 4 lists (4-9),
 *           centered in frame 1 show below, regardless of window shape.
 *
 *           If "frameMode==1", we draw frame 1,2,3,4 lists (0-9), in the
 *           appropriate frames.
 *
 *      ._____._____._____.     ._____._____._____.     ._____._____.......
 *      |                 |     |           |     |     |           |     .
 *      |                 |     |           |  2  |     |           |     .
 *      |        1        |     |     4     |_____|     |     ?     |......
 *      |                 |     |           |     |     |           |     .
 *      |                 |     |           |  3  |     |           |     .
 *      |_____._____._____|     |_____._____|_____|     |_____._____.......
 *
 * Display list codes:
 *
 *      List   Frame     Type
 *
 *         0       1     non-rotating, non-lighted
 *         1       1     non-rotating, non-lighted
 *         2       2     non-rotating, non-lighted
 *         3       3     non-rotating, non-lighted
 *
 *         4       4     non-rotating, non-lighted
 *         5       4         rotating, non-lighted
 *         6       4         rotating, non-lighted
 *         7       4         rotating,     lighted
 *         8       4         rotating,     lighted
 *         9       4     non-rotating,     lighted
 * 
Returns:
None
Parameters:
thee Pointer to the Ogl object.

void Ogl_dtor ( Ogl **  thee  ) 

Ogl object destructor.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

void Ogl_endList ( Ogl thee  ) 

Make a generic display list.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

int Ogl_frameModeOnOff ( Ogl thee  ) 

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

void Ogl_initBegin ( Ogl thee  ) 

Initialize the OpenGL context.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

void Ogl_initEnd ( Ogl thee  ) 

Initialize the OpenGL context.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

int Ogl_isList ( Ogl thee,
int  list 
)

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
list index for list options.

int Ogl_isListOn ( Ogl thee,
int  list 
)

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
list index for list options.

int Ogl_lightModeOnOff ( Ogl thee  ) 

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

int Ogl_listModeOnOff ( Ogl thee,
int  list 
)

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
list index for list options.

void Ogl_mouseDown ( Ogl thee,
int  x,
int  y 
)

Primary rotation/scaling/translation routines.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
x width parameter
y height parameter

void Ogl_mouseMotion ( Ogl thee,
int  x,
int  y 
)

Primary rotation/scaling/translation routines.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
x width parameter
y height parameter

void Ogl_mouseUp ( Ogl thee,
int  x,
int  y 
)

Primary rotation/scaling/translation routines.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
x width parameter
y height parameter

int Ogl_orthoModeOnOff ( Ogl thee  ) 

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

void Ogl_resetPos ( Ogl thee  ) 

Some simple callback routines to manipulate the object.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.

void Ogl_reshape ( Ogl thee,
int  w,
int  h 
)

The main 3D==>2D Projection function.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
w width of the plotbox
h height of the plotbox

void Ogl_setMouseMode ( Ogl thee,
int  value 
)

Primary rotation/scaling/translation routines.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.
value value of mouse (0=rotate, 1=scale, 2=translate)

int Ogl_spin ( Ogl thee  ) 

Primary rotation/scaling/translation routines.

Author:
Michael Holst
Note:
Class Ogl: Non-inlineable methods (ogl.c)
Returns:
None
Parameters:
thee Pointer to the Ogl object.


Generated on Mon Aug 9 11:14:55 2010 for SG by  doxygen 1.5.6