cPanel Class Reference

This class represents a rectangular panel that can be displayed within a CHAI viewport, and it is intended to be added to the front and back 2d rendering trees within the camera class. It generally behaves like a cMesh (from which it subclasses), you can give it colors, materials, textures, etc. It can also be used as a 3D rectangle, although its primary purpose is for 2D rendering. More...

#include <CPanel.h>

Inheritance diagram for cPanel:

cMesh cGenericObject cLabelPanel List of all members.

Public Member Functions

 cPanel (cWorld *a_world, const bool a_enableCollisionDetecion=false)
 Constructor of cPanel.
virtual ~cPanel ()
 Destructor of cPanel.
bool getDisplayRect ()
 Returns true if a solid rectangle is being rendered to represent the panel.
void setDisplayRect (const bool &a_showRect)
 Controls the rendering of a solid rectangle at the location of the panel.
bool getDisplayEdges ()
 Returns true if a rectangle outline is being rendered around the panel.
void setDisplayEdges (const bool &a_showEdges)
 Controls the rendering of a rectangle outline around the panel.
void setSize (const cVector3d &a_size)
 Set the width and height of the panel (in pixels) (z is ignored).
cVector3d getSize ()
 Get the width and height of the panel (in pixels) (z is ignored).
void setEdgeWidth (const float &a_width)
 Set the width used to render the panel outline.
float getEdgeWidth ()
 Get the width used to render the panel outline.
virtual void render (const int a_renderMode=0)
 Render the panel (overrides the parent render function).

Public Attributes

cColorf m_rectColor
cColorf m_edgeColor
 The color of the rectangle outline. Has no effect if m_showEdges is false.
bool m_disableClipping
 Should clipping be explicitly disabled for this panel?
bool m_useLighting
 Should I use GL lighting? Usually you want this off for 'true 2d'.
bool m_disableDepthTest
 Should depth-testing be explicitly disabled for this panel?
bool m_usePolygonOffset
 Should polygon-offseting be used for this panel?

Protected Attributes

bool m_showRect
 Controls the rendering of a solid rectangle at the location of the panel.
bool m_showEdges
 Controls the rendering of a rectangle outline around the panel.
float m_edgeWidth
 The width used to render the panel outline.
cVector3d m_size
 The size of the panel (in 2D mode, this is in pixels and z is ignored).

Detailed Description

This class represents a rectangular panel that can be displayed within a CHAI viewport, and it is intended to be added to the front and back 2d rendering trees within the camera class. It generally behaves like a cMesh (from which it subclasses), you can give it colors, materials, textures, etc. It can also be used as a 3D rectangle, although its primary purpose is for 2D rendering.


Constructor & Destructor Documentation

cPanel::cPanel ( cWorld a_world,
const bool  a_enableCollisionDetecion = false 
)

Constructor of cPanel.

Constructor of cPanel

Parameters:
a_world The parent CHAI world
a_enableCollisionDetecion Should this panel exist in the world for cd purposes?

cPanel::~cPanel (  )  [virtual]

Destructor of cPanel.

Destructor of cPanel


Member Function Documentation

void cPanel::setSize ( const cVector3d a_size  ) 

Set the width and height of the panel (in pixels) (z is ignored).

Set the width and height of the panel (in pixels) (z is ignored)

Parameters:
a_size New size of the panel, in pixels (for 2D rendering) or GL units (for 3D rendering). z is ignored.

void cPanel::render ( const int  a_renderMode = 0  )  [virtual]

Render the panel (overrides the parent render function).

Renders a cPanel to the display

Parameters:
a_renderMode Current rendering pass; see cGenericObject::render()

Reimplemented from cMesh.

Reimplemented in cLabelPanel.


Member Data Documentation

cColorf cPanel::m_rectColor

The color of the background rectangle. Has no effect if m_showRect is false, or if m_useColors or m_useMaterials are true. By default, this is the color used to represent the rectangle.

If texturing is enabled, you can use the alpha component of this color to control the alpha of an opaque texture. This is especially useful if you set the texture itself to render in GL_DECAL mode, so the color comes entirely from the texture and the alpha comes from here.


The documentation for this class was generated from the following files:
Generated on Mon Jun 11 09:41:47 2007 for CHAI 3D by  doxygen 1.5.2