50 #ifndef SKELETONEDITINGPLUGIN_HH
51 #define SKELETONEDITINGPLUGIN_HH
71 #include "SkeletonMarker.hh"
75 class SkeletonEditingPlugin :
public QObject,
BaseInterface,
MouseInterface,
KeyInterface,
PickingInterface,
ToolboxInterface,
LoggingInterface,
ScriptInterface,
ToolbarInterface,
ContextMenuInterface,
LoadSaveInterface,
BackupInterface,
RPCInterface
91 #if QT_VERSION >= 0x050000
92 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-SkeletonEditing")
98 void updatedObject(
int,
const UpdateType& _type);
99 void nodeVisibilityChanged(
int);
101 void setRenderer(
unsigned int _viewer, QString _rendererName);
102 void getCurrentRenderer(
unsigned int _viewer, QString& _rendererName);
105 void addPickMode(
const std::string& _mode );
106 void addHiddenPickMode(
const std::string& _mode );
107 void setPickModeMouseTracking (
const std::string& _mode,
bool _mouseTracking);
108 void setPickModeToolbar (
const std::string& _mode, QToolBar * _toolbar);
114 void log(
Logtype _type, QString _message);
115 void log(QString _message);
118 void scriptInfo( QString _functionName );
119 void setSlotDescription(QString _slotName, QString _slotDescription,
120 QStringList _parameters, QStringList _descriptions);
123 void addToolbar(QToolBar* _toolbar);
124 void getToolBar( QString _name, QToolBar*& _toolbar);
127 void registerKey(
int _key, Qt::KeyboardModifiers _modifiers, QString _description,
bool _multiUse =
false);
130 void addToolbox( QString _name , QWidget* _widget );
133 void addEmptyObject(
DataType _type,
int& _id);
134 void deleteObject(
int _id);
142 void initializePlugin();
144 void slotObjectUpdated(
int _id,
const UpdateType& _type);
147 void slotMouseWheelEvent(QWheelEvent * _event,
const std::string & _mode);
151 void slotKeyEvent (QKeyEvent* _event);
152 void slotKeyReleaseEvent (QKeyEvent* _event);
158 void moveJoint(QMouseEvent* _event);
160 void insertJoint(QMouseEvent* _event);
161 void cancelJointInsertion();
162 void deleteJoint(QMouseEvent* _event);
163 void selectJoint(QMouseEvent* _event);
178 QString
name(){
return (QString(
"Skeleton Editing")); };
181 QString
description() {
return (QString(tr(
"Create and edit skeletons"))); };
191 void splitBone(
int _objectId,
int _tailJoint);
197 void deleteJoint(
int _objectId ,
int _jointId );
218 int frameCount(
int _objectId,
int _animationIndex);
227 void setActivePose(
int _objectId,
int _animationIndex,
int _frame);
230 void addAnimation(
int _objectId, QString _name,
int _frames);
238 QString version() {
return QString(
"1.0"); };
242 void slotSetEditingMode(QAction* _action);
243 void slotPickToolbarAction(QAction* _action);
249 QActionGroup* toolBarActions_;
250 QAction* skeletonEditingAction_;
252 QToolBar* pickToolbar_;
253 QActionGroup* pickToolBarActions_;
254 QAction* selectJointAction_;
255 QAction* insertJointAction_;
256 QAction* splitJointAction_;
257 QAction* deleteJointAction_;
258 QAction* moveJointAction_;
259 QAction* transformChildManipAction_;
260 QAction* transformAllManipAction_;
261 QAction* rotateManipAction_;
262 QAction* inverseKinematicAction_;
264 int currentSkeleton_;
268 bool transformChildJoints_;
269 bool transformAllFrames_;
270 bool inverseKinematic_;
281 std::vector< int > activeManipulators_;
285 double manip_size_modifier_;
312 void slotRotateManipulator(
bool _toggled);
315 #endif //SKELETONEDITINGPLUGIN_HH
void manipulatorMoved(QtTranslationManipulatorNode *_node, QMouseEvent *_event)
move the object when its manipulator moves
Interface class from which all plugins have to be created.
Keyboard Event Interface.
QString description()
Description of the Plugin.
Matrix4x4 globalMatrix(int _objectId, int _jointId)
get global matrix of a joint in the active pose
QString lastRenderer_
Stores the last active renderer before we switched to skeleton editing mode.
Logtype
Log types for Message Window.
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
void updateManipulatorPosition(BaseObjectData *_skeletonObj)
make sure the manipulator is positioned on a joint
void ManipulatorPositionChanged(QtTranslationManipulatorNode *_node)
update object when its manipulator changes position
void setDescriptions()
Set Descriptions for Scripting Slots.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
bool rendererChanged_
Remembers, if we changed the renderer.
OpenMesh::Vec3d getNearestJoint(SkeletonObject *_skeletonObj, OpenMesh::Vec3d &_hitPoint, int &_bestJointID)
Get nearest joint to hitPoint (used for snapping)
void addAnimation(int _objectId, QString _name, int _frames)
add animation
~SkeletonEditingPlugin()
Destructor.
bool canModify(QMouseEvent *_event)
checks, if the skeleton can be modified. a skeleton can be modified, if the active pose is the refere...
A general pose, used to store the frames of the animation.
Interface for all Plugins which do logging to the logging window of the framework.
void placeManip(QMouseEvent *_event)
Place and show the Manipulator.
Interface to call functions across plugins.
void slotPickModeChanged(const std::string &_mode)
slot is called when the pickMode changed
SkeletonEditingPlugin()
Default Constructor.
void splitJoint(QMouseEvent *_event)
split selected Joint
Add a toolbox to OpenFlipper.
Interface for all Plugins which provide scriptable Functions.
Interface for all plugins which want to Load or Save files and create Objects.
void splitBone(int _objectId, int _tailJoint)
insert a joint in the middle of a bone given by its (unique) tailJoint
void pluginsInitialized()
Initialization of the plugin when it is loaded by the core.
Allow access to picking functions.
Interface class for backup handling.
void slotMouseEvent(QMouseEvent *_event)
MousePress event occured.
Interface class for creating custom context menus.
Interface class for receiving mouse events.
int animationCount(int _objectId)
get the number of animations
void setActivePose(int _objectId, int _animationIndex, int _frame)
set active pose
void transformJoint(int _objectId, int _jointId, Matrix4x4 _matrix)
transform joint with given matrix
Plugins can add its own toolbox to the main widget's toolbox area by using this interface.
QString name()
Name of the Plugin.
Vector localTranslation(int _objectId, int _jointId)
get local translation of a joint in the active pose
int activeFrame(int _objectId)
get active frame
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
void showManipulators()
Show/Hide active manipulators.
Represents a single joint in the skeleton.
int frameCount(int _objectId, int _animationIndex)
get the number of frames
void addJoint(int _objectId, int _parent, Vector _position)
add joint to the skeleton
int activeAnimation(int _objectId)
get active animation