43 #include "SkeletonObjectInfoPlugin.hh" 54 emit setSlotDescription(
"jointCount(int)",tr(
"get total number of joints for a given skeleton"),
55 QStringList(tr(
"skeletontID")), QStringList(tr(
"id of a skeleton")));
57 emit setSlotDescription(
"branchCount(int)",tr(
"get total number of branches for a given skeleton"),
58 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
60 emit setSlotDescription(
"leafCount(int)",tr(
"get total number of leaves for a given skeleton"),
61 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
65 emit setSlotDescription(
"boundingBoxMin(int)",tr(
"get minimum point of the axis-aligned bounding box"),
66 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
68 emit setSlotDescription(
"boundingBoxMax(int)",tr(
"get maximum point of the axis-aligned bounding box"),
69 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
71 emit setSlotDescription(
"boundingBoxSize(int)",tr(
"get the size of the axis-aligned bounding box"),
72 QStringList(tr(
"skeletonID")), QStringList(tr(
"id of a skeleton")));
75 emit setSlotDescription(
"boneLength(int,int)",tr(
"Get the length of a bone from given joint to his parent"),
76 QString(tr(
"SkeletonID,jointID")).split(
","),
77 QString(tr(
"id of the skeleton, id of the joint")).split(
","));
79 emit setSlotDescription(
"minBoneLength(int)",tr(
"Get the minimal bone length of a skeleton"),
80 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
82 emit setSlotDescription(
"maxBoneLength(int)",tr(
"Get the maximal bone length of a skeleton"),
83 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
85 emit setSlotDescription(
"meanBoneLength(int)",tr(
"Get the mean bone length of a skeleton"),
86 QStringList(tr(
"SkeletonID")), QStringList(tr(
"id of the skeleton")));
101 emit log(
LOGERR, tr(
"Unable to get skeleton"));
120 emit log(
LOGERR, tr(
"Unable to get skeleton"));
126 if (iter->size() > 1)
145 emit log(
LOGERR, tr(
"Unable to get skeleton"));
151 if (iter->size() == 0)
169 emit log(
LOGERR, tr(
"Unable to get skeleton"));
190 emit log(
LOGERR, tr(
"Unable to get skeleton"));
211 emit log(
LOGERR, tr(
"Unable to get skeleton"));
232 emit log(
LOGERR, tr(
"Unable to get skeleton"));
238 emit log(
LOGERR, tr (
"Unable to get parent joint"));
241 unsigned int parentID = parent->
id();
261 emit log(
LOGERR, tr(
"Unable to get skeleton"));
266 double min = std::numeric_limits<double>::max();
271 double length =
boneLength(_skeletonID,iter->id());
291 emit log(
LOGERR, tr(
"Unable to get skeleton"));
296 double max = std::numeric_limits<double>::min();
301 double length =
boneLength(_skeletonID,iter->id());
321 emit log(
LOGERR, tr(
"Unable to get skeleton"));
327 unsigned int count = 0;
337 return (sum/static_cast<double>(count));
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode()
Returns the skeleton scenegraph node.
double meanBoneLength(int _skeletonID)
get the mean bone length
Vector globalTranslation(unsigned int _joint)
Returns the global translation vector.
Vector boundingBoxMin(int _skeletonID)
get minumum bounding box point
int jointCount(int _skeletonID)
get total number of joints for a given skeleton
Vector boundingBoxMax(int _skeletonID)
get maximum bounding box point
double minBoneLength(int _skeletonID)
get the minimal bone length
Skeleton * skeleton(BaseObjectData *_object)
Get a skeleton from an object.
double maxBoneLength(int _skeletonID)
get the maximal bone length
void setDescriptions()
set scripting slot descriptions
SkeletonObject * skeletonObject(BaseObjectData *_object)
Cast an BaseObject to a SkeletonObject if possible.
A general pose, used to store the frames of the animation.
double boneLength(int _skeletonID, int _jointID)
get the length of a bone
Iterator class for the skeleton.
Iterator end()
Compare an iterator with the return value of this method to test if it is done.
Joint * parent()
Returns the parent joint.
Pose * referencePose()
Returns a pointer to the reference pose.
Iterator begin()
Iterator over joints of the skeletal tree in TOP-DOWN order (from root to leafs)
Vector boundingBoxSize(int _skeletonID)
get the size of the bounding box
Represents a single joint in the skeleton.
int branchCount(int _skeletonID)
get total number of branches for a given skeleton
int leafCount(int _skeletonID)
get total number of leaves for a given skeleton
size_t jointCount()
Returns the number of joints.
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
Joint * joint(const size_t &_index)
Returns the joint with the given index.
size_t id() const
returns the joint id