//---------------------------------------------------------------------------- // EgalTech 2013-2014 //---------------------------------------------------------------------------- // File : EGrScene.h Data : 13.02.14 Versione : 1.5b1 // Contenuto : Dichiarazione della interfaccia IEGrScene per scena OpenGL. // // // // Modifiche : 13.02.14 DS Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once //---------------------------------------------------------------------------- #include "/EgtDev/Include/EGkPoint3d.h" #include "/EgtDev/Include/EGkBBox3d.h" #include "/EgtDev/Include/EGkColor.h" #include #include class IGeomDB ; class ILogger ; //----------------------- Macro per import/export ---------------------------- #undef EGR_EXPORT #if defined( I_AM_EGR) // da definirsi solo nella DLL #define EGR_EXPORT __declspec( dllexport) #else #define EGR_EXPORT __declspec( dllimport) #endif //---------------------------------------------------------------------------- class IEGrScene { public : // Basic virtual ~IEGrScene( void) {} virtual bool Init( IGeomDB* pGeomDB) = 0 ; virtual bool CreateContext( HDC hDC, int nDriver, bool b2Buff, int nColorBits, int nDepthBits) = 0 ; virtual bool IsValid( void) = 0 ; virtual std::string GetOpenGLInfo( void) = 0 ; virtual std::string GetGLSLInfo( void) = 0 ; virtual std::string GetPixelFormatInfo( void) = 0 ; virtual bool RedrawWindow( void) = 0 ; virtual bool Reshape( int nW, int nH) = 0 ; virtual bool SetBackground( Color BackTop, Color BackBottom) = 0 ; virtual bool Prepare( void) = 0 ; virtual bool Draw( void) = 0 ; virtual bool Project( const Point3d& ptWorld, Point3d& ptView) = 0 ; virtual bool UnProject( const Point3d& ptView, Point3d& ptWorld) = 0 ; virtual void Destroy( void) = 0 ; // Camera virtual bool SetCenter( const Point3d& ptCenter) = 0 ; virtual bool SetCamera( double dAngVertDeg, double dAngOrizzDeg, double dDist) = 0 ; virtual bool SetCamera( int nDir, double dDist = 0) = 0 ; virtual const Point3d& GetCenter( void) = 0 ; virtual Point3d GetProjectedCenter( void) = 0 ; virtual void GetCamera( double* pdAngVertDeg, double* pdAngOrizzDeg, double* pdDist = nullptr) = 0 ; virtual int GetCameraDir( void) = 0 ; virtual bool PanCamera( const Point3d& ptWinOld, const Point3d& ptWinNew) = 0 ; virtual bool RotateCamera( const Point3d& ptWinOld, const Point3d& ptWinNew) = 0 ; virtual bool ZoomAll( void) = 0 ; virtual bool ZoomChange( double dCoeff) = 0 ; virtual bool ZoomOnPoint( const Point3d& ptWin, double dCoeff) = 0 ; virtual bool ZoomWin( const Point3d& ptWin1, const Point3d& ptWin2) = 0 ; // Geometry virtual bool SetExtension( const BBox3d& b3Ext) = 0 ; virtual bool UpdateExtension( void) = 0 ; // Aux virtual bool SetWinRectAttribs( bool bOutline, Color WRcol) = 0 ; virtual bool SetWinRect( const Point3d& ptWinRectP1, const Point3d& ptWinRectP2) = 0 ; virtual bool ResetWinRect( void) = 0 ; } ; //----------------------------------------------------------------------------- EGR_EXPORT IEGrScene* CreateEGrScene( void) ; //------------------------ Costanti per tipo di driver OpenGL ---------------- enum OglDriver { OD_SOFT = 1, OD_OLD = 2, OD_NEW = 3} ; //------------------------ Costanti per direzione Camera --------------------- enum CameraDir { CT_NONE = 0, CT_TOP = 1, CT_FRONT = 2, CT_RIGHT = 3, CT_BACK = 4, CT_LEFT = 5, CT_BOTTOM = 6, CT_ISO_SW = 7, CT_ISO_SE = 8, CT_ISO_NE = 9, CT_ISO_NW = 10} ;