KiCad PCB EDA Suite
|
for transforming drawing coordinates for a wxDC device context. More...
#include <transform.h>
Public Member Functions | |
TRANSFORM () | |
The default construct creates a transform that draws object is the normal orientation. | |
TRANSFORM (int ax1, int ay1, int ax2, int ay2) | |
bool | operator== (const TRANSFORM &aTransform) const |
bool | operator!= (const TRANSFORM &aTransform) const |
VECTOR2I | TransformCoordinate (const VECTOR2I &aPoint) const |
Calculate a new coordinate according to the mirror/rotation transform. | |
BOX2I | TransformCoordinate (const BOX2I &aRect) const |
Calculate a new rect according to the mirror/rotation transform. | |
TRANSFORM | InverseTransform () const |
Calculate the Inverse mirror/rotation transform. | |
bool | MapAngles (EDA_ANGLE *aAngle1, EDA_ANGLE *aAngle2) const |
Calculate new angles according to the transform. | |
Public Attributes | |
int | x1 |
int | y1 |
int | x2 |
int | y2 |
for transforming drawing coordinates for a wxDC device context.
This probably should be a base class with all pure virtual methods and a WXDC_TRANSFORM derived class. Then in the future if some new device context is used, a new transform could be derived from the base class and all the drawable objects would have to do is provide overloaded draw methods to use the new transform.
Definition at line 45 of file transform.h.
|
inline |
The default construct creates a transform that draws object is the normal orientation.
Definition at line 56 of file transform.h.
|
inline |
Definition at line 63 of file transform.h.
TRANSFORM TRANSFORM::InverseTransform | ( | ) | const |
Calculate the Inverse mirror/rotation transform.
Useful to calculate coordinates relative to a symbol, which must be for a non-rotated, non-mirrored item from the actual coordinate.
Definition at line 59 of file transform.cpp.
References x1, x2, y1, and y2.
Referenced by SCH_SYMBOL::doIsConnected(), GetRelativePosition(), SCH_MOVE_TOOL::moveItem(), and SCH_FIELD::SetPosition().
Calculate new angles according to the transform.
aAngle1 | = The first angle to transform |
aAngle2 | = The second angle to transform |
Definition at line 81 of file transform.cpp.
References ANGLE_0, ANGLE_360, EDA_ANGLE::Cos(), DEGREES_T, delta, epsilon, EDA_ANGLE::Normalize(), EDA_ANGLE::Sin(), swap, x1, x2, y1, and y2.
Referenced by SCH_SHAPE::Print().
|
inline |
Definition at line 72 of file transform.h.
bool TRANSFORM::operator== | ( | const TRANSFORM & | aTransform | ) | const |
Calculate a new rect according to the mirror/rotation transform.
Useful to calculate actual coordinates of a point from coordinates relative to a symbol, which are given for a non-rotated,-non mirrored item.
aRect | = The rectangle to transform |
Definition at line 50 of file transform.cpp.
References BOX2< Vec >::GetEnd(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::SetEnd(), BOX2< Vec >::SetOrigin(), and TransformCoordinate().
Calculate a new coordinate according to the mirror/rotation transform.
Useful to calculate actual coordinates of a point from coordinates relative to a symbol, which are given for a non-rotated,-non mirrored item.
aPoint | = The position to transform |
Definition at line 44 of file transform.cpp.
References VECTOR2< T >::x, x1, x2, VECTOR2< T >::y, y1, and y2.
Referenced by SCH_SYMBOL::doGetBoundingBox(), SCH_SYMBOL::doIsConnected(), SCH_FIELD::GetBoundingBox(), SCH_SYMBOL::GetConnectionPoints(), SCH_SYMBOL::GetPinPhysicalPosition(), SCH_PIN::GetPinRoot(), SCH_FIELD::GetPosition(), GetRelativePosition(), SCH_MOVE_TOOL::moveItem(), SCH_PIN::PinDrawOrient(), SCH_TEXT::Print(), SCH_FIELD::SetPosition(), TransformCoordinate(), SCH_RENDER_SETTINGS::TransformCoordinate(), and SCH_SYMBOL::UpdateDanglingState().
int TRANSFORM::x1 |
Definition at line 48 of file transform.h.
Referenced by InverseTransform(), SCH_IO_KICAD_LEGACY::loadSymbol(), MapAngles(), std::hash< TRANSFORM >::operator()(), operator==(), SCH_TEXT::Plot(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), SCH_IO_KICAD_LEGACY::saveSymbol(), SCH_SYMBOL::SetOrientation(), and TransformCoordinate().
int TRANSFORM::x2 |
Definition at line 50 of file transform.h.
Referenced by InverseTransform(), SCH_IO_KICAD_LEGACY::loadSymbol(), MapAngles(), std::hash< TRANSFORM >::operator()(), operator==(), SCH_IO_KICAD_LEGACY::saveSymbol(), SCH_SYMBOL::SetOrientation(), and TransformCoordinate().
int TRANSFORM::y1 |
Definition at line 49 of file transform.h.
Referenced by AUTOPLACER::computeFBoxSize(), KIGFX::SCH_PAINTER::draw(), SCH_FIELD::GetDrawRotation(), InverseTransform(), SCH_IO_KICAD_LEGACY::loadSymbol(), MapAngles(), std::hash< TRANSFORM >::operator()(), operator==(), SCH_FIELD::Plot(), SCH_TEXTBOX::Plot(), SCH_FIELD::Print(), SCH_TEXT::Print(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem(), SCH_IO_KICAD_LEGACY::saveSymbol(), SCH_SYMBOL::SetOrientation(), and TransformCoordinate().
int TRANSFORM::y2 |
Definition at line 51 of file transform.h.
Referenced by InverseTransform(), SCH_IO_KICAD_LEGACY::loadSymbol(), MapAngles(), std::hash< TRANSFORM >::operator()(), operator==(), SCH_IO_KICAD_LEGACY::saveSymbol(), SCH_SYMBOL::SetOrientation(), and TransformCoordinate().