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, const 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 (EDA_ITEM_FLAGS type) const
 
void SetState (EDA_ITEM_FLAGS type, bool state)
 
EDA_ITEM_FLAGS GetStatus () const
 
void SetStatus (EDA_ITEM_FLAGS aStatus)
 
void SetFlags (EDA_ITEM_FLAGS aMask)
 
void ClearFlags (EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
EDA_ITEM_FLAGS GetFlags () const
 
bool HasFlag (EDA_ITEM_FLAGS aFlag) const
 
EDA_ITEM_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

EDA_ITEM_FLAGS m_status
 
EDA_ITEMm_parent
 Linked list: Link (parent struct) More...
 
bool m_forceVisible
 
EDA_ITEM_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  :
41  EDA_ITEM( nullptr, GERBER_DRAW_ITEM_T )
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,...
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: eda_item.cpp:37
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 ( EDA_ITEM_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 154 of file eda_item.h.

154 { m_flags &= ~aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481

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 166 of file eda_item.h.

167  {
169  DO_NOT_DRAW );
170  }
#define DO_NOT_DRAW
Used to disable draw function.
#define STARTPOINT
When a line is selected, these flags indicate which.
#define ENDPOINT
ends. (Used to support dragging.)
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
#define CANDIDATE
flag indicating that the structure is connected
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:154
#define SKIP_STRUCT
flag indicating that the structure should be ignored
#define TEMP_SELECTED
flag indicating that the structure has already selected

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_SYMBOL, PAD, FOOTPRINT, PCB_DIM_CENTER, PCB_DIM_LEADER, SCH_HIERLABEL, PCB_DIM_ORTHOGONAL, PCB_VIA, SCH_SHEET, PCB_DIM_ALIGNED, SCH_GLOBALLABEL, PCB_SHAPE, SCH_LABEL, PCB_ARC, SCH_TEXT, SCH_LINE, LIB_PIN, FP_TEXT, SCH_BUS_BUS_ENTRY, PCB_TRACK, SCH_FIELD, SCH_SHEET_PIN, LIB_FIELD, SCH_BUS_WIRE_ENTRY, FP_SHAPE, PCB_TEXT, SCH_BITMAP, PCB_GROUP, LIB_ARC, LIB_TEXT, SCH_JUNCTION, SCH_NO_CONNECT, SCH_MARKER, LIB_POLYLINE, PCB_TARGET, LIB_BEZIER, LIB_CIRCLE, LIB_RECTANGLE, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 83 of file eda_item.cpp.

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

References EDA_ITEM::GetClass().

Referenced by DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), BOARD_ITEM::Duplicate(), SCH_ITEM::Duplicate(), PCB_DIMENSION_BASE::GetEffectiveShape(), LIB_SYMBOL::LIB_SYMBOL(), new_clone(), LIB_SYMBOL::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_SYMBOL::SetConversion(), LIB_SYMBOL::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 585 of file gerber_draw_item.cpp.

586 {
589 
590  wxPoint start = m_Start;
591  wxPoint end = m_End;
592 
593  // make calculations more easy if ensure start.x < end.x
594  // (only 2 quadrants to consider)
595  if( start.x > end.x )
596  std::swap( start, end );
597 
598  // calculate values relative to start point:
599  wxPoint delta = end - start;
600 
601  // calculate corners for the first quadrant only (delta.x and delta.y > 0 )
602  // currently, delta.x already is > 0.
603  // make delta.y > 0
604  bool change = delta.y < 0;
605 
606  if( change )
607  delta.y = -delta.y;
608 
609  // Now create the full polygon.
610  // Due to previous changes, the shape is always something like
611  // 3 4
612  // 2 5
613  // 1 6
614  wxPoint corner;
615  corner.x -= m_Size.x/2;
616  corner.y -= m_Size.y/2;
617  wxPoint close = corner;
618  m_Polygon.Append( VECTOR2I( corner ) ); // Lower left corner, start point (1)
619  corner.y += m_Size.y;
620  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, start point (2)
621 
622  if( delta.x || delta.y )
623  {
624  corner += delta;
625  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, end point (3)
626  }
627 
628  corner.x += m_Size.x;
629  m_Polygon.Append( VECTOR2I( corner ) ); // upper right corner, end point (4)
630  corner.y -= m_Size.y;
631  m_Polygon.Append( VECTOR2I( corner ) ); // lower right corner, end point (5)
632 
633  if( delta.x || delta.y )
634  {
635  corner -= delta;
636  m_Polygon.Append( VECTOR2I( corner ) ); // lower left corner, start point (6)
637  }
638 
639  m_Polygon.Append( VECTOR2I( close ) ); // close the shape
640 
641  // Create final polygon:
642  if( change )
643  m_Polygon.Mirror( false, true );
644 
645  m_Polygon.Move( VECTOR2I( start ) );
646 }
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 = T();
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 
178  return abPos;
179 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:229
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:73
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 283 of file gerber_draw_item.cpp.

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

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 225 of file gerber_draw_item.h.

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

◆ 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 271 of file gerber_draw_item.cpp.

272 {
273  if( ( m_DCode < FIRST_DCODE ) || ( m_DCode > LAST_DCODE ) )
274  return nullptr;
275 
276  if( m_GerberImageFile == nullptr )
277  return nullptr;
278 
280 }
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:71
#define FIRST_DCODE
Definition: dcode.h:70
GERBER_FILE_IMAGE * m_GerberImageFile

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

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()

EDA_ITEM_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 158 of file eda_item.h.

159  {
160  constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_RESIZING | IS_DRAGGING
162 
163  return m_flags & mask;
164  }
#define IS_NEW
New item, just created.
#define IS_RESIZING
Item being resized.
#define IS_DRAGGING
Item being dragged.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_MOVING
Item being moved.
#define STRUCT_DELETED
flag indication structures to be erased
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.

References IS_DRAGGING, IS_MOVING, IS_NEW, IS_PASTED, IS_RESIZING, 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_SYMBOL::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_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), and DIALOG_SYMBOL_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 PCB_TRACK.

Definition at line 259 of file eda_item.h.

259 { return GetPosition(); }
virtual wxPoint GetPosition() const
Definition: eda_item.h:252

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  // Return 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 766 of file gerber_draw_item.cpp.

767 {
768  if( m_Flashed )
769  return BITMAPS::pad;
770 
771  switch( m_Shape )
772  {
773  case GBR_SEGMENT:
774  case GBR_ARC:
775  case GBR_CIRCLE:
776  return BITMAPS::add_line;
777 
778  case GBR_SPOT_OVAL:
779  case GBR_SPOT_CIRCLE:
780  case GBR_SPOT_RECT:
781  case GBR_SPOT_POLY:
782  case GBR_SPOT_MACRO:
783  // should be handles by m_Flashed == true
784  return BITMAPS::pad;
785 
786  case GBR_POLYGON:
788  }
789 
790  return BITMAPS::info;
791 }

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 669 of file gerber_draw_item.cpp.

670 {
671  wxString msg;
672  wxString text;
673 
674  msg = ShowGBRShape();
675  aList.emplace_back( _( "Type" ), msg );
676 
677  // Display D_Code value with its attributes for items using a DCode:
678  if( m_Shape == GBR_POLYGON ) // Has no DCode, but can have an attribute
679  {
680  msg = _( "Attribute" );
681 
682  if( m_AperFunction.IsEmpty() )
683  text = _( "No attribute" );
684  else
686  }
687  else
688  {
689  msg.Printf( _( "D Code %d" ), m_DCode );
690  D_CODE* apertDescr = GetDcodeDescr();
691 
692  if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
693  text = _( "No attribute" );
694  else
695  text = apertDescr->m_AperFunction;
696  }
697 
698  aList.emplace_back( msg, text );
699 
700  // Display graphic layer name
702  aList.emplace_back( _( "Graphic Layer" ), msg );
703 
704  // Display item rotation
705  // The full rotation is Image rotation + m_lyrRotation
706  // but m_lyrRotation is specific to this object
707  // so we display only this parameter
708  msg.Printf( wxT( "%f" ), m_lyrRotation );
709  aList.emplace_back( _( "Rotation" ), msg );
710 
711  // Display item polarity (item specific)
712  msg = m_LayerNegative ? _("Clear") : _("Dark");
713  aList.emplace_back( _( "Polarity" ), msg );
714 
715  // Display mirroring (item specific)
716  msg.Printf( wxT( "A:%s B:%s" ), m_mirrorA ? _( "Yes" ) : _( "No" ),
717  m_mirrorB ? _( "Yes" ) : _( "No" ) );
718  aList.emplace_back( _( "Mirror" ), msg );
719 
720  // Display AB axis swap (item specific)
721  msg = m_swapAxis ? wxT( "A=Y B=X" ) : wxT( "A=X B=Y" );
722  aList.emplace_back( _( "AB axis" ), msg );
723 
724  // Display net info, if exists
726  return;
727 
728  // Build full net info:
729  wxString net_msg;
730  wxString cmp_pad_msg;
731 
733  {
734  net_msg = _( "Net:" );
735  net_msg << " ";
736 
737  if( m_netAttributes.m_Netname.IsEmpty() )
738  net_msg << "<no net>";
739  else
741  }
742 
744  {
746  cmp_pad_msg.Printf( _( "Cmp: %s Pad: %s" ),
749  else
750  cmp_pad_msg.Printf( _( "Cmp: %s Pad: %s Fct %s" ),
754  }
755 
757  {
758  cmp_pad_msg = _( "Cmp:" );
759  cmp_pad_msg << " " << m_netAttributes.m_Cmpref;
760  }
761 
762  aList.emplace_back( net_msg, cmp_pad_msg );
763 }
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
#define _(s)
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
Definition: dcode.h:200
A gerber DCODE (also called Aperture) definition.
Definition: dcode.h:80
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:222
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 1013 of file gerber_draw_item.cpp.

1014 {
1015  wxString layerName;
1016 
1018 
1019  return wxString::Format( _( "%s (D%d) on layer %d: %s" ),
1020  ShowGBRShape(),
1021  m_DCode,
1022  GetLayer() + 1,
1023  layerName );
1024 }
int GetLayer() const
Return the layer this item is on.
static GERBER_FILE_IMAGE_LIST & GetImagesList()
#define _(s)
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
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 ( EDA_ITEM_FLAGS  type) const
inlineinherited

Definition at line 137 of file eda_item.h.

138  {
139  return m_status & type;
140  }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:478

References EDA_ITEM::m_status.

Referenced by BOARD_ITEM::IsLocked().

◆ GetStatus()

EDA_ITEM_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 150 of file eda_item.h.

150 { return m_status; }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:478

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:234
void NORMALIZE_ANGLE_90(T &Angle)
Definition: trigo.h:380
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.
int GetShapeDim(GERBER_DRAW_ITEM *aParent)
Calculate a value that can be used to evaluate the size of text when displaying the D-Code of an item...
Definition: dcode.cpp:116

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:233

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 182 of file gerber_draw_item.cpp.

183 {
184  // do the inverse transform made by GetABPosition
185  wxPoint xyPos = aABPosition;
186 
187  if( m_mirrorA )
188  xyPos.x = -xyPos.x;
189 
190  if( !m_mirrorB )
191  xyPos.y = -xyPos.y;
192 
193  double rotation = m_lyrRotation * 10 + m_GerberImageFile->m_ImageRotation * 10;
194 
195  if( rotation )
196  RotatePoint( &xyPos, rotation );
197 
198  xyPos.x = KiROUND( xyPos.x / m_drawScale.x );
199  xyPos.y = KiROUND( xyPos.y / m_drawScale.y );
201 
202  if( m_swapAxis )
203  std::swap( xyPos.x, xyPos.y );
204 
205  return xyPos - m_GerberImageFile->m_ImageJustifyOffset;
206 }
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:229
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:73
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 452 of file gerber_draw_item.cpp.

453 {
455 
456  // if isClear is true, this item has negative shape
457  return isClear;
458 }
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 794 of file gerber_draw_item.cpp.

795 {
796  // In case the item has a very tiny width defined, allow it to be selected
797  const int MIN_HIT_TEST_RADIUS = Millimeter2iu( 0.01 );
798 
799  // calculate aRefPos in XY Gerber axis:
800  wxPoint ref_pos = GetXYPosition( aRefPos );
801 
802  SHAPE_POLY_SET poly;
803 
804  switch( m_Shape )
805  {
806  case GBR_POLYGON:
807  poly = m_Polygon;
808  return poly.Contains( VECTOR2I( ref_pos ), 0, aAccuracy );
809 
810  case GBR_SPOT_POLY:
811  poly = GetDcodeDescr()->m_Polygon;
812  poly.Move( VECTOR2I( m_Start ) );
813  return poly.Contains( VECTOR2I( ref_pos ), 0, aAccuracy );
814 
815  case GBR_SPOT_RECT:
816  return GetBoundingBox().Contains( aRefPos );
817 
818  case GBR_SPOT_OVAL:
819  {
820  EDA_RECT bbox = GetBoundingBox();
821 
822  if( ! bbox.Contains( aRefPos ) )
823  return false;
824 
825  // This is similar to a segment with thickness = min( m_Size.x, m_Size.y )
826  int radius = std::min( m_Size.x, m_Size.y )/2;
827  wxPoint start, end;
828 
829  if( m_Size.x > m_Size.y ) // Horizontal oval
830  {
831  int len = m_Size.y - m_Size.x;
832  start.x = -len/2;
833  end.x = len/2;
834  }
835  else // Vertical oval
836  {
837  int len = m_Size.x - m_Size.y;
838  start.y = -len/2;
839  end.y = len/2;
840  }
841 
842  start += bbox.Centre();
843  end += bbox.Centre();
844 
845  if( radius < MIN_HIT_TEST_RADIUS )
846  radius = MIN_HIT_TEST_RADIUS;
847 
848  return TestSegmentHit( aRefPos, start, end, radius );
849  }
850 
851  case GBR_ARC:
852  {
853  double radius = GetLineLength( m_Start, m_ArcCentre );
854  VECTOR2D test_radius = VECTOR2D( ref_pos ) - VECTOR2D( m_ArcCentre );
855 
856  int size = ( ( m_Size.x < MIN_HIT_TEST_RADIUS ) ? MIN_HIT_TEST_RADIUS : m_Size.x );
857 
858  // Are we close enough to the radius?
859  bool radius_hit = ( std::fabs( test_radius.EuclideanNorm() - radius) < size );
860 
861  if( radius_hit )
862  {
863  // Now check that we are within the arc angle
864 
865  VECTOR2D start = VECTOR2D( m_Start ) - VECTOR2D( m_ArcCentre );
867 
868  double start_angle = NormalizeAngleRadiansPos( start.Angle() );
869  double end_angle = NormalizeAngleRadiansPos( end.Angle() );
870 
871  if( m_Start == m_End )
872  {
873  start_angle = 0;
874  end_angle = 2 * M_PI;
875  }
876  else if( end_angle < start_angle )
877  {
878  end_angle += 2 * M_PI;
879  }
880 
881  double test_angle = NormalizeAngleRadiansPos( test_radius.Angle() );
882 
883  return ( test_angle > start_angle && test_angle < end_angle );
884  }
885 
886  return false;
887  }
888 
889  case GBR_SPOT_MACRO:
890  // Aperture macro polygons are already in absolute coordinates
891  auto p = GetDcodeDescr()->GetMacro()->GetApertureMacroShape( this, m_Start );
892  return p->Contains( VECTOR2I( aRefPos ), -1, aAccuracy );
893  }
894 
895  // TODO: a better analyze of the shape (perhaps create a D_CODE::HitTest for flashed items)
896  int radius = std::min( m_Size.x, m_Size.y ) >> 1;
897 
898  if( radius < MIN_HIT_TEST_RADIUS )
899  radius = MIN_HIT_TEST_RADIUS;
900 
901  if( m_Flashed )
902  return HitTestPoints( m_Start, ref_pos, radius );
903  else
904  return TestSegmentHit( ref_pos, m_Start, m_End, radius );
905 }
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:222
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:315
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
SHAPE_POLY_SET m_Polygon
bool Contains(const wxPoint &aPoint) const
Definition: eda_rect.cpp:57
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
void Move(const VECTOR2I &aVector) override
Represent a set of closed polygons.
bool TestSegmentHit(const wxPoint &aRefPoint, const wxPoint &aStart, const wxPoint &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
Definition: trigo.cpp:129
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:184
Handle the component boundary box.
Definition: eda_rect.h:42
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:203
wxPoint Centre() const
Definition: eda_rect.h:55
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:125
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)
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, const wxPoint &aShapePos)
Calculate the primitive shape for flashed items.

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 908 of file gerber_draw_item.cpp.

909 {
910  wxPoint pos = GetABPosition( m_Start );
911 
912  if( aRefArea.Contains( pos ) )
913  return true;
914 
915  pos = GetABPosition( m_End );
916 
917  if( aRefArea.Contains( pos ) )
918  return true;
919 
920  return false;
921 }
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 121 of file eda_item.h.

121 { return m_flags & IS_DRAGGING; }
#define IS_DRAGGING
Item being dragged.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481

References IS_DRAGGING, and EDA_ITEM::m_flags.

Referenced by DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().

◆ IsEntered()

bool EDA_ITEM::IsEntered ( ) const
inlineinherited

Definition at line 124 of file eda_item.h.

124 { return m_flags & ENTERED; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481
#define ENTERED
indicates a group has been entered

References ENTERED, and EDA_ITEM::m_flags.

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

◆ IsForceVisible()

bool EDA_ITEM::IsForceVisible ( ) const
inlineinherited

Definition at line 206 of file eda_item.h.

206 { return m_forceVisible; }
bool m_forceVisible
Definition: eda_item.h:480

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 118 of file eda_item.h.

118 { return m_flags & IS_CHANGED; }
#define IS_CHANGED
Item was edited, and modified.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481

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_SYMBOL, SCH_SHEET, SCH_LABEL, SCH_TEXT, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 403 of file eda_item.h.

403 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 125 of file eda_item.h.

125 { return m_flags & IS_RESIZING; }
#define IS_RESIZING
Item being resized.
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481

References IS_RESIZING, and EDA_ITEM::m_flags.

◆ IsSelected()

bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 123 of file eda_item.h.

123 { return m_flags & SELECTED; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481
#define SELECTED

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(), DIALOG_EXCHANGE_FOOTPRINTS::isMatch(), DIALOG_CHANGE_SYMBOLS::isMatch(), 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 PCB_VIA, SCH_LABEL, PCB_DIMENSION_BASE, PAD, SCH_FIELD, FP_TEXT, SCH_LINE, PCB_SHAPE, FP_SHAPE, and PCB_TEXT.

Definition at line 183 of file eda_item.h.

184  {
185  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
186  return true;
187 
188  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
189  {
190  if( m_structType == *p )
191  return true;
192  }
193 
194  return false;
195  }
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:488

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(), PCB_SHAPE::IsType(), SCH_LINE::IsType(), FP_TEXT::IsType(), SCH_FIELD::IsType(), PAD::IsType(), PCB_DIMENSION_BASE::IsType(), SCH_LABEL::IsType(), PCB_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 122 of file eda_item.h.

122 { return m_flags & IS_WIRE_IMAGE; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.

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 295 of file eda_item.h.

299  {
300  for( auto it : aList )
301  {
302  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
304  return SEARCH_RESULT::QUIT;
305  }
306 
308  }
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:93

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 314 of file eda_item.h.

316  {
317  for( auto it : aList )
318  {
319  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
321  return SEARCH_RESULT::QUIT;
322  }
323 
325  }
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:93

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_SYMBOL, SCH_SHEET, SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, ZONE, SCH_PIN, SCH_MARKER, PCB_MARKER, FP_TEXT, and PCB_TEXT.

Definition at line 365 of file eda_item.h.

366  {
367  return false;
368  }

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 118 of file eda_item.cpp.

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

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 430 of file gerber_draw_item.cpp.

431 {
432  wxPoint xymove = GetXYPosition( aMoveVector );
433 
434  m_Start += xymove;
435  m_End += xymove;
436  m_ArcCentre += xymove;
437 
438  m_Polygon.Move( VECTOR2I( xymove ) );
439 }
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 442 of file gerber_draw_item.cpp.

443 {
444  m_Start += aMoveVector;
445  m_End += aMoveVector;
446  m_ArcCentre += aMoveVector;
447 
448  m_Polygon.Move( VECTOR2I( aMoveVector ) );
449 }
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 171 of file eda_item.cpp.

172 {
173  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
174  GetClass() ) );
175 
176  return false;
177 }
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 461 of file gerber_draw_item.cpp.

462 {
463  // used when a D_CODE is not found. default D_CODE to draw a flashed item
464  static D_CODE dummyD_CODE( 0 );
465  bool isFilled;
466  int radius;
467  int halfPenWidth;
468  static bool show_err;
469  D_CODE* d_codeDescr = GetDcodeDescr();
470 
471  if( d_codeDescr == nullptr )
472  d_codeDescr = &dummyD_CODE;
473 
475 
476  /* isDark is true if flash is positive and should use a drawing
477  * color other than the background color, else use the background color
478  * when drawing so that an erasure happens.
479  */
481 
482  if( !isDark )
483  {
484  // draw in background color ("negative" color)
485  color = aOptions->m_NegativeDrawColor;
486  }
487 
488  isFilled = aOptions->m_DisplayLinesFill;
489 
490  switch( m_Shape )
491  {
492  case GBR_POLYGON:
493  isFilled = aOptions->m_DisplayPolygonsFill;
494 
495  if( !isDark )
496  isFilled = true;
497 
498  PrintGerberPoly( aDC, color, aOffset, isFilled );
499  break;
500 
501  case GBR_CIRCLE:
502  radius = KiROUND( GetLineLength( m_Start, m_End ) );
503 
504  halfPenWidth = m_Size.x >> 1;
505 
506  if( !isFilled )
507  {
508  // draw the border of the pen's path using two circles, each as narrow as possible
509  GRCircle( nullptr, aDC, GetABPosition( m_Start ), radius - halfPenWidth, 0, color );
510  GRCircle( nullptr, aDC, GetABPosition( m_Start ), radius + halfPenWidth, 0, color );
511  }
512  else // Filled mode
513  {
514  GRCircle( nullptr, aDC, GetABPosition( m_Start ), radius, m_Size.x, color );
515  }
516 
517  break;
518 
519  case GBR_ARC:
520  // Currently, arcs plotted with a rectangular aperture are not supported.
521  // a round pen only is expected.
522  if( !isFilled )
523  {
524  GRArc1( nullptr, aDC, GetABPosition( m_Start ), GetABPosition( m_End ),
526  }
527  else
528  {
529  GRArc1( nullptr, aDC, GetABPosition( m_Start ), GetABPosition( m_End ),
531  }
532 
533  break;
534 
535  case GBR_SPOT_CIRCLE:
536  case GBR_SPOT_RECT:
537  case GBR_SPOT_OVAL:
538  case GBR_SPOT_POLY:
539  case GBR_SPOT_MACRO:
540  isFilled = aOptions->m_DisplayFlashedItemsFill;
541  d_codeDescr->DrawFlashedShape( this, nullptr, aDC, color, m_Start, isFilled );
542  break;
543 
544  case GBR_SEGMENT:
545  /* Plot a line from m_Start to m_End.
546  * Usually, a round pen is used, but some Gerber files use a rectangular pen
547  * In fact, any aperture can be used to plot a line.
548  * currently: only a square pen is handled (I believe using a polygon gives a strange plot).
549  */
550  if( d_codeDescr->m_Shape == APT_RECT )
551  {
552  if( m_Polygon.OutlineCount() == 0 )
554 
555  PrintGerberPoly( aDC, color, aOffset, isFilled );
556  }
557  else
558  {
559  if( !isFilled )
560  {
561  GRCSegm( nullptr, aDC, GetABPosition( m_Start ), GetABPosition( m_End ),
562  m_Size.x, color );
563  }
564  else
565  {
567  m_Size.x, color );
568  }
569  }
570 
571  break;
572 
573  default:
574  if( !show_err )
575  {
576  wxMessageBox( wxT( "Trace_Segment() type error" ) );
577  show_err = true;
578  }
579 
580  break;
581  }
582 }
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:222
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:189
int color
Definition: DXF_plotter.cpp:60
COLOR4D GetPositiveDrawColor() const
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:51
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.
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, const COLOR4D &Color)
Definition: gr_basic.cpp:551
void GRFilledSegment(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aStart, const wxPoint &aEnd, int aWidth, const COLOR4D &aColor)
Definition: gr_basic.cpp:377
void ConvertSegmentToPolygon()
Convert a line to an equivalent polygon.
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, const COLOR4D &Color)
Definition: gr_basic.cpp:594
A gerber DCODE (also called Aperture) definition.
Definition: dcode.h:80
void DrawFlashedShape(GERBER_DRAW_ITEM *aParent, EDA_RECT *aClipBox, wxDC *aDC, COLOR4D aColor, const wxPoint &aShapePos, bool aFilledShape)
Draw the dcode shape for flashed items.
Definition: dcode.cpp:148
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:73
void PrintGerberPoly(wxDC *aDC, const COLOR4D &aColor, const wxPoint &aOffset, bool aFilledShape)
Print the polygon stored in m_PolyCorners.
GERBER_FILE_IMAGE * m_GerberImageFile
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, const COLOR4D &Color)
Definition: gr_basic.cpp:271

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, SHAPE_POLY_SET::OutlineCount(), and PrintGerberPoly().

◆ PrintGerberPoly()

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

Print the polygon stored in m_PolyCorners.

Definition at line 649 of file gerber_draw_item.cpp.

651 {
652  std::vector<wxPoint> points;
653  SHAPE_LINE_CHAIN& poly = m_Polygon.Outline( 0 );
654  int pointCount = poly.PointCount() - 1;
655 
656  points.reserve( pointCount );
657 
658  for( int ii = 0; ii < pointCount; ii++ )
659  {
660  wxPoint p( poly.CPoint( ii ).x, poly.CPoint( ii ).y );
661  points[ii] = p + aOffset;
662  points[ii] = GetABPosition( points[ii] );
663  }
664 
665  GRClosedPoly( nullptr, aDC, pointCount, &points[0], aFilledShape, aColor, aColor );
666 }
int PointCount() const
Return the number of points (vertices) in this line chain.
SHAPE_POLY_SET m_Polygon
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Return the image position of aPosition for this object.
SHAPE_LINE_CHAIN & Outline(int aIndex)
void GRClosedPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a closed polyline and fill it if Fill, in object space.
Definition: gr_basic.cpp:507
Represent a polyline (an zero-thickness chain of connected line segments).

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 145 of file eda_item.cpp.

146 {
147  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
148 
149  int result = searchString.Find( ( aSearchData.GetFlags() & wxFR_MATCHCASE ) ?
150  aSearchData.GetFindString() :
151  aSearchData.GetFindString().Upper() );
152 
153  if( result == wxNOT_FOUND )
154  return false;
155 
156  wxString prefix = aText.Left( result );
157  wxString suffix;
158 
159  if( aSearchData.GetFindString().length() + result < aText.length() )
160  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
161 
162  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
163  aText, prefix, aSearchData.GetReplaceString(), suffix );
164 
165  aText = prefix + aSearchData.GetReplaceString() + suffix;
166 
167  return true;
168 }
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 392 of file eda_item.h.

393  {
394  return false;
395  }

◆ 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()

◆ SetFlags()

void EDA_ITEM::SetFlags ( EDA_ITEM_FLAGS  aMask)
inlineinherited

Definition at line 153 of file eda_item.h.

153 { m_flags |= aMask; }
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481

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(), 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::ParseLabel(), 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_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_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 204 of file eda_item.h.

204 { m_forceVisible = aEnable; }
bool m_forceVisible
Definition: eda_item.h:480

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 209 of file gerber_draw_item.cpp.

210 {
212  m_swapAxis = m_GerberImageFile->m_SwapAxis; // false if A = X, B = Y;
213 
214  // true if A =Y, B = Y
215  m_mirrorA = m_GerberImageFile->m_MirrorA; // true: mirror / axe A
216  m_mirrorB = m_GerberImageFile->m_MirrorB; // true: mirror / axe B
217  m_drawScale = m_GerberImageFile->m_Scale; // A and B scaling factor
218  m_layerOffset = m_GerberImageFile->m_Offset; // Offset from OF command
219 
220  // Rotation from RO command:
223 }
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 PCB_DIMENSION_BASE.

Definition at line 116 of file eda_item.h.

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

References EDA_ITEM::m_parent.

Referenced by FOOTPRINT::Add(), BOARD::Add(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), BOARD_NETLIST_UPDATER::addNewFootprint(), 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::CreateNewSymbol(), SCH_DRAWING_TOOLS::createNewText(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), PCB_EDIT_FRAME::ExchangeFootprint(), LIB_SYMBOL::Flatten(), FOOTPRINT::FOOTPRINT(), PCB_IO::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), CADSTAR_SCH_ARCHIVE_LOADER::getKiCadSchText(), LIB_SYMBOL::LIB_SYMBOL(), SCH_LEGACY_PLUGIN_CACHE::loadAliases(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), FOOTPRINT::operator=(), LIB_SYMBOL::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_SYMBOL::SetFields(), PCB_DIMENSION_BASE::SetParent(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_SHEET::SwapData(), SCH_GLOBALLABEL::SwapData(), SCH_SYMBOL::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 ( EDA_ITEM_FLAGS  type,
bool  state 
)
inlineinherited

Definition at line 142 of file eda_item.h.

143  {
144  if( state )
145  m_status |= type; // state = ON or OFF
146  else
147  m_status &= ~type;
148  }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:478

References EDA_ITEM::m_status.

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

◆ SetStatus()

void EDA_ITEM::SetStatus ( EDA_ITEM_FLAGS  aStatus)
inlineinherited

Definition at line 151 of file eda_item.h.

151 { m_status = aStatus; }
EDA_ITEM_FLAGS m_status
Definition: eda_item.h:478

References EDA_ITEM::m_status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 128 of file eda_item.h.

128 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition: eda_item.h:153
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ Shape()

int GERBER_DRAW_ITEM::Shape ( ) const
inline

Definition at line 198 of file gerber_draw_item.h.

198 { return m_Shape; }

References m_Shape.

◆ ShowGBRShape()

wxString GERBER_DRAW_ITEM::ShowGBRShape ( ) const

Definition at line 226 of file gerber_draw_item.cpp.

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

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 421 of file eda_item.h.

421 { 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 113 of file eda_item.h.

113 { 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:488

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_LABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SYMBOL::CanConnect(), CN_VISITOR::checkZoneItemConnection(), SCH_MARKER::ClassOf(), SCH_JUNCTION::ClassOf(), SCH_PIN::ClassOf(), PCB_TEXT::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), SCH_NO_CONNECT::ClassOf(), PCB_MARKER::ClassOf(), FP_SHAPE::ClassOf(), PCB_TARGET::ClassOf(), SCH_LINE::ClassOf(), PCB_SHAPE::ClassOf(), PCB_GROUP::ClassOf(), SCH_FIELD::ClassOf(), FP_TEXT::ClassOf(), SCH_SHEET::ClassOf(), NETINFO_ITEM::ClassOf(), SCH_SHEET_PIN::ClassOf(), ZONE::ClassOf(), SCH_BITMAP::ClassOf(), PCB_TRACK::ClassOf(), PAD::ClassOf(), SCH_SYMBOL::ClassOf(), SCH_SCREEN::ClassOf(), FOOTPRINT::ClassOf(), SCH_TEXT::ClassOf(), SCH_BUS_WIRE_ENTRY::ClassOf(), SCH_BUS_BUS_ENTRY::ClassOf(), BOARD::ClassOf(), PCB_ARC::ClassOf(), SCH_LABEL::ClassOf(), PCB_VIA::ClassOf(), SCH_GLOBALLABEL::ClassOf(), PCB_DIM_ALIGNED::ClassOf(), PCB_DIM_ORTHOGONAL::ClassOf(), SCH_HIERLABEL::ClassOf(), PCB_DIM_LEADER::ClassOf(), PCB_DIM_CENTER::ClassOf(), TRACKS_CLEANER::cleanup(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), LIB_ITEM::compare(), LIB_SYMBOL::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(), PCB_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(), PCB_TRACK::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_FIELD::GetName(), CONNECTIVITY_DATA::GetNetItems(), LIB_SYMBOL::GetNextDrawItem(), PCB_SHAPE::GetParentFootprint(), LIB_SYMBOL::GetPin(), SCH_SYMBOL::GetPinPhysicalPosition(), SCH_FIELD::GetPosition(), KIGFX::SCH_PAINTER::getRenderColor(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), PCB_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(), BOARD_INSPECTION_TOOL::InspectDRCError(), 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(), PCB_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(), CONVERT_TOOL::makePolysFromSegs(), 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(), PCB_POINT_EDITOR::OnSelectionChange(), PCB_TRACK::cmp_tracks::operator()(), CN_VISITOR::operator()(), PCB_SHAPE::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), SCH_BUS_ENTRY_BASE::operator<(), SCH_JUNCTION::operator<(), SCH_TEXT::operator<(), SCH_FIELD::operator<(), SCH_LINE::operator<(), SCH_SHEET::operator<(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_SYMBOL::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_SYMBOL::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(), PCB_POINT_EDITOR::setAltConstraint(), 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_GROUP::SwapData(), PCB_TEXT::SwapData(), PCB_TRACK::SwapData(), SCH_SHEET::SwapData(), PCB_ARC::SwapData(), PCB_DIM_ALIGNED::SwapData(), PCB_DIM_ORTHOGONAL::SwapData(), SCH_SYMBOL::SwapData(), PCB_VIA::SwapData(), PCB_DIM_LEADER::SwapData(), PCB_DIM_CENTER::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_SYMBOL_FIELDS_TABLE::TransferDataToWindow(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), PCB_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(), PCB_TRACK::Visit(), Visit(), SCH_GLOBALLABEL::Visit(), SCH_SHEET::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 954 of file gerber_draw_item.cpp.

955 {
956  EDA_RECT bbox = GetBoundingBox();
957  return BOX2I( VECTOR2I( bbox.GetOrigin() ),
958  VECTOR2I( bbox.GetSize() ) );
959 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:506
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:101
Handle the component boundary box.
Definition: eda_rect.h:42
const wxSize GetSize() const
Definition: eda_rect.h:91

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 945 of file gerber_draw_item.cpp.

946 {
947  aCount = 2;
948 
949  aLayers[0] = GERBER_DRAW_LAYER( GetLayer() );
950  aLayers[1] = GERBER_DCODE_LAYER( aLayers[0] );
951 }
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 962 of file gerber_draw_item.cpp.

963 {
964  // DCodes will be shown only if zoom is appropriate:
965  // Returns the level of detail of the item.
966  // A level of detail (LOD) is the minimal VIEW scale that
967  // is sufficient for an item to be shown on a given layer.
968  if( IsDCodeLayer( aLayer ) )
969  {
970  int size = 0;
971 
972  switch( m_Shape )
973  {
974  case GBR_SPOT_MACRO:
976  break;
977 
978  case GBR_ARC:
979  size = GetLineLength( m_Start, m_ArcCentre );
980  break;
981 
982  default:
983  size = m_Size.x;
984  }
985 
986  // the level of details is chosen experimentally, to show
987  // only a readable text:
988  double level = (double)Millimeter2iu( 3 );
989  return level / ( size + 1 );
990  }
991 
992  // Other layers are shown without any conditions
993  return 0.0;
994 }
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:222
int GetWidth() const
Definition: eda_rect.h:109
EDA_RECT GetBoundingBox() const
Return the bounding box of the shape.
Definition: am_primitive.h:226
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:125
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 997 of file gerber_draw_item.cpp.

999 {
1000  KICAD_T stype = *scanTypes;
1001 
1002  // If caller wants to inspect my type
1003  if( stype == Type() )
1004  {
1005  if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
1006  return SEARCH_RESULT::QUIT;
1007  }
1008 
1009  return SEARCH_RESULT::CONTINUE;
1010 }
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:113

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 290 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 292 of file gerber_draw_item.h.

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

◆ m_parent

◆ m_Polygon

◆ m_Shape

◆ m_Size

◆ m_Start

◆ m_status

◆ m_swapAxis

bool GERBER_DRAW_ITEM::m_swapAxis
private

◆ m_UnitsMetric

bool GERBER_DRAW_ITEM::m_UnitsMetric

Definition at line 252 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 475 of file eda_item.h.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_SYMBOL::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_SYMBOL::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(), PNS::LOGGER::Log(), NETLIST_EXPORTER_XML::makeSymbols(), SCH_EDIT_FRAME::mapExistingAnnotation(), PCB_TRACK::cmp_tracks::operator()(), PCB_SHAPE::cmp_drawings::operator()(), BOARD_ITEM::ptr_cmp::operator()(), FOOTPRINT::cmp_drawings::operator()(), FOOTPRINT::cmp_pads::operator()(), SCH_ITEM::operator<(), SCH_SYMBOL::operator<(), PAD::PAD(), SCH_SEXPR_PARSER::parseSchSheetInstances(), SCH_EDITOR_CONTROL::Paste(), SCH_SHEET_PATH::PathAsString(), BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SYMBOL::ReplaceInstanceSheetPath(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), 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_LEGACY_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_REFERENCE::SCH_REFERENCE(), SCH_SHEET::SCH_SHEET(), SCH_SYMBOL::SCH_SYMBOL(), 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: