KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_table.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <pgm_base.h>
25#include <sch_edit_frame.h>
26#include <plotters/plotter.h>
28#include <geometry/shape_rect.h>
29#include <bitmaps.h>
30#include <string_utils.h>
31#include <schematic.h>
33#include <sch_painter.h>
34#include <wx/log.h>
35#include <sch_table.h>
36
37
38SCH_TABLE::SCH_TABLE( int aLineWidth ) :
39 SCH_ITEM( nullptr, SCH_TABLE_T ),
40 m_strokeExternal( true ),
41 m_StrokeHeaderSeparator( true ),
42 m_borderStroke( aLineWidth, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ),
43 m_strokeRows( true ),
44 m_strokeColumns( true ),
45 m_separatorsStroke( aLineWidth, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ),
46 m_colCount( 0 )
47{
49}
50
51
53 SCH_ITEM( aTable )
54{
61
62 m_colCount = aTable.m_colCount;
63 m_colWidths = aTable.m_colWidths;
65
66 for( SCH_TABLECELL* src : aTable.m_cells )
67 AddCell( new SCH_TABLECELL( *src ) );
68}
69
70
72{
73 // We own our cells; delete them
74 for( SCH_TABLECELL* cell : m_cells )
75 delete cell;
76}
77
78
80{
81 SCH_ITEM::SwapFlags( aItem );
82
83 wxCHECK_RET( aItem != nullptr && aItem->Type() == SCH_TABLE_T,
84 wxT( "Cannot swap data with invalid table." ) );
85
86 SCH_TABLE* table = static_cast<SCH_TABLE*>( aItem );
87
88 std::swap( m_strokeExternal, table->m_strokeExternal );
89 std::swap( m_StrokeHeaderSeparator, table->m_StrokeHeaderSeparator );
90 std::swap( m_borderStroke, table->m_borderStroke );
91 std::swap( m_strokeRows, table->m_strokeRows );
92 std::swap( m_strokeColumns, table->m_strokeColumns );
93 std::swap( m_separatorsStroke, table->m_separatorsStroke );
94
95 std::swap( m_colCount, table->m_colCount );
96 std::swap( m_colWidths, table->m_colWidths );
97 std::swap( m_rowHeights, table->m_rowHeights );
98
99 std::swap( m_cells, table->m_cells );
100
101 for( SCH_TABLECELL* cell : m_cells )
102 cell->SetParent( this );
103
104 for( SCH_TABLECELL* cell : table->m_cells )
105 cell->SetParent( table );
106}
107
108
110{
111 Move( aPos - GetPosition() );
112}
113
114
116{
117 return m_cells[0]->GetPosition();
118}
119
120
122{
123 BOX2I bbox;
124
125 for( SCH_TABLECELL* cell : m_cells )
126 {
127 bbox.Merge( cell->GetPosition() );
128 bbox.Merge( cell->GetEnd() );
129 }
130
131 return bbox.GetCenter();
132}
133
134
136{
137 VECTOR2I tableSize;
138
139 for( int ii = 0; ii < GetColCount(); ++ii )
140 tableSize.x += GetColWidth( ii );
141
142 for( int ii = 0; ii < GetRowCount(); ++ii )
143 tableSize.y += GetRowHeight( ii );
144
145 return GetPosition() + tableSize;
146}
147
148
150{
151 int y = GetPosition().y;
152
153 for( int row = 0; row < GetRowCount(); ++row )
154 {
155 int x = GetPosition().x;
156 int rowHeight = m_rowHeights[ row ];
157
158 for( int col = 0; col < GetColCount(); ++col )
159 {
160 int colWidth = m_colWidths[ col ];
161
162 SCH_TABLECELL* cell = GetCell( row, col );
163 VECTOR2I pos( x, y );
164
165 RotatePoint( pos, GetPosition(), cell->GetTextAngle() );
166
167 if( cell->GetPosition() != pos )
168 {
169 cell->SetPosition( pos );
170 cell->ClearRenderCache();
171 }
172
173 VECTOR2I end = VECTOR2I( x + colWidth, y + rowHeight );
174
175 if( cell->GetColSpan() > 1 || cell->GetRowSpan() > 1 )
176 {
177 for( int ii = col + 1; ii < col + cell->GetColSpan(); ++ii )
178 end.x += m_colWidths[ii];
179
180 for( int ii = row + 1; ii < row + cell->GetRowSpan(); ++ii )
181 end.y += m_rowHeights[ii];
182 }
183
185
186 if( cell->GetEnd() != end )
187 {
188 cell->SetEnd( end );
189 cell->ClearRenderCache();
190 }
191
192 x += colWidth;
193 }
194
195 y += rowHeight;
196 }
197}
198
199
200void SCH_TABLE::Move( const VECTOR2I& aMoveVector )
201{
202 for( SCH_TABLECELL* cell : m_cells )
203 cell->Move( aMoveVector );
204}
205
206
208{
209 // We could mirror all the cells, but it doesn't seem useful....
210}
211
212
214{
215 // We could mirror all the cells, but it doesn't seem useful....
216}
217
218
219void SCH_TABLE::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
220{
221 for( SCH_TABLECELL* cell : m_cells )
222 cell->Rotate( aCenter, aRotateCCW );
223
224 Normalize();
225}
226
227
228bool SCH_TABLE::operator<( const SCH_ITEM& aItem ) const
229{
230 if( Type() != aItem.Type() )
231 return Type() < aItem.Type();
232
233 const SCH_TABLE& other = static_cast<const SCH_TABLE&>( aItem );
234
235 if( m_cells.size() != other.m_cells.size() )
236 return m_cells.size() < other.m_cells.size();
237
238 if( GetPosition().x != other.GetPosition().x )
239 return GetPosition().x < GetPosition().x;
240
241 if( GetPosition().y != GetPosition().y )
242 return GetPosition().y < GetPosition().y;
243
244 return m_cells[0] < other.m_cells[0];
245}
246
247
248void SCH_TABLE::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction, RECURSE_MODE aMode )
249{
250 for( SCH_TABLECELL* cell : m_cells )
251 aFunction( cell );
252}
253
254
256{
257 // Note: a table with no cells is not allowed
258 BOX2I bbox = m_cells[0]->GetBoundingBox();
259
260 bbox.Merge( m_cells[ m_cells.size() - 1 ]->GetBoundingBox() );
261
262 return bbox;
263}
264
265
266INSPECT_RESULT SCH_TABLE::Visit( INSPECTOR aInspector, void* aTestData,
267 const std::vector<KICAD_T>& aScanTypes )
268{
269 for( KICAD_T scanType : aScanTypes )
270 {
271 if( scanType == SCH_LOCATE_ANY_T || scanType == SCH_TABLE_T )
272 {
273 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
274 return INSPECT_RESULT::QUIT;
275 }
276
277 if( scanType == SCH_LOCATE_ANY_T || scanType == SCH_TABLECELL_T )
278 {
279 for( SCH_TABLECELL* cell : m_cells )
280 {
281 if( INSPECT_RESULT::QUIT == aInspector( cell, (void*) this ) )
282 return INSPECT_RESULT::QUIT;
283 }
284 }
285 }
286
287 return INSPECT_RESULT::CONTINUE;
288}
289
290
291wxString SCH_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
292{
293 return wxString::Format( _( "%d Column Table" ), m_colCount );
294}
295
296
298{
299 return BITMAPS::spreadsheet; // JEY TODO
300}
301
302
303std::vector<int> SCH_TABLE::ViewGetLayers() const
304{
306}
307
308
309bool SCH_TABLE::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
310{
311 BOX2I rect = GetBoundingBox();
312
313 rect.Inflate( aAccuracy );
314
315 return rect.Contains( aPosition );
316}
317
318
319bool SCH_TABLE::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
320{
321 BOX2I rect = aRect;
322
323 rect.Inflate( aAccuracy );
324
325 if( aContained )
326 return rect.Contains( GetBoundingBox() );
327
328 return rect.Intersects( GetBoundingBox() );
329}
330
331
332void SCH_TABLE::DrawBorders( const std::function<void( const VECTOR2I& aPt1, const VECTOR2I& aPt2,
333 const STROKE_PARAMS& aStroke )>& aCallback ) const
334{
335 EDA_ANGLE drawAngle = GetCell( 0, 0 )->GetTextAngle();
336
337 std::vector<VECTOR2I> topLeft = GetCell( 0, 0 )->GetCornersInSequence( drawAngle );
338 std::vector<VECTOR2I> bottomLeft = GetCell( GetRowCount() - 1, 0 )->GetCornersInSequence( drawAngle );
339 std::vector<VECTOR2I> topRight = GetCell( 0, GetColCount() - 1 )->GetCornersInSequence( drawAngle );
340 std::vector<VECTOR2I> bottomRight =
341 GetCell( GetRowCount() - 1, GetColCount() - 1 )->GetCornersInSequence( drawAngle );
342 STROKE_PARAMS stroke;
343
344 for( int col = 0; col < GetColCount() - 1; ++col )
345 {
346 if( StrokeColumns() )
347 stroke = GetSeparatorsStroke();
348 else
349 continue;
350
351 for( int row = 0; row < GetRowCount(); ++row )
352 {
353 SCH_TABLECELL* cell = GetCell( row, col );
354
355 if( cell->GetColSpan() == 0 )
356 continue;
357
358 if( col + cell->GetColSpan() == GetColCount() )
359 continue;
360
361 std::vector<VECTOR2I> corners = cell->GetCornersInSequence( drawAngle );
362
363 if( corners.size() == 4 )
364 aCallback( corners[1], corners[2], stroke );
365 }
366 }
367
368 for( int row = 0; row < GetRowCount() - 1; ++row )
369 {
370 if( row == 0 && StrokeHeaderSeparator() )
371 stroke = GetBorderStroke();
372 else if( StrokeRows() )
373 stroke = GetSeparatorsStroke();
374 else
375 continue;
376
377 for( int col = 0; col < GetColCount(); ++col )
378 {
379 SCH_TABLECELL* cell = GetCell( row, col );
380
381 if( cell->GetRowSpan() == 0 )
382 continue;
383
384 if( row + cell->GetRowSpan() == GetRowCount() )
385 continue;
386
387 std::vector<VECTOR2I> corners = cell->GetCornersInSequence( drawAngle );
388
389 if( corners.size() == 4 )
390 aCallback( corners[2], corners[3], stroke );
391 }
392 }
393
394 if( StrokeExternal() && GetBorderStroke().GetWidth() >= 0 )
395 {
396 aCallback( topLeft[0], topRight[1], GetBorderStroke() );
397 aCallback( topRight[1], bottomRight[2], GetBorderStroke() );
398 aCallback( bottomRight[2], bottomLeft[3], GetBorderStroke() );
399 aCallback( bottomLeft[3], topLeft[0], GetBorderStroke() );
400 }
401}
402
403
404void SCH_TABLE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
405 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
406{
407 for( SCH_TABLECELL* cell : m_cells )
408 cell->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
409
410 if( aBackground )
411 return;
412
413 RENDER_SETTINGS* settings = aPlotter->RenderSettings();
414
416 [&]( const VECTOR2I& ptA, const VECTOR2I& ptB, const STROKE_PARAMS& stroke )
417 {
418 int lineWidth = stroke.GetWidth();
419 COLOR4D color = stroke.GetColor();
420 LINE_STYLE lineStyle = stroke.GetLineStyle();
421
422 if( lineWidth == 0 )
423 {
424 if( SCHEMATIC* schematic = Schematic() )
425 lineWidth = schematic->Settings().m_DefaultLineWidth;
426 else
428 }
429
430 if( lineWidth < settings->GetMinPenWidth() )
431 lineWidth = settings->GetMinPenWidth();
432
433 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
434 color = settings->GetLayerColor( m_layer );
435
436 if( lineStyle == LINE_STYLE::DEFAULT )
437 lineStyle = LINE_STYLE::SOLID;
438
439 aPlotter->SetColor( color );
440 aPlotter->SetDash( lineWidth, lineStyle );
441
442 aPlotter->MoveTo( ptA );
443 aPlotter->FinishTo( ptB );
444 } );
445}
446
447
448void SCH_TABLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
449{
450 // Don't use GetShownText() here; we want to show the user the variable references
451 aList.emplace_back( _( "Table" ), wxString::Format( _( "%d Columns" ), m_colCount ) );
452}
453
454
455bool SCH_TABLE::operator==( const SCH_ITEM& aOther ) const
456{
457 if( Type() != aOther.Type() )
458 return false;
459
460 const SCH_TABLE& other = static_cast<const SCH_TABLE&>( aOther );
461
462 if( m_cells.size() != other.m_cells.size() )
463 return false;
464
465 if( m_colWidths != other.m_colWidths )
466 return false;
467
468 if( m_rowHeights != other.m_rowHeights )
469 return false;
470
471 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
472 {
473 if( !( *m_cells[ii] == *other.m_cells[ii] ) )
474 return false;
475 }
476
477 return true;
478}
479
480
481double SCH_TABLE::Similarity( const SCH_ITEM& aOther ) const
482{
483 if( aOther.Type() != Type() )
484 return 0.0;
485
486 const SCH_TABLE& other = static_cast<const SCH_TABLE&>( aOther );
487
488 if( m_cells.size() != other.m_cells.size() )
489 return 0.1;
490
491 double similarity = 1.0;
492
493 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
494 similarity *= m_cells[ii]->Similarity( *other.m_cells[ii] );
495
496 return similarity;
497}
498
499
500static struct SCH_TABLE_DESC
501{
503 {
506
509
510 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Start X" ),
511 &SCH_TABLE::SetPositionX, &SCH_TABLE::GetPositionX, PROPERTY_DISPLAY::PT_COORD,
513 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Start Y" ),
514 &SCH_TABLE::SetPositionY, &SCH_TABLE::GetPositionY, PROPERTY_DISPLAY::PT_COORD,
516
517 const wxString tableProps = _( "Table Properties" );
518
519 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "External Border" ),
521 tableProps );
522
523 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "Header Border" ),
525 tableProps );
526
527 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Border Width" ),
529 PROPERTY_DISPLAY::PT_SIZE ),
530 tableProps );
531
532 propMgr.AddProperty( new PROPERTY_ENUM<SCH_TABLE, LINE_STYLE>( _HKI( "Border Style" ),
534 tableProps );
535
536 propMgr.AddProperty( new PROPERTY<SCH_TABLE, COLOR4D>( _HKI( "Border Color" ),
538 tableProps );
539
540 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "Row Separators" ),
542 tableProps );
543
544 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "Cell Separators" ),
546 tableProps );
547
548 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Separators Width" ),
550 PROPERTY_DISPLAY::PT_SIZE ),
551 tableProps );
552
553 propMgr.AddProperty( new PROPERTY_ENUM<SCH_TABLE, LINE_STYLE>( _HKI( "Separators Style" ),
555 tableProps );
556
557 propMgr.AddProperty( new PROPERTY<SCH_TABLE, COLOR4D>( _HKI( "Separators Color" ),
559 tableProps );
560 }
int color
Definition: DXF_plotter.cpp:63
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:112
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:558
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:658
constexpr const Vec GetCenter() const
Definition: box2.h:230
constexpr bool Contains(const Vec &aPoint) const
Definition: box2.h:168
constexpr bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:311
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:108
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:111
std::vector< VECTOR2I > GetCornersInSequence(EDA_ANGLE angle) const
Definition: eda_shape.cpp:1601
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition: eda_shape.h:215
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:219
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:144
virtual void ClearRenderCache()
Definition: eda_text.cpp:658
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
Base plotter engine class.
Definition: plotter.h:121
void MoveTo(const VECTOR2I &pos)
Definition: plotter.h:261
virtual void SetDash(int aLineWidth, LINE_STYLE aLineStyle)=0
void FinishTo(const VECTOR2I &pos)
Definition: plotter.h:271
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:152
bool GetColorMode() const
Definition: plotter.h:149
virtual void SetColor(const COLOR4D &color)=0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:85
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:87
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
Holds all the data relating to one schematic.
Definition: schematic.h:69
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:167
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:177
void SetLayer(SCH_LAYER_ID aLayer)
Definition: sch_item.h:291
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
Definition: sch_item.cpp:397
SCH_LAYER_ID m_layer
Definition: sch_item.h:719
void SetPosition(const VECTOR2I &aPos) override
Definition: sch_shape.h:84
VECTOR2I GetPosition() const override
Definition: sch_shape.h:83
int GetColSpan() const
Definition: sch_tablecell.h:64
int GetRowSpan() const
Definition: sch_tablecell.h:67
void SetBorderWidth(int aWidth)
Definition: sch_table.h:60
void SetSeparatorsStyle(const LINE_STYLE aStyle)
Definition: sch_table.h:81
LINE_STYLE GetSeparatorsStyle() const
Definition: sch_table.h:86
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition: sch_table.cpp:303
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
Definition: sch_table.cpp:481
bool operator<(const SCH_ITEM &aItem) const override
Definition: sch_table.cpp:228
std::vector< SCH_TABLECELL * > m_cells
Definition: sch_table.h:253
const STROKE_PARAMS & GetSeparatorsStroke() const
Definition: sch_table.h:76
std::map< int, int > m_rowHeights
Definition: sch_table.h:252
bool m_strokeColumns
Definition: sch_table.h:247
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_table.cpp:309
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_table.cpp:255
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition: sch_table.cpp:207
bool StrokeExternal() const
Definition: sch_table.h:52
void SetBorderColor(const COLOR4D &aColor)
Definition: sch_table.h:72
bool m_strokeRows
Definition: sch_table.h:246
int GetPositionY() const
Definition: sch_table.h:116
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: sch_table.cpp:291
void SetPositionX(int x)
Definition: sch_table.h:113
LINE_STYLE GetBorderStyle() const
Definition: sch_table.h:64
void SetSeparatorsColor(const COLOR4D &aColor)
Definition: sch_table.h:94
int GetRowHeight(int aRow) const
Definition: sch_table.h:138
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
Definition: sch_table.cpp:248
COLOR4D GetSeparatorsColor() const
Definition: sch_table.h:95
SCH_TABLE(int aLineWidth=0)
Definition: sch_table.cpp:38
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition: sch_table.cpp:213
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: sch_table.cpp:266
void DrawBorders(const std::function< void(const VECTOR2I &aPt1, const VECTOR2I &aPt2, const STROKE_PARAMS &aStroke)> &aCallback) const
Definition: sch_table.cpp:332
int GetColWidth(int aCol) const
Definition: sch_table.h:128
void SetStrokeHeaderSeparator(bool aDoStroke)
Definition: sch_table.h:54
void AddCell(SCH_TABLECELL *aCell)
Definition: sch_table.h:161
void SetSeparatorsWidth(int aWidth)
Definition: sch_table.h:78
const STROKE_PARAMS & GetBorderStroke() const
Definition: sch_table.h:58
bool m_StrokeHeaderSeparator
Definition: sch_table.h:244
VECTOR2I GetCenter() const
Definition: sch_table.cpp:121
int m_colCount
Definition: sch_table.h:250
VECTOR2I GetPosition() const override
Definition: sch_table.cpp:115
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition: sch_table.cpp:79
void SetStrokeExternal(bool aDoStroke)
Definition: sch_table.h:51
VECTOR2I GetEnd() const
Definition: sch_table.cpp:135
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: sch_table.cpp:448
void SetPositionY(int y)
Definition: sch_table.h:114
STROKE_PARAMS m_separatorsStroke
Definition: sch_table.h:248
int GetColCount() const
Definition: sch_table.h:119
bool StrokeHeaderSeparator() const
Definition: sch_table.h:55
bool m_strokeExternal
Definition: sch_table.h:243
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
Definition: sch_table.cpp:404
std::map< int, int > m_colWidths
Definition: sch_table.h:251
void SetStrokeColumns(bool aDoStroke)
Definition: sch_table.h:97
SCH_TABLECELL * GetCell(int aRow, int aCol) const
Definition: sch_table.h:146
int GetSeparatorsWidth() const
Definition: sch_table.h:79
bool StrokeColumns() const
Definition: sch_table.h:98
void SetPosition(const VECTOR2I &aPos) override
Definition: sch_table.cpp:109
int GetPositionX() const
Definition: sch_table.h:115
bool StrokeRows() const
Definition: sch_table.h:101
STROKE_PARAMS m_borderStroke
Definition: sch_table.h:245
int GetRowCount() const
Definition: sch_table.h:121
void SetStrokeRows(bool aDoStroke)
Definition: sch_table.h:100
void SetBorderStyle(const LINE_STYLE aStyle)
Definition: sch_table.h:63
COLOR4D GetBorderColor() const
Definition: sch_table.h:73
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: sch_table.cpp:297
bool operator==(const SCH_ITEM &aOther) const override
Definition: sch_table.cpp:455
int GetBorderWidth() const
Definition: sch_table.h:61
void Normalize()
Definition: sch_table.cpp:149
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition: sch_table.cpp:200
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition: sch_table.cpp:219
Simple container to manage line stroke parameters.
Definition: stroke_params.h:94
int GetWidth() const
LINE_STYLE GetLineStyle() const
KIGFX::COLOR4D GetColor() const
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
#define _HKI(x)
#define _(s)
RECURSE_MODE
Definition: eda_item.h:49
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition: eda_item.h:89
@ LAYER_NOTES
Definition: layer_ids.h:456
@ LAYER_NOTES_BACKGROUND
Definition: layer_ids.h:458
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:483
see class PGM_BASE
#define TYPE_HASH(x)
Definition: property.h:72
#define REGISTER_TYPE(x)
Definition: property_mgr.h:371
static struct SCH_TABLE_DESC _SCH_TABLE_DESC
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:46
constexpr int MilsToIU(int mils) const
Definition: base_units.h:95
VECTOR2I end
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
Definition: trigo.cpp:229
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ SCH_TABLE_T
Definition: typeinfo.h:165
@ SCH_TABLECELL_T
Definition: typeinfo.h:166
@ SCH_LOCATE_ANY_T
Definition: typeinfo.h:199
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:695