Class DIRECTION_45.
More...
#include <direction45.h>
|
enum | Directions {
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
} |
| Enum AngleType Represents kind of angle formed by vectors heading in two DIRECTION_45s.
|
|
Class DIRECTION_45.
Represents route directions & corner angles in a 45-degree metric.
◆ DIRECTION_45() [1/2]
DIRECTION_45::DIRECTION_45 |
( |
const VECTOR2I & |
aVec | ) |
|
|
inline |
Constructor.
- Parameters
-
aVec | vector, whose direction will be translated into a DIRECTION_45. |
◆ DIRECTION_45() [2/2]
DIRECTION_45::DIRECTION_45 |
( |
const SEG & |
aSeg | ) |
|
|
inline |
Constructor.
- Parameters
-
aSeg | segment, whose direction will be translated into a DIRECTION_45. |
◆ Angle()
Function Angle() Returns the type of angle between directions (this) and aOther.
- Parameters
-
aOther | direction to compare angle with |
◆ BuildInitialTrace()
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.
- Parameters
-
aP0 | starting point |
aP1 | ending point |
aStartDiagonal | whether the first segment has to be diagonal |
- Returns
- the trace
◆ Format()
const std::string DIRECTION_45::Format |
( |
| ) |
const |
|
inline |
Function Format() Formats the direction in a human readable word.
- Returns
- name of the direction
◆ IsDiagonal()
bool DIRECTION_45::IsDiagonal |
( |
| ) |
const |
|
inline |
Function IsDiagonal() Returns true if the direction is diagonal (e.g.
North-West, South-East, etc)
- Returns
- true, when diagonal.
◆ IsObtuse()
bool DIRECTION_45::IsObtuse |
( |
const DIRECTION_45 & |
aOther | ) |
const |
|
inline |
Function IsObtuse()
- Returns
- true, when (this) forms an obtuse angle with aOther
◆ Left()
Function Left()
Returns the direction on the left side of this (i.e. turns left by 45 deg)
◆ Opposite()
Function Opposite() Returns a direction opposite (180 degree) to (this)
- Returns
- opposite direction
◆ Right()
Function Right()
Returns the direction on the right side of this (i.e. turns right by 45 deg)
◆ ToVector()
const VECTOR2I DIRECTION_45::ToVector |
( |
| ) |
const |
|
inline |
Function ToVector()
Returns a unit vector corresponding to our direction.
The documentation for this class was generated from the following file: