Developer Documentation
SkeletonObject.cc
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 
43 
44 //=============================================================================
45 //
46 // MyTypes
47 //
48 //=============================================================================
49 
50 #define SKELETONOBJECT_C
51 
52 //== INCLUDES =================================================================
53 
54 #include <string>
55 #include <sstream>
56 #include <ACG/Scenegraph/TextNode.hh>
57 #include <ACG/Scenegraph/LineNode.hh>
59 #include "Skeleton.hh"
60 
61 #include <ACG/Scenegraph/MaterialNode.hh>
62 #include <ACG/Scenegraph/SeparatorNode.hh>
63 
64 //== DEFINES ==================================================================
65 
66 //== TYPEDEFS =================================================================
67 
68 //== CLASS DEFINITION =========================================================
69 
77  BaseObjectData( ),
78  skeleton_(NULL),
79  skeletonNode_(NULL)
80 {
82  init();
83 }
84 
85 //-----------------------------------------------------------------------------
86 
88  BaseObjectData(_other)
89 {
90  init(_other.skeleton_);
91 
92  setName(name());
93 }
94 
95 //-----------------------------------------------------------------------------
96 
101 {
102  // Delete the data attached to this object ( this will remove all perObject data)
103  // Not the best way to do it but it will work.
104  // This is only necessary if people use references to the skeleton below and
105  // they do something with the skeleton in the destructor of their
106  // perObjectData.
107  deleteData();
108 
109  // Delete the Skeleton only, if this object contains a mesh
110  if ( skeleton_ != NULL) {
111  delete skeleton_;
112  skeleton_ = NULL;
113  } else {
114  std::cerr << "Destructor error : Skeleton already deleted" << std::endl;
115  }
116 
117  // No need to delete the scenegraph Nodes as this will be managed by baseplugin
118  skeletonNode_ = NULL;
119 }
120 
121 //-----------------------------------------------------------------------------
122 
127  // Delete the Skeleton only, if this object contains a line
128  if ( skeleton_ != NULL) {
129  delete skeleton_;
130  skeleton_ = NULL;
131  } else {
132  std::cerr << "Cleanup error : Skeleton already deleted" << std::endl;
133  }
134 
136 
137  skeletonNode_ = NULL;
138 
140 
141  init();
142 
143 }
144 
145 //-----------------------------------------------------------------------------
146 
151  skeleton_ = new Skeleton();
152 
153  if ( materialNode() == NULL)
154  std::cerr << "Error when creating Skeleton Object! materialNode is NULL!" << std::endl;
155 
158 
159  //set defaults for the material
160  materialNode()->set_color(ACG::Vec4f(0.654f, 0.8f, 1.0f, 1.0f));
164 
165 }
166 
167 //-----------------------------------------------------------------------------
168 
169 void SkeletonObject::init(Skeleton *_pSkeleton)
170 {
171  skeleton_ = new Skeleton(*_pSkeleton);
172 
173  if(materialNode() == NULL)
174  std::cerr << "Error when creating Skeleton Object! materialNode is NULL!" << std::endl;
175 
178 
179  //set defaults for the material
180  materialNode()->set_color(ACG::Vec4f(0.654f, 0.8f, 1.0f, 1.0f));
184 }
185 
186 // ===============================================================================
187 // Name/Path Handling
188 // ===============================================================================
189 
193 void SkeletonObject::setName( QString _name ) {
195 
196  std::string nodename = std::string("SkeletonNode for Skeleton " + _name.toUtf8() );
197  skeletonNode_->name( nodename );
198 }
199 
200 // ===============================================================================
201 // Content
202 // ===============================================================================
203 
208  return skeleton_;
209 }
210 
211 // ===============================================================================
212 // Visualization
213 // ===============================================================================
214 
216  return skeletonNode_;
217 }
218 
219 // ===============================================================================
220 // Object information
221 // ===============================================================================
222 
229  QString output;
230 
231  output += "========================================================================\n";
232  output += BaseObjectData::getObjectinfo();
233 
234  if ( dataType( DATA_SKELETON ) )
235  output += "Object Contains a Skeleton : ";
236 
237  output += QString::number( skeleton()->jointCount()) + " joints.\n";
238 
239  output += "========================================================================\n";
240  return output;
241 }
242 
243 // ===============================================================================
244 // Picking
245 // ===============================================================================
246 
253 bool SkeletonObject::picked( uint _node_idx ) {
254  return ( _node_idx == skeletonNode_->id() );
255 }
256 
257 //-----------------------------------------------------------------------------
258 
259 void SkeletonObject::enablePicking( bool _enable ) {
260  skeletonNode_->enablePicking( _enable );
261 }
262 
263 //-----------------------------------------------------------------------------
264 
266  return skeletonNode_->pickingEnabled();
267 }
268 
269 //-----------------------------------------------------------------------------
270 
271 AnimationHandle SkeletonObject::activePose() {
272  return skeletonNode()->activePose();
273 }
274 
275 //-----------------------------------------------------------------------------
276 
286 {
287  skeletonNode()->setActivePose(_hAni);
288 
289  updateIndices(_hAni);
290  updateMotionPath(_hAni);
291 }
292 
293 //-----------------------------------------------------------------------------
294 
301 {
302  updateIndices(skeletonNode()->activePose());
303 }
304 
305 //-----------------------------------------------------------------------------
306 
315 {
317  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node"))
318  return;
319 
320  // update the position of existing nodes
321  PoseT<OpenMesh::Vec3d> *pose = skeleton_->pose(_hAni);
322  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
323  {
324  std::stringstream buf;
325  std::string nameTransformNode;
326 
327  buf << "TextNode " << i << " Transform";
328  nameTransformNode = buf.str();
329 
330  ACG::SceneGraph::TransformNode *pTransNode;
331  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
332  continue;
333 
334  pTransNode->loadIdentity();
335  pTransNode->translate(pose->globalTranslation(i));
336  pTransNode->scale(skeletonNode_->frameSize()*0.5);
337  }
338 
339  // find and prune redundant nodes
340  unsigned int i = skeleton_->jointCount();
341  bool bAdditionalNodes = true;
342  do{
343  std::stringstream buf;
344  std::string nameTransformNode;
345 
346  buf << "TextNode " << i << " Transform";
347  nameTransformNode = buf.str();
348 
349  ACG::SceneGraph::TransformNode *pTransNode;
350  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
351  {
352  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
353  ++i;
354  continue;
355  }
356  bAdditionalNodes = false;
357  }while(bAdditionalNodes);
358 }
359 
360 //-----------------------------------------------------------------------------
361 
369 void SkeletonObject::showIndices(bool _bVisible)
370 {
372  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node"))
373  {
374  pMatNode = new ACG::SceneGraph::MaterialNode(baseNode(), "Text material node");
375  addAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node");
376  }
377 
378  pMatNode->set_color(ACG::Vec4f(0, 0, 0, 1.0));
379  if(_bVisible)
380  pMatNode->show();
381  else
383 
384  // find and prune redundant nodes
385  unsigned int i = skeleton_->jointCount();
386  bool bAdditionalNodes = true;
387  do{
388  std::stringstream buf;
389  std::string nameTransformNode;
390 
391  buf << "TextNode " << i << " Transform";
392  nameTransformNode = buf.str();
393 
394  ACG::SceneGraph::TransformNode *pTransNode;
395  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
396  {
397  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
398  ++i;
399  continue;
400  }
401  bAdditionalNodes = false;
402  }while(bAdditionalNodes);
403 
404  // add or update nodes
406  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
407  {
408  std::stringstream buf;
409  std::string nameJoint, nameTextNode, nameTransformNode, nameSubMatNode;
410 
411  buf.str("");
412  buf << i;
413  nameJoint = buf.str();
414 
415  buf.str("");
416  buf << "TextNode " << i;
417  nameTextNode = buf.str();
418 
419  buf << " Transform";
420  nameTransformNode = buf.str();
421 
422  buf << " Material";
423  nameSubMatNode = buf.str();
424 
425  ACG::SceneGraph::TransformNode *pTransNode;
426  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
427  {
428  pTransNode = new ACG::SceneGraph::TransformNode(pMatNode, nameTransformNode.c_str());
429  addAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
430  }
431  pTransNode->loadIdentity();
432  pTransNode->translate(ref->globalTranslation(i));
433  pTransNode->scale(skeletonNode_->frameSize()*0.5);
434 
435  ACG::SceneGraph::MaterialNode *pSubMatNode;
436  if(!getAdditionalNode(pSubMatNode, "SkeletonPlugin", nameSubMatNode.c_str()))
437  {
438  pSubMatNode = new ACG::SceneGraph::MaterialNode(pTransNode, nameSubMatNode.c_str());
439  addAdditionalNode(pSubMatNode, "SkeletonPlugin", nameSubMatNode.c_str());
440  }
441  // pSubMatNode->set_color(skeleton_->joint(i)->color());
442 
443  ACG::SceneGraph::TextNode *pTextNode = NULL;
444  if(!getAdditionalNode(pTextNode, "SkeletonPlugin", nameTextNode.c_str()))
445  {
446  pTextNode = new ACG::SceneGraph::TextNode(pSubMatNode,
447  nameTextNode.c_str(),
448  ACG::SceneGraph::TextNode::SCREEN_ALIGNED,
449  true);
450  addAdditionalNode(pTextNode, "SkeletonPlugin", nameTextNode.c_str());
451  }
452  pTextNode->setText(" " + nameJoint);
453  pTextNode->setSize(1);
454  pTextNode->multipassNodeSetActive(8, true);
455  }
456 
457  //update the indices with the current animationhandle
458  updateIndices( skeletonNode()->activePose() );
459 }
460 
461 //-----------------------------------------------------------------------------
462 
463 bool SkeletonObject::indicesVisible()
464 {
466  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node"))
467  return false;
468 
469  return ( pMatNode->status() == ACG::SceneGraph::BaseNode::Active );
470 }
471 
472 //-----------------------------------------------------------------------------
473 
474 bool SkeletonObject::motionPathVisible()
475 {
477  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node"))
478  return false;
479 
480  return ( pMatNode->status() == ACG::SceneGraph::BaseNode::Active );
481 }
482 
483 //-----------------------------------------------------------------------------
484 
489 {
490  updateMotionPath(skeletonNode()->activePose());
491 }
492 
493 //-----------------------------------------------------------------------------
494 
504 {
505 
507  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node"))
508  return;
509 
510  // update the position of existing nodes
511  PoseT<OpenMesh::Vec3d>* pose = skeleton_->pose(_hAni);
512 
513  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
514  {
515 
516  std::stringstream buf;
517  std::string nameTransformNode;
518 
519  buf << "LineNode " << i << " Transform";
520  nameTransformNode = buf.str();
521 
522  ACG::SceneGraph::TransformNode *pTransNode;
523  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
524  continue;
525 
526  pTransNode->loadIdentity();
527  pTransNode->translate( pose->globalTranslation(i) );
528  }
529 
530  // find and prune redundant nodes
531  unsigned int i = skeleton_->jointCount();
532  bool bAdditionalNodes = true;
533  do{
534  std::stringstream buf;
535  std::string nameTransformNode;
536 
537  buf << "LineNode " << i << " Transform";
538  nameTransformNode = buf.str();
539 
540  ACG::SceneGraph::TransformNode *pTransNode;
541  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
542  {
543  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
544  ++i;
545  continue;
546  }
547  bAdditionalNodes = false;
548  }while(bAdditionalNodes);
549 }
550 
551 //-----------------------------------------------------------------------------
552 
561 {
563  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node"))
564  {
565  pMatNode = new ACG::SceneGraph::MaterialNode(baseNode(), "Motion material node");
566  addAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node");
567  }
568  pMatNode->set_color(ACG::Vec4f(0, 0, 0, 1.0));
569 
570  if(_visible)
571  pMatNode->show();
572  else
574 
575  // find and prune redundant nodes
576  unsigned int i = skeleton_->jointCount();
577  bool bAdditionalNodes = true;
578  do{
579  std::stringstream buf;
580  std::string nameTransformNode;
581 
582  buf << "LineNode " << i << " Transform";
583  nameTransformNode = buf.str();
584 
585  ACG::SceneGraph::TransformNode *pTransNode;
586  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
587  {
588  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
589  ++i;
590  continue;
591  }
592  bAdditionalNodes = false;
593  }while(bAdditionalNodes);
594 
595 
596  // add or update nodes
598 
599  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
600  {
601  std::stringstream buf;
602  std::string nameLineNode, nameTransformNode;
603 
604  buf.str("");
605  buf << "LineNode " << i;
606  nameLineNode = buf.str();
607 
608  buf << " Transform";
609  nameTransformNode = buf.str();
610 
611  ACG::SceneGraph::TransformNode *pTransNode;
612  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
613  {
614  pTransNode = new ACG::SceneGraph::TransformNode(pMatNode, nameTransformNode.c_str());
615  addAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
616  }
617  pTransNode->loadIdentity();
618  ACG::GLMatrixd mat( ref->globalMatrix(i).get_raw_data() );
619  pTransNode->scale(mat); //this is just a hack to set the global matrix
620 
621  ACG::SceneGraph::LineNode *pLineNode = NULL;
622  if(!getAdditionalNode(pLineNode, "SkeletonPlugin", nameLineNode.c_str()))
623  {
624  pLineNode = new ACG::SceneGraph::LineNode( ACG::SceneGraph::LineNode::LineSegmentsMode, pTransNode, nameLineNode.c_str());
625  addAdditionalNode(pLineNode, "SkeletonPlugin", nameLineNode.c_str());
626  }
627  pLineNode->clear();
628 
629  Skeleton::Joint* joint = skeleton_->joint(i);
630 
631  if ( joint->size() > 0 ){
632 
633  for (uint c=0; c < joint->size(); c++ ){
634  Skeleton::Joint* child = joint->child(c);
635 
636  for (unsigned int a = 0; a < skeleton_->animationCount(); a++){
637 
638  AnimationHandle animHandle = AnimationHandle(a, 0 );
639 
640  //get animation
641  AnimationT<ACG::Vec3d>* animation = skeleton_->animation( animHandle );
642 
643  if (animation->name() == "")
644  continue;
645 
646  ACG::Vec3d lastPos(0.0, 0.0, 0.0);
647 
648  // every frame of that animation
649  for(unsigned int k = 0; k < animation->frameCount(); ++k){
650  animHandle.setFrame(k);
651  Skeleton::Pose* pose = skeleton_->pose( animHandle );
652 
653  ACG::Matrix4x4d globalInv = pose->globalMatrix( joint->id() );
654  globalInv.invert();
655 
656  ACG::Matrix4x4d local = pose->globalMatrix(child->id());
657  ACG::Matrix4x4d unified = pose->unifiedMatrix( joint->id() );
658 
659  ACG::Vec3d trans = pose->globalTranslation(child->id()) - pose->globalTranslation(joint->id());
660  trans *= 0.5;
661 
662  pLineNode->add_line( ACG::Vec3d(0.0, 0.0, 0.0), trans );
663  pLineNode->add_color( ACG::Vec3uc(180,255,180));
664 
665  pLineNode->add_line( lastPos, trans );
666  pLineNode->add_color( ACG::Vec3uc(110,160,110));
667 
668  lastPos = trans;
669  }
670  }
671 
672  ACG::Vec3d trans = ref->globalTranslation(child->id())-ref->globalTranslation(joint->id());
673  trans *= 0.6;
674 
675  pLineNode->add_line( ACG::Vec3d(0.0, 0.0, 0.0), trans);
676  pLineNode->add_color( ACG::Vec3uc(255,0,0));
677  }
678  }
679  }
680 
681  //update the indices with the current animationhandle
682  updateMotionPath( skeletonNode_->activePose() );
683 }
684 
685 //-----------------------------------------------------------------------------
686 
688 {
689  SkeletonObject *pObject = new SkeletonObject(*this);
690  return dynamic_cast<BaseObject*>(pObject);
691 }
692 
693 // ===============================================================================
694 // Update
695 // ===============================================================================
696 
697 
699  BaseObject::update(_type);
700 }
701 
702 //=============================================================================
703 
bool invert()
matrix inversion (returns true on success)
Joint * child(size_t _index)
Returns the child joint with the given index.
Definition: JointT_impl.hh:211
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode()
Returns the skeleton scenegraph node.
Update type class.
Definition: UpdateType.hh:60
virtual QString getObjectinfo()
Get all Info for the Object as a string.
Definition: BaseObject.cc:244
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode_
A pointer to the scenegraph node.
void translate(const Vec3d &_v)
Add a translation to the current Transformation.
#define DATA_SKELETON
Definition: Skeleton.hh:64
Vector globalTranslation(unsigned int _joint)
Returns the global translation vector.
Definition: PoseT_impl.hh:227
const Matrix & globalMatrix(unsigned int _joint) const
Returns the global matrix for the given joint.
Definition: PoseT_impl.hh:193
void set_round_points(bool _b)
set round points enabled
SkeletonT< ACG::Vec3d > Skeleton
Simple Name for the Skeleton, based on double vectors.
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
QString getObjectinfo()
Returns a string holding information on this object.
MaterialNode * materialNode()
get a pointer to the materialnode
void setDataType(DataType _type)
Definition: BaseObject.cc:233
bool getAdditionalNode(NodeT *&_node, QString _pluginName, QString _nodeName, int _id=0)
get an addition node from the object
void deleteData()
Delete all data attached to this object ( calls delete on each object )
Definition: BaseObject.cc:812
bool picked(uint _node_idx)
Returns true if the picked node given by _node_idx is this objects scenegraph node.
virtual void cleanup()
Reset current object, including all related nodes.
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
Definition: BaseObject.cc:745
virtual void cleanup()
Hide this node and its children.
Definition: BaseNode.hh:398
A general pose, used to store the frames of the animation.
Definition: PoseT.hh:58
void enablePicking(bool _enable)
Enable or disable picking for this object.
bool addAdditionalNode(NodeT *_node, QString _pluginName, QString _nodeName, int _id=0)
add an additional node to the object
size_t animationCount()
Returns the number of animations stored in this skeleton.
void set_status(StatusMode _s)
Set the status of this node.
void updateMotionPath()
Updates the node that visualizes the local space of joint motions.
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
QString name() const
return the name of the object. The name defaults to NONAME if unset.
Definition: BaseObject.cc:730
bool removeAdditionalNode(NodeT *&_node, QString _pluginName, QString _nodeName, int _id=0)
remove an additional node from the object
A handle used to refer to an animation or to a specific frame in an animation.
void add_line(const Vec3d &_v0, const Vec3d &_v1)
add line (for LineMode == LineSegmentsMode)
Definition: LineNode.cc:151
void show()
Show node: set status to Active.
void set_line_width(float _sz)
set line width (default: 1.0)
Pose * referencePose()
Returns a pointer to the reference pose.
Skeleton * skeleton()
Returns a pointer to the skeleton.
const Scalar * get_raw_data() const
Definition: Matrix4x4T.hh:256
Pose * pose(const AnimationHandle &_hAni)
Returns a pointer to the pose with the given animation handle.
Represents a single joint in the skeleton.
Definition: JointT.hh:60
void setActivePose(const AnimationHandle &_hAni)
Call this to set the active pose.
SeparatorNode * baseNode()
Skeleton * skeleton_
A pointer to the skeleton data.
void showIndices(bool _bVisible=true)
Shows or hides the indices.
virtual void init()
Initialize current object, including all related nodes.
void clear()
clear points/lines and colors
Definition: LineNode.cc:101
void set_point_size(float _sz)
set point size (default: 1.0)
bool pickingEnabled()
Check if picking is enabled for this object.
StatusMode status() const
Get node&#39;s status.
const Matrix & unifiedMatrix(size_t _joint)
Returns the unified matrix.
Definition: PoseT_impl.hh:397
DrawMode SOLID_FLAT_SHADED
draw flat shaded faces (requires face normals)
Definition: DrawModes.cc:81
void showMotionPath(bool _visible=true)
Shows or hides the local motion space for a joint.
size_t jointCount()
Returns the number of joints.
void scale(double _s)
Add scaling to the current Transformation.
Animation * animation(std::string _name)
Returns a pointer to the animation to the given name.
virtual BaseObject * copy()
Returns a full copy of the object.
Draw node & children.
Definition: BaseNode.hh:392
void setFrame(size_t _iFrame)
Sets the current animation frame (not failsafe)
void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
Joint * joint(const size_t &_index)
Returns the joint with the given index.
BaseObject * child(int row)
return a child
Definition: BaseObject.cc:506
virtual ~SkeletonObject()
Destructor.
size_t size() const
Returns the number of children.
Definition: JointT_impl.hh:197
void setName(QString _name)
Set the name of the Object.
DrawMode POINTS
draw unlighted points using the default base color
Definition: DrawModes.cc:73
DataType dataType() const
Definition: BaseObject.cc:229
void add_color(const ACG::Vec3uc &_c)
add color (only for LineMode == LineSegmentsMode)
Definition: LineNode.cc:162
size_t id() const
returns the joint id
Definition: JointT_impl.hh:97
SkeletonObject()
Constructor.
void updateIndices()
Updates the joint index text node positions.