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 43 of file sch_text.h.

Member Enumeration Documentation

◆ SPIN

Enumerator
LEFT 
UP 
RIGHT 
BOTTOM 

Definition at line 46 of file sch_text.h.

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

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 56 of file sch_text.h.

56  : m_spin( aSpin )
57  {
58  }

Member Function Documentation

◆ MirrorX()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::MirrorX ( )
inline

Definition at line 110 of file sch_text.h.

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

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

Referenced by SCH_EDIT_TOOL::Mirror(), and orientLabel().

◆ MirrorY()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::MirrorY ( )
inline

Definition at line 129 of file sch_text.h.

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

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

Referenced by SCH_EDIT_TOOL::Mirror(), and orientLabel().

◆ operator int()

LABEL_SPIN_STYLE::operator int ( ) const
inline

Definition at line 70 of file sch_text.h.

71  {
72  return static_cast<int>( m_spin );
73  }

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.

◆ operator==()

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

Definition at line 60 of file sch_text.h.

61  {
62  return m_spin == a;
63  }

References m_spin.

◆ RotateCCW()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::RotateCCW ( )
inline

Definition at line 91 of file sch_text.h.

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

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

Referenced by orientLabel(), and SCH_EDIT_TOOL::Rotate().

◆ RotateCW()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::RotateCW ( )
inline

Definition at line 75 of file sch_text.h.

76  {
77  SPIN newSpin = m_spin;
78 
79  switch( m_spin )
80  {
81  case LABEL_SPIN_STYLE::LEFT: newSpin = LABEL_SPIN_STYLE::UP; break;
82  case LABEL_SPIN_STYLE::UP: newSpin = LABEL_SPIN_STYLE::RIGHT; break;
84  case LABEL_SPIN_STYLE::BOTTOM: newSpin = LABEL_SPIN_STYLE::LEFT; break;
85  default: wxLogWarning( "RotateCCW encountered unknown current spin style" ); break;
86  }
87 
88  return LABEL_SPIN_STYLE( newSpin );
89  }
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 146 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: