#include <GReparentAgent.h>
Inheritance diagram for GBE::GReparentAgent:


Public Slots | |
| virtual void | receiveInfluence (const GCS::GElementInfluence &influence) |
Public Member Functions | |
| GReparentAgent () | |
| virtual | ~GReparentAgent () |
Protected Member Functions | |
| void | performReparenting (const GCS::GElementID &new_parent, const GCS::GVector3 &pos_add, const GCS::GVector3 &rotate, double angle) |
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.
| GBE::GReparentAgent::GReparentAgent | ( | ) |
Constructor.
| GBE::GReparentAgent::~GReparentAgent | ( | ) | [virtual] |
Virtual Destructor.
| void GBE::GReparentAgent::performReparenting | ( | const GCS::GElementID & | new_parent, | |
| const GCS::GVector3 & | pos_add, | |||
| const GCS::GVector3 & | rotate, | |||
| double | angle | |||
| ) | [protected] |
Do the actual reparenting. This is done by the reparented element.
| void GBE::GReparentAgent::receiveInfluence | ( | const GCS::GElementInfluence & | influence | ) | [virtual, slot] |
Analyses given influence and checks for reparenting to the source of the influence. At this point this element also checks for reparenting into the parent's parent.
1.4.7