TBTK
Point.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 
23 #ifndef COM_DAFER45_TBTK_POINT
24 #define COM_DAFER45_TBTK_POINT
25 
26 #include "TBTK/PlotCanvas.h"
27 #include "TBTK/Coordinate.h"
28 #include "TBTK/Decoration.h"
29 #include "TBTK/Drawable.h"
30 
31 namespace TBTK{
32 namespace Plot{
33 
34 class Point : public Drawable{
35 public:
37  Point();
38 
40  Point(const Coordinate &coordinate, const Decoration &decoration);
41 
43  virtual ~Point();
44 
46  void setCoordinate(const Coordinate &coordinate);
47 
49  void setDecoration(const Decoration &decoration);
50 
52  virtual void draw(PlotCanvas &canvas);
53 
55  virtual double getMinX() const;
56 
58  virtual double getMaxX() const;
59 
61  virtual double getMinY() const;
62 
64  virtual double getMaxY() const;
65 private:
67  Coordinate coordinate;
68 
70  Decoration decoration;
71 };
72 
73 inline Point::Point() : coordinate(0, 0){
74 }
75 
76 inline Point::Point(
77  const Coordinate &coordinate,
78  const Decoration &decoration
79 ) :
80  coordinate(coordinate)
81 {
82  this->decoration = decoration;
83 }
84 
85 inline Point::~Point(){
86 }
87 
88 inline void Point::setCoordinate(const Coordinate &coordinate){
89  this->coordinate = coordinate;
90 }
91 
92 inline void Point::setDecoration(const Decoration &decoration){
93  this->decoration = decoration;
94 }
95 
96 inline double Point::getMinX() const{
97  return coordinate.x;
98 }
99 
100 inline double Point::getMaxX() const{
101  return coordinate.x;
102 }
103 
104 inline double Point::getMinY() const{
105  return coordinate.y;
106 }
107 
108 inline double Point::getMaxY() const{
109  return coordinate.y;
110 }
111 
112 }; //End namespace Plot
113 }; //End namespace TBTK
114 
115 #endif
void setCoordinate(const Coordinate &coordinate)
Definition: Point.h:88
double x
Definition: Coordinate.h:36
Definition: Drawable.h:35
Decoration.
virtual double getMaxX() const
Definition: Point.h:100
virtual double getMinY() const
Definition: Point.h:104
Definition: PlotCanvas.h:36
virtual double getMinX() const
Definition: Point.h:96
Drawable.
Definition: Coordinate.h:33
Point()
Definition: Point.h:73
virtual ~Point()
Definition: Point.h:85
Definition: Decoration.h:31
Definition: Point.h:34
Definition: ModelFactory.h:35
virtual void draw(PlotCanvas &canvas)
Coordinate.
virtual double getMaxY() const
Definition: Point.h:108
void setDecoration(const Decoration &decoration)
Definition: Point.h:92