Class SHAPE_SIMPLE.
More...
#include <shape_simple.h>
|
typedef VECTOR2I::extended_type | ecoord |
|
SHAPE_TYPE | m_type |
|
type of our shape
|
|
Class SHAPE_SIMPLE.
Represents a simple polygon consisting of a zero-thickness closed chain of connected line segments.
Internally the vertices are held in a SHAPE_LINE_CHAIN, please note that there is a "virtual" line segment between the last and first vertex.
◆ Append() [1/2]
void SHAPE_SIMPLE::Append |
( |
const VECTOR2I & |
aP | ) |
|
|
inline |
Function Append()
Appends a new point at the end of the polygon.
- Parameters
-
◆ Append() [2/2]
void SHAPE_SIMPLE::Append |
( |
int |
aX, |
|
|
int |
aY |
|
) |
| |
|
inline |
Function Append()
Appends a new point at the end of the polygon.
- Parameters
-
aX | is X coordinate of the new point |
aY | is Y coordinate of the new point |
◆ BBox()
const BOX2I SHAPE_SIMPLE::BBox |
( |
int |
aClearance = 0 | ) |
const |
|
inlineoverridevirtual |
Function BBox()
Computes a bounding box of the shape, with a margin of aClearance a collision.
- Parameters
-
aClearance | how much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape. |
- Returns
- the bounding box.
Implements SHAPE.
◆ CDPoint()
const VECTOR2D SHAPE_SIMPLE::CDPoint |
( |
int |
aIndex | ) |
const |
|
inline |
Function CDPoint()
Returns a given point as a vector with elements of type double.
- Parameters
-
- Returns
- the point with elements of type double
◆ Clone()
SHAPE* SHAPE_SIMPLE::Clone |
( |
| ) |
const |
|
inlineoverridevirtual |
Function Clone()
Returns a dynamically allocated copy of the shape
- Return values
-
Reimplemented from SHAPE.
◆ Collide()
bool SHAPE_SIMPLE::Collide |
( |
const SEG & |
aSeg, |
|
|
int |
aClearance = 0 |
|
) |
| const |
|
inlineoverridevirtual |
Function Collide()
Checks if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.
- Returns
- true, if there is a collision.
Implements SHAPE.
◆ CPoint()
const VECTOR2I& SHAPE_SIMPLE::CPoint |
( |
int |
aIndex | ) |
const |
|
inline |
Function CPoint()
Returns a const reference to a given point in the polygon. Negative indices count from the end of the point list, e.g. -1 means "last
point", -2 means "second to last point" and so on.
- Parameters
-
- Returns
- const reference to the point
◆ Point()
VECTOR2I& SHAPE_SIMPLE::Point |
( |
int |
aIndex | ) |
|
|
inline |
Function Point()
Returns a reference to a given point in the polygon. Negative indices count from the end of the point list, e.g. -1 means "last point", -2 means "second to last point" and so on.
- Parameters
-
- Returns
- reference to the point
◆ PointCount()
int SHAPE_SIMPLE::PointCount |
( |
| ) |
const |
|
inline |
Function PointCount()
Returns the number of points (vertices) in this polygon
- Returns
- number of points
◆ Vertices()
Function Vertices()
Returns the list of vertices defining this simple polygon.
- Returns
- the list of vertices defining this simple polygon
The documentation for this class was generated from the following file: