00001 /* 00002 Copyright (C) 2005-2006 Feeling Software Inc. 00003 MIT License: http://www.opensource.org/licenses/mit-license.php 00004 */ 00005 /* 00006 Based on the FS Import classes: 00007 Copyright (C) 2005-2006 Feeling Software Inc 00008 Copyright (C) 2005-2006 Autodesk Media Entertainment 00009 MIT License: http://www.opensource.org/licenses/mit-license.php 00010 */ 00011 00017 #ifndef _FCD_EFFECT_H_ 00018 #define _FCD_EFFECT_H_ 00019 00020 #include "FUtils/FUDaeEnum.h" 00021 #include "FCDocument/FCDEntity.h" 00022 00023 class FCDocument; 00024 class FCDEffectStandard; 00025 class FCDEffectParameter; 00026 class FCDEffectProfile; 00027 class FCDEffectParameterList; 00028 00033 class FCDEffectProfile; 00034 class FCDEffectParameterList; 00035 class FCDImage; 00036 00038 typedef vector<FCDEffectProfile*> FCDEffectProfileList; 00039 typedef vector<FCDImage*> FCDEffectImageList; 00040 00055 class FCOLLADA_EXPORT FCDEffect : public FCDEntity 00056 { 00057 private: 00058 DeclareObjectType; 00059 FCDEffectProfileList profiles; 00060 FCDEffectParameterList* parameters; 00061 FCDEffectImageList images; 00062 00063 public: 00067 FCDEffect(FCDocument* document); 00068 00071 virtual ~FCDEffect(); 00072 00076 virtual Type GetType() const { return FCDEntity::EFFECT; } 00077 00080 size_t GetProfileCount() const { return profiles.size(); } 00081 00085 FCDEffectProfile* GetProfile(size_t index) { FUAssert(index < GetProfileCount(), return NULL); return profiles.at(index); } 00086 const FCDEffectProfile* GetProfile(size_t index) const { FUAssert(index < GetProfileCount(), return NULL); return profiles.at(index); } 00090 FCDEffectProfileList& GetProfiles() { return profiles; } 00091 const FCDEffectProfileList& GetProfiles() const { return profiles; } 00099 FCDEffectProfile* FindProfile(FUDaeProfileType::Type type); 00100 const FCDEffectProfile* FindProfile(FUDaeProfileType::Type type) const; 00108 FCDEffectProfile* FindProfileByTypeAndPlatform(FUDaeProfileType::Type type, string platform); 00109 const FCDEffectProfile* FindProfileByTypeAndPlatform(FUDaeProfileType::Type type, string platform) const; 00114 inline bool HasProfile(FUDaeProfileType::Type type) const { return FindProfile(type) != NULL; } 00115 00121 FCDEffectProfile* AddProfile(FUDaeProfileType::Type type); 00122 00125 void ReleaseProfile(FCDEffectProfile* profile); 00126 00131 FCDEffectParameterList* GetParameters() { return parameters; } 00132 const FCDEffectParameterList* GetParameters() const { return parameters; } 00137 void AddParameter(FCDEffectParameter* parameter); 00138 00145 FCDEffectParameter* FindParameterBySemantic(const string& semantic); 00146 00152 void FindParametersBySemantic(const string& semantic, FCDEffectParameterList& parameters); 00153 00160 void FindParametersByReference(const string& reference, FCDEffectParameterList& parameters); 00161 00165 FCDEffect* Clone(); 00166 00170 void Flatten(); 00171 00176 virtual FUStatus LoadFromXML(xmlNode* effectNode); 00177 00181 virtual xmlNode* WriteToXML(xmlNode* parentNode) const; 00182 00185 FCDEffectImageList& GetImages() { return images; } 00186 const FCDEffectImageList& GetImages() const { return images; } 00187 }; 00188 00189 #endif // _FCD_MATERIAL_H_