/*========================================================================= * * SECTenv.hpp : Definition of Environments * * * Version 1.0 * Creation date * Revision date * * Shaitan *=======================================================================*/ /* #ifndef __SECT_ENV_HPP__ #define __SECT_ENV_HPP__ #include "incGLI.h" #include "incSPO.h" #include "incMEC.h" #define ENV_FRIEND #include "incENV.h" #undef ENV_FRIEND #define SCTFriend #include "incSCT.h" #undef SCTFriend #include "incITF.h" #include "incGAM.h" #include "HDL.h" #include "SECTelem.hpp" #include "x:\cpa\Main\inc\_editid.h" //************************************** #ifndef CPA_EXPORT #if defined(CPA_WANTS_IMPORT) #define CPA_EXPORT __declspec(dllimport) #elif defined(CPA_WANTS_EXPORT) #define CPA_EXPORT __declspec(dllexport) #else #define CPA_EXPORT #endif #endif //************************************** class Sector_Object; class Sector_Interface; typedef enum { E_te_Environment, E_te_Surface, E_te_MecEnvironment, E_te_VisEnvironment, E_te_SndEnvironment, E_te_NoType } tdeTypeElem; typedef CPA_SaveObject SECT_SndEnvironment; //################################################################################# // MecEnvironment //################################################################################# class SECT_MecEnvironment : public CPA_SaveObject, public CPA_EdMot { protected: DNM_stMecEnvironment * GetMecStruct (void); public: SECT_MecEnvironment (Sector_Interface *p_oDLL, DNM_tdxHandleToMecEnvironment hMecEnv, BOOL bAvailable, CString csName, CString csFileName, BOOL bSectionExists); SECT_MecEnvironment (Sector_Interface *p_oDLL, CString csName); ~SECT_MecEnvironment (void); // return Data long GetDataType (void) { return -1; } void * GetData (void) { return GetStruct(); }; void * GetEngineStruct (void) { return GetStruct(); } Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); } // default values void fn_vSetDefaultValues (void); // gravity parameters DNM_tdxReal GetGravity (void); DNM_tdstVector * GetVertical (void); void SetGravity (MTH_tdxReal tdxNewGravity, BOOL bNotify = TRUE); void SetVertical (DNM_tdstVector *tdstNewVertical, BOOL bNotify = TRUE); // fluid DNM_tdxReal GetFluidDensity (void); DNM_tdxReal GetFluidViscosity (void); DNM_tdxReal GetFluidLevel (void); DNM_tdstVector * GetFluidStream (void); void SetFluidDensity (MTH_tdxReal tdxNewFluidDensity, BOOL bNotify = TRUE); void SetFluidViscosity (MTH_tdxReal tdxNewFluidViscosity, BOOL bNotify = TRUE); void SetFluidLevel (MTH_tdxReal tdxNewFluidLevel, BOOL bNotify = TRUE); void SetFluidStream (DNM_tdstVector *tdstNewFluidStream, BOOL bNotify = TRUE); // volumic environment CString GetVolumicEnvironment (void); void SetVolumicEnvironment (CString, BOOL bNotify = TRUE); // save static void CallBackSaveMecEnvironment (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction); }; //################################################################################# // VisEnvironment //################################################################################# class SECT_VisEnvironment : public CPA_SaveObject, public CPA_EdMot { public: SECT_VisEnvironment (Sector_Interface *p_oDLL, ACP_tdxHandleToVisualEnvironment hVisEnv, BOOL bAvailable, CString csName, CString csFileName, BOOL bSectionExists); SECT_VisEnvironment (Sector_Interface *p_oDLL, CString csName); ~SECT_VisEnvironment (void); // return Data long GetDataType (void) { return -1; } void * GetData (void) { return GetStruct(); }; void * GetEngineStruct (void) { return GetStruct(); } Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); } // default values void fn_vInitFog (void); // global parameters BOOL fn_bHasFog (void); // Fog MTH_tdxReal GetFogNear (void); MTH_tdxReal GetFogFar (void); MTH_tdxReal GetFogBlendNear (void); MTH_tdxReal GetFogBlendFar (void); MTH_tdxReal GetFogInfinite (void); GLI_tdstColor * GetFogColor (void); void SetFogNear (MTH_tdxReal xNewNear, BOOL bNotify = TRUE); void SetFogFar (MTH_tdxReal xNewFar, BOOL bNotify = TRUE); void SetFogBlendNear (MTH_tdxReal xNewBlendNear, BOOL bNotify = TRUE); void SetFogBlendFar (MTH_tdxReal xNewBlendFar, BOOL bNotify = TRUE); void SetFogInfinite (MTH_tdxReal xNewInfinite, BOOL bNotify = TRUE); void SetFogColor (GLI_tdstColor *pNewColor, BOOL bNotify = TRUE); // save static void CallBackSaveVisEnvironment (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction); }; //################################################################################# // Environment //################################################################################# class SECT_Environment : public CPA_SaveObject, public CPA_EdMot { protected: SECT_MecEnvironment *m_pMecEnvironment; SECT_VisEnvironment *m_pVisEnvironment; SECT_SndEnvironment *m_pSndEnvironment; public: SECT_Environment (Sector_Interface *p_oDLL, ENV_tdxHandleToEnvironment hEnvironment, BOOL bAvailable, CString csName, CString csFileName); SECT_Environment (Sector_Interface *p_oDLL, SECT_MecEnvironment *pMecEnvironment, SECT_VisEnvironment *pVisEnvironment, SECT_SndEnvironment *pSndEnvironment, CString csName); ~SECT_Environment (void); // return Data long GetDataType (void) { return -1; } void * GetData (void) { return GetStruct(); }; void * GetEngineStruct (void) { return GetStruct(); } Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); } // get functions SECT_MecEnvironment * GetMecEnvironment (void) { return m_pMecEnvironment; } SECT_VisEnvironment * GetVisEnvironment (void) { return m_pVisEnvironment; } SECT_SndEnvironment * GetSndEnvironment (void) { return m_pSndEnvironment; } // set functions void SetMecEnvironment (SECT_MecEnvironment * pMecEnv, BOOL bNotifySave = TRUE); void SetVisEnvironment (SECT_VisEnvironment * pVisEnv, BOOL bNotifySave = TRUE); void SetSndEnvironment (SECT_SndEnvironment * pSndEnv, BOOL bNotifySave = TRUE); void fn_vInitSndEnvironment (void); CString GetSndEnvironmentReference (void); // save static void CallBackSaveEnvironment (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction); }; //################################################################################# // Environment (list element) //################################################################################# class SECT_EnvElem : public SECT_EnvElementBase, public CPA_EdElement { protected: SECT_Environment *m_pEnvironment; public: SECT_EnvElem (SECT_tdxHandleOfElementLstEnvironment hEnvElem, Sector_Object *pOwnerSector); SECT_EnvElem (SECT_Environment *pEnvironment, Sector_Object *pOwnerSector); ~SECT_EnvElem (void); void *GetEngineStruct() { return GetStruct(); } // environment SECT_Environment * GetEnvironment (void) { return m_pEnvironment; } void SetEnvironment (SECT_Environment *pEnvironment); }; //################################################################################# // Environment List //################################################################################# class SECT_EnvironmentList : public CPA_EdList { protected: Sector_Object *m_pOwnerSector; public: SECT_EnvironmentList (void) { }; ~SECT_EnvironmentList (void) { }; void SetOwnerSector (Sector_Object *pOwnerSector) { m_pOwnerSector = pOwnerSector; } BOOL fn_bAddAnElement (SECT_EnvElem *pNewElem, SECT_EnvElem *pPreviousElem, BOOL bUpdateEngine = TRUE); void fn_vRemoveAnElement (SECT_EnvElem *pOldElem, BOOL bUpdateEngine = TRUE); void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE); SECT_EnvElem * GetElementWithEnvironment (SECT_Environment *pEnvironment); }; //################################################################################# // Environment ListBox //################################################################################# class SECT_EnvListBox : public CPA_SortedListBox { protected: Sector_Interface *m_pSectorInterface; tdeTypeElem m_eType; CFormView *m_pDialog; public: SECT_EnvListBox (void); ~SECT_EnvListBox (void); void fn_vInitParameters (CFormView *pDialog, Sector_Interface *pSectorInterface, tdeTypeElem eType); void DrawItem (LPDRAWITEMSTRUCT lpDIS); virtual BOOL fn_bIsCurrentElement (CPA_BaseObject *pElem); virtual BOOL fn_bIsSelectedElement (CPA_BaseObject *pElem); virtual BOOL fn_bIsAlreadyUsed (CPA_BaseObject *pElem); }; #endif //__SECT_ENV_HPP__ */