dbgrip.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. #ifndef AD_DBGRIP_H
  12. #define AD_DBGRIP_H
  13. #include "acdb.h"
  14. #include "acarray.h"
  15. #include "dbDimData.h"
  16. class AcGiViewport;
  17. class AcDbEntity;
  18. class AcDbGripData;
  19. class AcGiWorldDraw;
  20. class AcGiViewportDraw;
  21. class AcDbCustomOsnapMode;
  22. namespace AcDbGripOperations {
  23. enum ReturnValue {
  24. eOk = 0,
  25. eFailure,
  26. eNoRedrawGrip,
  27. eGripHotToWarm,
  28. eGetNewGripPoints
  29. };
  30. enum DrawType {
  31. kWarmGrip = 0,
  32. kHoverGrip,
  33. kHotGrip,
  34. kDragImageGrip
  35. };
  36. enum GripStatus {
  37. kGripStart = 0,
  38. kGripEnd,
  39. kGripAbort,
  40. kStretch,
  41. kMove,
  42. kRotate,
  43. kScale,
  44. kMirror,
  45. kDimFocusChanged,
  46. kPopUpMenu
  47. };
  48. enum GripFlags {
  49. kSkipWhenShared = 0x1,
  50. kDisableRubberBandLine = 0x2,
  51. kDisableModeKeywords = 0x4,
  52. kDrawAtDragImageGripPoint = 0x8,
  53. kTriggerGrip = 0x10,
  54. kTurnOnForcedPick = 0x20,
  55. kMapGripHotToRtClk = 0x40,
  56. kGizmosEnabled = 0x80,
  57. kGripIsPerViewport = 0x100,
  58. kGripEditTip = 0x200, // INTERNAL USE ONLY
  59. kGripIsDisabled = 0x400,
  60. kGripRightClickIsNewStyle = 0x800,
  61. kGripSynergyPrompt = 0x1000 // INTERNAL USE ONLY
  62. };
  63. enum GripContextFlags {
  64. kSharedGrip = 0x1,
  65. kMultiHotGrip = 0x2
  66. };
  67. enum GetGripPointsFlags {
  68. kGripPointsOnly = 0x1,
  69. kCyclableGripsOnly = 0x02,
  70. kDynamicDimMode = 0x04,
  71. kNoMultiModesGrip = 0x08,
  72. };
  73. // The following are used by the moveGripPointsAt() bitflags parameter,
  74. // and refer to how the offset parameter was determined.
  75. enum MoveGripPointsFlags {
  76. kOsnapped = 0x1, // offset is result of osnap
  77. kPolar = 0x2, // offset is result of polar
  78. kOtrack = 0x4, // offset is result of otrack
  79. kZdir = 0x8, // offset polar or otrack value is in Z direction
  80. kKeyboard = 0x10, // offset is result of keyboard entry
  81. kDragging = 0x20 // dragging in progress
  82. };
  83. };
  84. typedef AcArray<AcDbGripData*, AcArrayMemCopyReallocator<AcDbGripData*> > AcDbGripDataPtrArray;
  85. typedef AcArray<AcDbGripData, AcArrayObjectCopyReallocator<AcDbGripData> > AcDbGripDataArray;
  86. typedef AcDbGripOperations::ReturnValue (*GripOperationPtr)(AcDbGripData* pThis,
  87. const AcDbObjectId& entId, int contextFlags);
  88. typedef void (*ContextMenuItemIndexPtr)(unsigned int itemIndex);
  89. typedef AcDbGripOperations::ReturnValue (*GripRtClkHandler)(AcDbGripDataArray& hotGrips,
  90. const AcDbObjectIdArray& ents, ACHAR *& menuName, HMENU& menu,
  91. ContextMenuItemIndexPtr& cb);
  92. typedef AcDbGripOperations::ReturnValue (*GripRightClickHandler)(AcDbGripDataArray& hotGrips,
  93. const AcDbObjectIdArray& ents, AcRxObject*& handler);
  94. typedef bool (*GripWorldDrawPtr)(AcDbGripData* pThis, AcGiWorldDraw* pWd,
  95. const AcDbObjectId& entId, AcDbGripOperations::DrawType type,
  96. AcGePoint3d* imageGripPoint, double dGripSize);
  97. typedef void (*GripViewportDrawPtr)(AcDbGripData* pThis, AcGiViewportDraw* pWd,
  98. const AcDbObjectId& entId, AcDbGripOperations::DrawType type,
  99. AcGePoint3d* imageGripPoint, int gripSize);
  100. typedef void (*GripOpStatusPtr)(AcDbGripData* pThis, const AcDbObjectId& entId,
  101. AcDbGripOperations::GripStatus stat);
  102. typedef const ACHAR * (*GripToolTipPtr)(AcDbGripData* pThis);
  103. typedef const ACHAR * (*GripCLIPromptPtr)(AcDbGripData* pThis);
  104. typedef const ACHAR * (*GripCLIDisplayStringPtr)(AcDbGripData* pThis);
  105. typedef void (*GripDimensionPtr)(AcDbGripData* pThis, const AcDbObjectId& entId,
  106. double dimScale, AcDbDimDataPtrArray& dimData);
  107. typedef AcDbGripOperations::ReturnValue (*GripInputPointPtr)(
  108. AcDbGripData* pThis, const AcDbObjectId& entId, bool& changedPoint,
  109. AcGePoint3d& newPoint, const AcGiViewport& viewContext,
  110. const AcDbObjectId& viewportId, bool pointComputed, int history,
  111. const AcGePoint3d& lastPoint, const AcGePoint3d& rawPoint,
  112. const AcGePoint3d& grippedPoint, const AcGePoint3d& cartesianSnappedPoint,
  113. const AcGePoint3d& osnappedPoint, AcDb::OsnapMask osnapMask,
  114. const AcArray<AcDbCustomOsnapMode*>& customOsnapModes,
  115. AcDb::OsnapMask osnapOverrides,
  116. const AcArray<AcDbCustomOsnapMode*>& customOsnapOverrides,
  117. const AcArray<AcDbObjectId>& pickedEntities,
  118. const AcArray< AcDbObjectIdArray,
  119. AcArrayObjectCopyReallocator< AcDbObjectIdArray > >& nestedPickedEntities,
  120. const AcArray<Adesk::GsMarker>& gsSelectionMark,
  121. const AcArray<AcDbObjectId>& keyPointEntities,
  122. const AcArray< AcDbObjectIdArray,
  123. AcArrayObjectCopyReallocator< AcDbObjectIdArray > >& nestedKeyPointEntities,
  124. const AcArray<Adesk::GsMarker>& keyPointGsSelectionMark,
  125. const AcArray<AcGeCurve3d*>& alignmentPaths, const AcGePoint3d& computedPoint);
  126. class AcDbGripData {
  127. public:
  128. AcDbGripData();
  129. AcDbGripData(const AcGePoint3d&, void*, GripOperationPtr hotGrip = NULL,
  130. GripOperationPtr hoverGrip = NULL, GripRtClkHandler RtClk = NULL,
  131. GripWorldDrawPtr wd = NULL, GripViewportDrawPtr vd = NULL,
  132. GripOpStatusPtr stat = NULL, GripToolTipPtr tt = NULL,
  133. GripDimensionPtr hoverDim = NULL, GripDimensionPtr hotGripDim = NULL,
  134. unsigned int bitFlags = 0,
  135. AcGePoint3d* altBasePt = NULL, GripInputPointPtr inputPointFunc = NULL);
  136. AcDbGripData(const AcGePoint3d&, void*, AcRxClass*,
  137. GripOperationPtr hotGrip = NULL,
  138. GripOperationPtr hoverGrip = NULL, GripRtClkHandler RtClk = NULL,
  139. GripWorldDrawPtr wd = NULL, GripViewportDrawPtr vd = NULL,
  140. GripOpStatusPtr stat = NULL, GripToolTipPtr tt = NULL,
  141. GripDimensionPtr hoverDim = NULL, GripDimensionPtr hotGripDim = NULL,
  142. unsigned int bitFlags = 0,
  143. AcGePoint3d* altBasePt = NULL, GripInputPointPtr inputPointFunc = NULL);
  144. ~AcDbGripData() {}
  145. AcDbGripData(const AcDbGripData&);
  146. AcDbGripData& operator = (const AcDbGripData&);
  147. void setAllData(const AcGePoint3d&, void*,
  148. GripOperationPtr hotGrip = NULL, GripOperationPtr hoverGrip = NULL,
  149. GripRtClkHandler RtClk = NULL, GripWorldDrawPtr wd = NULL,
  150. GripViewportDrawPtr vd = NULL, GripOpStatusPtr stat = NULL,
  151. GripToolTipPtr tt = NULL, GripDimensionPtr hoverDim = NULL,
  152. GripDimensionPtr hotGripDim = NULL,
  153. unsigned int bitFlags = 0, AcGePoint3d* altBasePt = NULL,
  154. GripInputPointPtr inputPointFunc = NULL,
  155. AcRxClass* appDataAcRxClass = NULL);
  156. const AcGePoint3d& gripPoint() const;
  157. void setGripPoint(const AcGePoint3d& pt);
  158. void* appData() const;
  159. void setAppData(void* appData);
  160. AcRxClass* appDataAcRxClass() const;
  161. void setAppDataAcRxClass(AcRxClass* pClass);
  162. GripOperationPtr hotGripFunc() const;
  163. void setHotGripFunc(GripOperationPtr pFunc);
  164. GripOperationPtr hoverFunc() const;
  165. void setHoverFunc(GripOperationPtr pFunc);
  166. GripRtClkHandler rtClk() const;
  167. void setRtClk(GripRtClkHandler pFunc);
  168. GripRightClickHandler righClick() const;
  169. void setRightClick(GripRightClickHandler pFunc);
  170. GripWorldDrawPtr worldDraw() const;
  171. void setWorldDraw(GripWorldDrawPtr pFunc);
  172. GripViewportDrawPtr viewportDraw() const;
  173. void setViewportDraw(GripViewportDrawPtr pFunc);
  174. GripOpStatusPtr gripOpStatFunc() const;
  175. void setGripOpStatFunc(GripOpStatusPtr pFunc);
  176. GripToolTipPtr toolTipFunc() const;
  177. void setToolTipFunc(GripToolTipPtr pFunc);
  178. GripDimensionPtr hoverDimensionFunc() const;
  179. void setHoverDimensionFunc(GripDimensionPtr pFunc);
  180. GripDimensionPtr hotGripDimensionFunc() const;
  181. void setHotGripDimensionFunc(GripDimensionPtr pFunc);
  182. AcGePoint3d* alternateBasePoint() const;
  183. void setAlternateBasePoint(AcGePoint3d* altBasePt);
  184. GripCLIPromptPtr getCLIPromptFunc()const;
  185. void setCLIPromptFunc(GripCLIPromptPtr pFunc);
  186. GripCLIDisplayStringPtr getCLIDisplayStringFunc()const;
  187. void setCLIDisplayStringFunc(GripCLIDisplayStringPtr pFunc);
  188. unsigned int bitFlags() const;
  189. void setBitFlags(unsigned int flags);
  190. // Utility functions for individual bit flag bits
  191. bool skipWhenShared() const;
  192. void setSkipWhenShared(bool skip);
  193. bool isRubberBandLineDisabled() const;
  194. void disableRubberBandLine(bool disable);
  195. bool areModeKeywordsDisabled() const;
  196. void disableModeKeywords(bool disable);
  197. bool drawAtDragImageGripPoint() const;
  198. void setDrawAtDragImageGripPoint(bool atDragPoint);
  199. bool triggerGrip() const;
  200. void setTriggerGrip(bool trigger);
  201. GripInputPointPtr inputPointFunc() const;
  202. void setInputPointFunc(GripInputPointPtr pFunc);
  203. bool forcedPickOn() const;
  204. void setForcedPickOn(bool on);
  205. bool mapGripHotToRtClk() const;
  206. void setMapGripHotToRtClk(bool on);
  207. bool gizmosEnabled() const;
  208. void setGizmosEnabled(bool on);
  209. bool gripIsPerViewport() const;
  210. void setGripIsPerViewport(bool on);
  211. bool gripIsDisabled() const;
  212. void disableGrip(bool disable);
  213. bool gripRightClickIsNewStyle() const;
  214. private:
  215. AcGePoint3d m_gripPt;
  216. AcGePoint3d* m_pAltBasePt;
  217. void* m_pAppData;
  218. GripOperationPtr m_pHotGripFunc;
  219. GripOperationPtr m_pHoverFunc;
  220. union {
  221. GripRtClkHandler oldHandler;
  222. GripRightClickHandler newHandler;
  223. } m_pRtClk;
  224. GripWorldDrawPtr m_pWorldDraw;
  225. GripViewportDrawPtr m_pViewportDraw;
  226. GripOpStatusPtr m_pGripOpStatFunc;
  227. GripToolTipPtr m_pToolTipFunc;
  228. GripDimensionPtr m_pHoverDimensionFunc;
  229. GripDimensionPtr m_pHotGripDimensionFunc;
  230. unsigned int m_bitFlags;
  231. GripInputPointPtr m_pInputPointFunc;
  232. AcRxClass* m_pAppDataClass;
  233. GripCLIPromptPtr m_pCLIPromptFunc;
  234. GripCLIDisplayStringPtr m_pCLIDisplayStringFunc;
  235. };
  236. inline AcDbGripData::AcDbGripData()
  237. : m_pAppData(NULL)
  238. , m_pAppDataClass(NULL)
  239. , m_pHotGripFunc(NULL)
  240. , m_pHoverFunc(NULL)
  241. , m_pWorldDraw(NULL)
  242. , m_pViewportDraw(NULL)
  243. , m_pGripOpStatFunc(NULL)
  244. , m_pToolTipFunc(NULL)
  245. , m_pHoverDimensionFunc(NULL)
  246. , m_pHotGripDimensionFunc(NULL)
  247. , m_bitFlags(0)
  248. , m_pAltBasePt(NULL)
  249. , m_pInputPointFunc(NULL)
  250. , m_pCLIPromptFunc(NULL)
  251. , m_pCLIDisplayStringFunc(NULL)
  252. {
  253. setRtClk(NULL);
  254. }
  255. inline AcDbGripData::AcDbGripData(const AcGePoint3d& pt, void* AppData,
  256. GripOperationPtr hotGrip, GripOperationPtr hoverGrip,
  257. GripRtClkHandler RtClk, GripWorldDrawPtr wd,
  258. GripViewportDrawPtr vd, GripOpStatusPtr stat,
  259. GripToolTipPtr tt, GripDimensionPtr hoverDim,
  260. GripDimensionPtr hotGripDim,
  261. unsigned int bitFlags, AcGePoint3d* altBasePt,
  262. GripInputPointPtr inputPointFunc) :
  263. m_gripPt(pt), m_pAppData(AppData), m_pAppDataClass(NULL), m_pHotGripFunc(hotGrip),
  264. m_pHoverFunc(hoverGrip), m_pWorldDraw(wd),
  265. m_pViewportDraw(vd), m_pGripOpStatFunc(stat),
  266. m_pToolTipFunc(tt), m_pHoverDimensionFunc(hoverDim),
  267. m_pHotGripDimensionFunc(hotGripDim),
  268. m_bitFlags(bitFlags), m_pAltBasePt(altBasePt),
  269. m_pInputPointFunc(inputPointFunc), m_pCLIPromptFunc(NULL), m_pCLIDisplayStringFunc(NULL)
  270. {
  271. setRtClk(RtClk);
  272. }
  273. inline AcDbGripData::AcDbGripData(const AcGePoint3d& pt, void* AppData,
  274. AcRxClass* pAppDataClass,
  275. GripOperationPtr hotGrip, GripOperationPtr hoverGrip,
  276. GripRtClkHandler RtClk, GripWorldDrawPtr wd,
  277. GripViewportDrawPtr vd, GripOpStatusPtr stat,
  278. GripToolTipPtr tt, GripDimensionPtr hoverDim,
  279. GripDimensionPtr hotGripDim,
  280. unsigned int bitFlags, AcGePoint3d* altBasePt,
  281. GripInputPointPtr inputPointFunc) :
  282. m_gripPt(pt), m_pAppData(AppData), m_pAppDataClass(pAppDataClass),
  283. m_pHotGripFunc(hotGrip), m_pHoverFunc(hoverGrip),
  284. m_pWorldDraw(wd), m_pViewportDraw(vd), m_pGripOpStatFunc(stat),
  285. m_pToolTipFunc(tt), m_pHoverDimensionFunc(hoverDim),
  286. m_pHotGripDimensionFunc(hotGripDim),
  287. m_bitFlags(bitFlags), m_pAltBasePt(altBasePt),
  288. m_pInputPointFunc(inputPointFunc), m_pCLIPromptFunc(NULL), m_pCLIDisplayStringFunc(NULL)
  289. {
  290. setRtClk(RtClk);
  291. }
  292. inline AcDbGripData::AcDbGripData(const AcDbGripData& src)
  293. {
  294. m_gripPt = src.gripPoint();
  295. m_pAppData = src.appData();
  296. m_pAppDataClass = src.appDataAcRxClass();
  297. m_pHotGripFunc = src.hotGripFunc();
  298. m_pHoverFunc = src.hoverFunc();
  299. m_pRtClk.oldHandler = src.rtClk();
  300. m_pWorldDraw = src.worldDraw();
  301. m_pViewportDraw = src.viewportDraw();
  302. m_pGripOpStatFunc = src.gripOpStatFunc();
  303. m_pToolTipFunc= src.toolTipFunc();
  304. m_pHoverDimensionFunc= src.hoverDimensionFunc();
  305. m_pHotGripDimensionFunc= src.hotGripDimensionFunc();
  306. m_bitFlags = src.bitFlags();
  307. m_pAltBasePt = src.alternateBasePoint();
  308. m_pInputPointFunc = src.inputPointFunc();
  309. m_pCLIPromptFunc = src.getCLIPromptFunc();
  310. m_pCLIDisplayStringFunc = src.getCLIDisplayStringFunc();
  311. }
  312. inline AcDbGripData& AcDbGripData::operator = (const AcDbGripData& rtSide)
  313. {
  314. m_gripPt = rtSide.gripPoint();
  315. m_pAppData = rtSide.appData();
  316. m_pAppDataClass = rtSide.appDataAcRxClass();
  317. m_pHotGripFunc = rtSide.hotGripFunc();
  318. m_pHoverFunc = rtSide.hoverFunc();
  319. m_pRtClk.oldHandler = rtSide.rtClk();
  320. m_pWorldDraw = rtSide.worldDraw();
  321. m_pViewportDraw = rtSide.viewportDraw();
  322. m_pGripOpStatFunc = rtSide.gripOpStatFunc();
  323. m_pToolTipFunc= rtSide.toolTipFunc();
  324. m_pHoverDimensionFunc= rtSide.hoverDimensionFunc();
  325. m_pHotGripDimensionFunc= rtSide.hotGripDimensionFunc();
  326. m_bitFlags = rtSide.bitFlags();
  327. m_pAltBasePt = rtSide.alternateBasePoint();
  328. m_pInputPointFunc = rtSide.inputPointFunc();
  329. m_pCLIPromptFunc = rtSide.getCLIPromptFunc();
  330. m_pCLIDisplayStringFunc = rtSide.getCLIDisplayStringFunc();
  331. return *this;
  332. }
  333. inline void AcDbGripData::setAllData(const AcGePoint3d& pt, void* AppData,
  334. GripOperationPtr hotGrip, GripOperationPtr hoverGrip,
  335. GripRtClkHandler RtClk, GripWorldDrawPtr wd,
  336. GripViewportDrawPtr vd, GripOpStatusPtr stat,
  337. GripToolTipPtr tt, GripDimensionPtr hoverDim,
  338. GripDimensionPtr hotGripDim,
  339. unsigned int bitFlags, AcGePoint3d* altBasePt,
  340. GripInputPointPtr inputPointFunc,
  341. AcRxClass* pAppDataClass)
  342. {
  343. m_gripPt = pt;
  344. m_pAppData = AppData;
  345. m_pAppDataClass = pAppDataClass;
  346. m_pHotGripFunc = hotGrip;
  347. m_pHoverFunc = hoverGrip;
  348. setRtClk(RtClk);
  349. m_pWorldDraw = wd;
  350. m_pViewportDraw = vd;
  351. m_pGripOpStatFunc = stat;
  352. m_pToolTipFunc= tt;
  353. m_pHoverDimensionFunc = hoverDim;
  354. m_pHotGripDimensionFunc = hotGripDim;
  355. m_bitFlags = bitFlags;
  356. m_pAltBasePt = altBasePt;
  357. m_pInputPointFunc = inputPointFunc;
  358. }
  359. inline const AcGePoint3d&
  360. AcDbGripData::gripPoint() const
  361. {
  362. return m_gripPt;
  363. }
  364. inline void
  365. AcDbGripData::setGripPoint(const AcGePoint3d& pt)
  366. {
  367. m_gripPt = pt;
  368. }
  369. inline void*
  370. AcDbGripData::appData() const
  371. {
  372. return m_pAppData;
  373. }
  374. inline void
  375. AcDbGripData::setAppData(void* appData)
  376. {
  377. m_pAppData = appData;
  378. }
  379. inline AcRxClass*
  380. AcDbGripData::appDataAcRxClass() const
  381. {
  382. return m_pAppDataClass;
  383. }
  384. inline void
  385. AcDbGripData::setAppDataAcRxClass(AcRxClass* appDataClass)
  386. {
  387. m_pAppDataClass = appDataClass;
  388. }
  389. inline GripOperationPtr
  390. AcDbGripData::hotGripFunc() const
  391. {
  392. return m_pHotGripFunc;
  393. }
  394. inline void
  395. AcDbGripData::setHotGripFunc(GripOperationPtr pFunc)
  396. {
  397. m_pHotGripFunc = pFunc;
  398. }
  399. inline GripOperationPtr
  400. AcDbGripData::hoverFunc() const
  401. {
  402. return m_pHoverFunc;
  403. }
  404. inline void
  405. AcDbGripData::setHoverFunc(GripOperationPtr pFunc)
  406. {
  407. m_pHoverFunc = pFunc;
  408. }
  409. inline GripRtClkHandler
  410. AcDbGripData::rtClk() const
  411. {
  412. return m_pRtClk.oldHandler;
  413. }
  414. inline void
  415. AcDbGripData::setRtClk(GripRtClkHandler pFunc)
  416. {
  417. m_bitFlags &= ~AcDbGripOperations::kGripRightClickIsNewStyle;
  418. m_pRtClk.oldHandler = pFunc;
  419. }
  420. inline GripRightClickHandler
  421. AcDbGripData::righClick() const
  422. {
  423. return m_pRtClk.newHandler;
  424. }
  425. inline void
  426. AcDbGripData::setRightClick(GripRightClickHandler pFunc)
  427. {
  428. m_bitFlags |= AcDbGripOperations::kGripRightClickIsNewStyle;
  429. m_pRtClk.newHandler = pFunc;
  430. }
  431. inline GripWorldDrawPtr
  432. AcDbGripData::worldDraw() const
  433. {
  434. return m_pWorldDraw;
  435. }
  436. inline void
  437. AcDbGripData::setWorldDraw(GripWorldDrawPtr pFunc)
  438. {
  439. m_pWorldDraw = pFunc;
  440. }
  441. inline GripViewportDrawPtr
  442. AcDbGripData::viewportDraw() const
  443. {
  444. return m_pViewportDraw;
  445. }
  446. inline void
  447. AcDbGripData::setViewportDraw(GripViewportDrawPtr pFunc)
  448. {
  449. m_pViewportDraw = pFunc;
  450. }
  451. inline GripOpStatusPtr
  452. AcDbGripData::gripOpStatFunc() const
  453. {
  454. return m_pGripOpStatFunc;
  455. }
  456. inline void
  457. AcDbGripData::setGripOpStatFunc(GripOpStatusPtr pFunc)
  458. {
  459. m_pGripOpStatFunc = pFunc;
  460. }
  461. inline GripToolTipPtr
  462. AcDbGripData::toolTipFunc() const
  463. {
  464. return m_pToolTipFunc;
  465. }
  466. inline void
  467. AcDbGripData::setToolTipFunc(GripToolTipPtr pFunc)
  468. {
  469. m_pToolTipFunc = pFunc;
  470. }
  471. inline GripDimensionPtr
  472. AcDbGripData::hoverDimensionFunc() const
  473. {
  474. return m_pHoverDimensionFunc;
  475. }
  476. inline void
  477. AcDbGripData::setHoverDimensionFunc(GripDimensionPtr pFunc)
  478. {
  479. m_pHoverDimensionFunc = pFunc;
  480. }
  481. inline GripDimensionPtr
  482. AcDbGripData::hotGripDimensionFunc() const
  483. {
  484. return m_pHotGripDimensionFunc;
  485. }
  486. inline void
  487. AcDbGripData::setHotGripDimensionFunc(GripDimensionPtr pFunc)
  488. {
  489. m_pHotGripDimensionFunc = pFunc;
  490. }
  491. inline AcGePoint3d*
  492. AcDbGripData::alternateBasePoint() const
  493. {
  494. return m_pAltBasePt;
  495. }
  496. inline void
  497. AcDbGripData::setAlternateBasePoint(AcGePoint3d* altBasePt)
  498. {
  499. m_pAltBasePt = altBasePt;
  500. }
  501. inline unsigned int
  502. AcDbGripData::bitFlags() const
  503. {
  504. return m_bitFlags;
  505. }
  506. inline void
  507. AcDbGripData::setBitFlags(unsigned int flags)
  508. {
  509. m_bitFlags = flags;
  510. }
  511. inline bool
  512. AcDbGripData::skipWhenShared() const
  513. {
  514. return !!(m_bitFlags & AcDbGripOperations::kSkipWhenShared);
  515. }
  516. inline void
  517. AcDbGripData::setSkipWhenShared(bool skip)
  518. {
  519. if (skip)
  520. m_bitFlags |= AcDbGripOperations::kSkipWhenShared;
  521. else
  522. m_bitFlags &= ~AcDbGripOperations::kSkipWhenShared;
  523. }
  524. inline bool
  525. AcDbGripData::isRubberBandLineDisabled() const
  526. {
  527. return !!(m_bitFlags & AcDbGripOperations::kDisableRubberBandLine);
  528. }
  529. inline void
  530. AcDbGripData::disableRubberBandLine(bool disable)
  531. {
  532. if (disable)
  533. m_bitFlags |= AcDbGripOperations::kDisableRubberBandLine;
  534. else
  535. m_bitFlags &= ~AcDbGripOperations::kDisableRubberBandLine;
  536. }
  537. inline bool
  538. AcDbGripData::areModeKeywordsDisabled() const
  539. {
  540. return !!(m_bitFlags & AcDbGripOperations::kDisableModeKeywords);
  541. }
  542. inline void
  543. AcDbGripData::disableModeKeywords(bool disable)
  544. {
  545. if (disable)
  546. m_bitFlags |= AcDbGripOperations::kDisableModeKeywords;
  547. else
  548. m_bitFlags &= ~AcDbGripOperations::kDisableModeKeywords;
  549. }
  550. inline bool
  551. AcDbGripData::drawAtDragImageGripPoint() const
  552. {
  553. return !!(m_bitFlags & AcDbGripOperations::kDrawAtDragImageGripPoint);
  554. }
  555. inline void
  556. AcDbGripData::setDrawAtDragImageGripPoint(bool atDragPoint)
  557. {
  558. if (atDragPoint)
  559. m_bitFlags |= AcDbGripOperations::kDrawAtDragImageGripPoint;
  560. else
  561. m_bitFlags &= ~AcDbGripOperations::kDrawAtDragImageGripPoint;
  562. }
  563. inline bool
  564. AcDbGripData::triggerGrip() const
  565. {
  566. return !!(m_bitFlags & AcDbGripOperations::kTriggerGrip);
  567. }
  568. inline void
  569. AcDbGripData::setTriggerGrip(bool trigger)
  570. {
  571. if (trigger)
  572. m_bitFlags |= AcDbGripOperations::kTriggerGrip
  573. | AcDbGripOperations::kSkipWhenShared;
  574. else
  575. m_bitFlags &= ~(AcDbGripOperations::kTriggerGrip
  576. | AcDbGripOperations::kSkipWhenShared);
  577. }
  578. inline GripInputPointPtr
  579. AcDbGripData::inputPointFunc() const
  580. {
  581. return m_pInputPointFunc;
  582. }
  583. inline void
  584. AcDbGripData::setInputPointFunc(GripInputPointPtr pFunc)
  585. {
  586. m_pInputPointFunc = pFunc;
  587. }
  588. inline bool
  589. AcDbGripData::forcedPickOn() const
  590. {
  591. return !!(m_bitFlags & AcDbGripOperations::kTurnOnForcedPick);
  592. }
  593. inline void
  594. AcDbGripData::setForcedPickOn(bool on)
  595. {
  596. if (on)
  597. m_bitFlags |= AcDbGripOperations::kTurnOnForcedPick;
  598. else
  599. m_bitFlags &= ~AcDbGripOperations::kTurnOnForcedPick;
  600. }
  601. inline bool
  602. AcDbGripData::mapGripHotToRtClk() const
  603. {
  604. return !!(m_bitFlags & AcDbGripOperations::kMapGripHotToRtClk);
  605. }
  606. inline void
  607. AcDbGripData::setMapGripHotToRtClk(bool on)
  608. {
  609. if (on)
  610. m_bitFlags |= AcDbGripOperations::kMapGripHotToRtClk;
  611. else
  612. m_bitFlags &= ~AcDbGripOperations::kMapGripHotToRtClk;
  613. }
  614. inline bool
  615. AcDbGripData::gizmosEnabled() const
  616. {
  617. return !!(m_bitFlags & AcDbGripOperations::kGizmosEnabled);
  618. }
  619. inline void
  620. AcDbGripData::setGizmosEnabled(bool on)
  621. {
  622. if (on)
  623. m_bitFlags |= AcDbGripOperations::kGizmosEnabled;
  624. else
  625. m_bitFlags &= ~AcDbGripOperations::kGizmosEnabled;
  626. }
  627. inline bool
  628. AcDbGripData::gripIsPerViewport() const
  629. {
  630. return !!(m_bitFlags & AcDbGripOperations::kGripIsPerViewport);
  631. }
  632. inline void
  633. AcDbGripData::setGripIsPerViewport(bool on)
  634. {
  635. if (on)
  636. m_bitFlags |= AcDbGripOperations::kGripIsPerViewport;
  637. else
  638. m_bitFlags &= ~AcDbGripOperations::kGripIsPerViewport;
  639. }
  640. inline bool
  641. AcDbGripData::gripIsDisabled() const
  642. {
  643. return !!(m_bitFlags & AcDbGripOperations::kGripIsDisabled);
  644. }
  645. inline void
  646. AcDbGripData::disableGrip(bool disable)
  647. {
  648. if (disable)
  649. m_bitFlags |= AcDbGripOperations::kGripIsDisabled;
  650. else
  651. m_bitFlags &= ~AcDbGripOperations::kGripIsDisabled;
  652. }
  653. inline bool
  654. AcDbGripData::gripRightClickIsNewStyle() const
  655. {
  656. return !!(m_bitFlags & AcDbGripOperations::kGripRightClickIsNewStyle);
  657. }
  658. inline GripCLIPromptPtr
  659. AcDbGripData::getCLIPromptFunc() const
  660. {
  661. return m_pCLIPromptFunc;
  662. }
  663. inline void
  664. AcDbGripData::setCLIPromptFunc(GripCLIPromptPtr pFunc)
  665. {
  666. m_pCLIPromptFunc = pFunc;
  667. }
  668. inline GripCLIDisplayStringPtr
  669. AcDbGripData::getCLIDisplayStringFunc() const
  670. {
  671. return m_pCLIDisplayStringFunc;
  672. }
  673. inline void
  674. AcDbGripData::setCLIDisplayStringFunc(GripCLIDisplayStringPtr pFunc)
  675. {
  676. m_pCLIDisplayStringFunc = pFunc;
  677. }
  678. #endif // AD_DBGRIP_H