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

- File List
- File Members

# FCDocument/FCDEffectParameterSampler.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_PARAMETER_SAMPLER_H_
    00015 #define _FCD_EFFECT_PARAMETER_SAMPLER_H_
    00016
    00017 #ifndef _FCD_EFFECT_PARAMETER_H_
    00018 #include "FCDocument/FCDEffectParameter.h"
    00019 #endif // _FCD_EFFECT_PARAMETER_H_
    00020
    00021 #ifndef _FU_DAE_ENUM_H_
    00022 #include "FUtils/FUDaeEnum.h"
    00023 #endif // _FU_DAE_ENUM_H_
    00024
    00025 class FCDocument;
    00026 class FCDEffectPass;
    00027 class FCDEffectParameterSurface;
    00028
    00037 class FCOLLADA_EXPORT FCDEffectParameterSampler : public FCDEffectParameter
    00038 {
    00039 public:
    00041     enum SamplerType
    00042     {
    00043         SAMPLER1D,
    00044         SAMPLER2D,
    00045         SAMPLER3D,
    00046         SAMPLERCUBE
    00047     };
    00048
    00049 private:
    00050     DeclareObjectType(FCDEffectParameter);
    00051
    00052     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, samplerType, FC("Sampler Type")); // SamplerType
    00053     DeclareParameterPtr(FCDEffectParameterSurface, surface, FC("Surface"));
    00054     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, wrap_s, FC("Wrap Mode S")); // FUDaeTextureWrapMode::WrapMode
    00055     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, wrap_t, FC("Wrap Mode T"));
    00056     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, wrap_p, FC("Wrap Mode P"));
    00057     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, minFilter, FC("Min Filter")); // FUDaeTextureFilterFunction::FilterFunction
    00058     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, magFilter, FC("Mag Filter"));
    00059     DeclareParameter(uint32, FUParameterQualifiers::SIMPLE, mipFilter, FC("Mip Filter"));
    00060
    00061 public:
    00065     FCDEffectParameterSampler(FCDocument* document);
    00066
    00068     virtual ~FCDEffectParameterSampler();
    00069
    00072     virtual Type GetType() const { return SAMPLER; }
    00073
    00077     FCDEffectParameterSurface* GetSurface() { return surface; }
    00078     const FCDEffectParameterSurface* GetSurface() const { return surface; }
    00083     void SetSurface(FCDEffectParameterSurface* surface);
    00084
    00087     SamplerType GetSamplerType() const { return (SamplerType) *samplerType; }
    00088
    00091     void SetSamplerType(SamplerType type) { samplerType = type; SetDirtyFlag(); }
    00092
    00095     FUDaeTextureWrapMode::WrapMode GetWrapS() const { return (FUDaeTextureWrapMode::WrapMode) *wrap_s; }
    00096     FUDaeTextureWrapMode::WrapMode GetWrapT() const { return (FUDaeTextureWrapMode::WrapMode) *wrap_t; }
    00097     FUDaeTextureWrapMode::WrapMode GetWrapP() const { return (FUDaeTextureWrapMode::WrapMode) *wrap_p; }
    00101     void SetWrapS(FUDaeTextureWrapMode::WrapMode mode) { wrap_s = mode; SetDirtyFlag(); }
    00102     void SetWrapT(FUDaeTextureWrapMode::WrapMode mode) { wrap_t = mode; SetDirtyFlag(); }
    00103     void SetWrapP(FUDaeTextureWrapMode::WrapMode mode) { wrap_p = mode; SetDirtyFlag(); }
    00108     FUDaeTextureFilterFunction::FilterFunction GetMinFilter() const { return (FUDaeTextureFilterFunction::FilterFunction) *minFilter; }
    00109     FUDaeTextureFilterFunction::FilterFunction GetMagFilter() const { return (FUDaeTextureFilterFunction::FilterFunction) *magFilter; }
    00110     FUDaeTextureFilterFunction::FilterFunction GetMipFilter() const { return (FUDaeTextureFilterFunction::FilterFunction) *mipFilter; }
    00115     void SetMinFilter(FUDaeTextureFilterFunction::FilterFunction func) { minFilter = func; SetDirtyFlag(); }
    00116     void SetMagFilter(FUDaeTextureFilterFunction::FilterFunction func) { magFilter = func; SetDirtyFlag(); }
    00117     void SetMipFilter(FUDaeTextureFilterFunction::FilterFunction func) { mipFilter = func; SetDirtyFlag(); }
    00122     virtual bool IsValueEqual(FCDEffectParameter *parameter);
    00123
    00129     virtual FCDEffectParameter* Clone(FCDEffectParameter* clone = NULL) const;
    00130
    00134     virtual void Overwrite(FCDEffectParameter* target);
    00135 };
    00136
    00137 #endif // _FCD_EFFECT_PARAMETER_SAMPLER_H_