H3D::H3DWindowNode Class Reference
[X3D node classes.]

The base class for all window nodes. More...

#include <H3DWindowNode.h>

Inheritance diagram for H3D::H3DWindowNode:

Inheritance graph
List of all members.

Public Types

typedef TypedSFNode< ViewpointSFViewpoint

Public Member Functions

 H3DWindowNode (Inst< SFInt32 > _width=0, Inst< SFInt32 > _height=0, Inst< SFBool > _fullscreen=0, Inst< SFBool > _mirrored=0, Inst< RenderMode > _renderMode=0, Inst< SFViewpoint > _viewpoint=0, Inst< SFTime > _time=0)
 Constructor.
 ~H3DWindowNode ()
 Destructor.
virtual void swapBuffers ()=0
 Virtual function to swap buffers.
virtual void initWindow ()=0
 Virtual function that should create a new window and set its properties depending on the fields.
virtual void initWindowHandler ()=0
 Virtual function to initialize the window handler if needed. E.g. glutInit().
virtual void setFullscreen (bool fullscreen)=0
 Virtual function to set whether the window should be fullscreen or not.
virtual void makeWindowActive ()=0
 Virtual function to make the current window active, i.e.
virtual void initialize ()
 Initialize the window node.
virtual void render (X3DChildNode *child_to_render)
 This function renders the X3DChildNode given into the window of the H3DWindowNode.
virtual void reshape (int w, int h)
 This function will be called when the window size has changed.
virtual void display ()
 This function is called when the window has to redraw itself.
bool calculateFarAndNearPlane (H3DFloat &far, H3DFloat &near, X3DChildNode *child, Viewpoint *vp, bool include_stylus)
 Calculate the far and near clipping planes from the bounding box of a X3DChildNode.
void shareRenderingContext (H3DWindowNode *w)
 This function shares the rendering context between this H3DWindowNode and the one given as an argument.

Public Attributes

auto_ptr< SFInt32width
 The width in pixels of the window.
auto_ptr< SFInt32height
 The height in pixels of the window.
auto_ptr< SFBoolfullscreen
 Determines if the window should be in fullscreen or not.
auto_ptr< SFBoolmirrored
 Determines if the scene rendered should be mirrored or not.
auto_ptr< RenderModerenderMode
 The mode to render the scene in the window in.
auto_ptr< SFViewpointviewpoint
 If the viewpoint field is specified, that viewpoint is used by the rendering in H3DWindowNode instead of the stack top of the Viewpoint bindable stack.
auto_ptr< SFTimetime

Static Public Attributes

static set< H3DWindowNode * > windows
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

X3DChildNodelast_render_child
int window_id
bool rebuild_stencil_mask
unsigned char * stencil_mask
unsigned int stencil_mask_height
unsigned int stencil_mask_width

Static Protected Attributes

static bool GLEW_init = false

Classes

class  RenderMode
 The mode for rendering specified as a string. More...

Detailed Description

The base class for all window nodes.

A H3DWindowNode handles creation of windows and window properties for looking into a Scene. To implement a new window class the following functions has to be specified: swapBuffers(), initWindow(), initWindowHandler(), setFullscreen( bool fullscreen ) makeWindowActive(). For example implementation see GLUTWindow.


Member Function Documentation

bool H3DWindowNode::calculateFarAndNearPlane H3DFloat far,
H3DFloat near,
X3DChildNode child,
Viewpoint vp,
bool  include_stylus
 

Calculate the far and near clipping planes from the bounding box of a X3DChildNode.

The far and near planes will be calculated on contain the node but nothing else. Requires the bounding box type to be BoxBound.

Parameters:
far Return param for the far plane.
near Return param for the near plane.
child The child node we want to be visible.
vp The Viewpoint in the scene.
include_stylus if true the stylus from each HapticsDevice in DeviceInfo will also be included in the calculations of the planes. The bounding box we will use is then the union of the stylus fields and the child parameter.
Returns:
True if successfully calculated and returned parameters. false if the bounding boxes was of another type than BoxBound.

virtual void H3D::H3DWindowNode::makeWindowActive  )  [pure virtual]
 

Virtual function to make the current window active, i.e.

make subsequent OpenGL calls draw in the context of this window.

Implemented in H3D::GLUTWindow.

void H3DWindowNode::shareRenderingContext H3DWindowNode w  ) 
 

This function shares the rendering context between this H3DWindowNode and the one given as an argument.

This means that the two windows after the call can share display lists and textures. When several H3DWindowNode instances are created this function will always be called to share the rendering context between them, i.e. all H3DWindowNode instances share rendering context by default.


Member Data Documentation

auto_ptr< SFBool > H3D::H3DWindowNode::fullscreen
 

Determines if the window should be in fullscreen or not.

Access type: inputOutput
Default value: FALSE

auto_ptr< SFInt32 > H3D::H3DWindowNode::height
 

The height in pixels of the window.

Access type: inputOutput
Default value: 600

auto_ptr< SFBool > H3D::H3DWindowNode::mirrored
 

Determines if the scene rendered should be mirrored or not.

Access type: inputOutput
Default value: FALSE

auto_ptr< RenderMode > H3D::H3DWindowNode::renderMode
 

The mode to render the scene in the window in.

See RenderMode::Mode for valid values. Values are specified as a string with the same name as the enum value of the mode you want.

Access type: inputOutput
Default value: "MONO"

auto_ptr< SFViewpoint > H3D::H3DWindowNode::viewpoint
 

If the viewpoint field is specified, that viewpoint is used by the rendering in H3DWindowNode instead of the stack top of the Viewpoint bindable stack.

This is so that multiple windows with different viewpoints can be specified.

Access type: inputOutput
Default value: NULL

auto_ptr< SFInt32 > H3D::H3DWindowNode::width
 

The width in pixels of the window.

Access type: inputOutput
Default value: 800


Generated on Thu Aug 24 12:39:23 2006 for H3D API by  doxygen 1.4.5