NAME
vtkPlane - perform various plane computations
SYNOPSIS
#include "/opt/vtk-c++/common/vtkPlane.h"
class VTK_EXPORT vtkPlane : public vtkImplicitFunction
vtkPlane();
static vtkPlane *New() {return new vtkPlane;};
const char *GetClassName() {return "vtkPlane";};
void PrintSelf(ostream& os, vtkIndent indent);
float EvaluateFunction(float x[3]);
void EvaluateGradient(float x[3], float g[3]);
void SetNormal(float, float, float);
void SetNormal(float *);
float *GetNormal();
void GetNormal(float data[3]);
void SetOrigin(float, float, float);
void SetOrigin(float *);
float *GetOrigin();
void GetOrigin(float data[3]);
static void ProjectPoint(float x[3], float origin[3], float normal[3],
float xproj[3]);
static float Evaluate(float normal[3], float origin[3], float x[3]);
static float DistanceToPlane(float x[3], float n[3], float p0[3]);
static int IntersectWithLine(float p1[3], float p2[3], float n[3],
float p0[3], float& t, float x[3]);
DESCRIPTION
vtkPlane provides methods for various plane computations. These include projecting points onto a plane, evaluating the plane equation, and returning plane normal. vtkPlane is a concrete implementation of the abstract class vtkImplicitFunction.
SUMMARY
void SetNormal(float, float, float)
void SetNormal(float *)
Set/get plane normal. Plane is defined by point and normal.
void SetOrigin(float, float, float)
void SetOrigin(float *)
Set/get point through which plane passes. Plane is defined by point and normal.
float Evaluate(float normal[3], float origin[3], float x[3]) Quick evaluation of plane equation n(x-origin)=0.
float DistanceToPlane(float x[3], float n[3], float p0[3]) Return the distance of a point x to a plane defined by n(x-p0) = 0. The normal n[3] must be magnitude=1.
int IntersectWithLine(float p1[3], float p2[3], float n[3], float p0[3], float& t, float x[3])
Given a line defined by the two points p1,p2; and a plane defined by the normal n and point p0, compute an intersection. The parametric coordinate along the line is returned in t, and the coordinates of intersection are returned in x. A zero is returned if the plane and line are parallel.