Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
plane.hpp
1 #ifndef SCENEVIEW_PLANE_HPP__
2 #define SCENEVIEW_PLANE_HPP__
3 
4 #include <QVector3D>
5 
6 namespace sv {
7 
26 class Plane {
27  public:
31  Plane();
32 
38  Plane(float a, float b, float c, float d);
39 
45  Plane(const QVector3D& normal, float d);
46 
61  static Plane FromThreePoints(const QVector3D& p1, const QVector3D& p2,
62  const QVector3D& p3);
63 
78  float SignedDistance(const QVector3D& point) const;
79 
83  const QVector3D& Normal() const { return normal_; }
84 
88  float D() const { return d_; }
89 
90  private:
91  QVector3D normal_;
92  float d_;
93 };
94 
95 } // namespace sv
96 
97 #endif // SCENEVIEW_PLANE_HPP__
A 3D plane.
Definition: plane.hpp:26
const QVector3D & Normal() const
Returns the plane's normal vector .
Definition: plane.hpp:83
static Plane FromThreePoints(const QVector3D &p1, const QVector3D &p2, const QVector3D &p3)
Create a plane from three points.
float D() const
Returns the plane's d parameter.
Definition: plane.hpp:88
Plane()
Construct an invalid plane with zero coefficients.
float SignedDistance(const QVector3D &point) const
Computes the signed distance of a point from the plane.