KiCad PCB EDA Suite
fp_text.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 <pcb_edit_frame.h>
27 #include <base_units.h>
28 #include <bitmaps.h>
29 #include <board.h>
30 #include <core/mirror.h>
31 #include <footprint.h>
33 #include <trigo.h>
34 
35 FP_TEXT::FP_TEXT( FOOTPRINT* aParentFootprint, TEXT_TYPE text_type ) :
36  BOARD_ITEM( aParentFootprint, PCB_FP_TEXT_T ),
37  EDA_TEXT()
38 {
39  FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_parent );
40 
41  m_Type = text_type;
42  m_keepUpright = true;
43 
44  // Set text thickness to a default value
46  SetLayer( F_SilkS );
47 
48  // Set position and give a default layer if a valid parent footprint exists
49  if( parentFootprint && parentFootprint->Type() == PCB_FOOTPRINT_T )
50  {
51  SetTextPos( parentFootprint->GetPosition() );
52 
53  if( IsBackLayer( parentFootprint->GetLayer() ) )
54  {
55  SetLayer( B_SilkS );
56  SetMirrored( true );
57  }
58  }
59 
60  SetDrawCoord();
61 }
62 
63 
65 {
66 }
67 
68 
69 void FP_TEXT::SetTextAngle( double aAngle )
70 {
72 }
73 
74 
75 bool FP_TEXT::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
76 {
77  EDA_RECT rect = GetTextBox();
78  wxPoint location = aPoint;
79 
80  rect.Inflate( aAccuracy );
81 
82  RotatePoint( &location, GetTextPos(), -GetDrawRotation() );
83 
84  return rect.Contains( location );
85 }
86 
87 
88 bool FP_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
89 {
90  EDA_RECT rect = aRect;
91 
92  rect.Inflate( aAccuracy );
93 
94  if( aContains )
95  return rect.Contains( GetBoundingBox() );
96  else
97  return rect.Intersects( GetTextBox(), GetDrawRotation() );
98 }
99 
100 
101 void FP_TEXT::KeepUpright( double aOldOrientation, double aNewOrientation )
102 {
103  if( !IsKeepUpright() )
104  return;
105 
106  double currentAngle = GetTextAngle() + aOldOrientation;
107  double newAngle = GetTextAngle() + aNewOrientation;
108 
109  NORMALIZE_ANGLE_POS( currentAngle );
110  NORMALIZE_ANGLE_POS( newAngle );
111 
112  bool isFlipped = currentAngle >= 1800.0;
113  bool needsFlipped = newAngle >= 1800.0;
114 
115  if( isFlipped != needsFlipped )
116  {
121 
122  SetTextAngle( GetTextAngle() + 1800.0 );
123  SetDrawCoord();
124  }
125 }
126 
127 
128 void FP_TEXT::Rotate( const wxPoint& aRotCentre, double aAngle )
129 {
130  // Used in footprint editing
131  // Note also in footprint editor, m_Pos0 = m_Pos
132 
133  wxPoint pt = GetTextPos();
134  RotatePoint( &pt, aRotCentre, aAngle );
135  SetTextPos( pt );
136 
137  SetTextAngle( GetTextAngle() + aAngle );
138  SetLocalCoord();
139 }
140 
141 
142 void FP_TEXT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
143 {
144  // flipping the footprint is relative to the X axis
145  if( aFlipLeftRight )
146  SetTextX( ::MIRRORVAL( GetTextPos().x, aCentre.x ) );
147  else
148  SetTextY( ::MIRRORVAL( GetTextPos().y, aCentre.y ) );
149 
151 
152  SetLayer( FlipLayer( GetLayer() ) );
154  SetLocalCoord();
155 
156  // adjust justified text for mirroring
158  {
159  SetHorizJustify( static_cast<EDA_TEXT_HJUSTIFY_T>( -GetHorizJustify() ) );
160  SetDrawCoord();
161  }
162 }
163 
165 {
166  if( GetParent() && GetParent()->GetLayer() == B_Cu )
167  return true;
168  return false;
169 }
170 
171 
172 void FP_TEXT::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
173 {
174  // the position is mirrored, but the text itself is not mirrored
175 
176  if( aMirrorAroundXAxis )
177  SetTextY( ::MIRRORVAL( GetTextPos().y, aCentre.y ) );
178  else
179  SetTextX( ::MIRRORVAL( GetTextPos().x, aCentre.x ) );
180 
181  SetLocalCoord();
182 }
183 
184 
185 void FP_TEXT::Move( const wxPoint& aMoveVector )
186 {
187  Offset( aMoveVector );
188  SetLocalCoord();
189 }
190 
191 
193 {
194  return GetText().Len();
195 }
196 
197 
199 {
200  const FOOTPRINT* parentFootprint = static_cast<const FOOTPRINT*>( m_parent );
201 
202  SetTextPos( m_Pos0 );
203 
204  if( parentFootprint )
205  {
206  double angle = parentFootprint->GetOrientation();
207 
208  wxPoint pt = GetTextPos();
209  RotatePoint( &pt, angle );
210  SetTextPos( pt );
211 
212  Offset( parentFootprint->GetPosition() );
213  }
214 }
215 
216 
218 {
219  const FOOTPRINT* parentFootprint = static_cast<const FOOTPRINT*>( m_parent );
220 
221  if( parentFootprint )
222  {
223  m_Pos0 = GetTextPos() - parentFootprint->GetPosition();
224 
225  double angle = parentFootprint->GetOrientation();
226 
227  RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
228  }
229  else
230  {
231  m_Pos0 = GetTextPos();
232  }
233 }
234 
236 {
237  double angle = GetDrawRotation();
238  EDA_RECT text_area = GetTextBox();
239 
240  if( angle )
241  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
242 
243  return text_area;
244 }
245 
246 
248 {
249  FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_parent );
250  double rotation = GetTextAngle();
251 
252  if( parentFootprint )
253  rotation += parentFootprint->GetOrientation();
254 
255  if( m_keepUpright )
256  {
257  // Keep angle between 0 .. 90 deg. Otherwise the text is not easy to read
258  while( rotation > 900 )
259  rotation -= 1800;
260 
261  while( rotation < 0 )
262  rotation += 1800;
263  }
264  else
265  {
266  NORMALIZE_ANGLE_POS( rotation );
267  }
268 
269  return rotation;
270 }
271 
272 
273 void FP_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
274 {
275  FOOTPRINT* fp = static_cast<FOOTPRINT*>( m_parent );
276  wxString msg;
277 
278  static const wxString text_type_msg[3] =
279  {
280  _( "Ref." ), _( "Value" ), _( "Text" )
281  };
282 
283  aList.emplace_back( _( "Footprint" ), fp ? fp->GetReference() : _( "<invalid>" ) );
284 
285  aList.emplace_back( _( "Text" ), GetShownText() );
286 
287  wxASSERT( m_Type >= TEXT_is_REFERENCE && m_Type <= TEXT_is_DIVERS );
288  aList.emplace_back( _( "Type" ), text_type_msg[m_Type] );
289 
290  aList.emplace_back( _( "Display" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
291 
292  // Display text layer
293  aList.emplace_back( _( "Layer" ), GetLayerName() );
294 
295  aList.emplace_back( _( "Mirror" ), IsMirrored() ? _( "Yes" ) : _( "No" ) );
296 
297  msg.Printf( wxT( "%.1f" ), GetTextAngleDegrees() );
298  aList.emplace_back( _( "Angle" ), msg );
299 
300  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextThickness() );
301  aList.emplace_back( _( "Thickness" ), msg );
302 
303  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() );
304  aList.emplace_back( _( "Width" ), msg );
305 
306  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() );
307  aList.emplace_back( _( "Height" ), msg );
308 }
309 
310 
311 wxString FP_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const
312 {
313  switch( m_Type )
314  {
315  case TEXT_is_REFERENCE:
316  return wxString::Format( _( "Reference '%s'" ),
317  static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
318 
319  case TEXT_is_VALUE:
320  return wxString::Format( _( "Value '%s' of %s" ),
321  GetShownText(),
322  static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
323 
324  default:
325  return wxString::Format( _( "Footprint Text '%s' of %s" ),
327  static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
328  }
329 }
330 
331 
333 {
334  return footprint_text_xpm;
335 }
336 
337 
339 {
340  return new FP_TEXT( *this );
341 }
342 
343 
345 {
346  double angle = GetDrawRotation();
347  EDA_RECT text_area = GetTextBox();
348 
349  if( angle != 0.0 )
350  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
351 
352  return BOX2I( text_area.GetPosition(), text_area.GetSize() );
353 }
354 
355 
356 void FP_TEXT::ViewGetLayers( int aLayers[], int& aCount ) const
357 {
358  if( IsVisible() )
359  aLayers[0] = GetLayer();
360  else
361  aLayers[0] = LAYER_MOD_TEXT_INVISIBLE;
362 
363  aCount = 1;
364 }
365 
366 
367 double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
368 {
369  constexpr double HIDE = (double)std::numeric_limits<double>::max();
370 
371  if( !aView )
372  return 0.0;
373 
374  // Hidden text gets put on the LAYER_MOD_TEXT_INVISIBLE for rendering, but
375  // should only render if its native layer is visible.
376  if( !aView->IsLayerVisible( GetLayer() ) )
377  return HIDE;
378 
379  // Handle Render tab switches
380  if( ( m_Type == TEXT_is_VALUE || GetText() == wxT( "${VALUE}" ) )
381  && !aView->IsLayerVisible( LAYER_MOD_VALUES ) )
382  return HIDE;
383 
384  if( ( m_Type == TEXT_is_REFERENCE || GetText() == wxT( "${REFERENCE}" ) )
385  && !aView->IsLayerVisible( LAYER_MOD_REFERENCES ) )
386  return HIDE;
387 
388  if( !IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_FR ) )
389  return HIDE;
390 
391  if( IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_BK ) )
392  return HIDE;
393 
395  return HIDE;
396 
397  if( IsBackLayer( m_layer ) && !aView->IsLayerVisible( LAYER_MOD_TEXT_BK ) )
398  return HIDE;
399 
400  // Other layers are shown without any conditions
401  return 0.0;
402 }
403 
404 
405 wxString FP_TEXT::GetShownText( int aDepth ) const
406 {
407  const FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( GetParent() );
408  wxASSERT( parentFootprint );
409  const BOARD* board = parentFootprint->GetBoard();
410 
411  std::function<bool( wxString* )> footprintResolver =
412  [&]( wxString* token ) -> bool
413  {
414  return parentFootprint && parentFootprint->ResolveTextVar( token, aDepth );
415  };
416 
417  std::function<bool( wxString* )> boardTextResolver =
418  [&]( wxString* token ) -> bool
419  {
420  return board->ResolveTextVar( token, aDepth + 1 );
421  };
422 
423  bool processTextVars = false;
424  wxString text = EDA_TEXT::GetShownText( &processTextVars );
425 
426  if( processTextVars )
427  {
428  PROJECT* project = nullptr;
429 
430  if( parentFootprint && parentFootprint->GetParent() )
431  project = static_cast<BOARD*>( parentFootprint->GetParent() )->GetProject();
432 
433  if( aDepth < 10 )
434  text = ExpandTextVars( text, &footprintResolver, project, &boardTextResolver );
435  }
436 
437  return text;
438 }
439 
440 
441 std::shared_ptr<SHAPE> FP_TEXT::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
442 {
443  return GetEffectiveTextShape();
444 }
445 
446 
447 static struct FP_TEXT_DESC
448 {
450  {
457  }
458 } _FP_TEXT_DESC;
void SetMirrored(bool isMirrored)
Definition: eda_text.h:194
virtual double GetDrawRotation() const override
Definition: fp_text.cpp:247
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:259
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Definition: fp_text.cpp:338
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:162
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Definition: base_units.cpp:123
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
void KeepUpright(double aOldOrientation, double aNewOrientation)
Called when rotating the parent footprint.
Definition: fp_text.cpp:101
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:64
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:55
bool IsMirrored() const
Definition: eda_text.h:195
class FP_TEXT, text in a footprint
Definition: typeinfo.h:93
PROJECT holds project specific data.
Definition: project.h:63
PNG memory record (file in memory).
Definition: bitmap_def.h:29
const EDA_RECT GetBoundingBoxRotated(wxPoint aRotCenter, double aAngle) const
Function GetBoundingBoxRotated.
Definition: eda_rect.cpp:511
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers.
Definition: fp_text.cpp:344
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
Definition: board_item.h:206
Implementation of conversion functions that require both schematic and board internal units.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
Definition: board_item.h:86
void Move(const wxPoint &aMoveVector) override
move text in move transform, in footprint editor
Definition: fp_text.cpp:185
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
bool IsVisible() const
Definition: eda_text.h:192
void SetTextAngle(double aAngle) override
Definition: fp_text.cpp:69
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
Definition: footprint.cpp:408
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Definition: lset.cpp:521
EDA_RECT GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
Definition: eda_text.cpp:223
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:253
show footprints on back
double GetOrientation() const
Definition: footprint.h:204
double GetTextAngle() const
Definition: eda_text.h:180
void SetDrawCoord()
Set absolute coordinates.
Definition: fp_text.cpp:198
show footprints values (when texts are visibles)
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
Definition: fp_text.cpp:273
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail (LOD) of the item.
Definition: fp_text.cpp:367
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const override
Function GetEffectiveShape Some pad shapes can be complex (rounded/chamfered rectangle),...
Definition: fp_text.cpp:441
void Rotate(const wxPoint &aOffset, double aAngle) override
Rotate text, in footprint editor (for instance in footprint rotation transform)
Definition: fp_text.cpp:128
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
void NORMALIZE_ANGLE_POS(T &Angle)
Definition: trigo.h:274
int GetTextThickness() const
Definition: eda_text.h:165
The base class for create windows for drawing purpose.
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names
Definition: property_mgr.h:247
void Mirror(const wxPoint &aCentre, bool aMirrorAroundXAxis)
Mirror text position in footprint editing the text itself is not mirrored, and the layer not modified...
Definition: fp_text.cpp:172
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
Definition: fp_text.cpp:356
bool Contains(const wxPoint &aPoint) const
Function Contains.
Definition: eda_rect.cpp:57
int GetTextHeight() const
Definition: eda_text.h:251
void SetTextX(int aX)
Definition: eda_text.h:256
show footprints on front
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:119
#define DEFAULT_TEXT_WIDTH
PCB_LAYER_ID
A quick note on layer IDs:
wxPoint m_Pos0
text coordinates relative to the footprint anchor, orient 0.
Definition: fp_text.h:242
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:205
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip entity during footprint flip.
Definition: fp_text.cpp:142
static struct FP_TEXT_DESC _FP_TEXT_DESC
FP_TEXT(FOOTPRINT *aParentFootprint, TEXT_TYPE text_type=TEXT_is_DIVERS)
Definition: fp_text.cpp:35
const wxPoint GetPosition() const
Definition: eda_rect.h:115
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declares an inheritance relationship between types.
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:202
bool m_keepUpright
if true, keep rotation angle between -90 .
Definition: fp_text.h:245
int GetLength() const
Definition: fp_text.cpp:192
const wxString GetReference() const
Function GetReference.
Definition: footprint.h:440
TEXT_TYPE
Footprint text type: there must be only one (and only one) for each of the reference value texts in o...
Definition: fp_text.h:48
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Definition: fp_text.cpp:311
TEXT_TYPE m_Type
0=ref, 1=val, etc.
Definition: fp_text.h:240
class FOOTPRINT, a footprint
Definition: typeinfo.h:89
wxString ExpandTextVars(const wxString &aSource, const std::function< bool(wxString *)> *aLocalResolver, const PROJECT *aProject, const std::function< bool(wxString *)> *aFallbackResolver)
Expand '${var-name}' templates in text.
Definition: common.cpp:58
const BITMAP_OPAQUE footprint_text_xpm[1]
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
EDA_UNITS
Definition: eda_units.h:38
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: fp_text.cpp:332
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
Definition: fp_text.cpp:235
double GetTextAngleDegrees() const
Definition: eda_text.h:182
int GetTextWidth() const
Definition: eda_text.h:248
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape() const
Definition: eda_text.cpp:624
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:186
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
Definition: eda_text.h:208
#define _(s)
Definition: 3d_actions.cpp:33
bool IsParentFlipped() const
Definition: fp_text.cpp:164
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
void AddTypeCast(TYPE_CAST_BASE *aCast)
Registers a type converter.
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
void SetLocalCoord()
Set relative coordinates.
Definition: fp_text.cpp:217
T MIRRORVAL(T aPoint, T aMirrorRef)
Returns the mirror of aPoint relative to the aMirrorRef.
Definition: mirror.h:31
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
wxPoint GetPosition() const override
Definition: footprint.h:200
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
Definition: eda_rect.cpp:150
PCB_LAYER_ID m_layer
Definition: board_item.h:89
const wxPoint & GetTextPos() const
Definition: eda_text.h:254
bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const override
Test if aPoint is within the bounds of this object.
Definition: fp_text.cpp:75
Provides class metadata.
Definition: property_mgr.h:61
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.h:164
virtual void SetTextAngle(double aAngle)
Definition: eda_text.h:173
VIEW.
Definition: view.h:63
bool IsKeepUpright()
Definition: fp_text.h:108
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:240
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:216
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:179
virtual wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
Definition: fp_text.cpp:405
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.
Definition: board_item.cpp:60
static constexpr int Millimeter2iu(double mm)
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
Definition: board_item.h:185
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
virtual wxString GetShownText(int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition: eda_text.h:140
show footprints references (when texts are visibles)
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
Definition: eda_rect.cpp:363
void SetTextY(int aY)
Definition: eda_text.h:257
~FP_TEXT()
Definition: fp_text.cpp:64
const wxSize GetSize() const
Definition: eda_rect.h:103
KICAD_T Type() const
Function Type()
Definition: eda_item.h:181
bool IsLayerVisible(int aLayer) const
Function IsLayerVisible() Returns information about visibility of a particular layer.
Definition: view.h:402