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 <footprint.h>
26#include <pcb_table.h>
27#include <board.h>
31
32
33PCB_TABLE::PCB_TABLE( BOARD_ITEM* aParent, int aLineWidth ) :
35 m_strokeExternal( true ),
36 m_strokeHeader( true ),
37 m_borderStroke( aLineWidth, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ),
38 m_strokeRows( true ),
39 m_strokeColumns( true ),
40 m_separatorsStroke( aLineWidth, LINE_STYLE::DEFAULT, COLOR4D::UNSPECIFIED ),
41 m_colCount( 0 )
42{
43}
44
45
47 BOARD_ITEM_CONTAINER( aTable )
48{
55
56 m_colCount = aTable.m_colCount;
57 m_colWidths = aTable.m_colWidths;
59
60 for( PCB_TABLECELL* src : aTable.m_cells )
61 AddCell( new PCB_TABLECELL( *src ) );
62}
63
64
66{
67 // We own our cells; delete them
68 for( PCB_TABLECELL* cell : m_cells )
69 delete cell;
70}
71
72
74{
75 wxCHECK_RET( aImage != nullptr && aImage->Type() == PCB_TABLE_T,
76 wxT( "Cannot swap data with invalid table." ) );
77
78 PCB_TABLE* table = static_cast<PCB_TABLE*>( aImage );
79
80 std::swap( m_layer, table->m_layer );
81 std::swap( m_isLocked, table->m_isLocked );
82
83 std::swap( m_strokeExternal, table->m_strokeExternal );
84 std::swap( m_strokeHeader, table->m_strokeHeader );
85 std::swap( m_borderStroke, table->m_borderStroke );
86 std::swap( m_strokeRows, table->m_strokeRows );
87 std::swap( m_strokeColumns, table->m_strokeColumns );
88 std::swap( m_separatorsStroke, table->m_separatorsStroke );
89
90 std::swap( m_colCount, table->m_colCount );
91 std::swap( m_colWidths, table->m_colWidths );
92 std::swap( m_rowHeights, table->m_rowHeights );
93
94 std::swap( m_cells, table->m_cells );
95
96 for( PCB_TABLECELL* cell : m_cells )
97 cell->SetParent( this );
98
99 for( PCB_TABLECELL* cell : table->m_cells )
100 cell->SetParent( table );
101}
102
103
105{
106 Move( aPos - GetPosition() );
107}
108
109
111{
112 return m_cells[0]->GetPosition();
113}
114
115
117{
118 VECTOR2I tableSize;
119
120 for( int ii = 0; ii < GetColCount(); ++ii )
121 tableSize.x += GetColWidth( ii );
122
123 for( int ii = 0; ii < GetRowCount(); ++ii )
124 tableSize.y += GetRowHeight( ii );
125
126 return GetPosition() + tableSize;
127}
128
129
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 RotatePoint( pos, GetPosition(), cell->GetTextAngle() );
147
148 if( cell->GetPosition() != pos )
149 {
150 cell->SetPosition( pos );
151 cell->ClearRenderCache();
152 }
153
154 VECTOR2I end = VECTOR2I( x + colWidth, y + rowHeight );
155
156 if( cell->GetColSpan() > 1 || cell->GetRowSpan() > 1 )
157 {
158 for( int ii = col + 1; ii < col + cell->GetColSpan(); ++ii )
159 end.x += m_colWidths[ii];
160
161 for( int ii = row + 1; ii < row + cell->GetRowSpan(); ++ii )
162 end.y += m_rowHeights[ii];
163 }
164
165 RotatePoint( end, GetPosition(), cell->GetTextAngle() );
166
167 if( cell->GetEnd() != end )
168 {
169 cell->SetEnd( end );
170 cell->ClearRenderCache();
171 }
172
173 x += colWidth;
174 }
175
176 y += rowHeight;
177 }
178}
179
180
181void PCB_TABLE::Move( const VECTOR2I& aMoveVector )
182{
183 for( PCB_TABLECELL* cell : m_cells )
184 cell->Move( aMoveVector );
185}
186
187
188void PCB_TABLE::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
189{
190 if( GetCells().empty() )
191 return;
192
193 bool translate = GetCell( 0, 0 )->GetTextAngle() + aAngle == ANGLE_180;
194
195 for( PCB_TABLECELL* cell : m_cells )
196 cell->Rotate( aRotCentre, aAngle );
197
198 if( translate )
199 Move( GetPosition() - GetEnd() );
200
201 Normalize();
202}
203
204
205void PCB_TABLE::Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
206{
207 for( PCB_TABLECELL* cell : m_cells )
208 cell->Flip( aCentre, aFlipDirection );
209
210 std::vector<PCB_TABLECELL*> oldCells = m_cells;
211 int rowOffset = 0;
212
213 for( int row = 0; row < GetRowCount(); ++row )
214 {
215 for( int col = 0; col < GetColCount(); ++col )
216 m_cells[ rowOffset + col ] = oldCells[ rowOffset + GetColCount() - 1 - col ];
217
218 rowOffset += GetColCount();
219 }
220
222 Normalize();
223}
224
225
226void PCB_TABLE::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction ) const
227{
228 for( PCB_TABLECELL* cell : m_cells )
229 aFunction( cell );
230}
231
232
234{
235 // Note: a table with no cells is not allowed
236 BOX2I bbox = m_cells[0]->GetBoundingBox();
237
238 bbox.Merge( m_cells[ m_cells.size() - 1 ]->GetBoundingBox() );
239
240 return bbox;
241}
242
243
244std::shared_ptr<SHAPE> PCB_TABLE::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
245{
246 VECTOR2I origin = GetPosition();
247 VECTOR2I end = GetEnd();
248 std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
249
250 std::vector<VECTOR2I> pts;
251
252 pts.emplace_back( origin );
253 pts.emplace_back( end.x, origin.y );
254 pts.emplace_back( end );
255 pts.emplace_back( origin.x, end.y );
256
257 shape->AddShape( new SHAPE_SIMPLE( pts ) );
258
259 auto addSeg =
260 [&shape]( const VECTOR2I& ptA, const VECTOR2I& ptB, int width )
261 {
262 shape->AddShape( new SHAPE_SEGMENT( ptA, ptB, width ) );
263 };
264
266 {
267 for( int col = 0; col < GetColCount() - 1; ++col )
268 {
269 for( int row = 0; row < GetRowCount(); ++row )
270 {
271 PCB_TABLECELL* cell = GetCell( row, col );
272 VECTOR2I topRight( cell->GetEndX(), cell->GetStartY() );
273
274 if( cell->GetColSpan() > 0 && cell->GetRowSpan() > 0 )
275 addSeg( topRight, cell->GetEnd(), GetSeparatorsStroke().GetWidth() );
276 }
277 }
278 }
279
280 if( StrokeRows() && GetSeparatorsStroke().GetWidth() >= 0 )
281 {
282 for( int row = 0; row < GetRowCount() - 1; ++row )
283 {
284 for( int col = 0; col < GetColCount(); ++col )
285 {
286 PCB_TABLECELL* cell = GetCell( row, col );
287 VECTOR2I botLeft( cell->GetStartX(), cell->GetEndY() );
288
289 if( cell->GetColSpan() > 0 && cell->GetRowSpan() > 0 )
290 addSeg( botLeft, cell->GetEnd(), GetSeparatorsStroke().GetWidth() );
291 }
292 }
293 }
294
295 if( StrokeExternal() && GetBorderStroke().GetWidth() >= 0 )
296 {
297 addSeg( pts[0], pts[1], GetBorderStroke().GetWidth() );
298 addSeg( pts[1], pts[2], GetBorderStroke().GetWidth() );
299 addSeg( pts[2], pts[3], GetBorderStroke().GetWidth() );
300 addSeg( pts[3], pts[0], GetBorderStroke().GetWidth() );
301 }
302
303 return shape;
304}
305
306
308 int aClearance, int aMaxError, ERROR_LOC aErrorLoc,
309 bool aIgnoreLineWidth ) const
310{
311 int gap = aClearance;
312
313 if( StrokeColumns() || StrokeRows() )
314 gap = std::max( gap, aClearance + GetSeparatorsStroke().GetWidth() / 2 );
315
316 if( StrokeExternal() || StrokeHeader() )
317 gap = std::max( gap, aClearance + GetBorderStroke().GetWidth() / 2 );
318
319 for( PCB_TABLECELL* cell : m_cells )
320 cell->TransformShapeToPolygon( aBuffer, aLayer, gap, aMaxError, aErrorLoc, false );
321}
322
323
324INSPECT_RESULT PCB_TABLE::Visit( INSPECTOR aInspector, void* aTestData,
325 const std::vector<KICAD_T>& aScanTypes )
326{
327 for( KICAD_T scanType : aScanTypes )
328 {
329 if( scanType == PCB_TABLE_T )
330 {
331 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
332 return INSPECT_RESULT::QUIT;
333 }
334
335 if( scanType == PCB_TABLECELL_T )
336 {
337 for( PCB_TABLECELL* cell : m_cells )
338 {
339 if( INSPECT_RESULT::QUIT == aInspector( cell, (void*) this ) )
340 return INSPECT_RESULT::QUIT;
341 }
342 }
343 }
344
345 return INSPECT_RESULT::CONTINUE;
346}
347
348
349wxString PCB_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
350{
351 return wxString::Format( _( "%d Column Table" ), m_colCount );
352}
353
354
356{
357 return BITMAPS::spreadsheet; // JEY TODO
358}
359
360
361bool PCB_TABLE::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
362{
363 BOX2I rect = GetBoundingBox();
364
365 rect.Inflate( aAccuracy );
366
367 return rect.Contains( aPosition );
368}
369
370
371bool PCB_TABLE::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
372{
373 BOX2I rect = aRect;
374
375 rect.Inflate( aAccuracy );
376
377 if( aContained )
378 return rect.Contains( GetBoundingBox() );
379
380 return rect.Intersects( GetBoundingBox() );
381}
382
383
384void PCB_TABLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
385{
386 // Don't use GetShownText() here; we want to show the user the variable references
387 aList.emplace_back( _( "Table" ), wxString::Format( _( "%d Columns" ), m_colCount ) );
388}
389
390
391int PCB_TABLE::Compare( const PCB_TABLE* aTable, const PCB_TABLE* aOther )
392{
393 int diff;
394
395 if( ( diff = (int) aTable->GetCells().size() - (int) aOther->GetCells().size() ) != 0 )
396 return diff;
397
398 if( ( diff = aTable->GetColCount() - aOther->GetColCount() ) != 0 )
399 return diff;
400
401 for( int col = 0; col < aTable->GetColCount(); ++col )
402 {
403 if( ( diff = aTable->GetColWidth( col ) - aOther->GetColWidth( col ) ) != 0 )
404 return diff;
405 }
406
407 for( int row = 0; row < aTable->GetRowCount(); ++row )
408 {
409 if( ( diff = aTable->GetRowHeight( row ) - aOther->GetRowHeight( row ) ) != 0 )
410 return diff;
411 }
412
413 for( int row = 0; row < aTable->GetRowCount(); ++row )
414 {
415 for( int col = 0; col < aTable->GetColCount(); ++col )
416 {
417 PCB_TABLECELL* cell = aTable->GetCell( row, col );
418 PCB_TABLECELL* other = aOther->GetCell( row, col );
419
420 if( ( diff = cell->PCB_SHAPE::Compare( other ) ) != 0 )
421 return diff;
422
423 if( ( diff = cell->EDA_TEXT::Compare( other ) ) != 0 )
424 return diff;
425 }
426 }
427
428 return 0;
429}
430
431
432bool PCB_TABLE::operator==( const BOARD_ITEM& aBoardItem ) const
433{
434 if( Type() != aBoardItem.Type() )
435 return false;
436
437 const PCB_TABLE& other = static_cast<const PCB_TABLE&>( aBoardItem );
438
439 return *this == other;
440}
441
442
443bool PCB_TABLE::operator==( const PCB_TABLE& aOther ) const
444{
445 if( m_cells.size() != aOther.m_cells.size() )
446 return false;
447
448 if( m_strokeExternal != aOther.m_strokeExternal )
449 return false;
450
451 if( m_strokeHeader != aOther.m_strokeHeader )
452 return false;
453
454 if( m_borderStroke != aOther.m_borderStroke )
455 return false;
456
457 if( m_strokeRows != aOther.m_strokeRows )
458 return false;
459
460 if( m_strokeColumns != aOther.m_strokeColumns )
461 return false;
462
464 return false;
465
466 if( m_colWidths != aOther.m_colWidths )
467 return false;
468
469 if( m_rowHeights != aOther.m_rowHeights )
470 return false;
471
472 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
473 {
474 if( !( *m_cells[ii] == *aOther.m_cells[ii] ) )
475 return false;
476 }
477
478 return true;
479}
480
481
482double PCB_TABLE::Similarity( const BOARD_ITEM& aOther ) const
483{
484 if( aOther.Type() != Type() )
485 return 0.0;
486
487 const PCB_TABLE& other = static_cast<const PCB_TABLE&>( aOther );
488
489 if( m_cells.size() != other.m_cells.size() )
490 return 0.1;
491
492 double similarity = 1.0;
493
495 similarity *= 0.9;
496
497 if( m_strokeHeader != other.m_strokeHeader )
498 similarity *= 0.9;
499
500 if( m_borderStroke != other.m_borderStroke )
501 similarity *= 0.9;
502
503 if( m_strokeRows != other.m_strokeRows )
504 similarity *= 0.9;
505
506 if( m_strokeColumns != other.m_strokeColumns )
507 similarity *= 0.9;
508
510 similarity *= 0.9;
511
512 if( m_colWidths != other.m_colWidths )
513 similarity *= 0.9;
514
515 if( m_rowHeights != other.m_rowHeights )
516 similarity *= 0.9;
517
518 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
519 similarity *= m_cells[ii]->Similarity( *other.m_cells[ii] );
520
521 return similarity;
522}
523
524
525static struct PCB_TABLE_DESC
526{
528 {
530
531 if( plotDashTypeEnum.Choices().GetCount() == 0 )
532 {
533 plotDashTypeEnum.Map( LINE_STYLE::DEFAULT, _HKI( "Default" ) )
534 .Map( LINE_STYLE::SOLID, _HKI( "Solid" ) )
535 .Map( LINE_STYLE::DASH, _HKI( "Dashed" ) )
536 .Map( LINE_STYLE::DOT, _HKI( "Dotted" ) )
537 .Map( LINE_STYLE::DASHDOT, _HKI( "Dash-Dot" ) )
538 .Map( LINE_STYLE::DASHDOTDOT, _HKI( "Dash-Dot-Dot" ) );
539 }
540
543
548
549 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Start X" ),
550 &PCB_TABLE::SetPositionX, &PCB_TABLE::GetPositionX, PROPERTY_DISPLAY::PT_COORD,
552 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Start Y" ),
553 &PCB_TABLE::SetPositionY, &PCB_TABLE::GetPositionY, PROPERTY_DISPLAY::PT_COORD,
555
556 const wxString tableProps = _( "Table Properties" );
557
558 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "External Border" ),
560 tableProps );
561
562 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "Header Border" ),
564 tableProps );
565
566 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Border Width" ),
568 PROPERTY_DISPLAY::PT_SIZE ),
569 tableProps );
570
571 propMgr.AddProperty( new PROPERTY_ENUM<PCB_TABLE, LINE_STYLE>( _HKI( "Border Style" ),
573 tableProps );
574
575 propMgr.AddProperty( new PROPERTY<PCB_TABLE, COLOR4D>( _HKI( "Border Color" ),
577 tableProps );
578
579 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "Row Separators" ),
581 tableProps );
582
583 propMgr.AddProperty( new PROPERTY<PCB_TABLE, bool>( _HKI( "Cell Separators" ),
585 tableProps );
586
587 propMgr.AddProperty( new PROPERTY<PCB_TABLE, int>( _HKI( "Separators Width" ),
589 PROPERTY_DISPLAY::PT_SIZE ),
590 tableProps );
591
592 propMgr.AddProperty( new PROPERTY_ENUM<PCB_TABLE, LINE_STYLE>( _HKI( "Separators Style" ),
594 tableProps );
595
596 propMgr.AddProperty( new PROPERTY<PCB_TABLE, COLOR4D>( _HKI( "Separators Color" ),
598 tableProps );
599 }
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Definition: approximation.h:32
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:79
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:237
PCB_LAYER_ID m_layer
Definition: board_item.h:436
bool m_isLocked
Definition: board_item.h:439
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:288
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:47
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 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:101
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:104
int GetStartY() const
Definition: eda_shape.h:138
int GetEndX() const
Definition: eda_shape.h:176
int GetEndY() const
Definition: eda_shape.h:175
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition: eda_shape.h:174
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:178
int GetStartX() const
Definition: eda_shape.h:139
const EDA_ANGLE & GetTextAngle() const
Definition: eda_text.h:134
virtual void ClearRenderCache()
Definition: eda_text.cpp:631
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:76
VECTOR2I GetPosition() const override
Definition: pcb_shape.h:77
int GetRowSpan() const
Definition: pcb_tablecell.h:65
int GetColSpan() const
Definition: pcb_tablecell.h:62
VECTOR2I GetEnd() const
Definition: pcb_table.cpp:116
STROKE_PARAMS m_separatorsStroke
Definition: pcb_table.h:247
bool StrokeRows() const
Definition: pcb_table.h:86
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:233
std::vector< PCB_TABLECELL * > m_cells
Definition: pcb_table.h:252
int m_colCount
Definition: pcb_table.h:249
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:361
bool m_strokeRows
Definition: pcb_table.h:245
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_table.cpp:181
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:242
STROKE_PARAMS m_borderStroke
Definition: pcb_table.h:244
bool m_strokeColumns
Definition: pcb_table.h:246
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: pcb_table.cpp:349
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:244
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
Definition: pcb_table.cpp:205
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
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
bool operator==(const PCB_TABLE &aOther) const
Definition: pcb_table.cpp:443
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:324
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:250
virtual void swapData(BOARD_ITEM *aImage) override
Definition: pcb_table.cpp:73
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:130
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:355
void SetStrokeRows(bool aDoStroke)
Definition: pcb_table.h:85
bool m_strokeHeader
Definition: pcb_table.h:243
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:482
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:307
LINE_STYLE GetBorderStyle() const
Definition: pcb_table.h:65
static int Compare(const PCB_TABLE *aTable, const PCB_TABLE *aOther)
Definition: pcb_table.cpp:391
int GetColWidth(int aCol) const
Definition: pcb_table.h:110
VECTOR2I GetPosition() const override
Definition: pcb_table.cpp:110
void SetSeparatorsWidth(int aWidth)
Definition: pcb_table.h:73
COLOR4D GetSeparatorsColor() const
Definition: pcb_table.h:80
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const override
Invoke a function on all children.
Definition: pcb_table.cpp:226
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_table.cpp:188
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:33
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:384
void SetPosition(const VECTOR2I &aPos) override
Definition: pcb_table.cpp:104
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:251
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:89
#define _HKI(x)
static bool empty(const wxTextEntryBase *aCtrl)
#define _(s)
static constexpr EDA_ANGLE ANGLE_180
Definition: eda_angle.h:405
INSPECT_RESULT
Definition: eda_item.h:43
const INSPECTOR_FUNC & INSPECTOR
Definition: eda_item.h:82
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Definition: layer_id.cpp:208
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:147
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
FLIP_DIRECTION
Definition: mirror.h:27
static struct PCB_TABLE_DESC _PCB_TABLE_DESC
#define TYPE_HASH(x)
Definition: property.h:71
#define REGISTER_TYPE(x)
Definition: property_mgr.h:371
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:46
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
@ 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< int32_t > VECTOR2I
Definition: vector2d.h:691