Mobile API Reference
MicroStrategy 2019
|
#include <Point2D.h>
Public Member Functions | |
Point (T iX=T(), T iY=T()) | |
Point (const Point< T > &irPoint) | |
template<typename U > | |
Point (const Point< U > &irPoint) | |
void | Reset (T iX, T iY) |
double | DistanceSquared (const Point< T > &irPoint) const |
double | Distance (const Point< T > &irPoint) const |
bool | IsInPolygon (const std::vector< Point< T > > &irPolygon) const |
bool | IsStrictlyInPolygon (const std::vector< Point< T > > &irPolygon) const |
bool | operator!= (const Point< T > &irPoint) const |
bool | operator== (const Point< T > &irPoint) const |
Point< T > | operator- () const |
void | Rotate (const Point< T > &irAnchor, double iRadian) |
Point< T > | RotateAndClone (const Point< T > &irAnchor, double iRadian) |
Point< T > | MiddleTo (const Point< T > &irPoint) const |
Point< T > | Shifted (const Point< T > &irOffset) const |
void | Swap () |
void | Swap (Point< T > &iorPoint) |
bool | IsOnSegment (const Point< T > &irSegmentStart, const Point< T > &irSegmentEnd, bool iExclude) const |
bool | IsOnVerOrHorSegment (const Point< T > &irSegmentStart, const Point< T > &irSegmentEnd) const |
CGPoint | GetCGPoint () const |
double | DistanceToPolygon (const std::vector< Point< T > > &irPolygon) const |
double | DistanceToLine (const Point< T > &irLineStart, const Point< T > &irLineEnd) const |
template<> | |
void | Rotate (const Point< Int32 > &irAnchor, double iRadian) |
Public Attributes | |
T | x |
X-coordinate of current point. More... | |
T | y |
Y-coordinate of current point. More... | |
This is a template class for 2D point.
|
inline |
Constructs from X and Y coordinates.
iX | X-coordinate of the point. |
iY | Y-coordinate of the point. |
|
inline |
Copy constructor
irPoint | Another Point<T> object. |
MsiChart::Point< T >::Point | ( | const Point< U > & | irPoint | ) |
Constructs from a Point<U> object.
irPoint | A Point<U> object. |
double MsiChart::Point< T >::Distance | ( | const Point< T > & | irPoint | ) | const |
Computes the distance between two points. Another point.
double MsiChart::Point< T >::DistanceSquared | ( | const Point< T > & | irPoint | ) | const |
Computes the square of the distance between two points. Another point.
double MsiChart::Point< T >::DistanceToLine | ( | const Point< T > & | irLineStart, |
const Point< T > & | irLineEnd | ||
) | const |
Get the distance between current point and an input line segment.
irLineStart,irLineEnd | Specifies a line segment. |
double MsiChart::Point< T >::DistanceToPolygon | ( | const std::vector< Point< T > > & | irPolygon | ) | const |
Get the distance between current point and an input polygon.
irPolygon | Specifies a polygon. |
CGPoint MsiChart::Point< T >::GetCGPoint | ( | ) | const |
Get the CGPoint version of current point.
bool MsiChart::Point< T >::IsInPolygon | ( | const std::vector< Point< T > > & | irPolygon | ) | const |
Check whether current point is inside a polygon or not. Reference: http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/
irPolygon | Specifies a polygon. |
bool MsiChart::Point< T >::IsOnSegment | ( | const Point< T > & | irSegmentStart, |
const Point< T > & | irSegmentEnd, | ||
bool | iExclude | ||
) | const |
Check whether current point is on a segment or not.
irSegmentStart,irSegmentEnd | Specifies a line segment. Indicates whether the two end points need to be excluded or not. |
bool MsiChart::Point< T >::IsOnVerOrHorSegment | ( | const Point< T > & | irSegmentStart, |
const Point< T > & | irSegmentEnd | ||
) | const |
Check whether current point is on a vertical/horizontal segment or not.
irSegmentStart,irSegmentEnd | Specifies a line segment. |
bool MsiChart::Point< T >::IsStrictlyInPolygon | ( | const std::vector< Point< T > > & | irPolygon | ) | const |
Check whether current point is strictly inside a polygon or not. A point is strictly inside a polygon if and only if (x+1,y),(x,y+1),(x-1,y) and (x,y-1) are inside that polygon.
irPolygon | Specifies a polygon. |
Point< T > MsiChart::Point< T >::MiddleTo | ( | const Point< T > & | irPoint | ) | const |
Computes the midpoint of two point. Specifies another point.
bool MsiChart::Point< T >::operator!= | ( | const Point< T > & | irPoint | ) | const |
Check whether two points coincide with each other. Specifies another point.
Point< T > MsiChart::Point< T >::operator- | ( | ) | const |
Return the central symmetric point of current point.
bool MsiChart::Point< T >::operator== | ( | const Point< T > & | irPoint | ) | const |
|
inline |
Set new coordinates for current point.
iX | X-coordinate of the point. |
iY | Y-coordinate of the point. |
void MsiChart::Point< T >::Rotate | ( | const Point< T > & | irAnchor, |
double | iRadian | ||
) |
Rotate a point relative to another point. Specifies a reference point. Specifies a rotation angle.
void MsiChart::Point< Int32 >::Rotate | ( | const Point< Int32 > & | irAnchor, |
double | iRadian | ||
) |
Point< T > MsiChart::Point< T >::RotateAndClone | ( | const Point< T > & | irAnchor, |
double | iRadian | ||
) |
Rotate a point relative to another point. Specifies a reference point. Specifies a rotation angle.
Point< T > MsiChart::Point< T >::Shifted | ( | const Point< T > & | irOffset | ) | const |
Computes a shifted point based on current point and an offset. Specifies an offset based on current point.
void MsiChart::Point< T >::Swap | ( | ) |
Swap current point's coordinate
void MsiChart::Point< T >::Swap | ( | Point< T > & | iorPoint | ) |
Swap point value with another one
T MsiChart::Point< T >::x |
X-coordinate of current point.
T MsiChart::Point< T >::y |
Y-coordinate of current point.