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

- File List
- File Members

# FCDocument/FCDEffectParameter.hpp

    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 //
    00010 // FCDEffectParameterT
    00011 //
    00012
    00013 template <class PrimitiveType>
    00014 FCDEffectParameterT<PrimitiveType>::~FCDEffectParameterT()
    00015 {
    00016 }
    00017
    00018 template <class PrimitiveType>
    00019 bool FCDEffectParameterT<PrimitiveType>::IsValueEqual(FCDEffectParameter* parameter)
    00020 {
    00021     if (!FCDEffectParameter::IsValueEqual(parameter)) return false;
    00022     FCDEffectParameterT<PrimitiveType>* param = (FCDEffectParameterT<PrimitiveType>*) parameter;
    00023     return IsEquivalent(value, param->GetValue());
    00024 }
    00025
    00026 template <class PrimitiveType>
    00027 FCDEffectParameter* FCDEffectParameterT<PrimitiveType>::Clone(FCDEffectParameter* _clone) const
    00028 {
    00029     FCDEffectParameterT<PrimitiveType>* clone = NULL;
    00030     if (_clone == NULL) _clone = clone = new FCDEffectParameterT<PrimitiveType>(const_cast<FCDocument*>(GetDocument()));
    00031     else if (_clone->HasType(FCDEffectParameterT<PrimitiveType>::GetClassType())) clone = (FCDEffectParameterT<PrimitiveType>*) _clone;
    00032
    00033     if (_clone != NULL) FCDEffectParameter::Clone(_clone);
    00034     if (clone != NULL) clone->value = *value;
    00035     return _clone;
    00036 }
    00037
    00038 template <class PrimitiveType>
    00039 void FCDEffectParameterT<PrimitiveType>::Overwrite(FCDEffectParameter* target)
    00040 {
    00041     if (target->GetType() == GetType())
    00042     {
    00043         FCDEffectParameterT<PrimitiveType>* s = (FCDEffectParameterT<PrimitiveType>*) target;
    00044         s->value = value;
    00045         SetDirtyFlag();
    00046     }
    00047 }
    00048
    00049 //
    00050 // FCDEffectParameterAnimatableT
    00051 //
    00052
    00053 template <class PrimitiveType, int Qualifiers>
    00054 FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>::~FCDEffectParameterAnimatableT()
    00055 {
    00056 }
    00057
    00058 template <class PrimitiveType, int Qualifiers>
    00059 bool FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>::IsValueEqual(FCDEffectParameter* parameter)
    00060 {
    00061     if (!FCDEffectParameter::IsValueEqual(parameter)) return false;
    00062     FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>* param = (FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>*) parameter;
    00063
    00064     if (floatType != param->GetFloatType()) return false;
    00065     return IsEquivalent(value, param->GetValue());
    00066 }
    00067
    00068 template <class PrimitiveType, int Qualifiers>
    00069 FCDEffectParameter* FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>::Clone(FCDEffectParameter* _clone) const
    00070 {
    00071     FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>* clone = NULL;
    00072     if (_clone == NULL) _clone = clone = new FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>(const_cast<FCDocument*>(GetDocument()));
    00073     else if (_clone->HasType(FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>::GetClassType())) clone = (FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>*) _clone;
    00074
    00075     if (_clone != NULL) FCDEffectParameter::Clone(_clone);
    00076     if (clone != NULL)
    00077     {
    00078         clone->floatType = floatType;
    00079         clone->value = *value;
    00080     }
    00081     return _clone;
    00082 }
    00083
    00084 template <class PrimitiveType, int Qualifiers>
    00085 void FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>::Overwrite(FCDEffectParameter* target)
    00086 {
    00087     if (target->GetType() == GetType())
    00088     {
    00089         FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>* s = (FCDEffectParameterAnimatableT<PrimitiveType, Qualifiers>*) target;
    00090         s->value = *value;
    00091         SetDirtyFlag();
    00092     }
    00093 }