IPoint.hpp
1 #pragma once
2 
3 #include "DM/config.hpp"
4 #include "DM/IAddInfoLayout.hpp"
5 #include "DM/Handle.hpp"
6 #include "DM/IGeometry.hpp"
7 #include "DM/IAddInfo.hpp"
8 #include "DM/IAddInfoContainer.hpp"
9 #include "DM/AutoLink.hpp" //enable autolink
10 
11 DM_NAMESPACE_BEGIN
12 
13 /// \brief 3d point object
14 class DM_API IPoint : public IGeometry, public IAddInfoContainer
15 {
16 public:
17  static IPoint* New();
18  static IPoint* New(const IAddInfoLayout &layout);
19  static IPoint* New(double x, double y);
20  static IPoint* New(double x, double y, double z);
21  static IPoint* New(double x, double y, double z, const IAddInfoLayout &layout);
22 
23  IPoint* clone() const override = 0;
24 
25 protected:
26  virtual ~IPoint() {}
27 
28 public:
29  virtual double x() const = 0;
30  virtual double y() const = 0;
31  virtual double z() const = 0;
32 
33  virtual void x(double) = 0;
34  virtual void y(double) = 0;
35  virtual void z(double) = 0;
36 
37  virtual const double& operator[](int) const = 0;
38 };
39 
41 
42 DM_API bool equal2D(const IPoint &a, const IPoint &b);
43 DM_API bool equal2D(const IPoint &a, const IPoint &b, double eps);
44 
45 DM_API bool equal3D(const IPoint &a, const IPoint &b);
46 DM_API bool equal3D(const IPoint &a, const IPoint &b, double eps);
47 
48 DM_API double length2D(const IPoint &a, const IPoint &b);
49 DM_API double length3D(const IPoint &a, const IPoint &b);
50 
51 
52 DM_NAMESPACE_END
virtual IGeometry * clone() const =0
get an object copy
AddInfo layouts describe a set of attributes that can be attached to geometry objects.
Definition: IAddInfoLayout.hpp:18
Interface of an add info container object (used by geometry objects)
Definition: IAddInfoContainer.hpp:14
Base class of all geometry objects.
Definition: IGeometry.hpp:26
Smart pointer class using reference counting with support for DM objects (see ObjectBase)
Definition: Handle.hpp:75
3d point object
Definition: IPoint.hpp:14