25 #ifndef CLASS_TEXT_LABEL_H 26 #define CLASS_TEXT_LABEL_H 35 class NETLIST_OBJECT_LIST;
71 return static_cast<int>(
m_spin );
84 default: wxLogWarning(
"RotateCCW encountered unknown current spin style" );
break;
100 default: wxLogWarning(
"RotateCCW encountered unknown current spin style" );
break;
119 default: wxLogWarning(
"MirrorVertically encountered unknown current spin style" );
break;
138 default: wxLogWarning(
"MirrorHorizontally encountered unknown current spin style" );
break;
188 SCH_TEXT(
const wxPoint& aPos = wxPoint( 0, 0 ),
const wxString& aText = wxEmptyString,
208 return wxT(
"SCH_TEXT" );
257 std::vector <wxPoint>& aPoints,
const wxPoint& Pos )
274 void Move(
const wxPoint& aMoveVector )
override 281 void Rotate( wxPoint aPosition )
override;
283 virtual void Rotate90(
bool aClockwise );
286 bool Matches(
const wxFindReplaceData& aSearchData,
void* aAuxData )
const override 291 bool Replace(
const wxFindReplaceData& aSearchData,
void* aAuxData )
override 298 void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList )
override;
315 bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const override;
316 bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
325 void Show(
int nestLevel, std::ostream& os )
const override;
335 SCH_LABEL(
const wxPoint& aPos = wxPoint( 0, 0 ),
const wxString& aText = wxEmptyString );
348 return wxT(
"SCH_LABEL" );
381 SCH_GLOBALLABEL(
const wxPoint& aPos = wxPoint( 0, 0 ),
const wxString& aText = wxEmptyString );
394 return wxT(
"SCH_GLOBALLABEL" );
405 void Rotate( wxPoint aPosition )
override;
406 void Rotate90(
bool aClockwise )
override;
419 std::vector<wxPoint>& aPoints,
const wxPoint& aPos )
override;
450 void Move(
const wxPoint& aMoveVector )
override 469 SCH_HIERLABEL(
const wxPoint& aPos = wxPoint( 0, 0 ),
const wxString& aText = wxEmptyString,
485 return wxT(
"SCH_HIERLABEL" );
493 const wxPoint& Pos )
override;
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
bool IsDangling() const override
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
void Offset(const wxPoint &aOffset)
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetShape(PINSHEETLABEL_SHAPE aShape)
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
PNG memory record (file in memory).
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
bool CanConnect(const SCH_ITEM *aItem) const override
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
virtual bool IsReplaceable() const override
Override this method in any derived object that supports test find and replace.
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
LABEL_SPIN_STYLE m_spin_style
The orientation of text and any associated drawing elements of derived objects.
wxPoint GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
bool m_isDangling
True if not connected to another object if the object derive from SCH_TEXT supports connections.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
bool Replace(const wxFindReplaceData &aSearchData)
Helper function used in search and replace dialog.
bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
void SetTextPos(const wxPoint &aPoint)
void CreateGraphicShape(const RENDER_SETTINGS *aRenderSettings, std::vector< wxPoint > &aPoints, const wxPoint &aPos) override
Calculate the graphic shape (a polygon) associated to the text.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
void SetIsDangling(bool aIsDangling)
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
SCH_GLOBALLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
The base class for create windows for drawing purpose.
bool Replace(const wxFindReplaceData &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
CONNECTION_TYPE m_connectionType
virtual wxPoint GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const
const INSPECTOR_FUNC & INSPECTOR
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
void MirrorSpinStyle(bool aLeftRight) override
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
constexpr bool operator==(SPIN a) const
constexpr LABEL_SPIN_STYLE(SPIN aSpin)
int GetPenWidth() const override
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &Pos) override
Calculate the graphic shape (a polygon) associated to the text.
void GetContextualTextVars(wxArrayString *aVars) const
Returns the set of contextual text variable tokens for this text item.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void Move(const wxPoint &aMoveVector) override
Move the item by aMoveVector to a new position.
bool ResolveTextVar(wxString *token, int aDepth) const
wxString GetClass() const override
Return the class name.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
constexpr bool operator!=(SPIN a) const
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
wxPoint GetSchematicTextOffset(const RENDER_SETTINGS *aSettings) const override
const char * SheetLabelType[]
bool IncrementLabel(int aIncrement)
Increment the label text, if it ends with a number.
LABEL_SPIN_STYLE()=default
void SetIntersheetRefs(const SCH_FIELD &aField)
virtual void CreateGraphicShape(const RENDER_SETTINGS *aSettings, std::vector< wxPoint > &aPoints, const wxPoint &Pos)
Calculate the graphic shape (a polygon) associated to the text.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
LABEL_SPIN_STYLE GetLabelSpinStyle() const
int GetTextOffset(const RENDER_SETTINGS *aSettings=nullptr) const
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
static bool ClassOf(const EDA_ITEM *aItem)
void UpdateIntersheetRefProps()
wxString GetShownText(int aDepth=0) const override
Return the string actually shown after processing of the base text.
wxPoint GetPosition() const override
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &offset) override
Print a schematic item.
LABEL_SPIN_STYLE MirrorY()
wxString GetClass() const override
Return the class name.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
bool IsConnectable() const override
static bool ClassOf(const EDA_ITEM *aItem)
LABEL_SPIN_STYLE RotateCCW()
virtual void Rotate90(bool aClockwise)
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
SCH_FIELD * GetIntersheetRefs()
bool CanConnect(const SCH_ITEM *aItem) const override
Base plotter engine class.
bool operator<(const SCH_ITEM &aItem) const override
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
static bool ClassOf(const EDA_ITEM *aItem)
LABEL_SPIN_STYLE MirrorX()
wxString GetClass() const override
Return the class name.
LABEL_SPIN_STYLE RotateCW()
SCH_FIELD m_intersheetRefsField
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
bool IsConnectable() const override
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
bool IsPointClickableAnchor(const wxPoint &aPos) const override
bool IsPointClickableAnchor(const wxPoint &aPos) const override
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
virtual wxString GetClass() const override
Return the class name.
bool IsPointClickableAnchor(const wxPoint &aPos) const override
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
Handle the component boundary box.
bool CanConnect(const SCH_ITEM *aItem) const override
A base class for most all the KiCad significant classes used in schematics and boards.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) 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.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const wxPoint & GetTextPos() const
PINSHEETLABEL_SHAPE m_shape
virtual void MirrorSpinStyle(bool aLeftRight)
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
SCH_HIERLABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_HIER_LABEL_T)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
virtual void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void SetPosition(const wxPoint &aPosition) override
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
void Rotate90(bool aClockwise) override
SCH_TEXT(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString, KICAD_T aType=SCH_TEXT_T)
bool IsConnectable() const override
SCH_LABEL(const wxPoint &aPos=wxPoint(0, 0), const wxString &aText=wxEmptyString)
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual const wxString & GetText() const
Return the string associated with the text object.
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
static bool ClassOf(const EDA_ITEM *aItem)
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.
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
PINSHEETLABEL_SHAPE GetShape() const
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
KICAD_T Type() const
Returns the type of object.