KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_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 (C) 2024 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 <pcb_edit_frame.h>
25#include <pcb_table.h>
29
30
31PCB_TABLE::PCB_TABLE( BOARD_ITEM* aParent, int aLineWidth ) :
33 m_strokeExternal( true ),
34 m_strokeHeader( true ),
35 m_borderStroke( aLineWidth, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ),
36 m_strokeRows( true ),
37 m_strokeColumns( true ),
38 m_separatorsStroke( aLineWidth, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ),
39 m_colCount( 0 )
40{
41}
42
43
45 BOARD_ITEM_CONTAINER( aTable )
46{
53
54 m_colCount = aTable.m_colCount;
55 m_colWidths = aTable.m_colWidths;
57
58 for( PCB_TABLECELL* src : aTable.m_cells )
59 AddCell( new PCB_TABLECELL( *src ) );
60}
61
62
64{
65 // We own our cells; delete them
66 for( PCB_TABLECELL* cell : m_cells )
67 delete cell;
68}
69
70
72{
73 wxCHECK_RET( aImage != nullptr && aImage->Type() == PCB_TABLE_T,
74 wxT( "Cannot swap data with invalid table." ) );
75
76 PCB_TABLE* table = static_cast<PCB_TABLE*>( aImage );
77
78 std::swap( m_layer, table->m_layer );
79 std::swap( m_isLocked, table->m_isLocked );
80
81 std::swap( m_strokeExternal, table->m_strokeExternal );
82 std::swap( m_strokeHeader, table->m_strokeHeader );
83 std::swap( m_borderStroke, table->m_borderStroke );
84 std::swap( m_strokeRows, table->m_strokeRows );
85 std::swap( m_strokeColumns, table->m_strokeColumns );
86 std::swap( m_separatorsStroke, table->m_separatorsStroke );
87
88 std::swap( m_colCount, table->m_colCount );
89 std::swap( m_colWidths, table->m_colWidths );
90 std::swap( m_rowHeights, table->m_rowHeights );
91
92 std::swap( m_cells, table->m_cells );
93
94 for( PCB_TABLECELL* cell : m_cells )
95 cell->SetParent( this );
96
97 for( PCB_TABLECELL* cell : table->m_cells )
98 cell->SetParent( table );
99}
100
101
103{
104 Move( aPos - GetPosition() );
105}
106
107
109{
110 return m_cells[0]->GetPosition();
111}
112
113
115{
116 VECTOR2I tableSize;
117
118 for( int ii = 0; ii < GetColCount(); ++ii )
119 tableSize.x += GetColWidth( ii );
120
121 for( int ii = 0; ii < GetRowCount(); ++ii )
122 tableSize.y += GetRowHeight( ii );
123
124 return GetPosition() + tableSize;
125}
126
127
129{
130 // JEY TODO: pukes on rotated tables...
131
132 int y = GetPosition().y;
133
134 for( int row = 0; row < GetRowCount(); ++row )
135 {
136 int x = GetPosition().x;
137 int rowHeight = m_rowHeights[ row ];
138
139 for( int col = 0; col < GetColCount(); ++col )
140 {
141 int colWidth = m_colWidths[ col ];
142
143 PCB_TABLECELL* cell = GetCell( row, col );
144 VECTOR2I pos( x, y );
145
146 if( cell->GetPosition() != pos )
147 {
148 cell->SetPosition( pos );
149 cell->ClearRenderCache();
150 }
151
152 VECTOR2I end = cell->GetStart() + VECTOR2I( colWidth, rowHeight );
153
154 if( cell->GetColSpan() > 1 || cell->GetRowSpan() > 1 )
155 {
156 for( int ii = col + 1; ii < col + cell->GetColSpan(); ++ii )
157 end.x += m_colWidths[ii];
158
159 for( int ii = row + 1; ii < row + cell->GetRowSpan(); ++ii )
160 end.y += m_rowHeights[ii];
161 }
162
163 if( cell->GetEnd() != end )
164 {
165 cell->SetEnd( end );
166 cell->ClearRenderCache();
167 }
168
169 x += colWidth;
170 }
171
172 y += rowHeight;
173 }
174}
175
176
177void PCB_TABLE::Move( const VECTOR2I& aMoveVector )
178{
179 for( PCB_TABLECELL* cell : m_cells )
180 cell->Move( aMoveVector );
181}
182
183
184void PCB_TABLE::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
185{
186 for( PCB_TABLECELL* cell : m_cells )
187 cell->Rotate( aRotCentre, aAngle );
188
189 Normalize();
190}
191
192
193void PCB_TABLE::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
194{
195 for( PCB_TABLECELL* cell : m_cells )
196 cell->Flip( aCentre, aFlipLeftRight );
197
198 std::vector<PCB_TABLECELL*> oldCells = m_cells;
199 int rowOffset = 0;
200
201 for( int row = 0; row < GetRowCount(); ++row )
202 {
203 for( int col = 0; col < GetColCount(); ++col )
204 m_cells[ rowOffset + col ] = oldCells[ rowOffset + GetColCount() - 1 - col ];
205
206 rowOffset += GetColCount();
207 }
208
209 SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
210 Normalize();
211}
212
213
214void PCB_TABLE::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction ) const
215{
216 for( PCB_TABLECELL* cell : m_cells )
217 aFunction( cell );
218}
219
220
222{
223 // Note: a table with no cells is not allowed
224 BOX2I bbox = m_cells[0]->GetBoundingBox();
225
226 bbox.Merge( m_cells[ m_cells.size() - 1 ]->GetBoundingBox() );
227
228 return bbox;
229}
230
231
232std::shared_ptr<SHAPE> PCB_TABLE::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
233{
234 VECTOR2I origin = GetPosition();
235 VECTOR2I end = GetEnd();
236 std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
237
238 std::vector<VECTOR2I> pts;
239
240 pts.emplace_back( origin );
241 pts.emplace_back( end.x, origin.y );
242 pts.emplace_back( end );
243 pts.emplace_back( origin.x, end.y );
244
245 shape->AddShape( new SHAPE_SIMPLE( pts ) );
246
247 auto addSeg =
248 [&shape]( const VECTOR2I& ptA, const VECTOR2I& ptB, int width )
249 {
250 shape->AddShape( new SHAPE_SEGMENT( ptA, ptB, width ) );
251 };
252
254 {
255 for( int col = 0; col < GetColCount() - 1; ++col )
256 {
257 for( int row = 0; row < GetRowCount(); ++row )
258 {
259 PCB_TABLECELL* cell = GetCell( row, col );
260 VECTOR2I topRight( cell->GetEndX(), cell->GetStartY() );
261
262 if( cell->GetColSpan() > 0 && cell->GetRowSpan() > 0 )
263 addSeg( topRight, cell->GetEnd(), GetSeparatorsStroke().GetWidth() );
264 }
265 }
266 }
267
268 if( StrokeRows() && GetSeparatorsStroke().GetWidth() >= 0 )
269 {
270 for( int row = 0; row < GetRowCount() - 1; ++row )
271 {
272 for( int col = 0; col < GetColCount(); ++col )
273 {
274 PCB_TABLECELL* cell = GetCell( row, col );
275 VECTOR2I botLeft( cell->GetStartX(), cell->GetEndY() );
276
277 if( cell->GetColSpan() > 0 && cell->GetRowSpan() > 0 )
278 addSeg( botLeft, cell->GetEnd(), GetSeparatorsStroke().GetWidth() );
279 }
280 }
281 }
282
283 if( StrokeExternal() && GetBorderStroke().GetWidth() >= 0 )
284 {
285 addSeg( pts[0], pts[1], GetBorderStroke().GetWidth() );
286 addSeg( pts[1], pts[2], GetBorderStroke().GetWidth() );
287 addSeg( pts[2], pts[3], GetBorderStroke().GetWidth() );
288 addSeg( pts[3], pts[0], GetBorderStroke().GetWidth() );
289 }
290
291 return shape;
292}
293
294
296 int aClearance, int aMaxError, ERROR_LOC aErrorLoc,
297 bool aIgnoreLineWidth ) const
298{
299 int gap = aClearance;
300
301 if( StrokeColumns() || StrokeRows() )
302 gap = std::max( gap, aClearance + GetSeparatorsStroke().GetWidth() / 2 );
303
304 if( StrokeExternal() || StrokeHeader() )
305 gap = std::max( gap, aClearance + GetBorderStroke().GetWidth() / 2 );
306
307 for( PCB_TABLECELL* cell : m_cells )
308 cell->TransformShapeToPolygon( aBuffer, aLayer, gap, aMaxError, aErrorLoc, false );
309}
310
311
312INSPECT_RESULT PCB_TABLE::Visit( INSPECTOR aInspector, void* aTestData,
313 const std::vector<KICAD_T>& aScanTypes )
314{
315 for( KICAD_T scanType : aScanTypes )
316 {
317 if( scanType == PCB_TABLE_T )
318 {
319 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
320 return INSPECT_RESULT::QUIT;
321 }
322
323 if( scanType == PCB_TABLECELL_T )
324 {
325 for( PCB_TABLECELL* cell : m_cells )
326 {
327 if( INSPECT_RESULT::QUIT == aInspector( cell, (void*) this ) )
328 return INSPECT_RESULT::QUIT;
329 }
330 }
331 }
332
333 return INSPECT_RESULT::CONTINUE;
334}
335
336
337wxString PCB_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
338{
339 return wxString::Format( _( "%d Column Table" ), m_colCount );
340}
341
342
344{
345 return BITMAPS::spreadsheet; // JEY TODO
346}
347
348
349bool PCB_TABLE::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
350{
351 BOX2I rect = GetBoundingBox();
352
353 rect.Inflate( aAccuracy );
354
355 return rect.Contains( aPosition );
356}
357
358
359bool PCB_TABLE::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
360{
361 BOX2I rect = aRect;
362
363 rect.Inflate( aAccuracy );
364
365 if( aContained )
366 return rect.Contains( GetBoundingBox() );
367
368 return rect.Intersects( GetBoundingBox() );
369}
370
371
372void PCB_TABLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
373{
374 // Don't use GetShownText() here; we want to show the user the variable references
375 aList.emplace_back( _( "Table" ), wxString::Format( _( "%d Columns" ), m_colCount ) );
376}
377
378
379int PCB_TABLE::Compare( const PCB_TABLE* aTable, const PCB_TABLE* aOther )
380{
381 int diff;
382
383 if( ( diff = (int) aTable->GetCells().size() - (int) aOther->GetCells().size() ) != 0 )
384 return diff;
385
386 if( ( diff = aTable->GetColCount() - aOther->GetColCount() ) != 0 )
387 return diff;
388
389 for( int col = 0; col < aTable->GetColCount(); ++col )
390 {
391 if( ( diff = aTable->GetColWidth( col ) - aOther->GetColWidth( col ) ) != 0 )
392 return diff;
393 }
394
395 for( int row = 0; row < aTable->GetRowCount(); ++row )
396 {
397 if( ( diff = aTable->GetRowHeight( row ) - aOther->GetRowHeight( row ) ) != 0 )
398 return diff;
399 }
400
401 for( int row = 0; row < aTable->GetRowCount(); ++row )
402 {
403 for( int col = 0; col < aTable->GetColCount(); ++col )
404 {
405 PCB_TABLECELL* cell = aTable->GetCell( row, col );
406 PCB_TABLECELL* other = aOther->GetCell( row, col );
407
408 if( ( diff = cell->PCB_SHAPE::Compare( other ) ) != 0 )
409 return diff;
410
411 if( ( diff = cell->EDA_TEXT::Compare( other ) ) != 0 )
412 return diff;
413 }
414 }
415
416 return 0;
417}
418
419
420bool PCB_TABLE::operator==( const BOARD_ITEM& aOther ) const
421{
422 if( Type() != aOther.Type() )
423 return false;
424
425 const PCB_TABLE& other = static_cast<const PCB_TABLE&>( aOther );
426
427 if( m_cells.size() != other.m_cells.size() )
428 return false;
429
430 if( m_colWidths != other.m_colWidths )
431 return false;
432
433 if( m_rowHeights != other.m_rowHeights )
434 return false;
435
436 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
437 {
438 if( !( *m_cells[ii] == *other.m_cells[ii] ) )
439 return false;
440 }
441
442 return true;
443}
444
445
446double PCB_TABLE::Similarity( const BOARD_ITEM& aOther ) const
447{
448 if( aOther.Type() != Type() )
449 return 0.0;
450
451 const PCB_TABLE& other = static_cast<const PCB_TABLE&>( aOther );
452
453 if( m_cells.size() != other.m_cells.size() )
454 return 0.1;
455
456 double similarity = 1.0;
457
458 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
459 similarity *= m_cells[ii]->Similarity( *other.m_cells[ii] );
460
461 return similarity;
462}
463
464
465static struct PCB_TABLE_DESC
466{
468 {
470
471 if( plotDashTypeEnum.Choices().GetCount() == 0 )
472 {
473 plotDashTypeEnum.Map( LINE_STYLE::DEFAULT, _HKI( "Default" ) )
474 .Map( LINE_STYLE::SOLID, _HKI( "Solid" ) )
475 .Map( LINE_STYLE::DASH, _HKI( "Dashed" ) )
476 .Map( LINE_STYLE::DOT, _HKI( "Dotted" ) )
477 .Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) )
478 .Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) );
479 }
480
483
488
489 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Start X" ),
490 &PCB_TABLE::SetPositionX, &PCB_TABLE::GetPositionX, PROPERTY_DISPLAY::PT_COORD,
492 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Start Y" ),
493 &PCB_TABLE::SetPositionY, &PCB_TABLE::GetPositionY, PROPERTY_DISPLAY::PT_COORD,
495
496 const wxString tableProps = _( "Table Properties" );
497
498 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "External Border" ),
500 tableProps );
501
502 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "Header Border" ),
504 tableProps );
505
506 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Border Width" ),
508 PROPERTY_DISPLAY::PT_SIZE ),
509 tableProps );
510
511 propMgr.AddProperty( new PROPERTY_ENUM<PCB_TABLE, LINE_STYLE>( _HKI( "Border Style" ),
513 tableProps );
514
515 propMgr.AddProperty( new PROPERTY<PCB_TABLE, COLOR4D>( _HKI( "Border Color" ),
517 tableProps );
518
519 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "Row Separators" ),
521 tableProps );
522
523 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "Cell Separators" ),
525 tableProps );
526
527 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Separators Width" ),
529 PROPERTY_DISPLAY::PT_SIZE ),
530 tableProps );
531
532 propMgr.AddProperty( new PROPERTY_ENUM<PCB_TABLE, LINE_STYLE>( _HKI( "Separators Style" ),
534 tableProps );
535
536 propMgr.AddProperty( new PROPERTY<PCB_TABLE, COLOR4D>( _HKI( "Separators Color" ),
538 tableProps );
539 }
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:226
PCB_LAYER_ID m_layer
Definition: board_item.h:388
bool m_isLocked
Definition: board_item.h:391
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:260
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:270
bool Contains(const Vec &aPoint) const
Definition: box2.h:142
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:507
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:589
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:100
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:103
int GetStartY() const
Definition: eda_shape.h:126
int GetEndX() const
Definition: eda_shape.h:152
int GetEndY() const
Definition: eda_shape.h:151
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition: eda_shape.h:150
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition: eda_shape.h:125
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:154
int GetStartX() const
Definition: eda_shape.h:127
virtual void ClearRenderCache()
Definition: eda_text.cpp:499
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:669
static ENUM_MAP< T > & Instance()
Definition: property.h:663
wxPGChoices & Choices()
Definition: property.h:712
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
void SetPosition(const VECTOR2I &aPos) override
Definition: pcb_shape.h:72
VECTOR2I GetPosition() const override
Definition: pcb_shape.h:73
int GetRowSpan() const
Definition: pcb_tablecell.h:65
int GetColSpan() const
Definition: pcb_tablecell.h:62
VECTOR2I GetEnd() const
Definition: pcb_table.cpp:114
STROKE_PARAMS m_separatorsStroke
Definition: pcb_table.h:245
bool StrokeRows() const
Definition: pcb_table.h:85
bool operator==(const BOARD_ITEM &aOther) const override
Definition: pcb_table.cpp:420
int GetRowCount() const
Definition: pcb_table.h:102
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: pcb_table.cpp:221
std::vector< PCB_TABLECELL * > m_cells
Definition: pcb_table.h:250
int m_colCount
Definition: pcb_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: pcb_table.cpp:349
bool m_strokeRows
Definition: pcb_table.h:243
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_table.cpp:177
int GetPositionY() const
Definition: pcb_table.h:97
bool StrokeColumns() const
Definition: pcb_table.h:82
void SetBorderStyle(const LINE_STYLE aStyle)
Definition: pcb_table.h:63
void SetStrokeHeader(bool aDoStroke)
Definition: pcb_table.h:54
void SetSeparatorsColor(const COLOR4D &aColor)
Definition: pcb_table.h:78
bool m_strokeExternal
Definition: pcb_table.h:240
STROKE_PARAMS m_borderStroke
Definition: pcb_table.h:242
bool m_strokeColumns
Definition: pcb_table.h:244
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: pcb_table.cpp:232
bool StrokeExternal() const
Definition: pcb_table.h:52
int GetSeparatorsWidth() const
Definition: pcb_table.h:73
void SetPositionX(int x)
Definition: pcb_table.h:94
void SetStrokeExternal(bool aDoStroke)
Definition: pcb_table.h:51
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: pcb_table.cpp:337
bool StrokeHeader() const
Definition: pcb_table.h:55
PCB_TABLECELL * GetCell(int aRow, int aCol) const
Definition: pcb_table.h:127
std::vector< PCB_TABLECELL * > GetCells() const
Definition: pcb_table.h:137
int GetBorderWidth() const
Definition: pcb_table.h:61
COLOR4D GetBorderColor() const
Definition: pcb_table.h:67
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: pcb_table.cpp:312
int GetColCount() const
Definition: pcb_table.h:100
void SetStrokeColumns(bool aDoStroke)
Definition: pcb_table.h:81
const STROKE_PARAMS & GetSeparatorsStroke() const
Definition: pcb_table.h:70
std::map< int, int > m_colWidths
Definition: pcb_table.h:248
virtual void swapData(BOARD_ITEM *aImage) override
Definition: pcb_table.cpp:71
int GetPositionX() const
Definition: pcb_table.h:96
void Normalize() override
Perform any normalization required after a user rotate and/or flip.
Definition: pcb_table.cpp:128
void AddCell(PCB_TABLECELL *aCell)
Definition: pcb_table.h:142
const STROKE_PARAMS & GetBorderStroke() const
Definition: pcb_table.h:58
void SetPositionY(int y)
Definition: pcb_table.h:95
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_table.cpp:343
void SetStrokeRows(bool aDoStroke)
Definition: pcb_table.h:84
bool m_strokeHeader
Definition: pcb_table.h:241
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
Definition: pcb_table.cpp:446
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth=false) const override
Convert the item shape to a closed polygon.
Definition: pcb_table.cpp:295
LINE_STYLE GetBorderStyle() const
Definition: pcb_table.h:64
static int Compare(const PCB_TABLE *aTable, const PCB_TABLE *aOther)
Definition: pcb_table.cpp:379
int GetColWidth(int aCol) const
Definition: pcb_table.h:109
VECTOR2I GetPosition() const override
Definition: pcb_table.cpp:108
void SetSeparatorsWidth(int aWidth)
Definition: pcb_table.h:72
COLOR4D GetSeparatorsColor() const
Definition: pcb_table.h:79
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: pcb_table.cpp:193
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const override
Invoke a function on all children.
Definition: pcb_table.cpp:214
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_table.cpp:184
LINE_STYLE GetSeparatorsStyle() const
Definition: pcb_table.h:76
void SetBorderColor(const COLOR4D &aColor)
Definition: pcb_table.h:66
PCB_TABLE(BOARD_ITEM *aParent, int aLineWidth)
Definition: pcb_table.cpp:31
void SetSeparatorsStyle(const LINE_STYLE aStyle)
Definition: pcb_table.h:75
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: pcb_table.cpp:372
void SetPosition(const VECTOR2I &aPos) override
Definition: pcb_table.cpp:102
void SetBorderWidth(int aWidth)
Definition: pcb_table.h:60
int GetRowHeight(int aRow) const
Definition: pcb_table.h:119
std::map< int, int > m_rowHeights
Definition: pcb_table.h:249
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.
Represent a set of closed polygons.
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
Definition: shape_simple.h:42
int GetWidth() const
Definition: stroke_params.h:91
#define _HKI(x)
#define _(s)
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:81
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:149
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Definition: lset.cpp:634
static struct PCB_TABLE_DESC _PCB_TABLE_DESC
#define TYPE_HASH(x)
Definition: property.h:71
#define REGISTER_TYPE(x)
Definition: property_mgr.h:366
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:48
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition: typeinfo.h:95
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition: typeinfo.h:94
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588