libMesh
plane.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_PLANE_H
21 #define LIBMESH_PLANE_H
22 
23 // Local includes
24 #include "libmesh/surface.h"
25 
26 namespace libMesh
27 {
28 
36 class Plane : public Surface
37 {
38 public:
39 
43  Plane ();
44 
48  Plane (const Point & p, const Point & n);
49 
55  Plane (const Point & p0, const Point & p1, const Point & p2);
56 
60  Plane (const Plane & other_plane);
61 
65  ~Plane ();
66 
70  void create_from_point_normal (const Point & p, const Point & n);
71 
77  void create_from_three_points (const Point & p0,
78  const Point & p1,
79  const Point & p2 );
80 
84  void xy_plane (const Real zpos=0.);
85 
89  void xz_plane (const Real ypos=0.);
90 
94  void yz_plane (const Real xpos=0.);
95 
100  virtual bool above_surface (const Point & p) const override;
101 
106  virtual bool below_surface (const Point & p) const override;
107 
115  virtual bool on_surface (const Point & p) const override;
116 
120  virtual Point closest_point (const Point & p) const override;
121 
126  virtual Point unit_normal (const Point & p) const override;
127 
132  const Point & get_planar_point() const;
133 
134 
135 private:
139  const Point & normal () const { return _normal; }
140 
146 };
147 
148 } // namespace libMesh
149 
150 #endif // LIBMESH_PLANE_H
libMesh::Plane::Plane
Plane()
Dummy Constructor.
Definition: plane.C:32
libMesh::Plane::closest_point
virtual Point closest_point(const Point &p) const override
Definition: plane.C:169
libMesh::Plane::below_surface
virtual bool below_surface(const Point &p) const override
Definition: plane.C:144
libMesh::Plane
This class defines a plane.
Definition: plane.h:36
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::Plane::_normal
Point _normal
Definition: plane.h:145
libMesh::Surface
The base class for all "surface" related geometric objects.
Definition: surface.h:42
libMesh::Plane::on_surface
virtual bool on_surface(const Point &p) const override
Definition: plane.C:151
libMesh::Plane::xz_plane
void xz_plane(const Real ypos=0.)
Creates an XZ plane located at y=ypos.
Definition: plane.C:105
libMesh::Plane::unit_normal
virtual Point unit_normal(const Point &p) const override
Definition: plane.C:184
libMesh::Plane::create_from_point_normal
void create_from_point_normal(const Point &p, const Point &n)
Defines a plane containing point p with normal n.
Definition: plane.C:70
libMesh::Plane::_point
Point _point
The plane is defined by a point and a normal.
Definition: plane.h:144
libMesh::Point
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
libMesh::Plane::normal
const Point & normal() const
Definition: plane.h:139
libMesh::Plane::get_planar_point
const Point & get_planar_point() const
Definition: plane.C:189
libMesh::Plane::create_from_three_points
void create_from_three_points(const Point &p0, const Point &p1, const Point &p2)
Defines a plane intersecting the three points p0, p1, and p2.
Definition: plane.C:78
libMesh::Plane::xy_plane
void xy_plane(const Real zpos=0.)
Creates an XY plane located at z=zpos.
Definition: plane.C:94
libMesh::Plane::~Plane
~Plane()
Destructor.
Definition: plane.C:64
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::Plane::above_surface
virtual bool above_surface(const Point &p) const override
Definition: plane.C:127
libMesh::Plane::yz_plane
void yz_plane(const Real xpos=0.)
Creates an YZ plane located at x=xpos.
Definition: plane.C:116