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 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 //=============================================================================
51 //
52 // MyTypes
53 //
54 //=============================================================================
55 
56 #define SKELETONOBJECT_C
57 
58 //== INCLUDES =================================================================
59 
60 #include <string>
61 #include <sstream>
62 #include <ACG/Scenegraph/TextNode.hh>
63 #include <ACG/Scenegraph/LineNode.hh>
65 #include "Skeleton.hh"
66 
67 //== DEFINES ==================================================================
68 
69 //== TYPEDEFS =================================================================
70 
71 //== CLASS DEFINITION =========================================================
72 
80  BaseObjectData( ),
81  skeleton_(NULL),
82  skeletonNode_(NULL)
83 {
85  init();
86 }
87 
88 //-----------------------------------------------------------------------------
89 
91  BaseObjectData(_other)
92 {
93  init(_other.skeleton_);
94 
95  setName(name());
96 }
97 
98 //-----------------------------------------------------------------------------
99 
104 {
105  // Delete the data attached to this object ( this will remove all perObject data)
106  // Not the best way to do it but it will work.
107  // This is only necessary if people use references to the skeleton below and
108  // they do something with the skeleton in the destructor of their
109  // perObjectData.
110  deleteData();
111 
112  // Delete the Skeleton only, if this object contains a mesh
113  if ( skeleton_ != NULL) {
114  delete skeleton_;
115  skeleton_ = NULL;
116  } else {
117  std::cerr << "Destructor error : Skeleton already deleted" << std::endl;
118  }
119 
120  // No need to delete the scenegraph Nodes as this will be managed by baseplugin
121  skeletonNode_ = NULL;
122 }
123 
124 //-----------------------------------------------------------------------------
125 
130  // Delete the Skeleton only, if this object contains a line
131  if ( skeleton_ != NULL) {
132  delete skeleton_;
133  skeleton_ = NULL;
134  } else {
135  std::cerr << "Cleanup error : Skeleton already deleted" << std::endl;
136  }
137 
139 
140  skeletonNode_ = NULL;
141 
143 
144  init();
145 
146 }
147 
148 //-----------------------------------------------------------------------------
149 
154  skeleton_ = new Skeleton();
155 
156  if ( materialNode() == NULL)
157  std::cerr << "Error when creating Skeleton Object! materialNode is NULL!" << std::endl;
158 
161 
162  //set defaults for the material
163  materialNode()->set_color(ACG::Vec4f(0.654f, 0.8f, 1.0f, 1.0f));
167 
168 }
169 
170 //-----------------------------------------------------------------------------
171 
172 void SkeletonObject::init(Skeleton *_pSkeleton)
173 {
174  skeleton_ = new Skeleton(*_pSkeleton);
175 
176  if(materialNode() == NULL)
177  std::cerr << "Error when creating Skeleton Object! materialNode is NULL!" << std::endl;
178 
181 
182  //set defaults for the material
183  materialNode()->set_color(ACG::Vec4f(0.654f, 0.8f, 1.0f, 1.0f));
187 }
188 
189 // ===============================================================================
190 // Name/Path Handling
191 // ===============================================================================
192 
196 void SkeletonObject::setName( QString _name ) {
198 
199  std::string nodename = std::string("SkeletonNode for Skeleton " + _name.toUtf8() );
200  skeletonNode_->name( nodename );
201 }
202 
203 // ===============================================================================
204 // Content
205 // ===============================================================================
206 
211  return skeleton_;
212 }
213 
214 // ===============================================================================
215 // Visualization
216 // ===============================================================================
217 
219  return skeletonNode_;
220 }
221 
222 // ===============================================================================
223 // Object information
224 // ===============================================================================
225 
232  QString output;
233 
234  output += "========================================================================\n";
235  output += BaseObjectData::getObjectinfo();
236 
237  if ( dataType( DATA_SKELETON ) )
238  output += "Object Contains a Skeleton : ";
239 
240  output += QString::number( skeleton()->jointCount()) + " joints.\n";
241 
242  output += "========================================================================\n";
243  return output;
244 }
245 
246 // ===============================================================================
247 // Picking
248 // ===============================================================================
249 
256 bool SkeletonObject::picked( uint _node_idx ) {
257  return ( _node_idx == skeletonNode_->id() );
258 }
259 
260 //-----------------------------------------------------------------------------
261 
262 void SkeletonObject::enablePicking( bool _enable ) {
263  skeletonNode_->enablePicking( _enable );
264 }
265 
266 //-----------------------------------------------------------------------------
267 
269  return skeletonNode_->pickingEnabled();
270 }
271 
272 //-----------------------------------------------------------------------------
273 
274 AnimationHandle SkeletonObject::activePose() {
275  return skeletonNode()->activePose();
276 }
277 
278 //-----------------------------------------------------------------------------
279 
289 {
290  skeletonNode()->setActivePose(_hAni);
291 
292  updateIndices(_hAni);
293  updateMotionPath(_hAni);
294 }
295 
296 //-----------------------------------------------------------------------------
297 
304 {
305  updateIndices(skeletonNode()->activePose());
306 }
307 
308 //-----------------------------------------------------------------------------
309 
318 {
320  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node"))
321  return;
322 
323  // update the position of existing nodes
324  PoseT<OpenMesh::Vec3d> *pose = skeleton_->pose(_hAni);
325  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
326  {
327  std::stringstream buf;
328  std::string nameTransformNode;
329 
330  buf << "TextNode " << i << " Transform";
331  nameTransformNode = buf.str();
332 
333  ACG::SceneGraph::TransformNode *pTransNode;
334  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
335  continue;
336 
337  pTransNode->loadIdentity();
338  pTransNode->translate(pose->globalTranslation(i));
339  pTransNode->scale(skeletonNode_->frameSize()*0.5);
340  }
341 
342  // find and prune redundant nodes
343  unsigned int i = skeleton_->jointCount();
344  bool bAdditionalNodes = true;
345  do{
346  std::stringstream buf;
347  std::string nameTransformNode;
348 
349  buf << "TextNode " << i << " Transform";
350  nameTransformNode = buf.str();
351 
352  ACG::SceneGraph::TransformNode *pTransNode;
353  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
354  {
355  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
356  ++i;
357  continue;
358  }
359  bAdditionalNodes = false;
360  }while(bAdditionalNodes);
361 }
362 
363 //-----------------------------------------------------------------------------
364 
372 void SkeletonObject::showIndices(bool _bVisible)
373 {
375  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node"))
376  {
377  pMatNode = new ACG::SceneGraph::MaterialNode(baseNode(), "Text material node");
378  addAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node");
379  }
380 
381  pMatNode->set_color(ACG::Vec4f(0, 0, 0, 1.0));
382  if(_bVisible)
383  pMatNode->show();
384  else
386 
387  // find and prune redundant nodes
388  unsigned int i = skeleton_->jointCount();
389  bool bAdditionalNodes = true;
390  do{
391  std::stringstream buf;
392  std::string nameTransformNode;
393 
394  buf << "TextNode " << i << " Transform";
395  nameTransformNode = buf.str();
396 
397  ACG::SceneGraph::TransformNode *pTransNode;
398  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
399  {
400  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
401  ++i;
402  continue;
403  }
404  bAdditionalNodes = false;
405  }while(bAdditionalNodes);
406 
407  // add or update nodes
409  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
410  {
411  std::stringstream buf;
412  std::string nameJoint, nameTextNode, nameTransformNode, nameSubMatNode;
413 
414  buf.str("");
415  buf << i;
416  nameJoint = buf.str();
417 
418  buf.str("");
419  buf << "TextNode " << i;
420  nameTextNode = buf.str();
421 
422  buf << " Transform";
423  nameTransformNode = buf.str();
424 
425  buf << " Material";
426  nameSubMatNode = buf.str();
427 
428  ACG::SceneGraph::TransformNode *pTransNode;
429  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
430  {
431  pTransNode = new ACG::SceneGraph::TransformNode(pMatNode, nameTransformNode.c_str());
432  addAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
433  }
434  pTransNode->loadIdentity();
435  pTransNode->translate(ref->globalTranslation(i));
436  pTransNode->scale(skeletonNode_->frameSize()*0.5);
437 
438  ACG::SceneGraph::MaterialNode *pSubMatNode;
439  if(!getAdditionalNode(pSubMatNode, "SkeletonPlugin", nameSubMatNode.c_str()))
440  {
441  pSubMatNode = new ACG::SceneGraph::MaterialNode(pTransNode, nameSubMatNode.c_str());
442  addAdditionalNode(pSubMatNode, "SkeletonPlugin", nameSubMatNode.c_str());
443  }
444  // pSubMatNode->set_color(skeleton_->joint(i)->color());
445 
446  ACG::SceneGraph::TextNode *pTextNode = NULL;
447  if(!getAdditionalNode(pTextNode, "SkeletonPlugin", nameTextNode.c_str()))
448  {
449  pTextNode = new ACG::SceneGraph::TextNode(pSubMatNode,
450  nameTextNode.c_str(),
451  ACG::SceneGraph::TextNode::SCREEN_ALIGNED,
452  true);
453  addAdditionalNode(pTextNode, "SkeletonPlugin", nameTextNode.c_str());
454  }
455  pTextNode->setText(" " + nameJoint);
456  pTextNode->setSize(1);
457  pTextNode->multipassNodeSetActive(8, true);
458  }
459 
460  //update the indices with the current animationhandle
461  updateIndices( skeletonNode()->activePose() );
462 }
463 
464 //-----------------------------------------------------------------------------
465 
466 bool SkeletonObject::indicesVisible()
467 {
469  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Text material node"))
470  return false;
471 
472  return ( pMatNode->status() == ACG::SceneGraph::BaseNode::Active );
473 }
474 
475 //-----------------------------------------------------------------------------
476 
477 bool SkeletonObject::motionPathVisible()
478 {
480  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node"))
481  return false;
482 
483  return ( pMatNode->status() == ACG::SceneGraph::BaseNode::Active );
484 }
485 
486 //-----------------------------------------------------------------------------
487 
492 {
493  updateMotionPath(skeletonNode()->activePose());
494 }
495 
496 //-----------------------------------------------------------------------------
497 
507 {
508 
510  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node"))
511  return;
512 
513  // update the position of existing nodes
514  PoseT<OpenMesh::Vec3d>* pose = skeleton_->pose(_hAni);
515 
516  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
517  {
518 
519  std::stringstream buf;
520  std::string nameTransformNode;
521 
522  buf << "LineNode " << i << " Transform";
523  nameTransformNode = buf.str();
524 
525  ACG::SceneGraph::TransformNode *pTransNode;
526  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
527  continue;
528 
529  pTransNode->loadIdentity();
530  pTransNode->translate( pose->globalTranslation(i) );
531  }
532 
533  // find and prune redundant nodes
534  unsigned int i = skeleton_->jointCount();
535  bool bAdditionalNodes = true;
536  do{
537  std::stringstream buf;
538  std::string nameTransformNode;
539 
540  buf << "LineNode " << i << " Transform";
541  nameTransformNode = buf.str();
542 
543  ACG::SceneGraph::TransformNode *pTransNode;
544  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
545  {
546  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
547  ++i;
548  continue;
549  }
550  bAdditionalNodes = false;
551  }while(bAdditionalNodes);
552 }
553 
554 //-----------------------------------------------------------------------------
555 
564 {
566  if(!getAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node"))
567  {
568  pMatNode = new ACG::SceneGraph::MaterialNode(baseNode(), "Motion material node");
569  addAdditionalNode(pMatNode, "SkeletonPlugin", "Motion material node");
570  }
571  pMatNode->set_color(ACG::Vec4f(0, 0, 0, 1.0));
572 
573  if(_visible)
574  pMatNode->show();
575  else
577 
578  // find and prune redundant nodes
579  unsigned int i = skeleton_->jointCount();
580  bool bAdditionalNodes = true;
581  do{
582  std::stringstream buf;
583  std::string nameTransformNode;
584 
585  buf << "LineNode " << i << " Transform";
586  nameTransformNode = buf.str();
587 
588  ACG::SceneGraph::TransformNode *pTransNode;
589  if(getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
590  {
591  removeAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
592  ++i;
593  continue;
594  }
595  bAdditionalNodes = false;
596  }while(bAdditionalNodes);
597 
598 
599  // add or update nodes
601 
602  for(unsigned int i = 0; i < skeleton_->jointCount(); ++i)
603  {
604  std::stringstream buf;
605  std::string nameLineNode, nameTransformNode;
606 
607  buf.str("");
608  buf << "LineNode " << i;
609  nameLineNode = buf.str();
610 
611  buf << " Transform";
612  nameTransformNode = buf.str();
613 
614  ACG::SceneGraph::TransformNode *pTransNode;
615  if(!getAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str()))
616  {
617  pTransNode = new ACG::SceneGraph::TransformNode(pMatNode, nameTransformNode.c_str());
618  addAdditionalNode(pTransNode, "SkeletonPlugin", nameTransformNode.c_str());
619  }
620  pTransNode->loadIdentity();
621  ACG::GLMatrixd mat( ref->globalMatrix(i).get_raw_data() );
622  pTransNode->scale(mat); //this is just a hack to set the global matrix
623 
624  ACG::SceneGraph::LineNode *pLineNode = NULL;
625  if(!getAdditionalNode(pLineNode, "SkeletonPlugin", nameLineNode.c_str()))
626  {
627  pLineNode = new ACG::SceneGraph::LineNode( ACG::SceneGraph::LineNode::LineSegmentsMode, pTransNode, nameLineNode.c_str());
628  addAdditionalNode(pLineNode, "SkeletonPlugin", nameLineNode.c_str());
629  }
630  pLineNode->clear();
631 
632  Skeleton::Joint* joint = skeleton_->joint(i);
633 
634  if ( joint->size() > 0 ){
635 
636  for (uint c=0; c < joint->size(); c++ ){
637  Skeleton::Joint* child = joint->child(c);
638 
639  for (unsigned int a = 0; a < skeleton_->animationCount(); a++){
640 
641  AnimationHandle animHandle = AnimationHandle(a, 0 );
642 
643  //get animation
644  AnimationT<ACG::Vec3d>* animation = skeleton_->animation( animHandle );
645 
646  if (animation->name() == "")
647  continue;
648 
649  ACG::Vec3d lastPos(0.0, 0.0, 0.0);
650 
651  // every frame of that animation
652  for(unsigned int k = 0; k < animation->frameCount(); ++k){
653  animHandle.setFrame(k);
654  Skeleton::Pose* pose = skeleton_->pose( animHandle );
655 
656  ACG::Matrix4x4d globalInv = pose->globalMatrix( joint->id() );
657  globalInv.invert();
658 
659  ACG::Matrix4x4d local = pose->globalMatrix(child->id());
660  ACG::Matrix4x4d unified = pose->unifiedMatrix( joint->id() );
661 
662  ACG::Vec3d trans = pose->globalTranslation(child->id()) - pose->globalTranslation(joint->id());
663  trans *= 0.5;
664 
665  pLineNode->add_line( ACG::Vec3d(0.0, 0.0, 0.0), trans );
666  pLineNode->add_color( ACG::Vec3uc(180,255,180));
667 
668  pLineNode->add_line( lastPos, trans );
669  pLineNode->add_color( ACG::Vec3uc(110,160,110));
670 
671  lastPos = trans;
672  }
673  }
674 
675  ACG::Vec3d trans = ref->globalTranslation(child->id())-ref->globalTranslation(joint->id());
676  trans *= 0.6;
677 
678  pLineNode->add_line( ACG::Vec3d(0.0, 0.0, 0.0), trans);
679  pLineNode->add_color( ACG::Vec3uc(255,0,0));
680  }
681  }
682  }
683 
684  //update the indices with the current animationhandle
685  updateMotionPath( skeletonNode_->activePose() );
686 }
687 
688 //-----------------------------------------------------------------------------
689 
691 {
692  SkeletonObject *pObject = new SkeletonObject(*this);
693  return dynamic_cast<BaseObject*>(pObject);
694 }
695 
696 // ===============================================================================
697 // Update
698 // ===============================================================================
699 
700 
702  BaseObject::update(_type);
703 }
704 
705 //=============================================================================
706 
void showIndices(bool _bVisible=true)
Shows or hides the indices.
DrawMode SOLID_FLAT_SHADED
draw flat shaded faces (requires face normals)
Definition: DrawModes.cc:87
void scale(double _s)
Add scaling to the current Transformation.
void setDataType(DataType _type)
Definition: BaseObject.cc:244
SkeletonT< ACG::Vec3d > Skeleton
Simple Name for the Skeleton, based on double vectors.
virtual void cleanup()
Represents a single joint in the skeleton.
Definition: JointT.hh:66
Joint * child(size_t _index)
Returns the child joint with the given index.
Definition: JointT.cc:217
virtual void cleanup()
Reset current object, including all related nodes.
virtual BaseObject * copy()
Returns a full copy of the object.
Draw node & children.
Definition: BaseNode.hh:423
Vector globalTranslation(unsigned int _joint)
Returns the global translation vector.
Definition: PoseT.cc:233
Hide this node and its children.
Definition: BaseNode.hh:429
unsigned int jointCount()
Returns the number of joints.
Definition: SkeletonT.cc:701
bool pickingEnabled()
Check if picking is enabled for this object.
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
const Matrix & globalMatrix(unsigned int _joint) const
Returns the global matrix for the given joint.
Definition: PoseT.cc:199
void setFrame(unsigned int _iFrame)
Sets the current animation frame (not failsafe)
Skeleton * skeleton_
A pointer to the skeleton data.
unsigned int id()
returns the joint id
Definition: JointT.cc:103
void enablePicking(bool _enable)
Enable or disable picking for this object.
DrawMode POINTS
draw unlighted points using the default base color
Definition: DrawModes.cc:79
Update type class.
Definition: UpdateType.hh:70
MaterialNode * materialNode()
get a pointer to the materialnode
A general pose, used to store the frames of the animation.
Definition: PoseT.hh:68
Skeleton * skeleton()
Returns a pointer to the skeleton.
Animation * animation(std::string _name)
Returns a pointer to the animation to the given name.
Definition: SkeletonT.cc:858
void clear()
clear points/lines and colors
Definition: LineNode.cc:107
A handle used to refer to an animation or to a specific frame in an animation.
void show()
Show node: set status to Active.
Definition: MeshNode2T.cc:438
bool getAdditionalNode(NodeT *&_node, QString _pluginName, QString _nodeName, int _id=0)
get an addition node from the object
SeparatorNode * baseNode()
SkeletonObject()
Constructor.
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
StatusMode status() const
Get node&#39;s status.
Definition: MeshNode2T.cc:432
bool picked(uint _node_idx)
Returns true if the picked node given by _node_idx is this objects scenegraph node.
void deleteData()
Delete all data attached to this object ( calls delete on each object )
Definition: BaseObject.cc:823
void setActivePose(const AnimationHandle &_hAni)
Call this to set the active pose.
void set_round_points(bool _b)
set round points enabled
void updateMotionPath()
Updates the node that visualizes the local space of joint motions.
const Scalar * get_raw_data() const
Definition: Matrix4x4T.hh:262
BaseObject * child(int row)
return a child
Definition: BaseObject.cc:517
void updateIndices()
Updates the joint index text node positions.
unsigned int animationCount()
Returns the number of animations stored in this skeleton.
Definition: SkeletonT.cc:971
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
Definition: BaseObject.cc:756
virtual void init()
Initialize current object, including all related nodes.
void set_line_width(float _sz)
set line width (default: 1.0)
bool removeAdditionalNode(NodeT *&_node, QString _pluginName, QString _nodeName, int _id=0)
remove an additional node from the object
QString name() const
return the name of the object. The name defaults to NONAME if unset.
Definition: BaseObject.cc:741
virtual ~SkeletonObject()
Destructor.
bool invert()
matrix inversion (returns true on success)
Definition: Matrix4x4T.cc:297
Pose * pose(const AnimationHandle &_hAni)
Returns a pointer to the pose with the given animation handle.
Definition: SkeletonT.cc:741
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode()
Returns the skeleton scenegraph node.
void add_color(const ACG::Vec3uc &_c)
add color (only for LineMode == LineSegmentsMode)
Definition: LineNode.cc:168
virtual QString getObjectinfo()
Get all Info for the Object as a string.
Definition: BaseObject.cc:255
#define DATA_SKELETON
Definition: Skeleton.hh:70
const Matrix & unifiedMatrix(unsigned int _joint)
Returns the unified matrix.
Definition: PoseT.cc:403
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
void setName(QString _name)
Set the name of the Object.
void translate(const Vec3d &_v)
Add a translation to the current Transformation.
bool addAdditionalNode(NodeT *_node, QString _pluginName, QString _nodeName, int _id=0)
add an additional node to the object
void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
void showMotionPath(bool _visible=true)
Shows or hides the local motion space for a joint.
Joint * joint(const unsigned int &_index)
Returns the joint with the given index.
Definition: SkeletonT.cc:642
ACG::SceneGraph::SkeletonNodeT< Skeleton > * skeletonNode_
A pointer to the scenegraph node.
size_t size()
Returns the number of children.
Definition: JointT.cc:203
QString getObjectinfo()
Returns a string holding information on this object.
void add_line(const Vec3d &_v0, const Vec3d &_v1)
add line (for LineMode == LineSegmentsMode)
Definition: LineNode.cc:157
void set_status(StatusMode _s)
Set the status of this node.
Definition: MeshNode2T.cc:434
DataType dataType() const
Definition: BaseObject.cc:240
void set_point_size(float _sz)
set point size (default: 1.0)
Pose * referencePose()
Returns a pointer to the reference pose.
Definition: SkeletonT.cc:761