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 protected:
24  virtual ~IPoint() {}
25 
26 public:
27  virtual double x() const = 0;
28  virtual double y() const = 0;
29  virtual double z() const = 0;
30 
31  virtual void x(double) = 0;
32  virtual void y(double) = 0;
33  virtual void z(double) = 0;
34 
35  virtual const double& operator[](int) const = 0;
36 };
37 
39 
40 DM_API bool equal2D(const IPoint &a, const IPoint &b);
41 DM_API bool equal2D(const IPoint &a, const IPoint &b, double eps);
42 
43 DM_API bool equal3D(const IPoint &a, const IPoint &b);
44 DM_API bool equal3D(const IPoint &a, const IPoint &b, double eps);
45 
46 DM_API double length2D(const IPoint &a, const IPoint &b);
47 DM_API double length3D(const IPoint &a, const IPoint &b);
48 
49 
50 DM_NAMESPACE_END
AddInfo layouts describe a set of attributes that can be attached to geometry objects.
Definition: IAddInfoLayout.hpp:20
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:98
3d point object
Definition: IPoint.hpp:14