|
Visual Computing Library
devel
|
The Plane class represent a 2D plane in 3D space. More...
#include <vclib/space/core/plane.h>
Public Types | |
| using | PointType = Point3< Scalar > |
| using | ScalarType = Scalar |
Public Member Functions | |
| template<typename S > | |
| auto | cast () const |
| void | deserialize (std::istream &is) |
| Deserializes the plane from the given input stream. | |
| const Point3< Scalar > & | direction () const |
| Returns the direction component of the plane. | |
| Point3< Scalar > | mirrorPoint (const Point3< Scalar > &p) const |
| Given a point, returns the point mirrored w.r.t. this plane. | |
| Scalar | offset () const |
| Returns the offset component of the plane. | |
| bool | operator!= (const Plane &p) const |
| bool | operator== (const Plane &p) const |
| Plane () | |
| Empty constructor. The plane is uninitialized. | |
| Plane (const Point3< Scalar > &direction, Scalar offset) | |
| Constructor of a plane given a direction and an offset. | |
| Plane (const Point3< Scalar > &p0, const Point3< Scalar > &normal) | |
| Constructor of a plane given a point lying to the plane and the normal of the plane. | |
| Plane (const Point3< Scalar > &p0, const Point3< Scalar > &p1, const Point3< Scalar > &p2) | |
| Constructor of a plane given three points. | |
| Point3< Scalar > | projectPoint (const Point3< Scalar > &p) const |
| Given a point, returns the point projected to this plane. | |
| void | serialize (std::ostream &os) const |
| Serializes the plane to the given output stream. | |
Static Public Attributes | |
| static constexpr bool | NORMED = NORM |
Private Attributes | |
| Point3< Scalar > | mDir |
| Scalar | mOffset |
The Plane class represent a 2D plane in 3D space.
This is the class for infinite planes in 3D space. A Plane is stored just as a Point3 and a scalar:
Just to be clear, given a point p on a plane it always holds: plane.direction().dot(p) == plane.offset()
A vcl::Plane, once initialized, cannot be changed.
|
inline |
Constructor of a plane given a direction and an offset.
| direction | |
| offset |
|
inline |
Constructor of a plane given a point lying to the plane and the normal of the plane.
| p0 | |
| normal |
|
inline |
Constructor of a plane given three points.
| p0 | |
| p1 | |
| p2 |
|
inline |
Deserializes the plane from the given input stream.
| [in] | is | The input stream. |
|
inline |
Returns the direction component of the plane.
|
inline |
Given a point, returns the point mirrored w.r.t. this plane.
| p |
|
inline |
Returns the offset component of the plane.
|
inline |
Given a point, returns the point projected to this plane.
| p |
|
inline |
Serializes the plane to the given output stream.
| [in] | os | The output stream. |