40 m_strokeExternal( true ),
41 m_strokeHeader( true ),
44 m_strokeColumns( true ),
84 wxT(
"Cannot swap data with invalid table." ) );
102 cell->SetParent(
this );
117 return m_cells[0]->GetPosition();
163 for(
int ii = col + 1; ii < col + cell->
GetColSpan(); ++ii )
166 for(
int ii = row + 1; ii < row + cell->GetRowSpan(); ++ii )
170 if( cell->
GetEnd() != end )
187 cell->Move( aMoveVector );
206 cell->Rotate( aCenter, aRotateCCW );
240 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
243 cell->Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
255 lineWidth = stroke.GetWidth();
256 color = stroke.GetColor();
257 lineStyle = stroke.GetLineStyle();
262 if(
color == COLOR4D::UNSPECIFIED )
265 if( lineStyle == LINE_STYLE::DEFAULT )
266 lineStyle = LINE_STYLE::SOLID;
270 [&](
const SHAPE& shape )
282 if( lineStyle <= LINE_STYLE::FIRST_TYPE )
296 if( lineStyle <= LINE_STYLE::FIRST_TYPE )
357 strokeRect( pos, end );
374 const std::vector<KICAD_T>& aScanTypes )
376 for(
KICAD_T scanType : aScanTypes )
380 if( INSPECT_RESULT::QUIT == aInspector(
this, aTestData ) )
381 return INSPECT_RESULT::QUIT;
388 if( INSPECT_RESULT::QUIT == aInspector( cell, (
void*)
this ) )
389 return INSPECT_RESULT::QUIT;
394 return INSPECT_RESULT::CONTINUE;
400 return wxString::Format(
_(
"%d Column Table" ),
m_colCount );
406 return BITMAPS::spreadsheet;
443 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
446 cell->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
461 lineWidth = stroke.GetWidth();
462 color = stroke.GetColor();
463 lineStyle = stroke.GetLineStyle();
468 lineWidth = schematic->Settings().m_DefaultLineWidth;
473 if( lineWidth < settings->GetMinPenWidth() )
479 if( lineStyle == LINE_STYLE::DEFAULT )
480 lineStyle = LINE_STYLE::SOLID;
483 aPlotter->
SetDash( lineWidth, lineStyle );
537 aPlotter->
Rect( pos, end, FILL_T::NO_FILL, lineWidth );
545 aList.emplace_back(
_(
"Table" ), wxString::Format(
_(
"%d Columns" ),
m_colCount ) );
565 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
585 double similarity = 1.0;
587 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
611 const wxString tableProps =
_(
"Table Properties" );
623 PROPERTY_DISPLAY::PT_SIZE ),
644 PROPERTY_DISPLAY::PT_SIZE ),
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
bool Intersects(const BOX2< Vec > &aRect) const
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
The base class for create windows for drawing purpose.
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetEnd(const VECTOR2I &aEnd)
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 GetDefaultPenWidth() const
int GetMinPenWidth() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
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 Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
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,...
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
void SetLayer(SCH_LAYER_ID aLayer)
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
void SetPosition(const VECTOR2I &aPos) override
VECTOR2I GetPosition() const override
void SetBorderWidth(int aWidth)
void SetSeparatorsStyle(const LINE_STYLE aStyle)
LINE_STYLE GetSeparatorsStyle() const
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
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &offset, bool aForceNoFill, bool aDimmed) override
Print an item.
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.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool StrokeExternal() const
void SetBorderColor(const COLOR4D &aColor)
LINE_STYLE GetBorderStyle() const
void SetSeparatorsColor(const COLOR4D &aColor)
int GetRowHeight(int aRow) const
COLOR4D GetSeparatorsColor() const
void SetStrokeHeader(bool aDoStroke)
SCH_TABLE(int aLineWidth=0)
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
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...
int GetColWidth(int aCol) const
void AddCell(SCH_TABLECELL *aCell)
void SetSeparatorsWidth(int aWidth)
const STROKE_PARAMS & GetBorderStroke() const
VECTOR2I GetPosition() const override
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
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 StrokeHeader() const
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.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
An abstract shape on 2D plane.
Simple container to manage line stroke parameters.
static void Stroke(const SHAPE *aShape, LINE_STYLE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS *aRenderSettings, const std::function< void(const VECTOR2I &a, const VECTOR2I &b)> &aStroker)
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
const INSPECTOR_FUNC & INSPECTOR
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
@ LAYER_SELECTION_SHADOWS
static struct SCH_TABLE_DESC _SCH_TABLE_DESC
LINE_STYLE
Dashed line types.
constexpr int MilsToIU(int mils) const
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.