Struct representing a 2D point.
More...
#include <Board/Point.h>
◆ Point() [1/3]
LibBoard::Point::Point |
( |
| ) |
|
|
inline |
◆ Point() [2/3]
LibBoard::Point::Point |
( |
const Point & | other | ) |
|
|
inline |
Point constructor.
- Parameters
-
Definition at line 43 of file Point.h.
43:
x(other.x),
y(other.y) { }
◆ Point() [3/3]
LibBoard::Point::Point |
( |
double | xc, |
|
|
double | yc ) |
|
inline |
Point constructor.
- Parameters
-
xc | The point's first coordinate. |
yc | The point's second coordinate. |
Definition at line 58 of file Point.h.
◆ get()
void LibBoard::Point::get |
( |
double & | xout, |
|
|
double & | yout ) const |
|
inline |
Get the values of the x and y values.
- Parameters
-
xout | Reference to the x to be set. |
yout | Reference to the y to be set. |
Definition at line 103 of file Point.h.
References x, and y.
◆ norm()
double LibBoard::Point::norm |
( |
| ) |
const |
|
inline |
◆ operator*=()
Point & LibBoard::Point::operator*= |
( |
double | s | ) |
|
|
inline |
Definition at line 162 of file Point.h.
163{
164 x *= s;
165 y *= s;
166 return *this;
167}
◆ operator+=()
Point & LibBoard::Point::operator+= |
( |
const Point & | other | ) |
|
|
inline |
Definition at line 146 of file Point.h.
147{
148 x += other.x;
149 y += other.y;
150 return *this;
151}
References x, and y.
◆ operator-()
Point LibBoard::Point::operator- |
( |
| ) |
|
|
inline |
◆ operator-=()
Point & LibBoard::Point::operator-= |
( |
const Point & | other | ) |
|
|
inline |
Definition at line 154 of file Point.h.
155{
156 x -= other.x;
157 y -= other.y;
158 return *this;
159}
References x, and y.
◆ operator/=()
Point & LibBoard::Point::operator/= |
( |
double | s | ) |
|
|
inline |
Definition at line 170 of file Point.h.
171{
172 x /= s;
173 y /= s;
174 return *this;
175}
◆ operator=()
Point & LibBoard::Point::operator= |
( |
const Point & | other | ) |
|
|
default |
Default assignment operator.
- Parameters
-
◆ rotate() [1/2]
Point & LibBoard::Point::rotate |
( |
double | angle | ) |
|
|
inline |
Rotate the point with a given angle around the origin (0,0)
- Parameters
-
Definition at line 190 of file Point.h.
191{
192 double newx = cos( angle ) * Point::x - sin( angle ) * Point::y;
193 double newy = sin( angle ) * Point::x + cos( angle ) * Point::y;
194 x = newx;
195 y = newy;
196 return *this;
197}
Referenced by LibBoard::Circle::rotate(), LibBoard::Text::rotate(), rotated(), and rotated().
◆ rotate() [2/2]
Point & LibBoard::Point::rotate |
( |
double | angle, |
|
|
const Point & | center ) |
|
inline |
Definition at line 206 of file Point.h.
207{
209 (*this).rotate( angle );
211 return *this;
212}
Point center(const std::vector< Point > &points)
◆ rotated() [1/2]
Point LibBoard::Point::rotated |
( |
double | angle | ) |
const |
|
inline |
◆ rotated() [2/2]
Point LibBoard::Point::rotated |
( |
double | angle, |
|
|
const Point & | center ) const |
|
inline |
double LibBoard::Point::x |
The point's first coordinate
Definition at line 29 of file Point.h.
Referenced by LibBoard::Ellipse::boundingBox(), LibBoard::Text::boundingBox(), LibBoard::Board::drawTriangle(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillTriangle(), LibBoard::Arc::flushCairo(), LibBoard::Circle::flushCairo(), LibBoard::Ellipse::flushCairo(), LibBoard::Ellipse::flushFIG(), LibBoard::Text::flushFIG(), LibBoard::Arc::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Text::flushPostscript(), LibBoard::Arc::flushSVG(), LibBoard::Circle::flushSVG(), LibBoard::Ellipse::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Text::flushSVG(), LibBoard::Arc::flushTikZ(), LibBoard::Circle::flushTikZ(), LibBoard::Ellipse::flushTikZ(), LibBoard::Text::flushTikZ(), get(), operator+=(), operator-=(), LibBoard::Ellipse::rotate(), LibBoard::Board::scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), LibBoard::Group::scale(), LibBoard::Line::scale(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Arrow::scaled(), and LibBoard::Line::scaled().
double LibBoard::Point::y |
The point's second coordinate
Definition at line 30 of file Point.h.
Referenced by LibBoard::Ellipse::boundingBox(), LibBoard::Text::boundingBox(), LibBoard::Board::drawTriangle(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillTriangle(), LibBoard::Arc::flushCairo(), LibBoard::Circle::flushCairo(), LibBoard::Ellipse::flushCairo(), LibBoard::Ellipse::flushFIG(), LibBoard::Text::flushFIG(), LibBoard::Arc::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Text::flushPostscript(), LibBoard::Arc::flushSVG(), LibBoard::Circle::flushSVG(), LibBoard::Ellipse::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Text::flushSVG(), LibBoard::Arc::flushTikZ(), LibBoard::Circle::flushTikZ(), LibBoard::Ellipse::flushTikZ(), LibBoard::Text::flushTikZ(), get(), operator+=(), operator-=(), LibBoard::Ellipse::rotate(), LibBoard::Board::scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), LibBoard::Group::scale(), LibBoard::Line::scale(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Arrow::scaled(), and LibBoard::Line::scaled().
The documentation for this struct was generated from the following file: