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-2016 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 
31 #include <fctsys.h>
32 #include <gr_basic.h>
33 #include <wxstruct.h>
34 #include <trigo.h>
35 #include <class_drawpanel.h>
36 #include <drawtxt.h>
37 #include <kicad_string.h>
38 #include <colors_selection.h>
39 #include <richio.h>
40 #include <macros.h>
41 #include <wxBasePcbFrame.h>
42 #include <msgpanel.h>
43 #include <base_units.h>
44 #include <bitmaps.h>
45 
46 #include <class_board.h>
47 #include <class_module.h>
48 
49 #include <view/view.h>
50 
51 #include <pcbnew.h>
52 
53 
55  BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
56  EDA_TEXT()
57 {
58  MODULE* module = static_cast<MODULE*>( m_Parent );
59 
60  m_Type = text_type;
61 
62  // Set text thickness to a default value
63  SetThickness( Millimeter2iu( 0.15 ) );
64  SetLayer( F_SilkS );
65 
66  // Set position and give a default layer if a valid parent footprint exists
67  if( module && ( module->Type() == PCB_MODULE_T ) )
68  {
69  SetTextPos( module->GetPosition() );
70 
71  if( IsBackLayer( module->GetLayer() ) )
72  {
73  SetLayer( B_SilkS );
74  SetMirrored( true );
75  }
76  }
77 
78  SetDrawCoord();
79 }
80 
81 
83 {
84 }
85 
86 
87 void TEXTE_MODULE::SetTextAngle( double aAngle )
88 {
90 }
91 
92 
93 bool TEXTE_MODULE::TextHitTest( const wxPoint& aPoint, int aAccuracy ) const
94 {
95  EDA_RECT rect = GetTextBox( -1 );
96  wxPoint location = aPoint;
97 
98  rect.Inflate( aAccuracy );
99 
100  RotatePoint( &location, GetTextPos(), -GetDrawRotation() );
101 
102  return rect.Contains( location );
103 }
104 
105 
106 bool TEXTE_MODULE::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
107 {
108  EDA_RECT rect = aRect;
109 
110  rect.Inflate( aAccuracy );
111 
112  if( aContains )
113  {
114  return rect.Contains( GetBoundingBox() );
115  }
116  else
117  {
118  return rect.Intersects( GetTextBox( -1 ), GetDrawRotation() );
119  }
120 }
121 
122 
123 void TEXTE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
124 {
125  // Used in footprint edition
126  // Note also in module editor, m_Pos0 = m_Pos
127 
128  wxPoint pt = GetTextPos();
129  RotatePoint( &pt, aRotCentre, aAngle );
130  SetTextPos( pt );
131 
132  SetTextAngle( GetTextAngle() + aAngle );
133  SetLocalCoord();
134 }
135 
136 
137 void TEXTE_MODULE::Flip( const wxPoint& aCentre )
138 {
139  // flipping the footprint is relative to the X axis
140  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
141 
143 
144  SetLayer( FlipLayer( GetLayer() ) );
146  SetLocalCoord();
147 }
148 
149 
150 void TEXTE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
151 {
152  // Used in modedit, to transform the footprint
153  // the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
154  // the position is mirrored, but the text itself is not mirrored
155  if( aMirrorAroundXAxis )
156  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
157  else
158  SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
159 
160  SetLocalCoord();
161 }
162 
163 
164 void TEXTE_MODULE::Move( const wxPoint& aMoveVector )
165 {
166  Offset( aMoveVector );
167  SetLocalCoord();
168 }
169 
170 
172 {
173  return m_Text.Len();
174 }
175 
176 
178 {
179  const MODULE* module = static_cast<const MODULE*>( m_Parent );
180 
181  SetTextPos( m_Pos0 );
182 
183  if( module )
184  {
185  double angle = module->GetOrientation();
186 
187  wxPoint pt = GetTextPos();
188  RotatePoint( &pt, angle );
189  SetTextPos( pt );
190 
191  Offset( module->GetPosition() );
192  }
193 }
194 
195 
197 {
198  const MODULE* module = static_cast<const MODULE*>( m_Parent );
199 
200  if( module )
201  {
202  m_Pos0 = GetTextPos() - module->GetPosition();
203 
204  double angle = module->GetOrientation();
205 
206  RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
207  }
208  else
209  {
210  m_Pos0 = GetTextPos();
211  }
212 }
213 
215 {
216  double angle = GetDrawRotation();
217  EDA_RECT text_area = GetTextBox( -1, -1 );
218 
219  if( angle )
220  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
221 
222  return text_area;
223 }
224 
225 
226 void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
227  const wxPoint& aOffset )
228 {
229  if( aPanel == NULL )
230  return;
231 
232  /* parent must *not* be NULL (a footprint text without a footprint
233  parent has no sense) */
234  wxASSERT( m_Parent );
235 
236  BOARD* brd = GetBoard( );
237  COLOR4D color = brd->GetLayerColor( GetLayer() );
238  PCB_LAYER_ID text_layer = GetLayer();
239 
240  if( !brd->IsLayerVisible( m_Layer )
241  || ( IsFrontLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_FR ) )
242  || ( IsBackLayer( text_layer ) && !brd->IsElementVisible( LAYER_MOD_TEXT_BK ) ) )
243  return;
244 
245  // Invisible texts are still drawn (not plotted) in LAYER_MOD_TEXT_INVISIBLE
246  // Just because we must have to edit them (at least to make them visible)
247  if( !IsVisible() )
248  {
250  return;
251 
253  }
254 
255  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)aPanel->GetDisplayOptions();
256 
257  // shade text if high contrast mode is active
258  if( ( aDrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts && displ_opts->m_ContrastModeDisplay )
259  {
260  PCB_LAYER_ID curr_layer = ( (PCB_SCREEN*) aPanel->GetScreen() )->m_Active_Layer;
261 
262  if( !IsOnLayer( curr_layer ) )
263  color = COLOR4D( DARKDARKGRAY );
264  }
265 
266  // Draw mode compensation for the width
267  int width = GetThickness();
268 
269  if( displ_opts && displ_opts->m_DisplayModTextFill == SKETCH )
270  width = -width;
271 
272  GRSetDrawMode( aDC, aDrawMode );
273  wxPoint pos = GetTextPos() - aOffset;
274 
275  // Draw the text anchor point
276  if( brd->IsElementVisible( LAYER_ANCHOR ) )
277  {
278  COLOR4D anchor_color = brd->GetVisibleElementColor( LAYER_ANCHOR );
279  GRDrawAnchor( aPanel->GetClipBox(), aDC, pos.x, pos.y, DIM_ANCRE_TEXTE, anchor_color );
280  }
281 
282  // Draw the text proper, with the right attributes
283  wxSize size = GetTextSize();
284  double orient = GetDrawRotation();
285 
286  // If the text is mirrored : negate size.x (mirror / Y axis)
287  if( IsMirrored() )
288  size.x = -size.x;
289 
290  DrawGraphicText( aPanel->GetClipBox(), aDC, pos, color, GetShownText(), orient,
291  size, GetHorizJustify(), GetVertJustify(),
292  width, IsItalic(), IsBold() );
293 
294  // Enable these line to draw the bounding box (debug test purpose only)
295 #if 0
296  {
297  EDA_RECT BoundaryBox = GetBoundingBox();
298  GRRect( aPanel->GetClipBox(), aDC, BoundaryBox, 0, BROWN );
299  }
300 #endif
301 }
302 
303 
305  wxDC* aDC,
306  GR_DRAWMODE aDrawMode,
307  const wxPoint& aOffset )
308 {
309  MODULE* parent = static_cast<MODULE*>( GetParent() );
310 
311  if( !parent )
312  return;
313 
314  GRSetDrawMode( aDC, GR_XOR );
315  GRLine( aPanel->GetClipBox(), aDC,
316  parent->GetPosition(), GetTextPos() + aOffset,
317  0, UMBILICAL_COLOR);
318 }
319 
320 
322 {
323  MODULE* module = (MODULE*) m_Parent;
324  double rotation = GetTextAngle();
325 
326  if( module )
327  rotation += module->GetOrientation();
328 
329  // Keep angle between -90 .. 90 deg. Otherwise the text is not easy to read
330  while( rotation > 900 )
331  rotation -= 1800;
332 
333  while( rotation < -900 )
334  rotation += 1800;
335 
336  return rotation;
337 }
338 
339 
340 // see class_text_mod.h
341 void TEXTE_MODULE::GetMsgPanelInfo( 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.push_back( MSG_PANEL_ITEM( _( "Footprint" ), Line, DARKCYAN ) );
357 
358  Line = GetShownText();
359  aList.push_back( MSG_PANEL_ITEM( _( "Text" ), Line, BROWN ) );
360 
361  wxASSERT( m_Type >= TEXT_is_REFERENCE && m_Type <= TEXT_is_DIVERS );
362  aList.push_back( MSG_PANEL_ITEM( _( "Type" ), text_type_msg[m_Type], DARKGREEN ) );
363 
364  if( !IsVisible() )
365  msg = _( "No" );
366  else
367  msg = _( "Yes" );
368 
369  aList.push_back( MSG_PANEL_ITEM( _( "Display" ), msg, DARKGREEN ) );
370 
371  // Display text layer
372  aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), DARKGREEN ) );
373 
374  if( IsMirrored() )
375  msg = _( " Yes" );
376  else
377  msg = _( " No" );
378 
379  aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), msg, DARKGREEN ) );
380 
381  msg.Printf( wxT( "%.1f" ), GetTextAngleDegrees() );
382  aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, DARKGREEN ) );
383 
385  aList.push_back( MSG_PANEL_ITEM( _( "Thickness" ), msg, DARKGREEN ) );
386 
388  aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, RED ) );
389 
391  aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, RED ) );
392 }
393 
394 
396 {
397  wxString text;
398  const wxChar *reference = GetChars( static_cast<MODULE*>( GetParent() )->GetReference() );
399 
400  switch( m_Type )
401  {
402  case TEXT_is_REFERENCE:
403  text.Printf( _( "Reference %s" ), reference );
404  break;
405 
406  case TEXT_is_VALUE:
407  text.Printf( _( "Value %s of %s" ), GetChars( GetShownText() ), reference );
408  break;
409 
410  default: // wrap this one in quotes:
411  text.Printf( _( "Text \"%s\" on %s of %s" ), GetChars( ShortenedShownText() ),
412  GetChars( GetLayerName() ), reference );
413  break;
414  }
415 
416  return text;
417 }
418 
419 
421 {
422  return footprint_text_xpm;
423 }
424 
425 
427 {
428  return new TEXTE_MODULE( *this );
429 }
430 
431 
433 {
434  double angle = GetDrawRotation();
435  EDA_RECT text_area = GetTextBox( -1, -1 );
436 
437  if( angle )
438  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
439 
440  return BOX2I( text_area.GetPosition(), text_area.GetSize() );
441 }
442 
443 
444 void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
445 {
446  if( !IsVisible() ) // Hidden text
447  aLayers[0] = LAYER_MOD_TEXT_INVISIBLE;
448  //else if( IsFrontLayer( m_Layer ) )
449  //aLayers[0] = LAYER_MOD_TEXT_FR;
450  //else if( IsBackLayer( m_Layer ) )
451  //aLayers[0] = LAYER_MOD_TEXT_BK;
452  else
453  aLayers[0] = GetLayer();
454 
455  aCount = 1;
456 }
457 
458 
459 unsigned int TEXTE_MODULE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
460 {
461  const int MAX = std::numeric_limits<unsigned int>::max();
462 
463  if( !aView )
464  return 0;
465 
466  if( m_Type == TEXT_is_VALUE && !aView->IsLayerVisible( LAYER_MOD_VALUES ) )
467  return MAX;
468 
470  return MAX;
471 
472  if( IsFrontLayer( m_Layer ) && ( !aView->IsLayerVisible( LAYER_MOD_TEXT_FR ) ||
473  !aView->IsLayerVisible( LAYER_MOD_FR ) ) )
474  return MAX;
475 
476  if( IsBackLayer( m_Layer ) && ( !aView->IsLayerVisible( LAYER_MOD_TEXT_BK ) ||
477  !aView->IsLayerVisible( LAYER_MOD_BK ) ) )
478  return MAX;
479 
480  return 0;
481 }
482 
483 
485 {
486  /* First order optimization: no % means that no processing is
487  * needed; just hope that RVO and copy constructor implementation
488  * avoid to copy the whole block; anyway it should be better than
489  * rebuild the string one character at a time...
490  * Also it seems wise to only expand macros in user text (but there
491  * is no technical reason, probably) */
492 
493  if( (m_Type != TEXT_is_DIVERS) || (wxString::npos == m_Text.find('%')) )
494  return m_Text;
495 
496  wxString newbuf;
497  const MODULE *module = static_cast<MODULE*>( GetParent() );
498 
499  for( wxString::const_iterator it = m_Text.begin(); it != m_Text.end(); ++it )
500  {
501  // Process '%' and copy everything else
502  if( *it != '%' )
503  newbuf.append(*it);
504  else
505  {
506  /* Look at the next character (if is it there) and append
507  * its expansion */
508  ++it;
509 
510  if( it != m_Text.end() )
511  {
512  switch( char(*it) )
513  {
514  case '%':
515  newbuf.append( '%' );
516  break;
517 
518  case 'R':
519  if( module )
520  newbuf.append( module->GetReference() );
521  break;
522 
523  case 'V':
524  if( module )
525  newbuf.append( module->GetValue() );
526  break;
527 
528  default:
529  newbuf.append( '?' );
530  break;
531  }
532  }
533  else
534  break; // The string is over and we can't ++ anymore
535  }
536  }
537 
538  return newbuf;
539 }
void SetMirrored(bool isMirrored)
Definition: eda_text.h:178
void SetTextAngle(double aAngle)
Definition: eda_text.h:156
wxString CoordinateToString(int aValue, bool aConvertToMils)
Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inche...
Definition: base_units.cpp:117
COLOR4D GetLayerColor(PCB_LAYER_ID aLayer) const
Function GetLayerColor gets a layer color for any valid layer, including non-copper ones...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
TEXT_TYPE
Text module type: there must be only one (and only one) for each of the reference and value texts in ...
int GetLength() const
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:229
BOARD_ITEM_CONTAINER * GetParent() const
virtual unsigned int ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Function ViewGetLOD() Returns the level of detail of the item.
BOX2< VECTOR2I > BOX2I
Definition: box2.h:468
void DrawGraphicText(EDA_RECT *aClipBox, 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), PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
Definition: drawtxt.cpp:122
bool IsElementVisible(GAL_LAYER_ID LAYER_aPCB) const
Function IsElementVisible tests whether a given element category is visible.
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:168
wxString m_Text
Definition: eda_text.h:346
double GetDrawRotation() const
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
Definition: eda_text.cpp:92
PNG memory record (file in memory).
Definition: bitmap_types.h:38
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:290
const wxPoint & GetTextPos() const
Definition: eda_text.h:224
bool IsItalic() const
Definition: eda_text.h:170
bool IsLayerVisible(int aLayer) const
Function IsLayerVisible() Returns information about visibility of a particular layer.
Definition: view.h:404
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Function IsOnLayer tests to see if this object is on the given layer.
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)
Class 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. ...
bool Contains(const wxPoint &aPoint) const
Function Contains.
void Rotate(const wxPoint &aOffset, double aAngle) override
Rotate text, in footprint editor (for instance in footprint rotation transform)
anchor of items having an anchor point (texts, footprints)
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
Definition: gr_basic.cpp:352
Class BOARD to handle a board.
const wxPoint & GetPosition() const override
Definition: class_module.h:155
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:445
int GetTextWidth() const
Definition: eda_text.h:218
void Move(const wxPoint &aMoveVector) override
move text in move transform, in footprint editor
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:223
show modules on back
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
show modules values (when texts are visibles)
void GRDrawAnchor(EDA_RECT *aClipBox, wxDC *aDC, int x, int y, int aSize, COLOR4D aColor)
Definition: gr_basic.cpp:1267
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:447
COLOR4D GetVisibleElementColor(GAL_LAYER_ID LAYER_aPCB)
Function GetVisibleElementColor returns the color of a pcb visible element.
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
double GetTextAngleDegrees() const
Definition: eda_text.h:166
virtual wxString GetShownText() const override
Returns the string actually shown after processing of the base text.
EDA_TEXT_HJUSTIFY_T GetHorizJustify() const
Definition: eda_text.h:190
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.
bool IsBold() const
Definition: eda_text.h:173
double GetTextAngle() const
Definition: eda_text.h:164
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:154
This file contains miscellaneous commonly used macros and functions.
void SetTextX(int aX)
Definition: eda_text.h:226
show modules on front
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels...
Definition: eda_text.h:114
PCB_LAYER_ID m_Layer
class MODULE, a footprint
Definition: typeinfo.h:101
#define UMBILICAL_COLOR
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:1077
PCB_LAYER_ID
A quick note on layer IDs:
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false) const
Function GetTextBox useful in multiline texts to calculate the full text or a line area (for zones fi...
Definition: eda_text.cpp:115
Classes used in Pcbnew, CvPcb and GerbView.
double GetOrientation() const
Definition: class_module.h:160
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
Base window classes and related definitions.
const EDA_RECT GetBoundingBoxRotated(wxPoint aRotCenter, double aAngle)
Function GetBoundingBoxRotated.
bool m_ContrastModeDisplay
Definition: pcbstruct.h:85
void GetMsgPanelInfo(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 * GetClipBox()
Definition: colors.h:60
void Flip(const wxPoint &aCentre) override
Flip entity during module flip.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw Draw the text according to the footprint pos and orient.
#define DIM_ANCRE_TEXTE
Definition: eda_text.h:75
const wxPoint & GetPosition() const
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:105
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:191
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetLocalCoord()
Set relative coordinates.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
#define max(a, b)
Definition: auxiliary.h:86
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:419
bool IsMirrored() const
Definition: eda_text.h:179
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on...
bool IsVisible() const
Definition: eda_text.h:176
wxPoint m_Pos0
text coordinates relative to the footprint anchor, orient 0.
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const override
Function TextHitTest Test if aPoint is within the bounds of this object.
void SetDrawCoord()
Set absolute coordinates.
Class EDA_RECT handles the component boundary box.
BASE_SCREEN * GetScreen()
Definition: draw_panel.cpp:188
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
void DrawUmbilical(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset)
Function DrawUmbilical draws a line from the TEXTE_MODULE origin to parent MODULE origin...
void Mirror(const wxPoint &aCentre, bool aMirrorAroundXAxis)
Mirror text position in footprint edition the text itself is not mirrored, and the layer not modified...
int GetTextHeight() const
Definition: eda_text.h:221
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
This file is part of the common libary.
void SetTextAngle(double aAngle)
Module description (excepted pads)
const wxSize & GetTextSize() const
Definition: eda_text.h:215
void * GetDisplayOptions()
Function GetDisplayOptions A way to pass info to draw functions.
Definition: draw_panel.cpp:182
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
Class VIEW.
Definition: view.h:58
Message panel definition file.
TEXT_TYPE m_Type
0=ref, 1=val, etc.
const wxSize & GetSize() const
bool m_DisplayModTextFill
Definition: pcbstruct.h:70
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)
Function SetThickness sets pen width.
Definition: eda_text.h:148
void SetTextY(int aY)
Definition: eda_text.h:227
T NormalizeAngle360(T Angle)
Normalize angle to be in the -360.0 .. 360.0:
Definition: trigo.h:202
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:443
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62