1 /* 2 Copyright (c) 2008-2009 NetAllied Systems GmbH 3 4 This file is part of COLLADAMax. 5 6 Portions of the code are: 7 Copyright (c) 2005-2007 Feeling Software Inc. 8 Copyright (c) 2005-2007 Sony Computer Entertainment America 9 10 Based on the 3dsMax COLLADASW Tools: 11 Copyright (c) 2005-2006 Autodesk Media Entertainment 12 13 Licensed under the MIT Open Source License, 14 for details please see LICENSE file or the website 15 http://www.opensource.org/licenses/mit-license.php 16 */ 17 18 #ifndef __COLLADAMAX_DOCUMENTIMPORTER_H__ 19 #define __COLLADAMAX_DOCUMENTIMPORTER_H__ 20 21 #include "COLLADAMaxPrerequisites.h" 22 #include "COLLADAMaxConversionFunctor.h" 23 #include "COLLADAMaxTypes.h" 24 25 #include "COLLADAFWIWriter.h" 26 #include "COLLADAFWMaterial.h" 27 #include "COLLADAFWEffect.h" 28 #include "COLLADAFWColor.h" 29 #include "COLLADAFWImage.h" 30 #include "COLLADAFWInstanceGeometry.h" 31 #include "COLLADAFWController.h" 32 #include "COLLADAFWMorphController.h" 33 #include "COLLADAFWSkinController.h" 34 #include "COLLADAFWFileInfo.h" 35 36 #include <list> 37 38 39 class Interface; 40 class ImpInterface; 41 class DummyObject; 42 class Control; 43 44 namespace COLLADAFW 45 { 46 class VisualScene; 47 class Geometry; 48 class UniqueId; 49 class LibraryNodes; 50 class Node; 51 class Camera; 52 class AnimationList; 53 } 54 55 namespace COLLADAMax 56 { 57 58 class MaterialCreator; 59 class ExtraDataHandler; 60 61 62 class DocumentImporter : COLLADAFW::IWriter 63 { 64 public: 65 enum ParsingPasses 66 { 67 GENERAL_PASS, //!< The first pass to gather all data except controller data 68 CONTROLLER_DATA_PASS //!< The second pass to gather controller data 69 }; 70 71 /** Maps Unique id to INodes.*/ 72 typedef std::multimap<COLLADAFW::UniqueId, INode*> UniqueIdINodeMultiMap; 73 74 /** Const iterator of the map above.*/ 75 typedef UniqueIdINodeMultiMap::const_iterator UniqueIdINodeMultiMapConstIterator; 76 77 /** Maps Unique id to ImpNodes.*/ 78 typedef std::multimap<COLLADAFW::UniqueId, ImpNode*> UniqueIdImpNodeMultiMap; 79 80 /** Maps Unique id to INodes.*/ 81 typedef std::map<COLLADAFW::UniqueId, INode*> UniqueIdINodeMap; 82 83 /** Maps Unique id to Objects.*/ 84 typedef std::map<COLLADAFW::UniqueId, Object*> UniqueIdObjectMap; 85 86 /** Maps objects to Unique id to.*/ 87 typedef std::map< INode*, COLLADAFW::UniqueId> ObjectINodeUniqueIdMap; 88 89 /** List of library nodes.*/ 90 typedef std::list<const COLLADAFW::LibraryNodes*> LibraryNodesList; 91 92 /** List of nodes visual scenes.*/ 93 typedef std::map<COLLADAFW::UniqueId, const COLLADAFW::VisualScene*> UniqueIdVisualSceneMap; 94 95 /** Maps Unique id to framework nodes.*/ 96 typedef std::map<COLLADAFW::UniqueId, const COLLADAFW::Node*> UniqueIdFWNodeMap; 97 98 /** Maps unique ids of framework materials to the corresponding framework material.*/ 99 typedef std::map<COLLADAFW::UniqueId, COLLADAFW::Material> UniqueIdFWMaterialMap; 100 101 /** Maps unique ids of framework images to the corresponding framework image.*/ 102 typedef std::map<COLLADAFW::UniqueId, COLLADAFW::Image> UniqueIdFWImageMap; 103 104 /** Maps unique ids of framework effects to the corresponding framework material.*/ 105 typedef std::map<COLLADAFW::UniqueId, COLLADAFW::Effect> UniqueIdFWEffectMap; 106 107 /** Vector of material bindings.*/ 108 typedef std::vector<COLLADAFW::MaterialBinding> MaterialBindingVector; 109 110 /** Pair of nodes an the instantiated materials.*/ 111 struct NodeMaterialBindingsPair 112 { 113 INode* maxNode; 114 MaterialBindingVector materialBindings; 115 }; 116 117 /** List of all max nodes that reference a material and their material bindings.*/ 118 typedef std::list<NodeMaterialBindingsPair> NodeMaterialBindingsList; 119 120 /** Maps frame work material ids to max material ids.*/ 121 typedef std::map<COLLADAFW::MaterialId, MtlID > FWMaterialIdMaxMtlIdMap; 122 123 /** Maps the unique id of a geometry to the material id mapping.*/ 124 typedef std::map<COLLADAFW::UniqueId, FWMaterialIdMaxMtlIdMap > GeometryMaterialIdMapMap; 125 126 /** Maps sets ( index for multiple texcoords) to the max map channel this set of tex coordinates has been saved in.*/ 127 typedef std::map<size_t /* Set index*/, int /* Max map channel*/ > SetMapChannelMap; 128 129 /** Maps each geometry to its SetMapChannelMap.*/ 130 typedef std::map<COLLADAFW::UniqueId /* geometry unique id*/, SetMapChannelMap > GeometrySetMapChannelMap; 131 132 /** List of inode inode pairs.*/ 133 typedef std::vector<std::pair<INode*, INode*>> INodeINodePairList; 134 135 /** Maps an object to its name.*/ 136 typedef std::map<Object*, String > ObjectObjectNameMap; 137 138 /** A list of max controllers.*/ 139 typedef std::vector<Control*> MaxControllerList; 140 141 /** Maps each already imported frame work animation to a list of created max float controllers.*/ 142 typedef std::map< COLLADAFW::UniqueId /* Animation*/, MaxControllerList> UniqueIdMaxControllerListMap; 143 144 /** Holds all already imported animation list, sorted by their unique id.*/ 145 typedef std::map< COLLADAFW::UniqueId /* AnimationList*/, COLLADAFW::AnimationList*> UniqueIdAnimationListMap; 146 147 /** Maps unique ids of controller data to the corresponding controller.*/ 148 typedef std::multimap< COLLADAFW::UniqueId /* Controller data*/, const COLLADAFW::Controller*> UniqueIdControllerMultiMap; 149 150 /** Maps Unique ids of morph controllers to the morph controller.*/ 151 typedef std::map< COLLADAFW::UniqueId /* Controller data*/, const COLLADAFW::MorphController* > UniqueIdMorphControllerMap; 152 153 /** Maps Unique ids of skin controllers to the skin controller.*/ 154 typedef std::map< COLLADAFW::UniqueId /* Controller data*/, const COLLADAFW::SkinController* > UniqueIdSkinControllerMap; 155 156 /** List of light pairs.*/ 157 typedef std::vector< COLLADAFW::Light > LightList; 158 159 struct FileInfo 160 { 161 COLLADABU::URI absoluteFileUri; 162 float unitScale; 163 COLLADAFW::FileInfo::UpAxisType upAxis; 164 }; 165 166 /** List of unique ids.*/ 167 typedef std::vector< COLLADAFW::UniqueId > UniqueIdList; 168 169 struct UnitConversionFunctors 170 { 171 ConversionFunctor* lengthConversion; 172 ConversionFunctor* inverseLengthConversion; 173 ConversionFunctor* angleConversion; 174 ConversionFunctor* timeConversion; 175 }; 176 177 /** Maps unique ids of framework materials to the corresponding framework material.*/ 178 typedef std::map<COLLADAFW::UniqueId, SkyLightParameters> UniqueIdSkyLightMap; 179 180 /** Maps unique ids of framework effects to the corresponding bump-map definitions.*/ 181 typedef std::map<COLLADAFW::UniqueId, EffectMaps> UniqueIdEffectMapsMap; 182 183 private: 184 /** Max interface.*/ 185 Interface* mMaxInterface; 186 187 /** Max import interface.*/ 188 ImpInterface* mMaxImportInterface; 189 190 /** File path of the COLLADA document to import.*/ 191 NativeString mImportFilePath; 192 193 /** Time in seconds when the instance of th importer was created.*/ 194 double mStartTime; 195 196 /** The accumulated ambient color.*/ 197 COLLADAFW::Color mAmbientColor; 198 199 /** The number of ambient colors already added.*/ 200 size_t mNumberOfAmbientColors; 201 202 /** A dummy helper, that is used for nodes that do not have an object assigned to.*/ 203 DummyObject* mDummyObject; 204 205 /** Maps the unique ids of objects (geometries, controllers,...) that are referenced by INodes to 206 these referencing INodes. This map is being filled while importing the visual scene. It is 207 required for objects that are referenced before they are imported.*/ 208 UniqueIdINodeMultiMap mUniqueIdObjectINodeMap; 209 210 /** Maps the unique ids of objects (geometries, controllers,...) to the created max object. This map 211 is being filled while importing geometries. */ 212 UniqueIdObjectMap mUniqueIdObjectMap; 213 214 /** Maps the unique ids of nodes to the created max INode. This map is being filled while importing 215 the visual scene. It is required when ever nodes are referenced, after they have been imported.*/ 216 UniqueIdINodeMap mUniqueIdINodeMap; 217 218 /** Maps the unique ids of nodes that are instantiated to the created instantiating max INode. This 219 map is being filled while importing the visual scene. It is required when ever nodes are referenced, 220 before they have been imported.*/ 221 UniqueIdImpNodeMultiMap mUniqueIdReferencingImpNodeMap; 222 223 /** Maps each already imported object to its Unique id. When ever a new object is created it 224 should be added to this map. .*/ 225 ObjectINodeUniqueIdMap mObjectINodeUniqueIdMap; 226 227 /** Maps Unique ids of nodes that are in a library nodes but not already in the max scene graph to 228 the frame word node itself. Each frame work node, that is in a library nodes but not immediately added 229 to the max scene graph should be added to that map. When looking for referenced nodes check this map if 230 the referenced node is not already in the max scene graph.*/ 231 UniqueIdFWNodeMap mUniqueIdFWNodeMap; 232 233 /** This vector contains all library nodes already received by the importer.*/ 234 LibraryNodesList mLibraryNodesList; 235 236 /** Maps unique ids to visual scene already received by the importer.*/ 237 UniqueIdVisualSceneMap mUniqueIdVisualSceneMap; 238 239 /** Maps unique ids of framework materials to the corresponding framework material.*/ 240 UniqueIdFWMaterialMap mUniqueIdFWMaterialMap; 241 242 /** Maps unique ids of framework effects to the corresponding framework effect.*/ 243 UniqueIdFWEffectMap mUniqueIdFWEffectMap; 244 245 /** Maps unique ids of framework images to the corresponding framework image.*/ 246 UniqueIdFWImageMap mUniqueIdFWImageMap; 247 248 /** of all max nodes that reference a material and their material bindings.*/ 249 NodeMaterialBindingsList mNodeMaterialBindingsList; 250 251 /** Maps the unique id of a geometry to the material id mapping.*/ 252 GeometryMaterialIdMapMap mGeometryMaterialIdMapMap; 253 254 /** Maps each geometry to its SetMapChannelMap.*/ 255 GeometrySetMapChannelMap mGeometrySetMapChannelMap; 256 257 /** List of pairs of cloned nodes and their originals. This is used to assign materials. When ever 258 an inode is cloned, the cloned one and itself should be added to that list.*/ 259 INodeINodePairList mClonedINodeOriginalINodePairList; 260 261 /** Maps an object to its name. Whenever an object is created, add it with its name to this map.*/ 262 ObjectObjectNameMap mObjectObjectNameMap; 263 264 /** List of unique ids of objects that use vertex color. When ever a geometry that uses vertex color is created, 265 its unique id should be added to this list.*/ 266 UniqueIdList mVertexColorObjects; 267 268 /** Maps each already imported frame work animation to a list of created max float controllers.*/ 269 UniqueIdMaxControllerListMap mAnimationUniqueIdMaxControllerListMap; 270 271 /** Holds all already imported animation list, sorted by their unique id.*/ 272 UniqueIdAnimationListMap mUniqueIdAnimationListMap; 273 274 /** Maps unique ids of controller data to the corresponding controller.*/ 275 UniqueIdControllerMultiMap mUniqueIdControllerMap; 276 277 /** Maps Unique ids of all morph controllers found during the first pass to the morph controller.*/ 278 UniqueIdMorphControllerMap mUniqueIdMorphControllersMap; 279 280 /** Maps the unique ids of morph controllers that are NOT instantiated in the scene graph but 281 used as source by a skin controller to the INode that references this skin controller.*/ 282 UniqueIdINodeMap mMorphUniqueIdINodeMap; 283 284 /** Maps Unique ids of all skin controllers found during the first pass to the skin controller.*/ 285 UniqueIdSkinControllerMap mUniqueIdSkinControllersMap; 286 287 /** List of light pairs. USed to assign animations to light parameters.*/ 288 LightList mLightList; 289 290 // TODO check if we need this map 291 /** Maps unique ids of skin controller to the INode that references the controller.*/ 292 UniqueIdINodeMap mSkinControllerINodeMap; 293 294 /** Holds informations about the entire file being loaded.*/ 295 FileInfo mFileInfo; 296 297 /** Functors used to convert values from frame work units into max units.*/ 298 UnitConversionFunctors mUnitConversionFunctors; 299 300 /** The current pass we are performing.*/ 301 ParsingPasses mCurrentParsingPass; 302 303 /** If set to true, 1-transparency is used as transparency. This used to circumvent wrong transparency 304 handling Google SketchUp COLLADA exporter*/ 305 bool mInvertTransparency; 306 307 ExtraDataHandler* mExtraDataHandler; 308 309 UniqueIdSkyLightMap mUniqueIdSkyLightMap; 310 311 COLLADAFW::UniqueId mVisualSceneUniqueId; 312 313 UniqueIdEffectMapsMap mEffectMaps; 314 315 public: 316 /** Constructor . 317 @param maxInterface The max interface. 318 @param the file name of the file to import.*/ 319 DocumentImporter(Interface * maxInterface, ImpInterface* maxImportInterface, const NativeString &filepath); 320 321 virtual ~DocumentImporter(); 322 323 /** Start the import of the model. 324 @return True on success, false otherwise. */ 325 bool import(); 326 327 /** Prints a message in the max gui. Only for debugging purposes.*/ 328 void printMessage( const String& message); 329 330 /* Returns the time elapsed the instantiation of the importer.*/ 331 double getElapsedTime() const; 332 333 /** Creates a new max object with @a superClassId and @a classId. If the object could not be created, 334 null is returned.*/ 335 void* createMaxObject(SClass_ID superClassId, Class_ID classId); 336 337 /** Returns the max interface.*/ getMaxInterface()338 Interface* getMaxInterface() { return mMaxInterface; } 339 340 /** Returns the max interface.*/ getMaxImportInterface()341 ImpInterface* getMaxImportInterface() { return mMaxImportInterface; } 342 343 /** Returns the accumulated ambient color.*/ getAmbientColor()344 const COLLADAFW::Color& getAmbientColor() const { return mAmbientColor; } 345 346 /** Returns the number of accumulated ambient colors.*/ getNumberOfAmbientColors()347 size_t getNumberOfAmbientColors() const { return mNumberOfAmbientColors; } 348 349 /** Adds @a ambientColor to the total ambient color.*/ 350 void addAmbientColor( const COLLADAFW::Color& ambientColor); 351 352 /** Converts @a originalValue in units provided by file info to units currently set in max.*/ 353 float convertSpaceUnit( float originalValue ); 354 355 /** If set to true, 1-transparency is used as transparency. This used to circumvent wrong transparency 356 handling Google SketchUp COLLADA exporter*/ getInvertTransparency()357 bool getInvertTransparency() const { return mInvertTransparency; } 358 359 360 /** Deletes the entire scene. 361 @param errorMessage A message containing informations about the error that occurred. 362 */ cancel(const String & errorMessage)363 void cancel(const String& errorMessage){}; 364 365 /** Prepare to receive data.*/ start()366 void start(){}; 367 368 /** Remove all objects that don't have an object. Deletes unused visual scenes.*/ finish()369 void finish(){}; 370 371 /** When this method is called, the writer must write the global document asset. 372 @return The writer should return true, if writing succeeded, false otherwise.*/ 373 virtual bool writeGlobalAsset ( const COLLADAFW::FileInfo* asset );; 374 375 /** Writes the scene. 376 @return True on succeeded, false otherwise.*/ 377 virtual bool writeScene ( const COLLADAFW::Scene* scene ); 378 379 /** Writes the entire visual scene. 380 @return True on succeeded, false otherwise.*/ 381 virtual bool writeVisualScene ( const COLLADAFW::VisualScene* visualScene ); 382 383 /** Handles all nodes in the library nodes. 384 @return True on succeeded, false otherwise.*/ 385 virtual bool writeLibraryNodes( const COLLADAFW::LibraryNodes* libraryNodes ); 386 387 /** Writes the geometry. 388 @return True on succeeded, false otherwise.*/ 389 virtual bool writeGeometry ( const COLLADAFW::Geometry* geometry ); 390 391 /** Writes the material. 392 @return True on succeeded, false otherwise.*/ 393 virtual bool writeMaterial( const COLLADAFW::Material* material ); 394 395 /** Writes the effect. 396 @return True on succeeded, false otherwise.*/ 397 virtual bool writeEffect( const COLLADAFW::Effect* effect ); 398 399 /** Writes the camera. 400 @return True on succeeded, false otherwise.*/ 401 virtual bool writeCamera( const COLLADAFW::Camera* camera ); 402 403 /** Writes the image. 404 @return True on succeeded, false otherwise.*/ 405 virtual bool writeImage( const COLLADAFW::Image* image ); 406 407 /** Writes the light. 408 @return True on succeeded, false otherwise.*/ 409 virtual bool writeLight( const COLLADAFW::Light* light ); 410 411 /** Writes the animation. 412 @return True on succeeded, false otherwise.*/ 413 virtual bool writeAnimation( const COLLADAFW::Animation* animation ); 414 415 /** Writes the animation. 416 @return True on succeeded, false otherwise.*/ 417 virtual bool writeAnimationList( const COLLADAFW::AnimationList* animationList ); 418 419 /** Writes the animation clip. 420 @return True on succeeded, flase otherwise.*/ writeAnimationClip(const COLLADAFW::AnimationClip * animationClip)421 virtual bool writeAnimationClip( const COLLADAFW::AnimationClip* animationClip ) { return true; } 422 423 /** When this method is called, the writer must write the skin controller data. 424 @return The writer should return true, if writing succeeded, false otherwise.*/ 425 virtual bool writeSkinControllerData( const COLLADAFW::SkinControllerData* skinControllerData ); 426 427 /** When this method is called, the writer must write the controller. 428 @return The writer should return true, if writing succeeded, false otherwise.*/ 429 virtual bool writeController( const COLLADAFW::Controller* Controller ); 430 431 /** When this method is called, the writer must write the formulas. All the formulas of the entire 432 COLLADA file are contained in @a formulas. 433 @return The writer should return true, if writing succeeded, false otherwise.*/ writeFormulas(const COLLADAFW::Formulas * formulas)434 virtual bool writeFormulas( const COLLADAFW::Formulas* formulas ) { return true; } 435 436 /** When this method is called, the writer must write the kinematics scene. 437 @return The writer should return true, if writing succeeded, false otherwise.*/ writeKinematicsScene(const COLLADAFW::KinematicsScene * kinematicsScene)438 virtual bool writeKinematicsScene( const COLLADAFW::KinematicsScene* kinematicsScene ) { return true; } 439 440 441 private: 442 /** Disable default copy ctor. */ 443 DocumentImporter( const DocumentImporter& pre ); 444 /** Disable default assignment operator. */ 445 const DocumentImporter& operator= ( const DocumentImporter& pre ); 446 447 /** Assigns the imported controllers (animations)to the corresponding objects.*/ 448 bool assignControllers( const MaterialCreator& materialCreator ); 449 450 /** Creates the scene graph.*/ 451 bool createSceneGraph(); 452 453 /** Creates the scene graph.*/ 454 bool createMorphController(); 455 456 /** Returns the dummy object used for nodes that do not have an object assigned to.*/ getDummyObject()457 DummyObject* getDummyObject(){ return mDummyObject; } 458 459 /** Returns the UniqueId Object INode Mapping.*/ getUniqueIdObjectINodeMap()460 UniqueIdINodeMultiMap& getUniqueIdObjectINodeMap(){ return mUniqueIdObjectINodeMap; } 461 462 /** Returns the UniqueId Referencing INode Mapping.*/ getUniqueIdReferencingImpNodeMap()463 UniqueIdImpNodeMultiMap& getUniqueIdReferencingImpNodeMap(){ return mUniqueIdReferencingImpNodeMap; } 464 465 /** Returns the UniqueId object Mapping.*/ getUniqueIdObjectMap()466 UniqueIdObjectMap& getUniqueIdObjectMap(){ return mUniqueIdObjectMap; } 467 468 /** Returns the UniqueId INode Mapping.*/ getUniqueIdINodeMap()469 UniqueIdINodeMap& getUniqueIdINodeMap(){ return mUniqueIdINodeMap; } 470 471 /** Returns the object UniqueId Mapping.*/ getObjectINodeUniqueIdMap()472 ObjectINodeUniqueIdMap& getObjectINodeUniqueIdMap(){ return mObjectINodeUniqueIdMap; } 473 474 /** Returns the Unique id framework node map.*/ getUniqueIdFWNodeMap()475 UniqueIdFWNodeMap& getUniqueIdFWNodeMap() { return mUniqueIdFWNodeMap; } 476 477 /** Returns the list of library nodes.*/ getLibraryNodesList()478 LibraryNodesList& getLibraryNodesList(){ return mLibraryNodesList; } 479 480 /** Returns the map of unique id to visual scenes.*/ getUniqueIdVisualSceneMap()481 UniqueIdVisualSceneMap& getUniqueIdVisualSceneMap(){ return mUniqueIdVisualSceneMap; } 482 483 /** Returns the UniqueIdFWMaterialMap.*/ getUniqueIdFWMaterialMap()484 UniqueIdFWMaterialMap& getUniqueIdFWMaterialMap() { return mUniqueIdFWMaterialMap; } 485 486 /** Returns the UniqueIdFWEffectMap.*/ getUniqueIdFWEffectMap()487 UniqueIdFWEffectMap& getUniqueIdFWEffectMap() { return mUniqueIdFWEffectMap; } 488 489 /** Returns the UniqueIdFWImageMap.*/ getUniqueIdFWImageMap()490 UniqueIdFWImageMap& getUniqueIdFWImageMap() { return mUniqueIdFWImageMap; } 491 492 /** Returns the NodeMaterialBindingsList.*/ getNodeMaterialBindingsList()493 NodeMaterialBindingsList& getNodeMaterialBindingsList() { return mNodeMaterialBindingsList; } 494 495 /** Return the GeometryMaterialIdMapMap.*/ getGeometryMaterialIdMapMap()496 GeometryMaterialIdMapMap& getGeometryMaterialIdMapMap() { return mGeometryMaterialIdMapMap; } 497 498 /** Returns the GeometrySetMapChannelMap.*/ getGeometrySetMapChannelMap()499 GeometrySetMapChannelMap& getGeometrySetMapChannelMap() { return mGeometrySetMapChannelMap; } 500 getUniqueIdSkyLightMap()501 UniqueIdSkyLightMap& getUniqueIdSkyLightMap() { return mUniqueIdSkyLightMap; } getUniqueIdEffectMapsMap()502 UniqueIdEffectMapsMap& getUniqueIdEffectMapsMap() { return mEffectMaps; } 503 void addUniqueIdEffectBumpMapParametersPair( const COLLADAFW::UniqueId& effectUniqueId, const BumpMap& bumpParameters); 504 505 /**Returns the list of pairs of cloned nodes and their originals. This is used to assign materials. 506 When ever an inode is cloned, the cloned one and itself should be added to that list.*/ getClonedINodeOriginalINodePairList()507 INodeINodePairList& getClonedINodeOriginalINodePairList() { return mClonedINodeOriginalINodePairList; } 508 509 /** Returns the map, that maps an object to its name. Whenever an object is created, add it with 510 its name to this map.*/ getObjectObjectNameMap()511 ObjectObjectNameMap& getObjectObjectNameMap() { return mObjectObjectNameMap; } 512 513 /** Returns the list of unique ids of objects that use vertex color. When ever a geometry that uses vertex color is created, 514 its unique id should be added to this list.*/ getVertexColorObjects()515 UniqueIdList& getVertexColorObjects() { return mVertexColorObjects; } 516 517 /** Maps each already imported frame work animation to a list of created max float controllers.*/ getAnimationUniqueIdMaxControllerListMap()518 UniqueIdMaxControllerListMap& getAnimationUniqueIdMaxControllerListMap() { return mAnimationUniqueIdMaxControllerListMap; } 519 520 /** Holds all already imported animation list, sorted by their unique id.*/ getUniqueIdAnimationListMap()521 UniqueIdAnimationListMap& getUniqueIdAnimationListMap() { return mUniqueIdAnimationListMap; } 522 523 /** Maps unique ids of controller data to the corresponding controller.*/ getUniqueIdControllerMap()524 UniqueIdControllerMultiMap& getUniqueIdControllerMap() { return mUniqueIdControllerMap; } 525 526 /** Maps Unique ids of all morph controllers found during the first pass to the morph controller.*/ getUniqueIdMorphControllerMap()527 UniqueIdMorphControllerMap& getUniqueIdMorphControllerMap() { return mUniqueIdMorphControllersMap; } 528 529 /** Maps Unique ids of all skin controllers found during the first pass to the skin controller.*/ getUniqueIdSkinControllerMap()530 UniqueIdSkinControllerMap& getUniqueIdSkinControllerMap() { return mUniqueIdSkinControllersMap; } 531 532 /** List of light pairs. Used to assign animations to light parameters.*/ getLightList()533 LightList& getLightList() { return mLightList; } 534 535 /** Maps unique ids of skin controller to the INode that references the controller.*/ getSkinControllerINodeMap()536 UniqueIdINodeMap& getSkinControllerINodeMap() { return mSkinControllerINodeMap; } 537 538 /** Maps the unique ids of morph controllers that are NOT instantiated in the scene graph but 539 used as source by a skin controller to the INode that references this skin controller.*/ getMorphUniqueIdINodeMap()540 UniqueIdINodeMap& getMorphUniqueIdINodeMap() { return mMorphUniqueIdINodeMap; } 541 542 /** Functors used to convert values from frame work units into max units.*/ getUnitConversionFunctors()543 const UnitConversionFunctors& getUnitConversionFunctors() const { return mUnitConversionFunctors; } 544 545 /** Returns informations about the entire file being loaded.*/ getFileInfo()546 const FileInfo& getFileInfo() const { return mFileInfo; } 547 friend class ImporterBase; 548 549 }; 550 551 } // namespace COLLADAMAX 552 553 #endif // __COLLADAMAX_DOCUMENTIMPORTER_H__ 554