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