geent2d.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 GeEntity2d - An abstract base class
  14. // for all Geometry Library 2d entities.
  15. #ifndef AC_GEENT2D_H
  16. #define AC_GEENT2D_H
  17. #include "gegbl.h"
  18. #include "gepnt2d.h"
  19. #include "geintrvl.h"
  20. #include "gegblnew.h"
  21. #pragma pack (push, 8)
  22. class
  23. GE_DLLEXPIMPORT
  24. AcGeEntity2d
  25. {
  26. public:
  27. ~AcGeEntity2d();
  28. // Run time type information.
  29. //
  30. Adesk::Boolean isKindOf (AcGe::EntityId entType) const;
  31. AcGe::EntityId type () const;
  32. // Make a copy of the entity.
  33. //
  34. AcGeEntity2d* copy () const;
  35. AcGeEntity2d& operator = (const AcGeEntity2d& entity);
  36. // Equivalence
  37. //
  38. Adesk::Boolean operator == (const AcGeEntity2d& entity) const;
  39. Adesk::Boolean operator != (const AcGeEntity2d& entity) const;
  40. Adesk::Boolean isEqualTo (const AcGeEntity2d& entity,
  41. const AcGeTol& tol = AcGeContext::gTol) const;
  42. // Matrix multiplication
  43. //
  44. AcGeEntity2d& transformBy (const AcGeMatrix2d& xfm);
  45. AcGeEntity2d& translateBy (const AcGeVector2d& translateVec);
  46. AcGeEntity2d& rotateBy (double angle, const AcGePoint2d& wrtPoint
  47. = AcGePoint2d::kOrigin);
  48. AcGeEntity2d& mirror (const AcGeLine2d& line);
  49. AcGeEntity2d& scaleBy (double scaleFactor,
  50. const AcGePoint2d& wrtPoint
  51. = AcGePoint2d::kOrigin);
  52. // Point containment
  53. //
  54. Adesk::Boolean isOn (const AcGePoint2d& pnt,
  55. const AcGeTol& tol = AcGeContext::gTol) const;
  56. protected:
  57. friend class AcGeEntity3d;
  58. friend class AcGeImpEntity3d;
  59. class AcGeImpEntity3d* mpImpEnt;
  60. int mDelEnt;
  61. AcGeEntity2d ();
  62. AcGeEntity2d (const AcGeEntity2d&);
  63. AcGeEntity2d (AcGeImpEntity3d&, int);
  64. AcGeEntity2d (AcGeImpEntity3d*);
  65. AcGeEntity2d* newEntity2d (AcGeImpEntity3d*) const;
  66. };
  67. inline AcGeEntity2d*
  68. AcGeEntity2d::newEntity2d (AcGeImpEntity3d *impEnt ) const
  69. {
  70. return GENEWLOC( AcGeEntity2d, this) ( impEnt );
  71. }
  72. #pragma pack (pop)
  73. #endif