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

- File List
- File Members

# FCDocument/FCDMaterial.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 */
    00014
    00020 #ifndef _FCD_MATERIAL_H_
    00021 #define _FCD_MATERIAL_H_
    00022
    00023 #ifndef _FCD_ENTITY_H_
    00024 #include "FCDocument/FCDEntity.h"
    00025 #endif // _FCD_ENTITY_H_
    00026
    00027 class FCDocument;
    00028 class FCDEffect;
    00029 class FCDEffectParameter;
    00030 class FCDEntityReference;
    00031
    00038 class FCOLLADA_EXPORT FCDMaterialTechniqueHint
    00039 {
    00040 public:
    00041     fstring platform;
    00042     fm::string technique;
    00043 };
    00044
    00046 typedef fm::vector<FCDMaterialTechniqueHint> FCDMaterialTechniqueHintList;
    00047
    00057 class FCOLLADA_EXPORT FCDMaterial : public FCDEntity
    00058 {
    00059 private:
    00060     DeclareObjectType(FCDEntity);
    00061     bool ownsEffect;
    00062     DeclareParameterPtr(FCDEntityReference, effect, FC("Effect"));
    00063     DeclareParameterContainer(FCDEffectParameter, parameters, FC("Effect Parameters"))
    00064     FCDMaterialTechniqueHintList techniqueHints;
    00065
    00066 public:
    00070     FCDMaterial(FCDocument* document);
    00071
    00073     virtual ~FCDMaterial();
    00074
    00078     virtual Type GetType() const { return FCDEntity::MATERIAL; }
    00079
    00083     FCDEffect* GetEffect() { return const_cast<FCDEffect*>(const_cast<const FCDMaterial*>(this)->GetEffect()); }
    00084     const FCDEffect* GetEffect() const;
    00090     FCDEntityReference* GetEffectReference() { return effect; }
    00091     const FCDEntityReference* GetEffectReference() const { return effect; }
    00092
    00095     void SetEffect(FCDEffect* _effect);
    00096
    00099     FCDMaterialTechniqueHintList& GetTechniqueHints() { return techniqueHints; }
    00100     const FCDMaterialTechniqueHintList& GetTechniqueHints() const { return techniqueHints; }
    00104     inline size_t GetEffectParameterCount() const { return parameters.size(); }
    00105
    00109     inline FCDEffectParameter* GetEffectParameter(size_t index) { FUAssert(index < parameters.size(), return NULL); return parameters.at(index); }
    00110     inline const FCDEffectParameter* GetEffectParameter(size_t index) const { FUAssert(index < parameters.size(), return NULL); return parameters.at(index); }
    00111
    00116     FCDEffectParameter* AddEffectParameter(uint32 type);
    00117
    00124     virtual FCDEntity* Clone(FCDEntity* clone = NULL, bool cloneChildren = false) const;
    00125
    00130     DEPRECATED(3.05A, not recommended) void Flatten() {}
    00131 };
    00132
    00133 #endif // _FCD_MATERIAL_H_