kfbxlight.h

Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_LIGHT_H_
00005 #define _FBXSDK_LIGHT_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 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/kfbxnodeattribute.h>
00050 #include <fbxfilesdk_nsbegin.h>
00051 
00052 class KFbxColor;
00053 class KFbxSdkManager;
00054 class KFbxTexture;
00055 class KFbxLight_internal;
00056 
00060 class KFBX_DLL KFbxLight : public KFbxNodeAttribute
00061 {
00062     KFBXOBJECT_DECLARE(KFbxLight);
00063 
00064 public:
00065 
00067     virtual EAttributeType GetAttributeType() const;
00068 
00073     static const char* sDecayType;
00074     static const char* sDecayStart;
00075     static const char* sEnableNearAttenuation;
00076     static const char* sNearAttenuationStart;
00077     static const char* sNearAttenuationEnd;
00078     static const char* sEnableFarAttenuation;
00079     static const char* sFarAttenuationStart;
00080     static const char* sFarAttenuationEnd;
00081     static const char* sCastShadows;
00082     static const char* sShadowColor;
00083 
00085 
00090 
00096     typedef enum  
00097     {
00098         ePOINT, 
00099         eDIRECTIONAL, 
00100         eSPOT
00101     } ELightType;
00102 
00110     typedef enum  
00111     {
00112         eNONE = 0,
00113         eLINEAR,
00114         eQUADRATIC,
00115         eCUBIC
00116     } EDecayType;
00117 
00121     void SetLightType(ELightType pLightType);
00122 
00126     ELightType GetLightType() const;
00127 
00131     void SetCastLight(bool pCastLight);
00132 
00136     bool GetCastLight() const;
00137 
00141     void SetCastShadows(bool pCastShadows);
00142 
00146     bool GetCastShadows() const;
00147 
00151     void SetShadowColor( KFbxColor& pColor );
00152 
00156     KFbxColor GetShadowColor() const;
00157 
00161     void SetShadowTexture( KFbxTexture* pTexture );
00162 
00166     KFbxTexture* GetShadowTexture() const;
00167 
00169 
00174 
00181     bool SetFileName(char* pFileName);
00182     
00183 #ifdef KARCH_DEV_MACOSX_CFM
00184     bool SetFile(const FSSpec &pMacFileSpec);
00185     bool SetFile(const FSRef &pMacFileRef);
00186     bool SetFile(const CFURLRef &pMacURL);
00187 #endif
00188 
00192     char const* GetFileName() const;
00193 
00194 #ifdef KARCH_DEV_MACOSX_CFM
00195     bool GetFile(FSSpec &pMacFileSpec) const;
00196     bool GetFile(FSRef &pMacFileRef) const;
00197     bool GetFile(CFURLRef &pMacURL) const;
00198 #endif
00199 
00200 
00204     void SetDecayType( EDecayType pDecayType );
00205 
00209     EDecayType GetDecayType() const;
00210 
00214     void SetDecayStart( double pDist );
00215 
00219     double GetDecayStart() const;
00220 
00224     void SetGroundProjection (bool pEnable);
00225 
00229     bool GetGroundProjection() const;
00230 
00234     void SetVolumetricProjection(bool pEnable);
00235 
00239     bool GetVolumetricProjection() const;
00240 
00245     void SetFrontVolumetricProjection(bool pEnable);
00246 
00251     bool GetFrontVolumetricProjection() const;
00252 
00254 
00262 
00267     void SetDefaultColor(KFbxColor& pColor);
00268 
00274     KFbxColor& GetDefaultColor(KFbxColor& pColor) const;
00275 
00280     void SetDefaultIntensity(double pIntensity);
00281 
00286     double GetDefaultIntensity() const;
00287 
00293     void SetDefaultConeAngle(double pConeAngle);
00294 
00300     double GetDefaultConeAngle() const;
00301 
00307     void SetDefaultFog(double pFog);
00308 
00314     double GetDefaultFog() const;
00315 
00317 
00318 
00320 //
00321 //  WARNING!
00322 //
00323 //  Anything beyond these lines may not be documented accurately and is 
00324 //  subject to change without notice.
00325 //
00327 
00328 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00329 
00330 public:
00331 
00332     virtual KObject*  GetFbxObject_internal();
00333     virtual KObject const*  GetFbxObject_internal() const;
00334 
00335     // Clone
00336     virtual KFbxObject* Clone(KFbxObject::ECloneType pCloneType) const;
00337 
00338 protected:
00339     static char const* GetNamePrefix() { return 0; }
00340 
00341     KFbxLight(KFbxSdkManager& pManager, char const* pName);
00342     virtual ~KFbxLight();
00343 
00345     KFbxLight& operator= (KFbxLight const& pLight);
00346 
00347     virtual void Destruct(bool pRecursive, bool pDependents);
00348 
00352     virtual void AddChannels(KFbxTakeNode *pTakeNode);
00353 
00357     virtual void RemoveChannels(KFbxTakeNode *pTakeNode);
00358 
00362     virtual void Init();
00363 
00364     virtual bool FbxPlugNotify(KFbxPlugEvent const &pEvent);
00365 
00369     KFbxLight_internal* mPH;
00370 
00371     virtual KString     GetTypeName() const;
00372     virtual KStringList GetTypeFlags() const;
00373 
00374     KString mFileName;  
00375 
00376 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00377 
00378 };
00379 
00380 typedef KFbxLight* HKFbxLight;
00381 
00382 #include <fbxfilesdk_nsend.h>
00383 
00384 #endif // #ifndef _FBXSDK_LIGHT_H_
00385 
00386 
00387