Horizon
|
Class DIRECTION_45. More...
#include <direction45.h>
Public Types | |
enum | Directions { N = 0, NE = 1, E = 2, SE = 3, S = 4, SW = 5, W = 6, NW = 7, UNDEFINED = -1, N = 0, NE = 1, E = 2, SE = 3, S = 4, SW = 5, W = 6, NW = 7, UNDEFINED = -1 } |
Enum Directions Represents available directions - there are 8 of them, as on a rectilinear map (north = up) + an extra undefined direction, reserved for traces that don't respect 45-degree routing regime. | |
enum | AngleType { ANG_OBTUSE = 0x01, ANG_RIGHT = 0x02, ANG_ACUTE = 0x04, ANG_STRAIGHT = 0x08, ANG_HALF_FULL = 0x10, ANG_UNDEFINED = 0x20, ANG_OBTUSE = 0x01, ANG_RIGHT = 0x02, ANG_ACUTE = 0x04, ANG_STRAIGHT = 0x08, ANG_HALF_FULL = 0x10, ANG_UNDEFINED = 0x20 } |
Enum AngleType Represents kind of angle formed by vectors heading in two DIRECTION_45s. | |
enum | Directions { N = 0, NE = 1, E = 2, SE = 3, S = 4, SW = 5, W = 6, NW = 7, UNDEFINED = -1, N = 0, NE = 1, E = 2, SE = 3, S = 4, SW = 5, W = 6, NW = 7, UNDEFINED = -1 } |
Enum Directions Represents available directions - there are 8 of them, as on a rectilinear map (north = up) + an extra undefined direction, reserved for traces that don't respect 45-degree routing regime. | |
enum | AngleType { ANG_OBTUSE = 0x01, ANG_RIGHT = 0x02, ANG_ACUTE = 0x04, ANG_STRAIGHT = 0x08, ANG_HALF_FULL = 0x10, ANG_UNDEFINED = 0x20, ANG_OBTUSE = 0x01, ANG_RIGHT = 0x02, ANG_ACUTE = 0x04, ANG_STRAIGHT = 0x08, ANG_HALF_FULL = 0x10, ANG_UNDEFINED = 0x20 } |
Enum AngleType Represents kind of angle formed by vectors heading in two DIRECTION_45s. | |
Public Member Functions | |
DIRECTION_45 (Directions aDir=UNDEFINED) | |
DIRECTION_45 (const VECTOR2I &aVec) | |
Constructor. More... | |
DIRECTION_45 (const SEG &aSeg) | |
Constructor. More... | |
const std::string | Format () const |
Function Format() Formats the direction in a human readable word. More... | |
DIRECTION_45 | Opposite () const |
Function Opposite() Returns a direction opposite (180 degree) to (this) More... | |
AngleType | Angle (const DIRECTION_45 &aOther) const |
Function Angle() Returns the type of angle between directions (this) and aOther. More... | |
bool | IsObtuse (const DIRECTION_45 &aOther) const |
Function IsObtuse() More... | |
bool | IsDiagonal () const |
Function IsDiagonal() Returns true if the direction is diagonal (e.g. More... | |
bool | IsDefined () const |
const SHAPE_LINE_CHAIN | BuildInitialTrace (const VECTOR2I &aP0, const VECTOR2I &aP1, bool aStartDiagonal=false) const |
Function BuildInitialTrace() More... | |
bool | operator== (const DIRECTION_45 &aOther) const |
bool | operator!= (const DIRECTION_45 &aOther) const |
const DIRECTION_45 | Right () const |
Function Right() More... | |
const DIRECTION_45 | Left () const |
Function Left() More... | |
const VECTOR2I | ToVector () const |
Function ToVector() More... | |
int | Mask () const |
DIRECTION_45 (Directions aDir=UNDEFINED) | |
DIRECTION_45 (const VECTOR2I &aVec) | |
Constructor. More... | |
DIRECTION_45 (const SEG &aSeg) | |
Constructor. More... | |
const std::string | Format () const |
Function Format() Formats the direction in a human readable word. More... | |
DIRECTION_45 | Opposite () const |
Function Opposite() Returns a direction opposite (180 degree) to (this) More... | |
AngleType | Angle (const DIRECTION_45 &aOther) const |
Function Angle() Returns the type of angle between directions (this) and aOther. More... | |
bool | IsObtuse (const DIRECTION_45 &aOther) const |
Function IsObtuse() More... | |
bool | IsDiagonal () const |
Function IsDiagonal() Returns true if the direction is diagonal (e.g. More... | |
bool | IsDefined () const |
const SHAPE_LINE_CHAIN | BuildInitialTrace (const VECTOR2I &aP0, const VECTOR2I &aP1, bool aStartDiagonal=false) const |
Function BuildInitialTrace() More... | |
bool | operator== (const DIRECTION_45 &aOther) const |
bool | operator!= (const DIRECTION_45 &aOther) const |
const DIRECTION_45 | Right () const |
Function Right() More... | |
const DIRECTION_45 | Left () const |
Function Left() More... | |
const VECTOR2I | ToVector () const |
Function ToVector() More... | |
int | Mask () const |
Class DIRECTION_45.
Represents route directions & corner angles in a 45-degree metric.
|
inline |
Constructor.
aVec | vector, whose direction will be translated into a DIRECTION_45. |
|
inline |
Constructor.
aSeg | segment, whose direction will be translated into a DIRECTION_45. |
|
inline |
Constructor.
aVec | vector, whose direction will be translated into a DIRECTION_45. |
|
inline |
Constructor.
aSeg | segment, whose direction will be translated into a DIRECTION_45. |
|
inline |
Function Angle() Returns the type of angle between directions (this) and aOther.
aOther | direction to compare angle with |
|
inline |
Function Angle() Returns the type of angle between directions (this) and aOther.
aOther | direction to compare angle with |
|
inline |
Function BuildInitialTrace()
Builds a 2-segment line chain between points aP0 and aP1 and following 45-degree routing regime. If aStartDiagonal is true, the trace starts with a diagonal segment.
aP0 | starting point |
aP1 | ending point |
aStartDiagonal | whether the first segment has to be diagonal |
|
inline |
Function BuildInitialTrace()
Builds a 2-segment line chain between points aP0 and aP1 and following 45-degree routing regime. If aStartDiagonal is true, the trace starts with a diagonal segment.
aP0 | starting point |
aP1 | ending point |
aStartDiagonal | whether the first segment has to be diagonal |
|
inline |
Function Format() Formats the direction in a human readable word.
|
inline |
Function Format() Formats the direction in a human readable word.
|
inline |
Function IsDiagonal() Returns true if the direction is diagonal (e.g.
North-West, South-East, etc)
|
inline |
Function IsDiagonal() Returns true if the direction is diagonal (e.g.
North-West, South-East, etc)
|
inline |
Function IsObtuse()
|
inline |
Function IsObtuse()
|
inline |
Function Left()
Returns the direction on the left side of this (i.e. turns left by 45 deg)
|
inline |
Function Left()
Returns the direction on the left side of this (i.e. turns left by 45 deg)
|
inline |
Function Opposite() Returns a direction opposite (180 degree) to (this)
|
inline |
Function Opposite() Returns a direction opposite (180 degree) to (this)
|
inline |
Function Right()
Returns the direction on the right side of this (i.e. turns right by 45 deg)
|
inline |
Function Right()
Returns the direction on the right side of this (i.e. turns right by 45 deg)
|
inline |
Function ToVector()
Returns a unit vector corresponding to our direction.
|
inline |
Function ToVector()
Returns a unit vector corresponding to our direction.