Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Avoid::Point Class Reference

The Point class defines a point in the plane. More...

#include <geomtypes.h>

Public Member Functions

 Point ()
 Default constructor.
 
 Point (const double xv, const double yv)
 Standard constructor.
 
bool operator== (const Point &rhs) const
 Comparison operator.
 
bool equals (const Point &rhs, double epsilon=0.0001) const
 Comparison operator.
 
bool operator!= (const Point &rhs) const
 Comparison operator.
 
bool operator< (const Point &rhs) const
 Comparison operator.
 
doubleoperator[] (const size_t dimension)
 Returns the x or y value of the point, given the dimension.
 
const doubleoperator[] (const size_t dimension) const
 
Point operator+ (const Point &rhs) const
 
Point operator- (const Point &rhs) const
 

Public Attributes

double x
 The x position.
 
double y
 The y position.
 
unsigned int id
 The ID associated with this point.
 
unsigned short vn
 The vertex number associated with this point.
 

Detailed Description

The Point class defines a point in the plane.

Points consist of an x and y value. They may also have an ID and vertex number associated with them.

Definition at line 52 of file geomtypes.h.

Constructor & Destructor Documentation

◆ Point() [1/2]

Avoid::Point::Point ( )

Default constructor.

Definition at line 41 of file geomtypes.cpp.

Referenced by operator+(), and operator-().

◆ Point() [2/2]

Avoid::Point::Point ( const double  xv,
const double  yv 
)

Standard constructor.

Parameters
[in]xvThe x position of the point.
[in]yvThe y position of the point.

Definition at line 48 of file geomtypes.cpp.

Member Function Documentation

◆ equals()

bool Avoid::Point::equals ( const Point rhs,
double  epsilon = 0.0001 
) const

Comparison operator.

Returns true if at same position, or at effectively the same position for a given value of epsilson.

Parameters
[in]rhsThe point to compare with this one.
[in]epsilonValue of epsilon to use during comparison.
Returns
The result of the comparison.
See also
operator==()

Definition at line 77 of file geomtypes.cpp.

References x, and y.

◆ operator!=()

bool Avoid::Point::operator!= ( const Point rhs) const

Comparison operator.

Returns true if at different positions.

Parameters
[in]rhsThe point to compare with this one.
Returns
The result of the comparison.

Definition at line 67 of file geomtypes.cpp.

References x, and y.

◆ operator+()

Point Avoid::Point::operator+ ( const Point rhs) const

Definition at line 111 of file geomtypes.cpp.

References Point(), x, and y.

◆ operator-()

Point Avoid::Point::operator- ( const Point rhs) const

Definition at line 117 of file geomtypes.cpp.

References Point(), x, and y.

◆ operator<()

bool Avoid::Point::operator< ( const Point rhs) const

Comparison operator.

Returns true if less-then rhs point.

Note
This operator is not particularly useful, but is defined to allow std::set<Point>.
Parameters
[in]rhsThe point to compare with this one.
Returns
The result of the comparison.

Definition at line 88 of file geomtypes.cpp.

References x, and y.

◆ operator==()

bool Avoid::Point::operator== ( const Point rhs) const

Comparison operator.

Returns true if at same position.

Parameters
[in]rhsThe point to compare with this one.
Returns
The result of the comparison.
See also
equals()

Definition at line 57 of file geomtypes.cpp.

References x, and y.

◆ operator[]() [1/2]

double & Avoid::Point::operator[] ( const size_t  dimension)

Returns the x or y value of the point, given the dimension.

Parameters
[in]dimensionThe dimension: 0 for x, 1 for y.
Returns
The component of the point in that dimension.

Definition at line 98 of file geomtypes.cpp.

References x, and y.

◆ operator[]() [2/2]

const double & Avoid::Point::operator[] ( const size_t  dimension) const

Definition at line 105 of file geomtypes.cpp.

References x, and y.

Member Data Documentation

◆ id

◆ vn

◆ x

double Avoid::Point::x

The x position.

Definition at line 107 of file geomtypes.h.

Referenced by Avoid::angle(), Avoid::angleBetween(), Avoid::colinear(), Avoid::cost(), Avoid::ConnectorCrossings::countForSegment(), Avoid::CrossLength(), Avoid::VertInf::directionFrom(), Avoid::dist(), Avoid::Dot(), equals(), Avoid::estimatedCostSpecific(), Avoid::euclideanDist(), Avoid::Router::existsInvalidOrthogonalPaths(), Avoid::ConnRef::generateStandardPath(), Avoid::ConnRef::getConnEndForEndpointVertex(), Avoid::MinimumTerminalSpanningTree::getOrthogonalEdgesFromVertex(), Avoid::inBetween(), Avoid::inPolyGen(), Avoid::EdgeInf::isOrthogonal(), Avoid::Box::length(), main(), Avoid::JunctionRef::makeRectangle(), Avoid::manhattanDist(), Avoid::Router::markPolylineConnectorsNeedingReroutingForDeletedObstacle(), Avoid::midpoint(), Avoid::midVertexNumber(), Avoid::Router::moveJunction(), Avoid::Node::Node(), Avoid::Node::Node(), Avoid::PolygonInterface::offsetBoundingBox(), operator!=(), operator+(), operator-(), operator<(), operator==(), operator[](), operator[](), Avoid::orthogonalDirection(), Avoid::orthogTurnOrder(), Avoid::ConnEnd::outputCode(), Avoid::Router::outputDiagramSVG(), Avoid::Router::outputDiagramText(), Avoid::HyperedgeTreeNode::outputEdgesExcept(), Avoid::HyperedgeImprover::outputHyperedgesToSVG(), Avoid::Router::outputInstanceToSVG(), Avoid::pointOnLine(), Avoid::ShapeConnectionPin::position(), Avoid::ShapeRef::position(), Avoid::projection(), Avoid::rayIntersectPoint(), Avoid::MinimumTerminalSpanningTree::realVerticesCountingPartners(), Avoid::Rectangle::Rectangle(), Avoid::Rectangle::Rectangle(), Avoid::rotationalAngle(), Avoid::EdgeInf::rotationLessThan(), Avoid::segDir(), Avoid::segmentIntersectPoint(), Avoid::ShapeRef::setCentrePos(), Avoid::Obstacle::shapeCentre(), Avoid::ConnRef::splitAtSegment(), Avoid::unitNormalForEdge(), Avoid::validateBendPoint(), Avoid::vecDir(), and Avoid::Box::width().

◆ y

double Avoid::Point::y

The y position.

Definition at line 109 of file geomtypes.h.

Referenced by Avoid::angle(), Avoid::angleBetween(), Avoid::colinear(), Avoid::cost(), Avoid::ConnectorCrossings::countForSegment(), Avoid::CrossLength(), Avoid::VertInf::directionFrom(), Avoid::dist(), Avoid::Dot(), equals(), Avoid::estimatedCostSpecific(), Avoid::euclideanDist(), Avoid::Router::existsInvalidOrthogonalPaths(), Avoid::ConnRef::generateStandardPath(), Avoid::ConnRef::getConnEndForEndpointVertex(), Avoid::MinimumTerminalSpanningTree::getOrthogonalEdgesFromVertex(), Avoid::Box::height(), Avoid::inBetween(), Avoid::inPolyGen(), Avoid::EdgeInf::isOrthogonal(), Avoid::Box::length(), Avoid::JunctionRef::makeRectangle(), Avoid::manhattanDist(), Avoid::Router::markPolylineConnectorsNeedingReroutingForDeletedObstacle(), Avoid::midpoint(), Avoid::midVertexNumber(), Avoid::Router::moveJunction(), Avoid::Node::Node(), Avoid::Node::Node(), Avoid::PolygonInterface::offsetBoundingBox(), operator!=(), operator+(), operator-(), operator<(), operator==(), operator[](), operator[](), Avoid::orthogonalDirection(), Avoid::orthogTurnOrder(), Avoid::ConnEnd::outputCode(), Avoid::Router::outputDiagramSVG(), Avoid::Router::outputDiagramText(), Avoid::HyperedgeTreeNode::outputEdgesExcept(), Avoid::HyperedgeImprover::outputHyperedgesToSVG(), Avoid::Router::outputInstanceToSVG(), Avoid::pointOnLine(), Avoid::ShapeConnectionPin::position(), Avoid::ShapeRef::position(), Avoid::projection(), Avoid::rayIntersectPoint(), Avoid::Rectangle::Rectangle(), Avoid::Rectangle::Rectangle(), Avoid::rotationalAngle(), Avoid::EdgeInf::rotationLessThan(), Avoid::segDir(), Avoid::segmentIntersectPoint(), Avoid::ShapeRef::setCentrePos(), Avoid::Obstacle::shapeCentre(), test(), Avoid::unitNormalForEdge(), Avoid::validateBendPoint(), Avoid::vecDir(), and Avoid::vertexSweep().


The documentation for this class was generated from the following files: