kfbxsurfacematerial.h

Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_SURFACEMATERIAL_H_
00005 #define _FBXSDK_SURFACEMATERIAL_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 1999 - 2007 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material
00013  (collectively the "Data") in these files contain unpublished information
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by
00015  Canada and United States of America federal copyright law and by international
00016  treaties.
00017 
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE,
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE.
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE.
00028 
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE.
00039 
00040 **************************************************************************************/
00041 
00042 #include <kaydaradef.h>
00043 #ifndef KFBX_DLL 
00044     #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046 
00047 #include <kaydara.h>
00048 
00049 #include <kfbxplugins/kfbxtakenodecontainer.h>
00050 #include <kfbxplugins/kfbxcolor.h>
00051 #include <kfbxplugins/kfbxgroupname.h>
00052 #include <kfbxplugins/kfbxnodeattribute.h>
00053 
00054 #include <klib/kerror.h>
00055 
00056 #include <fbxfilesdk_nsbegin.h>
00057 
00058 class KFbxSurfaceMaterial_internal;
00059 
00066 class KFBX_DLL KFbxSurfaceMaterial : public KFbxTakeNodeContainer
00067 {
00068     KFBXOBJECT_DECLARE(KFbxSurfaceMaterial);
00069 
00070 public:
00075 
00076     static char const* sShadingModel;
00077     static char const* sMultiLayer;
00078     
00079     static char const* sEmissive;
00080     static char const* sEmissiveFactor;
00081     
00082     static char const* sAmbient;
00083     static char const* sAmbientFactor;
00084     
00085     static char const* sDiffuse;
00086     static char const* sDiffuseFactor;
00087     
00088     static char const* sSpecular;
00089     static char const* sSpecularFactor;
00090     static char const* sShininess;
00091     
00092     static char const* sBump;
00093     
00094     static char const* sTransparentColor;
00095     static char const* sTransparencyFactor;
00096     
00097     static char const* sReflection;
00098     static char const* sReflectionFactor;
00099     
00101 
00106 
00108     void Reset();
00109     
00110     KFbxProperty GetShadingModel() const;
00111     KFbxProperty GetMultiLayer() const;
00112     
00113     void AddChannels(KFbxTakeNode *pTakeNode);
00114     
00116 
00123 
00128     K_DEPRECATED bool SetShadingModel(KString const& pShadingModel);
00129 
00133     K_DEPRECATED bool GetShadingModel(KString& pShadingModel) const;
00134 
00138     K_DEPRECATED bool SetMultiLayer(bool pMultiLayer);
00139 
00143     K_DEPRECATED bool GetMultiLayer(bool& pMultiLayer) const;
00144 
00146 
00151 
00155     KError const& GetError() const;
00156 
00161     typedef enum 
00162     {
00163         eTAKE_NODE_ERROR,
00164         eERROR_COUNT
00165     } EError;   
00166 
00170     EError GetLastErrorID() const;
00171 
00175     char const* GetLastErrorString() const;
00176 
00178 
00180 //
00181 //  WARNING!
00182 //
00183 //  Anything beyond these lines may not be documented accurately and is 
00184 //  subject to change without notice.
00185 //
00187 
00188 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00189 
00190     virtual KObject*  GetFbxObject_internal();
00191     virtual KObject const*  GetFbxObject_internal() const;
00192     
00193     // Clone
00194     virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType) const;
00195 
00196 protected:
00197     bool SetColorParameter(KFbxProperty pProperty, KFbxColor const& pColor);
00198     bool GetColorParameter(KFbxProperty pProperty, KFbxColor& pColor) const;
00199     bool SetDoubleParameter(KFbxProperty pProperty, double pDouble);
00200     bool GetDoubleParameter(KFbxProperty pProperty, double pDouble) const;
00201     
00202     static char const* GetNamePrefix() { return MATERIAL_PREFIX; }
00203     
00204     KFbxSurfaceMaterial(KFbxSdkManager& pManager, char const* pName);
00205     virtual ~KFbxSurfaceMaterial();
00206 
00207     virtual void Destruct(bool pRecursive, bool pDependents);
00208 
00210     KFbxSurfaceMaterial& operator=(KFbxSurfaceMaterial const& pMaterial);
00211 
00212     // Comparison operator
00213     bool operator==(KFbxSurfaceMaterial const& pMaterial) const;
00214 
00215     // From KFbxObject
00216     KFbxObject::ENameSpace GetNameSpace() const; 
00217     virtual KString     GetTypeName() const;
00218     virtual KStringList GetTypeFlags() const;
00219 
00220     // Local
00221     void Init();
00222 
00223     KError  mError;
00224 
00225     // Internal Property Handler
00226     KFbxSurfaceMaterial_internal* mPH;
00227     
00228     KFbxPropertyString ShadingModel;
00229     KFbxPropertyBool1 MultiLayer;
00230 
00231     friend class KFbxLayerContainer;
00232     friend class KFbxReaderFbx;
00233     friend class KFbxReaderFbx6;
00234     friend class KFbxWriterFbx6;
00235 
00236 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS 
00237 
00238 };
00239 
00240 typedef KFbxSurfaceMaterial* HKFbxSurfaceMaterial;
00241 
00242 #include <fbxfilesdk_nsend.h>
00243 
00244 #endif
00245 
00246