gearc3d.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. // DESCRIPTION:
  11. //
  12. // This file contains the class AcGeCircArc3d - A mathematical entity
  13. // used to represent a circular arc in 3-space.
  14. #ifndef AC_GEARC3D_H
  15. #define AC_GEARC3D_H
  16. #include "gecurv3d.h"
  17. #include "gevec3d.h"
  18. #include "gepnt3d.h"
  19. #include "geplane.h"
  20. #include "gegblabb.h"
  21. #pragma pack (push, 8)
  22. class AcGeLine3d;
  23. class AcGeCircArc2d;
  24. class AcGePlanarEnt;
  25. class
  26. GE_DLLEXPIMPORT
  27. AcGeCircArc3d : public AcGeCurve3d
  28. {
  29. public:
  30. AcGeCircArc3d();
  31. AcGeCircArc3d(const AcGeCircArc3d& arc);
  32. AcGeCircArc3d(const AcGePoint3d& cent,
  33. const AcGeVector3d& nrm, double radius);
  34. AcGeCircArc3d(const AcGePoint3d& cent, const AcGeVector3d& nrm,
  35. const AcGeVector3d& refVec, double radius,
  36. double startAngle, double endAngle);
  37. AcGeCircArc3d(const AcGePoint3d& startPoint, const AcGePoint3d& pnt, const AcGePoint3d& endPoint);
  38. // Return the point on this object that is closest to the other object.
  39. //
  40. AcGePoint3d closestPointToPlane (const AcGePlanarEnt& plane,
  41. AcGePoint3d& pointOnPlane,
  42. const AcGeTol& tol
  43. = AcGeContext::gTol) const;
  44. // Intersection with other geometric objects.
  45. //
  46. Adesk::Boolean intersectWith (const AcGeLinearEnt3d& line, int& intn,
  47. AcGePoint3d& p1, AcGePoint3d& p2,
  48. const AcGeTol& tol = AcGeContext::gTol) const;
  49. Adesk::Boolean intersectWith (const AcGeCircArc3d& arc, int& intn,
  50. AcGePoint3d& p1, AcGePoint3d& p2,
  51. const AcGeTol& tol = AcGeContext::gTol) const;
  52. Adesk::Boolean intersectWith (const AcGePlanarEnt& plane, int& numOfIntersect,
  53. AcGePoint3d& p1, AcGePoint3d& p2,
  54. const AcGeTol& tol = AcGeContext::gTol) const;
  55. // Projection-intersection with other geometric objects.
  56. Adesk::Boolean projIntersectWith (const AcGeLinearEnt3d& line,
  57. const AcGeVector3d& projDir, int& numInt,
  58. AcGePoint3d& pntOnArc1,
  59. AcGePoint3d& pntOnArc2,
  60. AcGePoint3d& pntOnLine1,
  61. AcGePoint3d& pntOnLine2,
  62. const AcGeTol& tol = AcGeContext::gTol) const;
  63. // Tangent to the circular arc.
  64. //
  65. Adesk::Boolean tangent (const AcGePoint3d& pnt, AcGeLine3d& line,
  66. const AcGeTol& tol = AcGeContext::gTol) const;
  67. Adesk::Boolean tangent (const AcGePoint3d& pnt, AcGeLine3d& line,
  68. const AcGeTol& tol, AcGeError& error) const;
  69. // Possible error conditions: kArg1TooBig, kArg1InsideThis,
  70. // kArg1OnThis, kThisIsInfiniteLine
  71. // Plane of the arc
  72. //
  73. void getPlane (AcGePlane& plane) const;
  74. // Test if point is inside circle.
  75. //
  76. Adesk::Boolean isInside (const AcGePoint3d& pnt,
  77. const AcGeTol& tol = AcGeContext::gTol) const;
  78. // Definition of circular arc
  79. //
  80. AcGePoint3d center () const;
  81. AcGeVector3d normal () const;
  82. AcGeVector3d refVec () const;
  83. double radius () const;
  84. double startAng () const;
  85. double endAng () const;
  86. AcGePoint3d startPoint () const;
  87. AcGePoint3d endPoint () const;
  88. AcGeCircArc3d& setCenter (const AcGePoint3d&);
  89. AcGeCircArc3d& setAxes (const AcGeVector3d& normal,
  90. const AcGeVector3d& refVec);
  91. AcGeCircArc3d& setRadius (double);
  92. AcGeCircArc3d& setAngles (double startAngle, double endAngle);
  93. AcGeCircArc3d& set (const AcGePoint3d& cent,
  94. const AcGeVector3d& nrm, double radius);
  95. AcGeCircArc3d& set (const AcGePoint3d& cent,
  96. const AcGeVector3d& nrm,
  97. const AcGeVector3d& refVec, double radius,
  98. double startAngle, double endAngle);
  99. AcGeCircArc3d& set (const AcGePoint3d& startPoint, const AcGePoint3d& pnt,
  100. const AcGePoint3d& endPoint);
  101. AcGeCircArc3d& set (const AcGePoint3d& startPoint, const AcGePoint3d& pnt,
  102. const AcGePoint3d& endPoint, AcGeError& error);
  103. // Possible errors: kEqualArg1Arg2, kEqualArg1Arg3, kEqualArg2Arg3,
  104. // kLinearlyDependentArg1Arg2Arg3.
  105. // Degenerate results: none.
  106. // On error, the object is unchanged.
  107. AcGeCircArc3d& set (const AcGeCurve3d& curve1,
  108. const AcGeCurve3d& curve2,
  109. double radius, double& param1, double& param2,
  110. Adesk::Boolean& success);
  111. // On success, this arc becomes the fillet of the given radius between the two curves,
  112. // whose points of tangency are nearest param1 and param2 respectively.
  113. AcGeCircArc3d& set (const AcGeCurve3d& curve1,
  114. const AcGeCurve3d& curve2,
  115. const AcGeCurve3d& curve3,
  116. double& param1, double& param2, double& param3,
  117. Adesk::Boolean& success);
  118. // Assignment operator.
  119. //
  120. AcGeCircArc3d& operator = (const AcGeCircArc3d& arc);
  121. };
  122. #pragma pack (pop)
  123. #endif