FBX SDK Reference Guide: kfbxlight.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_LIGHT_H_
00005 #define _FBXSDK_LIGHT_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright ?2001 - 2008 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 
00059 class KFBX_DLL KFbxLight : public KFbxNodeAttribute
00060 {
00061     KFBXOBJECT_DECLARE(KFbxLight,KFbxNodeAttribute);
00062 
00063 public:
00064 
00066     virtual EAttributeType GetAttributeType() const;
00067 
00072 
00078     typedef enum  
00079     {
00080         ePOINT = 0, 
00081         eDIRECTIONAL, 
00082         eSPOT
00083     } ELightType;
00084 
00092     typedef enum  
00093     {
00094         eNONE = 0,
00095         eLINEAR,
00096         eQUADRATIC,
00097         eCUBIC
00098     } EDecayType;
00099 
00106     K_DEPRECATED void SetLightType(ELightType pLightType);
00107 
00114     K_DEPRECATED ELightType GetLightType() const;
00115 
00122     K_DEPRECATED void SetCastLight(bool pCastLight);
00123 
00130     K_DEPRECATED bool GetCastLight() const;
00131 
00141     K_DEPRECATED void SetCastShadows(bool pCastShadows);
00142 
00152     K_DEPRECATED bool GetCastShadows() const;
00153 
00163     K_DEPRECATED void SetShadowColor( KFbxColor& pColor );
00164 
00174     K_DEPRECATED KFbxColor GetShadowColor() const;
00175 
00179     void SetShadowTexture( KFbxTexture* pTexture );
00180 
00184     KFbxTexture* GetShadowTexture() const;
00185 
00187 
00192 
00202     K_DEPRECATED bool SetFileName(char const* pFileName);
00203     
00204 #ifdef KARCH_DEV_MACOSX_CFM
00205     K_DEPRECATED bool SetFile(const FSSpec &pMacFileSpec);
00206     K_DEPRECATED bool SetFile(const FSRef &pMacFileRef);
00207     K_DEPRECATED bool SetFile(const CFURLRef &pMacURL);
00208 #endif
00209 
00216     K_DEPRECATED char const* GetFileName() const;
00217 
00218 #ifdef KARCH_DEV_MACOSX_CFM
00219     bool GetFile(FSSpec &pMacFileSpec) const;
00220     bool GetFile(FSRef &pMacFileRef) const;
00221     bool GetFile(CFURLRef &pMacURL) const;
00222 #endif
00223 
00224 
00231     K_DEPRECATED void SetDecayType( EDecayType pDecayType );
00232 
00239     K_DEPRECATED EDecayType GetDecayType() const;
00240 
00247     K_DEPRECATED void SetDecayStart( double pDist );
00248 
00255     K_DEPRECATED double GetDecayStart() const;
00256 
00263     K_DEPRECATED void SetGroundProjection (bool pEnable);
00264 
00271     K_DEPRECATED bool GetGroundProjection() const;
00272 
00279     K_DEPRECATED void SetVolumetricProjection(bool pEnable);
00280 
00287     K_DEPRECATED bool GetVolumetricProjection() const;
00288 
00296     K_DEPRECATED void SetFrontVolumetricProjection(bool pEnable);
00297 
00305     K_DEPRECATED bool GetFrontVolumetricProjection() const;
00306 
00308 
00316 
00324     K_DEPRECATED void SetDefaultColor(KFbxColor& pColor);
00325 
00334     K_DEPRECATED KFbxColor& GetDefaultColor(KFbxColor& pColor) const;
00335 
00343     K_DEPRECATED void SetDefaultIntensity(double pIntensity);
00344 
00352     K_DEPRECATED double GetDefaultIntensity() const;
00353 
00362     K_DEPRECATED void SetDefaultConeAngle(double pConeAngle);
00363 
00372     K_DEPRECATED double GetDefaultConeAngle() const;
00373 
00382     K_DEPRECATED void SetDefaultFog(double pFog);
00383 
00392     K_DEPRECATED double GetDefaultFog() const;
00393 
00395 
00400     static const char*          sLightType;
00401     static const char*          sCastLight;
00402     static const char*          sDrawVolumetricLight;
00403     static const char*          sDrawGroundProjection;
00404     static const char*          sDrawFrontFacingVolumetricLight;
00405     static const char*          sColor;
00406     static const char*          sIntensity;
00407     static const char*          sHotSpot; // inner cone
00408     static const char*          sConeAngle; // outer cone
00409     static const char*          sFog;
00410     static const char*          sDecayType;
00411     static const char*          sDecayStart;
00412     static const char*          sFileName;
00413     static const char*          sEnableNearAttenuation;
00414     static const char*          sNearAttenuationStart;
00415     static const char*          sNearAttenuationEnd;
00416     static const char*          sEnableFarAttenuation;
00417     static const char*          sFarAttenuationStart;
00418     static const char*          sFarAttenuationEnd;
00419     static const char*          sCastShadows;
00420     static const char*          sShadowColor;
00422 
00427     static const ELightType     sDefaultLightType;
00428     static const fbxBool1       sDefaultCastLight;
00429     static const fbxBool1       sDefaultDrawVolumetricLight;
00430     static const fbxBool1       sDefaultDrawGroundProjection;
00431     static const fbxBool1       sDefaultDrawFrontFacingVolumetricLight;
00432     static const fbxDouble3     sDefaultColor;
00433     static const fbxDouble1     sDefaultIntensity;
00434     static const fbxDouble1     sDefaultHotSpot;
00435     static const fbxDouble1     sDefaultConeAngle;
00436     static const fbxDouble1     sDefaultFog;
00437     static const EDecayType     sDefaultDecayType;
00438     static const fbxDouble1     sDefaultDecayStart;
00439     static const fbxString      sDefaultFileName;
00440     static const fbxBool1       sDefaultEnableNearAttenuation;
00441     static const fbxDouble1     sDefaultNearAttenuationStart;
00442     static const fbxDouble1     sDefaultNearAttenuationEnd;
00443     static const fbxBool1       sDefaultEnableFarAttenuation;
00444     static const fbxDouble1     sDefaultFarAttenuationStart;
00445     static const fbxDouble1     sDefaultFarAttenuationEnd;
00446     static const fbxBool1       sDefaultCastShadows;
00447     static const fbxDouble3     sDefaultShadowColor;
00449 
00451     //
00452     // Properties
00453     //
00455 
00460     
00468     KFbxTypedProperty<ELightType>       LightType;
00469 
00477     KFbxTypedProperty<fbxBool1>         CastLight;
00478 
00486     KFbxTypedProperty<fbxBool1>         DrawVolumetricLight;
00487 
00495     KFbxTypedProperty<fbxBool1>         DrawGroundProjection;
00496 
00504     KFbxTypedProperty<fbxBool1>         DrawFrontFacingVolumetricLight;
00505 
00513     KFbxTypedProperty<fbxDouble3>       Color;
00514 
00522     KFbxTypedProperty<fbxDouble1>       Intensity;
00523 
00531     KFbxTypedProperty<fbxDouble1>       HotSpot;
00532 
00540     KFbxTypedProperty<fbxDouble1>       ConeAngle;
00541 
00549     KFbxTypedProperty<fbxDouble1>       Fog;
00550 
00558     KFbxTypedProperty<EDecayType>       DecayType;
00559 
00567     KFbxTypedProperty<fbxDouble1>       DecayStart;
00568 
00576     KFbxTypedProperty<fbxString>        FileName;
00577 
00585     KFbxTypedProperty<fbxBool1>         EnableNearAttenuation;
00586 
00594     KFbxTypedProperty<fbxDouble1>       NearAttenuationStart;
00595 
00603     KFbxTypedProperty<fbxDouble1>       NearAttenuationEnd;
00604 
00612     KFbxTypedProperty<fbxBool1>         EnableFarAttenuation;
00613 
00621     KFbxTypedProperty<fbxDouble1>       FarAttenuationStart;
00622 
00630     KFbxTypedProperty<fbxDouble1>       FarAttenuationEnd;
00631 
00639     KFbxTypedProperty<fbxBool1>         CastShadows;
00640 
00648     KFbxTypedProperty<fbxDouble3>       ShadowColor;
00649     
00651 
00653 //
00654 //  WARNING!
00655 //
00656 //  Anything beyond these lines may not be documented accurately and is 
00657 //  subject to change without notice.
00658 //
00660 
00661 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00662 
00663 public:
00664 
00665     // Clone
00666     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00667 
00668 protected:
00669 
00670     KFbxLight(KFbxSdkManager& pManager, char const* pName);
00671     virtual ~KFbxLight();
00672 
00674     KFbxLight& operator= (KFbxLight const& pLight);
00675 
00676     virtual bool ConstructProperties(bool pForceSet);
00677     virtual void Destruct(bool pRecursive, bool pDependents);
00678 
00682     virtual void Init();
00683 
00684     virtual KString     GetTypeName() const;
00685     virtual KStringList GetTypeFlags() const;
00686 
00687 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00688 
00689 };
00690 
00691 typedef KFbxLight* HKFbxLight;
00692 
00693 inline EFbxType FbxTypeOf( KFbxLight::ELightType const &pItem )         { return eENUM; }
00694 inline EFbxType FbxTypeOf( KFbxLight::EDecayType const &pItem )         { return eENUM; }
00695 
00696 #include <fbxfilesdk_nsend.h>
00697 
00698 #endif // #ifndef _FBXSDK_LIGHT_H_
00699 
00700 
00701