KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symb_transforms_utils.cpp File Reference
#include "lib_symbol.h"
#include "sch_symbol.h"
#include "sch_pin.h"

Go to the source code of this file.

Classes

struct  ORIENT_MIRROR
 

Functions

void OrientAndMirrorSymbolItems (LIB_SYMBOL *aSymbol, int aOrientation)
 Rotate and/or mirror graphic objects of LIB_SYMBOL aSymbol according to aOrientMirror.
 
void RotateAndMirrorPin (SCH_PIN &aPin, int aOrientMirror)
 Rotate and/or mirror a SCH_PIN according to aOrientMirror.
 

Variables

static ORIENT_MIRROR symbols_orientations_list []
 

Function Documentation

◆ OrientAndMirrorSymbolItems()

void OrientAndMirrorSymbolItems ( LIB_SYMBOL aLibSymbol,
int  aOrientation 
)

Rotate and/or mirror graphic objects of LIB_SYMBOL aSymbol according to aOrientMirror.

Parameters
aLibSymbolis the LIB_SYMBOL to modify
aOrientationis the orientation+mirror value like returned by SCH_SYMBOL::GetOrientation()

Definition at line 54 of file symb_transforms_utils.cpp.

References LIB_SYMBOL::GetDrawItems(), ORIENT_MIRROR::mirror_x, ORIENT_MIRROR::mirror_y, ORIENT_MIRROR::n_rots, and symbols_orientations_list.

Referenced by KIGFX::SCH_PAINTER::draw().

◆ RotateAndMirrorPin()

void RotateAndMirrorPin ( SCH_PIN aPin,
int  aOrientMirror 
)

Rotate and/or mirror a SCH_PIN according to aOrientMirror.

aOrientMirror is usually the orientation/mirror of the parent symbol. The modified pin orientation is the actual pin orientation/mirror when the parent symbol is drawn.

Parameters
aPinis the SCH_PIN to modify
aOrientationis the orientation+mirror value like returned by SCH_SYMBOL::GetOrientation()

Definition at line 86 of file symb_transforms_utils.cpp.

References ORIENT_MIRROR::mirror_x, ORIENT_MIRROR::mirror_y, SCH_PIN::MirrorHorizontallyPin(), SCH_PIN::MirrorVerticallyPin(), ORIENT_MIRROR::n_rots, SCH_PIN::RotatePin(), and symbols_orientations_list.

Referenced by EE_SELECTION_TOOL::Main().

Variable Documentation

◆ symbols_orientations_list

ORIENT_MIRROR symbols_orientations_list[]
static
Initial value:
=
{
{ SYM_ORIENT_0, 0, 0, 0 },
{ SYM_ORIENT_90, 1, 0, 0 },
{ SYM_ORIENT_180, 2, 0, 0 },
{ SYM_ORIENT_270, 3, 0, 0 },
{ SYM_MIRROR_X + SYM_ORIENT_0, 0, 1, 0 },
{ SYM_MIRROR_X + SYM_ORIENT_90, 1, 1, 0 },
{ SYM_MIRROR_Y, 0, 0, 1 },
{ SYM_MIRROR_X + SYM_ORIENT_270, 3, 1, 0 },
{ SYM_MIRROR_Y + SYM_ORIENT_0, 0, 0, 1 },
{ SYM_MIRROR_Y + SYM_ORIENT_90, 1, 0, 1 },
{ SYM_MIRROR_Y + SYM_ORIENT_180, 2, 0, 1 },
}
@ SYM_ORIENT_270
Definition: sch_symbol.h:84
@ SYM_MIRROR_Y
Definition: sch_symbol.h:86
@ SYM_ORIENT_180
Definition: sch_symbol.h:83
@ SYM_MIRROR_X
Definition: sch_symbol.h:85
@ SYM_ORIENT_90
Definition: sch_symbol.h:82
@ SYM_ORIENT_0
Definition: sch_symbol.h:81

Definition at line 37 of file symb_transforms_utils.cpp.

Referenced by OrientAndMirrorSymbolItems(), and RotateAndMirrorPin().