00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc. 00002 // 00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., 00004 // and considered a trade secret as defined under civil and criminal statutes. 00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of 00006 // unauthorized use or misappropriation of its trade secrets. Use of this information 00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under 00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use. 00009 00013 #ifndef _HBASEOPERATOR_H 00014 #define _HBASEOPERATOR_H 00015 00016 00017 #ifdef H_PACK_8 00018 #pragma pack(push) 00019 #pragma pack(8) 00020 #endif 00021 00022 #include "HTools.h" 00023 #include "HBaseModel.h" 00024 #include "HUtility.h" 00025 #include "HEventListener.h" 00026 00027 00029 #define EPSILON 0.00001F 00030 00031 class HDB; 00032 class HBaseModel; 00033 class HBaseView; 00034 class HEventInfo; 00035 class HMouseListener; 00036 00040 enum HOperatorReturn 00041 { 00042 HOP_OK, 00043 HOP_NOT_HANDLED, 00044 HOP_CANCEL, 00045 HOP_READY 00046 }; 00047 00049 00060 class MVO_API HBaseOperator : public HMouseListener 00061 { 00062 protected: 00067 bool m_bOpStarted; 00068 int m_doRepeat; 00069 int m_doCapture; 00070 00071 HPoint m_ptFirst; 00072 HPoint m_ptNew; 00073 00074 HBaseView *m_pView; 00075 00076 bool m_bMapTouchesToMouseEvents; 00077 00080 bool IsSpecialKey( HC_KEY key ); 00081 00082 HShadowMode m_TempShadowMode; 00083 HCutGeometryVisibility m_TempCutGeometryVisibility; 00084 00085 public: 00086 int Repeat() { return m_doRepeat; } 00087 int Capture() { return m_doCapture; } 00088 00089 00095 virtual HBaseOperator * Clone(); 00096 00097 void SetFirstPoint(HPoint const& new_point) { m_ptFirst = new_point; } 00098 HPoint const GetFirstPoint() { return m_ptFirst; } 00099 00100 void SetNewPoint(HPoint const& new_point) { m_ptNew = new_point; } 00101 HPoint const GetNewPoint() { return m_ptNew; } 00102 00103 HBaseView * GetView() { return m_pView; } 00104 void SetView(HBaseView* new_view) { m_pView = new_view; } 00105 00106 virtual bool OperatorStarted() { return m_bOpStarted; } 00107 void SetOperatorStarted(bool val) { m_bOpStarted = val; } 00108 00109 void SetMapTouchesToMouseEvents(bool val) { m_bMapTouchesToMouseEvents = val; } 00110 00117 HBaseOperator(HBaseView* view, int DoRepeat=0, int DoCapture=1); 00118 virtual ~HBaseOperator(); 00119 00120 00134 virtual int OnMouseMove(HEventInfo &hevent); 00135 00136 00139 virtual const char * GetName(); 00140 00141 // event methods; these will be overloaded by derived classes 00142 00150 virtual int OnLButtonDown(HEventInfo &hevent); 00151 00159 virtual int OnLButtonUp(HEventInfo &hevent); 00160 00168 virtual int OnLButtonDblClk(HEventInfo &hevent); 00169 00170 00178 virtual int OnLButtonDownAndMove(HEventInfo &hevent); 00179 00180 00188 virtual int OnMButtonDown(HEventInfo &hevent); 00189 00197 virtual int OnMButtonUp(HEventInfo &hevent); 00198 00206 virtual int OnMButtonDblClk(HEventInfo &hevent); 00207 00215 virtual int OnMButtonDownAndMove(HEventInfo &hevent); 00216 00217 00225 virtual int OnRButtonDown(HEventInfo &hevent); 00226 00234 virtual int OnRButtonUp(HEventInfo &hevent); 00235 00243 virtual int OnRButtonDblClk(HEventInfo &hevent); 00244 00252 virtual int OnRButtonDownAndMove(HEventInfo &hevent); 00253 00261 virtual int OnLRButtonDownAndMove(HEventInfo &hevent); 00262 00270 virtual int OnNoButtonDownAndMove(HEventInfo &hevent); 00271 00279 virtual int OnTimer(HEventInfo &hevent); 00280 00288 virtual int OnKeyDown(HEventInfo &hevent); 00289 00297 virtual int OnKeyUp(HEventInfo &hevent); 00298 00306 virtual int OnMouseWheel(HEventInfo &hevent); 00307 00308 00316 virtual int OnTouchesDown(HEventInfo &hevent); 00317 00325 virtual int OnTouchesMove(HEventInfo &hevent); 00326 00334 virtual int OnTouchesUp(HEventInfo &hevent); 00335 00336 00337 00338 00339 }; 00340 00342 00343 #ifdef H_PACK_8 00344 #pragma pack(pop) 00345 #endif 00346 00347 #endif