RenderWindow Class Reference

#include <RenderWindow.h>

List of all members.

Public Types

 IDD = IDD_DIALOG3
enum  { IDD = IDD_DIALOG3 }

Public Member Functions

 RenderWindow (CWnd *pParent=NULL)
virtual ~RenderWindow ()
virtual void renderScene ()
virtual BOOL initOpenGL ()
void setContext ()
void OnMouseMove (UINT flags, CPoint point)
void OnPaint ()
void redraw ()
void recalc ()
void setVolumeLoader (VolumeLoader *vol_load)
void setInvViewMatrix (matrix44 matr)

Public Attributes

CDC * device_context_
 The device context.
CWnd * theParent
 the parent cchildframe.
OpaqueCubesopaque_cubes_
 This holds the opaque cube algorithm.
bool are_opaque_cubes_already_created_
 This holds the opaque cube creation flag.

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
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)
afx_msg void OnSize (UINT type, int new_width, int new_height)

Protected Attributes

Volumevolume_
 The volume.
VolumeLoadervolume_loader_
 The volume loader.
HGLRC rendering_context_
 The rendering context handle.
Raycasterraycaster_
 This holds the raycaster.
float zoom_
 This holds the value of the zoom.
float x_pos_
 This holds the x position of the camera.
float y_pos_
 This holds the y position of the camera.
matrix44 view_matrix_
 The view matrix of the volume.
matrix44 inv_view_matrix_
 The inverse view matrix of the volume.
float rotation_angle_
 This holds the rotation angle adjusted by the mouse movements.
Vector3 rotation_axis_
 This holds the rotation axis adjusted by the mouse movements.
int last_mouse_x_
 This holds the last x mouse position.
int last_mouse_y_
 This holds the last y mouse position.
float x_rot_
float y_rot_
 This holds the y rotation angle.
double view_width_height_ratio_


Member Enumeration Documentation

anonymous enum

Enumerator:
IDD 


Constructor & Destructor Documentation

RenderWindow::RenderWindow ( CWnd *  pParent = NULL  ) 

RenderWindow::~RenderWindow (  )  [virtual]


Member Function Documentation

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

Creates the OpenGL context for drawing on the view.

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

void RenderWindow::DoDataExchange ( CDataExchange *  pDX  )  [protected, virtual]

BOOL RenderWindow::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 RenderWindow::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 RenderWindow::OnDestroy (  )  [protected]

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

void RenderWindow::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 RenderWindow::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 RenderWindow::OnMouseMove ( UINT  flags,
CPoint  point 
)

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 RenderWindow::OnPaint (  ) 

void RenderWindow::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 RenderWindow::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 RenderWindow::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 RenderWindow::recalc (  ) 

void RenderWindow::redraw (  ) 

void RenderWindow::renderScene (  )  [virtual]

Renders the scene of the current OpenGL view.

void RenderWindow::setContext (  ) 

Sets the rendering context.

void RenderWindow::setInvViewMatrix ( matrix44  matr  ) 

BOOL RenderWindow::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 RenderWindow::setVolumeLoader ( VolumeLoader vol_load  ) 

void RenderWindow::swapGLBuffers (  )  [protected]

Sets the device context.


Member Data Documentation

bool RenderWindow::are_opaque_cubes_already_created_

This holds the opaque cube creation flag.

CDC* RenderWindow::device_context_

The device context.

matrix44 RenderWindow::inv_view_matrix_ [protected]

The inverse view matrix of the volume.

int RenderWindow::last_mouse_x_ [protected]

This holds the last x mouse position.

int RenderWindow::last_mouse_y_ [protected]

This holds the last y mouse position.

OpaqueCubes* RenderWindow::opaque_cubes_

This holds the opaque cube algorithm.

Raycaster* RenderWindow::raycaster_ [protected]

This holds the raycaster.

HGLRC RenderWindow::rendering_context_ [protected]

The rendering context handle.

float RenderWindow::rotation_angle_ [protected]

This holds the rotation angle adjusted by the mouse movements.

Vector3 RenderWindow::rotation_axis_ [protected]

This holds the rotation axis adjusted by the mouse movements.

CWnd* RenderWindow::theParent

the parent cchildframe.

matrix44 RenderWindow::view_matrix_ [protected]

The view matrix of the volume.

double RenderWindow::view_width_height_ratio_ [protected]

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

Volume* RenderWindow::volume_ [protected]

The volume.

VolumeLoader* RenderWindow::volume_loader_ [protected]

The volume loader.

float RenderWindow::x_pos_ [protected]

This holds the x position of the camera.

float RenderWindow::x_rot_ [protected]

float RenderWindow::y_pos_ [protected]

This holds the y position of the camera.

float RenderWindow::y_rot_ [protected]

This holds the y rotation angle.

float RenderWindow::zoom_ [protected]

This holds the value of the zoom.


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