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 void TEXTE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
94 {
95  // Used in footprint edition
96  // Note also in module editor, m_Pos0 = m_Pos
97 
98  wxPoint pt = GetTextPos();
99  RotatePoint( &pt, aRotCentre, aAngle );
100  SetTextPos( pt );
101 
102  SetTextAngle( GetTextAngle() + aAngle );
103  SetLocalCoord();
104 }
105 
106 
107 void TEXTE_MODULE::Flip( const wxPoint& aCentre )
108 {
109  // flipping the footprint is relative to the X axis
110  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
111 
113 
114  SetLayer( FlipLayer( GetLayer() ) );
116  SetLocalCoord();
117 }
118 
119 
120 void TEXTE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
121 {
122  // Used in modedit, to transform the footprint
123  // the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
124  // the position is mirrored, but the text itself is not mirrored
125  if( aMirrorAroundXAxis )
126  SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
127  else
128  SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
129 
130  SetLocalCoord();
131 }
132 
133 
134 void TEXTE_MODULE::Move( const wxPoint& aMoveVector )
135 {
136  Offset( aMoveVector );
137  SetLocalCoord();
138 }
139 
140 
142 {
143  return m_Text.Len();
144 }
145 
146 
148 {
149  const MODULE* module = static_cast<const MODULE*>( m_Parent );
150 
151  SetTextPos( m_Pos0 );
152 
153  if( module )
154  {
155  double angle = module->GetOrientation();
156 
157  wxPoint pt = GetTextPos();
158  RotatePoint( &pt, angle );
159  SetTextPos( pt );
160 
161  Offset( module->GetPosition() );
162  }
163 }
164 
165 
167 {
168  const MODULE* module = static_cast<const MODULE*>( m_Parent );
169 
170  if( module )
171  {
172  m_Pos0 = GetTextPos() - module->GetPosition();
173 
174  double angle = module->GetOrientation();
175 
176  RotatePoint( &m_Pos0.x, &m_Pos0.y, -angle );
177  }
178  else
179  {
180  m_Pos0 = GetTextPos();
181  }
182 }
183 
184 
185 bool TEXTE_MODULE::HitTest( const wxPoint& aPosition ) const
186 {
187  wxPoint rel_pos;
188  EDA_RECT area = GetTextBox( -1, -1 );
189 
190  /* Rotate refPos to - angle to test if refPos is within area (which
191  * is relative to an horizontal text)
192  */
193  rel_pos = aPosition;
194  RotatePoint( &rel_pos, GetTextPos(), -GetDrawRotation() );
195 
196  if( area.Contains( rel_pos ) )
197  return true;
198 
199  return false;
200 }
201 
202 
204 {
205  double angle = GetDrawRotation();
206  EDA_RECT text_area = GetTextBox( -1, -1 );
207 
208  if( angle )
209  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
210 
211  return text_area;
212 }
213 
214 
215 void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
216  const wxPoint& aOffset )
217 {
218  if( aPanel == NULL )
219  return;
220 
221  /* parent must *not* be NULL (a footprint text without a footprint
222  parent has no sense) */
223  wxASSERT( m_Parent );
224 
225  BOARD* brd = GetBoard( );
226  COLOR4D color = brd->GetLayerColor( GetLayer() );
227  LAYER_ID text_layer = GetLayer();
228 
229  if( !brd->IsLayerVisible( m_Layer )
230  || (IsFrontLayer( text_layer ) && !brd->IsElementVisible( MOD_TEXT_FR_VISIBLE ))
231  || (IsBackLayer( text_layer ) && !brd->IsElementVisible( MOD_TEXT_BK_VISIBLE )) )
232  return;
233 
234  // Invisible texts are still drawn (not plotted) in MOD_TEXT_INVISIBLE
235  // Just because we must have to edit them (at least to make them visible)
236  if( !IsVisible() )
237  {
238  if( !brd->IsElementVisible( MOD_TEXT_INVISIBLE ) )
239  return;
240 
242  }
243 
244  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)aPanel->GetDisplayOptions();
245 
246  // shade text if high contrast mode is active
247  if( ( aDrawMode & GR_ALLOW_HIGHCONTRAST ) && displ_opts && displ_opts->m_ContrastModeDisplay )
248  {
249  LAYER_ID curr_layer = ( (PCB_SCREEN*) aPanel->GetScreen() )->m_Active_Layer;
250 
251  if( !IsOnLayer( curr_layer ) )
252  color = COLOR4D( DARKDARKGRAY );
253  }
254 
255  // Draw mode compensation for the width
256  int width = GetThickness();
257 
258  if( displ_opts && displ_opts->m_DisplayModTextFill == SKETCH )
259  width = -width;
260 
261  GRSetDrawMode( aDC, aDrawMode );
262  wxPoint pos = GetTextPos() - aOffset;
263 
264  // Draw the text anchor point
265  if( brd->IsElementVisible( ANCHOR_VISIBLE ) )
266  {
267  COLOR4D anchor_color = brd->GetVisibleElementColor(ANCHOR_VISIBLE);
268  GRDrawAnchor( aPanel->GetClipBox(), aDC, pos.x, pos.y, DIM_ANCRE_TEXTE, anchor_color );
269  }
270 
271  // Draw the text proper, with the right attributes
272  wxSize size = GetTextSize();
273  double orient = GetDrawRotation();
274 
275  // If the text is mirrored : negate size.x (mirror / Y axis)
276  if( IsMirrored() )
277  size.x = -size.x;
278 
279  DrawGraphicText( aPanel->GetClipBox(), aDC, pos, color, GetShownText(), orient,
280  size, GetHorizJustify(), GetVertJustify(),
281  width, IsItalic(), IsBold() );
282 
283  // Enable these line to draw the bounding box (debug test purpose only)
284 #if 0
285  {
286  EDA_RECT BoundaryBox = GetBoundingBox();
287  GRRect( aPanel->GetClipBox(), aDC, BoundaryBox, 0, BROWN );
288  }
289 #endif
290 }
291 
292 
294  wxDC* aDC,
295  GR_DRAWMODE aDrawMode,
296  const wxPoint& aOffset )
297 {
298  MODULE* parent = static_cast<MODULE*>( GetParent() );
299 
300  if( !parent )
301  return;
302 
303  GRSetDrawMode( aDC, GR_XOR );
304  GRLine( aPanel->GetClipBox(), aDC,
305  parent->GetPosition(), GetTextPos() + aOffset,
306  0, UMBILICAL_COLOR);
307 }
308 
309 
311 {
312  MODULE* module = (MODULE*) m_Parent;
313  double rotation = GetTextAngle();
314 
315  if( module )
316  rotation += module->GetOrientation();
317 
318  // Keep angle between -90 .. 90 deg. Otherwise the text is not easy to read
319  while( rotation > 900 )
320  rotation -= 1800;
321 
322  while( rotation < -900 )
323  rotation += 1800;
324 
325  return rotation;
326 }
327 
328 
329 // see class_text_mod.h
330 void TEXTE_MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
331 {
332  MODULE* module = (MODULE*) m_Parent;
333 
334  if( module == NULL ) // Happens in modedit, and for new texts
335  return;
336 
337  wxString msg, Line;
338 
339  static const wxString text_type_msg[3] =
340  {
341  _( "Ref." ), _( "Value" ), _( "Text" )
342  };
343 
344  Line = module->GetReference();
345  aList.push_back( MSG_PANEL_ITEM( _( "Footprint" ), Line, DARKCYAN ) );
346 
347  Line = GetShownText();
348  aList.push_back( MSG_PANEL_ITEM( _( "Text" ), Line, BROWN ) );
349 
350  wxASSERT( m_Type >= TEXT_is_REFERENCE && m_Type <= TEXT_is_DIVERS );
351  aList.push_back( MSG_PANEL_ITEM( _( "Type" ), text_type_msg[m_Type], DARKGREEN ) );
352 
353  if( !IsVisible() )
354  msg = _( "No" );
355  else
356  msg = _( "Yes" );
357 
358  aList.push_back( MSG_PANEL_ITEM( _( "Display" ), msg, DARKGREEN ) );
359 
360  // Display text layer
361  aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), DARKGREEN ) );
362 
363  if( IsMirrored() )
364  msg = _( " Yes" );
365  else
366  msg = _( " No" );
367 
368  aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), msg, DARKGREEN ) );
369 
370  msg.Printf( wxT( "%.1f" ), GetTextAngleDegrees() );
371  aList.push_back( MSG_PANEL_ITEM( _( "Angle" ), msg, DARKGREEN ) );
372 
374  aList.push_back( MSG_PANEL_ITEM( _( "Thickness" ), msg, DARKGREEN ) );
375 
377  aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg, RED ) );
378 
380  aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg, RED ) );
381 }
382 
383 
385 {
386  wxString text;
387  const wxChar *reference = GetChars( static_cast<MODULE*>( GetParent() )->GetReference() );
388 
389  switch( m_Type )
390  {
391  case TEXT_is_REFERENCE:
392  text.Printf( _( "Reference %s" ), reference );
393  break;
394 
395  case TEXT_is_VALUE:
396  text.Printf( _( "Value %s of %s" ), GetChars( GetShownText() ), reference );
397  break;
398 
399  default: // wrap this one in quotes:
400  text.Printf( _( "Text \"%s\" on %s of %s" ), GetChars( ShortenedShownText() ),
401  GetChars( GetLayerName() ), reference );
402  break;
403  }
404 
405  return text;
406 }
407 
408 
410 {
411  return footprint_text_xpm;
412 }
413 
414 
416 {
417  return new TEXTE_MODULE( *this );
418 }
419 
420 
422 {
423  double angle = GetDrawRotation();
424  EDA_RECT text_area = GetTextBox( -1, -1 );
425 
426  if( angle )
427  text_area = text_area.GetBoundingBoxRotated( GetTextPos(), angle );
428 
429  return BOX2I( text_area.GetPosition(), text_area.GetSize() );
430 }
431 
432 
433 void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
434 {
435  if( !IsVisible() ) // Hidden text
436  aLayers[0] = ITEM_GAL_LAYER( MOD_TEXT_INVISIBLE );
437  //else if( IsFrontLayer( m_Layer ) )
438  //aLayers[0] = ITEM_GAL_LAYER( MOD_TEXT_FR_VISIBLE );
439  //else if( IsBackLayer( m_Layer ) )
440  //aLayers[0] = ITEM_GAL_LAYER( MOD_TEXT_BK_VISIBLE );
441  else
442  aLayers[0] = GetLayer();
443 
444  aCount = 1;
445 }
446 
447 
448 unsigned int TEXTE_MODULE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
449 {
450  const int MAX = std::numeric_limits<unsigned int>::max();
451 
452  if( !aView )
453  return 0;
454 
456  return MAX;
457 
459  return MAX;
460 
463  return MAX;
464 
467  return MAX;
468 
469  return 0;
470 }
471 
472 
474 {
475  /* First order optimization: no % means that no processing is
476  * needed; just hope that RVO and copy constructor implementation
477  * avoid to copy the whole block; anyway it should be better than
478  * rebuild the string one character at a time...
479  * Also it seems wise to only expand macros in user text (but there
480  * is no technical reason, probably) */
481 
482  if( (m_Type != TEXT_is_DIVERS) || (wxString::npos == m_Text.find('%')) )
483  return m_Text;
484 
485  wxString newbuf;
486  const MODULE *module = static_cast<MODULE*>( GetParent() );
487 
488  for( wxString::const_iterator it = m_Text.begin(); it != m_Text.end(); ++it )
489  {
490  // Process '%' and copy everything else
491  if( *it != '%' )
492  newbuf.append(*it);
493  else
494  {
495  /* Look at the next character (if is it there) and append
496  * its expansion */
497  ++it;
498 
499  if( it != m_Text.end() )
500  {
501  switch( char(*it) )
502  {
503  case '%':
504  newbuf.append( '%' );
505  break;
506 
507  case 'R':
508  if( module )
509  newbuf.append( module->GetReference() );
510  break;
511 
512  case 'V':
513  if( module )
514  newbuf.append( module->GetValue() );
515  break;
516 
517  default:
518  newbuf.append( '?' );
519  break;
520  }
521  }
522  else
523  break; // The string is over and we can't ++ anymore
524  }
525  }
526 
527  return newbuf;
528 }
void SetMirrored(bool isMirrored)
Definition: eda_text.h:178
void SetTextAngle(double aAngle)
Definition: eda_text.h:156
show modules on front
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
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
BOX2< VECTOR2I > BOX2I
Definition: box2.h:468
text marked as invisible
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
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:168
wxString m_Text
Definition: eda_text.h:348
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
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
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)
bool IsBackLayer(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:143
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
bool IsFrontLayer(LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
int GetTextWidth() const
Definition: eda_text.h:218
COLOR4D GetLayerColor(LAYER_ID aLayer) const
Function GetLayerColor gets a layer color for any valid layer, including non-copper ones...
virtual void SetLayer(LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
void Move(const wxPoint &aMoveVector) override
move text in move transform, in footprint editor
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:223
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
void GRDrawAnchor(EDA_RECT *aClipBox, wxDC *aDC, int x, int y, int aSize, COLOR4D aColor)
Definition: gr_basic.cpp:1259
const wxString & GetValue() const
Function GetValue.
Definition: class_module.h:439
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.
LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
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
virtual bool IsOnLayer(LAYER_ID aLayer) const
Function IsOnLayer tests to see if this object is on the given layer.
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels...
Definition: eda_text.h:114
class MODULE, a footprint
Definition: typeinfo.h:101
LAYER_ID m_Layer
#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
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.
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
double GetOrientation() const
Definition: class_module.h:147
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.
show modules references (when texts are visibles)
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 IsLayerVisible(LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:440
EDA_TEXT_VJUSTIFY_T GetVertJustify() const
Definition: eda_text.h:191
void SetLocalCoord()
Set relative coordinates.
#define ITEM_GAL_LAYER(layer)
macro for obtaining layer number for specific item (eg. pad or text)
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:166
LAYER_ID FlipLayer(LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:444
const wxString & GetReference() const
Function GetReference.
Definition: class_module.h:411
LAYER_ID
Enum LAYER_ID is the set of PCB layers.
bool IsMirrored() const
Definition: eda_text.h:179
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
bool IsVisible() const
Definition: eda_text.h:176
bool IsElementVisible(int aPCB_VISIBLE) const
Function IsElementVisible tests whether a given element category is visible.
COLOR4D GetVisibleElementColor(int aPCB_VISIBLE)
Function GetVisibleElementColor returns the color of a pcb visible element.
wxPoint m_Pos0
text coordinates relative to the footprint anchor, orient 0.
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
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 values (when texts are visibles)
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
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62