World Builder  0.1.0-pre
A geodyanmic initial conditions generator
point.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_feature_types_point_h
21 #define _world_feature_types_point_h
22 
24 #include <world_builder/point.h>
25 
26 
27 namespace WorldBuilder
28 {
29  namespace Types
30  {
31 
38  template <int dim>
39  class Point : public Interface
40  {
41  public:
45  Point(const WorldBuilder::Point<dim> &default_value, const std::string &description);
46 
50  Point(const WorldBuilder::Point<dim> &value, const WorldBuilder::Point<dim> &default_value, const std::string &description);
51 
55  ~Point();
56 
60  virtual
61  std::unique_ptr<Interface> clone() const;
62 
66  double operator*(const Point<dim> &point) const;
67 
68 
72  WorldBuilder::Point<dim> operator*(const double scalar) const;
73 
77  WorldBuilder::Point<dim> operator+(const Point<dim> &point) const;
78 
79 
83  WorldBuilder::Point<dim> operator-(const Point<dim> &point) const;
84 
88  const double &operator[](const unsigned int index) const;
89 
90 
94  double &operator[](const unsigned int index);
95 
96 
97 
100  std::string description;
101 
102  private:
103 
104  };
105 
106  template<int dim>
107  WorldBuilder::Point<dim> operator*(const double scalar, const Point<dim> &point);
108  }
109 }
110 
111 #endif
double operator*(const Point< dim > &point) const
Definition: point.cc:60
WorldBuilder::Point< dim > operator-(const Point< dim > &point) const
Definition: point.cc:93
WorldBuilder::Point< dim > operator+(const Point< dim > &point) const
Definition: point.cc:83
Point(const WorldBuilder::Point< dim > &default_value, const std::string &description)
Definition: point.cc:28
const double & operator[](const unsigned int index) const
Definition: point.cc:106
WorldBuilder::Point< dim > default_value
Definition: point.h:99
std::string description
Definition: point.h:100
virtual std::unique_ptr< Interface > clone() const
Definition: point.cc:53
WorldBuilder::Point< dim > value
Definition: point.h:98