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, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <pgm_base.h>
21#include <sch_edit_frame.h>
22#include <plotters/plotter.h>
24#include <geometry/shape_rect.h>
25#include <bitmaps.h>
26#include <string_utils.h>
27#include <schematic.h>
29#include <sch_painter.h>
30#include <wx/log.h>
31#include <sch_table.h>
33#include <properties/property.h>
35
36
37SCH_TABLE::SCH_TABLE( int aLineWidth ) :
38 SCH_ITEM( nullptr, SCH_TABLE_T ),
39 m_strokeExternal( true ),
42 m_strokeRows( true ),
43 m_strokeColumns( true ),
45 m_colCount( 0 )
46{
48}
49
50
52 SCH_ITEM( aTable )
53{
60
61 m_colCount = aTable.m_colCount;
62 m_colWidths = aTable.m_colWidths;
64
65 for( SCH_TABLECELL* src : aTable.m_cells )
66 AddCell( new SCH_TABLECELL( *src ) );
67}
68
69
71{
72 // We own our cells; delete them
73 for( SCH_TABLECELL* cell : m_cells )
74 delete cell;
75}
76
77
79{
80 wxCHECK_RET( aItem != nullptr && aItem->Type() == SCH_TABLE_T, wxT( "Cannot swap data with invalid table." ) );
81
82 SCH_TABLE* table = static_cast<SCH_TABLE*>( aItem );
83
84 std::swap( m_strokeExternal, table->m_strokeExternal );
85 std::swap( m_StrokeHeaderSeparator, table->m_StrokeHeaderSeparator );
86 std::swap( m_borderStroke, table->m_borderStroke );
87 std::swap( m_strokeRows, table->m_strokeRows );
88 std::swap( m_strokeColumns, table->m_strokeColumns );
89 std::swap( m_separatorsStroke, table->m_separatorsStroke );
90
91 std::swap( m_colCount, table->m_colCount );
92 std::swap( m_colWidths, table->m_colWidths );
93 std::swap( m_rowHeights, table->m_rowHeights );
94
95 std::swap( m_cells, table->m_cells );
96
97 for( SCH_TABLECELL* cell : m_cells )
98 cell->SetParent( this );
99
100 for( SCH_TABLECELL* cell : table->m_cells )
101 cell->SetParent( table );
102}
103
104
106{
107 Move( aPos - GetPosition() );
108}
109
110
112{
113 if( m_cells.empty() )
114 return VECTOR2I( 0, 0 ); // Return origin if table has no cells
115
116 return m_cells[0]->GetPosition();
117}
118
119
121{
122 BOX2I bbox;
123
124 for( SCH_TABLECELL* cell : m_cells )
125 {
126 bbox.Merge( cell->GetPosition() );
127 bbox.Merge( cell->GetEnd() );
128 }
129
130 return bbox.GetCenter();
131}
132
133
135{
136 VECTOR2I tableSize;
137
138 for( int ii = 0; ii < GetColCount(); ++ii )
139 tableSize.x += GetColWidth( ii );
140
141 for( int ii = 0; ii < GetRowCount(); ++ii )
142 tableSize.y += GetRowHeight( ii );
143
144 return GetPosition() + tableSize;
145}
146
147
149{
150 int y = GetPosition().y;
151
152 for( int row = 0; row < GetRowCount(); ++row )
153 {
154 int x = GetPosition().x;
155 int rowHeight = m_rowHeights[row];
156
157 for( int col = 0; col < GetColCount(); ++col )
158 {
159 int colWidth = m_colWidths[col];
160
161 SCH_TABLECELL* cell = GetCell( row, col );
162
163 if( !cell )
164 continue; // Skip if cell doesn't exist (shouldn't happen, but be defensive)
165
166 VECTOR2I pos( x, y );
167
168 RotatePoint( pos, GetPosition(), cell->GetTextAngle() );
169
170 if( cell->GetPosition() != pos )
171 {
172 cell->SetPosition( pos );
173 cell->ClearRenderCache();
174 }
175
176 VECTOR2I end = VECTOR2I( x + colWidth, y + rowHeight );
177
178 if( cell->GetColSpan() > 1 || cell->GetRowSpan() > 1 )
179 {
180 for( int ii = col + 1; ii < col + cell->GetColSpan(); ++ii )
181 end.x += m_colWidths[ii];
182
183 for( int ii = row + 1; ii < row + cell->GetRowSpan(); ++ii )
184 end.y += m_rowHeights[ii];
185 }
186
188
189 if( cell->GetEnd() != end )
190 {
191 cell->SetEnd( end );
192 cell->ClearRenderCache();
193 }
194
195 x += colWidth;
196 }
197
198 y += rowHeight;
199 }
200}
201
202
203void SCH_TABLE::Move( const VECTOR2I& aMoveVector )
204{
205 for( SCH_TABLECELL* cell : m_cells )
206 cell->Move( aMoveVector );
207}
208
209
211{
212 // We could mirror all the cells, but it doesn't seem useful....
213}
214
215
217{
218 // We could mirror all the cells, but it doesn't seem useful....
219}
220
221
222void SCH_TABLE::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
223{
224 for( SCH_TABLECELL* cell : m_cells )
225 cell->Rotate( aCenter, aRotateCCW );
226
227 Normalize();
228}
229
230
231bool SCH_TABLE::operator<( const SCH_ITEM& aItem ) const
232{
233 if( Type() != aItem.Type() )
234 return Type() < aItem.Type();
235
236 const SCH_TABLE& other = static_cast<const SCH_TABLE&>( aItem );
237
238 if( m_cells.size() != other.m_cells.size() )
239 return m_cells.size() < other.m_cells.size();
240
241 if( GetPosition().x != other.GetPosition().x )
242 return GetPosition().x < other.GetPosition().x;
243
244 if( GetPosition().y != other.GetPosition().y )
245 return GetPosition().y < other.GetPosition().y;
246
247 return m_cells[0] < other.m_cells[0];
248}
249
250
251void SCH_TABLE::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction, RECURSE_MODE aMode )
252{
253 for( SCH_TABLECELL* cell : m_cells )
254 aFunction( cell );
255}
256
257
259{
260 if( m_cells.empty() )
261 return BOX2I();
262
263 BOX2I bbox = m_cells[0]->GetBoundingBox();
264
265 bbox.Merge( m_cells[m_cells.size() - 1]->GetBoundingBox() );
266
267 return bbox;
268}
269
270
271INSPECT_RESULT SCH_TABLE::Visit( INSPECTOR aInspector, void* aTestData, const std::vector<KICAD_T>& aScanTypes )
272{
273 for( KICAD_T scanType : aScanTypes )
274 {
275 if( scanType == SCH_LOCATE_ANY_T || scanType == SCH_TABLE_T )
276 {
277 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
279 }
280
281 if( scanType == SCH_LOCATE_ANY_T || scanType == SCH_TABLECELL_T )
282 {
283 for( SCH_TABLECELL* cell : m_cells )
284 {
285 if( INSPECT_RESULT::QUIT == aInspector( cell, (void*) this ) )
287 }
288 }
289 }
290
292}
293
294
295wxString SCH_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
296{
297 return wxString::Format( _( "%d Column Table" ), m_colCount );
298}
299
300
302{
303 return BITMAPS::spreadsheet; // JEY TODO
304}
305
306
307std::vector<int> SCH_TABLE::ViewGetLayers() const
308{
310}
311
312
313bool SCH_TABLE::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
314{
315 BOX2I rect = GetBoundingBox();
316
317 rect.Inflate( aAccuracy );
318
319 return rect.Contains( aPosition );
320}
321
322
323bool SCH_TABLE::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
324{
325 BOX2I rect = aRect;
326
327 rect.Inflate( aAccuracy );
328
329 if( aContained )
330 return rect.Contains( GetBoundingBox() );
331
332 return rect.Intersects( GetBoundingBox() );
333}
334
335
336bool SCH_TABLE::HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const
337{
338 return KIGEOM::BoxHitTest( aPoly, GetBoundingBox(), aContained );
339}
340
341
342void SCH_TABLE::DrawBorders( const std::function<void( const VECTOR2I& aPt1, const VECTOR2I& aPt2,
343 const STROKE_PARAMS& aStroke )>& aCallback ) const
344{
345 EDA_ANGLE drawAngle = GetCell( 0, 0 )->GetTextAngle();
346
347 std::vector<VECTOR2I> topLeft = GetCell( 0, 0 )->GetCornersInSequence( drawAngle );
348 std::vector<VECTOR2I> bottomLeft = GetCell( GetRowCount() - 1, 0 )->GetCornersInSequence( drawAngle );
349 std::vector<VECTOR2I> topRight = GetCell( 0, GetColCount() - 1 )->GetCornersInSequence( drawAngle );
350 std::vector<VECTOR2I> bottomRight =
351 GetCell( GetRowCount() - 1, GetColCount() - 1 )->GetCornersInSequence( drawAngle );
352 STROKE_PARAMS stroke;
353
354 for( int col = 0; col < GetColCount() - 1; ++col )
355 {
356 for( int row = 0; row < GetRowCount(); ++row )
357 {
358 if( row == 0 && StrokeHeaderSeparator() )
359 stroke = GetBorderStroke();
360 else if( StrokeColumns() )
361 stroke = GetSeparatorsStroke();
362 else
363 continue;
364
365 SCH_TABLECELL* cell = GetCell( row, col );
366
367 if( cell->GetColSpan() == 0 )
368 continue;
369
370 if( col + cell->GetColSpan() == GetColCount() )
371 continue;
372
373 std::vector<VECTOR2I> corners = cell->GetCornersInSequence( drawAngle );
374
375 if( corners.size() == 4 )
376 aCallback( corners[1], corners[2], stroke );
377 }
378 }
379
380 for( int row = 0; row < GetRowCount() - 1; ++row )
381 {
382 if( row == 0 && StrokeHeaderSeparator() )
383 stroke = GetBorderStroke();
384 else if( StrokeRows() )
385 stroke = GetSeparatorsStroke();
386 else
387 continue;
388
389 for( int col = 0; col < GetColCount(); ++col )
390 {
391 SCH_TABLECELL* cell = GetCell( row, col );
392
393 if( cell->GetRowSpan() == 0 )
394 continue;
395
396 if( row + cell->GetRowSpan() == GetRowCount() )
397 continue;
398
399 std::vector<VECTOR2I> corners = cell->GetCornersInSequence( drawAngle );
400
401 if( corners.size() == 4 )
402 aCallback( corners[2], corners[3], stroke );
403 }
404 }
405
406 if( StrokeExternal() && GetBorderStroke().GetWidth() >= 0 )
407 {
408 aCallback( topLeft[0], topRight[1], GetBorderStroke() );
409 aCallback( topRight[1], bottomRight[2], GetBorderStroke() );
410 aCallback( bottomRight[2], bottomLeft[3], GetBorderStroke() );
411 aCallback( bottomLeft[3], topLeft[0], GetBorderStroke() );
412 }
413}
414
415
416void SCH_TABLE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts, int aUnit, int aBodyStyle,
417 const VECTOR2I& aOffset, bool aDimmed )
418{
419 for( SCH_TABLECELL* cell : m_cells )
420 cell->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
421
422 if( aBackground )
423 return;
424
425 RENDER_SETTINGS* settings = aPlotter->RenderSettings();
426
428 [&]( const VECTOR2I& ptA, const VECTOR2I& ptB, const STROKE_PARAMS& stroke )
429 {
430 int lineWidth = stroke.GetWidth();
431 COLOR4D color = stroke.GetColor();
432 LINE_STYLE lineStyle = stroke.GetLineStyle();
433
434 if( lineWidth == 0 )
435 {
436 if( SCHEMATIC* schematic = Schematic() )
437 lineWidth = schematic->Settings().m_DefaultLineWidth;
438 else
439 lineWidth = schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS );
440 }
441
442 if( lineWidth < settings->GetMinPenWidth() )
443 lineWidth = settings->GetMinPenWidth();
444
445 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
446 color = settings->GetLayerColor( m_layer );
447
448 if( color.m_text && Schematic() )
449 color = COLOR4D( ResolveText( *color.m_text, &Schematic()->CurrentSheet() ) );
450
451 if( lineStyle == LINE_STYLE::DEFAULT )
452 lineStyle = LINE_STYLE::SOLID;
453
454 aPlotter->SetColor( color );
455 aPlotter->SetDash( lineWidth, lineStyle );
456
457 aPlotter->MoveTo( ptA );
458 aPlotter->FinishTo( ptB );
459 } );
460}
461
462
463void SCH_TABLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
464{
465 // Don't use GetShownText() here; we want to show the user the variable references
466 aList.emplace_back( _( "Table" ), wxString::Format( _( "%d Columns" ), m_colCount ) );
467
468 SCH_ITEM::GetMsgPanelInfo( aFrame, aList );
469}
470
471
472bool SCH_TABLE::operator==( const SCH_ITEM& aOther ) const
473{
474 if( Type() != aOther.Type() )
475 return false;
476
477 const SCH_TABLE& other = static_cast<const SCH_TABLE&>( aOther );
478
479 if( m_cells.size() != other.m_cells.size() )
480 return false;
481
482 if( m_colWidths != other.m_colWidths )
483 return false;
484
485 if( m_rowHeights != other.m_rowHeights )
486 return false;
487
488 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
489 {
490 if( !( *m_cells[ii] == *other.m_cells[ii] ) )
491 return false;
492 }
493
494 return true;
495}
496
497
498double SCH_TABLE::Similarity( const SCH_ITEM& aOther ) const
499{
500 if( aOther.Type() != Type() )
501 return 0.0;
502
503 const SCH_TABLE& other = static_cast<const SCH_TABLE&>( aOther );
504
505 if( m_cells.size() != other.m_cells.size() )
506 return 0.1;
507
508 double similarity = 1.0;
509
510 for( int ii = 0; ii < (int) m_cells.size(); ++ii )
511 similarity *= m_cells[ii]->Similarity( *other.m_cells[ii] );
512
513 return similarity;
514}
515
516
517static struct SCH_TABLE_DESC
518{
520 {
523
526
527 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Start X" ),
530 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Start Y" ),
533
534 const wxString tableProps = _( "Table Properties" );
535
536 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "External Border" ),
538 tableProps );
539
540 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "Header Border" ),
542 tableProps );
543
544 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Border Width" ),
547 tableProps );
548
549 propMgr.AddProperty( new PROPERTY_ENUM<SCH_TABLE, LINE_STYLE>( _HKI( "Border Style" ),
551 tableProps );
552
553 propMgr.AddProperty( new PROPERTY<SCH_TABLE, COLOR4D>( _HKI( "Border Color" ),
555 tableProps );
556
557 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "Row Separators" ),
559 tableProps );
560
561 propMgr.AddProperty( new PROPERTY<SCH_TABLE, bool>( _HKI( "Cell Separators" ),
563 tableProps );
564
565 propMgr.AddProperty( new PROPERTY<SCH_TABLE, int>( _HKI( "Separators Width" ),
568 tableProps );
569
570 propMgr.AddProperty( new PROPERTY_ENUM<SCH_TABLE, LINE_STYLE>( _HKI( "Separators Style" ),
572 tableProps );
573
574 propMgr.AddProperty( new PROPERTY<SCH_TABLE, COLOR4D>( _HKI( "Separators Color" ),
576 tableProps );
577 }
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:123
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:554
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition box2.h:654
constexpr const Vec GetCenter() const
Definition box2.h:226
constexpr bool Contains(const Vec &aPoint) const
Definition box2.h:164
constexpr bool Intersects(const BOX2< Vec > &aRect) const
Definition box2.h:307
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:398
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.cpp:89
virtual void SetEnd(const VECTOR2I &aEnd)
Definition eda_shape.h:244
virtual std::vector< VECTOR2I > GetCornersInSequence(EDA_ANGLE angle) const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition eda_shape.h:240
virtual void ClearRenderCache()
Definition eda_text.cpp:689
virtual EDA_ANGLE GetTextAngle() const
Definition eda_text.h:168
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
std::shared_ptr< wxString > m_text
Definition color4d.h:395
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:133
void MoveTo(const VECTOR2I &pos)
Definition plotter.h:305
virtual void SetDash(int aLineWidth, LINE_STYLE aLineStyle)=0
void FinishTo(const VECTOR2I &pos)
Definition plotter.h:315
RENDER_SETTINGS * RenderSettings()
Definition plotter.h:164
bool GetColorMode() const
Definition plotter.h:161
virtual void SetColor(const COLOR4D &color)=0
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
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:90
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:162
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_item.cpp:825
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:268
void SetLayer(SCH_LAYER_ID aLayer)
Definition sch_item.h:339
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:52
wxString ResolveText(const wxString &aText, const SCH_SHEET_PATH *aPath, int aDepth=0) const
Definition sch_item.cpp:377
SCH_LAYER_ID m_layer
Definition sch_item.h:775
void SetPosition(const VECTOR2I &aPos) override
Definition sch_shape.h:85
VECTOR2I GetPosition() const override
Definition sch_shape.h:84
int GetColSpan() const
int GetRowSpan() const
void SetBorderWidth(int aWidth)
Definition sch_table.h:57
void SetSeparatorsStyle(const LINE_STYLE aStyle)
Definition sch_table.h:78
LINE_STYLE GetSeparatorsStyle() const
Definition sch_table.h:83
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
bool operator<(const SCH_ITEM &aItem) const override
std::vector< SCH_TABLECELL * > m_cells
Definition sch_table.h:255
const STROKE_PARAMS & GetSeparatorsStroke() const
Definition sch_table.h:73
std::map< int, int > m_rowHeights
Definition sch_table.h:254
bool m_strokeColumns
Definition sch_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.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool StrokeExternal() const
Definition sch_table.h:49
void SetBorderColor(const COLOR4D &aColor)
Definition sch_table.h:69
bool m_strokeRows
Definition sch_table.h:248
int GetPositionY() const
Definition sch_table.h:113
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void SetPositionX(int x)
Definition sch_table.h:110
LINE_STYLE GetBorderStyle() const
Definition sch_table.h:61
void SetSeparatorsColor(const COLOR4D &aColor)
Definition sch_table.h:91
int GetRowHeight(int aRow) const
Definition sch_table.h:135
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
COLOR4D GetSeparatorsColor() const
Definition sch_table.h:92
SCH_TABLE(int aLineWidth=0)
Definition sch_table.cpp:37
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
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...
void DrawBorders(const std::function< void(const VECTOR2I &aPt1, const VECTOR2I &aPt2, const STROKE_PARAMS &aStroke)> &aCallback) const
int GetColWidth(int aCol) const
Definition sch_table.h:125
void SetStrokeHeaderSeparator(bool aDoStroke)
Definition sch_table.h:51
void AddCell(SCH_TABLECELL *aCell)
Definition sch_table.h:158
void SetSeparatorsWidth(int aWidth)
Definition sch_table.h:75
const STROKE_PARAMS & GetBorderStroke() const
Definition sch_table.h:55
bool m_StrokeHeaderSeparator
Definition sch_table.h:246
VECTOR2I GetCenter() const
int m_colCount
Definition sch_table.h:252
VECTOR2I GetPosition() const override
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition sch_table.cpp:78
void SetStrokeExternal(bool aDoStroke)
Definition sch_table.h:48
VECTOR2I GetEnd() const
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.
void SetPositionY(int y)
Definition sch_table.h:111
STROKE_PARAMS m_separatorsStroke
Definition sch_table.h:250
int GetColCount() const
Definition sch_table.h:116
bool StrokeHeaderSeparator() const
Definition sch_table.h:52
bool m_strokeExternal
Definition sch_table.h:245
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.
std::map< int, int > m_colWidths
Definition sch_table.h:253
void SetStrokeColumns(bool aDoStroke)
Definition sch_table.h:94
SCH_TABLECELL * GetCell(int aRow, int aCol) const
Definition sch_table.h:143
int GetSeparatorsWidth() const
Definition sch_table.h:76
bool StrokeColumns() const
Definition sch_table.h:95
void SetPosition(const VECTOR2I &aPos) override
int GetPositionX() const
Definition sch_table.h:112
bool StrokeRows() const
Definition sch_table.h:98
STROKE_PARAMS m_borderStroke
Definition sch_table.h:247
int GetRowCount() const
Definition sch_table.h:118
void SetStrokeRows(bool aDoStroke)
Definition sch_table.h:97
void SetBorderStyle(const LINE_STYLE aStyle)
Definition sch_table.h:60
COLOR4D GetBorderColor() const
Definition sch_table.h:70
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool operator==(const SCH_ITEM &aOther) const override
int GetBorderWidth() const
Definition sch_table.h:58
void Normalize()
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Simple container to manage line stroke parameters.
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 _(s)
RECURSE_MODE
Definition eda_item.h:48
INSPECT_RESULT
Definition eda_item.h:42
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:89
a few functions useful in geometry calculations.
@ LAYER_NOTES
Definition layer_ids.h:465
@ LAYER_NOTES_BACKGROUND
Definition layer_ids.h:467
@ LAYER_SELECTION_SHADOWS
Definition layer_ids.h:493
bool BoxHitTest(const VECTOR2I &aHitPoint, const BOX2I &aHittee, int aAccuracy)
Perform a point-to-box hit test.
#define _HKI(x)
Definition page_info.cpp:40
see class PGM_BASE
#define TYPE_HASH(x)
Definition property.h:74
@ PT_COORD
Coordinate expressed in distance units (mm/inch)
Definition property.h:65
@ PT_SIZE
Size expressed in distance units (mm/inch)
Definition property.h:63
#define REGISTER_TYPE(x)
static struct SCH_TABLE_DESC _SCH_TABLE_DESC
LINE_STYLE
Dashed line types.
std::vector< std::vector< std::string > > table
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:225
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:71
@ SCH_TABLE_T
Definition typeinfo.h:162
@ SCH_TABLECELL_T
Definition typeinfo.h:163
@ SCH_LOCATE_ANY_T
Definition typeinfo.h:196
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683