VR-Forces 4.0.4 Class Documentation
include/geometry/plane.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1998 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: plane.h,v $ $Revision: 1.12 $ $State: Exp $
00007 *********************************************************************/
00008 
00009 #ifndef plane_H_
00010 #define plane_H_
00011 
00012 // \file plane.h
00013 // \brief Contains the DtPlane class declaration.
00014 
00015 #include <vlutil/vlMachineTypes.h>
00016 #include "geometry/geometryDefines.h"
00017 
00018 // forward declarations
00019 class DtPoint;
00020 class DtVector;
00021 class DtChord;
00022 
00023 //
00024 // DtPlane represents a plane in 3-space.
00025 class DT_DLL_geometry DtPlane
00026 {
00027 public:
00028 
00029    // default constructor (returns the xy-plane)
00030    DtPlane();
00031 
00032    // Define the plane passing through points v0, v1, and v2.
00033    // the three points v0, v1, and v2, are not collinear and not coincident.
00034    // The vertices v0, v1, and v2 appear in counterclockwise
00035    // order when viewing the plane from outside to inside in
00036    // a right-handed Cartesian coordinate system.
00037    DtPlane(const DtPoint& v0, const DtPoint& v1, const DtPoint& v2);
00038 
00039    // Plane defined by a location and normal direction vector.
00040    // \note The second parameter is passed by value so that the copy can be used
00041    // internally to the function, for performance reasons.
00042    DtPlane(const DtVector& point, DtVector normal);
00043 
00044    // define a plane by specifying the coefficients for the plane equation:
00045    // Ax + By + Cz + D = 0
00046    DtPlane(double a, double b, double c, double d);
00047 
00048    // Special version of the constructor that specifies the plane's coefficients, 
00049    // in that is assumes they are correct as specified.  
00050    // \note This version does \b not test them for correctness!
00051    DtPlane(bool ignored, double a, double b, double c, double d);
00052 
00053    // copy constructor
00054    DtPlane(const DtPlane& orig);
00055 
00056    // destructor
00057    virtual ~DtPlane();
00058 
00059    // assignment operator
00060    DtPlane& operator=(const DtPlane& orig);
00061 
00062    // Coefficients of the plane equation Ax + By + Cz + D = 0.
00063    virtual double a() const;
00064    virtual double b() const;
00065    virtual double c() const;
00066    virtual double d() const;
00067 
00068    // compute the vector normal to the plane.
00069    virtual const DtVector normal() const;
00070 
00071    // determine if chord intersects the plane; time specifies the
00072    // parametric value along the chord. 
00073    virtual bool intersects(const DtChord& chord, double& time) const;
00074 
00075    // print the contents of the object
00076    virtual void dump() const;
00077 
00078    // compute the distance of a point p to the plane.
00079    double distanceToPlane(const DtPoint& p) const;
00080 
00081    // \return point on the plane closest to the specified point.
00082    DtPoint closestPointOnPlane(const DtPoint& p) const;
00083 
00084 protected:
00085 
00086    // The plane is specified by the equation Ax + By + Cz + D = 0.
00087    double  myA;
00088    double  myB;
00089    double  myC;
00090    double  myD;
00091 
00092 };
00093 
00094 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)