2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAFramework.
6
Licensed under the MIT Open Source License,
7
for details please see LICENSE file or the website
8
http://www.opensource.org/licenses/mit-license.php
11
#ifndef __COLLADAFW_KINEMATICSMODEL_H__
12
#define __COLLADAFW_KINEMATICSMODEL_H__
14
#include "COLLADAFWPrerequisites.h"
15
#include "COLLADAFWTransformation.h"
16
#include "COLLADAFWJoint.h"
17
#include "COLLADAFWPointerArray.h"
18
#include "COLLADAFWObject.h"
24
/** A kinematics model. It describes a kinematics model, using the joints contained in mJoints. The hierarchy
25
of the model is defines by a list of LinkJointConnection that connect the joints to a link. Since links do
26
not have any properties, they are simply described by numbers, starting from 0. */
27
class KinematicsModel : public ObjectTemplate<COLLADA_TYPE::KINEMATICS_MODEL>
30
/** Defines the connection of a joint to a link.*/
31
class LinkJointConnection
34
/** The number of the link. This number is used to uniquely identify one link within a specific
35
kinematics model. The base link has always number 0. */
38
/** The index of the joint in mJoints of KinematicsModel.*/
41
/** The transformation defining the position and orientation of the joint, relative to the link.*/
42
TransformationPointerArray mTransformations;
45
LinkJointConnection( size_t linkNumber, size_t jointIndex)
46
: mLinkNumber(linkNumber)
47
, mJointIndex(jointIndex)
50
/** Returns the number of the link. This number is used to uniquely identify one link within a specific
52
size_t getLinkNumber() const { return mLinkNumber; }
54
/** Returns the index of the joint in mJoints of KinematicsModel.*/
55
size_t getJointIndex() const { return mJointIndex; }
57
/** Returns the transformation defining the position and orientation of the joint, relative to the link.*/
58
const TransformationPointerArray& getTransformations() const { return mTransformations; }
60
/** Returns the transformation defining the position and orientation of the joint, relative to the link.*/
61
TransformationPointerArray& getTransformations(){ return mTransformations; }
63
/** Creates a clone of the LinkJointConnection and returns a pointer to it.*/
64
LinkJointConnection* clone() const { return FW_NEW LinkJointConnection(*this); }
68
typedef PointerArray<LinkJointConnection> LinkJointConnections;
72
/** The joints used in the kinematics model.*/
73
JointPointerArray mJoints;
75
/** List of LinkJointConnection that define the connection between the links and the joints. This
76
defines the hierarchy of the kinematics model.*/
77
LinkJointConnections mLinkJointConnections;
79
/** Indices of the kinematics models base links.*/
80
SizeTValuesArray mBaseLinks;
85
KinematicsModel(const UniqueId& uniqueId);
88
virtual ~KinematicsModel();
90
/** Returns the joints used in the kinematics model.*/
91
const JointPointerArray& getJoints() const { return mJoints; }
93
/** Returns the joints used in the kinematics model.*/
94
JointPointerArray& getJoints() { return mJoints; }
96
/** Returns the List of LinkJointConnection that define the connection between the links and the joints. This
97
defines the hierarchy of the kinematics model.*/
98
const LinkJointConnections& getLinkJointConnections() const { return mLinkJointConnections; }
100
/** Returns the List of LinkJointConnection that define the connection between the links and the joints. This
101
defines the hierarchy of the kinematics model.*/
102
LinkJointConnections& getLinkJointConnections() { return mLinkJointConnections; }
104
/** Returns the indices of the kinematics models base links.*/
105
const SizeTValuesArray& getBaseLinks() const { return mBaseLinks; }
107
/** Returns the indices of the kinematics models base links.*/
108
SizeTValuesArray& getBaseLinks(){ return mBaseLinks; }
110
/** Creates a clone of the KinematicsModel and returns a pointer to it.*/
111
KinematicsModel* clone() const { return FW_NEW KinematicsModel(*this); }
115
/** Disable default copy ctor. */
116
KinematicsModel( const KinematicsModel& pre );
118
/** Disable default assignment operator. */
119
const KinematicsModel& operator= ( const KinematicsModel& pre );
123
typedef PointerArray<KinematicsModel> KinematicsModelArray;
125
} // namespace COLLADAFW
127
#endif // __COLLADAFW_KINEMATICSMODEL_H__