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

- File List
- File Members

# FCDocument/FCDEffectTools.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 /*
    00009     Based on the FS Import classes:
    00010     Copyright (C) 2005-2006 Feeling Software Inc
    00011     Copyright (C) 2005-2006 Autodesk Media Entertainment
    00012     MIT License: http://www.opensource.org/licenses/mit-license.php
    00013 */
    00019 #ifndef _FCD_EFFECT_TOOLS_H_
    00020 #define _FCD_EFFECT_TOOLS_H_
    00021
    00022 #ifndef _FCD_PARAMETER_ANIMATABLE_H_
    00023 #include "FCDocument/FCDParameterAnimatable.h"
    00024 #endif // _FCD_PARAMETER_ANIMATABLE_H_
    00025
    00029 class FCDMaterialInstance;
    00030 class FCDEffectStandard;
    00031 class FCDEffectTechnique;
    00032 class FCDGeometryInstance;
    00033
    00034 #ifndef LINUX
    00035 template <class T, int Q> class FCOLLADA_EXPORT FCDEffectParameterAnimatableT;
    00036 #else
    00037 template <class T, int Q> class FCDEffectParameterAnimatableT;
    00038 #endif // LINUX
    00039 typedef FCDEffectParameterAnimatableT<FMVector4, 1> FCDEffectParameterColor4;
    00040 typedef FCDEffectParameterAnimatableT<float, 0> FCDEffectParameterFloat;
    00042 typedef fm::pvector<FCDEffectParameter> FCDEffectParameterList;
    00044 namespace FCDEffectTools
    00045 {
    00049     FCOLLADA_EXPORT void SynchronizeAnimatedParams(FCDGeometryInstance* geometryInstance, FCDMaterialInstance* materialInstance);
    00050
    00058     FCOLLADA_EXPORT void LinkAnimatedParamCommonFloat(const fm::string& semantic, FCDEffectParameterFloat* param, FCDGeometryInstance* geometry, FCDMaterial* material, FCDEffect* effect, FCDEffectProfile* profile);
    00059
    00067     FCOLLADA_EXPORT void LinkAnimatedParamCommonVector(const fm::string& semantic, FCDEffectParameterColor4* param, FCDGeometryInstance* geometry, FCDMaterial* material, FCDEffect* effect, FCDEffectProfile* profile);
    00068
    00070     FCOLLADA_EXPORT FCDParameterAnimatableColor4* GetAnimatedColor(FCDGeometryInstance* geometryInstance, FCDMaterial* material, const fm::string& semantic, bool* isFloat3);
    00071
    00073     FCOLLADA_EXPORT FCDParameterAnimatableFloat* GetAnimatedFloat(FCDGeometryInstance* geometryInstance, FCDMaterial* material, const fm::string& semantic);
    00074
    00076     FCOLLADA_EXPORT FMVector4* GetDefaultColor(FCDMaterial* material, const fm::string& semantic, bool* isFloat3);
    00077
    00079     FCOLLADA_EXPORT float* GetDefaultFloat(FCDMaterial* material, const fm::string& semantic);
    00080
    00090     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDMaterialInstance* materialInstance, const char* semantic, bool localOnly = false);
    00091     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDMaterialInstance* materialInstance, const char* semantic, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDMaterialInstance*>(materialInstance), semantic, localOnly)); }
    00092     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDGeometryInstance* geometryInstance, const char* semantic);
    00093     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDGeometryInstance* geometryInstance, const char* semantic) { return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDGeometryInstance*>(geometryInstance), semantic)); }
    00094     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDMaterial* material, const char* semantic, bool localOnly = false);
    00095     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDMaterial* material, const char* semantic, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDMaterial*>(material), semantic, localOnly)); }
    00096     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDEffect* effect, const char* semantic, bool localOnly = false);
    00097     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDEffect* effect, const char* semantic, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDEffect*>(effect), semantic, localOnly)); }
    00098     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDEffectProfile* profile, const char* semantic, bool localOnly = false);
    00099     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDEffectProfile* profile, const char* semantic, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDEffectProfile*>(profile), semantic, localOnly)); }
    00100     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDEffectTechnique* technique, const char* semantic, bool localOnly = false);
    00101     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDEffectTechnique* technique, const char* semantic, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDEffectTechnique*>(technique), semantic, localOnly)); }
    00111     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDMaterialInstance* materialInstance, const char* reference, bool localOnly = false);
    00112     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDMaterialInstance* materialInstance, const char* reference, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDMaterialInstance*>(materialInstance), reference, localOnly)); }
    00113     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDGeometryInstance* geometryInstance, const char* reference);
    00114     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDGeometryInstance* geometryInstance, const char* reference) { return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDGeometryInstance*>(geometryInstance), reference)); }
    00115     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDMaterial* material, const char* reference, bool localOnly = false);
    00116     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDMaterial* material, const char* reference, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDMaterial*>(material), reference, localOnly)); }
    00117     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDEffect* effect, const char* reference, bool localOnly = false);
    00118     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDEffect* effect, const char* reference, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDEffect*>(effect), reference, localOnly)); }
    00119     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDEffectProfile* profile, const char* reference, bool localOnly = false);
    00120     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDEffectProfile* profile, const char* reference, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDEffectProfile*>(profile), reference, localOnly)); }
    00121     FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDEffectTechnique* technique, const char* reference, bool localOnly = false);
    00122     FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDEffectTechnique* technique, const char* reference, bool localOnly = false) { return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDEffectTechnique*>(technique), reference, localOnly)); }
    00131     FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDMaterialInstance* materialInstance, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false);
    00132     FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDMaterialInstance* materialInstance, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersBySemantic(const_cast<const FCDMaterialInstance*>(materialInstance), semantic, parameters, localOnly); }
    00133     FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDMaterial* material, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false);
    00134     FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDMaterial* material, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersBySemantic(const_cast<const FCDMaterial*>(material), semantic, parameters, localOnly); }
    00135     FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDEffect* effect, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false);
    00136     FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDEffect* effect, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersBySemantic(const_cast<const FCDEffect*>(effect), semantic, parameters, localOnly); }
    00137     FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDEffectProfile* profile, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false);
    00138     FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDEffectProfile* profile, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersBySemantic(const_cast<const FCDEffectProfile*>(profile), semantic, parameters, localOnly); }
    00139     FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDEffectTechnique* technique, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false);
    00140     FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDEffectTechnique* technique, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersBySemantic(const_cast<const FCDEffectTechnique*>(technique), semantic, parameters, localOnly); }
    00150     FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDMaterialInstance* materialInstance, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false);
    00151     FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDMaterialInstance* materialInstance, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersByReference(const_cast<const FCDMaterialInstance*>(materialInstance), reference, parameters, localOnly); }
    00152     FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDMaterial* material, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false);
    00153     FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDMaterial* material, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersByReference(const_cast<const FCDMaterial*>(material), reference, parameters, localOnly); }
    00154     FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDEffect* effect, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false);
    00155     FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDEffect* effect, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersByReference(const_cast<const FCDEffect*>(effect), reference, parameters, localOnly); }
    00156     FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDEffectProfile* profile, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false);
    00157     FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDEffectProfile* profile, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersByReference(const_cast<const FCDEffectProfile*>(profile), reference, parameters, localOnly); }
    00158     FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDEffectTechnique* technique, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false);
    00159     FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDEffectTechnique* technique, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false) { FindEffectParametersByReference(const_cast<const FCDEffectTechnique*>(technique), reference, parameters, localOnly); }
    00160 };
    00161
    00162 #endif //_FCD_EFFECT_TOOLS_H_