VTKm
2.0

Represent a plane with a base point (origin) and normal vector. More...
#include <Geometry.h>
Public Types  
using  Vector = vtkm::Vec< CoordType, 3 > 
Public Member Functions  
VTKM_EXEC_CONT  Plane () 
Construct a default plane whose base point is the origin and whose normal is (0,0,1) More...  
VTKM_EXEC_CONT  Plane (const Vector &origin, const Vector &normal, CoordType tol2=static_cast< CoordType >(1e8f)) 
Construct a plane with the given origin and normal. More...  
VTKM_EXEC_CONT bool  IsValid () const 
Return true if the plane's normal is welldefined to within the given tolerance. More...  
VTKM_EXEC_CONT CoordType  DistanceTo (const Vector &point) const 
Return the signed distance from the plane to the point. More...  
VTKM_EXEC_CONT Vector  ClosestPoint (const Vector &point) const 
Return the closest point in the plane to the given point. More...  
template<bool IsTwoSided>  
VTKM_EXEC_CONT bool  Intersect (const Ray< CoordType, 3, IsTwoSided > &ray, CoordType ¶meter, Vector &point, bool &lineInPlane, CoordType tol=CoordType(1e6f)) const 
Intersect this plane with the ray (or line if the ray is twosided). More...  
VTKM_EXEC_CONT bool  Intersect (const LineSegment< CoordType > &segment, CoordType ¶meter, bool &lineInPlane) const 
Intersect this plane with the line segment. More...  
VTKM_EXEC_CONT bool  Intersect (const LineSegment< CoordType > &segment, CoordType ¶meter, Vector &point, bool &lineInPlane) const 
Intersect this plane with the line segment. More...  
VTKM_EXEC_CONT bool  Intersect (const Plane< CoordType > &other, Ray< CoordType, 3, true > &ray, bool &coincident, CoordType tol2=static_cast< CoordType >(1e6f)) const 
Intersect this plane with another plane. More...  
VTKM_EXEC_CONT  Plane () 
Construct plane passing through origin and normal to zaxis. More...  
VTKM_EXEC_CONT  Plane (const Vector &normal) 
Construct a plane through the origin with the given normal. More...  
VTKM_EXEC_CONT  Plane (const Vector &origin, const Vector &normal) 
Construct a plane through the given point with the given normal. More...  
VTKM_CONT void  SetOrigin (const Vector &origin) 
VTKM_CONT void  SetNormal (const Vector &normal) 
const VTKM_EXEC_CONT Vector &  GetOrigin () const 
const VTKM_EXEC_CONT Vector &  GetNormal () const 
VTKM_EXEC_CONT Scalar  Value (const Vector &point) const 
VTKM_EXEC_CONT Vector  Gradient (const Vector &) const 
Public Attributes  
Vector  Origin 
Vector  Normal 
Represent a plane with a base point (origin) and normal vector.
Implicit function for a plane.
A plane is defined by a point in the plane and a normal to the plane. The normal does not have to be a unit vector. The implicit function will still evaluate to 0 at the plane, but the values outside the plane (and the gradient) will be scaled by the length of the normal vector.
using vtkm::Plane::Vector = vtkm::Vec<CoordType, 3> 
VTKM_EXEC_CONT vtkm::Plane::Plane  (  ) 
Construct a default plane whose base point is the origin and whose normal is (0,0,1)
VTKM_EXEC_CONT vtkm::Plane::Plane  (  const Vector &  origin, 
const Vector &  normal,  
CoordType  tol2 = static_cast< CoordType >(1e8f) 

) 
Construct a plane with the given origin and normal.

inline 
Construct plane passing through origin and normal to zaxis.

inlineexplicit 
Construct a plane through the origin with the given normal.

inline 
Construct a plane through the given point with the given normal.
VTKM_EXEC_CONT Vector vtkm::Plane::ClosestPoint  (  const Vector &  point  )  const 
Return the closest point in the plane to the given point.
VTKM_EXEC_CONT CoordType vtkm::Plane::DistanceTo  (  const Vector &  point  )  const 
Return the signed distance from the plane to the point.

inline 

inline 

inline 
VTKM_EXEC_CONT bool vtkm::Plane::Intersect  (  const LineSegment< CoordType > &  segment, 
CoordType &  parameter,  
bool &  lineInPlane  
)  const 
Intersect this plane with the line segment.
Returns true if there is a nondegenrate intersection (i.e., an isolated point of intersection). Returns false if there is no intersection or if the intersection is degenerate (i.e., the entire line segment lies in the plane). In the latter case, lineInPlane will be true upon exit.
If this method returns true, then parameter will be set to a number in [0,1] indicating where along the line segment the plane hits.
VTKM_EXEC_CONT bool vtkm::Plane::Intersect  (  const LineSegment< CoordType > &  segment, 
CoordType &  parameter,  
Vector &  point,  
bool &  lineInPlane  
)  const 
Intersect this plane with the line segment.
Returns true if there is a nondegenrate intersection (i.e., an isolated point of intersection). Returns false if there is no intersection or if the intersection is degenerate (i.e., the entire line segment lines in the plane). In the latter case, lineInPlane will be true upon exit.
If this method returns true, then parameter will be set to a number in [0,1] indicating where along the line segment the plane hits and point will be set to that location.
VTKM_EXEC_CONT bool vtkm::Plane::Intersect  (  const Plane< CoordType > &  other, 
Ray< CoordType, 3, true > &  ray,  
bool &  coincident,  
CoordType  tol2 = static_cast< CoordType >(1e6f) 

)  const 
Intersect this plane with another plane.
Returns true if there is a nondegenrate intersection (i.e., a line of intersection). Returns false if there is no intersection or if the intersection is degenerate (i.e., the planes are coincident). In the latter case, coincident will be true upon exit and segment will unmodified.
If this method returns true, then the resulting segment will have its base point on the line of intersection and its second point will be a unit length away in the direction of the cross produce of the input plane normals (this plane crossed with the other).
The tolerance tol is the minimum squared length of the crossproduct of the two plane normals. It is also compared to the squared distance of the base point of other away from this plane when considering whether the planes are coincident.
VTKM_EXEC_CONT bool vtkm::Plane::Intersect  (  const Ray< CoordType, 3, IsTwoSided > &  ray, 
CoordType &  parameter,  
Vector &  point,  
bool &  lineInPlane,  
CoordType  tol = CoordType(1e6f) 

)  const 
Intersect this plane with the ray (or line if the ray is twosided).
Returns true if there is a nondegenrate intersection (i.e., an isolated point of intersection). Returns false if there is no intersection or if the intersection is degenerate (i.e., the entire ray/line lies in the plane). In the latter case, lineInPlane will be true upon exit.
If this method returns true, then parameter will be set to a number indicating where along the ray/line the plane hits and point will be set to that location. If the input is a ray, the parameter will be nonnegative.

inline 
Return true if the plane's normal is welldefined to within the given tolerance.

inline 
Vector vtkm::Plane::Normal 
Vector vtkm::Plane::Origin 