33 #include <wx/fdrepdlg.h> 65 class wxFindReplaceData;
102 #define IS_CHANGED (1 << 0) 103 #define IS_LINKED (1 << 1) 104 #define IN_EDIT (1 << 2) 105 #define IS_MOVED (1 << 3) 106 #define IS_NEW (1 << 4) 107 #define IS_RESIZED (1 << 5) 108 #define IS_DRAGGED (1 << 6) 109 #define IS_DELETED (1 << 7) 110 #define IS_WIRE_IMAGE (1 << 8) 111 #define STARTPOINT (1 << 9) 112 #define ENDPOINT (1 << 10) 113 #define SELECTED (1 << 11) 114 #define TEMP_SELECTED (1 << 12) 115 #define STRUCT_DELETED (1 << 13) 116 #define CANDIDATE (1 << 14) 117 #define SKIP_STRUCT (1 << 15) 118 #define DO_NOT_DRAW (1 << 16) 119 #define IS_PASTED (1 << 17) 120 #define LOCKED (1 << 18) 121 #define UNUSED (1 << 19) 122 #define MALFORMED_F_COURTYARD (1 << 20) 123 #define MALFORMED_B_COURTYARD (1 << 21) 124 #define MALFORMED_COURTYARDS ( MALFORMED_F_COURTYARD | MALFORMED_B_COURTYARD ) 125 #define BEGIN_ONPAD (1 << 22) 126 #define END_ONPAD (1 << 23) 127 #define HOLE_PROXY (1 << 24) 128 #define IS_ROLLOVER (1 << 25) 129 #define BRIGHTENED (1 << 26) 131 #define DP_COUPLED (1 << 27) 132 #define UR_TRANSIENT (1 << 28) 135 #define IS_DANGLING (1 << 29) 136 #define ENTERED (1 << 30) 141 #define EDA_ITEM_ALL_FLAGS -1 236 for(
const KICAD_T* p = aScanTypes; *p !=
EOT; ++p )
273 virtual bool HitTest(
const wxPoint& aPosition,
int aAccuracy = 0 )
const 286 virtual bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const 348 for(
auto it : aList )
350 if( static_cast<EDA_ITEM*>( it )->
Visit( inspector, testData, scanTypes )
363 std::vector<T>& aList,
INSPECTOR inspector,
void* testData,
const KICAD_T scanTypes[] )
365 for(
auto it : aList )
367 if( static_cast<EDA_ITEM*>( it )->
Visit( inspector, testData, scanTypes )
378 virtual wxString
GetClass()
const = 0;
413 virtual bool Matches(
const wxFindReplaceData& aSearchData,
void* aAuxData )
const 427 static bool Replace(
const wxFindReplaceData& aSearchData, wxString& aText );
440 virtual bool Replace(
const wxFindReplaceData& aSearchData,
void* aAuxData =
nullptr )
478 virtual void ViewGetLayers(
int aLayers[],
int& aCount )
const override;
491 virtual void Show(
int nestLevel, std::ostream& os )
const = 0;
493 void ShowDummy( std::ostream& os )
const;
502 static std::ostream& NestedSpace(
int nestLevel, std::ostream& os );
520 bool Matches(
const wxString& aText,
const wxFindReplaceData& aSearchData )
const;
EDA_ITEM * m_parent
Linked list: Link (parent struct)
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
#define IS_CHANGED
Item was edited, and modified.
STATUS_FLAGS GetStatus() const
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
bool operator<(const EDA_ITEM &aItem) const
Test if another item is less than this object.
PNG memory record (file in memory).
virtual void SetPosition(const wxPoint &aPos)
virtual const wxPoint GetFocusPosition() const
Similar to GetPosition, but allows items to return their visual center rather than their anchor.
#define IS_RESIZED
Item being resized.
bool IsBrightened() const
virtual wxPoint GetPosition() const
An abstract base class for deriving all objects that can be added to a VIEW.
The base class for create windows for drawing purpose.
#define TEMP_SELECTED
flag indicating that the structure has already selected
EDA_ITEM * new_clone(const EDA_ITEM &aItem)
Provide cloning capabilities for all Boost pointer containers of EDA_ITEM pointers.
const INSPECTOR_FUNC & INSPECTOR
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
virtual void SetParent(EDA_ITEM *aParent)
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
#define EDA_ITEM_ALL_FLAGS
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const
Test if aPosition is contained within or on the bounding box of an item.
#define BRIGHTENED
item is drawn with a bright contour
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
VIEW_ITEM class definition.
void SetFlags(STATUS_FLAGS aMask)
std::function< SEARCH_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
Used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T...
STATUS_FLAGS GetEditFlags() const
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
#define ENTERED
indicates a group has been entered
void SetForceVisible(bool aEnable)
Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is se...
#define CANDIDATE
flag indicating that the structure is connected
EDA_ITEM * GetParent() const
#define DO_NOT_DRAW
Used to disable draw function.
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
#define STRUCT_DELETED
flag indication structures to be erased
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
static bool Sort(const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM poin...
virtual bool Replace(const wxFindReplaceData &aSearchData, void *aAuxData=nullptr)
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
#define IS_MOVED
Item being moved.
static bool Replace(const wxFindReplaceData &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
#define IS_DRAGGED
Item being dragged.
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define STARTPOINT
When a line is selected, these flags indicate which.
bool IsForceVisible() const
virtual wxString GetClass() const =0
Return the class name.
void SetState(int type, int state)
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Return the text to display to be used in the selection clarification context menu when multiple items...
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Handle the component boundary box.
virtual bool HitTest(const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const
Test if aRect intersects or is contained within the bounding box of an item.
A base class for most all the KiCad significant classes used in schematics and boards.
void SetStatus(STATUS_FLAGS aStatus)
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
#define ENDPOINT
ends. (Used to support dragging.)
static SEARCH_RESULT IterateForward(std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
This changes first parameter to avoid the DList and use the main queue instead.
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
STATUS_FLAGS GetFlags() const
virtual BITMAP_DEF GetMenuImage() const
Return a pointer to an image to be used in menus.
int GetState(int type) const
static SEARCH_RESULT IterateForward(std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Change first parameter to avoid the DList and use std::vector instead.
#define IS_NEW
New item, just created.
bool HasFlag(STATUS_FLAGS aFlag) const
KICAD_T Type() const
Returns the type of object.
FIND_REPLACE_FLAGS
Additional flag values wxFindReplaceData::m_Flags.