/usr/include/opencollada/COLLADAFramework/COLLADAFWNode.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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | /*
Copyright (c) 2008-2009 NetAllied Systems GmbH
This file is part of COLLADAFramework.
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 __COLLADAFW_NODE_H__
#define __COLLADAFW_NODE_H__
#include "COLLADAFWPrerequisites.h"
#include "COLLADAFWObject.h"
#include "COLLADAFWTransformation.h"
#include "COLLADAFWInstanceGeometry.h"
#include "COLLADAFWInstanceNode.h"
#include "COLLADAFWInstanceCamera.h"
#include "COLLADAFWInstanceLight.h"
#include "COLLADAFWInstanceController.h"
#include "COLLADAFWArrayPrimitiveType.h"
#include "COLLADAFWPointerArray.h"
#include "Math/COLLADABUMathVector3.h"
namespace COLLADABU
{
namespace Math
{
class Matrix4;
}
}
namespace COLLADAFW
{
class Node;
typedef ArrayPrimitiveType<Node*> NodeArray;
typedef PointerArray<Node> NodePointerArray;
class Node : public ObjectTemplate<COLLADA_TYPE::NODE>
{
public:
enum NodeType
{
NODE,
JOINT
};
private:
/**
* The original object id, if it in the original file format exist.
*/
String mOriginalId;
/**
* The name attribute is the text string name of this element.
* Optional attribute.
*/
String mName;
/**
* The type of the <node> element. Valid values are JOINT or NODE. The default is
* NODE. Optional.
*/
NodeType mType;
/**
* The sid of the joint. Only relevant is mType is JOINT.
*/
String mSid;
/** List of all transformations of the node. Array and contents will be delete in destructor.*/
TransformationPointerArray mTransformations;
/** List of all instance geometries of this node. Array and contents will be delete in destructor.*/
InstanceGeometryPointerArray mInstanceGeometries;
/** List of all instance nodes of this node. Array and contents will be delete in destructor.*/
InstanceNodePointerArray mInstanceNodes;
/** List of all instance cameras of this node. Array and contents will be delete in destructor.*/
InstanceCameraPointerArray mInstanceCameras;
/** List of all instance lights of this node. Array and contents will be delete in destructor.*/
InstanceLightPointerArray mInstanceLights;
/** List of all instance controller of this node. Array and contents will be delete in destructor.*/
InstanceControllerPointerArray mInstanceControllers;
/** List of all child nodes. Array and contents will be delete in destructor.*/
NodePointerArray mChildNodes;
public:
/** Creates a node with object id @a objectId.*/
Node(const UniqueId& uniqueId);
virtual ~Node();
/**
* The original object id, if it in the original file format exist.
*/
const String& getOriginalId () const { return mOriginalId; }
/**
* The original object id, if it in the original file format exist.
*/
void setOriginalId ( const String& val ) { mOriginalId = val; }
/** Returns the name of the node*/
const String& getName() const { return mName; }
/** Sets the name of the node*/
void setName(const String& name) { mName = name; }
/** Returns the sid of the joint. Only relevant when mType is JOINT. */
const String& getSid() const { return mSid; }
/** Sets the sid of the joint. Only relevant when mType is JOINT. */
void setSid(const String& sid) { mSid = sid; }
/** The type of the <node> element. Valid values are JOINT or NODE. The default is
NODE. Optional. */
const Node::NodeType getType () const { return mType; }
/** The type of the <node> element. Valid values are JOINT or NODE. The default is
NODE. Optional. */
void setType ( const Node::NodeType Type ) { mType = Type; }
/** Get list of all transformations of the node.*/
TransformationPointerArray& getTransformations() { return mTransformations; }
/** Get list of all transformations of the node.*/
const TransformationPointerArray& getTransformations() const { return mTransformations; }
/** List of all instance geometries of this node.*/
InstanceGeometryPointerArray& getInstanceGeometries() { return mInstanceGeometries; }
/** List of all instance geometries of this node.*/
const InstanceGeometryPointerArray& getInstanceGeometries() const { return mInstanceGeometries; }
/** List of all instance nodes of this node.*/
InstanceNodePointerArray& getInstanceNodes() { return mInstanceNodes; }
/** List of all instance nodes of this node.*/
const InstanceNodePointerArray& getInstanceNodes() const { return mInstanceNodes; }
/** List of all instance cameras of this camera.*/
InstanceCameraPointerArray& getInstanceCameras() { return mInstanceCameras; }
/** List of all instance cameras of this camera.*/
const InstanceCameraPointerArray& getInstanceCameras() const { return mInstanceCameras; }
/** List of all instance cameras of this camera.*/
InstanceLightPointerArray& getInstanceLights() { return mInstanceLights; }
/** List of all instance cameras of this camera.*/
const InstanceLightPointerArray& getInstanceLights() const { return mInstanceLights; }
/** List of all instance controller of this node. Array and contents will be delete in destructor.*/
InstanceControllerPointerArray& getInstanceControllers () { return mInstanceControllers; }
/** List of all instance controller of this node. Array and contents will be delete in destructor.*/
const InstanceControllerPointerArray& getInstanceControllers () const { return mInstanceControllers; }
/** Get list of all child nodes.*/
NodePointerArray& getChildNodes() { return mChildNodes; }
/** Get list of all child nodes.*/
const NodePointerArray& getChildNodes() const { return mChildNodes; }
/** Calculates a baked matrix, representing all the transformations.
@param transformationMatrix Will be set to the calculated node transformation matrix.*/
void getTransformationMatrix(COLLADABU::Math::Matrix4& transformationMatrix) const;
/** Calculates a baked matrix, representing all the transformations.
@return The calculated node transformation matrix. */
COLLADABU::Math::Matrix4 getTransformationMatrix() const;
/** Creates a clone of the node and returns a pointer to it.*/
Node* clone() const { return FW_NEW Node(*this); }
};
} // namespace COLLADAFW
#endif // __COLLADAFW_NODE_H__
|