TBTK
Need a break? Support the development by playing Polarity Puzzles
Coordinate.h
1 /* Copyright 2017 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
17 
24 #ifndef COM_DAFER45_TBTK_PLOT_COORDINATE
25 #define COM_DAFER45_TBTK_PLOT_COORDINATE
26 
27 #include "TBTK/TBTKMacros.h"
28 
29 #include <vector>
30 
31 namespace TBTK{
32 namespace Plot{
33 
34 class Coordinate{
35 public:
37  double x, y;
38 
40  Coordinate(double x, double y);
41 
43  Coordinate(const std::vector<double> &coordinates);
44 
46  ~Coordinate();
47 private:
48 };
49 
50 inline Coordinate::Coordinate(double x, double y){
51  this->x = x;
52  this->y = y;
53 }
54 
55 inline Coordinate::Coordinate(const std::vector<double> &coordinates){
56  TBTKAssert(
57  coordinates.size() == 2,
58  "Coordinate::Coordinate()",
59  "Number of coordinates must be 2, but '" << coordinates.size()
60  << "' coordinates supplied.",
61  ""
62  );
63 
64  this->x = coordinates[0];
65  this->y = coordinates[1];
66 }
67 
68 inline Coordinate::~Coordinate(){
69 }
70 
71 }; //End namespace Plot
72 }; //End namespace TBTK
73 
74 #endif
75 
Precompiler macros.
Definition: Boolean.h:32