42 virtual wxString
GetClass()
const override = 0;
44 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override;
50 switch( aItem->
Type() )
98 void SetFields(
const std::vector<SCH_FIELD>& aFields )
115 field.Offset( aMoveVector );
119 void Rotate90(
bool aClockwise )
override;
141 wxString
GetShownText(
int aDepth = 0,
bool aAllowExtraText =
true )
const override;
146 const std::vector<KICAD_T>& scanTypes )
override;
160 std::vector<VECTOR2I>& aPoints,
const VECTOR2I& Pos )
const
177 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
178 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
182 void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList )
override;
190 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
194 void Plot(
PLOTTER* aPlotter,
bool aBackground )
const override;
247 return wxT(
"SCH_LABEL" );
296 return wxT(
"SCH_DIRECTIVE_LABEL" );
312 const VECTOR2I& aPos )
const override;
344 return wxT(
"SCH_GLOBALLABEL" );
364 const VECTOR2I& aPos )
const override;
366 bool ResolveTextVar( wxString* token,
int aDepth )
const override;
370 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
408 return wxT(
"SCH_HIERLABEL" );
416 const VECTOR2I& aPos )
const override;
BITMAPS
A list of all bitmap identifiers.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
const VECTOR2I & GetTextPos() const
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.
Base plotter engine class.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
SCH_DIRECTIVE_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0))
bool IsConnectable() const override
static bool ClassOf(const EDA_ITEM *aItem)
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
int GetPenWidth() const override
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
wxString GetClass() const override
Return the class name.
void SetPinLength(int aLength)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
bool IsConnectable() const override
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
void CreateGraphicShape(const RENDER_SETTINGS *aRenderSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
static bool ClassOf(const EDA_ITEM *aItem)
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
bool ResolveTextVar(wxString *token, int aDepth) const override
Resolve any references to system tokens supported by the label.
int GetMandatoryFieldCount() override
void MirrorSpinStyle(bool aLeftRight) override
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
VECTOR2I GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
SCH_GLOBALLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
wxString GetClass() const override
Return the class name.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
static bool ClassOf(const EDA_ITEM *aItem)
wxString GetClass() const override
Return the class name.
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &aPos) const override
Calculate the graphic shape (a polygon) associated to the text.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
SCH_HIERLABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
bool IsConnectable() const override
VECTOR2I GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
void SetTextSpinStyle(TEXT_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
void SetLastResolvedState(const SCH_ITEM *aItem) override
SCH_LABEL_BASE(const VECTOR2I &aPos, const wxString &aText, KICAD_T aType)
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
COLOR4D m_lastResolvedColor
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
void SetIsDangling(bool aIsDangling)
bool IsDangling() const override
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
const std::vector< SCH_FIELD > & GetFields() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
bool AutoRotateOnPlacement() const
autoRotateOnPlacement
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) const override
Return the string actually shown after processing of the base text.
std::vector< SCH_FIELD > m_fields
CONNECTION_TYPE m_connectionType
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void GetIntersheetRefs(std::vector< std::pair< wxString, wxString > > *pages)
Builds an array of { pageNumber, pageName } pairs.
virtual bool ResolveTextVar(wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
COLOR4D GetLabelColor() const
const BOX2I GetBoundingBox() const override
Return the bounding box of the label including its fields.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
virtual bool AutoRotateOnPlacementSupported() const =0
AutoRotateOnPlacementSupported.
bool CanConnect(const SCH_ITEM *aItem) const override
bool m_autoRotateOnPlacement
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &offset) override
Print a schematic item.
int GetLabelBoxExpansion(const RENDER_SETTINGS *aSettings=nullptr) const
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
void SetAutoRotateOnPlacement(bool autoRotate=true)
setAutoRotateOnPlacement
void Rotate90(bool aClockwise) override
void SetShape(LABEL_FLAG_SHAPE aShape) override
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
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.
static const wxString GetDefaultFieldName(const wxString &aName, bool aUseDefaultName)
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
LABEL_FLAG_SHAPE GetShape() const override
virtual int GetMandatoryFieldCount()
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this label.
virtual const BOX2I GetBodyBoundingBox() const
Return the bounding box of the label only, without taking in account its fields.
virtual void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPoints, const VECTOR2I &Pos) const
Calculate the graphic shape (a polygon) associated to the text.
std::vector< SCH_FIELD > & GetFields()
virtual wxString GetClass() const override=0
Return the class name.
VECTOR2I GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
This offset depends on the orientation, the type of text, and the area required to draw the associate...
void Plot(PLOTTER *aPlotter, bool aBackground) const override
Plot the schematic item to aPlotter.
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
wxString GetClass() const override
Return the class name.
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
SCH_LABEL(const VECTOR2I &aPos=VECTOR2I(0, 0), const wxString &aText=wxEmptyString)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
static bool ClassOf(const EDA_ITEM *aItem)
bool IsConnectable() const override
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
VECTOR2I GetPosition() const override
const INSPECTOR_FUNC & INSPECTOR
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.