libMesh::Plane Class Reference
#include <plane.h>

Public Member Functions | |
| Plane () | |
| Plane (const Point &p, const Point &n) | |
| Plane (const Point &p0, const Point &p1, const Point &p2) | |
| Plane (const Plane &other_plane) | |
| ~Plane () | |
| void | create_from_point_normal (const Point &p, const Point &n) |
| void | create_from_three_points (const Point &p0, const Point &p1, const Point &p2) |
| void | xy_plane (const Real zpos=0.) |
| void | xz_plane (const Real ypos=0.) |
| void | yz_plane (const Real xpos=0.) |
| bool | above_surface (const Point &p) const |
| bool | below_surface (const Point &p) const |
| bool | on_surface (const Point &p) const |
| Point | closest_point (const Point &p) const |
| Point | unit_normal (const Point &p) const |
| const Point & | get_planar_point () const |
| virtual Point | surface_coords (const Point &world_coords) const |
| virtual Point | world_coords (const Point &surf_coords) const |
Private Member Functions | |
| const Point & | normal () const |
Private Attributes | |
| Point | _point |
| Point | _normal |
Detailed Description
This class defines a plane.
Definition at line 40 of file plane.h.
Constructor & Destructor Documentation
Constructs a plane containing point p with normal n.
Definition at line 38 of file plane.C.
References create_from_point_normal().
00040 { 00041 this->create_from_point_normal (p, n); 00042 }
Constructs a plane containing the three points. The normal is determined in a counter-clockwise sense. See the create_from_three_points method for more details.
Definition at line 46 of file plane.C.
References create_from_three_points().
00049 { 00050 this->create_from_three_points (p0, p1, p2); 00051 }
| libMesh::Plane::Plane | ( | const Plane & | other_plane | ) |
Copy-constructor.
Definition at line 55 of file plane.C.
References _normal, _point, and create_from_point_normal().
00055 : 00056 Surface() 00057 { 00058 this->create_from_point_normal(other_plane._point, 00059 other_plane._normal); 00060 }
| libMesh::Plane::~Plane | ( | ) |
Member Function Documentation
| bool libMesh::Plane::above_surface | ( | const Point & | p | ) | const [virtual] |
- Returns:
- true if the point p is above the surface, false otherwise.
Implements libMesh::Surface.
Definition at line 127 of file plane.C.
References _point, normal(), and libMesh::Real.
Referenced by below_surface().
00128 { 00129 // Create a vector from the surface to point p; 00130 const Point w = p - _point; 00131 00132 // The point is above the surface if the projection 00133 // of that vector onto the normal is positive 00134 const Real proj = w*this->normal(); 00135 00136 if (proj > 0.) 00137 return true; 00138 00139 return false; 00140 }
| bool libMesh::Plane::below_surface | ( | const Point & | p | ) | const [virtual] |
- Returns:
- true if the point p is below the surface, false otherwise.
Implements libMesh::Surface.
Definition at line 144 of file plane.C.
References above_surface().
00145 { 00146 return ( !this->above_surface (p) ); 00147 }
- Returns:
- the closest point on the surface to point p.
Implements libMesh::Surface.
Definition at line 169 of file plane.C.
References _point, and normal().
00170 { 00171 // Create a vector from the surface to point p; 00172 const Point w = p - _point; 00173 00174 // The closest point in the plane to point p 00175 // is in the negative normal direction 00176 // a distance w (dot) p. 00177 const Point cp = p - this->normal()*(w*this->normal()); 00178 00179 return cp; 00180 }
| void libMesh::Plane::create_from_three_points | ( | const Point & | p0, | |
| const Point & | p1, | |||
| const Point & | p2 | |||
| ) |
Defines a plane intersecting the three points p0, p1, and p2. The normal is constructed in a counter-clockwise sense, i.e. (p1-p0)x(p2-p0);
Definition at line 78 of file plane.C.
References _normal, _point, libMesh::TypeVector< T >::cross(), and libMesh::TypeVector< T >::unit().
Referenced by Plane().
| const Point & libMesh::Plane::get_planar_point | ( | ) | const |
| const Point & libMesh::Plane::normal | ( | ) | const [inline, private] |
Returns the normal for the plane.
Definition at line 158 of file plane.h.
References _normal.
Referenced by above_surface(), closest_point(), and on_surface().
00159 { 00160 return _normal; 00161 }
| bool libMesh::Plane::on_surface | ( | const Point & | p | ) | const [virtual] |
- Returns:
- true if the point p is on the surface, false otherwise. Note that the definition of on the surface really means "very close" to account for roundoff error.
Implements libMesh::Surface.
Definition at line 151 of file plane.C.
References _point, std::abs(), normal(), and libMesh::Real.
00152 { 00153 // Create a vector from the surface to point p; 00154 const Point w = p - _point; 00155 00156 // If the projection of that vector onto the 00157 // plane's normal is 0 then the point is in 00158 // the plane. 00159 const Real proj = w * this->normal(); 00160 00161 if (std::abs(proj) < 1.e-10) 00162 return true; 00163 00164 return false; 00165 }
| Point libMesh::Surface::surface_coords | ( | const Point & | world_coords | ) | const [inline, virtual, inherited] |
- Returns:
- the
Pointworld_coordsin the surface's coordinate system.world_coordsis in the world coordinate system. This method is not purely virtual, because there may be surfaces that do not have an own coordinate system. These simply do not have to overload this method.
Reimplemented in libMesh::Sphere.
- Returns:
- a unit vector normal to the surface at point p.
Implements libMesh::Surface.
Definition at line 184 of file plane.C.
References _normal.
00185 { 00186 return _normal; 00187 }
| Point libMesh::Surface::world_coords | ( | const Point & | surf_coords | ) | const [inline, virtual, inherited] |
- Returns:
- the world (cartesian) coordinates for the surface coordinates
surf_coords. This method is not purely virtual, because there may be surfaces that do not have an own coordinate system. These simply do not have to overload this method.
Reimplemented in libMesh::Sphere.
| void libMesh::Plane::xy_plane | ( | const Real | zpos = 0. |
) |
| void libMesh::Plane::xz_plane | ( | const Real | ypos = 0. |
) |
| void libMesh::Plane::yz_plane | ( | const Real | xpos = 0. |
) |
Member Data Documentation
Point libMesh::Plane::_normal [private] |
Definition at line 150 of file plane.h.
Referenced by create_from_point_normal(), create_from_three_points(), normal(), Plane(), unit_normal(), xy_plane(), xz_plane(), and yz_plane().
Point libMesh::Plane::_point [private] |
The plane is defined by a point and a normal.
Definition at line 149 of file plane.h.
Referenced by above_surface(), closest_point(), create_from_point_normal(), create_from_three_points(), get_planar_point(), on_surface(), Plane(), xy_plane(), xz_plane(), and yz_plane().
The documentation for this class was generated from the following files:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:34 UTC
Hosted By: