44 #ifndef SKELETONEDITINGPLUGIN_HH 45 #define SKELETONEDITINGPLUGIN_HH 65 #include "SkeletonMarker.hh" 67 #include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh> 71 class SkeletonEditingPlugin :
public QObject,
BaseInterface,
MouseInterface,
KeyInterface,
PickingInterface,
ToolboxInterface,
LoggingInterface,
ScriptInterface,
ToolbarInterface,
ContextMenuInterface,
LoadSaveInterface,
BackupInterface,
RPCInterface 87 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-SkeletonEditing")
92 void updatedObject(
int,
const UpdateType& _type);
93 void nodeVisibilityChanged(
int);
95 void setRenderer(
unsigned int _viewer, QString _rendererName);
96 void getCurrentRenderer(
unsigned int _viewer, QString& _rendererName);
99 void addPickMode(
const std::string& _mode );
100 void addHiddenPickMode(
const std::string& _mode );
101 void setPickModeMouseTracking (
const std::string& _mode,
bool _mouseTracking);
102 void setPickModeToolbar (
const std::string& _mode, QToolBar * _toolbar);
108 void log(
Logtype _type, QString _message);
109 void log(QString _message);
112 void scriptInfo( QString _functionName );
113 void setSlotDescription(QString _slotName, QString _slotDescription,
114 QStringList _parameters, QStringList _descriptions);
117 void addToolbar(QToolBar* _toolbar);
118 void getToolBar( QString _name, QToolBar*& _toolbar);
121 void registerKey(
int _key, Qt::KeyboardModifiers _modifiers, QString _description,
bool _multiUse =
false);
124 void addToolbox( QString _name , QWidget* _widget );
127 void addEmptyObject(
DataType _type,
int& _id);
128 void deleteObject(
int _id);
136 void initializePlugin();
138 void slotObjectUpdated(
int _id,
const UpdateType& _type);
141 void slotMouseWheelEvent(QWheelEvent * _event,
const std::string & _mode);
145 void slotKeyEvent (QKeyEvent* _event);
146 void slotKeyReleaseEvent (QKeyEvent* _event);
152 void moveJoint(QMouseEvent* _event);
154 void insertJoint(QMouseEvent* _event);
155 void cancelJointInsertion();
156 void deleteJoint(QMouseEvent* _event);
157 void selectJoint(QMouseEvent* _event);
172 QString
name(){
return (QString(
"Skeleton Editing")); };
175 QString
description() {
return (QString(tr(
"Create and edit skeletons"))); };
185 void splitBone(
int _objectId,
int _tailJoint);
191 void deleteJoint(
int _objectId ,
int _jointId );
212 int frameCount(
int _objectId,
int _animationIndex);
221 void setActivePose(
int _objectId,
int _animationIndex,
int _frame);
224 void addAnimation(
int _objectId, QString _name,
int _frames);
232 QString version() {
return QString(
"1.0"); };
236 void slotSetEditingMode(QAction* _action);
237 void slotPickToolbarAction(QAction* _action);
243 QActionGroup* toolBarActions_;
244 QAction* skeletonEditingAction_;
246 QToolBar* pickToolbar_;
247 QActionGroup* pickToolBarActions_;
248 QAction* selectJointAction_;
249 QAction* insertJointAction_;
250 QAction* splitJointAction_;
251 QAction* deleteJointAction_;
252 QAction* moveJointAction_;
253 QAction* transformChildManipAction_;
254 QAction* transformAllManipAction_;
255 QAction* rotateManipAction_;
256 QAction* inverseKinematicAction_;
258 int currentSkeleton_;
262 bool transformChildJoints_;
263 bool transformAllFrames_;
264 bool inverseKinematic_;
275 std::vector< int > activeManipulators_;
279 double manip_size_modifier_;
306 void slotRotateManipulator(
bool _toggled);
309 #endif //SKELETONEDITINGPLUGIN_HH void setDescriptions()
Set Descriptions for Scripting Slots.
void manipulatorMoved(QtTranslationManipulatorNode *_node, QMouseEvent *_event)
move the object when its manipulator moves
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
QString name()
Name of the Plugin.
void slotMouseEvent(QMouseEvent *_event)
MousePress event occured.
Interface class for receiving mouse events.
void setActivePose(int _objectId, int _animationIndex, int _frame)
set active pose
void transformJoint(int _objectId, int _jointId, Matrix4x4 _matrix)
transform joint with given matrix
void pluginsInitialized()
Initialization of the plugin when it is loaded by the core.
Logtype
Log types for Message Window.
Vector globalTranslation(int _objectId, int _jointId)
get global translation of a joint in the active pose
void showManipulators()
Show/Hide active manipulators.
A general pose, used to store the frames of the animation.
~SkeletonEditingPlugin()
Destructor.
Interface for all Plugins which do logging to the logging window of the framework.
void addAnimation(int _objectId, QString _name, int _frames)
add animation
bool canModify(QMouseEvent *_event)
checks, if the skeleton can be modified. a skeleton can be modified, if the active pose is the refere...
void ManipulatorPositionChanged(QtTranslationManipulatorNode *_node)
update object when its manipulator changes position
int activeFrame(int _objectId)
get active frame
void addJoint(int _objectId, int _parent, Vector _position)
add joint to the skeleton
OpenMesh::Vec3d getNearestJoint(SkeletonObject *_skeletonObj, OpenMesh::Vec3d &_hitPoint, int &_bestJointID)
Get nearest joint to hitPoint (used for snapping)
QString lastRenderer_
Stores the last active renderer before we switched to skeleton editing mode.
Represents a single joint in the skeleton.
Matrix4x4 globalMatrix(int _objectId, int _jointId)
get global matrix of a joint in the active pose
int animationCount(int _objectId)
get the number of animations
Interface to call functions across plugins.
Vector localTranslation(int _objectId, int _jointId)
get local translation of a joint in the active pose
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
bool rendererChanged_
Remembers, if we changed the renderer.
void updateManipulatorPosition(BaseObjectData *_skeletonObj)
make sure the manipulator is positioned on a joint
void splitBone(int _objectId, int _tailJoint)
insert a joint in the middle of a bone given by its (unique) tailJoint
Matrix4x4 localMatrix(int _objectId, int _jointId)
get local matrix of a joint in the active pose
int frameCount(int _objectId, int _animationIndex)
get the number of frames
Keyboard Event Interface.
void slotPickModeChanged(const std::string &_mode)
slot is called when the pickMode changed
void splitJoint(QMouseEvent *_event)
split selected Joint
Interface for all Plugins which provide scriptable Functions.
SkeletonEditingPlugin()
Default Constructor.
int activeAnimation(int _objectId)
get active animation
void placeManip(QMouseEvent *_event)
Place and show the Manipulator.
Interface class from which all plugins have to be created.
Allow access to picking functions.
Interface class for backup handling.
QString description()
Description of the Plugin.
Interface for all plugins which want to Load or Save files and create Objects.