dbjig.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. //
  12. // DESCRIPTION:
  13. // Definition of class AcEdJig, an object onto which you clamp an
  14. // AcDbEntity while bending it into shape. Comes with slots for a
  15. // few standard dragging attachments and a built-in tool or two.
  16. //
  17. #ifndef _DBJIG_H_
  18. #define _DBJIG_H_ 1
  19. #if defined(__cplusplus)
  20. #ifndef _AD_ACDB_H
  21. #include "acdb.h"
  22. #endif
  23. #include "dbdimdata.h" // for dynamic dimensions
  24. #pragma pack (push, 8)
  25. class AcEdImpJig;
  26. class AcDbEntity;
  27. class AcEdImpDragStyle;
  28. class AcGiVisualStyle;
  29. class AcEdDragStyle;
  30. class AcEdJig: public AcRxObject
  31. {
  32. public:
  33. ACRX_DECLARE_MEMBERS(AcEdJig);
  34. enum UserInputControls {
  35. kGovernedByOrthoMode = 0x000001,
  36. kNullResponseAccepted = 0x000002,
  37. kDontEchoCancelForCtrlC = 0x000004,
  38. kDontUpdateLastPoint = 0x000008,
  39. kNoDwgLimitsChecking = 0x000010,
  40. kNoZeroResponseAccepted = 0x000020,
  41. kNoNegativeResponseAccepted = 0x000040,
  42. kAccept3dCoordinates = 0x000080,
  43. kAcceptMouseUpAsPoint = 0x000100,
  44. kAnyBlankTerminatesInput = 0x000200,
  45. kInitialBlankTerminatesInput = 0x000400,
  46. kAcceptOtherInputString = 0x000800,
  47. kGovernedByUCSDetect = 0x001000,
  48. kNoZDirectionOrtho = 0x002000,
  49. kImpliedFaceForUCSChange = 0x004000,
  50. kUseBasePointElevation = 0x008000,
  51. ///<summary> Disables direct distance input. When this flag is ON a
  52. ///distance input such as integer or real will not be accepted unless
  53. ///kAcceptOtherInputString is ON, in that case returned DragStatus is
  54. ///kOther. </summary>
  55. kDisableDirectDistanceInput = 0x010000,
  56. };
  57. enum DragStatus {
  58. kModeless = -17,
  59. kNoChange = -6,
  60. kCancel = -4,
  61. kOther = -3,
  62. kNull = -1,
  63. kNormal = 0,
  64. kKW1,
  65. kKW2,
  66. kKW3,
  67. kKW4,
  68. kKW5,
  69. kKW6,
  70. kKW7,
  71. kKW8,
  72. kKW9
  73. };
  74. enum CursorType {
  75. kNoSpecialCursor = -1, // No Special Cursor Specified
  76. kCrosshair = 0, // Full Screen Cross Hair.
  77. kRectCursor, // Rectangular cursor.
  78. kRubberBand, // Rubber band line.
  79. kNotRotated, // NotRotated Type.
  80. kTargetBox, // Target Box Type.
  81. kRotatedCrosshair, // Rotated Crosshair w/ rubber band.
  82. kCrosshairNoRotate, // Crosshairs forced non-rotated.
  83. kInvisible, // Invisible cursor.
  84. kEntitySelect, // Entity selection target cursor.
  85. kParallelogram, // Parallelogram cursor.
  86. kEntitySelectNoPersp, // Pickbox, suppressed in persp.
  87. kPkfirstOrGrips, // Auto-select cursor.
  88. kCrosshairDashed // 15 dashed style crosshair cursor
  89. };
  90. AcEdJig();
  91. virtual ~AcEdJig();
  92. DragStatus drag();
  93. ACCORE_PORT DragStatus drag ( const AcEdDragStyle& style );
  94. virtual DragStatus sampler();
  95. virtual Adesk::Boolean update();
  96. AcDbObjectId append();
  97. const ACHAR* keywordList();
  98. void setKeywordList(const ACHAR*);
  99. const ACHAR* dispPrompt();
  100. void setDispPrompt(const ACHAR*, ...);
  101. ACCORE_PORT DragStatus acquireString(ACHAR (&str)[2049]);
  102. DragStatus acquireAngle(double &ang);
  103. DragStatus acquireAngle(double &ang, const AcGePoint3d& basePnt);
  104. DragStatus acquireDist(double &dist);
  105. DragStatus acquireDist(double &dist, const AcGePoint3d& basePnt);
  106. DragStatus acquirePoint(AcGePoint3d&);
  107. DragStatus acquirePoint(AcGePoint3d&, const AcGePoint3d&basePnt);
  108. AcEdJig::CursorType specialCursorType();
  109. void setSpecialCursorType(CursorType);
  110. AcEdJig::UserInputControls userInputControls();
  111. void setUserInputControls(AcEdJig::UserInputControls);
  112. virtual AcDbEntity* entity() const;
  113. virtual AcDbDimDataPtrArray * dimData(const double dimScale);
  114. virtual Acad::ErrorStatus setDimValue(const AcDbDimData* dimData,
  115. const double dimValue);
  116. private:
  117. AcEdImpJig* mpImpJig;
  118. };
  119. /// <summary>
  120. /// This class allows clients to define the visual styles for both the original and the
  121. /// dragged entity during a drag operation. The client can define the visual style by
  122. /// either explicitly specifying the AcGiVisualStyle or by specifying a pre-set type
  123. /// that is used to set the AcGiVisualStyle.
  124. /// </summary>
  125. class ACCORE_PORT AcEdDragStyle
  126. {
  127. public:
  128. /// <summary>
  129. /// Enumeration controlling the graphics representation of the drag entity during dragging process.
  130. /// </summary>
  131. enum StyleType
  132. {
  133. /// <summary> Dragger will not modify the entity's visual style during drag. </summary>
  134. kNone = 0,
  135. /// <summary> Entity will be hidden during drag. </summary>
  136. kHide,
  137. /// <summary> The dragger will apply 25% transparency to entity. </summary>
  138. kTransparent25,
  139. /// <summary> The dragger will apply 75% transparency to entity. </summary>
  140. kTransparent75,
  141. /// <summary> The dragger will apply the deletion effect to entity. </summary>
  142. kDeletedEffect,
  143. /// <summary> The dragger will apply highlight effect to entity. </summary>
  144. kHighlight,
  145. /// <summary> Style was set by client calling setVisualStyle(). </summary>
  146. kNotSet
  147. };
  148. /// <summary> Default constructor. The entity will be displayed in its default visual
  149. /// style. This is equivalent to setting the style type to kNone. </summary>
  150. AcEdDragStyle ();
  151. /// <summary> Construct by specifying style types for original and dragged entity. </summary>
  152. AcEdDragStyle ( StyleType styleTypeForOriginal, StyleType styleTypeForDragged );
  153. /// <summary> Copy constructor. </summary>
  154. AcEdDragStyle ( const AcEdDragStyle& dragStyle );
  155. /// <summary> Destructor. </summary>
  156. ~AcEdDragStyle ();
  157. /// <summary> Return the style type that was used to define the original entity's visual style.</summary>
  158. /// <returns> StyleType enum value that was used to define the original entity's visual style.</returns>
  159. StyleType styleTypeForOriginal () const;
  160. /// <summary> Return the style type that was used to define the dragged entity's visual style.</summary>
  161. /// <returns> StyleType enum value that was used to define the dragged entity's visual style.</returns>
  162. StyleType styleTypeForDragged () const;
  163. /// <summary> Set the original entity's visual style by specifying a style type. </summary>
  164. /// <param name="styleType"> Style type for the original entity.</param>
  165. /// <returns> eOk if sucessful.</returns>
  166. Acad::ErrorStatus setStyleTypeForOriginal ( StyleType styleType );
  167. /// <summary> Set the dragged entity's visual style by specifying a style type. </summary>
  168. /// <param name="styleType"> Style type for the dragged entity.</param>
  169. /// <returns> eOk if sucessful.</returns>
  170. Acad::ErrorStatus setStyleTypeForDragged ( StyleType styleType );
  171. /// <summary> Assignment operator. </summary>
  172. AcEdDragStyle& operator = ( const AcEdDragStyle& src );
  173. /// <summary> Test equality</summary>
  174. bool operator == ( const AcEdDragStyle& other ) const;
  175. bool operator != ( const AcEdDragStyle& other ) const;
  176. private:
  177. AcEdImpDragStyle *mpOriginalDragStyle;
  178. AcEdImpDragStyle *mpDraggedDragStyle;
  179. friend class AcEdImpDragStyle;
  180. };
  181. #pragma pack (pop)
  182. #endif // cplusplus
  183. #endif