TAPs 0.7.7.3
TAPsBaseOpenGLViewManager.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsBaseOpenGLViewManager.hpp
00003 
00004 Declares the pure virtual interface for OpenGL View Manager
00005 
00006 SUKITTI PUNAK   (05/07/2006)
00007 UPDATE          (05/07/2006)
00008 ******************************************************************************/
00009 #ifndef TAPs_BASE_OPENGL_VIEW_MANAGER_HPP
00010 #define TAPs_BASE_OPENGL_VIEW_MANAGER_HPP
00011 
00012 #include <TAPs/Core/TAPsLib.hpp>
00013 
00014 BEGIN_NAMESPACE_TAPs__OpenGL
00015 //=============================================================================
00016 // Class Forward
00017 class wxGLCanvas;
00018 //=============================================================================
00019 template <typename T>
00020 class BaseOpenGLViewManager {
00021 public:
00022     //---------------------------------------------------------------
00023     // Default Constructor and Destructor
00024     BaseOpenGLViewManager ();
00025     virtual ~BaseOpenGLViewManager ();
00026     //---------------------------------------------------------------
00027     enum ModifyViewType {
00028         MODIFY_VIEW_TRANSLATE,
00029         MODIFY_VIEW_ROTATE,
00030         MODIFY_VIEW_SCALE,
00031         INVALID_MODIFY_VIEW
00032     };
00033     //---------------------------------------------------------------
00034     // Pure Virtual Fns
00035     virtual void Setup () = 0;
00036     virtual void Cleanup () = 0;
00037     //---------------------------------------------------------------
00038     virtual void ReshapeView ( int width, int height ) = 0;
00039     virtual void UpdateView () = 0;
00040     virtual bool IsModifyingView () const = 0;
00041     virtual void StartModifyView ( ModifyViewType type, int x, int y ) = 0;
00042     virtual void StopModifyView () = 0;
00043     virtual void ModifyView ( int x, int y ) = 0;
00044     virtual bool ToScreen ( const Vector3<T> &obj, Vector3<T> &win ) const = 0;
00045     virtual bool FromScreen ( const Vector3<T> &win, Vector3<T> &obj ) const = 0;
00046     virtual T GetWindowToWorldScale () const = 0;
00047     virtual const Matrix4x4<T> & GetViewTransform () const = 0;
00048     virtual const Matrix4x4<T> & GetProjTransform () const = 0;
00049     //---------------------------------------------------------------
00050     // Get/Set Fns
00051     virtual int GetWindowWidth () const = 0;
00052     virtual int GetWindowHeight () const = 0;
00053     //-----------------------------------------------------
00054     inline void GLSetClearColor ( const T color[4] );
00055     inline void GLSetClearColor ( T r, T g, T b, T a );
00056     //-----------------------------------------------------
00057     inline virtual void GLSetCamera () const = 0;
00058 private:
00059     //===============================================================
00060     // Data Members
00061     //---------------------------------------------------------------
00062 }; // CLASS END: BaseOpenGLViewManager *****************************************
00063 //=============================================================================
00064 END_NAMESPACE_TAPs__OpenGL
00065 //-----------------------------------------------------------------------------
00066 // Include definition if TAPs_USE_EXPORT is not defined
00067 //#if !defined( TAPs_USE_EXPORT )
00068     #include "TAPsBaseOpenGLViewManager.cpp"
00069 //#endif
00070 //-----------------------------------------------------------------------------
00071 #endif
00072 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00073 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines