SpatiumLib
Geometry.h
Go to the documentation of this file.
1 /*
2  * Program: Spatium Library
3  *
4  * Copyright (C) Martijn Koopman
5  * All Rights Reserved
6  *
7  * This software is distributed WITHOUT ANY WARRANTY; without even
8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  * PURPOSE.
10  *
11  */
12 
13 #ifndef SPATIUMLIB_GEOM3D_GEOMETRY_H
14 #define SPATIUMLIB_GEOM3D_GEOMETRY_H
15 
16 namespace spatium {
17 namespace geom3d {
18 
19 class Point3;
20 class Vector3;
21 
29 class Geometry
30 {
31 public:
32  Geometry() = default;
33  virtual ~Geometry() = default;
34 
39  virtual double distanceTo(const Point3 &point) const = 0;
40 
45  virtual Point3 projectPoint(const Point3 &point) const = 0;
46 
53  virtual bool intersectLine(const Point3 &origin,
54  const Vector3 &direction,
55  Point3 &intersection) const = 0;
56 };
57 
58 } // namespace geom3d
59 } // namespace spatium
60 
61 #endif // SPATIUMLIB_GEOM3D_GEOMETRY_H
Vector in 3D space.
Definition: Vector3.h:25
Definition: Vector2.h:19
virtual double distanceTo(const Point3 &point) const =0
Compute Euclidean distance to point.
Point in 3D Cartesian space as homogeneous coordinates.
Definition: Point3.h:27
Abstract Geometry class.
Definition: Geometry.h:29
virtual Point3 projectPoint(const Point3 &point) const =0
Project point onto geometry.
virtual bool intersectLine(const Point3 &origin, const Vector3 &direction, Point3 &intersection) const =0
Intersect line with geometry.
virtual ~Geometry()=default