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

Member Enumeration Documentation

◆ SPIN

Enumerator
LEFT 
UP 
RIGHT 
BOTTOM 

Definition at line 45 of file sch_text.h.

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

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

55  : m_spin( aSpin )
56  {
57  }

Member Function Documentation

◆ MirrorX()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::MirrorX ( )
inline

Definition at line 109 of file sch_text.h.

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

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

Referenced by orientLabel().

◆ MirrorY()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::MirrorY ( )
inline

Definition at line 128 of file sch_text.h.

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

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

Referenced by orientLabel().

◆ operator int()

LABEL_SPIN_STYLE::operator int ( ) const
inline

Definition at line 69 of file sch_text.h.

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

References m_spin.

◆ operator!=()

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

Definition at line 64 of file sch_text.h.

65  {
66  return m_spin != a;
67  }

References m_spin.

◆ operator==()

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

Definition at line 59 of file sch_text.h.

60  {
61  return m_spin == a;
62  }

References m_spin.

◆ RotateCCW()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::RotateCCW ( )
inline

Definition at line 90 of file sch_text.h.

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

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

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

◆ RotateCW()

LABEL_SPIN_STYLE LABEL_SPIN_STYLE::RotateCW ( )
inline

Definition at line 74 of file sch_text.h.

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

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

Member Data Documentation

◆ m_spin

SPIN LABEL_SPIN_STYLE::m_spin
private

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