35 m_strokeExternal( true ),
36 m_StrokeHeaderSeparator( true ),
39 m_strokeColumns( true ),
76 wxT(
"Cannot swap data with invalid table." ) );
97 cell->SetParent(
this );
112 return m_cells[0]->GetPosition();
158 for(
int ii = col + 1; ii < col + cell->
GetColSpan(); ++ii )
161 for(
int ii = row + 1; ii < row + cell->GetRowSpan(); ++ii )
184 cell->Move( aMoveVector );
194 cell->Rotate( aRotCentre, aAngle );
203 cell->Flip( aCentre, aFlipDirection );
205 std::vector<PCB_TABLECELL*> oldCells =
m_cells;
267 if( corners.size() == 4 )
268 aCallback( corners[1], corners[2], stroke );
293 if( corners.size() == 4 )
294 aCallback( corners[2], corners[3], stroke );
315 std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
317 std::vector<VECTOR2I> pts;
319 pts.emplace_back( topLeft[3] );
320 pts.emplace_back( topRight[2] );
321 pts.emplace_back( bottomRight[2] );
322 pts.emplace_back( bottomLeft[3] );
337 int aClearance,
int aMaxError,
ERROR_LOC aErrorLoc,
338 bool aIgnoreLineWidth )
const
340 int gap = aClearance;
349 cell->TransformShapeToPolygon( aBuffer, aLayer, gap, aMaxError, aErrorLoc,
false );
354 const std::vector<KICAD_T>& aScanTypes )
356 for(
KICAD_T scanType : aScanTypes )
360 if( INSPECT_RESULT::QUIT == aInspector(
this, aTestData ) )
361 return INSPECT_RESULT::QUIT;
368 if( INSPECT_RESULT::QUIT == aInspector( cell, (
void*)
this ) )
369 return INSPECT_RESULT::QUIT;
374 return INSPECT_RESULT::CONTINUE;
380 return wxString::Format(
_(
"%d Column Table" ),
m_colCount );
386 return BITMAPS::table;
416 aList.emplace_back(
_(
"Table" ), wxString::Format(
_(
"%d Columns" ),
m_colCount ) );
424 if( ( diff = (
int) aTable->
GetCells().size() - (
int) aOther->
GetCells().size() ) != 0 )
430 for(
int col = 0; col < aTable->
GetColCount(); ++col )
436 for(
int row = 0; row < aTable->
GetRowCount(); ++row )
442 for(
int row = 0; row < aTable->
GetRowCount(); ++row )
444 for(
int col = 0; col < aTable->
GetColCount(); ++col )
449 if( ( diff = cell->PCB_SHAPE::Compare( other ) ) != 0 )
452 if( ( diff = cell->EDA_TEXT::Compare( other ) ) != 0 )
468 return *
this == other;
501 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
521 double similarity = 1.0;
547 for(
int ii = 0; ii < (int)
m_cells.size(); ++ii )
560 if( lineStyleEnum.
Choices().GetCount() == 0 )
562 lineStyleEnum.
Map( LINE_STYLE::SOLID,
_HKI(
"Solid" ) )
563 .
Map( LINE_STYLE::DASH,
_HKI(
"Dashed" ) )
564 .
Map( LINE_STYLE::DOT,
_HKI(
"Dotted" ) )
565 .
Map( LINE_STYLE::DASHDOT,
_HKI(
"Dash-Dot" ) )
566 .
Map( LINE_STYLE::DASHDOTDOT,
_HKI(
"Dash-Dot-Dot" ) );
584 const wxString tableProps =
_(
"Table Properties" );
596 PROPERTY_DISPLAY::PT_SIZE ),
617 PROPERTY_DISPLAY::PT_SIZE ),
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BITMAPS
A list of all bitmap identifiers.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
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 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.
std::vector< VECTOR2I > GetCornersInSequence() const
void SetEnd(const VECTOR2I &aEnd)
const EDA_ANGLE & GetTextAngle() const
virtual void ClearRenderCache()
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
A color representation with 4 components: red, green, blue, alpha.
void SetPosition(const VECTOR2I &aPos) override
VECTOR2I GetPosition() const override
STROKE_PARAMS m_separatorsStroke
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
std::vector< PCB_TABLECELL * > m_cells
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Move(const VECTOR2I &aMoveVector) override
Move this object.
bool StrokeHeaderSeparator() const
bool StrokeColumns() const
void SetBorderStyle(const LINE_STYLE aStyle)
void SetStrokeHeaderSeparator(bool aDoStroke)
void SetSeparatorsColor(const COLOR4D &aColor)
STROKE_PARAMS m_borderStroke
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
bool StrokeExternal() const
int GetSeparatorsWidth() const
void SetStrokeExternal(bool aDoStroke)
PCB_TABLECELL * GetCell(int aRow, int aCol) const
std::vector< PCB_TABLECELL * > GetCells() const
int GetBorderWidth() const
COLOR4D GetBorderColor() const
bool operator==(const PCB_TABLE &aOther) const
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 SetStrokeColumns(bool aDoStroke)
const STROKE_PARAMS & GetSeparatorsStroke() const
std::map< int, int > m_colWidths
virtual void swapData(BOARD_ITEM *aImage) override
void Normalize() override
Perform any normalization required after a user rotate and/or flip.
void AddCell(PCB_TABLECELL *aCell)
const STROKE_PARAMS & GetBorderStroke() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetStrokeRows(bool aDoStroke)
bool m_StrokeHeaderSeparator
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const override
Invoke a function on all children.
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth=false) const override
Convert the item shape to a closed polygon.
void DrawBorders(const std::function< void(const VECTOR2I &aPt1, const VECTOR2I &aPt2, const STROKE_PARAMS &aStroke)> &aCallback) const
LINE_STYLE GetBorderStyle() const
static int Compare(const PCB_TABLE *aTable, const PCB_TABLE *aOther)
int GetColWidth(int aCol) const
VECTOR2I GetPosition() const override
void SetSeparatorsWidth(int aWidth)
COLOR4D GetSeparatorsColor() const
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
LINE_STYLE GetSeparatorsStyle() const
void SetBorderColor(const COLOR4D &aColor)
PCB_TABLE(BOARD_ITEM *aParent, int aLineWidth)
void SetSeparatorsStyle(const LINE_STYLE aStyle)
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 SetPosition(const VECTOR2I &aPos) override
void SetBorderWidth(int aWidth)
int GetRowHeight(int aRow) const
std::map< int, int > m_rowHeights
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.
Represent a set of closed polygons.
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
Simple container to manage line stroke parameters.
static bool empty(const wxTextEntryBase *aCtrl)
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
PCB_LAYER_ID
A quick note on layer IDs:
static struct PCB_TABLE_DESC _PCB_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.
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
VECTOR2< int32_t > VECTOR2I