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)
 
 LABEL_SPIN_STYLE (int 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/3]

LABEL_SPIN_STYLE::LABEL_SPIN_STYLE ( )
default

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

◆ LABEL_SPIN_STYLE() [2/3]

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  }

◆ LABEL_SPIN_STYLE() [3/3]

LABEL_SPIN_STYLE::LABEL_SPIN_STYLE ( int  aSpin)
inline

Definition at line 59 of file sch_text.h.

60  {
61  m_spin = static_cast<SPIN>( aSpin );
62  }

References m_spin.

Member Function Documentation

◆ MirrorX()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::MirrorX ( )
inline

Definition at line 120 of file sch_text.h.

121  {
122  SPIN newSpin = m_spin;
123 
124  switch( m_spin )
125  {
126  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
127  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::UP; break;
128  case LABEL_SPIN_STYLE::LEFT: break;
129  case LABEL_SPIN_STYLE::RIGHT: break;
130  default: wxLogWarning( "MirrorX encountered unknown current spin style" ); break;
131  }
132 
133  return LABEL_SPIN_STYLE( newSpin );
134  }
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 140 of file sch_text.h.

141  {
142  SPIN newSpin = m_spin;
143 
144  switch( m_spin )
145  {
146  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
147  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::LEFT; break;
148  case LABEL_SPIN_STYLE::UP: break;
149  case LABEL_SPIN_STYLE::BOTTOM: break;
150  default: wxLogWarning( "MirrorY encountered unknown current spin style" ); break;
151  }
152 
153  return LABEL_SPIN_STYLE( newSpin );
154  }
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 77 of file sch_text.h.

78  {
79  return static_cast<int>( m_spin );
80  }

References m_spin.

◆ operator!=()

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

Definition at line 71 of file sch_text.h.

72  {
73  return m_spin != a;
74  }

References m_spin.

◆ operator==()

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

Definition at line 65 of file sch_text.h.

66  {
67  return m_spin == a;
68  }

References m_spin.

◆ RotateCCW()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::RotateCCW ( )
inline

Definition at line 100 of file sch_text.h.

101  {
102  SPIN newSpin = m_spin;
103 
104  switch( m_spin )
105  {
106  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::BOTTOM; break;
107  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
108  case LABEL_SPIN_STYLE::RIGHT: newSpin = LABEL_SPIN_STYLE::UP; break;
109  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::LEFT; break;
110  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
111  }
112 
113  return LABEL_SPIN_STYLE( newSpin );
114  }
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 83 of file sch_text.h.

84  {
85  SPIN newSpin = m_spin;
86 
87  switch( m_spin )
88  {
89  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::UP; break;
90  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
92  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::LEFT; break;
93  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
94  }
95 
96  return LABEL_SPIN_STYLE( newSpin );
97  }
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

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