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 #include <pgm_base.h>
44 
45 
47  BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
48  EDA_TEXT()
49 {
50  MODULE* module = static_cast<MODULE*>( m_Parent );
51 
52  m_Type = text_type;
53  m_keepUpright = true;
54 
55  // Set text thickness to a default value
56  SetThickness( Millimeter2iu( DEFAULT_TEXT_WIDTH ) );
57  SetLayer( F_SilkS );
58 
59  // Set position and give a default layer if a valid parent footprint exists
60  if( module && ( module->Type() == PCB_MODULE_T ) )
61  {
62  SetTextPos( module->GetPosition() );
63 
64  if( IsBackLayer( module->GetLayer() ) )
65  {
66  SetLayer( B_SilkS );
67  SetMirrored( true );
68  }
69  }
70 
71  SetDrawCoord();
72 }
73 
74 
76 {
77 }
78 
79 
80 void TEXTE_MODULE::SetTextAngle( double aAngle )
81 {
83 }
84 
85 
86 bool TEXTE_MODULE::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
87 {
88  EDA_RECT rect = GetTextBox( -1 );
89  wxPoint location = aPoint;
90 
91  rect.Inflate( aAccuracy );
92 
93  RotatePoint( &location, GetTextPos(), -GetDrawRotation() );
94 
95  return rect.Contains( location );
96 }
97 
98 
99 bool TEXTE_MODULE::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
100 {
101  EDA_RECT rect = aRect;
102 
103  rect.Inflate( aAccuracy );
104 
105  if( aContains )
106  return rect.Contains( GetBoundingBox() );
107  else
108  return rect.Intersects( GetTextBox( -1 ), GetDrawRotation() );
109 }
110 
111 
112 void TEXTE_MODULE::KeepUpright( double aOldOrientation, double aNewOrientation )
113 {
114  if( !IsKeepUpright() )
115  return;
116 
117  double currentAngle = GetTextAngle() + aOldOrientation;
118  double newAngle = GetTextAngle() + aNewOrientation;
119 
120  NORMALIZE_ANGLE_POS( currentAngle );
121  NORMALIZE_ANGLE_POS( newAngle );
122 
123  bool isFlipped = currentAngle >= 1800.0;
124  bool needsFlipped = newAngle >= 1800.0;
125 
126  if( isFlipped != needsFlipped )
127  {
132 
133  SetTextAngle( GetTextAngle() + 1800.0 );
134  SetDrawCoord();
135  }
136 }
137 
138 
139 void TEXTE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
140 {
141  // Used in footprint editing
142  // Note also in module editor, m_Pos0 = m_Pos
143 
144  wxPoint pt = GetTextPos();
145  RotatePoint( &pt, aRotCentre, aAngle );
146  SetTextPos( pt );
147 
148  SetTextAngle( GetTextAngle() + aAngle );
149  SetLocalCoord();
150 }
151 
152 
153 void TEXTE_MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
154 {
155  // flipping the footprint is relative to the X axis
156  if( aFlipLeftRight )
157  SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
158  else
159  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
160 
162 
163  SetLayer( FlipLayer( GetLayer() ) );
165  SetLocalCoord();
166 
167  // adjust justified text for mirroring
169  {
172  else
174 
175  SetDrawCoord();
176  }
177 }
178 
180 {
181  if( GetParent() && GetParent()->GetLayer() == B_Cu )
182  return true;
183  return false;
184 }
185 
186 
187 void TEXTE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
188 {
189  // Used in modedit, to transform the footprint
190  // the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
191  // the position is mirrored, but the text itself is not mirrored
192  if( aMirrorAroundXAxis )
193  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
194  else
195  SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
196 
197  SetLocalCoord();
198 }
199 
200 
201 void TEXTE_MODULE::Move( const wxPoint& aMoveVector )
202 {
203  Offset( aMoveVector );
204  SetLocalCoord();
205 }
206 
207 
209 {
210  return GetText().Len();
211 }
212 
213 
215 {
216  const MODULE* module = static_cast<const MODULE*>( m_Parent );
217 
218  SetTextPos( m_Pos0 );
219 
220  if( module )
221  {
222  double angle = module->GetOrientation();
223 
224  wxPoint pt = GetTextPos();
225  RotatePoint( &pt, angle );
226  SetTextPos( pt );
227 
228  Offset( module->GetPosition() );
229  }
230 }
231 
232 
234 {
235  const MODULE* module = static_cast<const MODULE*>( m_Parent );
236 
237  if( module )
238  {
239  m_Pos0 = GetTextPos() - module->GetPosition();
240 
241  double angle = module->GetOrientation();
242 
243  RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
244  }
245  else
246  {
247  m_Pos0 = GetTextPos();
248  }
249 }
250 
252 {
253  double angle = GetDrawRotation();
254  EDA_RECT text_area = GetTextBox( -1, -1 );
255 
256  if( angle )
257  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
258 
259  return text_area;
260 }
261 
262 
263 void TEXTE_MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset )
264 {
265  /* parent must *not* be NULL (a footprint text without a footprint parent has no sense) */
266  wxASSERT( m_Parent );
267 
268  BOARD* brd = GetBoard( );
269  KIGFX::COLOR4D color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( GetLayer() );
270  PCB_LAYER_ID text_layer = GetLayer();
271 
272  if( !brd->IsLayerVisible( m_Layer )
273  || ( IsFrontLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_FR ) )
274  || ( IsBackLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_BK ) ) )
275  return;
276 
277  if( !brd->IsElementVisible( LAYER_MOD_REFERENCES ) && GetText() == wxT( "%R" ) )
278  return;
279 
280  if( !brd->IsElementVisible( LAYER_MOD_VALUES ) && GetText() == wxT( "%V" ) )
281  return;
282 
283  // Invisible texts are still drawn (not plotted) in LAYER_MOD_TEXT_INVISIBLE
284  // Just because we must have to edit them (at least to make them visible)
285  if( !IsVisible() )
286  {
288  return;
289 
290  color = Pgm().GetSettingsManager().GetColorSettings()->GetColor( LAYER_MOD_TEXT_INVISIBLE );
291  }
292 
293  // Draw mode compensation for the width
294  int width = GetThickness();
295 
297  width = -width;
298 
299  wxPoint pos = GetTextPos() - aOffset;
300 
301  // Draw the text proper, with the right attributes
302  wxSize size = GetTextSize();
303  double orient = GetDrawRotation();
304 
305  // If the text is mirrored : negate size.x (mirror / Y axis)
306  if( IsMirrored() )
307  size.x = -size.x;
308 
309  GRText( aDC, pos, color, GetShownText(), orient, size, GetHorizJustify(), GetVertJustify(),
310  width, IsItalic(), IsBold() );
311 }
312 
313 
315 {
316  MODULE* module = (MODULE*) m_Parent;
317  double rotation = GetTextAngle();
318 
319  if( module )
320  rotation += module->GetOrientation();
321 
322  if( m_keepUpright )
323  {
324  // Keep angle between -90 .. 90 deg. Otherwise the text is not easy to read
325  while( rotation > 900 )
326  rotation -= 1800;
327 
328  while( rotation < -900 )
329  rotation += 1800;
330  }
331  else
332  {
333  NORMALIZE_ANGLE_POS( rotation );
334  }
335 
336  return rotation;
337 }
338 
339 
340 // see class_text_mod.h
341 void TEXTE_MODULE::GetMsgPanelInfo( EDA_UNITS aUnits, std::vector<MSG_PANEL_ITEM>& aList )
342 {
343  MODULE* module = (MODULE*) m_Parent;
344 
345  if( module == NULL ) // Happens in modedit, and for new texts
346  return;
347 
348  wxString msg, Line;
349 
350  static const wxString text_type_msg[3] =
351  {
352  _( "Ref." ), _( "Value" ), _( "Text" )
353  };
354 
355  Line = module->GetReference();
356  aList.emplace_back( _( "Footprint" ), Line, DARKCYAN );
357 
358  Line = GetShownText();
359  aList.emplace_back( _( "Text" ), Line, BROWN );
360 
361  wxASSERT( m_Type >= TEXT_is_REFERENCE && m_Type <= TEXT_is_DIVERS );
362  aList.emplace_back( _( "Type" ), text_type_msg[m_Type], DARKGREEN );
363 
364  if( !IsVisible() )
365  msg = _( "No" );
366  else
367  msg = _( "Yes" );
368 
369  aList.emplace_back( _( "Display" ), msg, DARKGREEN );
370 
371  // Display text layer
372  aList.emplace_back( _( "Layer" ), GetLayerName(), DARKGREEN );
373 
374  if( IsMirrored() )
375  msg = _( "Yes" );
376  else
377  msg = _( "No" );
378 
379  aList.emplace_back( _( "Mirror" ), msg, DARKGREEN );
380 
381  msg.Printf( wxT( "%.1f" ), GetTextAngleDegrees() );
382  aList.emplace_back( _( "Angle" ), msg, DARKGREEN );
383 
384  msg = MessageTextFromValue( aUnits, GetThickness(), true );
385  aList.emplace_back( _( "Thickness" ), msg, DARKGREEN );
386 
387  msg = MessageTextFromValue( aUnits, GetTextWidth(), true );
388  aList.emplace_back( _( "Width" ), msg, RED );
389 
390  msg = MessageTextFromValue( aUnits, GetTextHeight(), true );
391  aList.emplace_back( _( "Height" ), msg, RED );
392 }
393 
394 
396 {
397  switch( m_Type )
398  {
399  case TEXT_is_REFERENCE:
400  return wxString::Format( _( "Reference %s" ),
401  static_cast<MODULE*>( GetParent() )->GetReference() );
402 
403  case TEXT_is_VALUE:
404  return wxString::Format( _( "Value %s of %s" ),
405  GetShownText(),
406  static_cast<MODULE*>( GetParent() )->GetReference() );
407 
408  default: // wrap this one in quotes:
409  return wxString::Format( _( "Text \"%s\" of %s on %s" ),
411  static_cast<MODULE*>( GetParent() )->GetReference(),
412  GetLayerName() );
413  }
414 }
415 
416 
418 {
419  return footprint_text_xpm;
420 }
421 
422 
424 {
425  return new TEXTE_MODULE( *this );
426 }
427 
428 
430 {
431  double angle = GetDrawRotation();
432  EDA_RECT text_area = GetTextBox( -1, -1 );
433 
434  if( angle )
435  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
436 
437  return BOX2I( text_area.GetPosition(), text_area.GetSize() );
438 }
439 
440 
441 void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
442 {
443  if( IsVisible() )
444  aLayers[0] = GetLayer();
445  else
446  aLayers[0] = LAYER_MOD_TEXT_INVISIBLE;
447 
448  aCount = 1;
449 }
450 
451 
452 unsigned int TEXTE_MODULE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
453 {
454  const int HIDE = std::numeric_limits<unsigned int>::max();
455 
456  if( !aView )
457  return 0;
458 
459  // Hidden text gets put on the LAYER_MOD_TEXT_INVISIBLE for rendering, but
460  // should only render if its native layer is visible.
461  if( !aView->IsLayerVisible( GetLayer() ) )
462  return HIDE;
463 
464  // Handle Render tab switches
465  if( ( m_Type == TEXT_is_VALUE || GetText() == wxT( "%V" ) )
466  && !aView->IsLayerVisible( LAYER_MOD_VALUES ) )
467  return HIDE;
468 
469  if( ( m_Type == TEXT_is_REFERENCE || GetText() == wxT( "%R" ) )
470  && !aView->IsLayerVisible( LAYER_MOD_REFERENCES ) )
471  return HIDE;
472 
473  if( !IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_FR ) )
474  return HIDE;
475 
476  if( IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_BK ) )
477  return HIDE;
478 
480  return HIDE;
481 
482  if( IsBackLayer( m_Layer ) && !aView->IsLayerVisible( LAYER_MOD_TEXT_BK ) )
483  return HIDE;
484 
485  // Other layers are shown without any conditions
486  return 0;
487 }
488 
489 
491 {
492  /* First order optimization: no % means that no processing is
493  * needed; just hope that RVO and copy constructor implementation
494  * avoid to copy the whole block; anyway it should be better than
495  * rebuild the string one character at a time...
496  * Also it seems wise to only expand macros in user text (but there
497  * is no technical reason, probably) */
498 
499  if( (m_Type != TEXT_is_DIVERS) || (wxString::npos == GetText().find('%')) )
500  return GetText();
501 
502  wxString newbuf;
503  const MODULE *module = static_cast<MODULE*>( GetParent() );
504 
505  for( wxString::const_iterator it = GetText().begin(); it != GetText().end(); ++it )
506  {
507  // Process '%' and copy everything else
508  if( *it != '%' )
509  newbuf.append(*it);
510  else
511  {
512  /* Look at the next character (if is it there) and append
513  * its expansion */
514  ++it;
515 
516  if( it != GetText().end() )
517  {
518  switch( char(*it) )
519  {
520  case '%':
521  newbuf.append( '%' );
522  break;
523 
524  case 'R':
525  if( module )
526  newbuf.append( module->GetReference() );
527  break;
528 
529  case 'V':
530  if( module )
531  newbuf.append( module->GetValue() );
532  break;
533 
534  default:
535  newbuf.append( '?' );
536  break;
537  }
538  }
539  else
540  break; // The string is over and we can't ++ anymore
541  }
542  }
543 
544  return newbuf;
545 }
void SetMirrored(bool isMirrored)
Definition: eda_text.h:172
void SetTextAngle(double aAngle)
Definition: eda_text.h:150
EDA_UNITS
Definition: common.h:184
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:183
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:44
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
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)
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:257
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
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
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 .
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.
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.
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:127
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:431
double GetTextAngleDegrees() const
Definition: eda_text.h:160
int GetTextWidth() const
Definition: eda_text.h:226
see class PGM_BASE
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:163
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:33
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:166
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:237
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:212
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:40
Definition: colors.h:62