KiCad PCB EDA Suite
GERBER_DRAW_ITEM Class Reference

#include <gerber_draw_item.h>

Inheritance diagram for GERBER_DRAW_ITEM:
EDA_ITEM KIGFX::VIEW_ITEM INSPECTABLE

Public Member Functions

 GERBER_DRAW_ITEM (GERBER_FILE_IMAGE *aGerberparams)
 
 ~GERBER_DRAW_ITEM ()
 
void SetNetAttributes (const GBR_NETLIST_METADATA &aNetAttributes)
 
const GBR_NETLIST_METADATAGetNetAttributes () const
 
int GetLayer () const
 Return the layer this item is on. More...
 
bool GetLayerPolarity () const
 
bool GetTextD_CodePrms (int &aSize, wxPoint &aPos, double &aOrientation)
 Return the best size and orientation to display the D_Code on screen. More...
 
bool GetTextD_CodePrms (double &aSize, VECTOR2D &aPos, double &aOrientation)
 Return the best size and orientation to display the D_Code in GAL aOrientation is returned in radians. More...
 
bool HasNegativeItems ()
 Optimize screen refresh (when no items are in background color refresh can be faster). More...
 
void SetLayerParameters ()
 Initialize parameters from Image and Layer parameters found in the gerber file: m_UnitsMetric, m_MirrorA, m_MirrorB, m_DrawScale, m_DrawOffset. More...
 
void SetLayerPolarity (bool aNegative)
 
void MoveAB (const wxPoint &aMoveVector)
 Move this object. More...
 
void MoveXY (const wxPoint &aMoveVector)
 Move this object. More...
 
wxPoint GetPosition () const override
 Return the position of this object. More...
 
void SetPosition (const wxPoint &aPos) override
 
wxPoint GetABPosition (const wxPoint &aXYPosition) const
 Return the image position of aPosition for this object. More...
 
VECTOR2I GetABPosition (const VECTOR2I &aXYPosition) const
 
wxPoint GetXYPosition (const wxPoint &aABPosition) const
 Return the image position of aPosition for this object. More...
 
D_CODEGetDcodeDescr () const
 Return the GetDcodeDescr of this object, or NULL. More...
 
const EDA_RECT GetBoundingBox () const override
 Return the orthogonal bounding box of this object for display purposes. More...
 
void Print (wxDC *aDC, const wxPoint &aOffset, GBR_DISPLAY_OPTIONS *aOptions)
 
void ConvertSegmentToPolygon ()
 Convert a line to an equivalent polygon. More...
 
void PrintGerberPoly (wxDC *aDC, COLOR4D aColor, const wxPoint &aOffset, bool aFilledShape)
 Print the polygon stored in m_PolyCorners. More...
 
int Shape () const
 
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. More...
 
wxString ShowGBRShape () const
 
bool HitTest (const wxPoint &aRefPos, int aAccuracy=0) const override
 Test if the given wxPoint is within the bounds of this object. More...
 
bool HitTest (const EDA_RECT &aRefArea, bool aContained, int aAccuracy=0) const override
 Test if the given wxRect intersect this object. More...
 
wxString GetClass () const override
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 
virtual const BOX2I ViewBBox () const override
 
double ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
 Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
virtual wxString GetSelectMenuText (EDA_UNITS aUnits) const override
 Return a pointer to an image to be used in menus. More...
 
BITMAPS GetMenuImage () const override
 Return a pointer to an image to be used in menus. More...
 
KICAD_T Type () const
 Returns the type of object. More...
 
EDA_ITEMGetParent () const
 
virtual void SetParent (EDA_ITEM *aParent)
 
bool IsModified () const
 
bool IsNew () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsEntered () const
 
bool IsResized () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, bool state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag) const
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 Check whether the item is one of the listed types. More...
 
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 set to not visible. More...
 
bool IsForceVisible () const
 
virtual const wxPoint GetFocusPosition () const
 Similar to GetPosition, but allows items to return their visual center rather than their anchor. More...
 
virtual EDA_ITEMClone () const
 Create a duplicate of this item with linked list members set to NULL. More...
 
virtual bool Matches (const wxFindReplaceData &aSearchData, void *aAuxData) const
 Compare the item against the search criteria in aSearchData. More...
 
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 find and replace. More...
 
virtual bool IsReplaceable () const
 Override this method in any derived object that supports test find and replace. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Draw the parts of the object belonging to layer aLayer. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Static Public Member Functions

template<class T >
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. More...
 
template<class T >
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. More...
 
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 support text find and replace. More...
 
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 pointers. More...
 

Public Attributes

bool m_UnitsMetric
 
int m_Shape
 
wxPoint m_Start
 
wxPoint m_End
 
wxPoint m_ArcCentre
 
SHAPE_POLY_SET m_Polygon
 
wxSize m_Size
 
bool m_Flashed
 
int m_DCode
 
wxString m_AperFunction
 
GERBER_FILE_IMAGEm_GerberImageFile
 
const KIID m_Uuid
 

Protected Member Functions

bool Matches (const wxString &aText, const wxFindReplaceData &aSearchData) const
 Compare aText against search criteria in aSearchData. More...
 

Protected Attributes

STATUS_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
STATUS_FLAGS m_flags
 

Private Attributes

bool m_LayerNegative
 
bool m_swapAxis
 
bool m_mirrorA
 
bool m_mirrorB
 
wxRealPoint m_drawScale
 
wxPoint m_layerOffset
 
double m_lyrRotation
 
GBR_NETLIST_METADATA m_netAttributes
 the string given by a TO attribute set in aperture (dcode). More...
 

Detailed Description

Definition at line 66 of file gerber_draw_item.h.

Constructor & Destructor Documentation

◆ GERBER_DRAW_ITEM()

GERBER_DRAW_ITEM::GERBER_DRAW_ITEM ( GERBER_FILE_IMAGE aGerberparams)

Definition at line 40 of file gerber_draw_item.cpp.

40  :
42 {
43  m_GerberImageFile = aGerberImageFile;
45  m_Flashed = false;
46  m_DCode = 0;
47  m_UnitsMetric = false;
48  m_LayerNegative = false;
49  m_swapAxis = false;
50  m_mirrorA = false;
51  m_mirrorB = false;
52  m_drawScale.x = m_drawScale.y = 1.0;
53  m_lyrRotation = 0;
54 
55  if( m_GerberImageFile )
57 }
void SetLayerParameters()
Initialize parameters from Image and Layer parameters found in the gerber file: m_UnitsMetric,...
#define NULL
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: eda_item.cpp:35
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
GERBER_FILE_IMAGE * m_GerberImageFile
wxRealPoint m_drawScale

References GBR_SEGMENT, m_DCode, m_drawScale, m_Flashed, m_GerberImageFile, m_LayerNegative, m_lyrRotation, m_mirrorA, m_mirrorB, m_Shape, m_swapAxis, m_UnitsMetric, and SetLayerParameters().

◆ ~GERBER_DRAW_ITEM()

GERBER_DRAW_ITEM::~GERBER_DRAW_ITEM ( )

Definition at line 60 of file gerber_draw_item.cpp.

61 {
62 }

Member Function Documentation

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

◆ ClearEditFlags()

◆ ClearFlags()

void EDA_ITEM::ClearFlags ( STATUS_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 204 of file eda_item.h.

204 { m_flags &= ~aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References EDA_ITEM::m_flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::AlignElements(), FOOTPRINT::BuildPolyCourtyards(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), SYMBOL_EDITOR_PIN_TOOL::CreateImagePins(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), PCB_SELECTION_TOOL::ExitGroup(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), EE_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::narrowSelection(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceFootprint(), SYMBOL_EDITOR_PIN_TOOL::PlacePin(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearSelected()

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 216 of file eda_item.h.

217  {
219  DO_NOT_DRAW );
220  }
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: eda_item.h:115
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: eda_item.h:104
#define CANDIDATE
flag indicating that the structure is connected
Definition: eda_item.h:117
#define DO_NOT_DRAW
Used to disable draw function.
Definition: eda_item.h:119
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: eda_item.h:112
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:204
#define ENDPOINT
ends. (Used to support dragging.)
Definition: eda_item.h:113
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: eda_item.h:118

References CANDIDATE, EDA_ITEM::ClearFlags(), DO_NOT_DRAW, ENDPOINT, IS_LINKED, SKIP_STRUCT, STARTPOINT, and TEMP_SELECTED.

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 148 of file view_item.h.

149  {
150  m_viewPrivData = nullptr;
151  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:156

References KIGFX::VIEW_ITEM::m_viewPrivData.

Referenced by KIGFX::VIEW::OnDestroy().

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Create a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

Reimplemented in FP_ZONE, ZONE, SCH_COMPONENT, PAD, FOOTPRINT, SCH_HIERLABEL, CENTER_DIMENSION, LEADER, ORTHOGONAL_DIMENSION, VIA, SCH_GLOBALLABEL, SCH_SHEET, SCH_LABEL, ALIGNED_DIMENSION, PCB_SHAPE, ARC, SCH_TEXT, SCH_LINE, LIB_PIN, FP_TEXT, TRACK, SCH_BUS_BUS_ENTRY, SCH_FIELD, LIB_FIELD, SCH_SHEET_PIN, SCH_BUS_WIRE_ENTRY, FP_SHAPE, SCH_BITMAP, PCB_TEXT, PCB_GROUP, LIB_ARC, LIB_TEXT, SCH_NO_CONNECT, SCH_JUNCTION, SCH_MARKER, LIB_POLYLINE, PCB_TARGET, LIB_CIRCLE, LIB_BEZIER, LIB_RECTANGLE, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 81 of file eda_item.cpp.

82 {
83  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
84  wxT( ". Bad programmer!" ) );
85 }
#define NULL
virtual wxString GetClass() const =0
Return the class name.

References EDA_ITEM::GetClass(), and NULL.

Referenced by DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), DIMENSION_BASE::GetEffectiveShape(), LIB_PART::LIB_PART(), new_clone(), LIB_PART::operator=(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), CLIPBOARD_IO::SaveSelection(), LIB_PART::SetConversion(), LIB_PART::SetUnitCount(), SCH_DRAWING_TOOLS::SingleClickPlace(), COMMIT::Stage(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ConvertSegmentToPolygon()

void GERBER_DRAW_ITEM::ConvertSegmentToPolygon ( )

Convert a line to an equivalent polygon.

Useful when a line is plotted using a rectangular pen. In this case, the usual segment plot function cannot be used

Definition at line 577 of file gerber_draw_item.cpp.

578 {
581 
582  wxPoint start = m_Start;
583  wxPoint end = m_End;
584 
585  // make calculations more easy if ensure start.x < end.x
586  // (only 2 quadrants to consider)
587  if( start.x > end.x )
588  std::swap( start, end );
589 
590  // calculate values relative to start point:
591  wxPoint delta = end - start;
592 
593  // calculate corners for the first quadrant only (delta.x and delta.y > 0 )
594  // currently, delta.x already is > 0.
595  // make delta.y > 0
596  bool change = delta.y < 0;
597 
598  if( change )
599  delta.y = -delta.y;
600 
601  // Now create the full polygon.
602  // Due to previous changes, the shape is always something like
603  // 3 4
604  // 2 5
605  // 1 6
606  wxPoint corner;
607  corner.x -= m_Size.x/2;
608  corner.y -= m_Size.y/2;
609  wxPoint close = corner;
610  m_Polygon.Append( VECTOR2I( corner ) ); // Lower left corner, start point (1)
611  corner.y += m_Size.y;
612  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, start point (2)
613 
614  if( delta.x || delta.y)
615  {
616  corner += delta;
617  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, end point (3)
618  }
619 
620  corner.x += m_Size.x;
621  m_Polygon.Append( VECTOR2I( corner ) ); // upper right corner, end point (4)
622  corner.y -= m_Size.y;
623  m_Polygon.Append( VECTOR2I( corner ) ); // lower right corner, end point (5)
624 
625  if( delta.x || delta.y )
626  {
627  corner -= delta;
628  m_Polygon.Append( VECTOR2I( corner ) ); // lower left corner, start point (6)
629  }
630 
631  m_Polygon.Append( VECTOR2I( close ) ); // close the shape
632 
633  // Create final polygon:
634  if( change )
635  m_Polygon.Mirror( false, true );
636 
637  m_Polygon.Move( VECTOR2I( start ) );
638 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
SHAPE_POLY_SET m_Polygon
void Mirror(bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 })
Mirror the line points about y or x (or both)
void Move(const VECTOR2I &aVector) override
int NewOutline()
Creates a new hole in a given outline.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Add a new vertex to the contour indexed by aOutline and aHole (defaults to the outline of the last po...

References SHAPE_POLY_SET::Append(), m_End, m_Polygon, m_Size, m_Start, SHAPE_POLY_SET::Mirror(), SHAPE_POLY_SET::Move(), SHAPE_POLY_SET::NewOutline(), and SHAPE_POLY_SET::RemoveAllContours().

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), and Print().

◆ Get() [1/3]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 86 of file inspectable.h.

87  {
89  TYPE_ID thisType = TYPE_HASH( *this );
90  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
91  return object ? aProperty->getter( object ) : wxAny();
92  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual wxAny getter(void *aObject) const =0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by BOOST_AUTO_TEST_CASE(), CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [2/3]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 95 of file inspectable.h.

96  {
98  TYPE_ID thisType = TYPE_HASH( *this );
99  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
100  return object ? aProperty->get<T>( object ) : T();
101  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [3/3]

template<typename T >
boost::optional<T> INSPECTABLE::Get ( const wxString &  aProperty)
inlineinherited

Definition at line 104 of file inspectable.h.

105  {
107  TYPE_ID thisType = TYPE_HASH( *this );
108  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
109  boost::optional<T> ret;
110 
111  if( prop )
112  {
113  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
114 
115  if( object )
116  ret = prop->get<T>( object );
117  }
118 
119  return ret;
120  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
T get(void *aObject)
Definition: property.h:268
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ GetABPosition() [1/2]

wxPoint GERBER_DRAW_ITEM::GetABPosition ( const wxPoint &  aXYPosition) const

Return the image position of aPosition for this object.

Image position is the value of aPosition, modified by image parameters: offsets, axis selection, scale, rotation

Parameters
aXYPositionis position in X,Y gerber axis
Returns
The given position in plotter A,B axis.

Definition at line 151 of file gerber_draw_item.cpp.

152 {
153  /* Note: RS274Xrevd_e is obscure about the order of transforms:
154  * For instance: Rotation must be made after or before mirroring ?
155  * Note: if something is changed here, GetYXPosition must reflect changes
156  */
157  wxPoint abPos = aXYPosition + m_GerberImageFile->m_ImageJustifyOffset;
158 
159  if( m_swapAxis )
160  std::swap( abPos.x, abPos.y );
161 
163  abPos.x = KiROUND( abPos.x * m_drawScale.x );
164  abPos.y = KiROUND( abPos.y * m_drawScale.y );
165  double rotation = m_lyrRotation * 10 + m_GerberImageFile->m_ImageRotation * 10;
166 
167  if( rotation )
168  RotatePoint( &abPos, -rotation );
169 
170  // Negate A axis if mirrored
171  if( m_mirrorA )
172  abPos.x = -abPos.x;
173 
174  // abPos.y must be negated when no mirror, because draw axis is top to bottom
175  if( !m_mirrorB )
176  abPos.y = -abPos.y;
177  return abPos;
178 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:228
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
GERBER_FILE_IMAGE * m_GerberImageFile
int m_ImageRotation
Local rotation in degrees added to m_ImageRotation.
wxRealPoint m_drawScale

References KiROUND(), m_drawScale, m_GerberImageFile, GERBER_FILE_IMAGE::m_ImageJustifyOffset, GERBER_FILE_IMAGE::m_ImageOffset, GERBER_FILE_IMAGE::m_ImageRotation, m_layerOffset, m_lyrRotation, m_mirrorA, m_mirrorB, m_swapAxis, and RotatePoint().

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), AM_PRIMITIVE::DrawBasicShape(), D_CODE::DrawFlashedPolygon(), D_CODE::DrawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), GBR_TO_PCB_EXPORTER::export_flashed_copper_item(), GBR_TO_PCB_EXPORTER::export_non_copper_item(), GetABPosition(), APERTURE_MACRO::GetApertureMacroShape(), GetBoundingBox(), GetTextD_CodePrms(), HitTest(), Print(), and PrintGerberPoly().

◆ GetABPosition() [2/2]

VECTOR2I GERBER_DRAW_ITEM::GetABPosition ( const VECTOR2I aXYPosition) const
inline

Definition at line 157 of file gerber_draw_item.h.

158  {
159  return VECTOR2I( GetABPosition( wxPoint( aXYPosition.x, aXYPosition.y ) ) );
160  }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.

References GetABPosition(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ GetBoundingBox()

const EDA_RECT GERBER_DRAW_ITEM::GetBoundingBox ( ) const
overridevirtual

Return the orthogonal bounding box of this object for display purposes.

This box should be an enclosing perimeter for visible components of this object, and the units should be in the pcb or schematic coordinate system. It is OK to overestimate the size by a few counts.

Reimplemented from EDA_ITEM.

Definition at line 282 of file gerber_draw_item.cpp.

283 {
284  // return a rectangle which is (pos,dim) in nature. therefore the +1
285  EDA_RECT bbox( m_Start, wxSize( 1, 1 ) );
286  D_CODE* code = GetDcodeDescr();
287 
288  // TODO(JE) GERBER_DRAW_ITEM maybe should actually be a number of subclasses.
289  // Until/unless that is changed, we need to do different things depending on
290  // what is actually being represented by this GERBER_DRAW_ITEM.
291 
292  switch( m_Shape )
293  {
294  case GBR_POLYGON:
295  {
296  auto bb = m_Polygon.BBox();
297  bbox.Inflate( bb.GetWidth() / 2, bb.GetHeight() / 2 );
298  bbox.SetOrigin( bb.GetOrigin().x, bb.GetOrigin().y );
299  break;
300  }
301 
302  case GBR_CIRCLE:
303  {
304  double radius = GetLineLength( m_Start, m_End );
305  bbox.Inflate( radius, radius );
306  break;
307  }
308 
309  case GBR_ARC:
310  {
311  double arc_angle =
312  atan2( double( m_End.y - m_ArcCentre.y ), double( m_End.x - m_ArcCentre.x ) )
313  - atan2( double( m_Start.y - m_ArcCentre.y ), double( m_Start.x - m_ArcCentre.x ) );
314 
315  arc_angle *= 180.0 / M_PI;
316 
317  if( arc_angle < 0.0 )
318  arc_angle += 360.0;
319 
320  if( m_End == m_Start ) // Arc with the end point = start point is expected to be a circle
321  arc_angle = 360.0;
322 
323  SHAPE_ARC arc( m_ArcCentre, m_Start, arc_angle );
324  BOX2I arc_bbox = arc.BBox( m_Size.x / 2 ); // m_Size.x is the line thickness
325  bbox.SetOrigin( arc_bbox.GetX(), arc_bbox.GetY() );
326  bbox.SetWidth( arc_bbox.GetWidth() );
327  bbox.SetHeight( arc_bbox.GetHeight() );
328  break;
329  }
330 
331  case GBR_SPOT_CIRCLE:
332  {
333  if( code )
334  {
335  int radius = code->m_Size.x >> 1;
336  bbox.Inflate( radius, radius );
337  }
338  break;
339  }
340 
341  case GBR_SPOT_RECT:
342  {
343  if( code )
344  bbox.Inflate( code->m_Size.x / 2, code->m_Size.y / 2 );
345  break;
346  }
347 
348  case GBR_SPOT_OVAL:
349  {
350  if( code )
351  bbox.Inflate( code->m_Size.x /2, code->m_Size.y / 2 );
352  break;
353  }
354 
355  case GBR_SPOT_POLY:
356  {
357  if( code )
358  {
359  if( code->m_Polygon.OutlineCount() == 0 )
360  code->ConvertShapeToPolygon();
361 
362  bbox.Inflate( code->m_Polygon.BBox().GetWidth() / 2,
363  code->m_Polygon.BBox().GetHeight() / 2 );
364  }
365  break;
366  }
367  case GBR_SPOT_MACRO:
368  {
369  if( code )
370  {
371  // Update the shape drawings and the bounding box coordiantes:
372  code->GetMacro()->GetApertureMacroShape( this, m_Start );
373  // now the bounding box is valid:
374  bbox = code->GetMacro()->GetBoundingBox();
375  }
376  break;
377  }
378 
379  case GBR_SEGMENT:
380  {
381  if( code && code->m_Shape == APT_RECT )
382  {
383  if( m_Polygon.OutlineCount() > 0 )
384  {
385  auto bb = m_Polygon.BBox();
386  bbox.Inflate( bb.GetWidth() / 2, bb.GetHeight() / 2 );
387  bbox.SetOrigin( bb.GetOrigin().x, bb.GetOrigin().y );
388  }
389  }
390  else
391  {
392  int radius = ( m_Size.x + 1 ) / 2;
393 
394  int ymax = std::max( m_Start.y, m_End.y ) + radius;
395  int xmax = std::max( m_Start.x, m_End.x ) + radius;
396 
397  int ymin = std::min( m_Start.y, m_End.y ) - radius;
398  int xmin = std::min( m_Start.x, m_End.x ) - radius;
399 
400  bbox = EDA_RECT( wxPoint( xmin, ymin ), wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
401  }
402 
403  break;
404  }
405  default:
406  wxASSERT_MSG( false, wxT( "GERBER_DRAW_ITEM shape is unknown!" ) );
407  break;
408  }
409 
410  // calculate the corners coordinates in current gerber axis orientations
411  wxPoint org = GetABPosition( bbox.GetOrigin() );
412  wxPoint end = GetABPosition( bbox.GetEnd() );
413 
414  // Set the corners position:
415  bbox.SetOrigin( org );
416  bbox.SetEnd( end );
417  bbox.Normalize();
418 
419  return bbox;
420 }
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
coord_type GetX() const
Definition: box2.h:190
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:52
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, wxPoint aShapePos)
Function GetApertureMacroShape Calculate the primitive shape for flashed items.
EDA_RECT GetBoundingBox() const
Returns the bounding box of the shape.
Definition: am_primitive.h:230
coord_type GetWidth() const
Definition: box2.h:197
coord_type GetY() const
Definition: box2.h:191
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:302
D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void SetOrigin(const Vec &pos)
Definition: box2.h:210
Handle the component boundary box.
Definition: eda_rect.h:42
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:107
coord_type GetHeight() const
Definition: box2.h:198
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157
void ConvertShapeToPolygon()
Function ConvertShapeToPolygon convert a shape to an equivalent polygon.
Definition: dcode.cpp:300
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.

References APT_RECT, SHAPE_ARC::BBox(), SHAPE_POLY_SET::BBox(), D_CODE::ConvertShapeToPolygon(), GBR_ARC, GBR_CIRCLE, GBR_POLYGON, GBR_SEGMENT, GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, GetABPosition(), APERTURE_MACRO::GetApertureMacroShape(), APERTURE_MACRO::GetBoundingBox(), GetDcodeDescr(), EDA_RECT::GetEnd(), BOX2< Vec >::GetHeight(), GetLineLength(), D_CODE::GetMacro(), EDA_RECT::GetOrigin(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), EDA_RECT::Inflate(), m_ArcCentre, m_End, D_CODE::m_Polygon, m_Polygon, D_CODE::m_Shape, m_Shape, D_CODE::m_Size, m_Size, m_Start, EDA_RECT::Normalize(), SHAPE_POLY_SET::OutlineCount(), EDA_RECT::SetEnd(), EDA_RECT::SetHeight(), EDA_RECT::SetOrigin(), and EDA_RECT::SetWidth().

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), HitTest(), and ViewBBox().

◆ GetClass()

wxString GERBER_DRAW_ITEM::GetClass ( ) const
inlineoverridevirtual
Returns
the class name string.

Implements EDA_ITEM.

Definition at line 224 of file gerber_draw_item.h.

225  {
226  return wxT( "GERBER_DRAW_ITEM" );
227  }

◆ GetDcodeDescr()

D_CODE * GERBER_DRAW_ITEM::GetDcodeDescr ( ) const

Return the GetDcodeDescr of this object, or NULL.

Returns
a pointer to the DCode description (for flashed items).

Definition at line 270 of file gerber_draw_item.cpp.

271 {
272  if( (m_DCode < FIRST_DCODE) || (m_DCode > LAST_DCODE) )
273  return NULL;
274 
275  if( m_GerberImageFile == NULL )
276  return NULL;
277 
279 }
D_CODE * GetDCODE(int aDCODE) const
Return a pointer to the D_CODE within this GERBER for the given aDCODE.
#define LAST_DCODE
Definition: dcode.h:72
#define NULL
#define FIRST_DCODE
Definition: dcode.h:71
GERBER_FILE_IMAGE * m_GerberImageFile

References FIRST_DCODE, GERBER_FILE_IMAGE::GetDCODE(), LAST_DCODE, m_DCode, m_GerberImageFile, and NULL.

Referenced by AM_PRIMITIVE::ConvertShapeToPolygon(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), AM_PRIMITIVE::DrawBasicShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), GBR_TO_PCB_EXPORTER::export_flashed_copper_item(), GBR_TO_PCB_EXPORTER::export_non_copper_item(), fillFlashedGBRITEM(), GetBoundingBox(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), GetMsgPanelInfo(), AM_PRIMITIVE::GetShapeDim(), GetTextD_CodePrms(), GERBVIEW_CONTROL::HighlightControl(), HitTest(), AM_PRIMITIVE::IsAMPrimitiveExposureOn(), Print(), ShowGBRShape(), and ViewGetLOD().

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 208 of file eda_item.h.

209  {
210  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED |
212 
213  return m_flags & mask;
214  }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:108
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:116
#define IS_MOVED
Item being moved.
Definition: eda_item.h:106
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:109
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
Definition: eda_item.h:120
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:111
STATUS_FLAGS m_flags
Definition: eda_item.h:531
#define IS_NEW
New item, just created.
Definition: eda_item.h:107

References IS_DRAGGED, IS_MOVED, IS_NEW, IS_PASTED, IS_RESIZED, IS_WIRE_IMAGE, EDA_ITEM::m_flags, and STRUCT_DELETED.

Referenced by EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_PIN_TOOL::EditPinProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SCH_COMPONENT::GetMsgPanelInfo(), SELECTION_CONDITIONS::Idle(), SELECTION_CONDITIONS::IdleSelection(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_POINT_EDITOR::OnSelectionChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), PAD_TOOL::recombinePad(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow().

◆ GetFlags()

◆ GetFocusPosition()

virtual const wxPoint EDA_ITEM::GetFocusPosition ( ) const
inlinevirtualinherited

Similar to GetPosition, but allows items to return their visual center rather than their anchor.

Reimplemented in BOARD, PCB_SHAPE, and TRACK.

Definition at line 309 of file eda_item.h.

309 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:302

References EDA_ITEM::GetPosition().

Referenced by PCB_BASE_FRAME::FocusOnItem(), and SCH_EDIT_FRAME::FocusOnItem().

◆ GetLayer()

int GERBER_DRAW_ITEM::GetLayer ( ) const

Return the layer this item is on.

Definition at line 78 of file gerber_draw_item.cpp.

79 {
80  // returns the layer this item is on, or 0 if the m_GerberImageFile is NULL.
82 }
GERBER_FILE_IMAGE * m_GerberImageFile

References m_GerberImageFile, and GERBER_FILE_IMAGE::m_GraphicLayer.

Referenced by GetMsgPanelInfo(), GetSelectMenuText(), GERBVIEW_SELECTION_TOOL::selectable(), and ViewGetLayers().

◆ GetLayerPolarity()

bool GERBER_DRAW_ITEM::GetLayerPolarity ( ) const
inline

◆ GetMenuImage()

BITMAPS GERBER_DRAW_ITEM::GetMenuImage ( ) const
overridevirtual

Return a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 759 of file gerber_draw_item.cpp.

760 {
761  if( m_Flashed )
762  return BITMAPS::pad;
763 
764  switch( m_Shape )
765  {
766  case GBR_SEGMENT:
767  case GBR_ARC:
768  case GBR_CIRCLE:
769  return BITMAPS::add_line;
770 
771  case GBR_SPOT_OVAL:
772  case GBR_SPOT_CIRCLE:
773  case GBR_SPOT_RECT:
774  case GBR_SPOT_POLY:
775  case GBR_SPOT_MACRO:
776  // should be handles by m_Flashed == true
777  return BITMAPS::pad;
778 
779  case GBR_POLYGON:
781  }
782 
783  return BITMAPS::info;
784 }

References add_graphical_polygon, add_line, GBR_ARC, GBR_CIRCLE, GBR_POLYGON, GBR_SEGMENT, GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, info, m_Flashed, m_Shape, and pad.

◆ GetMsgPanelInfo()

void GERBER_DRAW_ITEM::GetMsgPanelInfo ( EDA_DRAW_FRAME aFrame,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Parameters
aListis the list to populate.

Reimplemented from EDA_ITEM.

Definition at line 661 of file gerber_draw_item.cpp.

662 {
663  wxString msg;
664  wxString text;
665 
666  msg = ShowGBRShape();
667  aList.emplace_back( _( "Type" ), msg );
668 
669  // Display D_Code value with its attributes for items using a DCode:
670  if( m_Shape == GBR_POLYGON ) // Has no DCode, but can have an attribute
671  {
672  msg = _( "Attribute" );
673 
674  if( m_AperFunction.IsEmpty() )
675  text = _( "No attribute" );
676  else
678  }
679  else
680  {
681  msg.Printf( _( "D Code %d" ), m_DCode );
682  D_CODE* apertDescr = GetDcodeDescr();
683 
684  if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
685  text = _( "No attribute" );
686  else
687  text = apertDescr->m_AperFunction;
688  }
689 
690  aList.emplace_back( msg, text );
691 
692  // Display graphic layer name
694  aList.emplace_back( _( "Graphic Layer" ), msg );
695 
696  // Display item rotation
697  // The full rotation is Image rotation + m_lyrRotation
698  // but m_lyrRotation is specific to this object
699  // so we display only this parameter
700  msg.Printf( wxT( "%f" ), m_lyrRotation );
701  aList.emplace_back( _( "Rotation" ), msg );
702 
703  // Display item polarity (item specific)
704  msg = m_LayerNegative ? _("Clear") : _("Dark");
705  aList.emplace_back( _( "Polarity" ), msg );
706 
707  // Display mirroring (item specific)
708  msg.Printf( wxT( "A:%s B:%s" ),
709  m_mirrorA ? _("Yes") : _("No"),
710  m_mirrorB ? _("Yes") : _("No"));
711  aList.emplace_back( _( "Mirror" ), msg );
712 
713  // Display AB axis swap (item specific)
714  msg = m_swapAxis ? wxT( "A=Y B=X" ) : wxT( "A=X B=Y" );
715  aList.emplace_back( _( "AB axis" ), msg );
716 
717  // Display net info, if exists
719  return;
720 
721  // Build full net info:
722  wxString net_msg;
723  wxString cmp_pad_msg;
724 
726  {
727  net_msg = _( "Net:" );
728  net_msg << " ";
729 
730  if( m_netAttributes.m_Netname.IsEmpty() )
731  net_msg << "<no net>";
732  else
734  }
735 
737  {
739  cmp_pad_msg.Printf( _( "Cmp: %s Pad: %s" ),
742  else
743  cmp_pad_msg.Printf( _( "Cmp: %s Pad: %s Fct %s" ),
747  }
748 
750  {
751  cmp_pad_msg = _( "Cmp:" );
752  cmp_pad_msg << " " << m_netAttributes.m_Cmpref;
753  }
754 
755  aList.emplace_back( net_msg, cmp_pad_msg );
756 }
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
print info associated to a component (TO.C attribute)
int GetLayer() const
Return the layer this item is on.
wxString m_Cmpref
the component reference parent of the data
GBR_DATA_FIELD m_PadPinFunction
for a pad: the pin function (defined in schematic)
GBR_DATA_FIELD m_Padname
for a flashed pad: the pad name ((TO.P attribute)
static GERBER_FILE_IMAGE_LIST & GetImagesList()
GBR_NETLIST_METADATA m_netAttributes
the string given by a TO attribute set in aperture (dcode).
wxString m_Netname
for items associated to a net: the netname
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE
Definition: dcode.h:105
D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
#define _(s)
Definition: 3d_actions.cpp:33
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:151
print info associated to a flashed pad (TO.P attribute)
print info associated to a net (TO.N attribute)
const wxString GetDisplayName(int aIdx, bool aNameOnly=false, bool aFullName=false)
Get the display name for the layer at aIdx.
const wxString & GetValue() const
int m_NetAttribType
the type of net info (used to define the gerber string to create)
wxString ShowGBRShape() const

References _, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, GBR_NETLIST_METADATA::GBR_NETINFO_NET, GBR_NETLIST_METADATA::GBR_NETINFO_PAD, GBR_NETLIST_METADATA::GBR_NETINFO_UNSPECIFIED, GBR_POLYGON, GetDcodeDescr(), GERBER_FILE_IMAGE_LIST::GetDisplayName(), GERBER_FILE_IMAGE_LIST::GetImagesList(), GetLayer(), GBR_DATA_FIELD::GetValue(), GBR_DATA_FIELD::IsEmpty(), D_CODE::m_AperFunction, m_AperFunction, GBR_NETLIST_METADATA::m_Cmpref, m_DCode, m_LayerNegative, m_lyrRotation, m_mirrorA, m_mirrorB, GBR_NETLIST_METADATA::m_NetAttribType, m_netAttributes, GBR_NETLIST_METADATA::m_Netname, GBR_NETLIST_METADATA::m_Padname, GBR_NETLIST_METADATA::m_PadPinFunction, m_Shape, m_swapAxis, ShowGBRShape(), text, and UnescapeString().

◆ GetNetAttributes()

const GBR_NETLIST_METADATA& GERBER_DRAW_ITEM::GetNetAttributes ( ) const
inline

Definition at line 73 of file gerber_draw_item.h.

73 { return m_netAttributes; }
GBR_NETLIST_METADATA m_netAttributes
the string given by a TO attribute set in aperture (dcode).

References m_netAttributes.

Referenced by KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), and GERBVIEW_CONTROL::HighlightControl().

◆ GetParent()

◆ GetPosition()

wxPoint GERBER_DRAW_ITEM::GetPosition ( ) const
inlineoverridevirtual

Return the position of this object.

This function exists mainly to satisfy the virtual GetPosition() in parent class

Returns
The position of this object.

Reimplemented from EDA_ITEM.

Definition at line 143 of file gerber_draw_item.h.

143 { return m_Start; }

References m_Start.

◆ GetSelectMenuText()

wxString GERBER_DRAW_ITEM::GetSelectMenuText ( EDA_UNITS  aUnits) const
overridevirtual

Return a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 1004 of file gerber_draw_item.cpp.

1005 {
1006  wxString layerName;
1007 
1009 
1010  return wxString::Format( _( "%s (D%d) on layer %d: %s" ),
1011  ShowGBRShape(),
1012  m_DCode,
1013  GetLayer() + 1,
1014  layerName );
1015 }
int GetLayer() const
Return the layer this item is on.
static GERBER_FILE_IMAGE_LIST & GetImagesList()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
#define _(s)
Definition: 3d_actions.cpp:33
const wxString GetDisplayName(int aIdx, bool aNameOnly=false, bool aFullName=false)
Get the display name for the layer at aIdx.
wxString ShowGBRShape() const

References _, Format(), GERBER_FILE_IMAGE_LIST::GetDisplayName(), GERBER_FILE_IMAGE_LIST::GetImagesList(), GetLayer(), m_DCode, and ShowGBRShape().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 187 of file eda_item.h.

188  {
189  return m_status & type;
190  }
STATUS_FLAGS m_status
Definition: eda_item.h:528

References EDA_ITEM::m_status.

Referenced by BOARD_ITEM::IsLocked().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 200 of file eda_item.h.

200 { return m_status; }
STATUS_FLAGS m_status
Definition: eda_item.h:528

References EDA_ITEM::m_status.

◆ GetTextD_CodePrms() [1/2]

bool GERBER_DRAW_ITEM::GetTextD_CodePrms ( int &  aSize,
wxPoint &  aPos,
double &  aOrientation 
)

Return the best size and orientation to display the D_Code on screen.

Parameters
aSizeis a reference to return the text size
aPosis a reference to return the text position
aOrientationis a reference to return the text orientation
Returns
true if the parameters can be calculated, false for unknown D_Code

Definition at line 85 of file gerber_draw_item.cpp.

86 {
87  // calculate the best size and orientation of the D_Code text
88 
89  if( m_DCode <= 0 )
90  return false; // No D_Code for this item
91 
92  if( m_Flashed || m_Shape == GBR_ARC )
93  {
94  aPos = m_Start;
95  }
96  else // it is a line:
97  {
98  aPos = ( m_Start + m_End) / 2;
99  }
100 
101  aPos = GetABPosition( aPos );
102 
103  int size; // the best size for the text
104 
105  if( GetDcodeDescr() )
106  size = GetDcodeDescr()->GetShapeDim( this );
107  else
108  size = std::min( m_Size.x, m_Size.y );
109 
110  aOrientation = TEXT_ANGLE_HORIZ;
111 
112  if( m_Flashed )
113  {
114  // A reasonable size for text is min_dim/3 because most of time this text has 3 chars.
115  aSize = size / 3;
116  }
117  else // this item is a line
118  {
119  wxPoint delta = m_Start - m_End;
120 
121  aOrientation = RAD2DECIDEG( atan2( (double)delta.y, (double)delta.x ) );
122  NORMALIZE_ANGLE_90( aOrientation );
123 
124  // A reasonable size for text is size/2 because text needs margin below and above it.
125  // a margin = size/4 seems good, expecting the line len is large enough to show 3 chars,
126  // that is the case most of time.
127  aSize = size / 2;
128  }
129 
130  return true;
131 }
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Definition: eda_text.h:50
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
double RAD2DECIDEG(double rad)
Definition: trigo.h:236
void NORMALIZE_ANGLE_90(T &Angle)
Definition: trigo.h:369
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.
int GetShapeDim(GERBER_DRAW_ITEM *aParent)
Function GetShapeDim calculates a value that can be used to evaluate the size of text when displaying...
Definition: dcode.cpp:120

References GBR_ARC, GetABPosition(), GetDcodeDescr(), D_CODE::GetShapeDim(), m_DCode, m_End, m_Flashed, m_Shape, m_Size, m_Start, NORMALIZE_ANGLE_90(), RAD2DECIDEG(), and TEXT_ANGLE_HORIZ.

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), and GetTextD_CodePrms().

◆ GetTextD_CodePrms() [2/2]

bool GERBER_DRAW_ITEM::GetTextD_CodePrms ( double &  aSize,
VECTOR2D aPos,
double &  aOrientation 
)

Return the best size and orientation to display the D_Code in GAL aOrientation is returned in radians.

Definition at line 134 of file gerber_draw_item.cpp.

135 {
136  // aOrientation is returned in radians
137  int size;
138  wxPoint pos;
139 
140  if( ! GetTextD_CodePrms( size, pos, aOrientation ) )
141  return false;
142 
143  aPos = pos;
144  aSize = (double) size;
145  aOrientation = DECIDEG2RAD( aOrientation );
146 
147  return true;
148 }
bool GetTextD_CodePrms(int &aSize, wxPoint &aPos, double &aOrientation)
Return the best size and orientation to display the D_Code on screen.
double DECIDEG2RAD(double deg)
Definition: trigo.h:235

References DECIDEG2RAD(), and GetTextD_CodePrms().

◆ GetXYPosition()

wxPoint GERBER_DRAW_ITEM::GetXYPosition ( const wxPoint &  aABPosition) const

Return the image position of aPosition for this object.

Image position is the value of aPosition, modified by image parameters: offsets, axis selection, scale, rotation

Parameters
aABPosition= position in A,B plotter axis
Returns
The given position in X,Y axis.

Definition at line 181 of file gerber_draw_item.cpp.

182 {
183  // do the inverse transform made by GetABPosition
184  wxPoint xyPos = aABPosition;
185 
186  if( m_mirrorA )
187  xyPos.x = -xyPos.x;
188 
189  if( !m_mirrorB )
190  xyPos.y = -xyPos.y;
191 
192  double rotation = m_lyrRotation * 10 + m_GerberImageFile->m_ImageRotation * 10;
193 
194  if( rotation )
195  RotatePoint( &xyPos, rotation );
196 
197  xyPos.x = KiROUND( xyPos.x / m_drawScale.x );
198  xyPos.y = KiROUND( xyPos.y / m_drawScale.y );
200 
201  if( m_swapAxis )
202  std::swap( xyPos.x, xyPos.y );
203 
204  return xyPos - m_GerberImageFile->m_ImageJustifyOffset;
205 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:228
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
GERBER_FILE_IMAGE * m_GerberImageFile
int m_ImageRotation
Local rotation in degrees added to m_ImageRotation.
wxRealPoint m_drawScale

References KiROUND(), m_drawScale, m_GerberImageFile, GERBER_FILE_IMAGE::m_ImageJustifyOffset, GERBER_FILE_IMAGE::m_ImageOffset, GERBER_FILE_IMAGE::m_ImageRotation, m_layerOffset, m_lyrRotation, m_mirrorA, m_mirrorB, m_swapAxis, and RotatePoint().

Referenced by HitTest(), and MoveAB().

◆ HasFlag()

◆ HasNegativeItems()

bool GERBER_DRAW_ITEM::HasNegativeItems ( )

Optimize screen refresh (when no items are in background color refresh can be faster).

Returns
true if this item or at least one shape (when using aperture macros must be drawn in background color.

Definition at line 445 of file gerber_draw_item.cpp.

446 {
448 
449  // if isClear is true, this item has negative shape
450  return isClear;
451 }
GERBER_FILE_IMAGE * m_GerberImageFile

References m_GerberImageFile, GERBER_FILE_IMAGE::m_ImageNegative, and m_LayerNegative.

◆ HitTest() [1/2]

bool GERBER_DRAW_ITEM::HitTest ( const wxPoint &  aRefPos,
int  aAccuracy = 0 
) const
overridevirtual

Test if the given wxPoint is within the bounds of this object.

Parameters
aRefPosa wxPoint to test
Returns
bool - true if a hit, else false

Reimplemented from EDA_ITEM.

Definition at line 787 of file gerber_draw_item.cpp.

788 {
789  // In case the item has a very tiny width defined, allow it to be selected
790  const int MIN_HIT_TEST_RADIUS = Millimeter2iu( 0.01 );
791 
792  // calculate aRefPos in XY gerber axis:
793  wxPoint ref_pos = GetXYPosition( aRefPos );
794 
795  SHAPE_POLY_SET poly;
796 
797  switch( m_Shape )
798  {
799  case GBR_POLYGON:
800  poly = m_Polygon;
801  return poly.Contains( VECTOR2I( ref_pos ), 0, aAccuracy );
802 
803  case GBR_SPOT_POLY:
804  poly = GetDcodeDescr()->m_Polygon;
805  poly.Move( VECTOR2I( m_Start ) );
806  return poly.Contains( VECTOR2I( ref_pos ), 0, aAccuracy );
807 
808  case GBR_SPOT_RECT:
809  return GetBoundingBox().Contains( aRefPos );
810 
811  case GBR_SPOT_OVAL:
812  {
813  EDA_RECT bbox = GetBoundingBox();
814 
815  if( ! bbox.Contains( aRefPos ) )
816  return false;
817 
818  // This is similar to a segment with thickness = min( m_Size.x, m_Size.y )
819  int radius = std::min( m_Size.x, m_Size.y )/2;
820  wxPoint start, end;
821  if( m_Size.x > m_Size.y ) // Horizontal oval
822  {
823  int len = m_Size.y - m_Size.x;
824  start.x = -len/2;
825  end.x = len/2;
826  }
827  else // Vertical oval
828  {
829  int len = m_Size.x - m_Size.y;
830  start.y = -len/2;
831  end.y = len/2;
832  }
833  start += bbox.Centre();
834  end += bbox.Centre();
835 
836  if( radius < MIN_HIT_TEST_RADIUS )
837  radius = MIN_HIT_TEST_RADIUS;
838 
839  return TestSegmentHit( aRefPos, start, end, radius );
840  }
841 
842  case GBR_ARC:
843  {
844  double radius = GetLineLength( m_Start, m_ArcCentre );
845  VECTOR2D test_radius = VECTOR2D( ref_pos ) - VECTOR2D( m_ArcCentre );
846 
847  int size = ( ( m_Size.x < MIN_HIT_TEST_RADIUS ) ? MIN_HIT_TEST_RADIUS
848  : m_Size.x );
849 
850  // Are we close enough to the radius?
851  bool radius_hit = ( std::fabs( test_radius.EuclideanNorm() - radius) < size );
852 
853  if( radius_hit )
854  {
855  // Now check that we are within the arc angle
856 
857  VECTOR2D start = VECTOR2D( m_Start ) - VECTOR2D( m_ArcCentre );
859 
860  double start_angle = NormalizeAngleRadiansPos( start.Angle() );
861  double end_angle = NormalizeAngleRadiansPos( end.Angle() );
862 
863  if( m_Start == m_End )
864  {
865  start_angle = 0;
866  end_angle = 2 * M_PI;
867  }
868  else if( end_angle < start_angle )
869  {
870  end_angle += 2 * M_PI;
871  }
872 
873  double test_angle = NormalizeAngleRadiansPos( test_radius.Angle() );
874 
875  return ( test_angle > start_angle && test_angle < end_angle );
876  }
877 
878  return false;
879  }
880 
881  case GBR_SPOT_MACRO:
882  // Aperture macro polygons are already in absolute coordinates
883  auto p = GetDcodeDescr()->GetMacro()->GetApertureMacroShape( this, m_Start );
884  return p->Contains( VECTOR2I( aRefPos ), -1, aAccuracy );
885  }
886 
887  // TODO: a better analyze of the shape (perhaps create a D_CODE::HitTest for flashed items)
888  int radius = std::min( m_Size.x, m_Size.y ) >> 1;
889 
890  if( radius < MIN_HIT_TEST_RADIUS )
891  radius = MIN_HIT_TEST_RADIUS;
892 
893  if( m_Flashed )
894  return HitTestPoints( m_Start, ref_pos, radius );
895  else
896  return TestSegmentHit( ref_pos, m_Start, m_End, radius );
897 }
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, int aAccuracy=0, bool aUseBBoxCaches=false) const
Return true if a given subpolygon contains the point aP.
double NormalizeAngleRadiansPos(double Angle)
Definition: trigo.h:312
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
SHAPE_POLY_SET m_Polygon
bool Contains(const wxPoint &aPoint) const
Definition: eda_rect.cpp:57
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
Definition: trigo.cpp:129
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, wxPoint aShapePos)
Function GetApertureMacroShape Calculate the primitive shape for flashed items.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
void Move(const VECTOR2I &aVector) override
Represent a set of closed polygons.
double Angle() const
Compute the angle of the vector.
Definition: vector2d.h:307
bool HitTestPoints(const wxPoint &pointA, const wxPoint &pointB, double threshold)
Test, if two points are near each other.
Definition: trigo.h:186
Handle the component boundary box.
Definition: eda_rect.h:42
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:107
wxPoint Centre() const
Definition: eda_rect.h:60
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
Definition: vector2d.h:293
wxPoint GetXYPosition(const wxPoint &aABPosition) const
Return the image position of aPosition for this object.
static constexpr int Millimeter2iu(double mm)

References VECTOR2< T >::Angle(), EDA_RECT::Centre(), EDA_RECT::Contains(), SHAPE_POLY_SET::Contains(), VECTOR2< T >::EuclideanNorm(), GBR_ARC, GBR_POLYGON, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, APERTURE_MACRO::GetApertureMacroShape(), GetBoundingBox(), GetDcodeDescr(), GetLineLength(), D_CODE::GetMacro(), GetXYPosition(), HitTestPoints(), m_ArcCentre, m_End, m_Flashed, D_CODE::m_Polygon, m_Polygon, m_Shape, m_Size, m_Start, Millimeter2iu(), SHAPE_POLY_SET::Move(), NormalizeAngleRadiansPos(), and TestSegmentHit().

◆ HitTest() [2/2]

bool GERBER_DRAW_ITEM::HitTest ( const EDA_RECT aRefArea,
bool  aContained,
int  aAccuracy = 0 
) const
overridevirtual

Test if the given wxRect intersect this object.

For now, an ending point must be inside this rect.

Parameters
aRefAreaa wxPoint to test
Returns
true if a hit, else false

Reimplemented from EDA_ITEM.

Definition at line 900 of file gerber_draw_item.cpp.

901 {
902  wxPoint pos = GetABPosition( m_Start );
903 
904  if( aRefArea.Contains( pos ) )
905  return true;
906 
907  pos = GetABPosition( m_End );
908 
909  if( aRefArea.Contains( pos ) )
910  return true;
911 
912  return false;
913 }
bool Contains(const wxPoint &aPoint) const
Definition: eda_rect.cpp:57
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.

References EDA_RECT::Contains(), GetABPosition(), m_End, and m_Start.

◆ IsBrightened()

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 171 of file eda_item.h.

171 { return m_flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: eda_item.h:109
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_DRAGGED, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 174 of file eda_item.h.

174 { return m_flags & ENTERED; }
#define ENTERED
indicates a group has been entered
Definition: eda_item.h:138
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References ENTERED, and EDA_ITEM::m_flags.

Referenced by KIGFX::PCB_PAINTER::draw().

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 256 of file eda_item.h.

256 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:530

References EDA_ITEM::m_forceVisible.

Referenced by KIGFX::SCH_PAINTER::draw(), and SCH_FIELD::Print().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 168 of file eda_item.h.

168 { return m_flags & IS_CHANGED; }
#define IS_CHANGED
Item was edited, and modified.
Definition: eda_item.h:103
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_CHANGED, and EDA_ITEM::m_flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Override this method in any derived object that supports test find and replace.

Returns
True if the item has replaceable text that can be modified using the find and replace dialog.

Reimplemented in SCH_COMPONENT, SCH_LABEL, SCH_SHEET, SCH_TEXT, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 453 of file eda_item.h.

453 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 175 of file eda_item.h.

175 { return m_flags & IS_RESIZED; }
#define IS_RESIZED
Item being resized.
Definition: eda_item.h:108
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_RESIZED, and EDA_ITEM::m_flags.

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 173 of file eda_item.h.

173 { return m_flags & SELECTED; }
#define SELECTED
Definition: eda_item.h:114
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References EDA_ITEM::m_flags, and SELECTED.

Referenced by ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DS_PROXY_UNDO_ITEM::DS_PROXY_UNDO_ITEM(), KIGFX::DS_RENDER_SETTINGS::GetColor(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_PAINTER::getLineWidth(), KIGFX::SCH_PAINTER::getRenderColor(), KIGFX::SCH_PAINTER::getTextThickness(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::RebuildSelection(), EE_SELECTION_TOOL::RebuildSelection(), RENDER_3D_LEGACY::renderFootprint(), SCH_EDIT_TOOL::Rotate(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), GERBVIEW_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), GERBVIEW_SELECTION_TOOL::selectPoint(), KIGFX::SCH_PAINTER::setDeviceColors(), and GERBVIEW_SELECTION_TOOL::unselect().

◆ IsType()

virtual bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[]) const
inlinevirtualinherited

Check whether the item is one of the listed types.

Parameters
aScanTypesList of item types
Returns
true if the item type is contained in the list aScanTypes

Reimplemented in VIA, SCH_LABEL, DIMENSION_BASE, PAD, PCB_SHAPE, SCH_FIELD, FP_TEXT, SCH_LINE, FP_SHAPE, and PCB_TEXT.

Definition at line 233 of file eda_item.h.

234  {
235  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
236  return true;
237 
238  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
239  {
240  if( m_structType == *p )
241  return true;
242  }
243 
244  return false;
245  }
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:538

References EOT, EDA_ITEM::m_structType, and SCH_LOCATE_ANY_T.

Referenced by ROUTER_TOOL::CanInlineDrag(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), PCB_TEXT::IsType(), FP_SHAPE::IsType(), SCH_LINE::IsType(), FP_TEXT::IsType(), SCH_FIELD::IsType(), PCB_SHAPE::IsType(), PAD::IsType(), DIMENSION_BASE::IsType(), SCH_LABEL::IsType(), VIA::IsType(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), SCH_BASE_FRAME::UpdateItem(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 172 of file eda_item.h.

172 { return m_flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:111
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References IS_WIRE_IMAGE, and EDA_ITEM::m_flags.

◆ IterateForward() [1/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

This changes first parameter to avoid the DList and use the main queue instead.

Definition at line 345 of file eda_item.h.

349  {
350  for( auto it : aList )
351  {
352  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
354  return SEARCH_RESULT::QUIT;
355  }
356 
358  }
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...
Definition: eda_item.cpp:91

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit().

◆ IterateForward() [2/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

Change first parameter to avoid the DList and use std::vector instead.

Definition at line 364 of file eda_item.h.

366  {
367  for( auto it : aList )
368  {
369  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
371  return SEARCH_RESULT::QUIT;
372  }
373 
375  }
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...
Definition: eda_item.cpp:91

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( const wxFindReplaceData &  aSearchData,
void *  aAuxData 
) const
inlinevirtualinherited

Compare the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, ZONE, SCH_PIN, SCH_MARKER, PCB_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 415 of file eda_item.h.

416  {
417  return false;
418  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), PCB_TEXT::Matches(), FP_TEXT::Matches(), PCB_MARKER::Matches(), SCH_MARKER::Matches(), SCH_PIN::Matches(), ZONE::Matches(), SCH_SHEET_PIN::Matches(), SCH_FIELD::Matches(), SCH_TEXT::Matches(), SCH_EDITOR_CONTROL::ReplaceAndFindNext(), and SCH_EDITOR_CONTROL::UpdateFind().

◆ Matches() [2/2]

bool EDA_ITEM::Matches ( const wxString &  aText,
const wxFindReplaceData &  aSearchData 
) const
protectedinherited

Compare aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 116 of file eda_item.cpp.

117 {
118  wxString text = aText;
119  wxString searchText = aSearchData.GetFindString();
120 
121  // Don't match if searching for replaceable item and the item doesn't support text replace.
122  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
123  return false;
124 
125  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
126  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
127 
128  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
129  {
130  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
131  return text.Matches( searchText );
132 
133  return text.MakeUpper().Matches( searchText.MakeUpper() );
134  }
135 
136  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
137  return aText.Find( searchText ) != wxNOT_FOUND;
138 
139  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
140 }
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Definition: eda_item.h:453

References FR_MATCH_WILDCARD, FR_SEARCH_REPLACE, EDA_ITEM::IsReplaceable(), and text.

◆ MoveAB()

void GERBER_DRAW_ITEM::MoveAB ( const wxPoint &  aMoveVector)

Move this object.

Parameters
aMoveVectorthe move vector for this object.

Definition at line 423 of file gerber_draw_item.cpp.

424 {
425  wxPoint xymove = GetXYPosition( aMoveVector );
426 
427  m_Start += xymove;
428  m_End += xymove;
429  m_ArcCentre += xymove;
430 
431  m_Polygon.Move( VECTOR2I( xymove ) );
432 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
SHAPE_POLY_SET m_Polygon
void Move(const VECTOR2I &aVector) override
wxPoint GetXYPosition(const wxPoint &aABPosition) const
Return the image position of aPosition for this object.

References GetXYPosition(), m_ArcCentre, m_End, m_Polygon, m_Start, and SHAPE_POLY_SET::Move().

◆ MoveXY()

void GERBER_DRAW_ITEM::MoveXY ( const wxPoint &  aMoveVector)

Move this object.

Parameters
aMoveVectorthe move vector for this object, in XY gerber axis.

Definition at line 435 of file gerber_draw_item.cpp.

436 {
437  m_Start += aMoveVector;
438  m_End += aMoveVector;
439  m_ArcCentre += aMoveVector;
440 
441  m_Polygon.Move( VECTOR2I( aMoveVector ) );
442 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
SHAPE_POLY_SET m_Polygon
void Move(const VECTOR2I &aVector) override

References m_ArcCentre, m_End, m_Polygon, m_Start, and SHAPE_POLY_SET::Move().

Referenced by GERBER_FILE_IMAGE::StepAndRepeatItem().

◆ operator<()

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 169 of file eda_item.cpp.

170 {
171  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
172  GetClass() ) );
173 
174  return false;
175 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
virtual wxString GetClass() const =0
Return the class name.

References Format(), and EDA_ITEM::GetClass().

◆ Print()

void GERBER_DRAW_ITEM::Print ( wxDC *  aDC,
const wxPoint &  aOffset,
GBR_DISPLAY_OPTIONS aOptions 
)

Definition at line 454 of file gerber_draw_item.cpp.

455 {
456  // used when a D_CODE is not found. default D_CODE to draw a flashed item
457  static D_CODE dummyD_CODE( 0 );
458  bool isFilled;
459  int radius;
460  int halfPenWidth;
461  static bool show_err;
462  D_CODE* d_codeDescr = GetDcodeDescr();
463 
464  if( d_codeDescr == NULL )
465  d_codeDescr = &dummyD_CODE;
466 
468 
469  /* isDark is true if flash is positive and should use a drawing
470  * color other than the background color, else use the background color
471  * when drawing so that an erasure happens.
472  */
474 
475  if( !isDark )
476  {
477  // draw in background color ("negative" color)
478  color = aOptions->m_NegativeDrawColor;
479  }
480 
481  isFilled = aOptions->m_DisplayLinesFill;
482 
483  switch( m_Shape )
484  {
485  case GBR_POLYGON:
486  isFilled = aOptions->m_DisplayPolygonsFill;
487 
488  if( !isDark )
489  isFilled = true;
490 
491  PrintGerberPoly( aDC, color, aOffset, isFilled );
492  break;
493 
494  case GBR_CIRCLE:
495  radius = KiROUND( GetLineLength( m_Start, m_End ) );
496 
497  halfPenWidth = m_Size.x >> 1;
498 
499  if( !isFilled )
500  {
501  // draw the border of the pen's path using two circles, each as narrow as possible
502  GRCircle( nullptr, aDC, GetABPosition( m_Start ), radius - halfPenWidth, 0, color );
503  GRCircle( nullptr, aDC, GetABPosition( m_Start ), radius + halfPenWidth, 0, color );
504  }
505  else // Filled mode
506  {
507  GRCircle( nullptr, aDC, GetABPosition( m_Start ), radius, m_Size.x, color );
508  }
509  break;
510 
511  case GBR_ARC:
512  // Currently, arcs plotted with a rectangular aperture are not supported.
513  // a round pen only is expected.
514  if( !isFilled )
515  {
516  GRArc1( nullptr, aDC, GetABPosition( m_Start ), GetABPosition( m_End ),
518  }
519  else
520  {
521  GRArc1( nullptr, aDC, GetABPosition( m_Start ), GetABPosition( m_End ),
523  }
524 
525  break;
526 
527  case GBR_SPOT_CIRCLE:
528  case GBR_SPOT_RECT:
529  case GBR_SPOT_OVAL:
530  case GBR_SPOT_POLY:
531  case GBR_SPOT_MACRO:
532  isFilled = aOptions->m_DisplayFlashedItemsFill;
533  d_codeDescr->DrawFlashedShape( this, nullptr, aDC, color, m_Start, isFilled );
534  break;
535 
536  case GBR_SEGMENT:
537  /* Plot a line from m_Start to m_End.
538  * Usually, a round pen is used, but some gerber files use a rectangular pen
539  * In fact, any aperture can be used to plot a line.
540  * currently: only a square pen is handled (I believe using a polygon gives a strange plot).
541  */
542  if( d_codeDescr->m_Shape == APT_RECT )
543  {
544  if( m_Polygon.OutlineCount() == 0 )
546 
547  PrintGerberPoly( aDC, color, aOffset, isFilled );
548  }
549  else
550  {
551  if( !isFilled )
552  {
553  GRCSegm( nullptr, aDC, GetABPosition( m_Start ), GetABPosition( m_End ),
554  m_Size.x, color );
555  }
556  else
557  {
559  m_Size.x, color );
560  }
561  }
562 
563  break;
564 
565  default:
566  if( !show_err )
567  {
568  wxMessageBox( wxT( "Trace_Segment() type error" ) );
569  show_err = true;
570  }
571 
572  break;
573  }
574 }
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
int color
Definition: DXF_plotter.cpp:60
COLOR4D GetPositiveDrawColor() const
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, COLOR4D Color)
Definition: gr_basic.cpp:310
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:52
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
COLOR4D m_NegativeDrawColor
The color used to draw negative objects, usually the background color, but not always,...
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.
#define NULL
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
void ConvertSegmentToPolygon()
Convert a line to an equivalent polygon.
void PrintGerberPoly(wxDC *aDC, COLOR4D aColor, const wxPoint &aOffset, bool aFilledShape)
Print the polygon stored in m_PolyCorners.
D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void DrawFlashedShape(GERBER_DRAW_ITEM *aParent, EDA_RECT *aClipBox, wxDC *aDC, COLOR4D aColor, wxPoint aShapePos, bool aFilledShape)
Function DrawFlashedShape Draw the dcode shape for flashed items.
Definition: dcode.cpp:151
void GRFilledSegment(EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
Definition: gr_basic.cpp:421
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:594
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
GERBER_FILE_IMAGE * m_GerberImageFile
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, COLOR4D Color)
Definition: gr_basic.cpp:638
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References APT_RECT, color, ConvertSegmentToPolygon(), D_CODE::DrawFlashedShape(), GBR_ARC, GBR_CIRCLE, GBR_POLYGON, GBR_SEGMENT, GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, GetABPosition(), GetDcodeDescr(), GetLineLength(), GERBER_FILE_IMAGE::GetPositiveDrawColor(), GRArc1(), GRCircle(), GRCSegm(), GRFilledSegment(), KiROUND(), m_ArcCentre, GBR_DISPLAY_OPTIONS::m_DisplayFlashedItemsFill, GBR_DISPLAY_OPTIONS::m_DisplayLinesFill, GBR_DISPLAY_OPTIONS::m_DisplayPolygonsFill, m_End, m_GerberImageFile, GERBER_FILE_IMAGE::m_ImageNegative, m_LayerNegative, GBR_DISPLAY_OPTIONS::m_NegativeDrawColor, m_Polygon, D_CODE::m_Shape, m_Shape, m_Size, m_Start, NULL, SHAPE_POLY_SET::OutlineCount(), and PrintGerberPoly().

◆ PrintGerberPoly()

void GERBER_DRAW_ITEM::PrintGerberPoly ( wxDC *  aDC,
COLOR4D  aColor,
const wxPoint &  aOffset,
bool  aFilledShape 
)

Print the polygon stored in m_PolyCorners.

Definition at line 641 of file gerber_draw_item.cpp.

643 {
644  std::vector<wxPoint> points;
645  SHAPE_LINE_CHAIN& poly = m_Polygon.Outline( 0 );
646  int pointCount = poly.PointCount() - 1;
647 
648  points.reserve( pointCount );
649 
650  for( int ii = 0; ii < pointCount; ii++ )
651  {
652  wxPoint p( poly.CPoint( ii ).x, poly.CPoint( ii ).y );
653  points[ii] = p + aOffset;
654  points[ii] = GetABPosition( points[ii] );
655  }
656 
657  GRClosedPoly( nullptr, aDC, pointCount, &points[0], aFilledShape, aColor, aColor );
658 }
int PointCount() const
Function PointCount()
SHAPE_POLY_SET m_Polygon
const VECTOR2I & CPoint(int aIndex) const
Function Point()
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.
SHAPE_LINE_CHAIN & Outline(int aIndex)
SHAPE_LINE_CHAIN.
void GRClosedPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, COLOR4D Color, COLOR4D BgColor)
Draw a closed polygon onto the drawing context aDC and optionally fills and/or draws a border around ...
Definition: gr_basic.cpp:550

References SHAPE_LINE_CHAIN::CPoint(), GetABPosition(), GRClosedPoly(), m_Polygon, SHAPE_POLY_SET::Outline(), SHAPE_LINE_CHAIN::PointCount(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by Print().

◆ Replace() [1/2]

bool EDA_ITEM::Replace ( const wxFindReplaceData &  aSearchData,
wxString &  aText 
)
staticinherited

Perform a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 143 of file eda_item.cpp.

144 {
145  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
146 
147  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
148  aSearchData.GetFindString() :
149  aSearchData.GetFindString().Upper() );
150 
151  if( result == wxNOT_FOUND )
152  return false;
153 
154  wxString prefix = aText.Left( result );
155  wxString suffix;
156 
157  if( aSearchData.GetFindString().length() + result < aText.length() )
158  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
159 
160  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
161  aText, prefix, aSearchData.GetReplaceString(), suffix );
162 
163  aText = prefix + aSearchData.GetReplaceString() + suffix;
164 
165  return true;
166 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.

References traceFindReplace.

Referenced by SCH_FIELD::Replace(), EDA_TEXT::Replace(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Replace() [2/2]

virtual bool EDA_ITEM::Replace ( const wxFindReplaceData &  aSearchData,
void *  aAuxData = nullptr 
)
inlinevirtualinherited

Perform a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented in SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, and SCH_PIN.

Definition at line 442 of file eda_item.h.

443  {
444  return false;
445  }

◆ Set() [1/3]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 42 of file inspectable.h.

43  {
45  TYPE_ID thisType = TYPE_HASH( *this );
46  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
47 
48  if( object )
49  aProperty->setter( object, aValue );
50 
51  return object != nullptr;
52  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by isCoupledDiffPair().

◆ Set() [2/3]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 55 of file inspectable.h.

56  {
58  TYPE_ID thisType = TYPE_HASH( *this );
59  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
60 
61  if( object )
62  aProperty->set<T>( object, aValue );
63 
64  return object != nullptr;
65  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/3]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 68 of file inspectable.h.

69  {
71  TYPE_ID thisType = TYPE_HASH( *this );
72  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
73  void* object = nullptr;
74 
75  if( prop )
76  {
77  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
78 
79  if( object )
80  prop->set<T>( object, aValue );
81  }
82 
83  return object != nullptr;
84  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
#define TYPE_HASH(x)
Definition: property.h:59
size_t TYPE_ID
Unique type identifier.
Definition: property_mgr.h:42
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62
void set(void *aObject, T aValue)
Definition: property.h:261
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 203 of file eda_item.h.

203 { m_flags |= aMask; }
STATUS_FLAGS m_flags
Definition: eda_item.h:531

References EDA_ITEM::m_flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddFootprintToBoard(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SCH_MOVE_TOOL::AlignElements(), PCB_CONTROL::AppendBoard(), FOOTPRINT::BuildPolyCourtyards(), SCH_EDIT_TOOL::ChangeTextType(), GRAPHICS_CLEANER::cleanupSegments(), ConvertOutlineToPolygon(), SCH_EDIT_FRAME::ConvertPart(), SCH_DRAWING_TOOLS::createNewText(), SCH_DRAWING_TOOLS::createSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), PCB_SELECTION_TOOL::EnterGroup(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), SCH_MOVE_TOOL::getConnectedDragItems(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), EE_SELECTION_TOOL::Main(), TRACKS_CLEANER::mergeCollinearSegments(), SYMBOL_EDITOR_MOVE_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), EE_SELECTION_TOOL::narrowSelection(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), SCH_ALTIUM_PLUGIN::ParseBezier(), SCH_ALTIUM_PLUGIN::ParseBus(), SCH_ALTIUM_PLUGIN::ParseBusEntry(), SCH_ALTIUM_PLUGIN::ParseJunction(), SCH_ALTIUM_PLUGIN::ParseLine(), SCH_ALTIUM_PLUGIN::ParseNetLabel(), SCH_ALTIUM_PLUGIN::ParseNoERC(), SCH_ALTIUM_PLUGIN::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_ALTIUM_PLUGIN::ParseSheetSymbol(), SCH_ALTIUM_PLUGIN::ParseWire(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), DRAWING_TOOL::PlaceText(), BACK_ANNOTATE::processNetNameChange(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_SELECTION_TOOL::RebuildSelection(), FOOTPRINT::Remove(), BOARD::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), DS_DATA_ITEM::SyncDrawItems(), DS_DATA_ITEM_BITMAP::SyncDrawItems(), DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Set and clear force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 254 of file eda_item.h.

254 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: eda_item.h:530

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDITOR_CONTROL::UpdateFind().

◆ SetLayerParameters()

void GERBER_DRAW_ITEM::SetLayerParameters ( )

Initialize parameters from Image and Layer parameters found in the gerber file: m_UnitsMetric, m_MirrorA, m_MirrorB, m_DrawScale, m_DrawOffset.

Definition at line 208 of file gerber_draw_item.cpp.

209 {
211  m_swapAxis = m_GerberImageFile->m_SwapAxis; // false if A = X, B = Y;
212 
213  // true if A =Y, B = Y
214  m_mirrorA = m_GerberImageFile->m_MirrorA; // true: mirror / axe A
215  m_mirrorB = m_GerberImageFile->m_MirrorB; // true: mirror / axe B
216  m_drawScale = m_GerberImageFile->m_Scale; // A and B scaling factor
217  m_layerOffset = m_GerberImageFile->m_Offset; // Offset from OF command
218 
219  // Rotation from RO command:
222 }
GERBER_FILE_IMAGE * m_GerberImageFile
GERBER_LAYER & GetLayerParams()
wxRealPoint m_drawScale

References GERBER_FILE_IMAGE::GetLayerParams(), m_drawScale, m_GerberImageFile, GERBER_FILE_IMAGE::m_GerbMetric, GERBER_LAYER::m_LayerNegative, m_LayerNegative, m_layerOffset, GERBER_FILE_IMAGE::m_LocalRotation, m_lyrRotation, m_mirrorA, GERBER_FILE_IMAGE::m_MirrorA, m_mirrorB, GERBER_FILE_IMAGE::m_MirrorB, GERBER_FILE_IMAGE::m_Offset, GERBER_FILE_IMAGE::m_Scale, m_swapAxis, GERBER_FILE_IMAGE::m_SwapAxis, and m_UnitsMetric.

Referenced by GERBER_DRAW_ITEM().

◆ SetLayerPolarity()

void GERBER_DRAW_ITEM::SetLayerPolarity ( bool  aNegative)
inline

Definition at line 117 of file gerber_draw_item.h.

118  {
119  m_LayerNegative = aNegative;
120  }

References m_LayerNegative.

Referenced by fillArcGBRITEM(), fillArcPOLY(), fillFlashedGBRITEM(), and fillLineGBRITEM().

◆ SetModified()

void EDA_ITEM::SetModified ( )
inherited

◆ SetNetAttributes()

void GERBER_DRAW_ITEM::SetNetAttributes ( const GBR_NETLIST_METADATA aNetAttributes)

Definition at line 65 of file gerber_draw_item.cpp.

66 {
67  m_netAttributes = aNetAttributes;
68 
71  m_GerberImageFile->m_ComponentsList.insert( std::make_pair( m_netAttributes.m_Cmpref, 0 ) );
72 
74  m_GerberImageFile->m_NetnamesList.insert( std::make_pair( m_netAttributes.m_Netname, 0 ) );
75 }
print info associated to a component (TO.C attribute)
wxString m_Cmpref
the component reference parent of the data
GBR_NETLIST_METADATA m_netAttributes
the string given by a TO attribute set in aperture (dcode).
wxString m_Netname
for items associated to a net: the netname
std::map< wxString, int > m_NetnamesList
print info associated to a flashed pad (TO.P attribute)
print info associated to a net (TO.N attribute)
GERBER_FILE_IMAGE * m_GerberImageFile
std::map< wxString, int > m_ComponentsList
int m_NetAttribType
the type of net info (used to define the gerber string to create)

References GBR_NETLIST_METADATA::GBR_NETINFO_CMP, GBR_NETLIST_METADATA::GBR_NETINFO_NET, GBR_NETLIST_METADATA::GBR_NETINFO_PAD, GBR_NETLIST_METADATA::m_Cmpref, GERBER_FILE_IMAGE::m_ComponentsList, m_GerberImageFile, GBR_NETLIST_METADATA::m_NetAttribType, m_netAttributes, GBR_NETLIST_METADATA::m_Netname, and GERBER_FILE_IMAGE::m_NetnamesList.

Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command(), fillArcGBRITEM(), fillArcPOLY(), fillFlashedGBRITEM(), and fillLineGBRITEM().

◆ SetParent()

virtual void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlinevirtualinherited

Reimplemented in DIMENSION_BASE.

Definition at line 166 of file eda_item.h.

166 { m_parent = aParent; }
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:529

References EDA_ITEM::m_parent.

Referenced by FOOTPRINT::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewComponent(), SCH_SHEET::AddPin(), PAD::AddPrimitive(), PAD::AddPrimitiveArc(), PAD::AddPrimitiveCircle(), PAD::AddPrimitiveCurve(), PAD::AddPrimitivePoly(), PAD::AddPrimitiveRect(), PAD::AddPrimitiveSegment(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SCH_SCREEN::Append(), LIB_FIELD::Copy(), SYMBOL_EDIT_FRAME::CreateNewPart(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), SCH_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_PART::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), LIB_PART::LIB_PART(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), FOOTPRINT::operator=(), LIB_PART::operator=(), PCB_PARSER::parseFOOTPRINT_unchecked(), SCH_SEXPR_PARSER::ParseSchematic(), SCH_SEXPR_PARSER::ParseSymbol(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PCB_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), pasteFootprintItemsToFootprintEditor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BACK_ANNOTATE::processNetNameChange(), BOARD_COMMIT::Push(), SCH_SEXPR_PLUGIN_CACHE::removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::removeSymbol(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET_PIN::SCH_SHEET_PIN(), LIB_PART::SetFields(), DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_SHEET::SwapData(), SCH_GLOBALLABEL::SwapData(), SCH_COMPONENT::SwapData(), and SwapItemData().

◆ SetPosition()

void GERBER_DRAW_ITEM::SetPosition ( const wxPoint &  aPos)
inlineoverridevirtual

Reimplemented from EDA_ITEM.

Definition at line 144 of file gerber_draw_item.h.

144 { m_Start = aPos; }

References m_Start.

◆ SetSelected()

◆ SetState()

void EDA_ITEM::SetState ( int  type,
bool  state 
)
inlineinherited

Definition at line 192 of file eda_item.h.

193  {
194  if( state )
195  m_status |= type; // state = ON or OFF
196  else
197  m_status &= ~type;
198  }
STATUS_FLAGS m_status
Definition: eda_item.h:528

References EDA_ITEM::m_status.

Referenced by LEGACY_PLUGIN::loadTrackList(), TRACKS_CLEANER::mergeCollinearSegments(), and BOARD_ITEM::SetLocked().

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 201 of file eda_item.h.

201 { m_status = aStatus; }
STATUS_FLAGS m_status
Definition: eda_item.h:528

References EDA_ITEM::m_status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 178 of file eda_item.h.

178 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: eda_item.h:203
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: eda_item.h:111

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ Shape()

int GERBER_DRAW_ITEM::Shape ( ) const
inline

Definition at line 197 of file gerber_draw_item.h.

197 { return m_Shape; }

References m_Shape.

◆ ShowGBRShape()

wxString GERBER_DRAW_ITEM::ShowGBRShape ( ) const

Definition at line 225 of file gerber_draw_item.cpp.

226 {
227  switch( m_Shape )
228  {
229  case GBR_SEGMENT:
230  return _( "Line" );
231 
232  case GBR_ARC:
233  return _( "Arc" );
234 
235  case GBR_CIRCLE:
236  return _( "Circle" );
237 
238  case GBR_SPOT_OVAL:
239  return wxT( "spot_oval" );
240 
241  case GBR_SPOT_CIRCLE:
242  return wxT( "spot_circle" );
243 
244  case GBR_SPOT_RECT:
245  return wxT( "spot_rect" );
246 
247  case GBR_SPOT_POLY:
248  return wxT( "spot_poly" );
249 
250  case GBR_POLYGON:
251  return wxT( "polygon" );
252 
253  case GBR_SPOT_MACRO:
254  {
255  wxString name = wxT( "apt_macro" );
256  D_CODE* dcode = GetDcodeDescr();
257 
258  if( dcode && dcode->GetMacro() )
259  name << wxT(" ") << dcode->GetMacro()->name;
260 
261  return name;
262  }
263 
264  default:
265  return wxT( "??" );
266  }
267 }
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
wxString name
The name of the aperture macro.
Definition: am_primitive.h:164
D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
const char * name
Definition: DXF_plotter.cpp:59
#define _(s)
Definition: 3d_actions.cpp:33
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157

References _, GBR_ARC, GBR_CIRCLE, GBR_POLYGON, GBR_SEGMENT, GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, GetDcodeDescr(), D_CODE::GetMacro(), m_Shape, name, and APERTURE_MACRO::name.

Referenced by GetMsgPanelInfo(), and GetSelectMenuText().

◆ Sort()

static bool EDA_ITEM::Sort ( const EDA_ITEM aLeft,
const EDA_ITEM aRight 
)
inlinestaticinherited

Helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers.

Parameters
aLeftThe left hand item to compare.
aRightThe right hand item to compare.
Returns
True if aLeft is less than aRight.

Definition at line 471 of file eda_item.h.

471 { return *aLeft < *aRight; }

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Returns the type of object.

This attribute should never be changed after a ctor sets it, so there is no public "setter" method.

Returns
the type of object.

Definition at line 163 of file eda_item.h.

163 { return m_structType; }
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
Definition: eda_item.h:538

References EDA_ITEM::m_structType.

Referenced by KIGFX::PCB_VIEW::Add(), FOOTPRINT::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_POINT_EDITOR::addCorner(), CONNECTION_SUBGRAPH::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_LINE_WIRE_BUS_TOOL::AddJunctionsIfNeeded(), ZONE_FILLER::addKnockout(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), SCH_SCREEN::Append(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PNS::TOPOLOGY::AssembleTuningPath(), CONNECTION_GRAPH::buildConnectionGraph(), DIALOG_NET_INSPECTOR::buildNewItem(), SCH_SCREENS::buildScreenList(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PCB_POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_SHEET::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_COMPONENT::CanConnect(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_PIN::ClassOf(), PCB_TEXT::ClassOf(), PCB_MARKER::ClassOf(), SCH_NO_CONNECT::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), FP_SHAPE::ClassOf(), SCH_LINE::ClassOf(), PCB_GROUP::ClassOf(), PCB_TARGET::ClassOf(), SCH_FIELD::ClassOf(), FP_TEXT::ClassOf(), SCH_SHEET::ClassOf(), NETINFO_ITEM::ClassOf(), PCB_SHAPE::ClassOf(), SCH_SHEET_PIN::ClassOf(), ZONE::ClassOf(), SCH_BITMAP::ClassOf(), PAD::ClassOf(), TRACK::ClassOf(), SCH_COMPONENT::ClassOf(), SCH_SCREEN::ClassOf(), FOOTPRINT::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_TEXT::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), BOARD::ClassOf(), ARC::ClassOf(), SCH_LABEL::ClassOf(), VIA::ClassOf(), ALIGNED_DIMENSION::ClassOf(), SCH_GLOBALLABEL::ClassOf(), ORTHOGONAL_DIMENSION::ClassOf(), LEADER::ClassOf(), SCH_HIERLABEL::ClassOf(), CENTER_DIMENSION::ClassOf(), TRACKS_CLEANER::cleanup(), LIB_BEZIER::compare(), LIB_RECTANGLE::compare(), LIB_CIRCLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_ITEM::compare(), LIB_PART::Compare(), EE_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), EE_RTREE::contains(), BOARD::ConvertKIIDsToCrossReferences(), SCHEMATIC::ConvertKIIDsToRefs(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), FOOTPRINT::CoverageRatio(), BOARD_ADAPTER::createLayers(), PCB_BASE_FRAME::CreateNewFootprint(), SCH_DRAWING_TOOLS::createNewText(), ZONE_CREATE_HELPER::createNewZone(), BOARD_ADAPTER::createTrack(), SCH_SCREEN::DeleteItem(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally(), ALIGN_DISTRIBUTE_TOOL::DistributeVertically(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDIT_TOOL::DoDelete(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), APPEARANCE_CONTROLS::doesBoardItemNeedRebuild(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::DragArcTrack(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawVia(), CONNECTION_SUBGRAPH::driverName(), CN_ITEM::Dump(), EDIT_TOOL::Duplicate(), FOOTPRINT::DuplicateItem(), EDA_ITEM_DESC::EDA_ITEM_DESC(), SCH_EDIT_TOOL::EditField(), SCH_EDIT_TOOL::editFieldText(), SYMBOL_EDITOR_EDIT_TOOL::editTextProperties(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), CONNECTION_GRAPH::ercCheckFloatingWires(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), CONNECTION_GRAPH::ercCheckNoConnects(), DRC_ENGINE::EvalRules(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), NETLIST_EXPORTER_BASE::findNextSymbol(), CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment(), PCB_BASE_FRAME::FocusOnItem(), EDIT_TOOL::FootprintFilter(), SCH_SEXPR_PLUGIN::Format(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), FP_TEXT::FP_TEXT(), PCB_POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), SCH_FIELD::GetBoundingBox(), TRACK::GetBoundingBox(), SCH_FIELD::GetCanonicalName(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetContextualTextVars(), FOOTPRINT::GetCoverageArea(), CONNECTION_GRAPH::getDefaultConnection(), getDrilledHoleShape(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_FIELD::GetMenuImage(), TRACK::GetMsgPanelInfo(), DIMENSION_BASE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), PCB_SHAPE::GetParentFootprint(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), KIGFX::SCH_PAINTER::getRenderColor(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), TRACK::GetSelectMenuText(), DRC_ENGINE::GetShape(), PCB_TEXT::GetShownText(), SCH_FIELD::GetShownText(), SCH_TEXT::GetShownText(), CONVERT_TOOL::getStartEndPoints(), getTopLevelGroup(), GROUP_TOOL::Group(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), EE_SELECTION_TOOL::GuessSelectionCandidates(), hash_fp_item(), EE_SELECTION_TOOL::highlight(), PCB_SELECTION_TOOL::highlightInternal(), BOARD_INSPECTION_TOOL::HighlightItem(), BOARD_INSPECTION_TOOL::highlightNet(), highlightNet(), PCB_SELECTION_TOOL::hitTestDistance(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_RTREE::insert(), DRC_RTREE::Insert(), insideArea(), insideBackCourtyard(), insideCourtyard(), insideFootprintCourtyard(), insideFrontCourtyard(), EE_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), ARRAY_CREATOR::Invoke(), isCopper(), CN_ANCHOR::IsDangling(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus(), PNS_KICAD_IFACE::IsFlashedOnLayer(), CADSTAR_PCB_ARCHIVE_LOADER::isFootprint(), SCH_FIELD::IsHypertext(), isKeepoutZone(), DRC_ENGINE::IsNetTie(), TRACK::IsNull(), SCH_LINE::IsParallel(), isPlated(), SCH_FIELD::IsReplaceable(), PNS::ROUTER::isStartingPointRoutable(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), PCB_SELECTION_TOOL::itemPassesFilter(), CONVERT_TOOL::LinesToPoly(), CLIPBOARD_IO::Load(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), CADSTAR_SCH_ARCHIVE_LOADER::loadHierarchicalSheetPins(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), EE_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeListOfNets(), PCB_POINT_EDITOR::makePoints(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), SCH_FIELD::Matches(), memberOf(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), SCH_MOVE_TOOL::moveItem(), SCH_EDITOR_CONTROL::nextMatch(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), EDA_3D_CANVAS::OnMouseMove(), TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), BOARD_ITEM::ptr_cmp::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), SCH_BUS_ENTRY_BASE::operator<(), SCH_JUNCTION::operator<(), SCH_FIELD::operator<(), SCH_LINE::operator<(), SCH_TEXT::operator<(), SCH_SHEET::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), PAD::PAD(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), PCB_CONTROL::Paste(), SCH_EDITOR_CONTROL::Paste(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), SCH_SCREEN::Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItem(), CONVERT_TOOL::PolyToLines(), POSITION_RELATIVE_TOOL::PositionRelative(), SCH_FIELD::Print(), SCH_SCREEN::Print(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), BACK_ANNOTATE::processNetNameChange(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), PCB_GRID_HELPER::queryVisible(), SCH_CONNECTION::recacheName(), SCH_BASE_FRAME::RefreshSelection(), KIGFX::PCB_VIEW::Remove(), EE_RTREE::remove(), FOOTPRINT::Remove(), CN_CONNECTIVITY_ALGO::Remove(), SCH_SCREEN::Remove(), BOARD::Remove(), PCB_POINT_EDITOR::removeCorner(), PCB_POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), SCH_SHEET::RemovePin(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_FIELD::Replace(), PCB_SELECTION_TOOL::RequestSelection(), SCHEMATIC::ResolveCrossReference(), PCB_PARSER::resolveGroups(), DS_PROXY_UNDO_ITEM::Restore(), PL_EDITOR_FRAME::RollbackFromUndo(), SCH_EDIT_TOOL::Rotate(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), SCH_SEXPR_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_SEXPR_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_SEXPR_PLUGIN_CACHE::saveCircle(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_SEXPR_PLUGIN::saveField(), SCH_SEXPR_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_SEXPR_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_SEXPR_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_SEXPR_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), CLIPBOARD_IO::SaveSelection(), SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN_CACHE::saveText(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_SCREEN::Schematic(), SCH_ITEM::Schematic(), CONVERT_TOOL::SegmentToArc(), PCB_SELECTION_TOOL::select(), PCB_SELECTION_TOOL::Selectable(), EE_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectConnectedTracks(), SCH_FIELD::SetId(), ITEM_PICKER::SetItem(), SCH_FIELD::SetPosition(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), BOARD_COMMIT::Stage(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_FIELD::SwapData(), PCB_TEXT::SwapData(), PCB_GROUP::SwapData(), TRACK::SwapData(), SCH_SHEET::SwapData(), ARC::SwapData(), ALIGNED_DIMENSION::SwapData(), ORTHOGONAL_DIMENSION::SwapData(), SCH_COMPONENT::SwapData(), LEADER::SwapData(), VIA::SwapData(), CENTER_DIMENSION::SwapData(), FOOTPRINT::SwapData(), PAD::SwapData(), ZONE::SwapData(), SwapItemData(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), ERC_TESTER::TestMultUnitPinConflicts(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), ERC_TESTER::TestPinToPin(), ERC_TESTER::TestSimilarLabels(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), CONNECTIVITY_DATA::TestTrackEndpointDangling(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PCB_SELECTION_TOOL::unhighlightInternal(), KIGFX::PCB_VIEW::Update(), SCH_TEXT::UpdateDanglingState(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_BASE_FRAME::UpdateItem(), CONNECTION_GRAPH::updateItemConnectivity(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updateParentItem(), SCH_EDITOR_CONTROL::updatePastedSheet(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), PCB_GROUP::Visit(), TRACK::Visit(), Visit(), SCH_SHEET::Visit(), SCH_GLOBALLABEL::Visit(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), and NETLIST_EXPORTER_CADSTAR::writeListOfNets().

◆ ViewBBox()

const BOX2I GERBER_DRAW_ITEM::ViewBBox ( ) const
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 946 of file gerber_draw_item.cpp.

947 {
948  EDA_RECT bbox = GetBoundingBox();
949  return BOX2I( VECTOR2I( bbox.GetOrigin() ),
950  VECTOR2I( bbox.GetSize() ) );
951 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
const wxPoint GetOrigin() const
Definition: eda_rect.h:106
Handle the component boundary box.
Definition: eda_rect.h:42
const wxSize GetSize() const
Definition: eda_rect.h:96

References GetBoundingBox(), EDA_RECT::GetOrigin(), and EDA_RECT::GetSize().

Referenced by KIGFX::GERBVIEW_PAINTER::draw().

◆ ViewDraw()

virtual void KIGFX::VIEW_ITEM::ViewDraw ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Draw the parts of the object belonging to layer aLayer.

An alternative way for drawing objects if there is no #PAINTER assigned for the view or if the PAINTER doesn't know how to paint this particular implementation of VIEW_ITEM. The preferred way of drawing is to design an appropriate PAINTER object, the method below is intended only for quick hacks and debugging purposes.

Parameters
aLayeris the current drawing layer.
aViewis a pointer to the VIEW device we are drawing on.

Reimplemented in EDIT_POINTS, DS_PROXY_VIEW_ITEM, ROUTER_PREVIEW_ITEM, KIGFX::VIEW_GROUP, KIGFX::PREVIEW::SELECTION_AREA, MY_DRAWING, KIGFX::VIEW_OVERLAY, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::PREVIEW::TWO_POINT_ASSISTANT, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, KIGFX::PREVIEW::RULER_ITEM, and RATSNEST_VIEW_ITEM.

Definition at line 111 of file view_item.h.

112  {}

Referenced by KIGFX::VIEW::draw(), and KIGFX::VIEW::updateItemGeometry().

◆ ViewGetLayers()

void GERBER_DRAW_ITEM::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 937 of file gerber_draw_item.cpp.

938 {
939  aCount = 2;
940 
941  aLayers[0] = GERBER_DRAW_LAYER( GetLayer() );
942  aLayers[1] = GERBER_DCODE_LAYER( aLayers[0] );
943 }
int GetLayer() const
Return the layer this item is on.
#define GERBER_DCODE_LAYER(x)
#define GERBER_DRAW_LAYER(x)

References GERBER_DCODE_LAYER, GERBER_DRAW_LAYER, and GetLayer().

◆ ViewGetLOD()

double GERBER_DRAW_ITEM::ViewGetLOD ( int  aLayer,
KIGFX::VIEW aView 
) const
overridevirtual

May be re-implemented for each derived class in order to handle all the types given by its member data. Implementations should call inspector->Inspect() on types in scanTypes[], and may use IterateForward() to do so on lists of such data.

Parameters
inspectorAn INSPECTOR instance to use in the inspection.
testDataArbitrary data used by the inspector.
scanTypesWhich# KICAD_T types are of interest and the order is significant too, terminated by EOT.
Returns
SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, else #SCAN_CONTINUE, and determined by the inspector.

Reimplemented from KIGFX::VIEW_ITEM.

Definition at line 954 of file gerber_draw_item.cpp.

955 {
956  // DCodes will be shown only if zoom is appropriate:
957  // Returns the level of detail of the item.
958  // A level of detail (LOD) is the minimal VIEW scale that
959  // is sufficient for an item to be shown on a given layer.
960  if( IsDCodeLayer( aLayer ) )
961  {
962  int size = 0;
963 
964  switch( m_Shape )
965  {
966  case GBR_SPOT_MACRO:
968  break;
969 
970  case GBR_ARC:
971  size = GetLineLength( m_Start, m_ArcCentre );
972  break;
973 
974  default:
975  size = m_Size.x;
976  }
977 
978  // the level of details is chosen experimentally, to show
979  // only a readable text:
980  double level = (double)Millimeter2iu( 3 );
981  return level / ( size + 1 );
982  }
983 
984  // Other layers are shown without any conditions
985  return 0.0;
986 }
D_CODE * GetDcodeDescr() const
Return the GetDcodeDescr of this object, or NULL.
bool IsDCodeLayer(int aLayer)
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:223
int GetWidth() const
Definition: eda_rect.h:114
EDA_RECT GetBoundingBox() const
Returns the bounding box of the shape.
Definition: am_primitive.h:230
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157
static constexpr int Millimeter2iu(double mm)

References GBR_ARC, GBR_SPOT_MACRO, APERTURE_MACRO::GetBoundingBox(), GetDcodeDescr(), GetLineLength(), D_CODE::GetMacro(), EDA_RECT::GetWidth(), IsDCodeLayer(), m_ArcCentre, m_Shape, m_Size, m_Start, and Millimeter2iu().

◆ viewPrivData()

◆ Visit()

SEARCH_RESULT GERBER_DRAW_ITEM::Visit ( INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
overridevirtual

Return the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position.

The default version of this function raises an assertion in the debug mode and returns a string to indicate that it was not overridden to provide the object specific text.

Returns
The menu text string.

Reimplemented from EDA_ITEM.

Definition at line 989 of file gerber_draw_item.cpp.

990 {
991  KICAD_T stype = *scanTypes;
992 
993  // If caller wants to inspect my type
994  if( stype == Type() )
995  {
996  if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
997  return SEARCH_RESULT::QUIT;
998  }
999 
1000  return SEARCH_RESULT::CONTINUE;
1001 }
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163

References CONTINUE, QUIT, and EDA_ITEM::Type().

Member Data Documentation

◆ m_AperFunction

wxString GERBER_DRAW_ITEM::m_AperFunction

◆ m_ArcCentre

◆ m_DCode

◆ m_drawScale

wxRealPoint GERBER_DRAW_ITEM::m_drawScale
private

◆ m_End

◆ m_flags

◆ m_Flashed

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

◆ m_GerberImageFile

◆ m_LayerNegative

bool GERBER_DRAW_ITEM::m_LayerNegative
private

◆ m_layerOffset

wxPoint GERBER_DRAW_ITEM::m_layerOffset
private

Definition at line 289 of file gerber_draw_item.h.

Referenced by GetABPosition(), GetXYPosition(), and SetLayerParameters().

◆ m_lyrRotation

double GERBER_DRAW_ITEM::m_lyrRotation
private

◆ m_mirrorA

bool GERBER_DRAW_ITEM::m_mirrorA
private

◆ m_mirrorB

bool GERBER_DRAW_ITEM::m_mirrorB
private

◆ m_netAttributes

GBR_NETLIST_METADATA GERBER_DRAW_ITEM::m_netAttributes
private

the string given by a TO attribute set in aperture (dcode).

Stored in each item, because TO is a dynamic object attribute

Definition at line 291 of file gerber_draw_item.h.

Referenced by GetMsgPanelInfo(), GetNetAttributes(), and SetNetAttributes().

◆ m_parent

◆ m_Polygon

◆ m_Shape

◆ m_Size

◆ m_Start

◆ m_status

STATUS_FLAGS EDA_ITEM::m_status
protectedinherited

◆ m_swapAxis

bool GERBER_DRAW_ITEM::m_swapAxis
private

◆ m_UnitsMetric

bool GERBER_DRAW_ITEM::m_UnitsMetric

Definition at line 251 of file gerber_draw_item.h.

Referenced by GERBER_DRAW_ITEM(), and SetLayerParameters().

◆ m_Uuid

const KIID EDA_ITEM::m_Uuid
inherited

Definition at line 525 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddHierarchicalReference(), RC_ITEM::AddItem(), SCH_EDIT_FRAME::AnnotateSymbols(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), SCH_SHEET_PATH::Cmp(), SCHEMATIC::ConvertRefsToKIIDs(), MICROWAVE_TOOL::createMicrowaveInductor(), DRAWING_TOOL::DrawVia(), LIB_PART::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), FOOTPRINT::Duplicate(), FOOTPRINT::DuplicateItem(), PCB_EDIT_FRAME::ExchangeFootprint(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportNetlist(), BOARD::FillItemMap(), SCH_SHEET_LIST::FillItemMap(), PCB_BASE_FRAME::FocusOnItem(), SCH_EDIT_FRAME::FocusOnItem(), PCB_IO::format(), FormatProbeItem(), SCH_PIN::GetDefaultNetName(), BOARD::GetItem(), SCH_SHEET_LIST::GetItem(), PAD::GetMsgPanelInfo(), DIALOG_BOARD_REANNOTATE::GetNewRefDes(), FP_TEXT::GetParentAsString(), PAD::GetParentAsString(), FP_SHAPE::GetParentAsString(), SCH_REFERENCE::GetPath(), SCH_MARKER::GetUUID(), PCB_MARKER::GetUUID(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), SCH_SHEET_PATH::IsContainedWithin(), LEGACY_PLUGIN::loadFOOTPRINT(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), SCH_LEGACY_PLUGIN::loadSymbol(), LEGACY_PLUGIN::loadTrackList(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), TRACK::cmp_tracks::operator()(), BOARD_ITEM::ptr_cmp::operator()(), PCB_SHAPE::cmp_drawings::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), PAD::PAD(), SCH_SEXPR_PARSER::parseSchSheetInstances(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_COMPONENT::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SEXPR_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_EDIT_FRAME::SaveProject(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_COMPONENT::SCH_COMPONENT(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), RC_ITEM::SetItems(), SwapItemData(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), testGroupEqual(), SCH_EDITOR_CONTROL::updatePastedSheet(), SCH_EDITOR_CONTROL::updatePastedSymbol(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().


The documentation for this class was generated from the following files: