KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_tablecell.h
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) 2023 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#ifndef SCH_TABLECELL_H
25#define SCH_TABLECELL_H
26
27
28#include <sch_textbox.h>
29
30
32{
33public:
34 SCH_TABLECELL( int aLineWidth = 0, FILL_T aFillType = FILL_T::NO_FILL );
35
36 static inline bool ClassOf( const EDA_ITEM* aItem )
37 {
38 return aItem && SCH_TABLECELL_T == aItem->Type();
39 }
40
41 virtual wxString GetClass() const override
42 {
43 return wxT( "SCH_TABLECELL" );
44 }
45
46 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
47
48 EDA_ITEM* Clone() const override
49 {
50 return new SCH_TABLECELL( *this );
51 }
52
53 void SwapData( SCH_ITEM* aItem ) override;
54
55 int GetRow() const;
56 int GetColumn() const;
57
58 // @return the spreadsheet nomenclature for the cell (ie: B3 for 2nd column, 3rd row)
59 wxString GetAddr() const;
60
61 int GetColSpan() const { return m_colSpan; }
62 void SetColSpan( int aSpan ) { m_colSpan = aSpan; }
63
64 int GetRowSpan() const { return m_rowSpan; }
65 void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
66
67 void Print( const SCH_RENDER_SETTINGS* aSettings, int aUnit, int aBodyStyle,
68 const VECTOR2I& offset, bool aForceNoFill, bool aDimmed ) override;
69
70 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
71 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
72
73 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
74
75 double Similarity( const SCH_ITEM& aOther ) const override;
76
77 bool operator==( const SCH_TABLECELL& aOther ) const;
78 bool operator==( const SCH_ITEM& aOther ) const override;
79
80protected:
83};
84
85
86#endif /* SCH_TABLECELL_H */
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
Base plotter engine class.
Definition: plotter.h:105
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:166
static bool ClassOf(const EDA_ITEM *aItem)
Definition: sch_tablecell.h:36
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
int GetColSpan() const
Definition: sch_tablecell.h:61
virtual wxString GetClass() const override
Return the class name.
Definition: sch_tablecell.h:41
int GetRowSpan() const
Definition: sch_tablecell.h:64
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
wxString GetAddr() const
bool operator==(const SCH_TABLECELL &aOther) const
void SetRowSpan(int aSpan)
Definition: sch_tablecell.h:65
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_tablecell.h:48
int GetColumn() const
void SetColSpan(int aSpan)
Definition: sch_tablecell.h:62
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.
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &offset, bool aForceNoFill, bool aDimmed) override
Print an item.
int GetRow() 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 SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
FILL_T
Definition: eda_shape.h:56
@ SCH_TABLECELL_T
Definition: typeinfo.h:166