KiCad PCB EDA Suite
LABEL_SPIN_STYLE Class Reference

#include <sch_text.h>

Public Types

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

Public Member Functions

 LABEL_SPIN_STYLE ()=default
 
constexpr LABEL_SPIN_STYLE (SPIN aSpin)
 
constexpr bool operator== (SPIN a) const
 
constexpr bool operator!= (SPIN a) const
 
 operator int () const
 
LABEL_SPIN_STYLE RotateCW ()
 
LABEL_SPIN_STYLE RotateCCW ()
 
LABEL_SPIN_STYLE MirrorX ()
 
LABEL_SPIN_STYLE MirrorY ()
 

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.

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

Constructor & Destructor Documentation

◆ LABEL_SPIN_STYLE() [1/2]

LABEL_SPIN_STYLE::LABEL_SPIN_STYLE ( )
default

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

◆ LABEL_SPIN_STYLE() [2/2]

constexpr LABEL_SPIN_STYLE::LABEL_SPIN_STYLE ( SPIN  aSpin)
inline

Definition at line 54 of file sch_text.h.

54  : m_spin( aSpin )
55  {
56  }

Member Function Documentation

◆ MirrorX()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::MirrorX ( )
inline

Definition at line 108 of file sch_text.h.

109  {
110  SPIN newSpin = m_spin;
111 
112  switch( m_spin )
113  {
114  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
115  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::UP; break;
116  case LABEL_SPIN_STYLE::LEFT: break;
117  case LABEL_SPIN_STYLE::RIGHT: break;
118  default: wxLogWarning( "MirrorX encountered unknown current spin style" ); break;
119  }
120 
121  return LABEL_SPIN_STYLE( newSpin );
122  }
LABEL_SPIN_STYLE()=default

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

Referenced by SCH_EDIT_TOOL::Mirror().

◆ MirrorY()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::MirrorY ( )
inline

Definition at line 127 of file sch_text.h.

128  {
129  SPIN newSpin = m_spin;
130 
131  switch( m_spin )
132  {
133  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
134  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::LEFT; break;
135  case LABEL_SPIN_STYLE::UP: break;
136  case LABEL_SPIN_STYLE::BOTTOM: break;
137  default: wxLogWarning( "MirrorY encountered unknown current spin style" ); break;
138  }
139 
140  return LABEL_SPIN_STYLE( newSpin );
141  }
LABEL_SPIN_STYLE()=default

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

Referenced by SCH_EDIT_TOOL::Mirror().

◆ operator int()

LABEL_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 LABEL_SPIN_STYLE::operator!= ( SPIN  a) const
inline

Definition at line 63 of file sch_text.h.

64  {
65  return m_spin != a;
66  }

References m_spin.

◆ operator==()

constexpr bool LABEL_SPIN_STYLE::operator== ( SPIN  a) const
inline

Definition at line 58 of file sch_text.h.

59  {
60  return m_spin == a;
61  }

References m_spin.

◆ RotateCCW()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::RotateCCW ( )
inline

Definition at line 89 of file sch_text.h.

90  {
91  SPIN newSpin = m_spin;
92 
93  switch( m_spin )
94  {
95  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
97  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::UP; break;
98  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::LEFT; break;
99  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
100  }
101 
102  return LABEL_SPIN_STYLE( newSpin );
103  }
LABEL_SPIN_STYLE()=default

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

Referenced by SCH_EDIT_TOOL::Rotate().

◆ RotateCW()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::RotateCW ( )
inline

Definition at line 73 of file sch_text.h.

74  {
75  SPIN newSpin = m_spin;
76 
77  switch( m_spin )
78  {
79  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::UP; break;
80  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
82  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::LEFT; break;
83  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
84  }
85 
86  return LABEL_SPIN_STYLE( newSpin );
87  }
LABEL_SPIN_STYLE()=default

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

Referenced by SCH_EDIT_TOOL::Rotate().

Member Data Documentation

◆ m_spin

SPIN LABEL_SPIN_STYLE::m_spin
private

Definition at line 144 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 file: