Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Object Class Reference

#include <object.h>

Inheritance diagram for Object:

Inheritance graph
[legend]
Collaboration diagram for Object:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class all window toolkit object are derived from.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Types

enum  HITTESTRESULT { OUTSIDE, INSIDE, EDGE }
 Identifiers for hit test result. More...


Public Member Functions

 Object (Object *pkParent, Object *pkObject=0, bool bDuplicateChildren=true)
virtual ~Object ()
virtual const CoordSetPosition (const Coord &rkPos)
virtual const CoordSetSize (const Coord &rkSize)
const CoordGetPosition () const
const CoordGetWorldPosition ()
const CoordGetSize () const
virtual void SetName (const NeoEngine::HashString &rstrName)
virtual const NeoEngine::HashString & GetName () const
virtual void SetAttribute (const AttributeBase &rkAttribute)
unsigned int GetID () const
virtual ObjectGetParent ()
virtual ObjectGetRoot ()
virtual ObjectGetObject (const std::string &rstrName)
virtual const std::vector<
Object * > & 
GetChildObjects () const
virtual void AttachObject (Object *pkObject)
virtual void DetachObject (Object *pkObject)
virtual void AttachToObject (Object *pkParent)
virtual unsigned int ProcessMsg (Msg *pkMsg)
virtual bool Render (NeoEngine::Frustum *pkFrustum=0, bool bForce=false)
virtual void AddHook (MsgHook *pkMsgHook)
virtual void RemoveHook (MsgHook *pkMsgHook)
virtual void Input (const NeoEngine::InputEvent *pkEvent)
HITTESTRESULT HitTest (const Coord &rkCoord)
virtual void Update (float fDeltaTime)
virtual ObjectDuplicate (Object *pkParent=0, Object *pkObject=0)

Protected Member Functions

void UpdateWorldCache (bool bRecurse=true)

Protected Attributes

unsigned int m_uiID
Objectm_pkParent
std::vector< Object * > m_vpkChildren
Coord m_kPos
Coord m_kWorldPos
Coord m_kSize
NeoEngine::HashString m_strName
std::vector< MsgHook * > m_vpkMsgHook
HITTESTRESULT m_eLastMouse


Member Enumeration Documentation

enum HITTESTRESULT
 

Identifiers for hit test result.

Enumeration values:
OUTSIDE  Coordinate was outside area
INSIDE  Coordinate was inside area
EDGE  Coordinate was on edge of area


Constructor & Destructor Documentation

Object Object pkParent,
Object pkObject = 0,
bool  bDuplicateChildren = true
 

Parameters:
pkParent Parent object
pkObject Reference object to copy values from
bDuplicateChildren If reference object given and this flag true, duplicate child objects

virtual ~Object  )  [virtual]
 

Deletes all child objects


Member Function Documentation

void UpdateWorldCache bool  bRecurse = true  )  [protected]
 

Update world cache position and recurse on children if flag set

Parameters:
bRecurse Recursion flag

virtual const Coord& SetPosition const Coord rkPos  )  [virtual]
 

Set position relative parent

Parameters:
rkPos Position
Returns:
New relative position

virtual const Coord& SetSize const Coord rkSize  )  [virtual]
 

Set size

Parameters:
rkSize Size
Returns:
New size

Reimplemented in Area, BorderArea, and Button.

const Coord& GetPosition  )  const
 

Returns:
Position relative parent

const Coord& GetWorldPosition  ) 
 

Returns:
World position

const Coord& GetSize  )  const
 

Returns:
Size

virtual void SetName const NeoEngine::HashString &  rstrName  )  [virtual]
 

Parameters:
rstrName New name

virtual const NeoEngine::HashString& GetName  )  const [virtual]
 

Returns:
Name

virtual void SetAttribute const AttributeBase rkAttribute  )  [virtual]
 

Set an attribute

Parameters:
rkAttribute Attribute

Reimplemented in TextArea.

unsigned int GetID  )  const [inline]
 

Returns:
Object ID

virtual Object* GetParent  )  [virtual]
 

Returns:
Parent object

virtual Object* GetRoot  )  [virtual]
 

Returns:
Root object

virtual Object* GetObject const std::string &  rstrName  )  [virtual]
 

Search for a child object by name ("parent" for parent object, "root" for root object)

Parameters:
rstrName Name of object
Returns:
Matching child object, null if not found

virtual const std::vector< Object* >& GetChildObjects  )  const [virtual]
 

Get all child objects (no recursion)

Returns:
Vector with child objects

virtual void AttachObject Object pkObject  )  [virtual]
 

Attach window object

Parameters:
pkObject Object

virtual void DetachObject Object pkObject  )  [virtual]
 

Detach window object

Parameters:
pkObject Object

virtual void AttachToObject Object pkParent  )  [virtual]
 

Attach this object to new parent

Parameters:
pkParent Parent object

virtual unsigned int ProcessMsg Msg pkMsg  )  [virtual]
 

Process message

Parameters:
pkMsg Message object
Returns:
Message specific return code, 0 indicates message was unprocessed

Reimplemented in Area, Button, and EditBox.

virtual bool Render NeoEngine::Frustum *  pkFrustum = 0,
bool  bForce = false
[virtual]
 

Render object, recurses on children

Parameters:
pkFrustum Currently ignored
bForce Force rendering
Returns:
true if rendered, false if not

Reimplemented in Area, BorderArea, Button, EditBox, and TextArea.

virtual void AddHook MsgHook pkMsgHook  )  [virtual]
 

Add a message hook object (hook object will be freed in dtor)

Parameters:
pkMsgHook Message hook object

virtual void RemoveHook MsgHook pkMsgHook  )  [virtual]
 

Remove a message hook object (you must now free the hook object yourself)

Parameters:
pkMsgHook Message hook object

virtual void Input const NeoEngine::InputEvent *  pkEvent  )  [virtual]
 

Process input

Parameters:
pkEvent Event

HITTESTRESULT HitTest const Coord rkCoord  ) 
 

Test if coordinate is inside, on edge or outside object area

Parameters:
rkCoord Coordinate to test
Returns:
Hit test identifier

virtual void Update float  fDeltaTime  )  [virtual]
 

Update object

Parameters:
fDeltaTime Deltatime passed since last update

Reimplemented in EditBox.

virtual Object* Duplicate Object pkParent = 0,
Object pkObject = 0
[virtual]
 

Duplicate and/or copy this object

Parameters:
pkParent Parent object to attach to
pkObject Object to copy data into, if null will allocate new object. Will only duplicate children if this object is null or has no children
Returns:
New object that is duplicate of this object

Reimplemented in Area, BorderArea, Button, EditBox, and TextArea.


Member Data Documentation

unsigned int m_uiID [protected]
 

Unique ID

Object* m_pkParent [protected]
 

Parent object

std::vector< Object* > m_vpkChildren [protected]
 

Children

Coord m_kPos [protected]
 

Position relative parent

Coord m_kWorldPos [protected]
 

World position

Coord m_kSize [protected]
 

Size

NeoEngine::HashString m_strName [protected]
 

Name

std::vector< MsgHook* > m_vpkMsgHook [protected]
 

Hooked message actions

HITTESTRESULT m_eLastMouse [protected]
 

Result of last mouse hit test


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:20 2004 for NeoWTK by doxygen 1.3.5