34#include <wx/fdrepdlg.h>
39 m_forceVisible( false ),
41 m_structType( idType )
48 m_forceVisible( false ),
50 m_structType( idType )
55 m_Uuid( base.m_Uuid ),
56 m_status( base.m_status ),
57 m_parent( base.m_parent ),
58 m_forceVisible( base.m_forceVisible ),
59 m_flags( base.m_flags ),
60 m_structType( base.m_structType )
84 wxCHECK_MSG(
false,
nullptr, wxT(
"Clone not implemented in derived class " ) +
GetClass() +
85 wxT(
". Bad programmer!" ) );
92 const std::vector<KICAD_T>& aScanTypes )
94#if 0 && defined(DEBUG)
95 std::cout <<
GetClass().mb_str() <<
' ';
110 wxFAIL_MSG( wxT(
"GetItemDescription() was not overridden for schematic item type " ) +
113 return wxString( wxT(
"Undefined item description for " ) +
GetClass() );
119 wxString
text = aText;
129 searchText.MakeUpper();
136 while( ii < (
int)
text.length() )
138 int next =
text.find( searchText, ii );
140 if(
next == wxNOT_FOUND )
144 next += searchText.length();
146 bool startOK = ( ii == 0 || !wxIsalnum(
text.GetChar( ii - 1 ) ) );
147 bool endOK = (
next == (int)
text.length() || !wxIsalnum(
text.GetChar(
next ) ) );
149 if( startOK && endOK )
159 return text.Matches( searchText );
163 return text.Find( searchText ) != wxNOT_FOUND;
170 wxString
text = aText;
173 bool replaced =
false;
178 searchText = searchText.Upper();
183 while( ii < (
int)
text.length() )
185 int next =
text.find( searchText, ii );
187 if(
next == wxNOT_FOUND )
189 result += aText.Mid( ii, wxString::npos );
194 result += aText.Mid( ii,
next - ii );
197 next += searchText.length();
204 startOK = ( ii == 0 || !wxIsalnum(
text.GetChar( ii - 1 ) ) );
205 endOK = (
next == (int)
text.length() || !wxIsalnum(
text.GetChar(
next ) ) );
213 if( startOK && endOK )
221 result += aText.GetChar( ii );
233 wxFAIL_MSG(
wxString::Format( wxT(
"Less than operator not defined for item type %s." ),
277void EDA_ITEM::ShowDummy( std::ostream& os )
const
282 os <<
'<' << s.Lower().mb_str() <<
">"
283 <<
" Need ::Show() override for this class "
284 <<
"</" << s.Lower().mb_str() <<
">\n";
288std::ostream& EDA_ITEM::NestedSpace(
int nestLevel, std::ostream& os )
290 for(
int i = 0; i<nestLevel; ++i )
306 return wxGetTranslation( typeDescr );
322 .Map(
NOT_USED, wxT(
"<not used>" ) )
397 typeProp->SetIsInternal(
true );
BITMAPS
A list of all bitmap identifiers.
A base class for most all the KiCad significant classes used in schematics and boards.
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
wxString GetTypeDesc() const
Return a translated description of the type for this EDA_ITEM for display in user facing messages.
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
bool operator<(const EDA_ITEM &aItem) const
Test if another item is less than this object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
virtual INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes)
May be re-implemented for each derived class in order to handle all the types given by its member dat...
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const
Return a user-visible description string of this item.
virtual wxString GetFriendlyName() const
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
virtual wxString GetClass() const =0
Return the class name.
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
static bool Replace(const EDA_SEARCH_DATA &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
virtual BITMAPS GetMenuImage() const
Return a pointer to an image to be used in menus.
static ENUM_MAP< T > & Instance()
Provide class metadata.Helper macro to map type hashes to names.
static PROPERTY_MANAGER & Instance()
void AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
static struct EDA_ITEM_DESC _EDA_ITEM_DESC
const INSPECTOR_FUNC & INSPECTOR
#define IS_CHANGED
Item was edited, and modified.
Some functions to handle hotkeys in KiCad.
#define NO_SETTER(owner, type)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
EDA_SEARCH_MATCH_MODE matchMode
wxLogTrace helper definitions.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_FP_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_FP_SHAPE_T
class FP_SHAPE, a footprint edge
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_FP_TEXTBOX_T
class FP_TEXTBOX, wrapped text in a footprint
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_FP_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_ITEM_LIST_T
class BOARD_ITEM_LIST, a list of board items
@ NOT_USED
the 3d code uses this value
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_FP_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_FP_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint
@ PCB_BITMAP_T
class PCB_BITMAP, bitmap on a layer
@ PCB_FP_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
@ PCB_PAD_T
class PAD, a pad in a footprint
@ SCREEN_T
not really an item, used to identify a screen
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension