TAPs 0.7.7.3
TAPsHapticManager.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsHapticManager.hpp
00003 
00004 Inherited from class BaseHapticManager
00005 
00006 SUKITTI PUNAK   (05/07/2006)
00007 UPDATE          (05/07/2006)
00008 ******************************************************************************/
00009 #ifndef TAPs_HAPTIC_MANAGER_HPP
00010 #define TAPs_HAPTIC_MANAGER_HPP
00011 
00012 #include "TAPsBaseHapticManager.hpp"
00013 
00014 BEGIN_NAMESPACE_TAPs__Haptic
00015 //=============================================================================
00016 template <typename T>
00017 class HapticManager : public /*virtual*/ BaseHapticManager<T> {
00018 public:
00019     //----------------------------------------------------------------
00020     // Default Constructor and Destructor
00021     HapticManager ();
00022     HapticManager ( const char * toolOneFileName );
00023     virtual ~HapticManager ();
00024     //----------------------------------------------------------------
00025     virtual void Setup ( 
00026             TAPs::OpenGL::BaseModelManager<T> *         pModelManager,
00027             TAPs::OpenGL::BaseOpenGLViewManager<T> *    pViewManager );
00028     virtual void Cleanup ();
00029     //----------------------------------------------------------------
00030     virtual void UpdateWorkSpace ();
00031     virtual void DrawCursor ( OpenGL::Enum::DrawMode DM 
00032                                 = OpenGL::Enum::POLYGON );
00033     virtual void DrawTooltipSphere ( OpenGL::Enum::DrawMode DM 
00034                                 = OpenGL::Enum::POLYGON );
00035     virtual void DrawHapticObjects ( OpenGL::Enum::DrawMode DM 
00036                                 = OpenGL::Enum::POLYGON );
00037     virtual void FeelObjects ( OpenGL::Enum::DrawMode DM 
00038                                 = OpenGL::Enum::POLYGON );
00039     virtual void FeelPoints ();
00040     virtual bool IsManipulating () const;
00041     //----------------------------------------------------------------
00042 protected:
00043     //----------------------------------------------------------------
00044     // Helper Fn(s)
00045     void StartManipulating ( int i );
00046     void StopManipulating ();
00047     void UpdateManipPoint ( const TAPs::Vector3<T> &    proxyPos, 
00048                             const TAPs::Matrix4x4<T> &  proxyTransform );
00049     void PushWorkSpaceOffset ( const TAPs::Vector3<T> &offsetWC );
00050     void PopWorkSpaceOffset ();
00051     int GetPointIndexFromTouchID ( HLuint id ) const;
00052     static void HLCALLBACK hlTouchCB ( 
00053         HLenum event, HLuint object, HLenum thread,
00054         HLcache *cache, void *userData );
00055     static void HLCALLBACK hlButtonDownCB ( 
00056         HLenum event, HLuint object, HLenum thread,
00057         HLcache *cache, void *userData );
00058     static void HLCALLBACK hlButtonUpCB ( 
00059         HLenum event, HLuint object, HLenum thread,
00060         HLcache *cache, void *userData );
00061     static void HLCALLBACK hlMotionCB ( 
00062         HLenum event, HLuint object, HLenum thread,
00063         HLcache *cache, void *userData );
00064     //----------------------------------------------------------------
00065     // Data Members
00066     HHD     m_hHD;
00067     HHLRC   m_hHLRC;
00068     //------------------------------------------------
00069     // Object ID that will be rendered hapticcally
00070     // Inherited from class BaseHapticManager
00071     //HLuint    m_uiHapticObjects;
00072     //------------------------------------------------
00073     HLuint  m_uiPointNameBase;
00074     int     m_iManipPoint;
00075     static const T  g_tSnapDistanceConst;
00076     static T        g_tSnapDistance;
00077     T       m_tCursorScale;
00078     GLuint  m_uiCursorDisplayList;
00079     HLuint  m_uiEffectName;
00080     TAPs::OpenGL::BaseModelManager<T> *         m_pModelManager;
00081     TAPs::OpenGL::BaseOpenGLViewManager<T> *    m_pViewManager;
00082     //----------------------------------------------------------------
00083     // Haptic Data
00084     // position and orientation of proxy at start of drag
00085     //hduVector3Dd  startDragProxyPos;
00086     //hduQuaternion startDragProxyRot;
00087     //hduMatrix     startDragProxyTransform;
00088     TAPs::Matrix4x4<T> startDragProxyTransform;
00089     TAPs::Matrix3x3<T> startDragProxyRotation;
00090     // position and orientation of drag object at start of drag
00091     //hduMatrix startDragObjTransform;
00092     //----------------------------------------------------------------
00093     // Not In Use Right Now
00094     // flag for enabling/disabling axis snap on drag
00095     bool m_bHapticAxisSnapOn;
00096     // flag for enabling/disabling rotation
00097     //----------------------------------------------------------------
00098     bool m_bHapticRotateOn;
00099     void InitHapticData ();
00100     void InitCursor ();
00101     void InitCursor ( const char * toolOneFile );
00102     //----------------------------------------------------------------
00103 }; // CLASS END: HapticManager *************************************************
00104 //=============================================================================
00105 END_NAMESPACE_TAPs__Haptic
00106 //-----------------------------------------------------------------------------
00107 // Include definition if TAPs_USE_EXPORT is not defined
00108 //#if !defined( TAPs_USE_EXPORT )
00109     #include "TAPsHapticManager.cpp"
00110 //#endif
00111 //-----------------------------------------------------------------------------
00112 #endif
00113 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00114 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines