World Builder  0.1.0-pre
A geodyanmic initial conditions generator
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2018 by the authors of the World Builder code.
3 
4  This file is part of the World Builder.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef _world_builder_features_interface_h
21 #define _world_builder_features_interface_h
22 
23 #include <vector>
24 
25 #include <boost/property_tree/ptree.hpp>
26 
27 #include <world_builder/world.h>
29 #include <world_builder/point.h>
30 
31 
32 using boost::property_tree::ptree;
33 
34 
35 namespace WorldBuilder
36 {
37  class World;
38 
43  namespace Features
44  {
45 
46  class Interface
47  {
48  public:
52  Interface();
53 
57  virtual
58  ~Interface();
59 
63  virtual
64  void decare_entries(std::string &path) = 0;
65 
66 
70  virtual
71  double temperature(const Point<3> &position,
72  const double depth,
73  const double gravity,
74  double temperature) const = 0;
79  virtual
80  bool composition(const Point<3> &position,
81  const double depth,
82  const unsigned int composition_number,
83  bool temperature) const = 0;
84 
85 
86  protected:
91 
95  std::string name;
96 
100  std::vector<Point<2> > coordinates;
101 
106 
111 
112  };
113 
114 
118  std::unique_ptr<Interface>
119  create_feature(const std::string name, WorldBuilder::World *world);
120 
121  }
122 }
123 
124 #endif
virtual void decare_entries(std::string &path)=0
std::unique_ptr< Interface > create_feature(const std::string name, World *world)
Definition: interface.cc:38
virtual double temperature(const Point< 3 > &position, const double depth, const double gravity, double temperature) const =0
virtual bool composition(const Point< 3 > &position, const double depth, const unsigned int composition_number, bool temperature) const =0
WorldBuilder::World * world
Definition: interface.h:90
std::vector< Point< 2 > > coordinates
Definition: interface.h:100