gecspl2d.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 AcGeCubicSplineCurve2d - A mathematic
  14. // entity used to represent a 2d interpolation cubic-spline curve.
  15. //
  16. #ifndef AC_GECSPL2D_H
  17. #define AC_GECSPL2D_H
  18. class AcGePointOnCurve2d;
  19. class AcGeCurve2dIntersection;
  20. class AcGeInterval;
  21. class AcGePlane;
  22. #include "gesent2d.h"
  23. #include "gept2dar.h"
  24. #include "gevc2dar.h"
  25. #include "gevec2d.h"
  26. #include "gekvec.h"
  27. #pragma pack (push, 8)
  28. class
  29. GE_DLLEXPIMPORT
  30. AcGeCubicSplineCurve2d : public AcGeSplineEnt2d
  31. {
  32. public:
  33. AcGeCubicSplineCurve2d();
  34. AcGeCubicSplineCurve2d(const AcGeCubicSplineCurve2d& spline);
  35. // Construct a periodic cubic spline curve
  36. // Contract: the first fit point must be equal to the last fit point
  37. //
  38. AcGeCubicSplineCurve2d(const AcGePoint2dArray& fitPnts,
  39. const AcGeTol& tol = AcGeContext::gTol);
  40. // Construct a cubic spline curve with clamped end condition
  41. //
  42. AcGeCubicSplineCurve2d(const AcGePoint2dArray& fitPnts,
  43. const AcGeVector2d& startDeriv,
  44. const AcGeVector2d& endDeriv,
  45. const AcGeTol& tol = AcGeContext::gTol);
  46. // Construct a cubic spline approximating the curve
  47. //
  48. AcGeCubicSplineCurve2d(const AcGeCurve2d& curve,
  49. double epsilon = AcGeContext::gTol.equalPoint());
  50. // Construct a cubic spline curve with given fit points and 1st derivatives
  51. //
  52. AcGeCubicSplineCurve2d(const AcGeKnotVector& knots,
  53. const AcGePoint2dArray& fitPnts,
  54. const AcGeVector2dArray& firstDerivs,
  55. Adesk::Boolean isPeriodic = Adesk::kFalse );
  56. // Definition of spline
  57. //
  58. int numFitPoints () const;
  59. AcGePoint2d fitPointAt (int idx) const;
  60. AcGeCubicSplineCurve2d& setFitPointAt (int idx, const AcGePoint2d& point);
  61. AcGeVector2d firstDerivAt (int idx) const;
  62. AcGeCubicSplineCurve2d& setFirstDerivAt(int idx, const AcGeVector2d& deriv);
  63. // Assignment operator.
  64. //
  65. AcGeCubicSplineCurve2d& operator = (const AcGeCubicSplineCurve2d& spline);
  66. };
  67. #pragma pack (pop)
  68. #endif