69 return static_cast<int>(
m_spin );
145 bool IsType(
const std::vector<KICAD_T>& aScanTypes )
const override;
151 switch( aItem->
Type() )
233 void Rotate90(
bool aClockwise )
override;
249 std::vector<std::pair<wxString, wxString>>* pages );
264 int aDepth = 0 )
const override;
266 wxString
GetShownText(
bool aAllowExtraText,
int aDepth = 0 )
const override
282 const std::vector<KICAD_T>& scanTypes )
override;
296 std::vector<VECTOR2I>& aPoints,
const VECTOR2I& Pos )
const
313 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
314 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
318 void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList )
override;
321 std::vector<DANGLING_END_ITEM>& aItemListByPos,
327 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
332 const VECTOR2I& offset,
bool aForceNoFill,
bool aDimmed )
override;
335 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
override;
388 void Serialize( google::protobuf::Any &aContainer )
const override;
389 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
398 return wxT(
"SCH_LABEL" );
440 void Serialize( google::protobuf::Any &aContainer )
const override;
441 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
450 return wxT(
"SCH_DIRECTIVE_LABEL" );
469 std::vector<VECTOR2I>& aPoints,
470 const VECTOR2I& aPos )
const override;
510 const wxString& aText = wxEmptyString );
516 void Serialize( google::protobuf::Any &aContainer )
const override;
517 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
526 return wxT(
"SCH_GLOBALLABEL" );
541 std::vector<VECTOR2I>& aPoints,
542 const VECTOR2I& aPos )
const override;
548 void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
579 void Serialize( google::protobuf::Any &aContainer )
const override;
580 bool Deserialize(
const google::protobuf::Any &aContainer )
override;
589 return wxT(
"SCH_HIERLABEL" );
597 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
virtual const wxString & GetText() const
Return the string associated with the text object.
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.
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void MirrorSpinStyle(bool aLeftRight) override
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void RemoveConnectedRuleArea(SCH_RULE_AREA *aRuleArea)
Removes a specific rule area from the cache.
void ClearConnectedRuleAreas()
Removes all rule areas from the cache.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool IsConnectable() const override
static bool ClassOf(const EDA_ITEM *aItem)
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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.
FLAG_SHAPE GetFlagShape() const
int GetPenWidth() const override
std::unordered_set< SCH_RULE_AREA * > m_connected_rule_areas
Cache of any rule areas with borders which this label connects to.
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
wxString GetClass() const override
Return the class name.
void SetPinLength(int aLength)
virtual bool IsDangling() const override
Determines dangling state from connectivity and cached connected rule areas.
void AddConnectedRuleArea(SCH_RULE_AREA *aRuleArea)
Adds an entry to the connected rule area cache.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetFlagShape(FLAG_SHAPE aShape)
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.
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const override
Resolve any references to system tokens supported by the label.
static bool ClassOf(const EDA_ITEM *aItem)
int GetMandatoryFieldCount() 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...
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
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
wxString GetClass() const override
Return the class name.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
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.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
const BOX2I GetBodyBoundingBox() const override
Return the bounding box of the label only, without taking in account its fields.
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
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.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
bool IsConnectable() const override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
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...
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
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.
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
bool operator==(const SCH_ITEM &aItem) const override
void SetLastResolvedState(const SCH_ITEM *aItem) override
const wxString & GetCachedDriverName() 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)
COLOR4D m_lastResolvedColor
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
void AddFields(const std::vector< SCH_FIELD > &aFields)
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
void SetIsDangling(bool aIsDangling)
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &offset, bool aForceNoFill, bool aDimmed) override
Print an item.
void AddField(const SCH_FIELD &aField)
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.
bool HasCachedDriverName() const override
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
SCH_LABEL_BASE & operator=(const SCH_LABEL_BASE &aLabel)
std::vector< SCH_FIELD > m_fields
CONNECTION_TYPE m_connectionType
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
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.
void SetLabelShape(LABEL_SHAPE aShape)
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
wxString GetShownText(bool aAllowExtraText, int aDepth=0) const override
Return the string actually shown after processing of the base text.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
SPIN_STYLE GetSpinStyle() const
void GetIntersheetRefs(const SCH_SHEET_PATH *aPath, std::vector< std::pair< wxString, wxString > > *pages)
Builds an array of { pageNumber, pageName } pairs.
void MirrorSpinStyle(bool aLeftRight) override
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
COLOR4D GetLabelColor() const
void SetShape(LABEL_FLAG_SHAPE aShape)
LABEL_FLAG_SHAPE GetShape() 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.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
virtual bool AutoRotateOnPlacementSupported() const =0
AutoRotateOnPlacementSupported.
void SetPosition(const VECTOR2I &aPosition) override
virtual bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth) const
Resolve any references to system tokens supported by the label.
bool CanConnect(const SCH_ITEM *aItem) const override
LABEL_SHAPE GetLabelShape() const
bool m_autoRotateOnPlacement
wxString m_cached_driver_name
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
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 cacheShownText() override
void Rotate90(bool aClockwise) override
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
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.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
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...
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
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 ...
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
bool AutoRotateOnPlacementSupported() const override
AutoRotateOnPlacementSupported.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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.
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.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
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
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
VECTOR2I GetPosition() const override
constexpr SPIN_STYLE(SPIN aSpin)
SPIN_STYLE MirrorX()
Mirror the label spin style across the X axis or simply swaps up and bottom.
constexpr bool operator!=(SPIN a) const
constexpr bool operator==(SPIN a) const
SPIN_STYLE MirrorY()
Mirror the label spin style across the Y axis or simply swaps left and right.
unsigned CCWRotationsTo(const SPIN_STYLE &aOther) const
Get CCW rotation needed to get to the given spin style.
const INSPECTOR_FUNC & INSPECTOR
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I