/usr/include/opencollada/COLLADASaxFrameworkLoader/COLLADASaxFWLNodeLoader.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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | /*
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_NODELOADER_H__
#define __COLLADASAXFWL_NODELOADER_H__
#include "COLLADASaxFWLPrerequisites.h"
#include "COLLADASaxFWLHelperLoaderBase.h"
#include "COLLADASaxFWLFileLoader.h"
#include "COLLADASaxFWLXmlTypes.h"
#include "COLLADASaxFWLTransformationLoader.h"
#include "COLLADAFWInstanceBindingBase.h"
#include "COLLADAFWInstanceGeometry.h"
#include "COLLADAFWInstanceController.h"
#include <stack>
#include <set>
namespace COLLADAFW
{
class Transformation;
class Node;
}
namespace COLLADASaxFWL
{
/** Imports the entire visual scene and sends it to the writer. */
class NodeLoader : public HelperLoaderBase
{
private:
/** Stack of nodes.*/
typedef std::stack<COLLADAFW::Node*> NodeStack;
/** Set of MaterialBindings*/
typedef std::set<COLLADAFW::MaterialBinding> MaterialBindingsSet;
/** Set of TextureCoordinateBinding*/
typedef std::set<COLLADAFW::TextureCoordinateBinding> TextureCoordinateBindingSet;
protected:
/** Stack of nodes to traverse back in node hierarchy. Array and contents will be delete in destructor.*/
NodeStack mNodeStack;
/** Instance with material (geometry) currently being filled.*/
COLLADAFW::InstanceGeometry* mCurrentInstanceGeometry;
/** Instance with material (controller) currently being filled.*/
COLLADAFW::InstanceController* mCurrentInstanceController;
private:
/** Transformation loader that helps to load transformations.*/
TransformationLoader mTransformationLoader;
/** Material binding currently being filled.*/
COLLADAFW::MaterialBinding* mCurrentMaterialBinding;
/** Set of all material bindings of the current instance geometry.*/
MaterialBindingsSet mCurrentMaterialBindings;
/** Set of all TextureCoordinate bindings of the current instance geometry.*/
TextureCoordinateBindingSet mCurrentTextureCoordinateBindings;
/** The material info of the geometry instantiated in the current instance geometry.*/
GeometryMaterialIdInfo* mCurrentMaterialInfo;
protected:
/** The InstanceControllerData of the current instance controller.*/
Loader::InstanceControllerData *mCurrentInstanceControllerData;
public:
/** Constructor. */
NodeLoader();
/** Destructor. */
virtual ~NodeLoader();
/** Sax callback function for the beginning of nodes, as child of a node.*/
virtual bool begin__node( const node__AttributeData& attributeData );
/** Sax callback function for the ending of nodes, as child of a node.*/
virtual bool end__node();
/** Sax callback function for the beginning of a translate element.*/
virtual bool begin__translate( const translate__AttributeData& attributeData );
/** Sax callback function for the ending of a translate element.*/
virtual bool end__translate();
/** Sax callback function for the float data of a translate element.*/
virtual bool data__translate( const float* data, size_t length );
/** Sax callback function for the beginning of a rotate element.*/
virtual bool begin__rotate( const rotate__AttributeData& attributeData );
/** Sax callback function for the ending of a rotate element.*/
virtual bool end__rotate();
/** Sax callback function for the float data of a rotate element.*/
virtual bool data__rotate( const float* data, size_t length );
/** Sax callback function for the beginning of a matrix element.*/
virtual bool begin__matrix( const matrix__AttributeData& attributeData );
/** Sax callback function for the ending of a matrix element.*/
virtual bool end__matrix();
/** Sax callback function for the float data of a rotate element.*/
virtual bool data__matrix( const float* data, size_t length );
/** Sax callback function for the beginning of a scale element.*/
virtual bool begin__scale( const scale__AttributeData& attributeData );
/** Sax callback function for the ending of a scale element.*/
virtual bool end__scale();
/** Sax callback function for the float data of a scale element.*/
virtual bool data__scale( const float* data, size_t length );
virtual bool begin__skew( const skew__AttributeData& attributeData );
virtual bool end__skew();
virtual bool data__skew( const float* data, size_t length );
virtual bool begin__lookat( const lookat__AttributeData& attributeData );
virtual bool end__lookat();
virtual bool data__lookat( const float* data, size_t length );
/** Sax callback function for the beginning of an instance geometry element.*/
virtual bool begin__instance_geometry( const instance_geometry__AttributeData& attributeData );
/** Sax callback function for the ending of an instance geometry element.*/
virtual bool end__instance_geometry();
/** We do not need to do anything here.*/
virtual bool begin__bind_material();
/** We do not need to do anything here.*/
virtual bool end__bind_material();
/** We do not need to do anything here.*/
virtual bool begin__bind_material__technique_common(){return true;}
/** We do not need to do anything here.*/
virtual bool end__bind_material__technique_common(){return true;}
/** Create new current bind material and set basic attributes.*/
virtual bool begin__instance_material( const instance_material__AttributeData& attributeData );
/** We store all instance_material informations in a set.*/
virtual bool end__instance_material();
/** We store all bind vertex informations in a set.*/
virtual bool begin__bind_vertex_input( const bind_vertex_input__AttributeData& attributeData );
/** We do not need to do anything here.*/
virtual bool end__bind_vertex_input(){return true; }
/** Sax callback function for the beginning of an instance node element.*/
virtual bool begin__instance_node( const instance_node__AttributeData& attributeData );
/** We don't need to do anything here.*/
virtual bool end__instance_node();
/** Appends the instance camera to the current node.*/
virtual bool begin__instance_camera( const instance_camera__AttributeData& attributeData );
/** We don't need to do anything here.*/
virtual bool end__instance_camera();
/** Appends the instance light to the current node.*/
virtual bool begin__instance_light( const instance_light__AttributeData& attributeData );
/** Set the current parsing position. */
virtual bool end__instance_light();
virtual bool begin__instance_controller( const instance_controller__AttributeData& attributeData );
virtual bool end__instance_controller();
virtual bool begin__skeleton(){return true;}
virtual bool end__skeleton(){return true;}
virtual bool data__skeleton( COLLADABU::URI value );
protected:
/** This method handles the beginning of a node element, independent of its parent.*/
bool beginNode( const node__AttributeData& attributeData );
/** This method handles the ending of a node element, independent of its parent.*/
bool endNode();
private:
/** Disable default copy ctor. */
NodeLoader( const NodeLoader& pre );
/** Disable default assignment operator. */
const NodeLoader& operator= ( const NodeLoader& pre );
/** Store a root node, i.e. a node that does not has a node as parent.*/
virtual void handleRootNode( COLLADAFW::Node* rootNode ) = 0;
/** This method handles the beginning of a transformation independent of its type.*/
template<class Transformationtype>
bool beginTransformation( const char* sid);
/** This method handles the ending of a transformation independent of its type.*/
bool endTransformation();
/** Assigns the bound materials to the current instance with material (geometry or controller).*/
bool endInstanceWithMaterial();
};
} // namespace COLLADASAXFWL
#endif // __COLLADASAXFWL_NODELOADER_H__
|