1 /* 2 Copyright (c) 2008-2009 NetAllied Systems GmbH 3 4 This file is part of COLLADAMaya. 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 Copyright (c) 2004-2005 Alias Systems Corp. 10 11 Licensed under the MIT Open Source License, 12 for details please see LICENSE file or the website 13 http://www.opensource.org/licenses/mit-license.php 14 */ 15 16 #ifndef __COLLADA_MAYA_LIGHT_EXPORTER_H__ 17 #define __COLLADA_MAYA_LIGHT_EXPORTER_H__ 18 19 #include "COLLADAMayaPrerequisites.h" 20 #include "COLLADASWStreamWriter.h" 21 #include "COLLADASWLibraryLights.h" 22 23 24 namespace COLLADAMaya 25 { 26 27 /** This class writes the <library_lights>. */ 28 class LightExporter : public COLLADASW::LibraryLights 29 { 30 private: 31 32 /** Pointer to the document exporter */ 33 DocumentExporter* mDocumentExporter; 34 35 /** 36 * The list of the unique collada ids. 37 */ 38 COLLADABU::IDList mLightIdList; 39 40 /** 41 * A collada id for every maya id. 42 */ 43 StringToStringMap mMayaIdColladaIdMap; 44 45 public: 46 47 /** 48 * @param streamWriter The stream the output will be written to 49 * @param documentExporter The document exporter this material exporter is used in 50 */ 51 LightExporter ( COLLADASW::StreamWriter* streamWriter, DocumentExporter* documentExporter ); ~LightExporter()52 virtual ~LightExporter() {}; 53 54 /** Exports the lights in the scene graph. */ 55 void exportLights ( ); 56 57 /** Exports the current scene element and all it's children. */ 58 void exportLights ( SceneElement* sceneElement ); 59 60 /** 61 * A collada id for every maya id. 62 */ 63 const String findColladaLightId ( const String& mayaLightId ); 64 65 private: 66 67 /** Exports the geometry data of the current object, if it is a valid mesh object to export. */ 68 bool exportLight ( const MDagPath& dagPath ); 69 70 void exportExtraAttributes(const SceneElement* sceneElement, COLLADASW::Light* light); 71 72 }; 73 74 } 75 76 #endif //__COLLADA_MAYA_LIGHT_EXPORTER_H__ 77