plane.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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
Point _point
Definition: plane.h:144
const Point & normal() const
Definition: plane.h:139
void create_from_point_normal(const Point &p, const Point &n)
Definition: plane.C:70
void create_from_three_points(const Point &p0, const Point &p1, const Point &p2)
Definition: plane.C:78
const Point & get_planar_point() const
Definition: plane.C:189
virtual bool above_surface(const Point &p) const override
Definition: plane.C:127
void xy_plane(const Real zpos=0.)
Definition: plane.C:94
virtual Point closest_point(const Point &p) const override
Definition: plane.C:169
void yz_plane(const Real xpos=0.)
Definition: plane.C:116
A geometric object representing a planar surface.
Definition: plane.h:36
virtual bool below_surface(const Point &p) const override
Definition: plane.C:144
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Point _normal
Definition: plane.h:145
Base class for Plane and Sphere classes.
Definition: surface.h:42
virtual Point unit_normal(const Point &p) const override
Definition: plane.C:184
void xz_plane(const Real ypos=0.)
Definition: plane.C:105
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual bool on_surface(const Point &p) const override
Definition: plane.C:151