gecylndr.h 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 implements the class AcGeCylinder, a representation for
  14. // a right circular cylinder. It is defined by its radius,
  15. // axis of symmetry, and the origin (a point on the axis). It
  16. // is generated by revolving a line parallel to the axis of symmetry,
  17. // at a distance of radius. The cylinder is paramterized as follows.
  18. // u is the angle of revolution, measured from the refAxis (an axis
  19. // perpendicular to the axis of symmetry). Right hand rule applied
  20. // along the direction of the axis of symmetry defines the positive
  21. // direction. For a closed cylinder, u defaults to [-PI, PI).
  22. // v parameter varies along the axis of symmetry. It is positive in
  23. // the direction of the axis of symmetry. v = 0 correspond to the
  24. // cross section containing the origin of the cylinder. v is
  25. // dimensionless. Its speed is determined by the initial radius
  26. // of the cylinder.
  27. // The surface is perodic in u with a period of 2PI.
  28. // [umin, umax] x [vmin, vmax] defines a four sided cylindrical
  29. // patch bounded by two straight lines (at umin and umax), and
  30. // two circular arcs (at vmin and vmax). Following constraints
  31. // apply to the definition of a cylindrical patch.
  32. // umin < umax and |umin - umax| <= 2PI.
  33. //
  34. #ifndef AC_GECYLNDR_H
  35. #define AC_GECYLNDR_H
  36. #include "gegbl.h"
  37. #include "gesurf.h"
  38. #include "gevec3d.h"
  39. #include "geintrvl.h"
  40. #include "gearc3d.h"
  41. #pragma pack (push, 8)
  42. class AcGeCircArc3d;
  43. class
  44. GX_DLLEXPIMPORT
  45. AcGeCylinder : public AcGeSurface
  46. {
  47. public:
  48. AcGeCylinder ();
  49. AcGeCylinder (double radius, const AcGePoint3d& origin,
  50. const AcGeVector3d& axisOfSymmetry);
  51. AcGeCylinder (double radius, const AcGePoint3d& origin,
  52. const AcGeVector3d& axisOfSymmetry,
  53. const AcGeVector3d& refAxis,
  54. const AcGeInterval& height,
  55. double startAngle, double endAngle);
  56. AcGeCylinder (const AcGeCylinder&);
  57. // Geometric properties.
  58. //
  59. double radius () const;
  60. AcGePoint3d origin () const;
  61. void getAngles (double& start, double& end) const;
  62. void getHeight (AcGeInterval& height) const;
  63. double heightAt (double u) const;
  64. AcGeVector3d axisOfSymmetry() const;
  65. AcGeVector3d refAxis () const;
  66. Adesk::Boolean isOuterNormal () const;
  67. Adesk::Boolean isClosed (const AcGeTol& tol = AcGeContext::gTol) const;
  68. AcGeCylinder& setRadius (double radius);
  69. AcGeCylinder& setAngles (double start, double end);
  70. AcGeCylinder& setHeight (const AcGeInterval& height);
  71. AcGeCylinder& set (double radius, const AcGePoint3d& origin,
  72. const AcGeVector3d& axisOfSym);
  73. AcGeCylinder& set (double radius, const AcGePoint3d& origin,
  74. const AcGeVector3d& axisOfSym,
  75. const AcGeVector3d& refAxis,
  76. const AcGeInterval& height,
  77. double startAngle, double endAngle);
  78. // Assignment operator.
  79. //
  80. AcGeCylinder& operator = (const AcGeCylinder& cylinder);
  81. // Intersection with a linear entity
  82. //
  83. Adesk::Boolean intersectWith (const AcGeLinearEnt3d& linEnt, int& intn,
  84. AcGePoint3d& p1, AcGePoint3d& p2,
  85. const AcGeTol& tol = AcGeContext::gTol) const;
  86. };
  87. #pragma pack (pop)
  88. #endif