- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDEffectTechnique.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008
    00014 #ifndef _FCD_EFFECT_TECHNIQUE_H_
    00015 #define _FCD_EFFECT_TECHNIQUE_H_
    00016
    00017 #ifndef __FCD_OBJECT_H_
    00018 #include "FCDocument/FCDObject.h"
    00019 #endif // __FCD_OBJECT_H_
    00020 #ifndef _FU_PARAMETER_H_
    00021 #include "FUtils/FUParameter.h"
    00022 #endif // _FU_PARAMETER_H_
    00023
    00024 class FCDEffectCode;
    00025 class FCDEffectPass;
    00026 class FCDEffectParameter;
    00027 class FCDEffectProfileFX;
    00028
    00029 typedef fm::pvector<FCDEffectPass> FCDEffectPassList;
    00030 typedef fm::pvector<FCDEffectCode> FCDEffectCodeList;
    00046 class FCOLLADA_EXPORT FCDEffectTechnique : public FCDObject
    00047 {
    00048 private:
    00049     DeclareObjectType(FCDObject);
    00050     FCDEffectProfileFX* parent;
    00051
    00052     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, name, FC("Name"));
    00053     DeclareParameterContainer(FCDEffectCode, codes, FC("Code Inclusions"));
    00054     DeclareParameterContainer(FCDEffectPass, passes, FC("Passes"))
    00055     DeclareParameterContainer(FCDEffectParameter, parameters, FC("Effect Parameters"));
    00056
    00057 public:
    00062     FCDEffectTechnique(FCDocument* document, FCDEffectProfileFX* parent);
    00063
    00065     virtual ~FCDEffectTechnique();
    00066
    00069     inline FCDEffectProfileFX* GetParent() { return parent; }
    00070     inline const FCDEffectProfileFX* GetParent() const { return parent; }
    00075     DEPRECATED(3.05A, GetParent()->GetParent()->GetDaeId) const fm::string& GetDaeId() const { return emptyString; }
    00076
    00079     const fstring& GetName() const { return name; }
    00080
    00085     void SetName(const fstring& _name) { name = _name; SetDirtyFlag(); }
    00086
    00089     DEPRECATED(3.05A, GetPassCount and GetPass(index)) void GetPassList() {}
    00090
    00093     size_t GetPassCount() const { return passes.size(); }
    00094
    00098     FCDEffectPass* GetPass(size_t index) { FUAssert(index < GetPassCount(), return NULL); return passes.at(index); }
    00099     const FCDEffectPass* GetPass(size_t index) const { FUAssert(index < GetPassCount(), return NULL); return passes.at(index); }
    00103     FCDEffectPass* AddPass();
    00104
    00107     DEPRECATED(3.05A, GetCodeCount and GetCode(index) or FindCode) void GetCodeList() {}
    00108
    00111     size_t GetCodeCount() const { return codes.size(); }
    00112
    00116     FCDEffectCode* GetCode(size_t index) { FUAssert(index < GetCodeCount(), return NULL); return codes.at(index); }
    00117     const FCDEffectCode* GetCode(size_t index) const { FUAssert(index < GetCodeCount(), return NULL); return codes.at(index); }
    00123     inline FCDEffectCode* FindCode(const char* sid) { return const_cast<FCDEffectCode*>(const_cast<const FCDEffectTechnique*>(this)->FindCode(sid)); }
    00124     const FCDEffectCode* FindCode(const char* sid) const;
    00128     FCDEffectCode* AddCode();
    00129
    00132     inline size_t GetEffectParameterCount() const { return parameters.size(); }
    00133
    00137     inline FCDEffectParameter* GetEffectParameter(size_t index) { FUAssert(index < parameters.size(), return NULL); return parameters.at(index); }
    00138     inline const FCDEffectParameter* GetEffectParameter(size_t index) const { FUAssert(index < parameters.size(), return NULL); return parameters.at(index); }
    00139
    00144     FCDEffectParameter* AddEffectParameter(uint32 type);
    00145
    00151     FCDEffectTechnique* Clone(FCDEffectTechnique* clone = NULL) const;
    00152
    00155     DEPRECATED(3.05A, not recommended) void Flatten() {}
    00156 };
    00157
    00158 #endif