92 if(
m_Pos.
x != tmp->m_Pos.x )
93 return m_Pos.
x - tmp->m_Pos.x;
95 if(
m_Pos.
y != tmp->m_Pos.y )
96 return m_Pos.
y - tmp->m_Pos.y;
142 int rot_angle = aRotateCCW ? -900 : 900;
179 if( aColor == COLOR4D::UNSPECIFIED )
193 if( aColor != COLOR4D::UNSPECIFIED )
212 bBox.
Move( aOffset );
246 msg.Printf( wxT(
"(%d, %d, %d, %d)" ), bBox.
GetOrigin().
x,
264 return add_circle_xpm;
271 wxT(
"Invalid edit mode for LIB_CIRCLE object." ) );
295 wxT(
"Bad call to ContinueEdit(). LIB_CIRCLE is not being edited." ) );
304 wxT(
"Bad call to EndEdit(). LIB_CIRCLE is not being edited." ) );
wxString CoordinateToString(int aValue, bool aConvertToMils)
Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inche...
KICAD_T Type() const
Function Type()
void Move(const wxPoint &aMoveVector)
Function Move moves the rectangle by the aMoveVector.
int GetPenSize() const override
const wxPoint GetOrigin() const
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Function GetLineLength returns the length of a line segment defined by aPointA and aPointB...
PNG memory record (file in memory).
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
void SetEraseLastDrawItem(bool aErase=true)
Implementation of conversion functions that require both schematic and board internal units...
void drawGraphic(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform) override
Draw the item on aPanel.
virtual void SetColor(COLOR4D color)=0
#define MINIMUM_SELECTION_DISTANCE
bool IntersectsCircle(const wxPoint &aCenter, const int aRadius) const
Function IntersectsCircle tests for a common area between a circle and this rectangle.
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
static const int dist[10][10]
void calcEdit(const wxPoint &aPosition) override
Calculates the attributes of an item at aPosition when it is being edited.
void SetOrigin(const wxPoint &pos)
void RotatePoint(int *pX, int *pY, double angle)
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
void GRFilledCircle(EDA_RECT *ClipBox, wxDC *DC, int x, int y, int r, int width, COLOR4D Color, COLOR4D BgColor)
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size) ...
The base class for drawable items used by schematic library components.
This file contains miscellaneous commonly used macros and functions.
#define IS_NEW
New item, just created.
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
bool ContinueEdit(const wxPoint aNextPoint) override
Continue an edit in progress at aPosition.
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
void SetOffset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
void MirrorVertical(const wxPoint &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
void SetEnd(int x, int y)
bool m_isFillable
Flag to indicate if draw item is fillable.
int compare(const LIB_ITEM &aOther) const override
Provide the draw object specific comparison called by the == and < operators.
Define a library symbol object.
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
virtual void Rotate()
Rotate the draw item.
void EndEdit(const wxPoint &aPosition, bool aAbort=false) override
End an object editing action.
void Move(const wxPoint &aPosition) override
Move a draw object to aPosition.
const wxPoint GetEnd() const
EDA_UNITS_T g_UserUnit
Global variables definitions.
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Base plotter engine class.
virtual void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
TRANSFORM DefaultTransform
LIB_CIRCLE(LIB_PART *aParent)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
wxPoint m_initialPos
Temporary position when moving an existing item.
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
FILL_T m_Fill
The body fill type.
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Class EDA_RECT handles the component boundary box.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
#define IS_RESIZED
Item being resized.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
bool Inside(EDA_RECT &aRect) const override
Test if any part of the draw object is inside rectangle bounds of aRect.
FILL_T
Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
COLOR4D GetItemSelectedColor()
void BeginEdit(STATUS_FLAGS aEditMode, const wxPoint aStartPoint=wxPoint(0, 0)) override
Begin an editing a component library draw item in aEditMode at aPosition.
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Message panel definition file.
const EDA_RECT GetBoundingBox() const override
virtual void Circle(const wxPoint &pos, int diametre, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
void Plot(PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) override
Plot the draw item using the plot object.
wxPoint m_initialCursorPos
Initial cursor position at the beginning of a move.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
#define IS_MOVED
Item being moved.