dbelipse.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 AcDbEllipse class represents both a full ellipse and an elliptical
  16. // arc. The parametrization of the ellipse is the vector equation
  17. //
  18. // P(O) = A * cos(O) + B * sin(O)
  19. //
  20. // where A and B are the semi major and minor axes respectively.
  21. #ifndef GEOMENT_DBELIPSE_H
  22. #define GEOMENT_DBELIPSE_H
  23. #include "gegbl.h"
  24. #include "dbmain.h"
  25. #include "dbcurve.h"
  26. #pragma pack(push, 8)
  27. class AcDbEllipse: public AcDbCurve
  28. {
  29. public:
  30. AcDbEllipse();
  31. AcDbEllipse(const AcGePoint3d& center,
  32. const AcGeVector3d& unitNormal,
  33. const AcGeVector3d& majorAxis,
  34. double radiusRatio,
  35. double startAngle = 0.0,
  36. double endAngle = 6.28318530717958647692);
  37. virtual ~AcDbEllipse();
  38. ACDB_DECLARE_MEMBERS(AcDbEllipse);
  39. AcGePoint3d center() const;
  40. Acad::ErrorStatus setCenter(const AcGePoint3d& center);
  41. AcGeVector3d normal() const;
  42. AcGeVector3d majorAxis() const;
  43. AcGeVector3d minorAxis() const;
  44. ACDB_PORT double majorRadius() const;
  45. ACDB_PORT Acad::ErrorStatus setMajorRadius(double);
  46. ACDB_PORT double minorRadius() const;
  47. ACDB_PORT Acad::ErrorStatus setMinorRadius(double);
  48. double radiusRatio() const;
  49. Acad::ErrorStatus setRadiusRatio(double ratio);
  50. double startAngle() const;
  51. Acad::ErrorStatus setStartAngle(double startAngle);
  52. double endAngle() const;
  53. Acad::ErrorStatus setEndAngle(double endAngle);
  54. Acad::ErrorStatus setStartParam(double startParam);
  55. Acad::ErrorStatus setEndParam(double endParam);
  56. double paramAtAngle(double angle) const;
  57. double angleAtParam(double param) const;
  58. Acad::ErrorStatus get(AcGePoint3d& center, AcGeVector3d& unitNormal,
  59. AcGeVector3d& majorAxis, double& radiusRatio, double& startAngle,
  60. double& endAngle) const;
  61. Acad::ErrorStatus set(const AcGePoint3d& center,
  62. const AcGeVector3d& unitNormal, const AcGeVector3d& majorAxis,
  63. double radiusRatio, double startAngle = 0.0,
  64. double endAngle = 6.28318530717958647692);
  65. Adesk::Boolean isNull() const;
  66. DBCURVE_METHODS
  67. protected:
  68. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  69. };
  70. #pragma pack(pop)
  71. #endif