24 #ifndef PXR_BASE_GF_PLANE_H
25 #define PXR_BASE_GF_PLANE_H
32 #include "pxr/base/gf/api.h"
36 PXR_NAMESPACE_OPEN_SCOPE
64 Set(normal, distanceToOrigin);
91 void Set(
const GfVec3d &normal,
double distanceToOrigin) {
92 _normal = normal.GetNormalized();
93 _distance = distanceToOrigin;
134 return (_normal == p._normal &&
135 _distance == p._distance);
141 return ! (*
this == p);
148 return p * _normal - _distance;
165 _distance = -_distance;
213 PXR_NAMESPACE_CLOSE_SCOPE
215 #endif // PXR_BASE_GF_PLANE_H
GfPlane(const GfVec3d &normal, const GfVec3d &point)
This constructor sets this to the plane perpendicular to normal and that passes through point...
Basic type: 3-dimensional floating point range.
GF_API bool GfFitPlaneToPoints(const std::vector< GfVec3d > &points, GfPlane *fitPlane)
Fits a plane to the given points.
GfPlane(const GfVec3d &normal, double distanceToOrigin)
This constructor sets this to the plane perpendicular to normal and at distance units from the origin...
double GetDistanceFromOrigin() const
Returns the distance of the plane from the origin.
GfPlane(const GfVec4d &eqn)
This constructor creates a plane given by the equation eqn[0] * x + eqn[1] * y + eqn[2] * z + eqn[3] ...
Basic type for a vector of 4 double components.
GF_API bool IntersectsPositiveHalfSpace(const GfRange3d &box) const
Returns true if the given aligned bounding box is at least partially on the positive side (the one th...
Basic type: 3-dimensional plane.
bool IntersectsPositiveHalfSpace(const GfVec3d &pt) const
Returns true if the given point is on the plane or within its positive half space.
Stores a 4x4 matrix of double elements.
void Reorient(const GfVec3d &p)
Flip the plane normal (if necessary) so that p is in the positive halfspace.
bool operator!=(const GfPlane &p) const
Component-wise inequality test.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
GfVec3d Project(const GfVec3d &p) const
Return the projection of p onto the plane.
GF_API GfVec4d GetEquation() const
Give the coefficients of the equation of the plane.
GfPlane(const GfVec3d &p0, const GfVec3d &p1, const GfVec3d &p2)
This constructor sets this to the plane that contains the three given points.
GF_API GfPlane & Transform(const GfMatrix4d &matrix)
Transforms the plane by the given matrix.
Basic type for a vector of 3 double components.
const GfVec3d & GetNormal() const
Returns the unit-length normal vector of the plane.
GfPlane()
The default constructor leaves the plane parameters undefined.
bool operator==(const GfPlane &p) const
Component-wise equality test.
void Set(const GfVec3d &normal, double distanceToOrigin)
Sets this to the plane perpendicular to normal and at distance units from the origin.
double GetDistance(const GfVec3d &p) const
Returns the distance of point from the plane.