Developer Documentation
SkeletonEditingPlugin Class Reference

#include <Plugin-SkeletonEditing/SkeletonEditingPlugin.hh>

Inheritance diagram for SkeletonEditingPlugin:
RPCInterface BackupInterface LoadSaveInterface ContextMenuInterface ToolbarInterface ScriptInterface LoggingInterface ToolboxInterface PickingInterface KeyInterface MouseInterface BaseInterface

Public Slots

QString version ()
 
Scriptable Functions
void splitBone (int _objectId, int _tailJoint)
 insert a joint in the middle of a bone given by its (unique) tailJoint
 
void addJoint (int _objectId, int _parent, Vector _position)
 add joint to the skeleton
 
void deleteJoint (int _objectId, int _jointId)
 delete joint from the skeleton
 
void transformJoint (int _objectId, int _jointId, Matrix4x4 _matrix)
 transform joint with given matrix More...
 
Matrix4x4 globalMatrix (int _objectId, int _jointId)
 get global matrix of a joint in the active pose
 
Matrix4x4 localMatrix (int _objectId, int _jointId)
 get local matrix of a joint in the active pose
 
Vector globalTranslation (int _objectId, int _jointId)
 get global translation of a joint in the active pose
 
Vector localTranslation (int _objectId, int _jointId)
 get local translation of a joint in the active pose
 
int animationCount (int _objectId)
 get the number of animations
 
int frameCount (int _objectId, int _animationIndex)
 get the number of frames
 
int activeAnimation (int _objectId)
 get active animation
 
int activeFrame (int _objectId)
 get active frame
 
void setActivePose (int _objectId, int _animationIndex, int _frame)
 set active pose
 
void addAnimation (int _objectId, QString _name, int _frames)
 add animation
 
void splitJoint (QMouseEvent *_event)
 split selected Joint More...
 

Signals

void updateView ()
 
void updatedObject (int, const UpdateType &_type)
 
void nodeVisibilityChanged (int)
 
void setRenderer (unsigned int _viewer, QString _rendererName)
 
void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 
void addPickMode (const std::string &_mode)
 
void addHiddenPickMode (const std::string &_mode)
 
void setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking)
 
void setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar)
 
void addContextMenuItem (QAction *_action, ContextMenuType _type)
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void scriptInfo (QString _functionName)
 
void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 
void addToolbar (QToolBar *_toolbar)
 
void getToolBar (QString _name, QToolBar *&_toolbar)
 
void registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false)
 
void addToolbox (QString _name, QWidget *_widget)
 
void addEmptyObject (DataType _type, int &_id)
 
void deleteObject (int _id)
 
void createBackup (int _objectid, QString _name, UpdateType _type=UPDATE_ALL)
 
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application. More...
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot. More...
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer. More...
 
- Signals inherited from KeyInterface
virtual void registerKey (int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse=false)
 Register a key-combination for your plugin. More...
 
- Signals inherited from PickingInterface
virtual void addPickMode (const std::string &_mode)
 Add a new picking mode to the examiner. More...
 
- Signals inherited from ToolboxInterface
virtual void addToolbox (QString _name, QWidget *_widget)
 Add a toolbox widget to the gui with the given name. More...
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- Signals inherited from ScriptInterface
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed. More...
 
virtual void getScriptingEngine (QScriptEngine *&_engine)
 
virtual void executeScript (QString _script)
 
virtual void getAvailableFunctions (QStringList &_functions)
 
- Signals inherited from ToolbarInterface
virtual void addToolbar (QToolBar *_toolbar)
 Adds a Toolbar to the main widget. More...
 
- Signals inherited from ContextMenuInterface
virtual void addContextMenuItem (QAction *_action, ContextMenuType _type)
 Add an entry for a context Menu. More...
 
- Signals inherited from LoadSaveInterface
virtual void save (int _id, QString _filename)
 Save object to a file. More...
 
virtual void load (QString _filename, DataType _type, int &_id)
 Load object from file with a specific DataType. More...
 
- Signals inherited from BackupInterface
virtual void createBackup (int _objectid, QString _name, UpdateType _type=UPDATE_ALL)
 Tell Backup Plugin to create a backup. More...
 
virtual void aboutToRestore (int _objectid)
 Backup Plugin tells other Plugins that a restore will happen. More...
 
virtual void generateBackup (int _id, QString _name, UpdateType _type)
 This signal is emitted by a BackupPlugin and tells a TypePlugin to generate a backup. More...
 
- Signals inherited from RPCInterface
virtual void pluginExists (QString _pluginName, bool &_exists)
 

Public Member Functions

 SkeletonEditingPlugin ()
 Default Constructor. More...
 
 ~SkeletonEditingPlugin ()
 Destructor. More...
 
QString name ()
 Name of the Plugin.
 
QString description ()
 Description of the Plugin.
 

Private Slots

void initializePlugin ()
 
void pluginsInitialized ()
 Initialization of the plugin when it is loaded by the core. More...
 
void slotObjectUpdated (int _id, const UpdateType &_type)
 
void slotMouseWheelEvent (QWheelEvent *_event, const std::string &_mode)
 
void slotMouseEvent (QMouseEvent *_event)
 MousePress event occured. More...
 
void slotKeyEvent (QKeyEvent *_event)
 
void slotKeyReleaseEvent (QKeyEvent *_event)
 
void slotPickModeChanged (const std::string &_mode)
 slot is called when the pickMode changed More...
 
void slotSetEditingMode (QAction *_action)
 
void slotPickToolbarAction (QAction *_action)
 
void setDescriptions ()
 Set Descriptions for Scripting Slots. More...
 
void manipulatorMoved (QtTranslationManipulatorNode *_node, QMouseEvent *_event)
 move the object when its manipulator moves More...
 
void ManipulatorPositionChanged (QtTranslationManipulatorNode *_node)
 update object when its manipulator changes position More...
 
void slotRotateManipulator (bool _toggled)
 
- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin. More...
 
- Private Slots inherited from KeyInterface
virtual void slotKeyEvent (QKeyEvent *_event)
 Key Event from Main App. More...
 

Private Member Functions

void moveJoint (QMouseEvent *_event)
 
bool canModify (QMouseEvent *_event)
 checks, if the skeleton can be modified. a skeleton can be modified, if the active pose is the reference pose More...
 
void insertJoint (QMouseEvent *_event)
 
void cancelJointInsertion ()
 
void deleteJoint (QMouseEvent *_event)
 
void selectJoint (QMouseEvent *_event)
 
Skeleton::PoseactivePose (SkeletonObject *_skeletonObj)
 
void setJointPosition (SkeletonObject *_skeletonObj, Skeleton::Joint *_joint, ACG::Vec3d &_position)
 
OpenMesh::Vec3d getNearestJoint (SkeletonObject *_skeletonObj, OpenMesh::Vec3d &_hitPoint, int &_bestJointID)
 Get nearest joint to hitPoint (used for snapping)
 
void placeManip (QMouseEvent *_event)
 Place and show the Manipulator. More...
 
void showManipulators ()
 Show/Hide active manipulators. More...
 
void updateManipulatorPosition (BaseObjectData *_skeletonObj)
 make sure the manipulator is positioned on a joint More...
 
void inverseKinematic (ACG::Vec3d dest, Skeleton::Pose *currentPose, Skeleton::Joint *pickedJoint, std::vector< Skeleton::Joint *> rotatableJoints)
 function for computing the position of our joints using inverse Kinematic
 
- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
 
virtual ~BaseInterface ()
 Destructor.
 
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates. More...
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin. More...
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin. More...
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden. More...
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer. More...
 
- Private Member Functions inherited from MouseInterface
virtual ~MouseInterface ()
 Destructor.
 
- Private Member Functions inherited from KeyInterface
virtual void slotKeyReleaseEvent (QKeyEvent *_event)
 Key Release Event from Main App. More...
 
virtual ~KeyInterface ()
 Destructor.
 
- Private Member Functions inherited from PickingInterface
virtual void addHiddenPickMode (const std::string &_mode)
 Add a new picking mode to the examiner which will be invisible. More...
 
virtual void setPickModeCursor (const std::string &_mode, QCursor _cursor)
 Set the cursor of the given PickMode. More...
 
virtual void setPickModeMouseTracking (const std::string &_mode, bool _mouseTracking)
 Set mouse tracking for the given PickMode. More...
 
virtual void setPickModeToolbar (const std::string &_mode, QToolBar *_toolbar)
 Set the additional toolbar of the given PickMode. More...
 
virtual void removePickModeToolbar (const std::string &_mode)
 Removes the additional toolbar of the given PickMode. More...
 
virtual ~PickingInterface ()
 Destructor.
 
- Private Member Functions inherited from ToolboxInterface
virtual ~ToolboxInterface ()
 Destructor.
 
virtual void addToolbox (QString _name, QWidget *_widget, QIcon *_icon)
 Add a toolbox widget to the gui with the given name and an icon. More...
 
virtual void addToolbox (QString _name, QWidget *_widget, QIcon *_icon, QWidget *_headerAreaWidget)
 Add a toolbox widget to the gui with the given name, icon and header area widget. More...
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void executeFileScript (QString _filename)
 
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
- Private Member Functions inherited from ToolbarInterface
virtual ~ToolbarInterface ()
 Destructor.
 
virtual void removeToolbar (QToolBar *_toolbar)
 Remove a Toolbar from the main widget. More...
 
virtual void getToolBar (QString _name, QToolBar *&_toolbar)
 Get a pointer to a Toolbar of the given name or 0 if it does not exist. More...
 
- Private Member Functions inherited from ContextMenuInterface
virtual ~ContextMenuInterface ()
 Destructor.
 
virtual void addContextMenuItem (QAction *_action, DataType _objectType, ContextMenuType _type)
 Add an entry for a context Menu. More...
 
virtual void hideContextMenu ()
 hide the main context menu
 
- Private Member Functions inherited from LoadSaveInterface
virtual ~LoadSaveInterface ()
 Destructor.
 
virtual void addEmptyObject (DataType _type, int &_id)
 
virtual void copyObject (int _oldId, int &_newId)
 
virtual void emptyObjectAdded (int _id)
 DEPRECATED HERE (Moved to Type Interface)! Emit this signal if an empty object has been created. More...
 
virtual void deleteObject (int _id)
 Delete an object
This signal can be called from any thread.
. More...
 
virtual void deleteAllObjects ()
 Delete all Objects. More...
 
virtual void getAllFileFilters (QStringList &_filters)
 Get all file filters that are registered. More...
 
- Private Member Functions inherited from BackupInterface
virtual void createBackup (IdList _objectids, QString _name, std::vector< UpdateType > _types)
 Tell Backup Plugin to create a group backup. More...
 
virtual void undo (int _objectid)
 Tell Backup Plugin to undo the last action of an object. More...
 
virtual void redo (int _objectid)
 Tell Backup Plugin to redo the last action on an object. More...
 
virtual void undo ()
 Tell Backup Plugin to undo the last action. More...
 
virtual void redo ()
 Tell Backup Plugin to redo the last action. More...
 
virtual ~BackupInterface ()
 Destructor.
 
virtual void restored (int _objectid)
 Backup Plugin tells other Plugins that a restore has happened. More...
 
- Private Member Functions inherited from RPCInterface
virtual ~RPCInterface ()
 Destructor.
 
virtual void functionExists (QString _pluginName, QString _functionName, bool &_exists)
 

Private Attributes

QToolBar * toolbar_
 
QActionGroup * toolBarActions_
 
QAction * skeletonEditingAction_
 
QToolBar * pickToolbar_
 
QActionGroup * pickToolBarActions_
 
QAction * selectJointAction_
 
QAction * insertJointAction_
 
QAction * splitJointAction_
 
QAction * deleteJointAction_
 
QAction * moveJointAction_
 
QAction * transformChildManipAction_
 
QAction * transformAllManipAction_
 
QAction * rotateManipAction_
 
QAction * inverseKinematicAction_
 
int currentSkeleton_
 
int currentJoint_
 
bool jointPreview_
 
bool transformChildJoints_
 
bool transformAllFrames_
 
bool inverseKinematic_
 
bool dblClick_
 
QString lastRenderer_
 Stores the last active renderer before we switched to skeleton editing mode.
 
bool rendererChanged_
 Remembers, if we changed the renderer.
 
std::vector< int > activeManipulators_
 
double manip_size_
 
double manip_size_modifier_
 
SkeletonMarker objectMarker_
 
ACG::Matrix4x4d accumMatrix_
 

Detailed Description

Plugin for creating and editing skeletons

Definition at line 71 of file SkeletonEditingPlugin.hh.

Constructor & Destructor Documentation

◆ SkeletonEditingPlugin()

SkeletonEditingPlugin::SkeletonEditingPlugin ( )

Default Constructor.

Definition at line 58 of file SkeletonEditingPlugin.cc.

◆ ~SkeletonEditingPlugin()

SkeletonEditingPlugin::~SkeletonEditingPlugin ( )

Destructor.

Definition at line 94 of file SkeletonEditingPlugin.cc.

Member Function Documentation

◆ canModify()

bool SkeletonEditingPlugin::canModify ( QMouseEvent *  _event)
private

checks, if the skeleton can be modified. a skeleton can be modified, if the active pose is the reference pose

Parameters
_eventthe event that occurred

Definition at line 290 of file SkeletonEditingPlugin.cc.

◆ manipulatorMoved

void SkeletonEditingPlugin::manipulatorMoved ( QtTranslationManipulatorNode _node,
QMouseEvent *  _event 
)
privateslot

move the object when its manipulator moves

Parameters
_nodethe manipulator node
_eventthe mouse event

Definition at line 713 of file SkeletonEditingPlugin.cc.

◆ ManipulatorPositionChanged

void SkeletonEditingPlugin::ManipulatorPositionChanged ( QtTranslationManipulatorNode _node)
privateslot

update object when its manipulator changes position

Parameters
_nodethe manipulator node

Definition at line 842 of file SkeletonEditingPlugin.cc.

◆ placeManip()

void SkeletonEditingPlugin::placeManip ( QMouseEvent *  _event)
private

Place and show the Manipulator.

Parameters
_eventmouseEvent that occured

Definition at line 536 of file SkeletonEditingPlugin.cc.

◆ pluginsInitialized

void SkeletonEditingPlugin::pluginsInitialized ( )
privateslot

Initialization of the plugin when it is loaded by the core.

Definition at line 107 of file SkeletonEditingPlugin.cc.

◆ setDescriptions

void SkeletonEditingPlugin::setDescriptions ( )
privateslot

Set Descriptions for Scripting Slots.

Definition at line 55 of file SkeletonEditingScripting.cc.

◆ showManipulators()

void SkeletonEditingPlugin::showManipulators ( )
private

Show/Hide active manipulators.

Checks if the manipulators should be visible or not.

Definition at line 862 of file SkeletonEditingPlugin.cc.

◆ slotMouseEvent

void SkeletonEditingPlugin::slotMouseEvent ( QMouseEvent *  _event)
privateslot

MousePress event occured.

Parameters
_eventthe event that occured

Definition at line 338 of file SkeletonEditingPlugin.cc.

◆ slotPickModeChanged

void SkeletonEditingPlugin::slotPickModeChanged ( const std::string &  _mode)
privateslot

slot is called when the pickMode changed

Parameters
_modenew pickMode

Definition at line 388 of file SkeletonEditingPlugin.cc.

◆ splitJoint

void SkeletonEditingPlugin::splitJoint ( QMouseEvent *  _event)
slot

split selected Joint

split the selected joint. selected joint will be child of new joint

Parameters
_eventmouseEvent that occured

Definition at line 986 of file SkeletonEditingPlugin.cc.

◆ transformJoint

void SkeletonEditingPlugin::transformJoint ( int  _objectId,
int  _jointId,
Matrix4x4  _matrix 
)
slot

transform joint with given matrix

transform selected joint with given matrix

Definition at line 300 of file SkeletonEditingScripting.cc.

◆ updateManipulatorPosition()

void SkeletonEditingPlugin::updateManipulatorPosition ( BaseObjectData _skeletonObj)
private

make sure the manipulator is positioned on a joint

Definition at line 1445 of file SkeletonEditingPlugin.cc.


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