OpenGLView Class Reference

#include <OpenGLView.h>

List of all members.

Public Member Functions

 OpenGLView (CDocument *, CDC *, CPaintDC &, CRect &)
virtual ~OpenGLView ()
virtual void renderScene ()
virtual BOOL initOpenGL ()
void setContext ()
void OnPaint ()

Public Attributes

CDC * device_context_
 The device context.
int last_mouse_x_
 This holds the last x mouse position.
int last_mouse_y_
 This holds the last y mouse position.
CDocument * document
CPaintDC * paint_device_context_
CRect * rect_
unsigned int x_dim_
unsigned int y_dim_
float pic_size
 The draw size of the image.
RGBAColorpicture_data_
 The color data for the OpenGL rendering.
CFlowVisAppflow_vis_

Protected Member Functions

virtual BOOL createViewGLContext ()
BOOL setupPixelFormat ()
void swapGLBuffers ()
void OnMouseMove (UINT flags, CPoint point)
virtual void OnDraw (CDC *device_context)
virtual BOOL PreCreateWindow (CREATESTRUCT &create_struct)
CFlowVisDocGetDocument ()
afx_msg int OnCreate (LPCREATESTRUCT create_struct)
afx_msg void OnDestroy ()
afx_msg BOOL OnEraseBkgnd (CDC *device_context)
afx_msg void OnTimer (UINT event_id)
afx_msg void OnSize (UINT type, int new_width, int new_height)

Protected Attributes

HGLRC rendering_context_
 The rendering context handle.
GLfloat * ambient_light_
 The ambient light for the lighting of objects.
GLfloat * diffuse_light_
 The diffuse light for the lighting of objects.
GLfloat * light_position_
 The light position.
double view_width_height_ratio_


Constructor & Destructor Documentation

OpenGLView::OpenGLView ( CDocument *  ,
CDC *  ,
CPaintDC &  ,
CRect &   
)

The default constructor.

OpenGLView::~OpenGLView (  )  [virtual]

The destructor.


Member Function Documentation

BOOL OpenGLView::createViewGLContext (  )  [protected, virtual]

Creates the OpenGL context for drawing on the view.

Returns:
Returns TRUE if the creations went well; FALSE otherwise.

CFlowVisDoc* OpenGLView::GetDocument (  )  [inline, protected]

Call this function to get a pointer to the view's document.

Returns:
This returns a pointer to the CDocument object associated with the view. NULL if the view is not attached to a document.

BOOL OpenGLView::initOpenGL (  )  [virtual]

This initializes all stuff needed for the OpenGL rendering.

Returns:
If the setting og the pixel format succeeded, it returns TRUE; otherwise FALSE.

int OpenGLView::OnCreate ( LPCREATESTRUCT  create_struct  )  [protected]

The MFC framework calls this member function when an application requests that the Windows window be created by calling the Create or CreateEx member function.

Parameters:
create_struct Points to a CREATESTRUCT structure that contains information about the CWnd object being created.

void OpenGLView::OnDestroy (  )  [protected]

The framework calls this member function to inform the CWnd object that it is being destroyed.

void OpenGLView::OnDraw ( CDC *  device_context  )  [protected, virtual]

This overrided method is resonsible for rendering of an image of the document.

Parameters:
device_context This is used to render an image of the document.

BOOL OpenGLView::OnEraseBkgnd ( CDC *  device_context  )  [protected]

The MFC framework calls this member function when the CWnd object background needs erasing (for example, when resized).

Parameters:
device_context Specifies the device-context object.

void OpenGLView::OnMouseMove ( UINT  flags,
CPoint  point 
) [protected]

The MFC framework calls this member function when the mouse cursor moves.

Parameters:
flags Indicates whether various virtual keys are down.
point Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.

void OpenGLView::OnPaint (  ) 

void OpenGLView::OnSize ( UINT  type,
int  new_width,
int  new_height 
) [protected]

The framework calls this member function after the window's size has changed. Here we adjust the viewport after sizing the window.

Parameters:
type Specifies the type of resizing requested.
new_width Specifies the new width of the client area.
new_height Specifies the new height of the client area. information about the CWnd object being created.

void OpenGLView::OnTimer ( UINT  event_id  )  [protected]

The framework calls this member function after each interval specified in the SetTimer member function used to install a timer.

Parameters:
event_id Specifies the identifier of the timer.

BOOL OpenGLView::PreCreateWindow ( CREATESTRUCT &  create_struct  )  [protected, virtual]

Called before the creation of the Windows window attached to this CWnd object.

Parameters:
create_struct This structure defines the initialization parameters passed to the window procedure of an application.
Returns:
Returns TRUE if the window creation should continue and FALSE to indicate creation failure.

void OpenGLView::renderScene (  )  [virtual]

Renders the scene of the current OpenGL view.

void OpenGLView::setContext (  ) 

Sets the rendering context.

BOOL OpenGLView::setupPixelFormat (  )  [protected]

Sets the format of the pixels to draw.

Returns:
If the setting of the pixel format succeeded, it returns TRUE; otherwise FALSE.

void OpenGLView::swapGLBuffers (  )  [protected]

Sets the device context.


Member Data Documentation

GLfloat* OpenGLView::ambient_light_ [protected]

The ambient light for the lighting of objects.

CDC* OpenGLView::device_context_

The device context.

GLfloat* OpenGLView::diffuse_light_ [protected]

The diffuse light for the lighting of objects.

CDocument* OpenGLView::document

CFlowVisApp* OpenGLView::flow_vis_

int OpenGLView::last_mouse_x_

This holds the last x mouse position.

int OpenGLView::last_mouse_y_

This holds the last y mouse position.

GLfloat* OpenGLView::light_position_ [protected]

The light position.

CPaintDC* OpenGLView::paint_device_context_

float OpenGLView::pic_size

The draw size of the image.

RGBAColor* OpenGLView::picture_data_

The color data for the OpenGL rendering.

CRect* OpenGLView::rect_

HGLRC OpenGLView::rendering_context_ [protected]

The rendering context handle.

double OpenGLView::view_width_height_ratio_ [protected]

The ratio between the width of the view and the height of the view.

unsigned int OpenGLView::x_dim_

unsigned int OpenGLView::y_dim_


The documentation for this class was generated from the following files:
Generated on Wed Jan 17 09:27:52 2007 for FlowVis by  doxygen 1.4.7