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 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#ifndef SCH_TABLECELL_H
21#define SCH_TABLECELL_H
22
23
24#include <sch_textbox.h>
25
27{
28 class SchematicTableCell;
29}
30
31
33{
34public:
35 SCH_TABLECELL( int aLineWidth = 0, FILL_T aFillType = FILL_T::NO_FILL );
36
37 static inline bool ClassOf( const EDA_ITEM* aItem ) { return aItem && SCH_TABLECELL_T == aItem->Type(); }
38
39 virtual wxString GetClass() const override { return wxT( "SCH_TABLECELL" ); }
40
41 void Serialize( google::protobuf::Any& aContainer ) const override;
42 bool Deserialize( const google::protobuf::Any& aContainer ) override;
43
44 void Serialize( kiapi::schematic::types::SchematicTableCell& cell ) const;
45 bool Deserialize( const kiapi::schematic::types::SchematicTableCell& cell );
46
47 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
48
49 EDA_ITEM* Clone() const override { return new SCH_TABLECELL( *this ); }
50
51 EDA_GROUP* GetParentGroup() const override { return GetParent()->GetParentGroup(); }
52
53 int GetRow() const;
54 int GetColumn() const;
55
57 wxString GetAddr() const;
58
59 wxString GetShownText( const RENDER_SETTINGS* aSettings, const SCH_SHEET_PATH* aPath,
60 RESOLUTION_CONTEXT aContext, int aDepth = 0 ) const override;
61
62 wxString GetShownText( RESOLUTION_CONTEXT aContext, int aDepth = 0 ) const override
63 {
64 SCH_SHEET_PATH* sheetPath = nullptr;
65
66 if( SCHEMATIC* schematic = Schematic() )
67 sheetPath = &schematic->CurrentSheet();
68
69 return GetShownText( nullptr, sheetPath, aContext, aDepth );
70 }
71
72 int GetColSpan() const { return m_colSpan; }
73 void SetColSpan( int aSpan ) { m_colSpan = aSpan; }
74
75 int GetRowSpan() const { return m_rowSpan; }
76 void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
77
78 int GetRowHeight() const;
79 void SetRowHeight( int aHeight );
80
81 int GetColumnWidth() const;
82 void SetColumnWidth( int aWidth );
83
84 bool IsFilledForHitTesting() const override { return true; }
85
86 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts, int aUnit, int aBodyStyle,
87 const VECTOR2I& aOffset, bool aDimmed ) override;
88
89 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
90
91 double Similarity( const SCH_ITEM& aOther ) const override;
92
93 bool operator==( const SCH_TABLECELL& aOther ) const;
94 bool operator==( const SCH_ITEM& aOther ) const override;
95
96protected:
97 void swapData( SCH_ITEM* aItem ) override;
98
101};
102
103
104#endif /* SCH_TABLECELL_H */
The base class for create windows for drawing purpose.
A set of EDA_ITEMs (i.e., without duplicates).
Definition eda_group.h:43
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:116
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
EDA_ITEM * GetParent() const
Definition eda_item.h:112
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Base plotter engine class.
Definition plotter.h:136
Holds all the data relating to one schematic.
Definition schematic.h:148
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:281
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
EDA_GROUP * GetParentGroup() const override
static bool ClassOf(const EDA_ITEM *aItem)
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
int GetRowHeight() const
int GetColSpan() const
virtual wxString GetClass() const override
Return the class name.
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
int GetRowSpan() const
wxString GetShownText(const RENDER_SETTINGS *aSettings, const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, int aDepth=0) const override
SCH_TABLECELL(int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL)
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)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetColumnWidth(int aWidth)
wxString GetShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const override
Return the string actually shown after processing of the base text.
int GetColumn() const
void SetColSpan(int aSpan)
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
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.
bool IsFilledForHitTesting() const override
void SetRowHeight(int aHeight)
int GetColumnWidth() const
int GetRow() const
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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.
SCH_TEXTBOX(SCH_LAYER_ID aLayer=LAYER_NOTES, int aLineWidth=0, FILL_T aFillType=FILL_T::NO_FILL, const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXTBOX_T)
RESOLUTION_CONTEXT
Definition common.h:87
FILL_T
Definition eda_fill.h:29
@ NO_FILL
Definition eda_fill.h:30
@ SCH_TABLECELL_T
Definition typeinfo.h:162
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683