$extrastylesheet
plane.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_PLANE_H
00021 #define LIBMESH_PLANE_H
00022 
00023 // Local includes
00024 #include "libmesh/surface.h"
00025 
00026 // C++ includes
00027 
00028 namespace libMesh
00029 {
00030 
00031 
00037 class Plane : public Surface
00038 {
00039 public:
00040 
00044   Plane ();
00045 
00049   Plane (const Point& p, const Point& n);
00050 
00056   Plane (const Point& p0, const Point& p1, const Point& p2);
00057 
00061   Plane (const Plane& other_plane);
00062 
00066   ~Plane ();
00067 
00071   void create_from_point_normal (const Point& p, const Point& n);
00072 
00078   void create_from_three_points (const Point& p0,
00079                                  const Point& p1,
00080                                  const Point& p2 );
00081 
00085   void xy_plane (const Real zpos=0.);
00086 
00090   void xz_plane (const Real ypos=0.);
00091 
00095   void yz_plane (const Real xpos=0.);
00096 
00101   bool above_surface (const Point& p) const;
00102 
00107   bool below_surface (const Point& p) const;
00108 
00115   bool on_surface (const Point& p) const;
00116 
00120   Point closest_point (const Point& p) const;
00121 
00126   Point unit_normal (const Point& p) const;
00127 
00132   const Point & get_planar_point() const;
00133 
00134 
00135 private:
00136 
00137 
00141   const Point& normal () const;
00142 
00146   Point _point;
00147   Point _normal;
00148 
00149 };
00150 
00151 
00152 
00153 // ------------------------------------------------------------
00154 // Plane class inline members
00155 inline const Point & Plane::normal () const
00156 {
00157   return _normal;
00158 }
00159 
00160 } // namespace libMesh
00161 
00162 #endif // LIBMESH_PLANE_H