AcEdViewCube.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // Name: AcEdViewCube.h
  12. //
  13. // Description:
  14. //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #ifndef __ACEDVIEWCUBE_H__
  17. #define __ACEDVIEWCUBE_H__
  18. #pragma once
  19. class AcDbUcsPlane;
  20. class AcDbHomeView;
  21. class AcEdViewCube;
  22. class AcEdViewCubeReactor;
  23. ///////////////////////////////////////////////////////////////////////////////
  24. // Parts of the ViewCube
  25. //
  26. enum AcEdViewCubePart
  27. {
  28. FACE_FRONT = 0,
  29. FACE_BACK,
  30. FACE_BOTTOM,
  31. FACE_TOP,
  32. FACE_LEFT,
  33. FACE_RIGHT,
  34. EDGE_FRONT_BOTTOM,
  35. EDGE_FRONT_TOP,
  36. EDGE_BACK_BOTTOM,
  37. EDGE_BACK_TOP,
  38. EDGE_LEFT_BOTTOM,
  39. EDGE_RIGHT_BOTTOM,
  40. EDGE_LEFT_TOP,
  41. EDGE_RIGHT_TOP,
  42. EDGE_FRONT_LEFT,
  43. EDGE_BACK_LEFT,
  44. EDGE_FRONT_RIGHT,
  45. EDGE_BACK_RIGHT,
  46. CORNER_FRONT_LEFT_BOTTOM,
  47. CORNER_FRONT_RIGHT_BOTTOM,
  48. CORNER_FRONT_LEFT_TOP,
  49. CORNER_FRONT_RIGHT_TOP,
  50. CORNER_BACK_LEFT_BOTTOM,
  51. CORNER_BACK_RIGHT_BOTTOM,
  52. CORNER_BACK_LEFT_TOP,
  53. CORNER_BACK_RIGHT_TOP,
  54. ARROW_FRONT,
  55. ARROW_BACK,
  56. ARROW_BOTTOM,
  57. ARROW_TOP,
  58. ARROW_LEFT,
  59. ARROW_RIGHT,
  60. BUTTON_ROTATE_CCW,
  61. BUTTON_ROTATE_CW,
  62. BUTTON_HOME,
  63. BUTTON_LOCK,
  64. BUTTON_MENU,
  65. COMPASS_EAST,
  66. COMPASS_WEST,
  67. COMPASS_SOUTH,
  68. COMPASS_NORTH,
  69. COMPASS_RING
  70. };
  71. ///////////////////////////////////////////////////////////////////////////////
  72. // Create the ViewCube instance for a specify GS view
  73. //
  74. AcEdViewCube* acedCreateViewCube(AcGsView* pGsView);
  75. ///////////////////////////////////////////////////////////////////////////////
  76. // Destroy the ViewCube
  77. //
  78. void acedDestroyViewCube(AcEdViewCube* pCube);
  79. ///////////////////////////////////////////////////////////////////////////////
  80. // Interface AcEdViewCube
  81. //
  82. class AcEdViewCube
  83. {
  84. public:
  85. virtual AcGiDrawable* getDrawable () const = 0;
  86. virtual AcGsView* getView () const = 0;
  87. virtual AcGsModel* getModel () const = 0;
  88. virtual void redraw () const = 0;
  89. virtual bool isMouseInRegion () const = 0;
  90. virtual HWND getDeviceHandle () const = 0;
  91. virtual bool isVisible () const = 0;
  92. virtual bool isEnable () const = 0;
  93. virtual bool isOverride () const = 0;
  94. virtual int getLocation () const = 0;
  95. virtual int getSize () const = 0;
  96. virtual int getMinOpacity () const = 0;
  97. virtual int getTransitionDuration () const = 0;
  98. virtual bool getOrientToUCS () const = 0;
  99. virtual bool getDragSnap () const = 0;
  100. virtual bool getZoomToFitScene () const = 0;
  101. virtual bool getPreserveSceneUp () const = 0;
  102. virtual bool getDrawCompass () const = 0;
  103. virtual bool getDrawUCSMenu () const = 0;
  104. virtual bool getPerspWithOrtho () const = 0;
  105. virtual const AcDbHomeView& getHomeCamera () const = 0;
  106. virtual const AcGeVector3d& getSceneUpDirection () const = 0;
  107. virtual const AcGeVector3d& getSceneFrontDirection () const = 0;
  108. virtual const AcDbUcsPlane& getUCSPlane () const = 0;
  109. virtual void setDeviceHandle (HWND hDevice) = 0;
  110. virtual void setVisible (bool bVisible) = 0;
  111. virtual void setEnable (bool bEnable) = 0;
  112. virtual void setOverride (bool bOverride) = 0;
  113. virtual void setLocation (int nLocation) = 0;
  114. virtual void setSize (int nSize) = 0;
  115. virtual void setMinOpacity (int nMinOpacity) = 0;
  116. virtual void setTransitionDuration (int nTransitionDuration) = 0;
  117. virtual void setOrientToUCS (bool bOrientToUCS) = 0;
  118. virtual void setDragSnap (bool bDragSnap) = 0;
  119. virtual void setZoomToFitScene (bool bZoomToFitScene) = 0;
  120. virtual void setPreserveSceneUp (bool bPreserveSceneUp) = 0;
  121. virtual void setDrawCompass (bool bDrawCompass) = 0;
  122. virtual void setDrawUCSMenu (bool bDrawUCSMenu) = 0;
  123. virtual void setPerspWithOrtho (bool bPerspWithOrtho) = 0;
  124. virtual void setHomeCamera (const AcDbHomeView& home) = 0;
  125. virtual void setSceneUpDirection (const AcGeVector3d& up) = 0;
  126. virtual void setSceneFrontDirection (const AcGeVector3d& front) = 0;
  127. virtual void setUCSPlane (const AcDbUcsPlane& ucs) = 0;
  128. virtual void onLButtonDown (UINT nFlags, POINT pt) = 0;
  129. virtual void onLButtonUp (UINT nFlags, POINT pt) = 0;
  130. virtual void onMouseMove (UINT nFlags, POINT pt) = 0;
  131. virtual bool attachView (AcGsView* pGsView) = 0;
  132. virtual AcGsView* detachView () = 0;
  133. virtual void addReactor (AcEdViewCubeReactor* pReactor) = 0;
  134. virtual void removeReactor (AcEdViewCubeReactor* pReactor) = 0;
  135. virtual void goToHomeView () = 0;
  136. virtual AcEdViewCubePart getActivePart () const = 0;
  137. };
  138. ///////////////////////////////////////////////////////////////////////////////
  139. // Interface AcEdViewCubeReactor
  140. //
  141. class AcEdViewCubeReactor
  142. {
  143. public:
  144. virtual void onClicked (AcEdViewCube* pCube, AcEdViewCubePart part) = 0;
  145. virtual void onDragBegin (AcEdViewCube* pCube, AcEdViewCubePart part) = 0;
  146. virtual void onDragEnd (AcEdViewCube* pCube) = 0;
  147. };
  148. #endif // __ACEDVIEWCUBE_H__