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