Main Page | Packages | Class Hierarchy | Class List | Directories | Class Members

IDVR.Tools.OpenGLTools.DrawModelGLSW Class Reference

#include <DrawModelGLSW.h>

List of all members.


Detailed Description

Class for managing the draw process onto the canvas.

This class is part of the OpenGLTools namespace which is actually a subnamespace of the main namespace Tools.

After the final color values are calculated by the application's raycaster of the class RenderMachineSW this results´have to be drawn onto the canvas. Furthermore, this drawing process should be implemented with the help of OpenGL texture management for most efficient processing.

As every other class of the subpackage OpenGLTools this class has the base class OpenGLCode of the CSOpenGL library to correctly implement the OpenGL code Which will be handled by the OpenGLPanel which will show the specific drawing results on the screen.

Thus, te main task of this class is the mapping of the final color values which are stored as a two dimensional array into OgenGL texture objects which will be actually drawn onto the canvas.

See also:
OpenGLCanvas - the GUI class for the canvas with its draw control

RenderMachineSW - the actual raycaster of the application.

Author:
Bernhard Pflugfelder
Version:
1.0
Date:
02-20-2005


Public Member Functions

 DrawModelGLSW (void)
 This is the standard constructor.
 DrawModelGLSW (short n_CanvasWidth, short n_CanvasHeight, short n_TextureWidth, short n_TextureHeight)
 Constructor initialization with the valid canvas and texture sizes.
 DrawModelGLSW (short n_CanvasWidth, short n_CanvasHeight, Color n_CanvasBackColor)
 Constructor initialization with the valid canvas size and canvas background color.
 DrawModelGLSW (short n_CanvasWidth, short n_CanvasHeight, short n_TextureWidth, short n_TextureHeight, unsigned char n_FrameBuffer __gc[], Color n_CanvasBackColor)
 Constructor initialization with all included member variables.
 ~DrawModelGLSW (void)
 This is the standard deconstructor.
virtual void Init (void)
 This function overwrites the base init funtion of the class OpenGLCode.
virtual void Draw (void)
 This function overwrites the base draw funtion of the class OpenGLCode.
__property void set_CanvasWidth (short n_CanvasWidth)
 Sets a new witdh for the canvas.
__property void set_CanvasHeight (short n_CanvasHeight)
 Sets a new height for the canvas.
__property void set_TextureWidth (short n_TextureWidth)
 Sets a new width for the used texture object.
__property void set_TextureHeight (short n_TextureHeight)
 Sets a new height for the used texture object.
__property void set_CanvasBackColor (Color n_CanvasBackColor)
 Sets a new canvas background color.
__property short get_CanvasWidth (void)
 Returns the witdh of the current canvas.
__property short get_CanvasHeight (void)
 Returns the height of the current canvas.
__property short get_TextureWidth (void)
 Returns the witdh of the current used texture object.
__property short get_TextureHeight (void)
 Returns the height of the current used texture object.
void setFrameBuffer (unsigned char n_FrameBuffer __gc[])
 Sets new final color values as an two dimensional 8-bit array.
unsigned char getFrameBuffer (void) __gc[]
 Returns the current stored color values.

Static Public Member Functions

static Bitmap * GetBitmap (unsigned char n_FrameBuffer __gc[], int n_CanvasWidth, int n_CanvasHeight, int n_Resolution)
 Returns an instance of the standard Bitmap class.

Private Types

enum  ColorIndices
 Constant index values for the three color components red, green and blue.

Private Attributes

short m_CanvasWidth
 Saves the current width of the canvas.
short m_CanvasHeight
 Saves the current height of the canvas.
short m_TextureWidth
 Saves the width of the essential texture object.
short m_TextureHeight
 Saves the height of the essential texture object.
unsigned char m_FrameBuffer __gc []
 Saves the final color values.
float m_CanvasBackColor __gc []
 Saves the current canvas background color.
GLuint m_ResultTex
 Saves the index of the used OpenGL texture object.


Constructor & Destructor Documentation

DrawModelGLSW::DrawModelGLSW void   ) 
 

This is the standard constructor.

All member variables of this new instance will be set to zero/null.

DrawModelGLSW::DrawModelGLSW short  n_CanvasWidth,
short  n_CanvasHeight,
short  n_TextureWidth,
short  n_TextureHeight
 

Constructor initialization with the valid canvas and texture sizes.

All member variables will be set to zero besides the canvas dimension size member variables and the texture size member variables.

Parameters:
n_CanvasWidth the width of the current canvas.
n_CanvasHeight the height of the current canvas.
n_TextureWidth the width of the texture which actually is the row count of the final color values.
n_TextureHeight the height of the texture which actually is the row count of the final color values.

DrawModelGLSW::DrawModelGLSW short  n_CanvasWidth,
short  n_CanvasHeight,
Color  n_CanvasBackColor
 

Constructor initialization with the valid canvas size and canvas background color.

All member variables will be set to zero besides the canvas dimension size member variables and the canvas background member variable.

Parameters:
n_CanvasWidth the width of the current canvas.
n_CanvasHeight the height of the current canvas.
n_CanvasBackColor the background color of the current canvas.

DrawModelGLSW::DrawModelGLSW short  n_CanvasWidth,
short  n_CanvasHeight,
short  n_TextureWidth,
short  n_TextureHeight,
unsigned char n_FrameBuffer  __gc[],
Color  n_CanvasBackColor
 

Constructor initialization with all included member variables.

All member variables will be set to the cooresponding parameter. Thus, parameter for all included member variables have to be assigned.

Parameters:
n_CanvasWidth the width of the current canvas.
n_CanvasHeight the height of the current canvas.
n_TextureWidth the width of the texture which actually is the row count of the final color values.
n_TextureHeight the height of the texture which actually is the row count of the final color values.
n_FrameBuffer the actual final color values of the rendering process.
n_CanvasBackColor the background color of the current canvas.

DrawModelGLSW::~DrawModelGLSW void   ) 
 

This is the standard deconstructor.

All member variables will be deleted.


Member Function Documentation

void DrawModelGLSW::Draw void   )  [virtual]
 

This function overwrites the base draw funtion of the class OpenGLCode.

It contains the actual drawing code in OpenGL and also performs the code.

short DrawModelGLSW::get_CanvasHeight void   ) 
 

Returns the height of the current canvas.

Returns:
The current canvas height.

short DrawModelGLSW::get_CanvasWidth void   ) 
 

Returns the witdh of the current canvas.

Returns:
The current canvas width.

short DrawModelGLSW::get_TextureHeight void   ) 
 

Returns the height of the current used texture object.

Returns:
The current texture object height.

short DrawModelGLSW::get_TextureWidth void   ) 
 

Returns the witdh of the current used texture object.

Returns:
The current texture object width.

Bitmap * DrawModelGLSW::GetBitmap unsigned char n_FrameBuffer  __gc[],
int  n_CanvasWidth,
int  n_CanvasHeight,
int  n_Resolution
[static]
 

Returns an instance of the standard Bitmap class.

This function will be needed to store the calculated final color values into a graphic file like JEPG, BMP, etc.

Parameters:
n_FrameBuffer the final color values.
n_CanvasWidth the width of the current canvas.
n_CanvasHeight the height of the current canvas.
n_Resolution the resolution og the current canvas.

unsigned char DrawModelGLSW::getFrameBuffer void   ) 
 

Returns the current stored color values.

Returns:
The current final color values which are stored in a two dimensional array.

void DrawModelGLSW::Init void   )  [virtual]
 

This function overwrites the base init funtion of the class OpenGLCode.

It contains the actual initialization code in OpenGL and also performs the code.

void DrawModelGLSW::set_CanvasBackColor Color  n_CanvasBackColor  ) 
 

Sets a new canvas background color.

Parameters:
n_CanvasBackColor the new canvas background color as an instance of the standard color class.

void DrawModelGLSW::set_CanvasHeight short  n_CanvasHeight  ) 
 

Sets a new height for the canvas.

Parameters:
n_CanvasHeight the new canvas height.

void DrawModelGLSW::set_CanvasWidth short  n_CanvasWidth  ) 
 

Sets a new witdh for the canvas.

Parameters:
n_CanvasWidth the new canvas width.

void DrawModelGLSW::set_TextureHeight short  n_TextureHeight  ) 
 

Sets a new height for the used texture object.

Parameters:
n_TextureHeight the new texture object height.

void DrawModelGLSW::set_TextureWidth short  n_TextureWidth  ) 
 

Sets a new width for the used texture object.

Parameters:
n_TextureWidth the new texture object width.

void DrawModelGLSW::setFrameBuffer unsigned char n_FrameBuffer  __gc[]  ) 
 

Sets new final color values as an two dimensional 8-bit array.

Note that the dimensions of the color values array need not to be equal to the dimension of the current texture object (which actually is equal to the canvas dimension) because sampling is implemented.

Parameters:
n_FrameBuffer the final color values.


The documentation for this class was generated from the following files:
Generated on Sat Apr 9 11:51:00 2005 for RayCaster wiht Importance Driven Volume Rendering (IDVR) by  doxygen 1.4.1