/usr/include/opencollada/COLLADASaxFrameworkLoader/COLLADASaxFWLKinematicsSceneCreator.h is in opencollada-dev 0.1.0~20140703.ddf8f47+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | /*
Copyright (c) 2008-2009 NetAllied Systems GmbH
This file is part of COLLADASaxFrameworkLoader.
Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __COLLADASAXFWL_KINEMATICSSCENECREATOR_H__
#define __COLLADASAXFWL_KINEMATICSSCENECREATOR_H__
#include "COLLADASaxFWLPrerequisites.h"
#include "COLLADAFWKinematicsModel.h"
#include "COLLADAFWKinematicsController.h"
#include <map>
#include <stack>
namespace COLLADAFW
{
class KinematicsScene;
class KinematicsModel;
}
namespace COLLADASaxFWL
{
class DocumentProcessor;
class KinematicsIntermediateData;
class KinematicsModel;
class KinematicLink;
class KinematicAttachment;
class KinematicsController;
class KinematicsInstanceKinematicsModel;
class KinematicsInstanceKinematicsScene;
class KinematicsScene;
class KinematicsBindJointAxis;
class AxisInfo;
/** Creates a kinematics scene from an intermediate kinematics data */
class KinematicsSceneCreator
{
public:
typedef std::map<COLLADAFW::Joint*, size_t> JointIndexMap;
typedef std::stack<size_t> NumberStack;
typedef std::map<COLLADAFW::JointPrimitive*, COLLADAFW::JointPrimitive*> JointPrimitiveJointPrimitiveMap;
typedef COLLADABU::hash_map<KinematicsModel*, COLLADAFW::KinematicsModel*> KinematicsModelFWKinematicsModelMap;
typedef std::set<COLLADAFW::InstanceKinematicsScene::NodeLinkBinding> NodeLinkBindingSet;
private:
/** The kinematics scene we are about to create.*/
COLLADAFW::KinematicsScene* mKinematicsScene;
/** The file loader that has all the information about the kinematics scene.*/
DocumentProcessor* mDocumentProcessor;
/** The kinematics intermediate data th kinematics scene will be created from. It is
provided by mFileLoader.*/
const KinematicsIntermediateData& mKinematicsIntermediateData;
/** Link number of the current link.*/
size_t mLargestLinkNumber;
/** Holds the link numbers of the current link and all of its parents.*/
NumberStack mLinkNumberStack;
/** Index of the next joint to be added to the current kinematics model.*/
size_t mLargestJointIndex;
/** Maps the joints in the intermediate data to their index in the current framework
kinematics model.*/
JointIndexMap mJointIndexMap;
/** We use this to map the joints created during the parse proces to the final nodes in the kinematics model,
to point to the correct joint in the axis infos.
TODO: This solution is to simple for the general case. Requires a much better algo
*/
JointPrimitiveJointPrimitiveMap mOriginalClonedJointPrimitiveMap;
/** Maps the intermediate kinematics model to the fw kinematics model.*/
KinematicsModelFWKinematicsModelMap mKinematicsModelFWKinematicsModelMap;
/** Set of all node link bindings. */
NodeLinkBindingSet mNodeLinkBindingSet;
public:
/** Constructor. */
KinematicsSceneCreator( DocumentProcessor* documentProcessor);
/** Destructor. */
virtual ~KinematicsSceneCreator();
COLLADAFW::KinematicsScene* createAndGetKinematicsScene();
private:
/** Disable default copy ctor. */
KinematicsSceneCreator( const KinematicsSceneCreator& pre );
/** Disable default assignment operator. */
const KinematicsSceneCreator& operator= ( const KinematicsSceneCreator& pre );
COLLADAFW::KinematicsModel* createFWKinematicsModel(KinematicsModel* kinematicsModel);
void createJointLinkConnections(const KinematicLink* link, COLLADAFW::KinematicsModel* fwKinematicsModel);
void createJointLinkConnections(const KinematicAttachment* attachment, size_t jointIndex, COLLADAFW::KinematicsModel* fwKinematicsModel);
COLLADAFW::KinematicsController* createFWKinematicsController(KinematicsController* kinematicsController);
COLLADAFW::InstanceKinematicsScene* createFWInstanceKinematicsScene(KinematicsInstanceKinematicsScene* instanceKinematicsScene);
COLLADAFW::AxisInfo createFWAxisInfo( const AxisInfo& axisInfo, bool& success );
COLLADAFW::UniqueId processInstanceKinematicsModel(const KinematicsInstanceKinematicsModel& instanceKinematicsModel);
bool resolveLink(KinematicsScene* kinematicsScene,
KinematicsBindJointAxis* kinematicsBindJointAxis,
size_t* linkNumber,
COLLADAFW::KinematicsModel** kinModel);
size_t findLinkByJOintPrimitive(const COLLADAFW::KinematicsModel* fwKinModel, const COLLADAFW::JointPrimitive* jointPrimitive);
};
} // namespace COLLADASAXFWL
#endif // __COLLADASAXFWL_KINEMATICSSCENECREATOR_H__
|