dbSweepOptions.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. //
  13. // DESCRIPTION:
  14. //
  15. // The AcDbSweepOptions class is used for setting options that are
  16. // passed to createSweptSurface() and sweepFace().
  17. #pragma once
  18. #ifndef DBSWEEPOPTIONS_H
  19. #define DBSWEEPOPTIONS_H
  20. #include "dbmain.h"
  21. #include "dbsubeid.h"
  22. #include "gepnt3d.h"
  23. #include "gevec3d.h"
  24. #include "dbbody.h"
  25. #pragma pack(push, 8)
  26. // Utility class for setting options used by createSweptSurface().
  27. class AcDbSweepOptions
  28. {
  29. public:
  30. AcDbSweepOptions ();
  31. AcDbSweepOptions ( const AcDbSweepOptions& src );
  32. ~AcDbSweepOptions ();
  33. // Assignment operator.
  34. AcDbSweepOptions& operator = ( const AcDbSweepOptions& src );
  35. bool operator == (const AcDbSweepOptions&) const;
  36. enum AlignOption {
  37. kNoAlignment,
  38. kAlignSweepEntityToPath,
  39. kTranslateSweepEntityToPath,
  40. kTranslatePathToSweepEntity
  41. };
  42. enum MiterOption {
  43. kDefaultMiter,
  44. kOldMiter,
  45. kNewMiter,
  46. kCrimpMiter,
  47. kBendMiter
  48. };
  49. // Get/set draft angle.
  50. double draftAngle () const;
  51. void setDraftAngle ( double ang );
  52. // Get/set start draft distance.
  53. double startDraftDist () const;
  54. void setStartDraftDist ( double val );
  55. // Get/set end draft distance.
  56. double endDraftDist () const;
  57. void setEndDraftDist ( double val );
  58. // Get/set twist angle.
  59. double twistAngle () const;
  60. void setTwistAngle ( double ang );
  61. // Get/set scale factor.
  62. double scaleFactor () const;
  63. void setScaleFactor ( double val );
  64. // Get/set align angle.
  65. double alignAngle () const;
  66. void setAlignAngle ( double ang );
  67. // Get/set align option.
  68. AcDbSweepOptions::AlignOption align () const;
  69. void setAlign ( AcDbSweepOptions::AlignOption val );
  70. // Get/set miter option.
  71. AcDbSweepOptions::MiterOption miterOption () const;
  72. void setMiterOption ( AcDbSweepOptions::MiterOption val );
  73. // Get/set whether to align to start or end of curve.
  74. bool alignStart () const;
  75. void setAlignStart ( bool val );
  76. // Get/set base point for alignment.
  77. AcGePoint3d basePoint () const;
  78. void setBasePoint ( AcGePoint3d& pnt );
  79. // Get/set bank option.
  80. bool bank () const;
  81. void setBank ( bool val );
  82. // Get/set self-intersection check option.
  83. // Warning: turning off this check may result in the creation of
  84. // a self-intersecting surface or solid.
  85. bool checkIntersections () const;
  86. void setCheckIntersections ( bool val );
  87. // Get/set reference vector for controlling twist.
  88. AcGeVector3d twistRefVec () const;
  89. void setTwistRefVec ( const AcGeVector3d& vec );
  90. // Get/set coordinate system for sweep entity.
  91. bool getSweepEntityTransform ( AcGeMatrix3d& mat );
  92. void setSweepEntityTransform ( AcGeMatrix3d& mat );
  93. Acad::ErrorStatus setSweepEntityTransform ( AcArray<AcDbEntity*>& sweepEntities,
  94. bool displayErrorMessages = false );
  95. // Get/set coordinate system at start/end of path curve. If path entity transform is
  96. // computed from the path entity geometry (by calling the second
  97. // setPathEntityTransform() below), then the sweep entity transform should be
  98. // set before making this call.
  99. bool getPathEntityTransform ( AcGeMatrix3d& mat );
  100. void setPathEntityTransform ( AcGeMatrix3d& mat );
  101. Acad::ErrorStatus setPathEntityTransform ( AcDbEntity *pPathEnt,
  102. bool displayErrorMessages = false );
  103. // Check for valid sweep entity. Returns planarity of input entity.
  104. // If planarity is kPlanar, then pnt and vec will be set to a point on the
  105. // plane and the plane normal of the entity. If planarity is kLinear, then
  106. // pnt and vec will be set to a point on the line and the line direction of
  107. // the entity.
  108. Acad::ErrorStatus checkSweepCurve ( AcDbEntity *pSweepEnt,
  109. AcDb::Planarity& planarity, AcGePoint3d& pnt, AcGeVector3d& vec,
  110. bool& closed, double& approxArcLen, bool displayErrorMessages = false );
  111. // Check for valid path entity.
  112. Acad::ErrorStatus checkPathCurve ( AcDbEntity *pPathEnt,
  113. bool displayErrorMessages = false );
  114. private:
  115. void *mpImpSweepOptions;
  116. friend class AcDbImpSweepOptions;
  117. };
  118. #pragma pack(pop)
  119. #endif // DBSWEEPOPTIONS_H