105 for(
const KICAD_T* p = aScanTypes; *p !=
EOT; ++p )
153 void SetPrefix(
const wxString& aPrefix );
156 void SetSuffix(
const wxString& aSuffix );
201 void SetText(
const wxString& aNewText );
207 const wxString
GetText()
const;
219 void Move(
const wxPoint& offset )
override;
220 void Rotate(
const wxPoint& aRotCentre,
double aAngle )
override;
221 void Flip(
const wxPoint& aCentre,
bool aFlipLeftRight )
override;
229 void Mirror(
const wxPoint& axis_pos,
bool aMirrorLeftRight =
false );
233 bool HitTest(
const wxPoint& aPosition,
int aAccuracy )
const override;
234 bool HitTest(
const EDA_RECT& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
245 int aClearance,
int aError,
ERROR_LOC aErrorLoc,
246 bool aIgnoreLineWidth )
const override;
249 virtual void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
264 template<
typename ShapeType>
265 void addShape(
const ShapeType& aShape );
377 void UpdateHeight(
const wxPoint& aCrossbarStart,
const wxPoint& aCrossbarEnd );
391 return atan2( (
double)delta.y, (
double)delta.x );
396 return wxT(
"ALIGNED_DIMENSION" );
451 return wxT(
"ORTHOGONAL_DIMENSION" );
496 return wxT(
"LEADER" );
534 return wxT(
"CENTER_DIMENSION" );
546 #endif // DIMENSION_H bool GetSuppressZeroes() const
CENTER_DIMENSION(BOARD_ITEM *aParent)
int m_extensionHeight
Length of extension lines past the crossbar.
~ALIGNED_DIMENSION()=default
bool GetOverrideTextEnabled() const
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
class ALIGNED_DIMENSION, a linear dimension (graphic item)
class LEADER, a leader dimension (graphic item)
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
PNG memory record (file in memory).
bool m_suppressZeroes
Suppress trailing zeroes.
DIM_UNITS_FORMAT GetUnitsFormat() const
static constexpr float s_arrowAngle
void SetParent(EDA_ITEM *aParent) override
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
static bool ClassOf(const EDA_ITEM *aItem)
virtual void SetStart(const wxPoint &aPoint)
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
int m_precision
Number of digits to display after decimal.
void SetTextFrame(DIM_TEXT_FRAME aFrame)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
wxString m_prefix
String prepended to the value.
DIM_UNITS_MODE GetUnitsMode() const
DIM_TEXT_FRAME GetTextFrame() const
bool m_autoUnits
If true, follow the currently selected UI units.
class CENTER_DIMENSION, a center point marking (graphic item)
void updateGeometry() override
Updates the cached geometry of the dimension after changing any of its properties.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
bool m_overrideTextEnabled
Manually specify the displayed measurement value.
void SetPosition(const wxPoint &aPos) override
void updateText() override
Updates the text field value from the current geometry (called by updateGeometry normally)
virtual const wxPoint & GetStart() const
The dimension's origin is the first feature point for the dimension.
void SetUnitsFormat(const DIM_UNITS_FORMAT aFormat)
void SetPrefix(const wxString &aPrefix)
DIM_TEXT_POSITION GetTextPositionMode() const
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetUnits(EDA_UNITS aUnits)
wxString GetOverrideText() const
int m_extensionOffset
Distance from feature points to extension line start.
void SetTextSize(const wxSize &aNewSize)
wxString GetClass() const override
Return the class name.
void Update()
Updates the dimension's cached text and geometry.
const wxString GetText() const
Retrieves the value text or override text, not including prefix or suffix.
void addShape(const ShapeType &aShape)
The base class for create windows for drawing purpose.
LEADER(BOARD_ITEM *aParent)
const wxPoint & GetCrossbarStart() const
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
static bool ClassOf(const EDA_ITEM *aItem)
void SetOverrideText(const wxString &aValue)
int m_height
Perpendicular distance from features to crossbar.
const wxPoint & GetCrossbarEnd() const
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
int GetLineThickness() const
double GetAngle() const
Function GetAngle Returns angle of the crossbar.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
int m_arrowLength
Length of arrow shapes.
void SetExtensionHeight(int aHeight)
wxString m_suffix
String appended to the value.
void SetSuppressZeroes(bool aSuppress)
static bool ClassOf(const EDA_ITEM *aItem)
void updateText() override
Updates the text field value from the current geometry (called by updateGeometry normally)
void SetText(const wxString &aNewText)
Sets the override text - has no effect if m_overrideValue == false.
wxString GetClass() const override
Return the class name.
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth) const override
Convert the item shape to a closed polygon.
PCB_LAYER_ID
A quick note on layer IDs:
wxString GetSuffix() const
void SetHeight(int aHeight)
Sets the distance from the feature points to the crossbar line.
bool m_keepTextAligned
Calculate text orientation to match dimension.
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
virtual void updateGeometry()=0
Updates the cached geometry of the dimension after changing any of its properties.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
static OPT_VECTOR2I segPolyIntersection(SHAPE_POLY_SET &aPoly, SEG &aSeg, bool aStart=true)
Finds the intersection between a given segment and polygon outline.
wxString GetPrefix() const
OPT< VECTOR2I > OPT_VECTOR2I
A leader is a dimension-like object pointing to a specific point.
int GetExtensionHeight() const
Represent a set of closed polygons.
void updateGeometry() override
Updates the cached geometry of the dimension after changing any of its properties.
void GetUnits(EDA_UNITS &aUnits) const
EDA_UNITS m_units
0 = inches, 1 = mm
DIR GetOrientation() const
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the X or ...
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.
PCB_TEXT m_text
The actual text object.
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
virtual void SetEnd(const wxPoint &aPoint)
Text placement is manually set by the user.
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void Move(const wxPoint &offset) override
Move this object.
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Text appears outside the dimension line (default)
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
void SetExtensionOffset(int aOffset)
DIM_TEXT_FRAME
Frame to show around dimension text.
void SetSuffix(const wxString &aSuffix)
int m_measuredValue
value of PCB dimensions
class DIMENSION_BASE: abstract dimension meta-type
~ORTHOGONAL_DIMENSION()=default
void SetOrientation(DIR aOrientation)
Sets the orientation of the dimension line (so, perpendicular to the feature lines)
Text appears in line with the dimension line.
void UpdateHeight(const wxPoint &aCrossbarStart, const wxPoint &aCrossbarEnd)
Updates stored height basing on points coordinates.
void SetAutoUnits(bool aAuto=true)
wxString GetClass() const override
Return the class name.
int GetMeasuredValue() const
wxPoint GetPosition() const override
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void updateGeometry() override
Updates the cached geometry of the dimension after changing any of its properties.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
DIM_TEXT_FRAME m_textFrame
static bool ClassOf(const EDA_ITEM *aItem)
wxString GetClass() const override
Return the class name.
ALIGNED_DIMENSION(BOARD_ITEM *aParent, KICAD_T aType=PCB_DIM_ALIGNED_T)
void SetPrecision(int aPrecision)
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
std::vector< std::shared_ptr< SHAPE > > m_shapes
void SetArrowLength(int aLength)
DIM_UNITS_MODE
Used for storing the units selection in the file because EDA_UNITS alone doesn't cut it.
Handle the component boundary box.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
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.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
A base class for most all the KiCad significant classes used in schematics and boards.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
wxString m_valueString
Displayed value when m_overrideValue = true.
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Test if aPosition is contained within or on the bounding box of an item.
DIM_TEXT_POSITION
Where to place the text on a dimension.
int m_lineThickness
Thickness used for all graphics in the dimension.
ORTHOGONAL_DIMENSION(BOARD_ITEM *aParent)
DIMENSION_BASE(BOARD_ITEM *aParent, KICAD_T aType=PCB_DIMENSION_T)
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
void Mirror(const wxPoint &axis_pos, bool aMirrorLeftRight=false)
Mirror the Dimension , relative to a given horizontal axis the text is not mirrored.
DIM_UNITS_FORMAT m_unitsFormat
How to render the units suffix.
void SetOverrideTextEnabled(bool aOverride)
DIM_UNITS_FORMAT
How to display the units in a dimension's text.
virtual void updateText()
Updates the text field value from the current geometry (called by updateGeometry normally)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void updateGeometry() override
Updates the cached geometry of the dimension after changing any of its properties.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
void SetLineThickness(int aWidth)
For better understanding of the points that make a dimension:
BITMAP_DEF GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetTextPositionMode(DIM_TEXT_POSITION aMode)
wxPoint m_crossBarEnd
Crossbar end control point.
void SetTextSize(const wxSize &aTextSize)
bool GetKeepTextAligned() const
DIM_TEXT_POSITION m_textPosition
How to position the text.
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.
virtual const wxPoint & GetEnd() const
int GetArrowLength() const
wxPoint m_crossBarStart
Crossbar start control point.
int GetExtensionOffset() const
void SetUnitsMode(DIM_UNITS_MODE aMode)
void SetKeepTextAligned(bool aKeepAligned)
wxString GetValueText() const
KICAD_T Type() const
Returns the type of object.
DIR m_orientation
What axis to lock the dimension line to.
wxPoint m_end
Internal cache of drawn shapes.
Marks the center of a circle or arc with a cross shape The size and orientation of the cross is adjus...