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 #ifndef __COLLADASAXFWL_LIBRARYMATERIALSLOADER_H__
12 #define __COLLADASAXFWL_LIBRARYMATERIALSLOADER_H__
13 
14 #include "COLLADASaxFWLPrerequisites.h"
15 #include "COLLADASaxFWLFilePartLoader.h"
16 #include "COLLADASaxFWLXmlTypes.h"
17 
18 
19 namespace COLLADAFW
20 {
21 	class Material;
22 }
23 
24 
25 namespace COLLADASaxFWL
26 {
27 
28     /** TODO Documentation */
29 	class LibraryMaterialsLoader : public FilePartLoader
30 	{
31 	private:
32 		/** The material currently being parsed.*/
33 		COLLADAFW::Material* mCurrentMaterial;
34 
35         /** True, if the parser is in the instance_effect element. */
36         bool mInInstanceEffect;
37 
38 	public:
39 
40         /** Constructor. */
41 		LibraryMaterialsLoader( IFilePartLoader* callingFilePartLoader );
42 
43         /** Destructor. */
44 		virtual ~LibraryMaterialsLoader();
45 
46         /** Returns the unique id of the current parsed object. */
47         virtual const COLLADAFW::UniqueId& getUniqueId();
48 
49 
50 		/** Create new current material.*/
51 		virtual bool begin__material( const material__AttributeData& attributeData );
52 
53 		/** Sends current material to the writer an deletes it afterwards.*/
54 		virtual bool end__material();
55 
56 		/** Set the referenced effect in the current material.*/
57 		virtual bool begin__instance_effect( const instance_effect__AttributeData& attributeData );
58 
59 		/** We don't need to do anything here.*/
60 		virtual bool end__instance_effect();
61 
62 		/** Finishes the material loader.*/
63 		virtual bool end__library_materials();
64 
65 	private:
66 
67         /** Disable default copy ctor. */
68 		LibraryMaterialsLoader( const LibraryMaterialsLoader& pre );
69 
70         /** Disable default assignment operator. */
71 		const LibraryMaterialsLoader& operator= ( const LibraryMaterialsLoader& pre );
72 
73 	};
74 
75 } // namespace COLLADASAXFWL
76 
77 #endif // __COLLADASAXFWL_LIBRARYMATERIALSLOADER_H__
78