83 wxT(
"Cannot swap data with invalid table." ) );
101 cell->SetParent(
this );
116 return m_cells[0]->GetPosition();
126 bbox.
Merge( cell->GetPosition() );
127 bbox.
Merge( cell->GetEnd() );
176 for(
int ii = col + 1; ii < col + cell->
GetColSpan(); ++ii )
179 for(
int ii = row + 1; ii < row + cell->
GetRowSpan(); ++ii )
202 cell->Move( aMoveVector );
221 cell->Rotate( aCenter, aRotateCCW );
266 const std::vector<KICAD_T>& aScanTypes )
268 for(
KICAD_T scanType : aScanTypes )
292 return wxString::Format(
_(
"%d Column Table" ),
m_colCount );
345 std::vector<VECTOR2I> bottomRight =
368 if( corners.size() == 4 )
369 aCallback( corners[1], corners[2], stroke );
394 if( corners.size() == 4 )
395 aCallback( corners[2], corners[3], stroke );
410 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
413 cell->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
430 lineWidth = schematic->Settings().m_DefaultLineWidth;
435 if( lineWidth < settings->GetMinPenWidth() )
445 aPlotter->
SetDash( lineWidth, lineStyle );
456 aList.emplace_back(
_(
"Table" ), wxString::Format(
_(
"%d Columns" ),
m_colCount ) );
478 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
498 double similarity = 1.0;
500 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
524 const wxString tableProps =
_(
"Table Properties" );
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr const Vec GetCenter() const
constexpr bool Contains(const Vec &aPoint) const
constexpr bool Intersects(const BOX2< Vec > &aRect) const
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
std::vector< VECTOR2I > GetCornersInSequence(EDA_ANGLE angle) const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
void SetEnd(const VECTOR2I &aEnd)
const EDA_ANGLE & GetTextAngle() const
virtual void ClearRenderCache()
A color representation with 4 components: red, green, blue, alpha.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetMinPenWidth() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
Base plotter engine class.
void MoveTo(const VECTOR2I &pos)
virtual void SetDash(int aLineWidth, LINE_STYLE aLineStyle)=0
void FinishTo(const VECTOR2I &pos)
RENDER_SETTINGS * RenderSettings()
bool GetColorMode() const
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.
Base class for any item which can be embedded within the SCHEMATIC container class,...
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.
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
void SetLayer(SCH_LAYER_ID aLayer)
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
void SetPosition(const VECTOR2I &aPos) override
VECTOR2I GetPosition() const override
void SetBorderWidth(int aWidth)
void SetSeparatorsStyle(const LINE_STYLE aStyle)
LINE_STYLE GetSeparatorsStyle() const
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
const STROKE_PARAMS & GetSeparatorsStroke() const
std::map< int, int > m_rowHeights
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
void SetBorderColor(const COLOR4D &aColor)
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
LINE_STYLE GetBorderStyle() const
void SetSeparatorsColor(const COLOR4D &aColor)
int GetRowHeight(int aRow) const
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
COLOR4D GetSeparatorsColor() const
SCH_TABLE(int aLineWidth=0)
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
void SetStrokeHeaderSeparator(bool aDoStroke)
void AddCell(SCH_TABLECELL *aCell)
void SetSeparatorsWidth(int aWidth)
const STROKE_PARAMS & GetBorderStroke() const
bool m_StrokeHeaderSeparator
VECTOR2I GetCenter() const
VECTOR2I GetPosition() const override
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void SetStrokeExternal(bool aDoStroke)
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.
STROKE_PARAMS m_separatorsStroke
bool StrokeHeaderSeparator() const
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
void SetStrokeColumns(bool aDoStroke)
SCH_TABLECELL * GetCell(int aRow, int aCol) const
int GetSeparatorsWidth() const
bool StrokeColumns() const
void SetPosition(const VECTOR2I &aPos) override
STROKE_PARAMS m_borderStroke
void SetStrokeRows(bool aDoStroke)
void SetBorderStyle(const LINE_STYLE aStyle)
COLOR4D GetBorderColor() const
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
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.
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)
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
a few functions useful in geometry calculations.
@ LAYER_SELECTION_SHADOWS
bool BoxHitTest(const VECTOR2I &aHitPoint, const BOX2I &aHittee, int aAccuracy)
Perform a point-to-box hit test.
@ PT_COORD
Coordinate expressed in distance units (mm/inch)
@ PT_SIZE
Size expressed in distance units (mm/inch)
static struct SCH_TABLE_DESC _SCH_TABLE_DESC
LINE_STYLE
Dashed line types.
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.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I