KiCad PCB EDA Suite
TEXT_SPIN_STYLE Class Reference

#include <sch_text.h>

Public Types

enum  SPIN : int { LEFT = 0 , UP = 1 , RIGHT = 2 , BOTTOM = 3 }
 

Public Member Functions

 TEXT_SPIN_STYLE ()=default
 
constexpr TEXT_SPIN_STYLE (SPIN aSpin)
 
constexpr bool operator== (SPIN a) const
 
constexpr bool operator!= (SPIN a) const
 
 operator int () const
 
TEXT_SPIN_STYLE RotateCW ()
 
TEXT_SPIN_STYLE RotateCCW ()
 
TEXT_SPIN_STYLE MirrorX ()
 Mirror the label spin style across the X axis or simply swaps up and bottom. More...
 
TEXT_SPIN_STYLE MirrorY ()
 Mirror the label spin style across the Y axis or simply swaps left and right. More...
 

Private Attributes

SPIN m_spin
 

Detailed Description

Definition at line 41 of file sch_text.h.

Member Enumeration Documentation

◆ SPIN

Enumerator
LEFT 
UP 
RIGHT 
BOTTOM 

Definition at line 44 of file sch_text.h.

45 {
46 LEFT = 0,
47 UP = 1,
48 RIGHT = 2,
49 BOTTOM = 3
50 };

Constructor & Destructor Documentation

◆ TEXT_SPIN_STYLE() [1/2]

TEXT_SPIN_STYLE::TEXT_SPIN_STYLE ( )
default

Referenced by MirrorX(), MirrorY(), RotateCCW(), and RotateCW().

◆ TEXT_SPIN_STYLE() [2/2]

constexpr TEXT_SPIN_STYLE::TEXT_SPIN_STYLE ( SPIN  aSpin)
inlineconstexpr

Definition at line 54 of file sch_text.h.

54 : m_spin( aSpin )
55 {
56 }

Member Function Documentation

◆ MirrorX()

TEXT_SPIN_STYLE TEXT_SPIN_STYLE::MirrorX ( )

Mirror the label spin style across the X axis or simply swaps up and bottom.

Definition at line 83 of file sch_text.cpp.

84{
85 SPIN newSpin = m_spin;
86
87 switch( m_spin )
88 {
89 case TEXT_SPIN_STYLE::UP: newSpin = TEXT_SPIN_STYLE::BOTTOM; break;
90 case TEXT_SPIN_STYLE::BOTTOM: newSpin = TEXT_SPIN_STYLE::UP; break;
91 case TEXT_SPIN_STYLE::LEFT: break;
92 case TEXT_SPIN_STYLE::RIGHT: break;
93 }
94
95 return TEXT_SPIN_STYLE( newSpin );
96}
TEXT_SPIN_STYLE()=default

References BOTTOM, LEFT, m_spin, RIGHT, TEXT_SPIN_STYLE(), and UP.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), and orientLabel().

◆ MirrorY()

TEXT_SPIN_STYLE TEXT_SPIN_STYLE::MirrorY ( )

Mirror the label spin style across the Y axis or simply swaps left and right.

Definition at line 99 of file sch_text.cpp.

100{
101 SPIN newSpin = m_spin;
102
103 switch( m_spin )
104 {
105 case TEXT_SPIN_STYLE::LEFT: newSpin = TEXT_SPIN_STYLE::RIGHT; break;
106 case TEXT_SPIN_STYLE::RIGHT: newSpin = TEXT_SPIN_STYLE::LEFT; break;
107 case TEXT_SPIN_STYLE::UP: break;
108 case TEXT_SPIN_STYLE::BOTTOM: break;
109 }
110
111 return TEXT_SPIN_STYLE( newSpin );
112}

References BOTTOM, LEFT, m_spin, RIGHT, TEXT_SPIN_STYLE(), and UP.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), and orientLabel().

◆ operator int()

TEXT_SPIN_STYLE::operator int ( ) const
inline

Definition at line 68 of file sch_text.h.

69 {
70 return static_cast<int>( m_spin );
71 }

References m_spin.

◆ operator!=()

constexpr bool TEXT_SPIN_STYLE::operator!= ( SPIN  a) const
inlineconstexpr

Definition at line 63 of file sch_text.h.

64 {
65 return m_spin != a;
66 }

References m_spin.

◆ operator==()

constexpr bool TEXT_SPIN_STYLE::operator== ( SPIN  a) const
inlineconstexpr

Definition at line 58 of file sch_text.h.

59 {
60 return m_spin == a;
61 }

References m_spin.

◆ RotateCCW()

TEXT_SPIN_STYLE TEXT_SPIN_STYLE::RotateCCW ( )

Definition at line 67 of file sch_text.cpp.

68{
69 SPIN newSpin = m_spin;
70
71 switch( m_spin )
72 {
75 case TEXT_SPIN_STYLE::RIGHT: newSpin = TEXT_SPIN_STYLE::UP; break;
76 case TEXT_SPIN_STYLE::UP: newSpin = TEXT_SPIN_STYLE::LEFT; break;
77 }
78
79 return TEXT_SPIN_STYLE( newSpin );
80}

References BOTTOM, LEFT, m_spin, RIGHT, TEXT_SPIN_STYLE(), and UP.

Referenced by CADSTAR_SCH_ARCHIVE_LOADER::getSpinStyle(), and orientLabel().

◆ RotateCW()

TEXT_SPIN_STYLE TEXT_SPIN_STYLE::RotateCW ( )

Definition at line 51 of file sch_text.cpp.

52{
53 SPIN newSpin = m_spin;
54
55 switch( m_spin )
56 {
57 case TEXT_SPIN_STYLE::LEFT: newSpin = TEXT_SPIN_STYLE::UP; break;
58 case TEXT_SPIN_STYLE::UP: newSpin = TEXT_SPIN_STYLE::RIGHT; break;
61 }
62
63 return TEXT_SPIN_STYLE( newSpin );
64}

References BOTTOM, LEFT, m_spin, RIGHT, TEXT_SPIN_STYLE(), and UP.

Member Data Documentation

◆ m_spin

SPIN TEXT_SPIN_STYLE::m_spin
private

Definition at line 88 of file sch_text.h.

Referenced by MirrorX(), MirrorY(), operator int(), operator!=(), operator==(), RotateCCW(), and RotateCW().


The documentation for this class was generated from the following files: