Light.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Softimage 3D Games & 3D Bridge team
00004 //
00005 // (c) Copyright 2001-2002 Avid Technology, Inc. . All rights reserved.
00006 //
00007 //***************************************************************************************
00008 
00009 /****************************************************************************************
00010 THIS CODE IS PUBLISHED AS A SAMPLE ONLY AND IS PROVIDED "AS IS".
00011 IN NO EVENT SHALL SOFTIMAGE, AVID TECHNOLOGY, INC. AND/OR THEIR RESPECTIVE
00012 SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
00013 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00014 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
00015 CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE .
00016 
00017 COPYRIGHT NOTICE. Copyright © 1999-2002 Avid Technology Inc. . All rights reserved. 
00018 
00019 SOFTIMAGE is a registered trademark of Avid Technology Inc. or its subsidiaries 
00020 or divisions. Windows NT is a registered trademark of Microsoft Corp. All other
00021 trademarks contained herein are the property of their respective owners. 
00022 ****************************************************************************************/
00023 
00024 
00025 #ifndef _LIGHT_H
00026 #define _LIGHT_H
00027 
00028 #include "Primitive.h"
00029 #include "ConstrainableType.h"
00030 #include "LightInfo.h"
00031 
00033 class XSIEXPORT CSLLight
00034     : public CSLPrimitive
00035     , public CSLConstrainableType
00036 {
00037 public:
00038 
00043     virtual SI_Error Synchronize();
00044 
00049     virtual CSLAnimatableType* ParameterFromName(SI_Char *in_szName);
00050 
00056     virtual CSLAnimatableType* ParameterFromType(EFCurveType in_Type, SI_Char *in_szParameterName);
00057 
00060     virtual ~CSLLight();
00061 
00065     CSIBCColorf GetColor();
00066 
00071     SI_Void SetColor(CSIBCColorf &in_rColor);
00072 
00076     CSIBCVector3D GetPosition();
00077 
00082     SI_Void SetPosition(CSIBCVector3D &in_rValue);
00083 
00088     CSLConstraint* AddConstraint(CSLConstraint::EConstraintType in_ConstraintType);
00089     
00091     // light info Functionality /////////////////////////////////////////////////
00093 
00097     CSLLightInfo* CreateLightInfo();
00098 
00102     SI_Error DestroyLightInfo();
00103 
00108     CSLLightInfo* ConnectLightInfo( CSLLightInfo* in_pToConnect );
00109 
00113     CSLLightInfo* LightInfo();
00114 
00115     CSLColorRGBProxy* GetColorProxy() { return &m_Color;};
00116     CSLVector3DProxy* GetPositionProxy() { return &m_Position;};
00117 
00118 protected:
00119     CSLLight(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00120 
00121     virtual SI_Bool ConstraintTypeIsValid(CSLConstraint::EConstraintType in_ConstraintType) = 0;
00122 
00123 private:
00124     CSLColorRGBProxy m_Color;
00125     CSLVector3DProxy m_Position;
00126     CSLLightInfo *m_pLightInfo;
00127 
00128     void *m_pReserved;  // reserved for future extension
00129 };
00130 
00131 #endif