24 #ifndef PXR_BASE_GF_PLANE_H 25 #define PXR_BASE_GF_PLANE_H 32 #include "pxr/base/gf/api.h" 37 PXR_NAMESPACE_OPEN_SCOPE
65 Set(normal, distanceToOrigin);
92 void Set(
const GfVec3d &normal,
double distanceToOrigin) {
93 _normal = normal.GetNormalized();
94 _distance = distanceToOrigin;
135 return (_normal == p._normal &&
136 _distance == p._distance);
142 return ! (*
this == p);
149 return p * _normal - _distance;
166 _distance = -_distance;
214 PXR_NAMESPACE_CLOSE_SCOPE
216 #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.
bool operator !=(const GfPlane &p) const
Component-wise inequality test.
Basic type: 3-dimensional floating point range.
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] ...
GF_API std::ostream & operator<<(std::ostream &, const GfPlane &)
Output a GfPlane using the format [(nx ny nz) distance].
Basic type for a vector of 4 double components.
Basic type: 3-dimensional plane.
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.
GF_API bool GfFitPlaneToPoints(const std::vector< GfVec3d > &points, GfPlane *fitPlane)
Fits a plane to the given points.
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...
double GetDistance(const GfVec3d &p) const
Returns the distance of point from 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.
GfVec3d Project(const GfVec3d &p) const
Return the projection of p onto the plane.
GF_API GfPlane & Transform(const GfMatrix4d &matrix)
Transforms the plane by the given matrix.
Basic type for a vector of 3 double components.
bool operator==(const GfPlane &p) const
Component-wise equality test.
GfPlane()
The default constructor leaves the plane parameters undefined.
GF_API GfVec4d GetEquation() const
Give the coefficients of the equation of the plane.
const GfVec3d & GetNormal() const
Returns the unit-length normal vector of the plane.
bool IntersectsPositiveHalfSpace(const GfVec3d &pt) const
Returns true if the given point is on the plane or within its positive half space.
void Set(const GfVec3d &normal, double distanceToOrigin)
Sets this to the plane perpendicular to normal and at distance units from the origin.