OpenGLView Class Reference

#include <OpenGLView.h>

Inheritance diagram for OpenGLView:

BlackView XYView XZView YZView List of all members.

Public Member Functions

virtual ~OpenGLView ()
virtual BOOL initOpenGL ()
CVolumeRendererDocGetDocument ()
virtual void renderScene ()=0
void setContext ()

Public Attributes

CDC * device_context_
 The device context.

Protected Member Functions

 OpenGLView ()
 Implementation for type information about the MFC classes at runtime.
virtual BOOL createViewGLContext ()
BOOL setupPixelFormat ()
void swapGLBuffers ()
virtual void OnDraw (CDC *device_context)
virtual BOOL PreCreateWindow (CREATESTRUCT &create_struct)
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)

Protected Attributes

Volumevolume_
 The volume.
VolumeLoadervolume_loader_
 The volume loader.
HGLRC rendering_context_
 The rendering context handle.
double view_width_height_ratio_
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.

Constructor & Destructor Documentation

OpenGLView::OpenGLView (  )  [protected]

Implementation for type information about the MFC classes at runtime.

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.

CVolumeRendererDoc * OpenGLView::GetDocument (  )  [inline]

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 of the pixel format succeeded, it returns TRUE; otherwise FALSE.

Reimplemented in BlackView, XYView, XZView, and YZView.

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.

Reimplemented in BlackView, XYView, XZView, and YZView.

void OpenGLView::OnDestroy (  )  [protected]

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

Reimplemented in BlackView, XYView, XZView, and YZView.

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.

Reimplemented in BlackView, XYView, XZView, and YZView.

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.

Reimplemented in BlackView, XYView, XZView, and YZView.

virtual void OpenGLView::renderScene (  )  [pure virtual]

Renders the scene of the current OpenGL view.

Implemented in BlackView, XYView, XZView, and YZView.

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.

GLfloat* OpenGLView::light_position_ [protected]

The light position.

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.

Volume* OpenGLView::volume_ [protected]

The volume.

VolumeLoader* OpenGLView::volume_loader_ [protected]

The volume loader.

Reimplemented in XYView, XZView, and YZView.


The documentation for this class was generated from the following files:
Generated on Wed Dec 6 11:27:27 2006 by  doxygen 1.4.7