~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to COLLADAFramework/include/COLLADAFWKinematicsModel.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
    This file is part of COLLADAFramework.
 
5
 
 
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
 
9
*/
 
10
 
 
11
#ifndef __COLLADAFW_KINEMATICSMODEL_H__
 
12
#define __COLLADAFW_KINEMATICSMODEL_H__
 
13
 
 
14
#include "COLLADAFWPrerequisites.h"
 
15
#include "COLLADAFWTransformation.h"
 
16
#include "COLLADAFWJoint.h"
 
17
#include "COLLADAFWPointerArray.h"
 
18
#include "COLLADAFWObject.h"
 
19
 
 
20
 
 
21
namespace COLLADAFW
 
22
{
 
23
 
 
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>
 
28
        {
 
29
        public:
 
30
                /** Defines the connection of a joint to a link.*/
 
31
                class LinkJointConnection
 
32
                {
 
33
                private:
 
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. */
 
36
                        size_t mLinkNumber;
 
37
 
 
38
                        /** The index of the joint in mJoints of KinematicsModel.*/
 
39
                        size_t mJointIndex;
 
40
 
 
41
                        /** The transformation defining the position and orientation of the joint, relative to the link.*/
 
42
                        TransformationPointerArray mTransformations;
 
43
 
 
44
                public:
 
45
                        LinkJointConnection( size_t linkNumber, size_t jointIndex)
 
46
                                : mLinkNumber(linkNumber)
 
47
                                , mJointIndex(jointIndex)
 
48
                        {}
 
49
 
 
50
                        /** Returns the number of the link. This number is used to uniquely identify one link within a specific 
 
51
                        kinematics model. */
 
52
                        size_t getLinkNumber() const { return mLinkNumber; }
 
53
 
 
54
                        /** Returns the index of the joint in mJoints of KinematicsModel.*/
 
55
                        size_t getJointIndex() const { return mJointIndex; }
 
56
 
 
57
                        /** Returns the transformation defining the position and orientation of the joint, relative to the link.*/
 
58
                        const TransformationPointerArray& getTransformations() const { return mTransformations; }
 
59
 
 
60
                        /** Returns the transformation defining the position and orientation of the joint, relative to the link.*/
 
61
                        TransformationPointerArray& getTransformations(){ return mTransformations; }
 
62
 
 
63
                        /** Creates a clone of the LinkJointConnection and returns a pointer to it.*/
 
64
                        LinkJointConnection* clone() const { return FW_NEW LinkJointConnection(*this); }
 
65
 
 
66
                };
 
67
 
 
68
                typedef PointerArray<LinkJointConnection> LinkJointConnections;
 
69
 
 
70
        private:
 
71
 
 
72
                /** The joints used in the kinematics model.*/
 
73
                JointPointerArray mJoints;
 
74
 
 
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;
 
78
 
 
79
                /** Indices of the kinematics models base links.*/
 
80
                SizeTValuesArray mBaseLinks;
 
81
        
 
82
        public:
 
83
 
 
84
        /** Constructor. */
 
85
                KinematicsModel(const UniqueId& uniqueId);
 
86
 
 
87
        /** Destructor. */
 
88
                virtual ~KinematicsModel();
 
89
 
 
90
                /** Returns the joints used in the kinematics model.*/
 
91
                const JointPointerArray& getJoints() const { return mJoints; }
 
92
 
 
93
                /** Returns the joints used in the kinematics model.*/
 
94
                JointPointerArray& getJoints() { return mJoints; }
 
95
 
 
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; }
 
99
 
 
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; }
 
103
 
 
104
                /** Returns the indices of the kinematics models base links.*/
 
105
                const SizeTValuesArray& getBaseLinks() const { return mBaseLinks; }
 
106
 
 
107
                /** Returns the indices of the kinematics models base links.*/
 
108
                SizeTValuesArray& getBaseLinks(){ return mBaseLinks; }
 
109
 
 
110
                /** Creates a clone of the KinematicsModel and returns a pointer to it.*/
 
111
                KinematicsModel* clone() const { return FW_NEW KinematicsModel(*this); }
 
112
 
 
113
        private:
 
114
 
 
115
        /** Disable default copy ctor. */
 
116
                KinematicsModel( const KinematicsModel& pre );
 
117
 
 
118
        /** Disable default assignment operator. */
 
119
                const KinematicsModel& operator= ( const KinematicsModel& pre );
 
120
 
 
121
        };
 
122
 
 
123
        typedef PointerArray<KinematicsModel> KinematicsModelArray;
 
124
 
 
125
} // namespace COLLADAFW
 
126
 
 
127
#endif // __COLLADAFW_KINEMATICSMODEL_H__