TBTK
Coordinate.h
Go to the documentation of this file.
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 
23 #ifndef COM_DAFER45_TBTK_COORDINATE
24 #define COM_DAFER45_TBTK_COORDINATE
25 
26 #include "TBTK/TBTKMacros.h"
27 
28 #include <vector>
29 
30 namespace TBTK{
31 namespace Plot{
32 
33 class Coordinate{
34 public:
36  double x, y;
37 
39  Coordinate(double x, double y);
40 
42  Coordinate(const std::vector<double> &coordinates);
43 
45  ~Coordinate();
46 private:
47 };
48 
49 inline Coordinate::Coordinate(double x, double y){
50  this->x = x;
51  this->y = y;
52 }
53 
54 inline Coordinate::Coordinate(const std::vector<double> &coordinates){
55  TBTKAssert(
56  coordinates.size() == 2,
57  "Coordinate::Coordinate()",
58  "Number of coordinates must be 2, but '" << coordinates.size()
59  << "' coordinates supplied.",
60  ""
61  );
62 
63  this->x = coordinates[0];
64  this->y = coordinates[1];
65 }
66 
68 }
69 
70 }; //End namespace Plot
71 }; //End namespace TBTK
72 
73 #endif
double x
Definition: Coordinate.h:36
Precompiler macros.
Definition: Coordinate.h:33
Definition: ModelFactory.h:35
~Coordinate()
Definition: Coordinate.h:67
Coordinate(double x, double y)
Definition: Coordinate.h:49