GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Surface.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Damien Andre IRCER/UNILIM, Limoges France
4 // <damien.andre@unilim.fr>
5 // - Jean-luc Charles Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
6 // <jean-luc.charles@ensam.eu>
7 // - Jeremie Girardot Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UPHF, Valenciennes France
10 // <cedric.hubert@uphf.fr>
11 // - Ivan Iordanoff Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
12 // <ivan.iordanoff@ensam.eu>
13 //
14 // Copyright (C) 2008-2019 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff
15 //
16 // This program is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 // This program is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with this program. If not, see <http://www.gnu.org/licenses/>.
28 
29 
30 #ifndef _GranOO_LibShape_Surface_hh_
31 #define _GranOO_LibShape_Surface_hh_
32 
33 #include <iostream>
34 #include <string>
35 #include <math.h>
36 
37 #include "GranOO3/Core/String.hpp"
40 #include "GranOO3/Geom/Tensor.hpp"
41 #include "GranOO3/Geom/Point.hpp"
43 #include "GranOO3/Shape/Base.hpp"
44 
46 
47 
48 namespace GranOO3
49 {
50  namespace Shape
51  {
52  class Volume;
53 
54  class Surface : public Base
55  {
56  public:
57  static std::string class_ID() {return "Surface";}
58 
59  public:
60  //CONSTRUCTORS & DESTRUCTORS
61  explicit Surface(const Geom::Frame &frame);
62  virtual ~Surface();
63 
64  //USEFULL
65  virtual double area() const = 0;
66  bool is_surface() const;
67  bool is_volume() const;
68 
69  //CONTACT DETECTION v2
70  virtual bool collide(const Volume&, Collision::Data&) const = 0;
71  virtual bool collide(const Geom::Point&, Collision::Data&) const = 0;
72 
73  private:
74  Surface (const Surface &) = delete;
75  Surface & operator=(const Surface &) = delete;
76 
77  //SERIALIZATION
79  template<class Archive> void serialize(Archive &, const unsigned int );
80 
81  };
82 
83  inline bool
85  return true;
86  }
87 
88  inline bool
90  return true;
91  }
92 
93  template<class Archive> void
94  Surface::serialize(Archive &, const unsigned int ) {
95  }
96 
97 
98  } // namespace Shape
99 }
100 
101 
102 
103 
104 #endif
Definition: Frame.hpp:68
Definition: Point.hpp:62
Definition: Base.hpp:97
Definition: Surface.hpp:55
Surface(const Surface &)=delete
Surface(const Geom::Frame &frame)
Definition: Surface.cpp:37
bool is_surface() const
Definition: Surface.hpp:84
virtual double area() const =0
bool is_volume() const
Definition: Surface.hpp:89
virtual ~Surface()
Definition: Surface.cpp:41
void serialize(Archive &, const unsigned int)
Definition: Surface.hpp:94
friend class boost::serialization::access
Definition: Surface.hpp:78
Surface & operator=(const Surface &)=delete
static std::string class_ID()
Definition: Surface.hpp:57
virtual bool collide(const Volume &, Collision::Data &) const =0
virtual bool collide(const Geom::Point &, Collision::Data &) const =0
Definition: Volume.hpp:103
Definition: Common.hpp:198
Definition: Data.hpp:43