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();
127 bbox.
Merge( cell->GetPosition() );
128 bbox.
Merge( cell->GetEnd() );
177 for(
int ii = col + 1; ii < col + cell->
GetColSpan(); ++ii )
180 for(
int ii = row + 1; ii < row + cell->GetRowSpan(); ++ii )
186 if( cell->
GetEnd() != end )
203 cell->Move( aMoveVector );
222 cell->Rotate( aCenter, aRotateCCW );
256 const VECTOR2I& aOffset,
bool aDimmed )
259 cell->PrintBackground( aSettings, aUnit, aBodyStyle, aOffset, aDimmed );
264 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
267 cell->Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
279 lineWidth = stroke.GetWidth();
280 color = stroke.GetColor();
281 lineStyle = stroke.GetLineStyle();
286 if(
color == COLOR4D::UNSPECIFIED )
289 if( lineStyle == LINE_STYLE::DEFAULT )
290 lineStyle = LINE_STYLE::SOLID;
294 [&](
const SHAPE& shape )
306 if( lineStyle <= LINE_STYLE::FIRST_TYPE )
320 if( lineStyle <= LINE_STYLE::FIRST_TYPE )
381 strokeRect( pos, end );
398 const std::vector<KICAD_T>& aScanTypes )
400 for(
KICAD_T scanType : aScanTypes )
404 if( INSPECT_RESULT::QUIT == aInspector(
this, aTestData ) )
405 return INSPECT_RESULT::QUIT;
412 if( INSPECT_RESULT::QUIT == aInspector( cell, (
void*)
this ) )
413 return INSPECT_RESULT::QUIT;
418 return INSPECT_RESULT::CONTINUE;
424 return wxString::Format(
_(
"%d Column Table" ),
m_colCount );
430 return BITMAPS::spreadsheet;
464 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
467 cell->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
482 lineWidth = stroke.GetWidth();
483 color = stroke.GetColor();
484 lineStyle = stroke.GetLineStyle();
489 lineWidth = schematic->Settings().m_DefaultLineWidth;
494 if( lineWidth < settings->GetMinPenWidth() )
500 if( lineStyle == LINE_STYLE::DEFAULT )
501 lineStyle = LINE_STYLE::SOLID;
504 aPlotter->
SetDash( lineWidth, lineStyle );
558 aPlotter->
Rect( pos, end, FILL_T::NO_FILL, lineWidth );
566 aList.emplace_back(
_(
"Table" ), wxString::Format(
_(
"%d Columns" ),
m_colCount ) );
586 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
606 double similarity = 1.0;
608 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
632 const wxString tableProps =
_(
"Table Properties" );
644 PROPERTY_DISPLAY::PT_SIZE ),
665 PROPERTY_DISPLAY::PT_SIZE ),
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
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.
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 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
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
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.
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
COLOR4D GetSeparatorsColor() const
void SetStrokeHeader(bool aDoStroke)
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...
int GetColWidth(int aCol) const
void AddCell(SCH_TABLECELL *aCell)
void SetSeparatorsWidth(int aWidth)
const STROKE_PARAMS & GetBorderStroke() const
VECTOR2I GetCenter() const
void PrintBackground(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Print just the background fills.
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
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