VectorEntity  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
vctl::MCPlane Class Reference

Plane defined by its equation coefficients. More...

#include <mcplane.h>

Inheritance diagram for vctl::MCPlane:
Inheritance graph
[legend]

List of all members.

Public Types

enum  MCCoordinatePlaneType { XY_PLANE = 0, XZ_PLANE, YZ_PLANE }
 Types of coordinate planes. More...
enum  MCRelativePosition {
  INTERSECTS = 0, FIRST_VERTEX_IN_PLANE, SECOND_VERTEX_IN_PLANE, BOTH_IN_PLANE,
  OUT_OF_PLANE
}
 Relative position of an edge and a plane. More...

Public Member Functions

double GetA () const
 Returns the coefficient.
double GetB () const
double GetC () const
double GetD () const
MCVector3D GetNormal ()
 Returns the normal vector of a plane.
 MCPlane ()
 Default constructor.
 MCPlane (double A, double B, double C, double D)
 A constructor with plane equation coefficients.
 MCPlane (MCVertex *vertex, MCVector3D *normal)
 A constructor with a normal vector of the plane and a point lying in the plane.
 MCPlane (MCVertex *v1, MCVertex *v2, MCVertex *v3)
 A constructor with three points lying in the plane.
 MCPlane (MCCoordinatePlaneType cplane)
 A constructor of a coordinate plane.
 MCPlane (MCCoordinatePlaneType cplane, MCVertex *vertex)
 A constructor of a coordinate plane.
 MCPlane (MCCoordinatePlaneType cplane, double distance)
 A constructor of a coordinate plane.
void MoveBy (double distance)
 Moves the plane by a distance.
void MoveTo (MCVertex *vertex)
 Moves the plane into a point.
void NormalizeVector ()
 Normalizes the normal vector of the plane.
MCRelativePosition Position (MCEdge *edge, MCVertex &intersection)
 Returns relative position of an edge and the plane.
MCRelativePosition Position (MCVertex *v1, MCVertex *v2, MCVertex &intersection)
 Returns relative position of an edge and the plane.
void SetA (double A)
 Sets the coefficient.
void SetB (double B)
void SetC (double C)
void SetD (double D)
bool TestIdentity (MCPlane *test_plane)
 Tests identity of two planes.
double ToPlaneEquation (MCVertex *v)
 Substitutes a point into the plane equation.
 ~MCPlane ()
 Destructor.

Protected Member Functions

void IsValid ()
 Checks that at least one coefficient is non-zero.

Protected Attributes

double _A
 Equation coefficient.
double _B
double _C
double _D

Detailed Description

Plane defined by its equation coefficients.


Member Enumeration Documentation

Types of coordinate planes.

Enumerator:
XY_PLANE 

normal vector (0,0,1).

XZ_PLANE 

normal vector (0,1,0).

YZ_PLANE 

normal vector (1,0,0).

Relative position of an edge and a plane.

Enumerator:
INTERSECTS 

The edge intersects the plane.

FIRST_VERTEX_IN_PLANE 

First endpoint of the edge lies in the plane.

SECOND_VERTEX_IN_PLANE 

Second endpoint of the edge lies in the plane.

BOTH_IN_PLANE 

Both endpoints of the edge lie in the plane.

OUT_OF_PLANE 

The edge does not intersect the plane.


Constructor & Destructor Documentation

vctl::MCPlane::MCPlane ( ) [inline]

Default constructor.

  • Makes a XY coordinate plane
vctl::MCPlane::MCPlane ( double  A,
double  B,
double  C,
double  D 
) [inline]

A constructor with plane equation coefficients.

vctl::MCPlane::MCPlane ( MCVertex vertex,
MCVector3D normal 
) [inline]

A constructor with a normal vector of the plane and a point lying in the plane.

vctl::MCPlane::MCPlane ( MCVertex v1,
MCVertex v2,
MCVertex v3 
) [inline]

A constructor with three points lying in the plane.

A constructor of a coordinate plane.

vctl::MCPlane::MCPlane ( MCCoordinatePlaneType  cplane,
MCVertex vertex 
) [inline]

A constructor of a coordinate plane.

  • Vertex lies in the plane.
vctl::MCPlane::MCPlane ( MCCoordinatePlaneType  cplane,
double  distance 
) [inline]

A constructor of a coordinate plane.

  • The plane is in the distance from coordinate origin.

Destructor.


Member Function Documentation

double vctl::MCPlane::GetA ( ) const [inline]

Returns the coefficient.

Returns the normal vector of a plane.

void vctl::MCPlane::IsValid ( ) [inline, protected]

Checks that at least one coefficient is non-zero.

void vctl::MCPlane::MoveBy ( double  distance) [inline]

Moves the plane by a distance.

void vctl::MCPlane::MoveTo ( MCVertex vertex) [inline]

Moves the plane into a point.

void vctl::MCPlane::NormalizeVector ( ) [inline]

Normalizes the normal vector of the plane.

MCRelativePosition vctl::MCPlane::Position ( MCEdge edge,
MCVertex intersection 
) [inline]

Returns relative position of an edge and the plane.

  • First and second endpoint of an edge.
  • Reference to an intersection vertex whose coordinates are set if the edge intersects the plane, otherwise the coordinates are not set (the function returns BOTH_IN_PLANE or OUT_OF_PLANE).

Returns relative position of an edge and the plane.

  • First and second endpoint of an edge.
  • Reference to an intersection vertex whose coordinates are set if the edge intersects the plane, otherwise the coordinates are not set (the function returns BOTH_IN_PLANE or OUT_OF_PLANE).
void vctl::MCPlane::SetA ( double  A) [inline]

Sets the coefficient.

bool vctl::MCPlane::TestIdentity ( MCPlane test_plane) [inline]

Tests identity of two planes.

Substitutes a point into the plane equation.

  • If the normal vector is normalised it returns the distance of the point from the plane.
  • Returns result of the equation
    A*x + B*y + C*z + D
    where x, y and z are coordinates of the vertex.

Member Data Documentation

Equation coefficient.


The documentation for this class was generated from the following files: