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

GBE::GReparentAgent Class Reference

Handles element restructuring of child elements according to their positions. More...

#include <GReparentAgent.h>

Inheritance diagram for GBE::GReparentAgent:

Inheritance graph
[legend]
Collaboration diagram for GBE::GReparentAgent:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void receiveInfluence (GCS::GElementInfluence &influence)

Public Member Functions

 GReparentAgent (QObject *parent=0, const char *name=0)
virtual ~GReparentAgent ()

Protected Member Functions

void performReparenting (const GCS::GElementID &new_parent, const GCS::GVector3 &pos_add, const GCS::GVector3 &rotate)

Detailed Description

Handles element restructuring of child elements according to their positions.

Author:
Raphael Langerhorst
When receiving influences from child elements and these influences are GPositionalInfluence or compatible, the agent checks if the child is still in the context of itself - the child's current parent. If the child has left its current parent (according to position and size), a reparent influence is created and sent to the child and the new parent so they can change their child/parent settings. When the child has left this element it is reparented to this element's parent.

If a reparent influence is received, the agent updates the parent/child information of the element and emits a reparent signal (NOT influence!) to let the GWE know about it.

This agent also handles reparenting of itself into another child of the same parent. This happens when this element is completely enclosed in another element of the same parent. On such cases a reparenting influence is sent to the current parent and the new child so they can update their child/parent data.

In all cases the reparented element has to perform form transformation because position and rotation is always relative to the current parent. The required transformation information is included in the reparenting influence which is sent by the element/agent that detects reparenting.

Position and size information is stored in the form attribute of an element. GRadiatingAgent is taking care of influence radiation which is required for this agent to work as these influences include the position and size information.

See also:
GReparentInfluence, GPositionalInfluence


Constructor & Destructor Documentation

GBE::GReparentAgent::GReparentAgent QObject *  parent = 0,
const char *  name = 0
 

Constructor.

GBE::GReparentAgent::~GReparentAgent  )  [virtual]
 

Virtual Destructor.


Member Function Documentation

void GBE::GReparentAgent::performReparenting const GCS::GElementID new_parent,
const GCS::GVector3 pos_add,
const GCS::GVector3 rotate
[protected]
 

Do the actual reparenting. This is done by the reparented element.

void GBE::GReparentAgent::receiveInfluence GCS::GElementInfluence influence  )  [virtual, slot]
 

Analyses given influence and checks for reparenting if it's a GPositionalInfluence or performs reparenting work if it is a GReparentInfluence.

Reimplemented from GCS::GAgent.


The documentation for this class was generated from the following files:
Generated on Thu Oct 21 21:18:16 2004 for G System by doxygen 1.3.6