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