ESyS-Particle  2.3
Plane3D.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2014 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.opensource.org/licenses/osl-3.0.php //
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
Vec3 U
Definition: Plane3D.h:31
Definition: vec3.h:46
virtual Vec3 ToClosest(const Vec3 &M)
Definition: Plane3D.h:46
Plane3D()
Definition: Plane3D.cpp:58
Class representing a Plane3D.
Definition: Plane3D.h:28
Vec3 Dir
Definition: Plane3D.h:33
Definition: CheckPointable.cpp:16
::Plane3D Plane3D
Definition: Plane3D.h:60
Vec3 Pos
Definition: Plane3D.h:34
void Create()
Definition: Plane3D.cpp:67
const Vec3 & GetO() const
Definition: Plane3D.h:52
Vec3 V
Definition: Plane3D.h:31
Vec3 GetV() const
Definition: Plane3D.h:49
bool force3D
Definition: Plane3D.h:32
Vec3 getPos() const
Definition: Plane3D.h:53
Vec3 getNormal() const
Definition: Plane3D.h:51
virtual double dist(const Vec3 &)
Definition: Plane3D.cpp:97
virtual ~Plane3D()
Definition: Plane3D.h:42
Vec3 GetU() const
Definition: Plane3D.h:48
virtual double sep(const Vec3 &) const
Definition: Plane3D.cpp:87
const Vec3 & GetW() const
Definition: Plane3D.h:50