KiCad PCB EDA Suite
class_text_mod.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #include <fctsys.h>
27 #include <gr_basic.h>
28 #include <trigo.h>
29 #include <gr_text.h>
30 #include <kicad_string.h>
31 #include <richio.h>
32 #include <macros.h>
33 #include <pcb_edit_frame.h>
34 #include <msgpanel.h>
35 #include <base_units.h>
36 #include <bitmaps.h>
37 #include <class_board.h>
38 #include <class_module.h>
39 #include <view/view.h>
40 #include <pcbnew.h>
41 
42 
44  BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
45  EDA_TEXT()
46 {
47  MODULE* module = static_cast<MODULE*>( m_Parent );
48 
49  m_Type = text_type;
50  m_keepUpright = true;
51 
52  // Set text thickness to a default value
53  SetThickness( Millimeter2iu( DEFAULT_TEXT_WIDTH ) );
54  SetLayer( F_SilkS );
55 
56  // Set position and give a default layer if a valid parent footprint exists
57  if( module && ( module->Type() == PCB_MODULE_T ) )
58  {
59  SetTextPos( module->GetPosition() );
60 
61  if( IsBackLayer( module->GetLayer() ) )
62  {
63  SetLayer( B_SilkS );
64  SetMirrored( true );
65  }
66  }
67 
68  SetDrawCoord();
69 }
70 
71 
73 {
74 }
75 
76 
77 void TEXTE_MODULE::SetTextAngle( double aAngle )
78 {
80 }
81 
82 
83 bool TEXTE_MODULE::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
84 {
85  EDA_RECT rect = GetTextBox( -1 );
86  wxPoint location = aPoint;
87 
88  rect.Inflate( aAccuracy );
89 
90  RotatePoint( &location, GetTextPos(), -GetDrawRotation() );
91 
92  return rect.Contains( location );
93 }
94 
95 
96 bool TEXTE_MODULE::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
97 {
98  EDA_RECT rect = aRect;
99 
100  rect.Inflate( aAccuracy );
101 
102  if( aContains )
103  return rect.Contains( GetBoundingBox() );
104  else
105  return rect.Intersects( GetTextBox( -1 ), GetDrawRotation() );
106 }
107 
108 
109 void TEXTE_MODULE::KeepUpright( double aOldOrientation, double aNewOrientation )
110 {
111  if( !IsKeepUpright() )
112  return;
113 
114  double currentAngle = GetTextAngle() + aOldOrientation;
115  double newAngle = GetTextAngle() + aNewOrientation;
116 
117  NORMALIZE_ANGLE_POS( currentAngle );
118  NORMALIZE_ANGLE_POS( newAngle );
119 
120  bool isFlipped = currentAngle >= 1800.0;
121  bool needsFlipped = newAngle >= 1800.0;
122 
123  if( isFlipped != needsFlipped )
124  {
129 
130  SetTextAngle( GetTextAngle() + 1800.0 );
131  SetDrawCoord();
132  }
133 }
134 
135 
136 void TEXTE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
137 {
138  // Used in footprint editing
139  // Note also in module editor, m_Pos0 = m_Pos
140 
141  wxPoint pt = GetTextPos();
142  RotatePoint( &pt, aRotCentre, aAngle );
143  SetTextPos( pt );
144 
145  SetTextAngle( GetTextAngle() + aAngle );
146  SetLocalCoord();
147 }
148 
149 
150 void TEXTE_MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
151 {
152  // flipping the footprint is relative to the X axis
153  if( aFlipLeftRight )
154  SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
155  else
156  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
157 
159 
160  SetLayer( FlipLayer( GetLayer() ) );
162  SetLocalCoord();
163 
164  // adjust justified text for mirroring
166  {
169  else
171 
172  SetDrawCoord();
173  }
174 }
175 
177 {
178  if( GetParent() && GetParent()->GetLayer() == B_Cu )
179  return true;
180  return false;
181 }
182 
183 
184 void TEXTE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
185 {
186  // Used in modedit, to transform the footprint
187  // the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
188  // the position is mirrored, but the text itself is not mirrored
189  if( aMirrorAroundXAxis )
190  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
191  else
192  SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
193 
194  SetLocalCoord();
195 }
196 
197 
198 void TEXTE_MODULE::Move( const wxPoint& aMoveVector )
199 {
200  Offset( aMoveVector );
201  SetLocalCoord();
202 }
203 
204 
206 {
207  return GetText().Len();
208 }
209 
210 
212 {
213  const MODULE* module = static_cast<const MODULE*>( m_Parent );
214 
215  SetTextPos( m_Pos0 );
216 
217  if( module )
218  {
219  double angle = module->GetOrientation();
220 
221  wxPoint pt = GetTextPos();
222  RotatePoint( &pt, angle );
223  SetTextPos( pt );
224 
225  Offset( module->GetPosition() );
226  }
227 }
228 
229 
231 {
232  const MODULE* module = static_cast<const MODULE*>( m_Parent );
233 
234  if( module )
235  {
236  m_Pos0 = GetTextPos() - module->GetPosition();
237 
238  double angle = module->GetOrientation();
239 
240  RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
241  }
242  else
243  {
244  m_Pos0 = GetTextPos();
245  }
246 }
247 
249 {
250  double angle = GetDrawRotation();
251  EDA_RECT text_area = GetTextBox( -1, -1 );
252 
253  if( angle )
254  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
255 
256  return text_area;
257 }
258 
259 
260 void TEXTE_MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset )
261 {
262  /* parent must *not* be NULL (a footprint text without a footprint parent has no sense) */
263  wxASSERT( m_Parent );
264 
265  BOARD* brd = GetBoard( );
267  PCB_LAYER_ID text_layer = GetLayer();
268 
269  if( !brd->IsLayerVisible( m_Layer )
270  || ( IsFrontLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_FR ) )
271  || ( IsBackLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_BK ) ) )
272  return;
273 
274  if( !brd->IsElementVisible( LAYER_MOD_REFERENCES ) && GetText() == wxT( "%R" ) )
275  return;
276 
277  if( !brd->IsElementVisible( LAYER_MOD_VALUES ) && GetText() == wxT( "%V" ) )
278  return;
279 
280  // Invisible texts are still drawn (not plotted) in LAYER_MOD_TEXT_INVISIBLE
281  // Just because we must have to edit them (at least to make them visible)
282  if( !IsVisible() )
283  {
285  return;
286 
288  }
289 
290  // Draw mode compensation for the width
291  int width = GetThickness();
292 
294  width = -width;
295 
296  wxPoint pos = GetTextPos() - aOffset;
297 
298  // Draw the text proper, with the right attributes
299  wxSize size = GetTextSize();
300  double orient = GetDrawRotation();
301 
302  // If the text is mirrored : negate size.x (mirror / Y axis)
303  if( IsMirrored() )
304  size.x = -size.x;
305 
306  GRText( aDC, pos, color, GetShownText(), orient, size, GetHorizJustify(), GetVertJustify(),
307  width, IsItalic(), IsBold() );
308 }
309 
310 
312 {
313  MODULE* module = (MODULE*) m_Parent;
314  double rotation = GetTextAngle();
315 
316  if( module )
317  rotation += module->GetOrientation();
318 
319  if( m_keepUpright )
320  {
321  // Keep angle between -90 .. 90 deg. Otherwise the text is not easy to read
322  while( rotation > 900 )
323  rotation -= 1800;
324 
325  while( rotation < -900 )
326  rotation += 1800;
327  }
328  else
329  {
330  NORMALIZE_ANGLE_POS( rotation );
331  }
332 
333  return rotation;
334 }
335 
336 
337 // see class_text_mod.h
338 void TEXTE_MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
339 {
340  MODULE* module = (MODULE*) m_Parent;
341 
342  if( module == NULL ) // Happens in modedit, and for new texts
343  return;
344 
345  wxString msg, Line;
346 
347  static const wxString text_type_msg[3] =
348  {
349  _( "Ref." ), _( "Value" ), _( "Text" )
350  };
351 
352  Line = module->GetReference();
353  aList.emplace_back( _( "Footprint" ), Line, DARKCYAN );
354 
355  Line = GetShownText();
356  aList.emplace_back( _( "Text" ), Line, BROWN );
357 
358  wxASSERT( m_Type >= TEXT_is_REFERENCE && m_Type <= TEXT_is_DIVERS );
359  aList.emplace_back( _( "Type" ), text_type_msg[m_Type], DARKGREEN );
360 
361  if( !IsVisible() )
362  msg = _( "No" );
363  else
364  msg = _( "Yes" );
365 
366  aList.emplace_back( _( "Display" ), msg, DARKGREEN );
367 
368  // Display text layer
369  aList.emplace_back( _( "Layer" ), GetLayerName(), DARKGREEN );
370 
371  if( IsMirrored() )
372  msg = _( "Yes" );
373  else
374  msg = _( "No" );
375 
376  aList.emplace_back( _( "Mirror" ), msg, DARKGREEN );
377 
378  msg.Printf( wxT( "%.1f" ), GetTextAngleDegrees() );
379  aList.emplace_back( _( "Angle" ), msg, DARKGREEN );
380 
381  msg = MessageTextFromValue( aUnits, GetThickness(), true );
382  aList.emplace_back( _( "Thickness" ), msg, DARKGREEN );
383 
384  msg = MessageTextFromValue( aUnits, GetTextWidth(), true );
385  aList.emplace_back( _( "Width" ), msg, RED );
386 
387  msg = MessageTextFromValue( aUnits, GetTextHeight(), true );
388  aList.emplace_back( _( "Height" ), msg, RED );
389 }
390 
391 
393 {
394  switch( m_Type )
395  {
396  case TEXT_is_REFERENCE:
397  return wxString::Format( _( "Reference %s" ),
398  static_cast<MODULE*>( GetParent() )->GetReference() );
399 
400  case TEXT_is_VALUE:
401  return wxString::Format( _( "Value %s of %s" ),
402  GetShownText(),
403  static_cast<MODULE*>( GetParent() )->GetReference() );
404 
405  default: // wrap this one in quotes:
406  return wxString::Format( _( "Text \"%s\" of %s on %s" ),
408  static_cast<MODULE*>( GetParent() )->GetReference(),
409  GetLayerName() );
410  }
411 }
412 
413 
415 {
416  return footprint_text_xpm;
417 }
418 
419 
421 {
422  return new TEXTE_MODULE( *this );
423 }
424 
425 
427 {
428  double angle = GetDrawRotation();
429  EDA_RECT text_area = GetTextBox( -1, -1 );
430 
431  if( angle )
432  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
433 
434  return BOX2I( text_area.GetPosition(), text_area.GetSize() );
435 }
436 
437 
438 void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
439 {
440  if( IsVisible() )
441  aLayers[0] = GetLayer();
442  else
443  aLayers[0] = LAYER_MOD_TEXT_INVISIBLE;
444 
445  aCount = 1;
446 }
447 
448 
449 unsigned int TEXTE_MODULE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
450 {
451  const int HIDE = std::numeric_limits<unsigned int>::max();
452 
453  if( !aView )
454  return 0;
455 
456  // Hidden text gets put on the LAYER_MOD_TEXT_INVISIBLE for rendering, but
457  // should only render if its native layer is visible.
458  if( !aView->IsLayerVisible( GetLayer() ) )
459  return HIDE;
460 
461  // Handle Render tab switches
462  if( ( m_Type == TEXT_is_VALUE || GetText() == wxT( "%V" ) )
463  && !aView->IsLayerVisible( LAYER_MOD_VALUES ) )
464  return HIDE;
465 
466  if( ( m_Type == TEXT_is_REFERENCE || GetText() == wxT( "%R" ) )
467  && !aView->IsLayerVisible( LAYER_MOD_REFERENCES ) )
468  return HIDE;
469 
470  if( !IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_FR ) )
471  return HIDE;
472 
473  if( IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_BK ) )
474  return HIDE;
475 
477  return HIDE;
478 
479  if( IsBackLayer( m_Layer ) && !aView->IsLayerVisible( LAYER_MOD_TEXT_BK ) )
480  return HIDE;
481 
482  // Other layers are shown without any conditions
483  return 0;
484 }
485 
486 
488 {
489  /* First order optimization: no % means that no processing is
490  * needed; just hope that RVO and copy constructor implementation
491  * avoid to copy the whole block; anyway it should be better than
492  * rebuild the string one character at a time...
493  * Also it seems wise to only expand macros in user text (but there
494  * is no technical reason, probably) */
495 
496  if( (m_Type != TEXT_is_DIVERS) || (wxString::npos == GetText().find('%')) )
497  return GetText();
498 
499  wxString newbuf;
500  const MODULE *module = static_cast<MODULE*>( GetParent() );
501 
502  for( wxString::const_iterator it = GetText().begin(); it != GetText().end(); ++it )
503  {
504  // Process '%' and copy everything else
505  if( *it != '%' )
506  newbuf.append(*it);
507  else
508  {
509  /* Look at the next character (if is it there) and append
510  * its expansion */
511  ++it;
512 
513  if( it != GetText().end() )
514  {
515  switch( char(*it) )
516  {
517  case '%':
518  newbuf.append( '%' );
519  break;
520 
521  case 'R':
522  if( module )
523  newbuf.append( module->GetReference() );
524  break;
525 
526  case 'V':
527  if( module )
528  newbuf.append( module->GetValue() );
529  break;
530 
531  default:
532  newbuf.append( '?' );
533  break;
534  }
535  }
536  else
537  break; // The string is over and we can't ++ anymore
538  }
539  }
540 
541  return newbuf;
542 }
void SetMirrored(bool isMirrored)
Definition: eda_text.h:172
void SetTextAngle(double aAngle)
Definition: eda_text.h:150
EDA_UNITS
Definition: common.h:72
TEXT_TYPE
Text module type: there must be only one (and only one) for each of the reference and value texts in ...
bool IsBold() const
Definition: eda_text.h:167
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:237
double GetOrientation() const
Definition: class_module.h:215
virtual unsigned int ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
BOX2< VECTOR2I > BOX2I
Definition: box2.h:521
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:177
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:44
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:184
bool IsMirrored() const
Definition: eda_text.h:173
PNG memory record (file in memory).
Definition: bitmap_def.h:29
void KeepUpright(double aOldOrientation, double aNewOrientation)
Called when rotating the parent footprint.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
Implementation of conversion functions that require both schematic and board internal units.
TEXTE_MODULE(MODULE *parent, TEXT_TYPE text_type=TEXT_is_DIVERS)
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers.
void Rotate(const wxPoint &aOffset, double aAngle) override
Rotate text, in footprint editor (for instance in footprint rotation transform)
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils)
Definition: base_units.cpp:127
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
bool IsVisible() const
Definition: eda_text.h:170
int color
Definition: DXF_plotter.cpp:61
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:485
void Move(const wxPoint &aMoveVector) override
move text in move transform, in footprint editor
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:231
const wxString GetValue() const
Function GetValue.
Definition: class_module.h:461
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
double GetTextAngle() const
Definition: eda_text.h:158
show modules values (when texts are visibles)
int GetThickness() const
Return the pen width.
Definition: eda_text.h:148
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
void NORMALIZE_ANGLE_POS(T &Angle)
Definition: trigo.h:252
virtual wxString GetShownText() const override
Return the string actually shown after processing of the base text.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use Display options are relative to...
bool Contains(const wxPoint &aPoint) const
Function Contains.
This file contains miscellaneous commonly used macros and functions.
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:436
int GetTextHeight() const
Definition: eda_text.h:229
void SetTextX(int aX)
Definition: eda_text.h:234
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
bool IsItalic() const
Definition: eda_text.h:164
show modules on front
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:109
#define DEFAULT_TEXT_WIDTH
bool IsKeepUpright()
PCB_LAYER_ID m_Layer
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
void Print(PCB_BASE_FRAME *aFrame, wxDC *aDC, const wxPoint &aOffset=ZeroOffset) override
Function Print Print the text according to the footprint pos and orient.
class MODULE, a footprint
Definition: typeinfo.h:89
PCB_LAYER_ID
A quick note on layer IDs:
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:183
#define NULL
bool m_keepUpright
if true, keep rotation angle between -90 .
PCB_GENERAL_SETTINGS & Settings()
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false, int aMarkupFlags=0) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
Definition: eda_text.cpp:184
const wxSize & GetTextSize() const
Definition: eda_text.h:223
const wxPoint GetPosition() const
Definition: eda_rect.h:115
const EDA_RECT GetBoundingBoxRotated(wxPoint aRotCenter, double aAngle)
Function GetBoundingBoxRotated.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:163
Definition: colors.h:60
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
COLORS_DESIGN_SETTINGS & Colors()
void GRText(wxDC *aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function GRText Draw a graphic text (like module texts)
Definition: gr_text.cpp:143
const BITMAP_OPAQUE footprint_text_xpm[1]
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Function IsElementVisible tests whether a given element category is visible.
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip entity during module flip.
int GetLength() const
void SetLocalCoord()
Set relative coordinates.
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:449
double GetTextAngleDegrees() const
Definition: eda_text.h:160
int GetTextWidth() const
Definition: eda_text.h:226
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
Definition: eda_text.h:186
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
#define _(s)
Definition: 3d_actions.cpp:31
wxPoint m_Pos0
text coordinates relative to the footprint anchor, orient 0.
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const override
Test if aPoint is within the bounds of this object.
void SetDrawCoord()
Set absolute coordinates.
void GetMsgPanelInfo(EDA_UNITS aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:163
void Mirror(const wxPoint &aCentre, bool aMirrorAroundXAxis)
Mirror text position in footprint editing the text itself is not mirrored, and the layer not modified...
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
const wxPoint & GetTextPos() const
Definition: eda_text.h:232
bool IsParentFlipped() const
void SetTextAngle(double aAngle)
Module description (excepted pads)
VIEW.
Definition: view.h:61
T NormalizeAngle360Min(T Angle)
Normalize angle to be > -360.0 and < 360.0 Angle equal to -360 or +360 are set to 0.
Definition: trigo.h:233
Message panel definition file.
BOARD_ITEM_CONTAINER * GetParent() const
TEXT_TYPE m_Type
0=ref, 1=val, etc.
double GetDrawRotation() const
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
const wxPoint GetPosition() const override
Definition: class_module.h:210
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:123
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
show modules references (when texts are visibles)
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
void SetThickness(int aNewThickness)
Set the pen width.
Definition: eda_text.h:143
void SetTextY(int aY)
Definition: eda_text.h:235
const wxSize GetSize() const
Definition: eda_rect.h:103
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207
bool IsLayerVisible(int aLayer) const
Function IsLayerVisible() Returns information about visibility of a particular layer.
Definition: view.h:416
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62