TBTK
Need a break? Support the development by playing Polarity Puzzles
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 
17 
24 #ifndef COM_DAFER45_TBTK_PLOT_POINT
25 #define COM_DAFER45_TBTK_PLOT_POINT
26 
27 #include "TBTK/Plot/PlotCanvas.h"
28 #include "TBTK/Plot/Coordinate.h"
29 #include "TBTK/Plot/Decoration.h"
30 #include "TBTK/Plot/Drawable.h"
31 
32 namespace TBTK{
33 namespace Plot{
34 
35 class Point : public Drawable{
36 public:
38  Point();
39 
41  Point(const Coordinate &coordinate, const Decoration &decoration);
42 
44  virtual ~Point();
45 
47  void setCoordinate(const Coordinate &coordinate);
48 
50  void setDecoration(const Decoration &decoration);
51 
53  virtual void draw(PlotCanvas &canvas);
54 
56  virtual double getMinX() const;
57 
59  virtual double getMaxX() const;
60 
62  virtual double getMinY() const;
63 
65  virtual double getMaxY() const;
66 private:
68  Coordinate coordinate;
69 
71  Decoration decoration;
72 };
73 
74 inline Point::Point() : coordinate(0, 0){
75 }
76 
77 inline Point::Point(
78  const Coordinate &coordinate,
79  const Decoration &decoration
80 ) :
81  coordinate(coordinate)
82 {
83  this->decoration = decoration;
84 }
85 
86 inline Point::~Point(){
87 }
88 
89 inline void Point::setCoordinate(const Coordinate &coordinate){
90  this->coordinate = coordinate;
91 }
92 
93 inline void Point::setDecoration(const Decoration &decoration){
94  this->decoration = decoration;
95 }
96 
97 inline double Point::getMinX() const{
98  return coordinate.x;
99 }
100 
101 inline double Point::getMaxX() const{
102  return coordinate.x;
103 }
104 
105 inline double Point::getMinY() const{
106  return coordinate.y;
107 }
108 
109 inline double Point::getMaxY() const{
110  return coordinate.y;
111 }
112 
113 }; //End namespace Plot
114 }; //End namespace TBTK
115 
116 #endif
117 
Definition: Boolean.h:32