00001 // 00002 // Copyright (c) 2000 by Tech Soft 3D, LLC. 00003 // The information contained herein is confidential and proprietary to 00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under 00005 // civil and criminal statutes. Tech Soft 3D shall pursue its civil 00006 // and criminal remedies in the event of unauthorized use or misappropriation 00007 // of its trade secrets. Use of this information by anyone other than 00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a 00009 // written non-disclosure agreement, expressly prescribing the scope and 00010 // manner of such use. 00011 // 00012 // $Id: ec4e2aa7f33151875bd1d3e2fdc320bd37ee309e $ 00013 // 00014 00018 #ifndef _HBASEOPERATOR_H 00019 #define _HBASEOPERATOR_H 00020 00021 00022 #ifdef H_PACK_8 00023 #pragma pack(push) 00024 #pragma pack(8) 00025 #endif 00026 00027 #include "HTools.h" 00028 #include "HBaseModel.h" 00029 #include "HUtility.h" 00030 #include "HEventListener.h" 00031 00032 00034 #define EPSILON 0.00001F 00035 00036 class HDB; 00037 class HBaseModel; 00038 class HBaseView; 00039 class HEventInfo; 00040 class HMouseListener; 00041 00045 enum HOperatorReturn 00046 { 00047 HOP_OK, 00048 HOP_NOT_HANDLED, 00049 HOP_CANCEL, 00050 HOP_READY 00051 }; 00052 00054 00065 class MVO_API HBaseOperator : public HMouseListener 00066 { 00067 protected: 00072 bool m_bOpStarted; 00073 int m_doRepeat; 00074 int m_doCapture; 00075 00076 HPoint m_ptFirst; 00077 HPoint m_ptNew; 00078 00079 HBaseView *m_pView; 00080 00081 bool m_bMapTouchesToMouseEvents; 00082 00085 bool IsSpecialKey( HC_KEY key ); 00086 00087 HShadowMode m_TempShadowMode; 00088 HCutGeometryVisibility m_TempCutGeometryVisibility; 00089 00090 public: 00091 int Repeat() { return(m_doRepeat); } 00092 int Capture() { return(m_doCapture); } 00093 00094 00100 virtual HBaseOperator * Clone(); 00101 00102 void SetFirstPoint( HPoint const& new_point ) { m_ptFirst = new_point; } 00103 HPoint const GetFirstPoint( void ) { return m_ptFirst; } 00104 00105 void SetNewPoint( HPoint const& new_point ) { m_ptNew = new_point; } 00106 HPoint const GetNewPoint( void ) { return m_ptNew; } 00107 00108 HBaseView * GetView( void ) { return m_pView; } 00109 void SetView(HBaseView* new_view) { m_pView = new_view; } 00110 00111 virtual bool OperatorStarted() { return m_bOpStarted; } 00112 void SetOperatorStarted( bool val ) { m_bOpStarted = val; } 00113 00114 void SetMapTouchesToMouseEvents(bool val) { m_bMapTouchesToMouseEvents = val; } 00115 00122 HBaseOperator(HBaseView* view, int DoRepeat=0, int DoCapture=1); 00123 virtual ~HBaseOperator(); 00124 00125 00139 virtual int OnMouseMove(HEventInfo &hevent); 00140 00141 00144 virtual const char * GetName(); 00145 00146 // event methods; these will be overloaded by derived classes 00147 00155 virtual int OnLButtonDown(HEventInfo &hevent); 00156 00164 virtual int OnLButtonUp(HEventInfo &hevent); 00165 00173 virtual int OnLButtonDblClk(HEventInfo &hevent); 00174 00175 00183 virtual int OnLButtonDownAndMove(HEventInfo &hevent); 00184 00185 00193 virtual int OnMButtonDown(HEventInfo &hevent); 00194 00202 virtual int OnMButtonUp(HEventInfo &hevent); 00203 00211 virtual int OnMButtonDblClk(HEventInfo &hevent); 00212 00220 virtual int OnMButtonDownAndMove(HEventInfo &hevent); 00221 00222 00230 virtual int OnRButtonDown(HEventInfo &hevent); 00231 00239 virtual int OnRButtonUp(HEventInfo &hevent); 00240 00248 virtual int OnRButtonDblClk(HEventInfo &hevent); 00249 00257 virtual int OnRButtonDownAndMove(HEventInfo &hevent); 00258 00266 virtual int OnLRButtonDownAndMove(HEventInfo &hevent); 00267 00275 virtual int OnNoButtonDownAndMove(HEventInfo &hevent); 00276 00284 virtual int OnTimer(HEventInfo &hevent); 00285 00293 virtual int OnKeyDown(HEventInfo &hevent); 00294 00302 virtual int OnKeyUp(HEventInfo &hevent); 00303 00311 virtual int OnMouseWheel(HEventInfo &hevent); 00312 00313 00321 virtual int OnTouchesDown(HEventInfo &hevent); 00322 00330 virtual int OnTouchesMove(HEventInfo &hevent); 00331 00339 virtual int OnTouchesUp(HEventInfo &hevent); 00340 00341 00342 00343 00344 }; 00345 00347 00348 #ifdef H_PACK_8 00349 #pragma pack(pop) 00350 #endif 00351 00352 #endif