pgDraw Class Reference
[pgDraw -- Graphics module]

The base class of the drawable-object classes. More...

#include <pg_draw.h>

Inheritance diagram for pgDraw:

pgNode pgPrim pgSprt

List of all members.

Public Types

enum  DrawType { TYPE_NODE, TYPE_PRIM, TYPE_SPRT }
 The types of the drawable-objects. More...
enum  DepthTest {
  DEPTH_TEST_ALWAYS, DEPTH_TEST_LESS, DEPTH_TEST_GREATER, DEPTH_TEST_LEQUAL,
  DEPTH_TEST_GEQUAL
}
 The types of the depth tests. More...
enum  BlendMode { BLEND_OFF, BLEND_HALF, BLEND_ADD, BLEND_DEST_ALPHA }
 The types of the alpha-blending mode. More...
enum  DrawFlag {
  FLAG_BOUND_CLIP, FLAG_SORT, FLAG_WRITE_RGB, FLAG_WRITE_ALPHA,
  FLAG_WRITE_DEPTH, FLAG_BACKFACE_CULLING, FLAG_BILINEAR
}
 The flags which specify the drawing attributes. More...

Public Member Functions

 pgDefineException (ExceptionInvalidArgument)
 pgDefineException (ExceptionInvalidCall)
 pgDefineException (ExceptionNotInitialized)
virtual ~pgDraw ()
 Destructs this pgDraw.
bool hasScreen () const
 Returns whether this pgDraw belongs to a pgScr directly.
pgID getScreenID () const
 Returns the ID of the screen which this pgDraw belongs to directly.
void setScreenID (pgID scr_id)
 TODO.
bool hasParent () const
 Returns whether this pgDraw has a parent pgDraw.
pgDrawgetParentN () const
 Returns the parent pgDraw of this pgDraw.
void setParent (pgDraw *parent)
 TODO.
pgDrawgetPrevAllN () const
 Returns the previous pgDraw of this pgDraw.
pgDrawgetNextAllN () const
 Returns the next pgDraw of this pgDraw.
pgDrawgetPrevSiblingN () const
 Returns the previous sibling pgDraw of this pgDraw.
pgDrawgetNextSiblingN () const
 Returns the next sibling pgDraw of this pgDraw.
pgDrawgetLastDesc () const
 TODO.
bool hasChild () const
 TODO.
pgDrawgetFirstChildN () const
 TODO.
pgDrawgetLastChildN () const
 TODO.
void moveFirst ()
 TODO.
void moveLast ()
 TODO.
void moveBefore (pgDraw *draw)
 TODO.
void moveAfter (pgDraw *draw)
 TODO.
DrawType getType () const
 TODO.
bool isVisible () const
 TODO.
void setVisible (bool is_visible)
 TODO.
pgCol getColor () const
 TODO.
void setColor (pgCol col)
 TODO.
DepthTest getDepthTest () const
 TODO.
void setDepthTest (DepthTest depth_test)
 TODO.
BlendMode getBlendMode () const
 TODO.
void setBlendMode (BlendMode blend_mode)
 TODO.
bool isDrawFlag (DrawFlag draw_flag) const
 TODO.
void setDrawFlag (DrawFlag draw_flag, bool is_on)
 TODO.
void clearDrawFlag ()
 TODO.
void copyDrawFlag (const pgDraw *src)
 TODO.
void setPreset_defaultBlendOff ()
 TODO.
void setPreset_defaultBlendHalf ()
 TODO.
void setPreset_defaultBlendAdd ()
 TODO.
const pgVecgetClipBoundMin () const
 TODO.
const pgVecgetClipBoundMax () const
 TODO.
void setClipBound (const pgVec &bound_min, const pgVec &bound_max)
 TODO.
const pgVecgetSortCenter () const
 TODO.
void setSortCenter (const pgVec &sort_center)
 TODO.
r32 getSortOffset () const
 Returns the value of sort offset.
void setSortOffset (r32 sort_offset)
 Sets the specified value of sort offset.
pgID getTextureID () const
 Returns the texture ID which this pgDraw uses.
void setTextureID (pgID tex_id)
 Sets the specified texture ID to this pgDraw.
pgMatlocal ()
 Returns the local matrix.
pgMat calcWorld () const
 Calculates and returns the world matrix at present.
pgCol calcFinalColor () const
 Calculates and returns the final drawing color at present.

Protected Types

enum  PrivateFlag { FLAG_INITIALIZED, FLAG_VISIBLE }

Protected Member Functions

void setupWorld ()
void setupFinalColor ()
void setupSortValue (const pgMat &view)
void setupDrawState ()
virtual void render (const pgMat &view)

Protected Attributes

pgTree< pgDrawm_tree
pgType< u8, DrawTypem_type
pgType< u8, DepthTestm_depth_test
pgType< u8, BlendModem_blend_mode
pgFlag< u8, PrivateFlag > m_private_flag
pgFlag< u16, DrawFlagm_draw_flag
pgID m_scr_id
pgTexm_tex
pgMat m_local
pgMat m_world
pgCol m_local_col
pgCol m_final_col
pgVec m_bound_min
pgVec m_bound_max
pgVec m_sort_center
r32 m_sort_offset
r32 m_sort_value
pgDrawm_next_sort

Friends

class pgScr
class pgDrawMgr


Detailed Description

The base class of the drawable-object classes.

Member Enumeration Documentation

The types of the alpha-blending mode.

Enumerator:
BLEND_OFF  TODO.
BLEND_HALF  TODO.
BLEND_ADD  TODO.
BLEND_DEST_ALPHA  TODO.

The types of the depth tests.

Enumerator:
DEPTH_TEST_ALWAYS  TODO.
DEPTH_TEST_LESS  TODO.
DEPTH_TEST_GREATER  TODO.
DEPTH_TEST_LEQUAL  TODO.
DEPTH_TEST_GEQUAL  TODO.

The flags which specify the drawing attributes.

Enumerator:
FLAG_BOUND_CLIP  TODO.
FLAG_SORT  TODO.
FLAG_WRITE_RGB  TODO.
FLAG_WRITE_ALPHA  TODO.
FLAG_WRITE_DEPTH  TODO.
FLAG_BACKFACE_CULLING  TODO.
FLAG_BILINEAR  TODO.

The types of the drawable-objects.

Enumerator:
TYPE_NODE  The node drawable-object.

TYPE_PRIM  The primitive drawable-object.

TYPE_SPRT  The sprite drawable-object.


Member Function Documentation

pgCol pgDraw::calcFinalColor (  )  const

Calculates and returns the final drawing color at present.

Returns:
The final drawing color at present.

pgMat pgDraw::calcWorld (  )  const

Calculates and returns the world matrix at present.

Returns:
The world matrix at present.

pgDraw* pgDraw::getNextAllN (  )  const

Returns the next pgDraw of this pgDraw.

If this pgDraw has no next pgDraw, returns NULL. This method is used to follow the whole tree as list structure.

Returns:
The previous pgDraw of this pgDraw.

pgDraw* pgDraw::getNextSiblingN (  )  const

Returns the next sibling pgDraw of this pgDraw.

If this pgDraw has no next sibling pgDraw, return NULL.

Returns:
The next sibling pgDraw of this pgDraw.

pgDraw* pgDraw::getParentN (  )  const

Returns the parent pgDraw of this pgDraw.

If this pgDraw has no parent pgDraw, return NULL.

Returns:
The parent pgDraw of this pgDraw.

pgDraw* pgDraw::getPrevAllN (  )  const

Returns the previous pgDraw of this pgDraw.

If this pgDraw has no previous pgDraw, returns NULL. This method is used to follow the whole tree as list structure.

Returns:
The previous pgDraw of this pgDraw.

pgDraw* pgDraw::getPrevSiblingN (  )  const

Returns the previous sibling pgDraw of this pgDraw.

If this pgDraw has no previous sibling pgDraw, return NULL.

Returns:
The previous sibling pgDraw of this pgDraw.

pgID pgDraw::getScreenID (  )  const

Returns the ID of the screen which this pgDraw belongs to directly.

If this pgDraw belongs to no screen, an exception occurs.

Returns:
The id of the screen which this pgDraw belongs to directly.

r32 pgDraw::getSortOffset (  )  const

Returns the value of sort offset.

Returns:
The value of sort offset.

pgID pgDraw::getTextureID (  )  const

Returns the texture ID which this pgDraw uses.

If no texture is used, returns pgID::ZERO.

Returns:
The texture ID which this pgDraw uses.

bool pgDraw::hasParent (  )  const

Returns whether this pgDraw has a parent pgDraw.

Returns:
Whether this pgDraw has a parent pgDraw.

bool pgDraw::hasScreen (  )  const

Returns whether this pgDraw belongs to a pgScr directly.

Returns:
Whether this pgDraw belongs to a pgScr directly.

pgMat& pgDraw::local (  ) 

Returns the local matrix.

Returns:
The local matrix.

void pgDraw::setSortOffset ( r32  sort_offset  ) 

Sets the specified value of sort offset.

Parameters:
sort_offset The value of sort offset.

void pgDraw::setTextureID ( pgID  tex_id  ) 

Sets the specified texture ID to this pgDraw.

If pgID::ZERO is specified, uses no texture.

Parameters:
tex_id A texture ID.


The documentation for this class was generated from the following file:

Generated on Sat Aug 15 11:24:38 2009 for Pogolyn by  doxygen 1.5.8