1 /* 2 Copyright (c) 2008-2009 NetAllied Systems GmbH 3 4 This file is part of COLLADASaxFrameworkLoader. 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 #include "COLLADASaxFWLStableHeaders.h" 12 #include "COLLADASaxFWLExtraDataLoader.h" 13 #include "COLLADASaxFWLExtraDataElementHandler.h" 14 #include "COLLADASaxFWLFileLoader.h" 15 #include "COLLADASaxFWLIExtraDataCallbackHandler.h" 16 17 18 namespace COLLADASaxFWL 19 { 20 21 //------------------------------ ExtraDataLoader()22 ExtraDataLoader::ExtraDataLoader() 23 { 24 } 25 26 //------------------------------ ~ExtraDataLoader()27 ExtraDataLoader::~ExtraDataLoader() 28 { 29 } 30 31 //------------------------------ base__begin__technique(const technique__AttributeData & attributeData,const COLLADAFW::UniqueId & uniqueId,COLLADAFW::Object * object)32 bool ExtraDataLoader::base__begin__technique ( 33 const technique__AttributeData& attributeData, 34 const COLLADAFW::UniqueId& uniqueId, 35 COLLADAFW::Object* object ) 36 { 37 // Get the extra data element handler. 38 ExtraDataElementHandler& extraDataElementHandler = getFileLoader ()->getExtraDataElementHandler (); 39 40 // Ask all handlers, if they want to have the data of the current extra tag. 41 // (profile name, element name ("optics"), id (cameraId)) 42 const ExtraDataCallbackHandlerList& extraDataCallbackHandlerList = extraDataElementHandler.getExtraDataCallbackHandlerList (); 43 size_t numHandlers = extraDataCallbackHandlerList.size (); 44 for ( size_t i=0; i<numHandlers; ++i ) 45 { 46 IExtraDataCallbackHandler* extraDataCallbackHandler = extraDataCallbackHandlerList[i]; 47 48 // Get the hash value of the current element. 49 size_t level = 1; 50 StringHash elementHash = getFileLoader ()->getElementHash ( level ); 51 52 // Get the profile name. 53 const ParserChar* profileName = attributeData.profile; 54 55 // Ask, if the current handler should parse the extra tags of the current element. 56 bool parseElement = extraDataCallbackHandler->parseElement ( profileName, elementHash, uniqueId, object ); 57 58 // Store the flag in the list. 59 extraDataElementHandler.setExtraDataCallbackHandlerCalling ( i, parseElement ); 60 } 61 return true; 62 } 63 64 } // namespace COLLADASaxFWL 65