Struct representing a 2D point.
More...
#include <Point.h>
Struct representing a 2D point.
The Point structure.
- Examples
- examples/Huffman.cpp, examples/Julia.cpp, examples/array.cpp, examples/bezier.cpp, examples/board_font_text.cpp, examples/circled_framed.cpp, examples/clipping.cpp, examples/example1.cpp, examples/example2.cpp, examples/flag.cpp, examples/graph.cpp, examples/holes.cpp, examples/hull.cpp, examples/images.cpp, examples/interpolate.cpp, examples/koch.cpp, examples/logo.cpp, examples/rough.cpp, examples/sandbox.cpp, examples/sierpinski.cpp, examples/stroke_path.cpp, examples/test_arrow.cpp, examples/test_depth.cpp, examples/tilings.cpp, examples/triangles.cpp, and examples/xkcd.cpp.
◆ Point() [1/3]
LibBoard::Point::Point |
( |
| ) |
|
|
inline |
◆ Point() [2/3]
LibBoard::Point::Point |
( |
const Point & |
other | ) |
|
|
inline |
◆ Point() [3/3]
LibBoard::Point::Point |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
inline |
Point constructor.
- Parameters
-
x | The point's first coordinate. |
y | The point's second coordinate. |
◆ argument()
double LibBoard::Point::argument |
( |
| ) |
const |
|
inline |
◆ get()
void LibBoard::Point::get |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| const |
|
inline |
Get the values of the x and y values.
- Parameters
-
x | Reference to the x to be set. |
y | Reference to the y to be set. |
References x, and y.
Referenced by LibBoard::Dot::rotate().
◆ isInf()
bool LibBoard::Point::isInf |
( |
| ) |
const |
|
inline |
◆ norm()
double LibBoard::Point::norm |
( |
| ) |
const |
|
inline |
◆ normalise()
Point & LibBoard::Point::normalise |
( |
| ) |
|
|
inline |
◆ normalised()
Point LibBoard::Point::normalised |
( |
| ) |
const |
|
inline |
◆ operator*=()
Point & LibBoard::Point::operator*= |
( |
double |
s | ) |
|
|
inline |
Scale the point's coordinates.
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
◆ operator+=()
Point & LibBoard::Point::operator+= |
( |
const Point & |
other | ) |
|
|
inline |
Move the point given a translation vector (given as another Point).
- Parameters
-
other | A point seen as a translation vector. |
- Returns
- The point itself, once translated.
References x, and y.
◆ operator-()
Point LibBoard::Point::operator- |
( |
| ) |
const |
|
inline |
Get the opposite copy of the point.
- Returns
- The opposite copy of the point.
References Point(), x, and y.
◆ operator-=()
Point & LibBoard::Point::operator-= |
( |
const Point & |
other | ) |
|
|
inline |
Move (backward) the point given a translation vector (given as another Point).
- Parameters
-
other | A point seen as a translation vector. |
- Returns
- The point itself, once translated.
References x, and y.
◆ operator/=()
Point & LibBoard::Point::operator/= |
( |
double |
s | ) |
|
|
inline |
Downscale the point's coordinates.
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
◆ operator=()
Point & LibBoard::Point::operator= |
( |
const Point & |
other | ) |
|
|
inline |
Point assignment operator.
- Parameters
-
References x, and y.
◆ rotate() [1/2]
Point & LibBoard::Point::rotate |
( |
double |
angle | ) |
|
|
inline |
◆ rotate() [2/2]
Point & LibBoard::Point::rotate |
( |
double |
angle, |
|
|
const Point & |
center |
|
) |
| |
|
inline |
Rotate the point, given a rotation center and an angle.
- Parameters
-
angle | The rotation angle (in radians). |
center | The rotation center. |
- Returns
- The point itself (once rotated).
References rotate().
◆ rotated() [1/2]
Point LibBoard::Point::rotated |
( |
double |
angle | ) |
const |
|
inline |
Get a rotated copy of the point, around the origin, by a given angle.
- Parameters
-
angle | The rotation angle (in radians). |
- Returns
- The rotated point.
- Examples
- examples/koch.cpp, and examples/sierpinski.cpp.
References Point().
Referenced by LibBoard::Arrow::extremity(), Koch(), main(), LibBoard::Ellipse::rotate(), LibBoard::Line::rotate(), LibBoard::Line::rotated(), LibBoard::Line::rotated(), and Sierpinksi().
◆ rotated() [2/2]
Point LibBoard::Point::rotated |
( |
double |
angle, |
|
|
const Point & |
center |
|
) |
| const |
|
inline |
Get a rotated copy of the point, given a rotation center and an angle.
- Parameters
-
angle | The rotation angle (in radians). |
center | The rotation center. |
- Returns
- A rotated copy of the point.
References Point().
◆ rotatedPI2()
Point LibBoard::Point::rotatedPI2 |
( |
| ) |
const |
|
inline |
Get a PI/2 rotated copy of the point around (0,0), counterclockwise.
- Returns
- A rotated copy of the point.
- Examples
- examples/stroke_path.cpp.
References Point(), x, and y.
Referenced by LibBoard::Tools::butCapExtremities(), LibBoard::Tools::exteriorBevelIntersection(), LibBoard::Tools::exteriorMiterIntersection(), LibBoard::Tools::exteriorRoundIntersection(), LibBoard::Tools::interiorMiterIntersection(), LibBoard::RoughVisitor::map(), LibBoard::RoughVisitor::map(), LibBoard::RoughVisitor::map(), LibBoard::RoughVisitor::slideRandomlyAwayFromSegment(), LibBoard::RoughVisitor::slideRandomlyAwayFromSegment(), LibBoard::Tools::squareCapExtremities(), and strikeOut().
◆ scale()
Point & LibBoard::Point::scale |
( |
double |
sx, |
|
|
double |
sy |
|
) |
| |
|
inline |
Scale the point
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
◆ scaled()
Point LibBoard::Point::scaled |
( |
double |
sx, |
|
|
double |
sy |
|
) |
| |
|
inline |
Return a scaled copy of a point
- Parameters
-
- Returns
- The new point, once scaled.
References Point().
◆ translate()
Point & LibBoard::Point::translate |
( |
double |
dx, |
|
|
double |
dy |
|
) |
| |
|
inline |
◆ translated()
Point LibBoard::Point::translated |
( |
double |
dx, |
|
|
double |
dy |
|
) |
| const |
|
inline |
Return a translated copy of the point
- Parameters
-
dx | Translation along the x axis. |
dy | Translation along the y axis. |
- Returns
- The translated point.
References Point(), x, and y.
Referenced by LibBoard::cross().
◆ Infinity
Point LibBoard::Point::Infinity |
|
static |
double LibBoard::Point::x |
The point's first coordinate
- Examples
- examples/holes.cpp, examples/hull.cpp, and examples/xkcd.cpp.
Referenced by LibBoard::ShapeList::append(), argument(), LibBoard::array(), LibBoard::boardFontText(), LibBoard::Ellipse::boundingBox(), LibBoard::Rect::contains(), LibBoard::Tools::EuclideanLine::EuclideanLine(), LibBoard::Arrow::flushFIG(), LibBoard::Ellipse::flushFIG(), LibBoard::Line::flushFIG(), LibBoard::Polyline::flushFIG(), LibBoard::Arrow::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::Line::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushSVG(), LibBoard::Line::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Arrow::flushTikZ(), LibBoard::Ellipse::flushTikZ(), LibBoard::Line::flushTikZ(), get(), LibBoard::grid(), LibBoard::Rect::growToContain(), LibBoard::Tools::intersection(), LibBoard::Path::isClockwise(), isSeparing(), main(), LibBoard::Path::moveCenter(), LibBoard::Shape::moveCenter(), LibBoard::Path::moveCenter(), LibBoard::Shape::moveCenter(), norm(), normalise(), LibBoard::operator!=(), LibBoard::operator*(), LibBoard::operator*(), LibBoard::operator*(), operator*=(), LibBoard::operator+(), operator+=(), operator-(), LibBoard::operator-(), operator-=(), LibBoard::operator/(), operator/=(), operator<<(), operator=(), LibBoard::operator==(), LibBoard::Tools::pathBoundaryPoints(), LibBoard::Bezier::pathThroughLocalExtremums(), rotate(), LibBoard::Ellipse::rotate(), rotatedPI2(), LibBoard::Transform::scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), LibBoard::Path::scale(), scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), LibBoard::Line::scale(), LibBoard::Polyline::scale(), LibBoard::ShapeList::scale(), LibBoard::Line::scaleAll(), LibBoard::TransformEPS::setBoundingBox(), LibBoard::TransformFIG::setBoundingBox(), LibBoard::TransformSVG::setBoundingBox(), LibBoard::Rect::strictlyContains(), LibBoard::tiling(), translate(), and translated().
double LibBoard::Point::y |
The point's second coordinate
- Examples
- examples/holes.cpp, examples/hull.cpp, and examples/xkcd.cpp.
Referenced by LibBoard::ShapeList::append(), argument(), LibBoard::array(), LibBoard::boardFontText(), LibBoard::Ellipse::boundingBox(), LibBoard::Rect::contains(), LibBoard::Tools::EuclideanLine::EuclideanLine(), LibBoard::Arrow::flushFIG(), LibBoard::Ellipse::flushFIG(), LibBoard::Line::flushFIG(), LibBoard::Polyline::flushFIG(), LibBoard::Arrow::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::Line::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushSVG(), LibBoard::Line::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Arrow::flushTikZ(), LibBoard::Ellipse::flushTikZ(), LibBoard::Line::flushTikZ(), get(), LibBoard::grid(), LibBoard::Rect::growToContain(), LibBoard::Tools::intersection(), LibBoard::Path::isClockwise(), isSeparing(), main(), LibBoard::Path::moveCenter(), LibBoard::Shape::moveCenter(), LibBoard::Path::moveCenter(), LibBoard::Shape::moveCenter(), norm(), normalise(), LibBoard::operator!=(), LibBoard::operator*(), LibBoard::operator*(), LibBoard::operator*(), operator*=(), LibBoard::operator+(), operator+=(), operator-(), LibBoard::operator-(), operator-=(), LibBoard::operator/(), operator/=(), operator<<(), operator=(), LibBoard::operator==(), LibBoard::Tools::pathBoundaryPoints(), LibBoard::Bezier::pathThroughLocalExtremums(), rotate(), LibBoard::Ellipse::rotate(), rotatedPI2(), LibBoard::Transform::scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), LibBoard::Path::scale(), scale(), LibBoard::Board::scale(), LibBoard::Group::scale(), LibBoard::Line::scale(), LibBoard::Polyline::scale(), LibBoard::ShapeList::scale(), LibBoard::Line::scaleAll(), LibBoard::TransformEPS::setBoundingBox(), LibBoard::TransformFIG::setBoundingBox(), LibBoard::TransformSVG::setBoundingBox(), LibBoard::Rect::strictlyContains(), LibBoard::tiling(), translate(), and translated().
The documentation for this struct was generated from the following files: