VisiLibity v1 Source Code 1.0
Public Member Functions | Protected Attributes | List of all members
VisiLibity::Point Class Reference

Point in the plane represented by Cartesian coordinates. More...

#include <visilibity.hpp>

Inheritance diagram for VisiLibity::Point:
VisiLibity::Polar_Point VisiLibity::Visibility_Polygon::Polar_Point_With_Edge_Info

Public Member Functions

 Point ()
 default More...
 
 Point (double x_temp, double y_temp)
 costruct from raw coordinates
 
double x () const
 get x coordinate
 
double y () const
 get y coordinate
 
Point projection_onto (const Line_Segment &line_segment_temp) const
 closest Point on line_segment_temp More...
 
Point projection_onto (const Ray &ray_temp) const
 closest Point on ray_temp More...
 
Point projection_onto (const Polyline &polyline_temp) const
 closest Point on polyline_temp More...
 
Point projection_onto_vertices_of (const Polygon &polygon_temp) const
 closest vertex of polygon_temp More...
 
Point projection_onto_vertices_of (const Environment &enviroment_temp) const
 closest vertex of environment_temp More...
 
Point projection_onto_boundary_of (const Polygon &polygon_temp) const
 closest Point on boundary of polygon_temp More...
 
Point projection_onto_boundary_of (const Environment &enviroment_temp) const
 closest Point on boundary of environment_temp More...
 
bool on_boundary_of (const Polygon &polygon_temp, double epsilon=0.0) const
 true iff w/in epsilon of boundary of polygon_temp More...
 
bool on_boundary_of (const Environment &environment_temp, double epsilon=0.0) const
 true iff w/in epsilon of boundary of environment_temp More...
 
bool in (const Line_Segment &line_segment_temp, double epsilon=0.0) const
 true iff w/in epsilon of line_segment_temp More...
 
bool in_relative_interior_of (const Line_Segment &line_segment_temp, double epsilon=0.0) const
 true iff w/in epsilon of interior but greater than espilon away from endpoints of line_segment_temp More...
 
bool in (const Polygon &polygon_temp, double epsilon=0.0) const
 true iff w/in epsilon of polygon_temp More...
 
bool in (const Environment &environment_temp, double epsilon=0.0) const
 true iff w/in epsilon of environment_temp More...
 
bool is_endpoint_of (const Line_Segment &line_segment_temp, double epsilon=0.0) const
 true iff w/in epsilon of some endpoint of line_segment_temp More...
 
void set_x (double x_temp)
 change x coordinate
 
void set_y (double y_temp)
 change y coordinate
 
void snap_to_vertices_of (const Polygon &polygon_temp, double epsilon=0.0)
 relocate to closest vertex if w/in epsilon of some vertex (of polygon_temp) More...
 
void snap_to_vertices_of (const Environment &environment_temp, double epsilon=0.0)
 relocate to closest vertex if w/in epsilon of some vertex (of environment_temp) More...
 
void snap_to_boundary_of (const Polygon &polygon_temp, double epsilon=0.0)
 relocate to closest Point on boundary if w/in epsilon of the boundary (of polygon_temp) More...
 
void snap_to_boundary_of (const Environment &environment_temp, double epsilon=0.0)
 relocate to closest Point on boundary if w/in epsilon of the boundary (of environment_temp) More...
 

Protected Attributes

double x_
 
double y_
 

Detailed Description

Point in the plane represented by Cartesian coordinates.

Constructor & Destructor Documentation

◆ Point()

VisiLibity::Point::Point ( )
inline

default

Remarks
Data defaults to NAN so that checking whether the data are numbers can be used as a precondition in functions.

Member Function Documentation

◆ in() [1/3]

bool VisiLibity::Point::in ( const Environment environment_temp,
double  epsilon = 0.0 
) const

true iff w/in epsilon of environment_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and environment_temp is nonempty and epsilon -valid. Test validity with Enviroment::is_valid(epsilon)
Returns
true iff the calling Point is a Euclidean distance no greater than epsilon from the in the (closed) Environment environment_temp
Remarks
O(n) time complexity, where n is the number of vertices in environment_temp

◆ in() [2/3]

bool VisiLibity::Point::in ( const Line_Segment line_segment_temp,
double  epsilon = 0.0 
) const

true iff w/in epsilon of line_segment_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and line_segment_temp is nonempty
Returns
true iff the calling Point is within distance epsilon of the (closed) Line_Segment line_segment_temp

◆ in() [3/3]

bool VisiLibity::Point::in ( const Polygon polygon_temp,
double  epsilon = 0.0 
) const

true iff w/in epsilon of polygon_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and polygon_temp is epsilon -simple. Test simplicity with Polygon::is_simple(epsilon)
Returns
true iff the calling Point is a Euclidean distance no greater than epsilon from the (closed) Polygon (with vertices listed either cw or ccw) polygon_temp.
Remarks
O(n) time complexity, where n is the number of vertices in polygon_temp

◆ in_relative_interior_of()

bool VisiLibity::Point::in_relative_interior_of ( const Line_Segment line_segment_temp,
double  epsilon = 0.0 
) const

true iff w/in epsilon of interior but greater than espilon away from endpoints of line_segment_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and line_segment_temp is nonempty
Returns
true iff the calling Point is within distance epsilon of \line_segment_temp, but distance (strictly) greater than epsilon from line_segment_temp 's endpoints.

◆ is_endpoint_of()

bool VisiLibity::Point::is_endpoint_of ( const Line_Segment line_segment_temp,
double  epsilon = 0.0 
) const

true iff w/in epsilon of some endpoint of line_segment_temp

Precondition
the calling Point data are numbers and line_segment_temp is nonempty
Returns
true iff calling Point is a Euclidean distance no greater than epsilon from some endpoint of line_segment_temp

◆ on_boundary_of() [1/2]

bool VisiLibity::Point::on_boundary_of ( const Environment environment_temp,
double  epsilon = 0.0 
) const

true iff w/in epsilon of boundary of environment_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and environment_temp is nonempty
Returns
true iff the calling Point is within Euclidean distance epsilon of environment_temp 's boundary
Remarks
O(n) time complexity, where n is the number of vertices of environment_temp

◆ on_boundary_of() [2/2]

bool VisiLibity::Point::on_boundary_of ( const Polygon polygon_temp,
double  epsilon = 0.0 
) const

true iff w/in epsilon of boundary of polygon_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and polygon_temp is nonempty
Returns
true iff the calling Point is within Euclidean distance epsilon of polygon_temp 's boundary
Remarks
O(n) time complexity, where n is the number of vertices of polygon_temp

◆ projection_onto() [1/3]

Point VisiLibity::Point::projection_onto ( const Line_Segment line_segment_temp) const

closest Point on line_segment_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and line_segment_temp is nonempty
Returns
the Point on line_segment_temp which is the smallest Euclidean distance from the calling Point

◆ projection_onto() [2/3]

Point VisiLibity::Point::projection_onto ( const Polyline polyline_temp) const

closest Point on polyline_temp

Precondition
the calling Point data are numbers and polyline_temp is nonempty
Returns
the Point on polyline_temp which is the smallest Euclidean distance from the calling Point

◆ projection_onto() [3/3]

Point VisiLibity::Point::projection_onto ( const Ray ray_temp) const

closest Point on ray_temp

Author
Karl J. Obermeyer
Precondition
the calling Point and ray_temp data are numbers
Returns
the Point on ray_temp which is the smallest Euclidean distance from the calling Point

◆ projection_onto_boundary_of() [1/2]

Point VisiLibity::Point::projection_onto_boundary_of ( const Environment enviroment_temp) const

closest Point on boundary of environment_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and environment_temp is nonempty
Returns
the Point on the boundary of environment_temp which is the smalles Euclidean distance from the calling Point

◆ projection_onto_boundary_of() [2/2]

Point VisiLibity::Point::projection_onto_boundary_of ( const Polygon polygon_temp) const

closest Point on boundary of polygon_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and polygon_temp is nonempty
Returns
the Point on the boundary of polygon_temp which is the smallest Euclidean distance from the calling Point

◆ projection_onto_vertices_of() [1/2]

Point VisiLibity::Point::projection_onto_vertices_of ( const Environment enviroment_temp) const

closest vertex of environment_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and environment_temp is nonempty
Returns
the vertex of environment_temp which is the smallest Euclidean distance from the calling Point

◆ projection_onto_vertices_of() [2/2]

Point VisiLibity::Point::projection_onto_vertices_of ( const Polygon polygon_temp) const

closest vertex of polygon_temp

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and polygon_temp is nonempty
Returns
the vertex of polygon_temp which is the smallest Euclidean distance from the calling Point

◆ snap_to_boundary_of() [1/2]

void VisiLibity::Point::snap_to_boundary_of ( const Environment environment_temp,
double  epsilon = 0.0 
)

relocate to closest Point on boundary if w/in epsilon of the boundary (of environment_temp)

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and environment_temp is nonempty
Postcondition
if the calling Point was a Euclidean distance no greater than epsilon from the boundary of environment_temp, then it will be repositioned to it's projection onto that boundary
Remarks
O(n) time complexity, where n is the number of vertices in environment_temp.

◆ snap_to_boundary_of() [2/2]

void VisiLibity::Point::snap_to_boundary_of ( const Polygon polygon_temp,
double  epsilon = 0.0 
)

relocate to closest Point on boundary if w/in epsilon of the boundary (of polygon_temp)

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and polygon_temp is nonempty
Postcondition
if the calling Point was a Euclidean distance no greater than epsilon from the boundary of polygon_temp, then it will be repositioned to it's projection onto that boundary
Remarks
O(n) time complexity, where n is the number of vertices in polygon_temp.

◆ snap_to_vertices_of() [1/2]

void VisiLibity::Point::snap_to_vertices_of ( const Environment environment_temp,
double  epsilon = 0.0 
)

relocate to closest vertex if w/in epsilon of some vertex (of environment_temp)

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and environment_temp is nonempty
Postcondition
If the calling Point was a Euclidean distance no greater than epsilon from any vertex of environment_temp, then it will be repositioned to coincide with the closest such vertex
Remarks
O(n) time complexity, where n is the number of vertices in environment_temp.

◆ snap_to_vertices_of() [2/2]

void VisiLibity::Point::snap_to_vertices_of ( const Polygon polygon_temp,
double  epsilon = 0.0 
)

relocate to closest vertex if w/in epsilon of some vertex (of polygon_temp)

Author
Karl J. Obermeyer
Precondition
the calling Point data are numbers and polygon_temp is nonempty
Postcondition
If the calling Point was a Euclidean distance no greater than epsilon from any vertex of polygon_temp, then it will be repositioned to coincide with the closest such vertex
Remarks
O(n) time complexity, where n is the number of vertices in polygon_temp.

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