AnimatLab  2
Test
AnimatSim::IMovableItemCallback Class Referenceabstract

Movable Item callback to the GUI. More...

#include <IMovableItemCallback.h>

+ Collaboration diagram for AnimatSim::IMovableItemCallback:

Public Member Functions

 IMovableItemCallback (void)
 Default constructor. More...
 
virtual ~IMovableItemCallback (void)
 Destructor. More...
 
virtual void AddBodyClicked (float fltPosX, float fltPosY, float fltPosZ, float fltNormX, float fltNormY, float fltNormZ)=0
 Called to signal to the GUI that a part was clicked while AddBody mode was active. More...
 
virtual void PositionChanged ()=0
 Called to signal to the GUI that the position of the body part changed. More...
 
virtual void RotationChanged ()=0
 Called to signal to the GUI that the rotation of the body part changed. More...
 
virtual void SelectedVertexChanged (float fltPosX, float fltPosY, float fltPosZ)=0
 Called to signal when the selected vertex has changed. More...
 
virtual void SelectionChanged (bool bSelected, bool bSelectMultiple)=0
 Called to signal to the GUI that the selected body part changed. More...
 
virtual void SizeChanged ()=0
 Called to signal to the GUI that the size of the body part changed. More...
 

Detailed Description

Movable Item callback to the GUI.

How the Movable Item callback works: I have this interface defined within AnimatSim. It contains NO references to any managed code, so it is still STL compliant and is not used if we are running stand-alone without a gui. If we are running a gui then when the simulation is created each object creates a managed ManagedAnimatTools.DataObjectInterface class that is used to send data down from the managed GUI to the unmanaged sim. If the part it is talking to is a MovableItem or a structure then it also creates a new unmanaged ManagedAnimatTools::MovableItemCallback class that implements the IMovableItemCallback interface. It contains a gcroot pointer to its associated DataObjectInterface and callback methods for PositionChanged, RotationChanged, and SelectionChanged. When the user clicks on an object in the sim window it is picked and the Select method is called. That method checks to see if the pointer to the IMovableItemCallback is not null. If it is not then it calls the SelectionChanged method, which calls that method on the DataObjectInterface, which fires the SelectionChangedEvent of that MovableItem. However, there was a wrinkle in that any UI class has to be able to handle multi-threaded operations. Initially the treecontrol from DotNetMagic could not do that. I added code in the SelectNode to check if an Invoke was required. if it was then it did a begininvoke to re-fire the method using the UI thread.

Author
dcofer
Date
2/25/2011

Definition at line 26 of file IMovableItemCallback.h.

Constructor & Destructor Documentation

AnimatSim::IMovableItemCallback::IMovableItemCallback ( void  )

Default constructor.

Author
dcofer
Date
3/25/2011

Definition at line 14 of file IMovableItemCallback.cpp.

AnimatSim::IMovableItemCallback::~IMovableItemCallback ( void  )
virtual

Destructor.

Author
dcofer
Date
3/25/2011

Definition at line 24 of file IMovableItemCallback.cpp.

Member Function Documentation

virtual void AnimatSim::IMovableItemCallback::AddBodyClicked ( float  fltPosX,
float  fltPosY,
float  fltPosZ,
float  fltNormX,
float  fltNormY,
float  fltNormZ 
)
pure virtual

Called to signal to the GUI that a part was clicked while AddBody mode was active.

Author
dcofer
Date
3/25/2011
Parameters
fltPosXThe x coordinate of the location clicked.
fltPosYThe y coordinate of the location clicked.
fltPosZThe z coordinate of the location clicked.
fltNormXThe x normal of the location clicked.
fltNormYThe y normal of the location clicked.
fltNormZThe z normal of the location clicked.

Referenced by AnimatSim::Environment::BodyPart::AddBodyClicked().

+ Here is the caller graph for this function:

virtual void AnimatSim::IMovableItemCallback::PositionChanged ( )
pure virtual

Called to signal to the GUI that the position of the body part changed.

Author
dcofer
Date
3/25/2011

Referenced by AnimatSim::Environment::MovableItem::Position(), and AnimatSim::Environment::Structure::Position().

+ Here is the caller graph for this function:

virtual void AnimatSim::IMovableItemCallback::RotationChanged ( )
pure virtual

Called to signal to the GUI that the rotation of the body part changed.

Author
dcofer
Date
3/25/2011

Referenced by AnimatSim::Environment::MovableItem::Rotation().

+ Here is the caller graph for this function:

virtual void AnimatSim::IMovableItemCallback::SelectedVertexChanged ( float  fltPosX,
float  fltPosY,
float  fltPosZ 
)
pure virtual

Called to signal when the selected vertex has changed.

Author
dcofer
Date
6/21/2011
Parameters
fltPosXThe position x coordinate.
fltPosYThe position y coordinate.
fltPosZThe position z coordinate.

Referenced by AnimatSim::Environment::MovableItem::SelectedVertex().

+ Here is the caller graph for this function:

virtual void AnimatSim::IMovableItemCallback::SelectionChanged ( bool  bSelected,
bool  bSelectMultiple 
)
pure virtual

Called to signal to the GUI that the selected body part changed.

Author
dcofer
Date
3/25/2011
Parameters
bSelectedtrue if it was selected.
bSelectMultipletrue if multiple items were selected.
virtual void AnimatSim::IMovableItemCallback::SizeChanged ( )
pure virtual

Called to signal to the GUI that the size of the body part changed.

Author
dcofer
Date
6/7/2014

Referenced by AnimatSim::Environment::BodyPart::Resize().

+ Here is the caller graph for this function:


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