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 currentAngle = GetTextAngle() + aOldOrientation;
108  double newAngle = GetTextAngle() + aNewOrientation;
109 
110  NORMALIZE_ANGLE_POS( currentAngle );
111  NORMALIZE_ANGLE_POS( newAngle );
112 
113  bool isFlipped = currentAngle >= 1800.0;
114  bool needsFlipped = newAngle >= 1800.0;
115 
116  if( isFlipped != needsFlipped )
117  {
122 
123  SetTextAngle( GetTextAngle() + 1800.0 );
124  SetDrawCoord();
125  }
126 }
127 
128 
129 void FP_TEXT::Rotate( const wxPoint& aRotCentre, double aAngle )
130 {
131  // Used in footprint editing
132  // Note also in footprint editor, m_Pos0 = m_Pos
133 
134  wxPoint pt = GetTextPos();
135  RotatePoint( &pt, aRotCentre, aAngle );
136  SetTextPos( pt );
137 
138  SetTextAngle( GetTextAngle() + aAngle );
139  SetLocalCoord();
140 }
141 
142 
143 void FP_TEXT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
144 {
145  // flipping the footprint is relative to the X axis
146  if( aFlipLeftRight )
147  SetTextX( ::MIRRORVAL( GetTextPos().x, aCentre.x ) );
148  else
149  SetTextY( ::MIRRORVAL( GetTextPos().y, aCentre.y ) );
150 
152 
153  SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
155  SetLocalCoord();
156 
157  // adjust justified text for mirroring
159  {
160  SetHorizJustify( static_cast<EDA_TEXT_HJUSTIFY_T>( -GetHorizJustify() ) );
161  SetDrawCoord();
162  }
163 }
164 
166 {
167  if( GetParent() && GetParent()->GetLayer() == B_Cu )
168  return true;
169  return false;
170 }
171 
172 
173 void FP_TEXT::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
174 {
175  // the position is mirrored, but the text itself is not mirrored
176 
177  if( aMirrorAroundXAxis )
178  SetTextY( ::MIRRORVAL( GetTextPos().y, aCentre.y ) );
179  else
180  SetTextX( ::MIRRORVAL( GetTextPos().x, aCentre.x ) );
181 
182  SetLocalCoord();
183 }
184 
185 
186 void FP_TEXT::Move( const wxPoint& aMoveVector )
187 {
188  Offset( aMoveVector );
189  SetLocalCoord();
190 }
191 
192 
194 {
195  return GetText().Len();
196 }
197 
198 
200 {
201  const FOOTPRINT* parentFootprint = static_cast<const FOOTPRINT*>( m_parent );
202 
203  SetTextPos( m_Pos0 );
204 
205  if( parentFootprint )
206  {
207  double angle = parentFootprint->GetOrientation();
208 
209  wxPoint pt = GetTextPos();
210  RotatePoint( &pt, angle );
211  SetTextPos( pt );
212 
213  Offset( parentFootprint->GetPosition() );
214  }
215 }
216 
217 
219 {
220  const FOOTPRINT* parentFootprint = static_cast<const FOOTPRINT*>( m_parent );
221 
222  if( parentFootprint )
223  {
224  m_Pos0 = GetTextPos() - parentFootprint->GetPosition();
225 
226  double angle = parentFootprint->GetOrientation();
227 
228  RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
229  }
230  else
231  {
232  m_Pos0 = GetTextPos();
233  }
234 }
235 
237 {
238  double angle = GetDrawRotation();
239  EDA_RECT text_area = GetTextBox();
240 
241  if( angle )
242  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
243 
244  return text_area;
245 }
246 
247 
249 {
250  FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( m_parent );
251  double rotation = GetTextAngle();
252 
253  if( parentFootprint )
254  rotation += parentFootprint->GetOrientation();
255 
256  if( m_keepUpright )
257  {
258  // Keep angle between 0 .. 90 deg. Otherwise the text is not easy to read
259  while( rotation > 900 )
260  rotation -= 1800;
261 
262  while( rotation < 0 )
263  rotation += 1800;
264  }
265  else
266  {
267  NORMALIZE_ANGLE_POS( rotation );
268  }
269 
270  return rotation;
271 }
272 
273 
274 void FP_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
275 {
276  FOOTPRINT* fp = static_cast<FOOTPRINT*>( m_parent );
277  wxString msg;
278 
279  static const wxString text_type_msg[3] =
280  {
281  _( "Ref." ), _( "Value" ), _( "Text" )
282  };
283 
284  aList.emplace_back( _( "Footprint" ), fp ? fp->GetReference() : _( "<invalid>" ) );
285 
286  // Don't use GetShownText() here; we want to show the user the variable references
287  aList.emplace_back( _( "Text" ), UnescapeString( GetText() ) );
288 
289  wxASSERT( m_Type >= TEXT_is_REFERENCE && m_Type <= TEXT_is_DIVERS );
290  aList.emplace_back( _( "Type" ), text_type_msg[m_Type] );
291 
292  if( IsLocked() )
293  aList.emplace_back( _( "Status" ), _( "locked" ) );
294 
295  aList.emplace_back( _( "Display" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
296 
297  // Display text layer
298  aList.emplace_back( _( "Layer" ), GetLayerName() );
299 
300  aList.emplace_back( _( "Mirror" ), IsMirrored() ? _( "Yes" ) : _( "No" ) );
301 
302  msg.Printf( wxT( "%g" ), GetTextAngleDegrees() );
303  aList.emplace_back( _( "Angle" ), msg );
304 
305  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextThickness() );
306  aList.emplace_back( _( "Thickness" ), msg );
307 
308  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() );
309  aList.emplace_back( _( "Width" ), msg );
310 
311  msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() );
312  aList.emplace_back( _( "Height" ), msg );
313 }
314 
315 
316 wxString FP_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const
317 {
318  switch( m_Type )
319  {
320  case TEXT_is_REFERENCE:
321  return wxString::Format( _( "Reference '%s'" ),
322  static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
323 
324  case TEXT_is_VALUE:
325  return wxString::Format( _( "Value '%s' of %s" ),
326  GetShownText(),
327  static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
328 
329  default:
330  return wxString::Format( _( "Footprint Text '%s' of %s" ),
332  static_cast<FOOTPRINT*>( GetParent() )->GetReference() );
333  }
334 }
335 
336 
338 {
339  return text_xpm;
340 }
341 
342 
344 {
345  return new FP_TEXT( *this );
346 }
347 
348 
350 {
351  double angle = GetDrawRotation();
352  EDA_RECT text_area = GetTextBox();
353 
354  if( angle != 0.0 )
355  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
356 
357  return BOX2I( text_area.GetPosition(), text_area.GetSize() );
358 }
359 
360 
361 void FP_TEXT::ViewGetLayers( int aLayers[], int& aCount ) const
362 {
363  if( IsVisible() )
364  aLayers[0] = GetLayer();
365  else
366  aLayers[0] = LAYER_MOD_TEXT_INVISIBLE;
367 
368  aCount = 1;
369 }
370 
371 
372 double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
373 {
374  constexpr double HIDE = (double)std::numeric_limits<double>::max();
375 
376  if( !aView )
377  return 0.0;
378 
379  // Hidden text gets put on the LAYER_MOD_TEXT_INVISIBLE for rendering, but
380  // should only render if its native layer is visible.
381  if( !aView->IsLayerVisible( GetLayer() ) )
382  return HIDE;
383 
384  // Handle Render tab switches
385  if( ( m_Type == TEXT_is_VALUE || GetText() == wxT( "${VALUE}" ) )
386  && !aView->IsLayerVisible( LAYER_MOD_VALUES ) )
387  return HIDE;
388 
389  if( ( m_Type == TEXT_is_REFERENCE || GetText() == wxT( "${REFERENCE}" ) )
390  && !aView->IsLayerVisible( LAYER_MOD_REFERENCES ) )
391  return HIDE;
392 
393  if( !IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_FR ) )
394  return HIDE;
395 
396  if( IsParentFlipped() && !aView->IsLayerVisible( LAYER_MOD_BK ) )
397  return HIDE;
398 
400  return HIDE;
401 
402  if( IsBackLayer( m_layer ) && !aView->IsLayerVisible( LAYER_MOD_TEXT_BK ) )
403  return HIDE;
404 
405  // Other layers are shown without any conditions
406  return 0.0;
407 }
408 
409 
410 wxString FP_TEXT::GetShownText( int aDepth ) const
411 {
412  const FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( GetParent() );
413  wxASSERT( parentFootprint );
414  const BOARD* board = parentFootprint->GetBoard();
415 
416  std::function<bool( wxString* )> footprintResolver =
417  [&]( wxString* token ) -> bool
418  {
419  return parentFootprint && parentFootprint->ResolveTextVar( token, aDepth );
420  };
421 
422  std::function<bool( wxString* )> boardTextResolver =
423  [&]( wxString* token ) -> bool
424  {
425  return board->ResolveTextVar( token, aDepth + 1 );
426  };
427 
428  bool processTextVars = false;
429  wxString text = EDA_TEXT::GetShownText( &processTextVars );
430 
431  if( processTextVars )
432  {
433  PROJECT* project = nullptr;
434 
435  if( parentFootprint && parentFootprint->GetParent() )
436  project = static_cast<BOARD*>( parentFootprint->GetParent() )->GetProject();
437 
438  if( aDepth < 10 )
439  text = ExpandTextVars( text, &footprintResolver, &boardTextResolver, project );
440  }
441 
442  return text;
443 }
444 
445 
446 std::shared_ptr<SHAPE> FP_TEXT::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
447 {
448  return GetEffectiveTextShape();
449 }
450 
451 
452 static struct FP_TEXT_DESC
453 {
455  {
462 
463  propMgr.AddProperty( new PROPERTY<FP_TEXT, wxString>( _HKI( "Parent" ),
464  NO_SETTER( FP_TEXT, wxString ), &FP_TEXT::GetParentAsString ) );
465  }
466 } _FP_TEXT_DESC;
void SetMirrored(bool isMirrored)
Definition: eda_text.h:195
virtual double GetDrawRotation() const override
Definition: fp_text.cpp:248
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:343
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:528
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:125
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:66
#define TYPE_HASH(x)
Definition: property.h:57
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
PNG memory record (file in memory).
Definition: bitmap_def.h:29
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:349
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:186
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:431
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
const BITMAP_OPAQUE text_xpm[1]
Definition: text.cpp:17
double GetOrientation() const
Definition: footprint.h:186
double GetTextAngle() const
Definition: eda_text.h:181
void SetDrawCoord()
Set relative coordinates.
Definition: fp_text.cpp:199
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:274
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition: fp_text.cpp:372
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:446
void Rotate(const wxPoint &aOffset, double aAngle) override
Rotate text, in footprint editor (for instance in footprint rotation transform)
Definition: fp_text.cpp:129
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:605
#define REGISTER_TYPE(x)
Definition: property_mgr.h:249
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:173
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:361
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
#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:143
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:423
bool m_keepUpright
if true, keep rotation angle between -90 .
Definition: fp_text.h:245
int GetLength() const
Definition: fp_text.cpp:193
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:316
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
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: fp_text.cpp:337
const EDA_RECT GetBoundingBox() const override
Set absolute coordinates.
Definition: fp_text.cpp:236
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
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape() const
Definition: eda_text.cpp:624
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:150
bool IsParentFlipped() const
Definition: fp_text.cpp:165
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:218
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:149
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:63
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:410
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:162
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:404