ESyS-Particle  2.3.4
Plane3D.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef __PLANE3D_H
14 #define __PLANE3D_H
15 
16 //-- Project includes --
17 #include "Foundation/vec3.h"
18 
28 class Plane3D
29 {
30  protected:
31  Vec3 U,V ;
32  bool force3D ;
33  Vec3 Dir ;
35 
36  void Create() ;
37  public:
38  Plane3D();
39  Plane3D(const Vec3& iDir,const Vec3& iPos);
40  Plane3D(const Vec3& iU,const Vec3& iV,const Vec3& iPos);
41 
42  virtual ~Plane3D() {}
43 
44  virtual double sep(const Vec3&) const;
45  virtual double dist(const Vec3&) ; // signed separation according to Direction of the normal
46  virtual Vec3 ToClosest(const Vec3& M) {return dist(M)*Dir; } ; // return the vector PM where P is the closest point to M on the surface.
47 
48  inline Vec3 GetU() const { return U; } ; // return U (for planes in a 2D space (ie. line) U is in the space)
49  inline Vec3 GetV() const { return V; } ; // V is null if this is a 2D space.
50  inline const Vec3 &GetW() const { return Dir; } ; // The normal
51  inline Vec3 getNormal() const { return Dir; } ;
52  inline const Vec3 &GetO() const { return Pos; } ;
53  inline Vec3 getPos() const { return Pos; } ;
54 } ;
55 
56 namespace esys
57 {
58  namespace lsm
59  {
61  }
62 }
63 
64 #endif // __PLANE3D_H
Plane3D::getNormal
Vec3 getNormal() const
Definition: Plane3D.h:51
Plane3D::GetV
Vec3 GetV() const
Definition: Plane3D.h:49
Plane3D::V
Vec3 V
Definition: Plane3D.h:31
Plane3D::Dir
Vec3 Dir
Definition: Plane3D.h:33
Plane3D.h
esys::lsm::Plane3D
::Plane3D Plane3D
Definition: Plane3D.h:60
Plane3D::Plane3D
Plane3D()
Definition: Plane3D.cpp:58
Vec3::unit
VEC3_INLINE Vec3 unit() const
Definition: vec3.hpp:225
Plane3D::GetW
const Vec3 & GetW() const
Definition: Plane3D.h:50
Plane3D::GetO
const Vec3 & GetO() const
Definition: Plane3D.h:52
Plane3D::getPos
Vec3 getPos() const
Definition: Plane3D.h:53
Plane3D
Class representing a Plane3D.
Definition: Plane3D.h:29
cross
VEC3_INLINE Vec3 cross(const Vec3 &lhs, const Vec3 &rhs)
Definition: vec3.hpp:187
esys
Definition: CheckPointable.cpp:17
Plane3D::sep
virtual double sep(const Vec3 &) const
Definition: Plane3D.cpp:87
Plane3D::Create
void Create()
Definition: Plane3D.cpp:67
Plane3D::force3D
bool force3D
Definition: Plane3D.h:32
Plane3D::~Plane3D
virtual ~Plane3D()
Definition: Plane3D.h:42
Vec3
Definition: vec3.h:47
vec3.h
Plane3D::Pos
Vec3 Pos
Definition: Plane3D.h:34
Plane3D::dist
virtual double dist(const Vec3 &)
Definition: Plane3D.cpp:97
Plane3D::GetU
Vec3 GetU() const
Definition: Plane3D.h:48
Plane3D::U
Vec3 U
Definition: Plane3D.h:31
Plane3D::ToClosest
virtual Vec3 ToClosest(const Vec3 &M)
Definition: Plane3D.h:46