gelnsg2d.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. // DESCRIPTION:
  12. //
  13. // This file contains the class AcGeLinSeg2d - A mathematical entity
  14. // used to represent a 2d line segment
  15. #ifndef AC_GELNSG2D_H
  16. #define AC_GELNSG2D_H
  17. #include "geline2d.h"
  18. #pragma pack (push, 8)
  19. class
  20. GE_DLLEXPIMPORT
  21. AcGeLineSeg2d : public AcGeLinearEnt2d
  22. {
  23. public:
  24. AcGeLineSeg2d();
  25. AcGeLineSeg2d(const AcGeLineSeg2d& line);
  26. AcGeLineSeg2d(const AcGePoint2d& pnt1, const AcGePoint2d& pnt2);
  27. AcGeLineSeg2d(const AcGePoint2d& pnt, const AcGeVector2d& vec);
  28. // Set methods.
  29. //
  30. AcGeLineSeg2d& set(const AcGePoint2d& pnt, const AcGeVector2d& vec);
  31. AcGeLineSeg2d& set(const AcGePoint2d& pnt1, const AcGePoint2d& pnt2);
  32. AcGeLineSeg2d& set(const AcGeCurve2d& curve1,
  33. const AcGeCurve2d& curve2,
  34. double& param1, double& param2,
  35. Adesk::Boolean& success);
  36. AcGeLineSeg2d& set(const AcGeCurve2d& curve, const AcGePoint2d& point,
  37. double& param, Adesk::Boolean& success);
  38. // Bisector.
  39. //
  40. void getBisector(AcGeLine2d& line) const;
  41. // Barycentric combination of end points.
  42. //
  43. AcGePoint2d baryComb (double blendCoeff) const;
  44. // Definition of linear segment
  45. //
  46. AcGePoint2d startPoint () const;
  47. AcGePoint2d midPoint () const;
  48. AcGePoint2d endPoint () const;
  49. double length () const;
  50. double length (double fromParam, double toParam,
  51. double tol = AcGeContext::gTol.equalPoint())
  52. const;
  53. // Assignment operator.
  54. //
  55. AcGeLineSeg2d& operator = (const AcGeLineSeg2d& line);
  56. };
  57. #pragma pack (pop)
  58. #endif