KiCad PCB EDA Suite
EXCELLON_IMAGE Class Reference

#include <excellon_image.h>

Inheritance diagram for EXCELLON_IMAGE:
GERBER_FILE_IMAGE EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 EXCELLON_IMAGE (int layer)
 
 ~EXCELLON_IMAGE ()
 
virtual void ResetDefaultValues () override
 
bool LoadFile (const wxString &aFullFileName)
 Read and load a drill (EXCELLON format) file. More...
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
void Clear_GERBER_FILE_IMAGE ()
 
bool LoadGerberFile (const wxString &aFullFileName)
 Read and load a gerber file. More...
 
const wxArrayString & GetMessages () const
 
int GetDcodesCount ()
 
COLOR4D GetPositiveDrawColor () const
 
GERBER_DRAW_ITEMGetItemsList ()
 Function GetItemsList. More...
 
GERBER_LAYERGetLayerParams ()
 Function GetLayerParams. More...
 
bool HasNegativeItems ()
 Function HasNegativeItems. More...
 
void ClearMessageList ()
 Function ClearMessageList Clear the message list Call it before reading a Gerber file. More...
 
void AddMessageToList (const wxString &aMessage)
 Function AddMessageToList Add a message to the message list. More...
 
void InitToolTable ()
 Function InitToolTable. More...
 
wxPoint ReadXYCoord (char *&aText, bool aExcellonMode=false)
 Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm) More...
 
wxPoint ReadIJCoord (char *&Text)
 Returns the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) These coordinates are relative, so if coordinate is absent, it's value defaults to 0. More...
 
int GCodeNumber (char *&Text)
 
int DCodeNumber (char *&Text)
 
D_CODEGetDCODEOrCreate (int aDCODE, bool aCreateIfNoExist=true)
 Function GetDCODEOrCreate returns a pointer to the D_CODE within this GERBER for the given aDCODE. More...
 
D_CODEGetDCODE (int aDCODE) const
 Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE. More...
 
APERTURE_MACROFindApertureMacro (const APERTURE_MACRO &aLookup)
 Function FindApertureMacro looks up a previously read in aperture macro. More...
 
void StepAndRepeatItem (const GERBER_DRAW_ITEM &aItem)
 Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called when reading a gerber file and after creating a new gerber item that must be repeated (i.e when m_XRepeatCount or m_YRepeatCount are > 1) More...
 
void DisplayImageInfo (GERBVIEW_FRAME *aMainFrame)
 Function DisplayImageInfo has knowledge about the frame and how and where to put status information about this object into the frame's message panel. More...
 
void RemoveAttribute (X2_ATTRIBUTE &aAttribute)
 Function RemoveAttribute. More...
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
 

More...
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
EDA_ITEMNext () const
 
EDA_ITEMBack () const
 
EDA_ITEMGetParent () const
 
DHEADGetList () const
 
void SetNext (EDA_ITEM *aNext)
 
void SetBack (EDA_ITEM *aBack)
 
void SetParent (EDA_ITEM *aParent)
 
void SetList (DHEAD *aList)
 
bool IsNew () const
 
bool IsModified () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[])
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
virtual void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList)
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
virtual bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const
 Function HitTest tests if aPosition is contained within or on the bounding box of an item. More...
 
virtual bool HitTest (const EDA_RECT &aRect, bool aContained, int aAccuracy=0) const
 Function HitTest tests if aRect intersects or is contained within the bounding box of an item. More...
 
virtual const EDA_RECT GetBoundingBox () const
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
virtual EDA_ITEMClone () const
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
virtual wxString GetSelectMenuText (EDA_UNITS_T aUnits) const
 Function GetSelectMenuText returns 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 BITMAP_DEF GetMenuImage () const
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual unsigned int ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 

Static Public Member Functions

static SEARCH_RESULT IterateForward (EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes. More...
 
static bool Sort (const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
 Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL container of EDA_ITEM pointers. More...
 

Public Attributes

DLIST< GERBER_DRAW_ITEMm_Drawings
 
bool m_InUse
 
bool m_IsVisible
 
COLOR4D m_PositiveDrawColor
 
wxString m_FileName
 
wxString m_ImageName
 
bool m_IsX2_file
 
X2_ATTRIBUTE_FILEFUNCTIONm_FileFunction
 
wxString m_MD5_value
 
wxString m_PartString
 
int m_GraphicLayer
 
bool m_ImageNegative
 
bool m_ImageJustifyXCenter
 
bool m_ImageJustifyYCenter
 
wxPoint m_ImageJustifyOffset
 
bool m_GerbMetric
 
bool m_Relative
 
bool m_NoTrailingZeros
 
wxPoint m_ImageOffset
 
wxSize m_FmtScale
 
wxSize m_FmtLen
 
int m_ImageRotation
 
double m_LocalRotation
 
wxPoint m_Offset
 
wxRealPoint m_Scale
 
bool m_SwapAxis
 
bool m_MirrorA
 
bool m_MirrorB
 
int m_Iterpolation
 
int m_Current_Tool
 
int m_Last_Pen_Command
 
int m_CommandState
 
int m_LineNum
 
wxPoint m_CurrentPos
 
wxPoint m_PreviousPos
 
wxPoint m_IJPos
 
bool m_LastCoordIsIJPos
 
int m_ArcRadius
 
LAST_EXTRA_ARC_DATA_TYPE m_LastArcDataType
 
FILE * m_Current_File
 
int m_Selected_Tool
 
bool m_Has_DCode
 
bool m_360Arc_enbl
 
bool m_PolygonFillMode
 
int m_PolygonFillModeState
 
APERTURE_MACRO_SET m_aperture_macros
 a collection of APERTURE_MACROS, sorted by name More...
 
GBR_NETLIST_METADATA m_NetAttributeDict
 
wxString m_AperFunction
 
std::map< wxString, int > m_ComponentsList
 
std::map< wxString, int > m_NetnamesList
 

Protected Member Functions

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

Protected Attributes

EDA_ITEMPnext
 next in linked list More...
 
EDA_ITEMPback
 previous in linked list More...
 
DHEADm_List
 which DLIST I am on. More...
 
EDA_ITEMm_Parent
 Linked list: Link (parent struct) More...
 
timestamp_t m_TimeStamp
 Time stamp used for logical links. More...
 
bool m_forceVisible
 Set to true to override the visibility setting of the item. More...
 
STATUS_FLAGS m_Flags
 Flag bits for editing and other uses. More...
 

Private Types

enum  excellon_state { READ_HEADER_STATE, READ_PROGRAM_STATE }
 

Private Member Functions

bool Execute_HEADER_And_M_Command (char *&text)
 
bool Select_Tool (char *&text)
 
bool Execute_EXCELLON_G_Command (char *&text)
 
bool Execute_Drill_Command (char *&text)
 
bool readToolInformation (char *&aText)
 Read a tool definition like T1C0.02 or T1F00S00C0.02 or T1C0.02F00S00 and enter params in TCODE list. More...
 
int TCodeNumber (char *&aText)
 
void FinishRouteCommand ()
 Ends a route command started by M15 ot G01, G02 or G03 command. More...
 
void SelectUnits (bool aMetric)
 

Private Attributes

excellon_state m_State
 
bool m_SlotOn
 
bool m_RouteModeOn
 
std::vector< EXCELLON_ROUTE_COORDm_RoutePositions
 

Detailed Description

Definition at line 133 of file excellon_image.h.

Member Enumeration Documentation

◆ excellon_state

Enumerator
READ_HEADER_STATE 
READ_PROGRAM_STATE 

Definition at line 136 of file excellon_image.h.

136  {
137  READ_HEADER_STATE, // When we are in this state, we are reading header
138  READ_PROGRAM_STATE // When we are in this state, we are reading drill data
139  };

Constructor & Destructor Documentation

◆ EXCELLON_IMAGE()

EXCELLON_IMAGE::EXCELLON_IMAGE ( int  layer)
inline

Definition at line 147 of file excellon_image.h.

147  : EXCELLON_IMAGE( int layer ) :
148  GERBER_FILE_IMAGE( layer )
149  {
151  m_SlotOn = false;
152  m_RouteModeOn = false;
153  }
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
EXCELLON_IMAGE(int layer)
excellon_state m_State

References m_RouteModeOn, m_SlotOn, m_State, and READ_HEADER_STATE.

◆ ~EXCELLON_IMAGE()

EXCELLON_IMAGE::~EXCELLON_IMAGE ( )
inline

Definition at line 156 of file excellon_image.h.

156 {};

Member Function Documentation

◆ AddMessageToList()

void GERBER_FILE_IMAGE::AddMessageToList ( const wxString &  aMessage)
inlineinherited

◆ Back()

EDA_ITEM* EDA_ITEM::Back ( ) const
inlineinherited

Definition at line 213 of file base_struct.h.

213 { return Pback; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:171

References EDA_ITEM::Pback.

Referenced by DHEAD::insert(), and DHEAD::remove().

◆ Clear_GERBER_FILE_IMAGE()

void GERBER_FILE_IMAGE::Clear_GERBER_FILE_IMAGE ( )
inherited

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 239 of file base_struct.h.

239 { ClearFlags( BRIGHTENED ); }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:137
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260

References BRIGHTENED, and EDA_ITEM::ClearFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::unhighlight(), and SELECTION_TOOL::unhighlight().

◆ ClearEditFlags()

void EDA_ITEM::ClearEditFlags ( )
inlineinherited

◆ ClearFlags()

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

Definition at line 260 of file base_struct.h.

260 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181

References EDA_ITEM::m_Flags.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_Move_Pad(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), Abort_Zone_Move_Corner_Or_Outlines(), AbortMoveAndEditTarget(), AbortMoveDimensionText(), AbortMoveTextModule(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_COMPONENT::ClearAllHighlightFlags(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearHighlighted(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), CopyMarkedItems(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), PCB_EDIT_FRAME::Exchange_Module(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), PCB_BASE_FRAME::Import_Pad_Settings(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), EDIT_POINTS_FACTORY::Make(), MarkItemsInBloc(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::Place_DrawItem(), FOOTPRINT_EDIT_FRAME::Place_EdgeMod(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_EDIT_FRAME::PlaceDimensionText(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_EDIT_FRAME::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::PlaceTexteModule(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), BOARD_COMMIT::Revert(), LIB_EDIT_FRAME::RollbackPartFromUndo(), PCB_BASE_FRAME::Rotate_Module(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SelectUnit(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ ClearHighlighted()

void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 238 of file base_struct.h.

238 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:136
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

◆ ClearMessageList()

void GERBER_FILE_IMAGE::ClearMessageList ( )
inlineinherited

Function ClearMessageList Clear the message list Call it before reading a Gerber file.

Definition at line 300 of file gerber_file_image.h.

301  {
302  m_messagesList.Clear();
303  }
wxArrayString m_messagesList

References GERBER_FILE_IMAGE::m_messagesList.

Referenced by LoadFile(), and GERBER_FILE_IMAGE::LoadGerberFile().

◆ ClearSelected()

void EDA_ITEM::ClearSelected ( )
inlineinherited

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 271 of file base_struct.h.

272  {
274  }
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
Definition: base_struct.h:111
#define SKIP_STRUCT
flag indicating that the structure should be ignored
Definition: base_struct.h:125
#define CANDIDATE
flag indicating that the structure is connected
Definition: base_struct.h:124
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:120
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:260
#define DO_NOT_DRAW
Used to disable draw function.
Definition: base_struct.h:126
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:119

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

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 153 of file view_item.h.

154  {
155  m_viewPrivData = NULL;
156  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:161

References KIGFX::VIEW_ITEM::m_viewPrivData.

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

◆ Clone()

EDA_ITEM * EDA_ITEM::Clone ( ) const
virtualinherited

Function Clone creates 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 D_PAD, ZONE_CONTAINER, SCH_COMPONENT, MODULE, SCH_SHEET, LIB_PIN, VIA, SCH_HIERLABEL, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, DIMENSION, SCH_LABEL, LIB_FIELD, TEXTE_MODULE, SCH_FIELD, SCH_LINE, SCH_TEXT, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, SCH_BITMAP, SCH_BUS_WIRE_ENTRY, LIB_ARC, EDGE_MODULE, LIB_TEXT, TEXTE_PCB, LIB_POLYLINE, SCH_NO_CONNECT, LIB_BEZIER, PCB_TARGET, LIB_RECTANGLE, SCH_JUNCTION, LIB_CIRCLE, SCH_MARKER, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 123 of file base_struct.cpp.

124 {
125  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
126  wxT( ". Bad programmer!" ) );
127 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass().

Referenced by PCB_EDIT_FRAME::Block_Duplicate(), CopyMarkedItems(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), LIB_DRAWING_TOOLS::DrawShape(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), BOARD::Duplicate(), LIB_PART::LIB_PART(), LIB_EDIT_FRAME::LoadOneSymbol(), new_clone(), LIB_EDIT_TOOL::Paste(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), LIB_PART::SetConversion(), LIB_PART::SetUnitCount(), and COMMIT::Stage().

◆ DCodeNumber()

int GERBER_FILE_IMAGE::DCodeNumber ( char *&  Text)
inherited

Definition at line 434 of file rs274d.cpp.

435 {
436  int ii = 0;
437  char* text;
438  char line[1024];
439 
440  if( Text == NULL )
441  return 0;
442 
443  Text++;
444  text = line;
445  while( IsNumber( *Text ) )
446  *(text++) = *(Text++);
447 
448  *text = 0;
449  ii = atoi( line );
450  return ii;
451 }
#define IsNumber(x)

References IsNumber.

Referenced by GERBER_FILE_IMAGE::Execute_G_Command(), GERBER_FILE_IMAGE::LoadGerberFile(), and TCodeNumber().

◆ DisplayImageInfo()

void GERBER_FILE_IMAGE::DisplayImageInfo ( GERBVIEW_FRAME aMainFrame)
inherited

Function DisplayImageInfo has knowledge about the frame and how and where to put status information about this object into the frame's message panel.

Display info about Image Parameters.

Parameters
aMainFrame= the GERBVIEW_FRAME to display messages

Display info about Image Parameters. These parameters are valid for the entire file, and must set only once (If more than once, only the last value is used)

Definition at line 339 of file gerber_file_image.cpp.

340 {
341  wxString msg;
342 
343  aMainFrame->ClearMsgPanel();
344 
345  // Display Image name (Image specific)
346  aMainFrame->AppendMsgPanel( _( "Image name" ), m_ImageName, CYAN );
347 
348  // Display graphic layer number used to draw this Image
349  // (not a Gerber parameter but is also image specific)
350  msg.Printf( wxT( "%d" ), m_GraphicLayer + 1 );
351  aMainFrame->AppendMsgPanel( _( "Graphic layer" ), msg, BROWN );
352 
353  // Display Image rotation (Image specific)
354  msg.Printf( wxT( "%d" ), m_ImageRotation );
355  aMainFrame->AppendMsgPanel( _( "Img Rot." ), msg, CYAN );
356 
357  // Display Image polarity (Image specific)
358  msg = m_ImageNegative ? _("Negative") : _("Normal");
359  aMainFrame->AppendMsgPanel( _( "Polarity" ), msg, BROWN );
360 
361  // Display Image justification and offset for justification (Image specific)
362  msg = m_ImageJustifyXCenter ? _("Center") : _("Normal");
363  aMainFrame->AppendMsgPanel( _( "X Justify" ), msg, DARKRED );
364 
365  msg = m_ImageJustifyYCenter ? _("Center") : _("Normal");
366  aMainFrame->AppendMsgPanel( _( "Y Justify" ), msg, DARKRED );
367 
368  if( aMainFrame->GetUserUnits() == INCHES )
369  msg.Printf( wxT( "X=%f Y=%f" ), Iu2Mils( m_ImageJustifyOffset.x ) / 1000.0,
370  Iu2Mils( m_ImageJustifyOffset.y ) / 1000.0 );
371  else
372  msg.Printf( wxT( "X=%f Y=%f" ), Iu2Millimeter( m_ImageJustifyOffset.x ),
373  Iu2Millimeter( m_ImageJustifyOffset.y ) );
374 
375  aMainFrame->AppendMsgPanel( _( "Image Justify Offset" ), msg, DARKRED );
376 }
Definition: colors.h:54
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:289
Definition: common.h:158
Definition: colors.h:59
virtual void ClearMsgPanel()
Clear all messages from the message panel.
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
Definition: colors.h:62

References EDA_DRAW_FRAME::AppendMsgPanel(), BROWN, EDA_DRAW_FRAME::ClearMsgPanel(), CYAN, DARKRED, EDA_DRAW_FRAME::GetUserUnits(), INCHES, GERBER_FILE_IMAGE::m_GraphicLayer, GERBER_FILE_IMAGE::m_ImageJustifyOffset, GERBER_FILE_IMAGE::m_ImageJustifyXCenter, GERBER_FILE_IMAGE::m_ImageJustifyYCenter, GERBER_FILE_IMAGE::m_ImageName, GERBER_FILE_IMAGE::m_ImageNegative, and GERBER_FILE_IMAGE::m_ImageRotation.

Referenced by GERBVIEW_FRAME::OnLeftClick(), and GERBVIEW_FRAME::UpdateTitleAndInfo().

◆ Execute_Drill_Command()

bool EXCELLON_IMAGE::Execute_Drill_Command ( char *&  text)
private

Definition at line 619 of file excellon_read_drill_file.cpp.

620 {
621  D_CODE* tool;
622  GERBER_DRAW_ITEM * gbritem;
623 
624  while( true )
625  {
626  switch( *text )
627  {
628  case 'X':
629  case 'Y':
630  ReadXYCoord( text, true );
631 
632  if( *text == 'I' || *text == 'J' )
633  ReadIJCoord( text );
634 
635  break;
636 
637  case 'G': // G85 is found here for oval holes
640  break;
641 
642  case 0: // E.O.L: execute command
643  if( m_RouteModeOn )
644  {
645  // We are in routing mode, and this is an intermediate point.
646  // So just store it
647  int rmode = 0; // linear routing.
648 
650  rmode = ROUTE_CW;
652  rmode = ROUTE_CCW;
653 
655  {
656  EXCELLON_ROUTE_COORD point( m_CurrentPos, m_IJPos, rmode );
657  m_RoutePositions.push_back( point );
658  }
659  else
660  {
662  m_RoutePositions.push_back( point );
663  }
664  return true;
665  }
666 
667  tool = GetDCODE( m_Current_Tool );
668  if( !tool )
669  {
670  wxString msg;
671  msg.Printf( _( "Tool %d not defined" ), m_Current_Tool );
672  AddMessageToList( msg );
673  return false;
674  }
675 
676  gbritem = new GERBER_DRAW_ITEM( this );
677  m_Drawings.Append( gbritem );
678 
679  if( m_SlotOn ) // Oblong hole
680  {
681  fillLineGBRITEM( gbritem, tool->m_Num_Dcode,
683  tool->m_Size, false );
684  // the hole is made: reset the slot on command (G85)
685  // (it is needed for each oblong hole)
686  m_SlotOn = false;
687  }
688  else
689  {
690  fillFlashedGBRITEM( gbritem, tool->m_Shape, tool->m_Num_Dcode,
691  m_CurrentPos, tool->m_Size, false );
692  }
693 
694  StepAndRepeatItem( *gbritem );
696  return true;
697  break;
698 
699  default:
700  text++;
701  break;
702  }
703  }
704 
705  return true;
706 }
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
wxPoint ReadIJCoord(char *&Text)
Returns the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) These coordinates are rela...
#define ROUTE_CCW
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
void Append(T *aNewElement)
Function Append adds aNewElement to the end of the list.
Definition: dlist.h:177
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE.
void fillFlashedGBRITEM(GERBER_DRAW_ITEM *aGbrItem, APERTURE_T aAperture, int Dcode_index, const wxPoint &aPos, wxSize aSize, bool aLayerNegative)
Function fillFlashedGBRITEM initializes a given GBRITEM so that it can draw a circle which is filled ...
Definition: rs274d.cpp:103
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
#define ROUTE_CW
wxPoint ReadXYCoord(char *&aText, bool aExcellonMode=false)
Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm)
LAST_EXTRA_ARC_DATA_TYPE m_LastArcDataType
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
DLIST< GERBER_DRAW_ITEM > m_Drawings
std::vector< EXCELLON_ROUTE_COORD > m_RoutePositions
bool Execute_EXCELLON_G_Command(char *&text)
void StepAndRepeatItem(const GERBER_DRAW_ITEM &aItem)
Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called wh...
void fillLineGBRITEM(GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const wxPoint &aStart, const wxPoint &aEnd, wxSize aPenSize, bool aLayerNegative)
Function fillLineGBRITEM initializes a given GBRITEM so that it can draw a linear D code.
Definition: rs274d.cpp:158

References GERBER_FILE_IMAGE::AddMessageToList(), DLIST< T >::Append(), ARC_INFO_TYPE_CENTER, Execute_EXCELLON_G_Command(), fillFlashedGBRITEM(), fillLineGBRITEM(), GERB_INTERPOL_ARC_NEG, GERB_INTERPOL_ARC_POS, GERBER_FILE_IMAGE::GetDCODE(), GERBER_FILE_IMAGE::m_ArcRadius, GERBER_FILE_IMAGE::m_Current_Tool, GERBER_FILE_IMAGE::m_CurrentPos, GERBER_FILE_IMAGE::m_Drawings, GERBER_FILE_IMAGE::m_IJPos, GERBER_FILE_IMAGE::m_Iterpolation, GERBER_FILE_IMAGE::m_LastArcDataType, D_CODE::m_Num_Dcode, GERBER_FILE_IMAGE::m_PreviousPos, m_RouteModeOn, m_RoutePositions, D_CODE::m_Shape, D_CODE::m_Size, m_SlotOn, GERBER_FILE_IMAGE::ReadIJCoord(), GERBER_FILE_IMAGE::ReadXYCoord(), ROUTE_CCW, ROUTE_CW, and GERBER_FILE_IMAGE::StepAndRepeatItem().

Referenced by LoadFile().

◆ Execute_EXCELLON_G_Command()

bool EXCELLON_IMAGE::Execute_EXCELLON_G_Command ( char *&  text)
private

Definition at line 747 of file excellon_read_drill_file.cpp.

748 {
749  EXCELLON_CMD* cmd = NULL;
750  bool success = false;
751  int id = DRILL_G_UNKNOWN;
752 
753  // Search command in list
754  EXCELLON_CMD* candidate;
755  char * gcmd = text; // gcmd points the G command, for error messages.
756 
757  for( unsigned ii = 0; ; ii++ )
758  {
759  candidate = &excellon_G_CmdList[ii];
760  int len = candidate->m_Name.size();
761  if( len == 0 ) // End of list reached
762  break;
763  if( candidate->m_Name.compare( 0, len, text, len ) == 0 ) // found.
764  {
765  cmd = candidate;
766  text += len;
767  success = true;
768  id = cmd->m_Code;
769  break;
770  }
771  }
772 
773  switch( id )
774  {
775  case DRILL_G_ZERO_SET:
776  ReadXYCoord( text, true );
778  break;
779 
780  case DRILL_G_ROUT:
781  m_SlotOn = false;
782 
783  if( m_RouteModeOn )
785 
786  m_RouteModeOn = true;
787  m_RoutePositions.clear();
789  ReadXYCoord( text, true );
790  // This is the first point (starting point) of routing
792  break;
793 
794  case DRILL_G_DRILL:
795  m_SlotOn = false;
796 
797  if( m_RouteModeOn )
799 
800  m_RouteModeOn = false;
801  m_RoutePositions.clear();
803  break;
804 
805  case DRILL_G_SLOT:
806  m_SlotOn = true;
807  break;
808 
809  case DRILL_G_LINEARMOVE:
812  ReadXYCoord( text, true );
814  break;
815 
816  case DRILL_G_CWMOVE:
818  ReadXYCoord( text, true );
819 
820  if( *text == 'I' || *text == 'J' )
821  ReadIJCoord( text );
822 
825  else
827  break;
828 
829  case DRILL_G_CCWMOVE:
831  ReadXYCoord( text, true );
832 
833  if( *text == 'I' || *text == 'J' )
834  ReadIJCoord( text );
835 
838  else
840  break;
841 
842  case DRILL_G_ABSOLUTE:
843  m_Relative = false; // false = absolute coord
844  break;
845 
846  case DRILL_G_INCREMENTAL:
847  m_Relative = true; // true = relative coord
848  break;
849 
850  case DRILL_G_UNKNOWN:
851  default:
852  AddMessageToList( wxString::Format( _( "Unknown Excellon G Code: &lt;%s&gt;" ), FROM_UTF8(gcmd) ) );
853  while( *text )
854  text++;
855  return false;
856  }
857 
858  return success;
859 }
static EXCELLON_CMD excellon_G_CmdList[]
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
wxPoint ReadIJCoord(char *&Text)
Returns the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) These coordinates are rela...
#define ROUTE_CCW
#define ROUTE_CW
std::string m_Name
wxPoint ReadXYCoord(char *&aText, bool aExcellonMode=false)
Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm)
LAST_EXTRA_ARC_DATA_TYPE m_LastArcDataType
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void FinishRouteCommand()
Ends a route command started by M15 ot G01, G02 or G03 command.
std::vector< EXCELLON_ROUTE_COORD > m_RoutePositions

References GERBER_FILE_IMAGE::AddMessageToList(), ARC_INFO_TYPE_CENTER, ARC_INFO_TYPE_NONE, DRILL_G_ABSOLUTE, DRILL_G_CCWMOVE, DRILL_G_CWMOVE, DRILL_G_DRILL, DRILL_G_INCREMENTAL, DRILL_G_LINEARMOVE, DRILL_G_ROUT, DRILL_G_SLOT, DRILL_G_UNKNOWN, DRILL_G_ZERO_SET, excellon_G_CmdList, FinishRouteCommand(), Format(), FROM_UTF8(), GERB_INTERPOL_ARC_NEG, GERB_INTERPOL_ARC_POS, GERB_INTERPOL_LINEAR_1X, GERBER_FILE_IMAGE::m_ArcRadius, EXCELLON_CMD::m_Code, GERBER_FILE_IMAGE::m_CurrentPos, GERBER_FILE_IMAGE::m_IJPos, GERBER_FILE_IMAGE::m_Iterpolation, GERBER_FILE_IMAGE::m_LastArcDataType, EXCELLON_CMD::m_Name, GERBER_FILE_IMAGE::m_Offset, GERBER_FILE_IMAGE::m_Relative, m_RouteModeOn, m_RoutePositions, m_SlotOn, GERBER_FILE_IMAGE::ReadIJCoord(), GERBER_FILE_IMAGE::ReadXYCoord(), ROUTE_CCW, and ROUTE_CW.

Referenced by Execute_Drill_Command(), and LoadFile().

◆ Execute_HEADER_And_M_Command()

bool EXCELLON_IMAGE::Execute_HEADER_And_M_Command ( char *&  text)
private

Definition at line 405 of file excellon_read_drill_file.cpp.

406 {
407  EXCELLON_CMD* cmd = NULL;
408  wxString msg;
409 
410  // Search command in list
411  for( unsigned ii = 0; ; ii++ )
412  {
413  EXCELLON_CMD* candidate = &excellonHeaderCmdList[ii];
414  int len = candidate->m_Name.size();
415 
416  if( len == 0 ) // End of list reached
417  break;
418 
419  if( candidate->m_Name.compare( 0, len, text, len ) == 0 ) // found.
420  {
421  cmd = candidate;
422  text += len;
423  break;
424  }
425  }
426 
427  if( !cmd )
428  {
429  msg.Printf( _( "Unknown Excellon command &lt;%s&gt;" ), text );
430  AddMessageToList( msg );
431  while( *text )
432  text++;
433 
434  return false;
435  }
436 
437  // Execute command
438  // some do nothing
439  switch( cmd->m_Code )
440  {
441  case DRILL_SKIP:
442  case DRILL_M_UNKNOWN:
443  break;
444 
445  case DRILL_M_END:
446  case DRILL_M_ENDFILE:
447  // if a route command is in progress, finish it
448  if( m_RouteModeOn )
450 
451  break;
452 
453  case DRILL_M_MESSAGE:
454  break;
455 
456  case DRILL_M_LONGMESSAGE:
457  break;
458 
459  case DRILL_M_HEADER:
461  break;
462 
463  case DRILL_M_ENDHEADER:
465  break;
466 
467  case DRILL_REWIND_STOP: // End of header. No action in a viewer
469  break;
470 
471  case DRILL_M_METRIC:
472  SelectUnits( true );
473  break;
474 
475  case DRILL_IMPERIAL_HEADER: // command like INCH,TZ or INCH,LZ
476  case DRILL_METRIC_HEADER: // command like METRIC,TZ or METRIC,LZ
477  SelectUnits( cmd->m_Code == DRILL_METRIC_HEADER ? true : false );
478 
479  if( *text != ',' )
480  {
481  // No TZ or LZ specified. Should be a decimal format
482  // but this is not always the case. Use default TZ setting as default
483  m_NoTrailingZeros = false;
484  break;
485  }
486 
487  text++; // skip separator
488  if( *text == 'T' )
489  m_NoTrailingZeros = false;
490  else
491  m_NoTrailingZeros = true;
492  break;
493 
495  break;
496 
497  case DRILL_M_ENDPATTERN:
498  break;
499 
500  case DRILL_M_CANNEDTEXT:
501  break;
502 
503  case DRILL_M_TIPCHECK:
504  break;
505 
506  case DRILL_DETECT_BROKEN:
507  break;
508 
510  if( *text != ',' )
511  {
512  AddMessageToList( "ICI command has no parameter" );
513  break;
514  }
515  text++; // skip separator
516  // Parameter should be ON or OFF
517  if( strncasecmp( text, "OFF", 3 ) == 0 )
518  m_Relative = false;
519  else if( strncasecmp( text, "ON", 2 ) == 0 )
520  m_Relative = true;
521  else
522  AddMessageToList( "ICI command has incorrect parameter" );
523  break;
524 
526  break;
527 
529  break;
530 
531  case DRILL_AXIS_VERSION:
532  break;
533 
534  case DRILL_RESET_CMD:
535  break;
536 
538  break;
539 
540  case DRILL_FMT:
541  break;
542 
544  readToolInformation( text );
545  break;
546 
547  case DRILL_M_TOOL_DOWN: // tool down (starting a routed hole or polyline)
548  // Only the last position is usefull:
549  if( m_RoutePositions.size() > 1 )
550  m_RoutePositions.erase( m_RoutePositions.begin(), m_RoutePositions.begin() + m_RoutePositions.size() - 1 );
551 
552  break;
553 
554  case DRILL_M_TOOL_UP: // tool up (ending a routed polyline)
556  break;
557  }
558 
559  while( *text )
560  text++;
561 
562  return true;
563 }
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
static EXCELLON_CMD excellonHeaderCmdList[]
std::string m_Name
excellon_state m_State
bool readToolInformation(char *&aText)
Read a tool definition like T1C0.02 or T1F00S00C0.02 or T1C0.02F00S00 and enter params in TCODE list.
void FinishRouteCommand()
Ends a route command started by M15 ot G01, G02 or G03 command.
std::vector< EXCELLON_ROUTE_COORD > m_RoutePositions
void SelectUnits(bool aMetric)

References GERBER_FILE_IMAGE::AddMessageToList(), DRILL_AUTOMATIC_SPEED, DRILL_AUTOMATIC_TOOL_CHANGE, DRILL_AXIS_VERSION, DRILL_DETECT_BROKEN, DRILL_FMT, DRILL_IMPERIAL_HEADER, DRILL_INCREMENTALHEADER, DRILL_M_BEGINPATTERN, DRILL_M_CANNEDTEXT, DRILL_M_END, DRILL_M_ENDFILE, DRILL_M_ENDHEADER, DRILL_M_ENDPATTERN, DRILL_M_HEADER, DRILL_M_LONGMESSAGE, DRILL_M_MESSAGE, DRILL_M_METRIC, DRILL_M_TIPCHECK, DRILL_M_TOOL_DOWN, DRILL_M_TOOL_UP, DRILL_M_UNKNOWN, DRILL_METRIC_HEADER, DRILL_RESET_CMD, DRILL_REWIND_STOP, DRILL_SKIP, DRILL_TOOL_CHANGE_STOP, DRILL_TOOL_INFORMATION, excellonHeaderCmdList, FinishRouteCommand(), EXCELLON_CMD::m_Code, EXCELLON_CMD::m_Name, GERBER_FILE_IMAGE::m_NoTrailingZeros, GERBER_FILE_IMAGE::m_Relative, m_RouteModeOn, m_RoutePositions, m_State, READ_HEADER_STATE, READ_PROGRAM_STATE, readToolInformation(), and SelectUnits().

Referenced by LoadFile().

◆ FindApertureMacro()

APERTURE_MACRO * GERBER_FILE_IMAGE::FindApertureMacro ( const APERTURE_MACRO aLookup)
inherited

Function FindApertureMacro looks up a previously read in aperture macro.

Parameters
aLookupA dummy APERTURE_MACRO with [only] the name field set.
Returns
APERTURE_MACRO* - the one with a matching name, or NULL if not found.

Definition at line 164 of file gerber_file_image.cpp.

165 {
166  APERTURE_MACRO_SET::iterator iter = m_aperture_macros.find( aLookup );
167 
168  if( iter != m_aperture_macros.end() )
169  {
170  APERTURE_MACRO* pam = (APERTURE_MACRO*) &(*iter);
171  return pam;
172  }
173 
174  return NULL; // not found
175 }
APERTURE_MACRO_SET m_aperture_macros
a collection of APERTURE_MACROS, sorted by name
Struct APERTURE_MACRO helps support the "aperture macro" defined within standard RS274X.
Definition: am_primitive.h:163

References GERBER_FILE_IMAGE::m_aperture_macros.

Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ FinishRouteCommand()

void EXCELLON_IMAGE::FinishRouteCommand ( )
private

Ends a route command started by M15 ot G01, G02 or G03 command.

Definition at line 892 of file excellon_read_drill_file.cpp.

893 {
894  // Ends a route command started by M15 ot G01, G02 or G03 command
895  // if a route command is not in progress, do nothing
896 
897  if( !m_RouteModeOn )
898  return;
899 
900  D_CODE* tool = GetDCODE( m_Current_Tool );
901 
902  if( !tool )
903  {
904  AddMessageToList( wxString::Format( "Unknown tool code %d", m_Current_Tool ) );
905  return;
906  }
907 
908  for( size_t ii = 1; ii < m_RoutePositions.size(); ii++ )
909  {
910  GERBER_DRAW_ITEM* gbritem = new GERBER_DRAW_ITEM( this );
911 
912  if( m_RoutePositions[ii].m_rmode == 0 ) // linear routing
913  {
914  fillLineGBRITEM( gbritem, tool->m_Num_Dcode,
915  m_RoutePositions[ii-1].GetPos(), m_RoutePositions[ii].GetPos(),
916  tool->m_Size, false );
917  }
918  else // circular (cw or ccw) routing
919  {
920  bool rot_ccw = m_RoutePositions[ii].m_rmode == ROUTE_CW;
921  int radius = m_RoutePositions[ii].m_radius; // Can be adjusted by computeCenter.
922  wxPoint center;
923 
924  if( m_RoutePositions[ii].m_arc_type_info == ARC_INFO_TYPE_CENTER )
925  center = wxPoint( m_RoutePositions[ii].m_cx, m_RoutePositions[ii].m_cy );
926  else
927  center = computeCenter( m_RoutePositions[ii-1].GetPos(),
928  m_RoutePositions[ii].GetPos(), radius, rot_ccw );
929 
930  fillArcGBRITEM( gbritem, tool->m_Num_Dcode,
931  m_RoutePositions[ii-1].GetPos(), m_RoutePositions[ii].GetPos(),
932  center - m_RoutePositions[ii-1].GetPos(),
933  tool->m_Size, not rot_ccw , true,
934  false );
935  }
936 
937  m_Drawings.Append( gbritem );
938 
939  StepAndRepeatItem( *gbritem );
940  }
941 
942  m_RoutePositions.clear();
943  m_RouteModeOn = false;
944 }
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
void Append(T *aNewElement)
Function Append adds aNewElement to the end of the list.
Definition: dlist.h:177
static wxPoint computeCenter(wxPoint aStart, wxPoint aEnd, int &aRadius, bool aRotCCW)
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE.
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
#define ROUTE_CW
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
DLIST< GERBER_DRAW_ITEM > m_Drawings
std::vector< EXCELLON_ROUTE_COORD > m_RoutePositions
void StepAndRepeatItem(const GERBER_DRAW_ITEM &aItem)
Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called wh...
void fillArcGBRITEM(GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &aRelCenter, wxSize aPenSize, bool aClockwise, bool aMultiquadrant, bool aLayerNegative)
Function fillArcGBRITEM initializes a given GBRITEM so that it can draw an arc G code.
Definition: rs274d.cpp:207
void fillLineGBRITEM(GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const wxPoint &aStart, const wxPoint &aEnd, wxSize aPenSize, bool aLayerNegative)
Function fillLineGBRITEM initializes a given GBRITEM so that it can draw a linear D code.
Definition: rs274d.cpp:158

References GERBER_FILE_IMAGE::AddMessageToList(), DLIST< T >::Append(), ARC_INFO_TYPE_CENTER, computeCenter(), fillArcGBRITEM(), fillLineGBRITEM(), Format(), GERBER_FILE_IMAGE::GetDCODE(), GERBER_FILE_IMAGE::m_Current_Tool, GERBER_FILE_IMAGE::m_Drawings, D_CODE::m_Num_Dcode, m_RouteModeOn, m_RoutePositions, D_CODE::m_Size, ROUTE_CW, and GERBER_FILE_IMAGE::StepAndRepeatItem().

Referenced by Execute_EXCELLON_G_Command(), and Execute_HEADER_And_M_Command().

◆ GCodeNumber()

int GERBER_FILE_IMAGE::GCodeNumber ( char *&  Text)
inherited

Definition at line 411 of file rs274d.cpp.

412 {
413  int ii = 0;
414  char* text;
415  char line[1024];
416 
417  if( Text == NULL )
418  return 0;
419  Text++;
420  text = line;
421  while( IsNumber( *Text ) )
422  {
423  *(text++) = *(Text++);
424  }
425 
426  *text = 0;
427  ii = atoi( line );
428  return ii;
429 }
#define IsNumber(x)

References IsNumber.

Referenced by GERBER_FILE_IMAGE::LoadGerberFile().

◆ GetBoundingBox()

const EDA_RECT EDA_ITEM::GetBoundingBox ( ) const
virtualinherited

Function GetBoundingBox returns 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 in BOARD, D_PAD, SCH_SHEET, LIB_PART, SCH_COMPONENT, SCH_HIERLABEL, SCH_GLOBALLABEL, DIMENSION, GERBER_DRAW_ITEM, LIB_ITEM, SCH_LABEL, DRAWSEGMENT, TEXTE_MODULE, LIB_FIELD, MODULE, SCH_TEXT, TRACK, ZONE_CONTAINER, LIB_PIN, SCH_FIELD, TEXTE_PCB, SCH_LINE, MARKER_PCB, SCH_BITMAP, LIB_ALIAS, GBR_LAYOUT, PCB_TARGET, LIB_TEXT, SCH_BUS_ENTRY_BASE, LIB_ARC, LIB_BEZIER, LIB_POLYLINE, SCH_PIN, LIB_RECTANGLE, SCH_NO_CONNECT, LIB_CIRCLE, SCH_JUNCTION, and SCH_MARKER.

Definition at line 110 of file base_struct.cpp.

111 {
112 #if defined(DEBUG)
113  printf( "Missing GetBoundingBox()\n" );
114  Show( 0, std::cout ); // tell me which classes still need GetBoundingBox support
115 #endif
116 
117  // return a zero-sized box per default. derived classes should override
118  // this
119  return EDA_RECT( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
120 }
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), CN_ITEM::BBox(), MODULE::CoverageRatio(), LIB_ITEM::GetBoundingBox(), GetBoundingBoxes(), getRect(), getSheetBbox(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), SCH_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Rotate(), and EDA_ITEM::ViewBBox().

◆ GetClass()

wxString GERBER_FILE_IMAGE::GetClass ( ) const
inlineoverridevirtualinherited

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 245 of file gerber_file_image.h.

246  {
247  return wxT( "GERBER_FILE_IMAGE" );
248  }

Referenced by GERBER_FILE_IMAGE::Visit().

◆ GetDCODE()

D_CODE * GERBER_FILE_IMAGE::GetDCODE ( int  aDCODE) const
inherited

Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE.

Parameters
aDCODEThe numeric value of the D_CODE to look up.
Returns
D_CODE* - the one implied by the given aDCODE, or NULL if the requested aDCODE is out of range.

Definition at line 151 of file gerber_file_image.cpp.

152 {
153  unsigned ndx = aDCODE - FIRST_DCODE;
154 
155  if( ndx < (unsigned) arrayDim( m_Aperture_List ) )
156  {
157  return m_Aperture_List[ndx];
158  }
159 
160  return NULL;
161 }
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
#define FIRST_DCODE
Definition: dcode.h:71
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:107

References arrayDim(), FIRST_DCODE, and GERBER_FILE_IMAGE::m_Aperture_List.

Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command(), Execute_Drill_Command(), GERBER_FILE_IMAGE::Execute_G_Command(), FinishRouteCommand(), GERBER_DRAW_ITEM::GetDcodeDescr(), GERBVIEW_FRAME::Liste_D_Codes(), Select_Tool(), GERBVIEW_FRAME::updateAperAttributesSelectBox(), and GERBVIEW_FRAME::updateDCodeSelectBox().

◆ GetDCODEOrCreate()

D_CODE * GERBER_FILE_IMAGE::GetDCODEOrCreate ( int  aDCODE,
bool  aCreateIfNoExist = true 
)
inherited

Function GetDCODEOrCreate returns a pointer to the D_CODE within this GERBER for the given aDCODE.

Parameters
aDCODEThe numeric value of the D_CODE to look up.
aCreateIfNoExistIf true, then create the D_CODE if it does not exist in list.
Returns
D_CODE* - the one implied by the given aDCODE, or NULL if the requested aDCODE is out of range.

Definition at line 131 of file gerber_file_image.cpp.

132 {
133  unsigned ndx = aDCODE - FIRST_DCODE;
134 
135  if( ndx < (unsigned) arrayDim( m_Aperture_List ) )
136  {
137  // lazily create the D_CODE if it does not exist.
138  if( aCreateIfNoExist )
139  {
140  if( m_Aperture_List[ndx] == NULL )
141  m_Aperture_List[ndx] = new D_CODE( ndx + FIRST_DCODE );
142  }
143 
144  return m_Aperture_List[ndx];
145  }
146 
147  return NULL;
148 }
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
#define FIRST_DCODE
Definition: dcode.h:71
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:107
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82

References arrayDim(), FIRST_DCODE, and GERBER_FILE_IMAGE::m_Aperture_List.

Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand(), readToolInformation(), and Select_Tool().

◆ GetDcodesCount()

int GERBER_FILE_IMAGE::GetDcodesCount ( )
inherited
Returns
the count of Dcode tools in used by the image

Definition at line 265 of file gerber_file_image.cpp.

266 {
267  int count = 0;
268 
269  for( unsigned ii = 0; ii < arrayDim( m_Aperture_List ); ii++ )
270  {
271  if( m_Aperture_List[ii] )
272  if( m_Aperture_List[ii]->m_InUse || m_Aperture_List[ii]->m_Defined )
273  ++count;
274  }
275 
276  return count;
277 }
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:107

References arrayDim(), GERBER_FILE_IMAGE::m_Aperture_List, and GERBER_FILE_IMAGE::m_InUse.

Referenced by GERBVIEW_FRAME::Liste_D_Codes(), GERBVIEW_FRAME::updateAperAttributesSelectBox(), and GERBVIEW_FRAME::updateDCodeSelectBox().

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 263 of file base_struct.h.

264  {
268  return m_Flags & mask;
269  }
#define END_ONPAD
Pcbnew: flag set for track segment ending on a pad.
Definition: base_struct.h:133
#define BEGIN_ONPAD
Pcbnew: flag set for track segment starting on a pad.
Definition: base_struct.h:132
#define EDA_ITEM_ALL_FLAGS
Definition: base_struct.h:148
#define SELECTED
Definition: base_struct.h:121
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:137
#define DP_COUPLED
item is coupled with another item making a differential pair
Definition: base_struct.h:139
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:136
#define IS_DANGLING
indicates a pin is dangling
Definition: base_struct.h:143
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:120
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:119

References BEGIN_ONPAD, BRIGHTENED, DP_COUPLED, EDA_ITEM_ALL_FLAGS, END_ONPAD, ENDPOINT, HIGHLIGHTED, IS_DANGLING, EDA_ITEM::m_Flags, SELECTED, and STARTPOINT.

Referenced by AbortMoveAndEditTarget(), SCH_EDIT_TOOL::ChangeShape(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::ConvertTextType(), PCB_EDIT_FRAME::createPopUpMenuForFootprints(), PCB_EDIT_FRAME::createPopUpMenuForFpPads(), PCB_EDIT_FRAME::createPopUpMenuForFpTexts(), PCB_EDIT_FRAME::createPopUpMenuForTexts(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::createPopUpMenuForZones(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteJunction(), PCB_BASE_FRAME::DeleteTextModule(), BOARD::Draw(), PCB_EDIT_FRAME::Edit_TrackSegm_Width(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_VIEW_FRAME::GeneralControl(), FOOTPRINT_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), TRACKS_CLEANER::removeDuplicatesOfTrack(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), PCB_BASE_FRAME::RotateTextModule(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ GetFlags()

◆ GetItemsList()

◆ GetLayerParams()

GERBER_LAYER& GERBER_FILE_IMAGE::GetLayerParams ( )
inlineinherited

◆ GetList()

DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited

◆ GetMenuImage()

BITMAP_DEF EDA_ITEM::GetMenuImage ( ) const
virtualinherited

Function GetMenuImage returns 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 in D_PAD, ZONE_CONTAINER, MODULE, SCH_COMPONENT, SCH_SHEET, LIB_PIN, VIA, GERBER_DRAW_ITEM, SCH_HIERLABEL, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, DIMENSION, SCH_LABEL, LIB_FIELD, TEXTE_MODULE, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_TEXT, SCH_LINE, SCH_SHEET_PIN, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, LIB_ARC, EDGE_MODULE, LIB_TEXT, TEXTE_PCB, LIB_POLYLINE, MARKER_PCB, PCB_TARGET, LIB_RECTANGLE, LIB_CIRCLE, SCH_NO_CONNECT, SCH_JUNCTION, and SCH_MARKER.

Definition at line 272 of file base_struct.cpp.

273 {
274  return dummy_xpm;
275 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: base_struct.cpp:56

References dummy_xpm.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), and PCB_BASE_FRAME::PcbGeneralLocateAndDisplay().

◆ GetMessages()

const wxArrayString& GERBER_FILE_IMAGE::GetMessages ( ) const
inlineinherited

◆ GetMsgPanelInfo()

virtual void EDA_ITEM::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
inlinevirtualinherited

Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.

Note
This method replaces DisplayInfo() so that KiCad objects no longer have any knowledge of wxWidgets UI objects.
Parameters
aListis the list to populate.

Reimplemented in BOARD, D_PAD, MODULE, SCH_SHEET, SCH_COMPONENT, GERBER_DRAW_ITEM, NETINFO_ITEM, LIB_ITEM, TRACK, DIMENSION, DRAWSEGMENT, TEXTE_MODULE, SCH_LINE, SCH_TEXT, LIB_FIELD, EDGE_MODULE, LIB_PIN, SCH_BUS_ENTRY_BASE, MARKER_PCB, LIB_BEZIER, ZONE_CONTAINER, LIB_TEXT, LIB_ARC, LIB_POLYLINE, SCH_MARKER, TEXTE_PCB, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 321 of file base_struct.h.

322  {
323  }

Referenced by EDA_DRAW_FRAME::SetMsgPanel(), EE_INSPECTION_TOOL::UpdateMessagePanel(), FOOTPRINT_VIEWER_FRAME::UpdateMsgPanel(), FOOTPRINT_WIZARD_FRAME::UpdateMsgPanel(), PCB_BASE_FRAME::UpdateMsgPanel(), and FOOTPRINT_EDIT_FRAME::UpdateMsgPanel().

◆ GetParent()

◆ GetPositiveDrawColor()

COLOR4D GERBER_FILE_IMAGE::GetPositiveDrawColor ( ) const
inlineinherited

Definition at line 270 of file gerber_file_image.h.

270 { return m_PositiveDrawColor; }

References GERBER_FILE_IMAGE::m_PositiveDrawColor.

Referenced by GBR_LAYOUT::Draw(), and GERBER_DRAW_ITEM::Draw().

◆ GetSelectMenuText()

wxString EDA_ITEM::GetSelectMenuText ( EDA_UNITS_T  aUnits) const
virtualinherited

Function GetSelectMenuText returns 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 in D_PAD, ZONE_CONTAINER, MODULE, SCH_COMPONENT, BOARD, SCH_SHEET, LIB_PIN, VIA, GERBER_DRAW_ITEM, SCH_HIERLABEL, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, DIMENSION, SCH_LABEL, LIB_FIELD, TEXTE_MODULE, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_TEXT, SCH_LINE, SCH_SHEET_PIN, DELETED_SCH_ITEM, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, LIB_ARC, EDGE_MODULE, LIB_TEXT, TEXTE_PCB, LIB_POLYLINE, MARKER_PCB, PCB_TARGET, LIB_RECTANGLE, LIB_CIRCLE, SCH_NO_CONNECT, SCH_JUNCTION, SCH_MARKER, DELETED_BOARD_ITEM, and SCH_PIN.

Definition at line 165 of file base_struct.cpp.

166 {
167  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
168  GetClass() );
169 
170  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
171 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.

References EDA_ITEM::GetClass().

Referenced by CONNECTION_GRAPH::buildConnectionGraph(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), CONNECTION_GRAPH::ercCheckBusToBusConflicts(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckBusToNetConflicts(), SCH_FIND_COLLECTOR::GetText(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), DRC_ITEM::SetData(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

◆ GetState()

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 256 of file base_struct.h.

256 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:167

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ GetTimeStamp()

◆ HasNegativeItems()

bool GERBER_FILE_IMAGE::HasNegativeItems ( )
inherited

Function HasNegativeItems.

Returns
true if at least one item must be drawn in background color used to optimize screen refresh (when no items are in background color refresh can be faster)

Definition at line 241 of file gerber_file_image.cpp.

242 {
243  if( m_hasNegativeItems < 0 ) // negative items are not yet searched: find them if any
244  {
245  if( m_ImageNegative ) // A negative layer is expected having always negative objects.
246  m_hasNegativeItems = 1;
247  else
248  {
249  m_hasNegativeItems = 0;
250  for( GERBER_DRAW_ITEM* item = GetItemsList(); item; item = item->Next() )
251  {
252  if( item->GetLayer() != m_GraphicLayer )
253  continue;
254  if( item->HasNegativeItems() )
255  {
256  m_hasNegativeItems = 1;
257  break;
258  }
259  }
260  }
261  }
262  return m_hasNegativeItems == 1;
263 }
GERBER_DRAW_ITEM * Next() const
GERBER_DRAW_ITEM * GetItemsList()
Function GetItemsList.

References GERBER_FILE_IMAGE::GetItemsList(), GERBER_FILE_IMAGE::m_GraphicLayer, GERBER_FILE_IMAGE::m_hasNegativeItems, GERBER_FILE_IMAGE::m_ImageNegative, and GERBER_DRAW_ITEM::Next().

Referenced by GBR_LAYOUT::Draw().

◆ HitTest() [1/2]

virtual bool EDA_ITEM::HitTest ( const wxPoint &  aPosition,
int  aAccuracy = 0 
) const
inlinevirtualinherited

Function HitTest tests if aPosition is contained within or on the bounding box of an item.

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
aAccuracyIncrease the item bounding box by this amount.
Returns
True if aPosition is within the item bounding box.

Reimplemented in D_PAD, SCH_COMPONENT, SCH_SHEET, MODULE, VIA, ZONE_CONTAINER, GERBER_DRAW_ITEM, TRACK, DIMENSION, DRAWSEGMENT, LIB_ITEM, TEXTE_MODULE, SCH_FIELD, SCH_LINE, SCH_TEXT, SCH_SHEET_PIN, LIB_FIELD, SCH_BITMAP, LIB_PIN, SCH_BUS_ENTRY_BASE, SCH_NO_CONNECT, MARKER_PCB, SCH_JUNCTION, SCH_MARKER, PCB_TARGET, LIB_TEXT, TEXTE_PCB, LIB_ARC, LIB_BEZIER, LIB_POLYLINE, SCH_PIN, LIB_RECTANGLE, LIB_CIRCLE, and KIGFX::RATSNEST_VIEWITEM.

Definition at line 333 of file base_struct.h.

334  {
335  return false; // derived classes should override this function
336  }

Referenced by SCH_MOVE_TOOL::getConnectedDragItems(), LIB_ITEM::HitTest(), EE_COLLECTOR::Inspect(), GERBER_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), EE_SELECTION_TOOL::selectMultiple(), and SELECTION_TOOL::selectMultiple().

◆ HitTest() [2/2]

virtual bool EDA_ITEM::HitTest ( const EDA_RECT aRect,
bool  aContained,
int  aAccuracy = 0 
) const
inlinevirtualinherited

Function HitTest tests if aRect intersects or is contained within the bounding box of an item.

Parameters
aRectA reference to a EDA_RECT object containing the rectangle to test.
aContainedSet to true to test for containment instead of an intersection.
aAccuracyIncrease aRect by this amount.
Returns
True if aRect contains or intersects the item bounding box.

Reimplemented in D_PAD, SCH_COMPONENT, SCH_SHEET, MODULE, VIA, ZONE_CONTAINER, GERBER_DRAW_ITEM, TRACK, DIMENSION, LIB_ITEM, DRAWSEGMENT, TEXTE_MODULE, SCH_FIELD, SCH_LINE, SCH_TEXT, SCH_BITMAP, SCH_BUS_ENTRY_BASE, SCH_NO_CONNECT, SCH_JUNCTION, PCB_TARGET, TEXTE_PCB, LIB_TEXT, LIB_ARC, LIB_BEZIER, LIB_POLYLINE, and LIB_CIRCLE.

Definition at line 347 of file base_struct.h.

348  {
349  return false; // derived classes should override this function
350  }

◆ InitToolTable()

void GERBER_FILE_IMAGE::InitToolTable ( )
inherited

Function InitToolTable.

Definition at line 280 of file gerber_file_image.cpp.

281 {
282  for( int count = 0; count < TOOLS_MAX_COUNT; count++ )
283  {
284  if( m_Aperture_List[count] == NULL )
285  continue;
286 
287  m_Aperture_List[count]->m_Num_Dcode = count + FIRST_DCODE;
289  }
290 
291  m_aperture_macros.clear();
292 }
APERTURE_MACRO_SET m_aperture_macros
a collection of APERTURE_MACROS, sorted by name
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
#define FIRST_DCODE
Definition: dcode.h:71
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
void Clear_D_CODE_Data()
Definition: dcode.cpp:79

References D_CODE::Clear_D_CODE_Data(), FIRST_DCODE, GERBER_FILE_IMAGE::m_Aperture_List, GERBER_FILE_IMAGE::m_aperture_macros, D_CODE::m_Num_Dcode, and TOOLS_MAX_COUNT.

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

Definition at line 230 of file base_struct.h.

230 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:137
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181

References BRIGHTENED, and EDA_ITEM::m_Flags.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), and KIGFX::SCH_PAINTER::getRenderColor().

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

◆ IsHighlighted()

bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 229 of file base_struct.h.

229 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:136
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181

References HIGHLIGHTED, and EDA_ITEM::m_Flags.

Referenced by KIGFX::SCH_PAINTER::getRenderColor().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 223 of file base_struct.h.

223 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:110
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

bool EDA_ITEM::IsNew ( ) const
inlineinherited

Definition at line 222 of file base_struct.h.

222 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:114
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181

References IS_NEW, and EDA_ITEM::m_Flags.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_MoveOrCopyModule(), Abort_Zone_Create_Outline(), AbortBuildDimension(), AbortMoveAndEditTarget(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_EDIT_TOOL::AutoplaceFields(), LIB_CIRCLE::CalcEdit(), LIB_RECTANGLE::CalcEdit(), LIB_FIELD::CalcEdit(), LIB_POLYLINE::CalcEdit(), LIB_ARC::CalcEdit(), LIB_TEXT::CalcEdit(), LIB_POLYLINE::ContinueEdit(), LIB_ARC::ContinueEdit(), SCH_EDIT_TOOL::ConvertDeMorgan(), SCH_EDIT_FRAME::ConvertTextType(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Segment_Edge(), LIB_ARC::drawGraphic(), LIB_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), LIB_PIN::EnableEditMode(), LIB_DRAWING_TOOLS::Init(), isNewSegment(), SCH_MOVE_TOOL::Main(), LIB_MOVE_TOOL::Main(), EDIT_TOOL::MoveExact(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_BASE_FRAME::PlaceModule(), LIB_PIN_TOOL::PlacePin(), PCB_EDIT_FRAME::PlaceTarget(), ShowClearance(), PCB_EDIT_FRAME::StartMoveTextePcb(), PCB_EDIT_FRAME::SwitchLayer(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), and DIALOG_LABEL_EDITOR::TransferDataFromWindow().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

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

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

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

Definition at line 502 of file base_struct.h.

502 { return false; }

Referenced by EDA_ITEM::Matches(), and EDA_ITEM::Replace().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 228 of file base_struct.h.

228 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:115

References IS_RESIZED, and EDA_ITEM::m_Flags.

Referenced by LIB_POLYLINE::CalcEdit(), and KIGFX::SCH_PAINTER::setColors().

◆ IsSelected()

◆ IsType()

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

Function IsType Checks 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 SCH_FIELD, and SCH_LINE.

Definition at line 287 of file base_struct.h.

288  {
289  if( aScanTypes[0] == SCH_LOCATE_ANY_T )
290  return true;
291 
292  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
293  {
294  if( m_StructType == *p )
295  return true;
296  }
297 
298  return false;
299  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:166
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78

References EOT, EDA_ITEM::m_StructType, and SCH_LOCATE_ANY_T.

Referenced by SCH_SCREEN::GetItem(), SCH_WIRE_BUS_TOOL::IsDrawingBus(), SCH_WIRE_BUS_TOOL::IsDrawingLine(), SCH_WIRE_BUS_TOOL::IsDrawingWire(), SCH_LINE::IsType(), SCH_FIELD::IsType(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), and EDA_ITEM::Visit().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 226 of file base_struct.h.

226 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ IterateForward()

SEARCH_RESULT EDA_ITEM::IterateForward ( EDA_ITEM listStart,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
staticinherited

Function IterateForward walks through the object tree calling the inspector() on each object type requested in scanTypes.

Parameters
listStartThe first in a list of EDA_ITEMs to iterate over.
inspectorIs an INSPECTOR to call on each object that is one of the requested scanTypes.
testDataIs an aid to testFunc, and should be sufficient to allow it to fully determine if an item meets the match criteria, but it may also be used to collect output.
scanTypesA KICAD_T array that is EOT terminated, and provides both the order and interest level of of the types of objects to be iterated over.
Returns
SEARCH_RESULT SEARCH_QUIT if the called INSPECTOR returned SEARCH_QUIT, else SCAN_CONTINUE;

Definition at line 130 of file base_struct.cpp.

134 {
135  EDA_ITEM* p = listStart;
136 
137  for( ; p; p = p->Pnext )
138  {
139  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
140  return SEARCH_QUIT;
141  }
142 
143  return SEARCH_CONTINUE;
144 }
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function Visit may be re-implemented for each derived class in order to handle all the types given by...
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:170

References EDA_ITEM::Pnext, SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Visit().

Referenced by EE_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::Collect(), EE_TYPE_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::GetItem(), EE_SELECTION_TOOL::RebuildSelection(), GERBER_FILE_IMAGE::Visit(), MODULE::Visit(), and BOARD::Visit().

◆ LoadFile()

bool EXCELLON_IMAGE::LoadFile ( const wxString &  aFullFileName)

Read and load a drill (EXCELLON format) file.

Parameters
aFullFileName= the full filename of the Gerber file when the file cannot be loaded Warning and info messages are stored in m_Messages
Returns
bool if OK, false if the gerber file was not loaded

Definition at line 316 of file excellon_read_drill_file.cpp.

317 {
318  // Set the default parmeter values:
321 
322  m_Current_File = wxFopen( aFullFileName, "rt" );
323 
324  if( m_Current_File == NULL )
325  return false;
326 
327  wxString msg;
328  m_FileName = aFullFileName;
329 
330  LOCALE_IO toggleIo;
331 
332  // FILE_LINE_READER will close the file.
333  FILE_LINE_READER excellonReader( m_Current_File, m_FileName );
334 
335  while( true )
336  {
337  if( excellonReader.ReadLine() == 0 )
338  break;
339 
340  char* line = excellonReader.Line();
341  char* text = StrPurge( line );
342 
343  if( *text == ';' || *text == 0 ) // comment: skip line or empty malformed line
344  continue;
345 
347  {
349  }
350  else
351  {
352  switch( *text )
353  {
354  case 'M':
356  break;
357 
358  case 'G': // Line type Gxx : command
360  break;
361 
362  case 'X':
363  case 'Y': // command like X12550Y19250
364  Execute_Drill_Command(text);
365  break;
366 
367  case 'I':
368  case 'J': /* Auxiliary Move command */
369  m_IJPos = ReadIJCoord( text );
370  if( *text == '*' ) // command like X35142Y15945J504
371  {
372  Execute_Drill_Command( text);
373  }
374  break;
375 
376  case 'T': // Tool command
377  Select_Tool( text );
378  break;
379 
380  case '%':
381  break;
382 
383  default:
384  msg.Printf( "Unexpected symbol 0x%2.2X &lt;%c&gt;", *text, *text );
385  AddMessageToList( msg );
386  break;
387  } // End switch
388  }
389  }
390 
391  // Add our file attribute, to identify the drill file
393  char* text = (char*)file_attribute;
394  int dummyline = 0;
395  dummy.ParseAttribCmd( NULL, NULL, 0, text, dummyline );
396  delete m_FileFunction;
398 
399  m_InUse = true;
400 
401  return true;
402 }
class X2_ATTRIBUTE_FILEFUNCTION ( from TF.FileFunction in Gerber file) Example file function: TF....
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
X2_ATTRIBUTE_FILEFUNCTION * m_FileFunction
class X2_ATTRIBUTE The attribute value consists of a number of substrings separated by a comma
char * StrPurge(char *text)
Remove leading and training spaces, tabs and end of line chars in text.
Definition: string.cpp:298
virtual void ResetDefaultValues() override
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:177
wxPoint ReadIJCoord(char *&Text)
Returns the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) These coordinates are rela...
void ClearMessageList()
Function ClearMessageList Clear the message list Call it before reading a Gerber file.
bool Select_Tool(char *&text)
Class FILE_LINE_READER is a LINE_READER that reads from an open file.
Definition: richio.h:180
bool Execute_HEADER_And_M_Command(char *&text)
bool Execute_Drill_Command(char *&text)
excellon_state m_State
static const char file_attribute[]
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
bool Execute_EXCELLON_G_Command(char *&text)

References GERBER_FILE_IMAGE::AddMessageToList(), GERBER_FILE_IMAGE::ClearMessageList(), dummy(), Execute_Drill_Command(), Execute_EXCELLON_G_Command(), Execute_HEADER_And_M_Command(), file_attribute, LINE_READER::Line(), GERBER_FILE_IMAGE::m_Current_File, GERBER_FILE_IMAGE::m_FileFunction, GERBER_FILE_IMAGE::m_FileName, GERBER_FILE_IMAGE::m_IJPos, GERBER_FILE_IMAGE::m_InUse, m_State, READ_HEADER_STATE, GERBER_FILE_IMAGE::ReadIJCoord(), FILE_LINE_READER::ReadLine(), ResetDefaultValues(), Select_Tool(), and StrPurge().

Referenced by GERBVIEW_FRAME::Read_EXCELLON_File().

◆ LoadGerberFile()

bool GERBER_FILE_IMAGE::LoadGerberFile ( const wxString &  aFullFileName)
inherited

Read and load a gerber file.

Parameters
aFullFileName= the full filename of the Gerber file when the file cannot be loaded Warning and info messages are stored in m_messagesList
Returns
bool if OK, false if the gerber file was not loaded

Definition at line 117 of file readgerb.cpp.

118 {
119  int G_command = 0; // command number for G commands like G04
120  int D_commande = 0; // command number for D commands like D02
121  char* text;
122 
123  ClearMessageList( );
125 
126  // Read the gerber file */
127  m_Current_File = wxFopen( aFullFileName, wxT( "rt" ) );
128 
129  if( m_Current_File == 0 )
130  return false;
131 
132  m_FileName = aFullFileName;
133 
134  LOCALE_IO toggleIo;
135 
136  wxString msg;
137 
138  while( true )
139  {
140  if( fgets( lineBuffer, GERBER_BUFZ, m_Current_File ) == NULL )
141  break;
142 
143  m_LineNum++;
144  text = StrPurge( lineBuffer );
145 
146  while( text && *text )
147  {
148  switch( *text )
149  {
150  case ' ':
151  case '\r':
152  case '\n':
153  text++;
154  break;
155 
156  case '*': // End command
158  text++;
159  break;
160 
161  case 'M': // End file
163  while( *text )
164  text++;
165  break;
166 
167  case 'G': /* Line type Gxx : command */
168  G_command = GCodeNumber( text );
169  Execute_G_Command( text, G_command );
170  break;
171 
172  case 'D': /* Line type Dxx : Tool selection (xx > 0) or
173  * command if xx = 0..9 */
174  D_commande = DCodeNumber( text );
175  Execute_DCODE_Command( text, D_commande );
176  break;
177 
178  case 'X':
179  case 'Y': /* Move or draw command */
180  m_CurrentPos = ReadXYCoord( text );
181  if( *text == '*' ) // command like X12550Y19250*
182  {
184  }
185  break;
186 
187  case 'I':
188  case 'J': /* Auxiliary Move command */
189  m_IJPos = ReadIJCoord( text );
190 
191  if( *text == '*' ) // command like X35142Y15945J504*
192  {
194  }
195  break;
196 
197  case '%':
199  {
202  }
203  else //Error
204  {
205  AddMessageToList( "Expected RS274X Command" );
207  text++;
208  }
209  break;
210 
211  default:
212  msg.Printf( "Unexpected char 0x%2.2X &lt;%c&lt;", *text, *text );
213  AddMessageToList( msg );
214  text++;
215  break;
216  }
217  }
218  }
219 
220  fclose( m_Current_File );
221 
222  m_InUse = true;
223 
224  return true;
225 }
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
bool Execute_DCODE_Command(char *&text, int D_command)
Definition: rs274d.cpp:579
char * StrPurge(char *text)
Remove leading and training spaces, tabs and end of line chars in text.
Definition: string.cpp:298
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:177
wxPoint ReadIJCoord(char *&Text)
Returns the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) These coordinates are rela...
void ClearMessageList()
Function ClearMessageList Clear the message list Call it before reading a Gerber file.
int GCodeNumber(char *&Text)
Definition: rs274d.cpp:411
static char lineBuffer[GERBER_BUFZ+1]
Definition: readgerb.cpp:115
int DCodeNumber(char *&Text)
Definition: rs274d.cpp:434
#define GERBER_BUFZ
Definition: readgerb.cpp:113
wxPoint ReadXYCoord(char *&aText, bool aExcellonMode=false)
Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm)
bool Execute_G_Command(char *&text, int G_command)
Definition: rs274d.cpp:454
bool ReadRS274XCommand(char *aBuff, unsigned int aBuffSize, char *&aText)
reads a single RS274X command terminated with a %
Definition: rs274x.cpp:186
virtual void ResetDefaultValues()

References GERBER_FILE_IMAGE::AddMessageToList(), GERBER_FILE_IMAGE::ClearMessageList(), CMD_IDLE, GERBER_FILE_IMAGE::DCodeNumber(), END_BLOCK, ENTER_RS274X_CMD, GERBER_FILE_IMAGE::Execute_DCODE_Command(), GERBER_FILE_IMAGE::Execute_G_Command(), GERBER_FILE_IMAGE::GCodeNumber(), GERBER_BUFZ, lineBuffer, GERBER_FILE_IMAGE::m_CommandState, GERBER_FILE_IMAGE::m_Current_File, GERBER_FILE_IMAGE::m_CurrentPos, GERBER_FILE_IMAGE::m_FileName, GERBER_FILE_IMAGE::m_IJPos, GERBER_FILE_IMAGE::m_InUse, GERBER_FILE_IMAGE::m_Last_Pen_Command, GERBER_FILE_IMAGE::m_LineNum, GERBER_FILE_IMAGE::ReadIJCoord(), GERBER_FILE_IMAGE::ReadRS274XCommand(), GERBER_FILE_IMAGE::ReadXYCoord(), GERBER_FILE_IMAGE::ResetDefaultValues(), and StrPurge().

Referenced by GERBVIEW_FRAME::Read_GERBER_File().

◆ Matches() [1/2]

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

Function Matches compares 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.
aFindLocationA pointer to a wxPoint object to store the location of matched item. The pointer can be NULL if it is not used.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_FIELD, SCH_SHEET_PIN, SCH_TEXT, LIB_PIN, and SCH_MARKER.

Definition at line 458 of file base_struct.h.

459  {
460  return false;
461  }

Referenced by SCH_FIND_COLLECTOR::Inspect(), SCH_MARKER::Matches(), LIB_PIN::Matches(), SCH_TEXT::Matches(), SCH_SHEET_PIN::Matches(), SCH_FIELD::Matches(), and SCH_SHEET::Matches().

◆ Matches() [2/2]

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

Function Matches compares 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 174 of file base_struct.cpp.

175 {
176  wxString text = aText;
177  wxString searchText = aSearchData.GetFindString();
178 
179  // Don't match if searching for replaceable item and the item doesn't support text replace.
180  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
181  return false;
182 
183  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
184  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
185 
186  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
187  {
188  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
189  return text.Matches( searchText );
190 
191  return text.MakeUpper().Matches( searchText.MakeUpper() );
192  }
193 
194  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
195  return aText.Find( searchText ) != wxNOT_FOUND;
196 
197  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
198 }
Perform search using simple wild card matching (* & ?).
Perform a search for a item that has replaceable text.
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:502

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

◆ Next()

◆ 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 231 of file base_struct.cpp.

232 {
233  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
234  GetChars( GetClass() ) ) );
235 
236  return false;
237 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

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

◆ ReadIJCoord()

wxPoint GERBER_FILE_IMAGE::ReadIJCoord ( char *&  Text)
inherited

Returns the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) These coordinates are relative, so if coordinate is absent, it's value defaults to 0.

Definition at line 190 of file rs274_read_XY_and_IJ_coordinates.cpp.

191 {
192  wxPoint pos( 0, 0 );
193 
194  int type_coord = 0, current_coord, nbdigits;
195  bool is_float = false;
196  char* text;
197  char line[256];
198 
199  if( Text == NULL )
200  return pos;
201 
202  text = line;
203  while( *Text )
204  {
205  if( (*Text == 'I') || (*Text == 'J') )
206  {
207  type_coord = *Text;
208  Text++;
209  text = line;
210  nbdigits = 0;
211  while( IsNumber( *Text ) )
212  {
213  if( *Text == '.' )
214  is_float = true;
215 
216  // count digits only (sign and decimal point are not counted)
217  if( (*Text >= '0') && (*Text <='9') )
218  nbdigits++;
219 
220  *(text++) = *(Text++);
221  }
222 
223  *text = 0;
224  if( is_float )
225  {
226  // When X or Y values are float numbers, they are given in mm or inches
227  if( m_GerbMetric ) // units are mm
228  current_coord = KiROUND( atof( line ) * IU_PER_MILS / 0.0254 );
229  else // units are inches
230  current_coord = KiROUND( atof( line ) * IU_PER_MILS * 1000 );
231  }
232  else
233  {
234  int fmt_scale =
235  (type_coord == 'I') ? m_FmtScale.x : m_FmtScale.y;
236 
237  if( m_NoTrailingZeros )
238  {
239  int min_digit =
240  (type_coord == 'I') ? m_FmtLen.x : m_FmtLen.y;
241  while( nbdigits < min_digit )
242  {
243  *(text++) = '0';
244  nbdigits++;
245  }
246 
247  *text = 0;
248  }
249 
250  current_coord = atoi( line );
251 
252  double real_scale = scale_list[fmt_scale];
253 
254  if( m_GerbMetric )
255  real_scale = real_scale / 25.4;
256 
257  current_coord = KiROUND( current_coord * real_scale );
258  }
259  if( type_coord == 'I' )
260  pos.x = current_coord;
261  else if( type_coord == 'J' )
262  pos.y = current_coord;
263 
264  continue;
265  }
266  else
267  break;
268  }
269 
270  m_IJPos = pos;
272  m_LastCoordIsIJPos = true;
273 
274  return pos;
275 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
static double scale_list[SCALE_LIST_SIZE]
LAST_EXTRA_ARC_DATA_TYPE m_LastArcDataType
#define IU_PER_MILS
Definition: plotter.cpp:134
#define IsNumber(x)

References ARC_INFO_TYPE_CENTER, IsNumber, IU_PER_MILS, KiROUND(), GERBER_FILE_IMAGE::m_FmtLen, GERBER_FILE_IMAGE::m_FmtScale, GERBER_FILE_IMAGE::m_GerbMetric, GERBER_FILE_IMAGE::m_IJPos, GERBER_FILE_IMAGE::m_LastArcDataType, GERBER_FILE_IMAGE::m_LastCoordIsIJPos, GERBER_FILE_IMAGE::m_NoTrailingZeros, and scale_list.

Referenced by Execute_Drill_Command(), Execute_EXCELLON_G_Command(), LoadFile(), and GERBER_FILE_IMAGE::LoadGerberFile().

◆ readToolInformation()

bool EXCELLON_IMAGE::readToolInformation ( char *&  aText)
private

Read a tool definition like T1C0.02 or T1F00S00C0.02 or T1C0.02F00S00 and enter params in TCODE list.

Definition at line 566 of file excellon_read_drill_file.cpp.

567 {
568  // Read a tool definition like T1C0.02 or T1F00S00C0.02 or T1C0.02F00S00
569  // and enter the TCODE param in list (using the D_CODE param management, which
570  // is similar to TCODE params.
571  if( *aText == 'T' ) // This is the beginning of the definition
572  aText++;
573 
574  // Read tool number:
575  int iprm = ReadInt( aText, false );
576 
577  // Skip Feed rate and Spindle speed, if any here
578  while( *aText && ( *aText == 'F' || *aText == 'S' ) )
579  {
580  aText++;
581  ReadInt( aText, false );
582  }
583 
584  // Read tool shape
585  if( ! *aText )
587  _( "Tool definition shape not found" ) ) );
588  else if( *aText != 'C' )
590  _( "Tool definition '%c' not supported" ), *aText ) );
591  if( *aText )
592  aText++;
593 
594  //read tool diameter:
595  double dprm = ReadDouble( aText, false );
596  m_Has_DCode = true;
597 
598  // Initialize Dcode to handle this Tool
599  // Remember: dcodes are >= FIRST_DCODE
600  D_CODE* dcode = GetDCODEOrCreate( iprm + FIRST_DCODE );
601 
602  if( dcode == NULL )
603  return false;
604 
605  // conv_scale = scaling factor from inch to Internal Unit
606  double conv_scale = IU_PER_MILS * 1000;
607 
608  if( m_GerbMetric )
609  conv_scale /= 25.4;
610 
611  dcode->m_Size.x = dcode->m_Size.y = KiROUND( dprm * conv_scale );
612  dcode->m_Shape = APT_CIRCLE;
613  dcode->m_Defined = true;
614 
615  return true;
616 }
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
bool m_Defined
false if the aperture is not defined in the header
Definition: dcode.h:104
#define FIRST_DCODE
Definition: dcode.h:71
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
double ReadDouble(char *&text, bool aSkipSeparator=true)
Function ReadDouble reads a double from an ASCII character buffer.
#define IU_PER_MILS
Definition: plotter.cpp:134
D_CODE * GetDCODEOrCreate(int aDCODE, bool aCreateIfNoExist=true)
Function GetDCODEOrCreate returns a pointer to the D_CODE within this GERBER for the given aDCODE.
int ReadInt(char *&text, bool aSkipSeparator=true)
Function ReadInt reads an int from an ASCII character buffer.

References GERBER_FILE_IMAGE::AddMessageToList(), APT_CIRCLE, FIRST_DCODE, Format(), GERBER_FILE_IMAGE::GetDCODEOrCreate(), IU_PER_MILS, KiROUND(), D_CODE::m_Defined, GERBER_FILE_IMAGE::m_GerbMetric, GERBER_FILE_IMAGE::m_Has_DCode, D_CODE::m_Shape, D_CODE::m_Size, ReadDouble(), and ReadInt().

Referenced by Execute_HEADER_And_M_Command(), and Select_Tool().

◆ ReadXYCoord()

wxPoint GERBER_FILE_IMAGE::ReadXYCoord ( char *&  aText,
bool  aExcellonMode = false 
)
inherited

Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm)

Parameters
aTextis a pointer to the text to parse.
aExcellonMode= true to parse a Excellon drill file. it force truncation of a digit string to a max len because the exact coordinate format is not always known

Definition at line 72 of file rs274_read_XY_and_IJ_coordinates.cpp.

73 {
74  wxPoint pos;
75  int type_coord = 0, current_coord, nbdigits;
76  bool is_float = false;
77  char* text;
78  char line[256];
79 
80 
81  if( m_Relative )
82  pos.x = pos.y = 0;
83  else
84  pos = m_CurrentPos;
85 
86  if( Text == NULL )
87  return pos;
88 
89  text = line;
90  while( *Text )
91  {
92  if( (*Text == 'X') || (*Text == 'Y') || (*Text == 'A') )
93  {
94  type_coord = *Text;
95  Text++;
96  text = line;
97  nbdigits = 0;
98 
99  while( IsNumber( *Text ) )
100  {
101  if( *Text == '.' ) // Force decimat format if reading a floating point number
102  is_float = true;
103 
104  // count digits only (sign and decimal point are not counted)
105  if( (*Text >= '0') && (*Text <='9') )
106  nbdigits++;
107  *(text++) = *(Text++);
108  }
109 
110  *text = 0;
111 
112  if( is_float )
113  {
114  // When X or Y (or A) values are float numbers, they are given in mm or inches
115  if( m_GerbMetric ) // units are mm
116  current_coord = KiROUND( atof( line ) * IU_PER_MILS / 0.0254 );
117  else // units are inches
118  current_coord = KiROUND( atof( line ) * IU_PER_MILS * 1000 );
119  }
120  else
121  {
122  int fmt_scale = (type_coord == 'X') ? m_FmtScale.x : m_FmtScale.y;
123 
124  if( m_NoTrailingZeros )
125  {
126  // no trailing zero format, we need to add missing zeros.
127  int digit_count = (type_coord == 'X') ? m_FmtLen.x : m_FmtLen.y;
128 
129  while( nbdigits < digit_count )
130  {
131  *(text++) = '0';
132  nbdigits++;
133  }
134 
135  if( aExcellonMode )
136  {
137  // Truncate the extra digits if the len is more than expected
138  // because the conversion to internal units expect exactly
139  // digit_count digits
140  while( nbdigits > digit_count )
141  {
142  *(text--) = 0;
143  nbdigits--;
144  }
145  }
146 
147  *text = 0;
148  }
149 
150  current_coord = atoi( line );
151  double real_scale = scale_list[fmt_scale];
152 
153  if( m_GerbMetric )
154  real_scale = real_scale / 25.4;
155 
156  current_coord = KiROUND( current_coord * real_scale );
157  }
158 
159  if( type_coord == 'X' )
160  pos.x = current_coord;
161  else if( type_coord == 'Y' )
162  pos.y = current_coord;
163  else if( type_coord == 'A' )
164  {
165  m_ArcRadius = current_coord;
167  }
168 
169  continue;
170  }
171  else
172  break;
173  }
174 
175  if( m_Relative )
176  {
177  pos.x += m_CurrentPos.x;
178  pos.y += m_CurrentPos.y;
179  }
180 
181  m_CurrentPos = pos;
182  return pos;
183 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
static double scale_list[SCALE_LIST_SIZE]
LAST_EXTRA_ARC_DATA_TYPE m_LastArcDataType
#define IU_PER_MILS
Definition: plotter.cpp:134
#define IsNumber(x)

References ARC_INFO_TYPE_RADIUS, IsNumber, IU_PER_MILS, KiROUND(), GERBER_FILE_IMAGE::m_ArcRadius, GERBER_FILE_IMAGE::m_CurrentPos, GERBER_FILE_IMAGE::m_FmtLen, GERBER_FILE_IMAGE::m_FmtScale, GERBER_FILE_IMAGE::m_GerbMetric, GERBER_FILE_IMAGE::m_LastArcDataType, GERBER_FILE_IMAGE::m_NoTrailingZeros, GERBER_FILE_IMAGE::m_Relative, and scale_list.

Referenced by Execute_Drill_Command(), Execute_EXCELLON_G_Command(), and GERBER_FILE_IMAGE::LoadGerberFile().

◆ RemoveAttribute()

void GERBER_FILE_IMAGE::RemoveAttribute ( X2_ATTRIBUTE aAttribute)
inherited

Function RemoveAttribute.

Called when a TD command is found the Gerber file

Parameters
aAttributeis the X2_ATTRIBUTE which stores the full command Remove the attribute specified by the TD command. is no attribute, all current attributes specified by the TO and the TA commands are cleared. if a attribute name is specified (for instance TD.CN*%) is specified, only this attribute is cleared

Definition at line 379 of file gerber_file_image.cpp.

380 {
381  /* Called when a %TD command is found
382  * Remove the attribute specified by the %TD command.
383  * is no attribute, all current attributes specified by the %TO and the %TA
384  * commands are cleared.
385  * if a attribute name is specified (for instance %TD.CN*%) is specified,
386  * only this attribute is cleared
387  */
388  m_NetAttributeDict.ClearAttribute( &aAttribute.GetPrm( 1 ) );
389 
390  if( aAttribute.GetPrm( 1 ).IsEmpty() || aAttribute.GetPrm( 1 ) == ".AperFunction" )
391  m_AperFunction.Clear();
392 }
const wxString & GetPrm(int aIdx)
GBR_NETLIST_METADATA m_NetAttributeDict
void ClearAttribute(const wxString *aName)
remove the net attribute specified by aName If aName == NULL or empty, remove all attributes

References GBR_NETLIST_METADATA::ClearAttribute(), X2_ATTRIBUTE::GetPrm(), GERBER_FILE_IMAGE::m_AperFunction, and GERBER_FILE_IMAGE::m_NetAttributeDict.

Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand().

◆ Replace() [1/2]

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

Helper function used in search and replace dialog Function Replace performs 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 201 of file base_struct.cpp.

202 {
203  wxCHECK_MSG( IsReplaceable(), false,
204  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
205 
206  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
207 
208  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
209  aSearchData.GetFindString() :
210  aSearchData.GetFindString().Upper() );
211 
212  if( result == wxNOT_FOUND )
213  return false;
214 
215  wxString prefix = aText.Left( result );
216  wxString suffix;
217 
218  if( aSearchData.GetFindString().length() + result < aText.length() )
219  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
220 
221  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
222  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
223  GetChars( suffix ) );
224 
225  aText = prefix + aSearchData.GetReplaceString() + suffix;
226 
227  return true;
228 }
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:100
virtual wxString GetClass() const =0
Function GetClass returns the class name.
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:502

References GetChars(), EDA_ITEM::GetClass(), EDA_ITEM::IsReplaceable(), and traceFindReplace.

Referenced by FOOTPRINT_INFO_GENERATOR::GetHtmlFieldRow(), SCH_TEXT::Replace(), SCH_SHEET_PIN::Replace(), SCH_FIELD::Replace(), SCH_SHEET::Replace(), and SCH_FIND_COLLECTOR::ReplaceItem().

◆ Replace() [2/2]

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

Function Replace performs 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_SHEET, SCH_FIELD, SCH_SHEET_PIN, and SCH_TEXT.

Definition at line 490 of file base_struct.h.

490 { return false; }

◆ ResetDefaultValues()

virtual void EXCELLON_IMAGE::ResetDefaultValues ( )
inlineoverridevirtual

Reimplemented from GERBER_FILE_IMAGE.

Definition at line 158 of file excellon_image.h.

159  {
161  SelectUnits( false );
162  }
void SelectUnits(bool aMetric)
virtual void ResetDefaultValues()

References GERBER_FILE_IMAGE::ResetDefaultValues(), and SelectUnits().

Referenced by LoadFile().

◆ Select_Tool()

bool EXCELLON_IMAGE::Select_Tool ( char *&  text)
private

Definition at line 709 of file excellon_read_drill_file.cpp.

710 {
711  // Select the tool from the command line Tn, with n = 1 ... TOOLS_MAX_COUNT - 1
712  // Because some drill file have an embedded TCODE definition (like T1C.008F0S0)
713  // in tool selection command, if the tool is not defined in list,
714  // and the definition is embedded, it will be entered in list
715  char * startline = text; // the tool id starts here.
716  int tool_id = TCodeNumber( text );
717 
718  // T0 is legal, but is not a selection tool. it is a special command
719  if( tool_id >= 0 )
720  {
721  int dcode_id = tool_id + FIRST_DCODE; // Remember: dcodes are >= FIRST_DCODE
722 
723  if( dcode_id > (TOOLS_MAX_COUNT - 1) )
724  dcode_id = TOOLS_MAX_COUNT - 1;
725 
726  m_Current_Tool = dcode_id;
727  D_CODE* currDcode = GetDCODEOrCreate( dcode_id, true );
728 
729  if( currDcode == NULL && tool_id > 0 ) // if the definition is embedded, enter it
730  {
731  text = startline; // text starts at the beginning of the command
732  readToolInformation( text );
733  currDcode = GetDCODE( dcode_id );
734  }
735 
736  if( currDcode )
737  currDcode->m_InUse = true;
738  }
739 
740  while( *text )
741  text++;
742 
743  return tool_id >= 0;
744 }
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE.
#define FIRST_DCODE
Definition: dcode.h:71
int TCodeNumber(char *&aText)
bool readToolInformation(char *&aText)
Read a tool definition like T1C0.02 or T1F00S00C0.02 or T1C0.02F00S00 and enter params in TCODE list.
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
D_CODE * GetDCODEOrCreate(int aDCODE, bool aCreateIfNoExist=true)
Function GetDCODEOrCreate returns a pointer to the D_CODE within this GERBER for the given aDCODE.

References FIRST_DCODE, GERBER_FILE_IMAGE::GetDCODE(), GERBER_FILE_IMAGE::GetDCODEOrCreate(), GERBER_FILE_IMAGE::m_Current_Tool, D_CODE::m_InUse, readToolInformation(), TCodeNumber(), and TOOLS_MAX_COUNT.

Referenced by LoadFile().

◆ SelectUnits()

void EXCELLON_IMAGE::SelectUnits ( bool  aMetric)
private

Definition at line 861 of file excellon_read_drill_file.cpp.

862 {
863  /* Coordinates are measured either in inch or metric (millimeters).
864  * Inch coordinates are in six digits (00.0000) with increments
865  * as small as 0.0001 (1/10,000).
866  * Metric coordinates can be measured in microns (thousandths of a millimeter)
867  * in one of the following three ways:
868  * Five digit 10 micron resolution (000.00)
869  * Six digit 10 micron resolution (0000.00)
870  * Six digit micron resolution (000.000)
871  *
872  * Inches: Default fmt = 2.4 for X and Y axis: 6 digits with 0.0001 resolution
873  * metric: Default fmt = 3.3 for X and Y axis: 6 digits, 1 micron resolution
874  */
875  if( aMetric )
876  {
877  m_GerbMetric = true;
878  // number of digits in mantissa
880  // number of digits (mantissa+interger)
882  }
883  else
884  {
885  m_GerbMetric = false;
888  }
889 }
static const int fmtMantissaInch
static const int fmtIntegerInch
static const int fmtMantissaMM
static const int fmtIntegerMM

References fmtIntegerInch, fmtIntegerMM, fmtMantissaInch, fmtMantissaMM, GERBER_FILE_IMAGE::m_FmtLen, GERBER_FILE_IMAGE::m_FmtScale, and GERBER_FILE_IMAGE::m_GerbMetric.

Referenced by Execute_HEADER_And_M_Command(), and ResetDefaultValues().

◆ SetBack()

void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 218 of file base_struct.h.

218 { Pback = aBack; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:171

References EDA_ITEM::Pback.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), DHEAD::remove(), and SwapItemData().

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 235 of file base_struct.h.

235 { SetFlags( BRIGHTENED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:137

References BRIGHTENED, and EDA_ITEM::SetFlags().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::highlight(), and SELECTION_TOOL::highlight().

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 259 of file base_struct.h.

259 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:181

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddModuleToBoard(), AddSegmentToDragList(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), LIB_ITEM::BeginEdit(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::ConvertTextType(), CopyMarkedItems(), SCH_EDIT_FRAME::CreateNewText(), LIB_PIN_TOOL::CreatePin(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), SCH_WIRE_BUS_TOOL::doDrawSegments(), SCH_DRAWING_TOOLS::doPlaceComponent(), SCH_DRAWING_TOOLS::doSingleClickPlace(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), KIGFX::SCH_PAINTER::draw(), SCH_DRAWING_TOOLS::DrawSheet(), LIB_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), KIGFX::SCH_VIEW::HighlightItem(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), InvokeDialogImportGfxBoard(), InvokeDialogImportGfxModule(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), SCH_MOVE_TOOL::moveItem(), LIB_MOVE_TOOL::moveItem(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), PCB_EDIT_FRAME::Other_Layer_Route(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceImage(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), BLOCK_SELECTOR::SetFlags(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), SCH_WIRE_BUS_TOOL::startSegments(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Function SetForceVisible is used to set and cleag 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 309 of file base_struct.h.

309 { m_forceVisible = aEnable; }
bool m_forceVisible
Set to true to override the visibility setting of the item.
Definition: base_struct.h:178

References EDA_ITEM::m_forceVisible.

Referenced by SCH_EDIT_FRAME::OnFindSchematicItem(), and SCH_EDIT_FRAME::updateFindReplaceView().

◆ SetHighlighted()

void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 234 of file base_struct.h.

234 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:136

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

◆ SetList()

void EDA_ITEM::SetList ( DHEAD aList)
inlineinherited

Definition at line 220 of file base_struct.h.

220 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:172

References EDA_ITEM::m_List.

Referenced by DHEAD::append(), DHEAD::insert(), DHEAD::remove(), and SwapItemData().

◆ SetModified()

◆ SetNext()

void EDA_ITEM::SetNext ( EDA_ITEM aNext)
inlineinherited

Definition at line 217 of file base_struct.h.

217 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:170

References EDA_ITEM::Pnext.

Referenced by DHEAD::append(), DHEAD::insert(), SCH_EDIT_FRAME::PutDataInPreviousState(), DHEAD::remove(), and SwapItemData().

◆ SetParent()

◆ SetSelected()

void EDA_ITEM::SetSelected ( )
inlineinherited

Definition at line 233 of file base_struct.h.

233 { SetFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259

References SELECTED, and EDA_ITEM::SetFlags().

Referenced by EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), and GERBVIEW_SELECTION_TOOL::selectVisually().

◆ SetState()

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

◆ SetTimeStamp()

void EDA_ITEM::SetTimeStamp ( timestamp_t  aNewTimeStamp)
inlineinherited

Definition at line 209 of file base_struct.h.

209 { m_TimeStamp = aNewTimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:175

References EDA_ITEM::m_TimeStamp.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_FRAME::AddModuleToBoard(), BOARD_NETLIST_UPDATER::addNewComponent(), PCAD2KICAD::PCB_TEXT::AddToBoard(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_ARC::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), PCAD2KICAD::PCB_MODULE::AddToBoard(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::Begin_Zone(), Diagnose(), SCH_DRAWING_TOOLS::DrawSheet(), SCH_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), EDA_ITEM::initVars(), BOARD::InsertArea(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), EDA_ITEM::operator=(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), PCB_PARSER::parseDIMENSION(), SCH_EDITOR_CONTROL::Paste(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET::SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), DIALOG_ERC::TestErc(), and TestMultiunitFootprints().

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 232 of file base_struct.h.

232 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:259
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

◆ Sort()

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

Function Sort is a 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 521 of file base_struct.h.

521 { return *aLeft < *aRight; }

Referenced by PART_LIB::GetEntryTypePowerNames().

◆ StepAndRepeatItem()

void GERBER_FILE_IMAGE::StepAndRepeatItem ( const GERBER_DRAW_ITEM aItem)
inherited

Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called when reading a gerber file and after creating a new gerber item that must be repeated (i.e when m_XRepeatCount or m_YRepeatCount are > 1)

Parameters
aItem= the item to repeat

Definition at line 303 of file gerber_file_image.cpp.

304 {
305  if( GetLayerParams().m_XRepeatCount < 2 &&
306  GetLayerParams().m_YRepeatCount < 2 )
307  return; // Nothing to repeat
308 
309  // Duplicate item:
310  for( int ii = 0; ii < GetLayerParams().m_XRepeatCount; ii++ )
311  {
312  for( int jj = 0; jj < GetLayerParams().m_YRepeatCount; jj++ )
313  {
314  // the first gerber item already exists (this is the template)
315  // create duplicate only if ii or jj > 0
316  if( jj == 0 && ii == 0 )
317  continue;
318  GERBER_DRAW_ITEM* dupItem = new GERBER_DRAW_ITEM( aItem );
319  wxPoint move_vector;
320  move_vector.x = scaletoIU( ii * GetLayerParams().m_StepForRepeat.x,
321  GetLayerParams().m_StepForRepeatMetric );
322  move_vector.y = scaletoIU( jj * GetLayerParams().m_StepForRepeat.y,
323  GetLayerParams().m_StepForRepeatMetric );
324  dupItem->MoveXY( move_vector );
325  m_Drawings.Append( dupItem );
326  }
327  }
328 }
void Append(T *aNewElement)
Function Append adds aNewElement to the end of the list.
Definition: dlist.h:177
int scaletoIU(double aCoord, bool isMetric)
Function scaletoIU converts a distance given in floating point to our internal units.
DLIST< GERBER_DRAW_ITEM > m_Drawings
void MoveXY(const wxPoint &aMoveVector)
Function MoveXY move this object.
GERBER_LAYER & GetLayerParams()
Function GetLayerParams.

References DLIST< T >::Append(), GERBER_FILE_IMAGE::GetLayerParams(), GERBER_FILE_IMAGE::m_Drawings, GERBER_LAYER::m_XRepeatCount, GERBER_LAYER::m_YRepeatCount, GERBER_DRAW_ITEM::MoveXY(), and scaletoIU().

Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command(), Execute_Drill_Command(), GERBER_FILE_IMAGE::Execute_G_Command(), and FinishRouteCommand().

◆ TCodeNumber()

int EXCELLON_IMAGE::TCodeNumber ( char *&  aText)
inlineprivate

Definition at line 185 of file excellon_image.h.

186  {
187  return DCodeNumber( aText );
188  }
int DCodeNumber(char *&Text)
Definition: rs274d.cpp:434

References GERBER_FILE_IMAGE::DCodeNumber().

Referenced by Select_Tool().

◆ Type()

KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

returns the type of object. This attribute should never be changed after a constructor sets it, so there is no public "setter" method.

Returns
KICAD_T - the type of object.

Definition at line 204 of file base_struct.h.

205  {
206  return m_StructType;
207  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it.
Definition: base_struct.h:166

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), POINT_EDITOR::addCorner(), CONNECTION_SUBGRAPH::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_MOVE_TOOL::addJunctionsIfNeeded(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), CONNECTION_GRAPH::buildConnectionGraph(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_SCREENS::ChangeSymbolLibNickname(), CN_VISITOR::checkZoneItemConnection(), TEXTE_PCB::ClassOf(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), PCB_TARGET::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), ZONE_CONTAINER::ClassOf(), MARKER_PCB::ClassOf(), DIMENSION::ClassOf(), NETINFO_ITEM::ClassOf(), TRACK::ClassOf(), MODULE::ClassOf(), SCH_COMPONENT::ClassOf(), D_PAD::ClassOf(), BOARD::ClassOf(), VIA::ClassOf(), SCH_SHEET::CleanupSheet(), EE_COLLECTOR::Collect(), Collect_TrackSegmentsToDrag(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_BEZIER::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), SCH_SHEET::ComponentCount(), GRID_HELPER::computeAnchors(), SCH_BUS_WIRE_ENTRY::ConnectionPropagatesTo(), SCH_EDIT_FRAME::ConvertTextType(), SCH_SCREEN::CountConnectedItems(), SCH_SHEET::CountSheets(), MODULE::CoverageRatio(), CINFO3D_VISU::createLayers(), BOARD::CreateLockPoint(), SCH_EDIT_FRAME::CreateNewText(), CINFO3D_VISU::createNewTrack(), PCB_EDIT_FRAME::createPopupMenuForTracks(), CreateRoutesSection(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), D_PAD::D_PAD(), FOOTPRINT_EDIT_FRAME::Delete_Edge_Module(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), DeleteNullTrackSegments(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_ERC::DisplayERC_MarkersList(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), LIB_DRAWING_TOOLS::doTwoClickPlace(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DrawMovingBlockOutlines(), drawPickedItems(), CN_ITEM::Dump(), SCH_ITEM::Duplicate(), BOARD::Duplicate(), MODULE::Duplicate(), PCB_EDIT_FRAME::duplicateItems(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_TOOL::EditField(), LIB_EDIT_TOOL::editTextProperties(), EditToolSelectionFilter(), PCB_EDIT_FRAME::EraseRedundantTrack(), CONNECTION_GRAPH::ercCheckLabels(), find_vias_and_tracks_at(), SCH_EDIT_FRAME::FindComponentAndItem(), NETLIST_EXPORTER::findNextComponent(), NETLIST_EXPORTER::findNextComponentAndCreatePinList(), SCH_SHEET_PATH::FindNextItem(), SCH_SHEET_LIST::FindNextItem(), SCH_SHEET_PATH::FindPreviousItem(), SCH_SHEET_LIST::FindPreviousItem(), EDIT_TOOL::FootprintFilter(), FootprintWriteShape(), SCH_LEGACY_PLUGIN::Format(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), CN_ITEM::GetAnchor(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_TEXT::GetConnectionPoints(), CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_TEXT::GetEndPoints(), SCH_SHEET::GetEndPoints(), GetFirstTrack(), GetFirstVia(), SCH_SCREEN::GetHierarchicalItems(), SCH_SCREENS::GetLibNicknames(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), CONNECTION_SUBGRAPH::GetNameForDriver(), BOARD_CONNECTED_ITEM::GetNetClass(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), SCH_SCREEN::GetPin(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), getRect(), SELECTION::GetTopLeftItem(), EE_SELECTION_TOOL::guessSelectionCandidates(), SELECTION_TOOL::guessSelectionCandidates(), hash_eda(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), EE_SELECTION_TOOL::highlight(), SELECTION_TOOL::highlight(), KIGFX::SCH_VIEW::HighlightItem(), SCH_EDIT_FRAME::ImportSheetPin(), SCH_EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EE_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), isNewSegment(), TRACK::IsNull(), SCH_LINE::IsParallel(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), SCH_SHEET::LocatePathOfScreen(), Magnetize(), LIB_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), MarkItemsInBloc(), BOARD::MarkTrace(), TRACKS_CLEANER::mergeCollinearSegments(), TRACKS_CLEANER::MergeCollinearTracks(), SCH_LINE::MergeOverlap(), SCH_EDIT_TOOL::Mirror(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), SCH_MOVE_TOOL::moveItem(), MoveMarkedItems(), MoveMarkedItemsExactly(), SCH_CONNECTION::Name(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftDClick(), FOOTPRINT_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), POINT_EDITOR::OnSelectionChange(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), LIB_ITEM::operator==(), OrCell_Trace(), EDIT_TOOL::PadFilter(), BOARD_COMMIT::parentObject(), SCH_EDITOR_CONTROL::Paste(), PCBNEW_CONTROL::PasteItemsFromClipboard(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), GAL_ARRAY_CREATOR::prePushAction(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), DIALOG_EXCHANGE_FOOTPRINTS::processMatchingModules(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SELECTION_TOOL::RebuildSelection(), SCH_BASE_FRAME::RefreshItem(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), TRACKS_CLEANER::removeDuplicatesOfTrack(), SCH_SHEET::RemovePin(), FOOTPRINT_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::RemoveStruct(), SCH_EDIT_TOOL::RepeatDrawItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SCREEN::ReplaceWires(), PCB_BASE_FRAME::ResetTextSize(), BOARD_COMMIT::Revert(), SCH_EDIT_TOOL::Rotate(), SCH_TEXT::Rotate(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EE_TOOL_BASE< SCH_BASE_FRAME >::saveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_EDIT_FRAME::SaveUndoItemInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SELECTION_TOOL::select(), EE_SELECTION_TOOL::selectable(), SELECTION_TOOL::selectable(), PCB_EDIT_FRAME::SelectHighLight(), ITEM_PICKER::SetItem(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_MoveNode(), ShowClearance(), ShowNewTrackWhenMovingCursor(), SortByTimeStamp(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SCH_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), PCB_TARGET::SwapData(), SCH_BITMAP::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), SCH_FIELD::SwapData(), DIMENSION::SwapData(), DRAWSEGMENT::SwapData(), TRACK::SwapData(), SCH_SHEET::SwapData(), VIA::SwapData(), SCH_COMPONENT::SwapData(), MODULE::SwapData(), ZONE_CONTAINER::SwapData(), D_PAD::SwapData(), SwapItemData(), PCB_EDIT_FRAME::SwitchLayer(), TestDuplicateSheetNames(), TRACKS_CLEANER::testTrackEndpointDangling(), TEXTE_MODULE::TEXTE_MODULE(), AR_MATRIX::TraceSegmentPcb(), TraceSegmentPcb(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), TRACK::TransformShapeWithClearanceToPolygon(), EE_SELECTION_TOOL::unhighlight(), SELECTION_TOOL::unhighlight(), SCH_SHEET_PATH::UpdateAllScreenReferences(), SCH_TEXT::UpdateDanglingState(), EE_POINT_EDITOR::updateItem(), POINT_EDITOR::updateItem(), CONNECTION_GRAPH::updateItemConnectivity(), EE_POINT_EDITOR::updatePoints(), POINT_EDITOR::updatePoints(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateView(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), SCH_SHEET::Visit(), and SCH_COMPONENT::Visit().

◆ ViewBBox()

const BOX2I EDA_ITEM::ViewBBox ( ) const
overridevirtualinherited

Function ViewBBox() returns the bounding box of the item covering all its layers.

Returns
BOX2I - the current bounding box

Implements KIGFX::VIEW_ITEM.

Reimplemented in D_PAD, MODULE, EDIT_POINTS, GERBER_DRAW_ITEM, TRACK, DRAWSEGMENT, DIMENSION, TEXTE_MODULE, LIB_ALIAS, KIGFX::WORKSHEET_VIEWITEM, MARKER_PCB, ROUTER_PREVIEW_ITEM, KIGFX::PREVIEW::CENTRELINE_RECT_ITEM, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::POLYGON_ITEM, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, BRIGHT_BOX, and KIGFX::PREVIEW::ARC_ASSISTANT.

Definition at line 257 of file base_struct.cpp.

258 {
259  // Basic fallback
260  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
261  VECTOR2I( GetBoundingBox().GetSize() ) );
262 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:520
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.

References EDA_ITEM::GetBoundingBox().

Referenced by BRIGHT_BOX::ViewBBox(), DIMENSION::ViewBBox(), DRAWSEGMENT::ViewBBox(), and BRIGHT_BOX::ViewDraw().

◆ ViewDraw()

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

Function ViewDraw() Draws the parts of the object belonging to layer aLayer.

viewDraw() is an alternative way for drawing objects if 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
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on

Reimplemented in EDIT_POINTS, KIGFX::WORKSHEET_VIEWITEM, ROUTER_PREVIEW_ITEM, KIGFX::VIEW_GROUP, KIGFX::PREVIEW::SELECTION_AREA, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, KIGFX::VIEW_OVERLAY, KIGFX::ORIGIN_VIEWITEM, BRIGHT_BOX, KIGFX::PREVIEW::RULER_ITEM, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::ARC_ASSISTANT, and PCB_BRIGHT_BOX.

Definition at line 116 of file view_item.h.

117  {}

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

◆ ViewGetLayers()

void EDA_ITEM::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtualinherited

Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.

For instance, a D_PAD spans zero or more copper layers and a few technical layers. ViewDraw() or PAINTER::Draw() is repeatedly called for each of the layers returned by ViewGetLayers(), depending on the rendering order.

Parameters
aLayers[]output layer index array
aCountnumber of layer indices in aLayers[]

Implements KIGFX::VIEW_ITEM.

Reimplemented in D_PAD, MODULE, SCH_SHEET, EDIT_POINTS, VIA, LIB_PART, GERBER_DRAW_ITEM, TRACK, BOARD_ITEM, TEXTE_MODULE, LIB_ITEM, SCH_ITEM, LIB_ALIAS, ZONE_CONTAINER, SCH_COMPONENT, LIB_FIELD, KIGFX::WORKSHEET_VIEWITEM, MARKER_PCB, SCH_BITMAP, ROUTER_PREVIEW_ITEM, SCH_BUS_ENTRY_BASE, LIB_TEXT, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, SCH_NO_CONNECT, BRIGHT_BOX, SCH_JUNCTION, KIGFX::RATSNEST_VIEWITEM, KIGFX::PREVIEW::RULER_ITEM, and SCH_MARKER.

Definition at line 265 of file base_struct.cpp.

266 {
267  // Basic fallback
268  aCount = 1;
269  aLayers[0] = 0;
270 }

◆ ViewGetLOD()

virtual unsigned int KIGFX::VIEW_ITEM::ViewGetLOD ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

Function ViewGetLOD() Returns the level of detail (LOD) of the item.

A level of detail is the minimal VIEW scale that is sufficient for an item to be shown on a given layer.

Parameters
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on
Returns
the level of detail. 0 always show the item, because the actual zoom level (or VIEW scale) is always > 0

Reimplemented in D_PAD, MODULE, VIA, GERBER_DRAW_ITEM, TRACK, TEXTE_MODULE, and EDGE_MODULE.

Definition at line 140 of file view_item.h.

141  {
142  // By default always show the item
143  return 0;
144  }

Referenced by KIGFX::VIEW::drawItem::operator()().

◆ viewPrivData()

◆ Visit()

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

Reimplemented from EDA_ITEM.

Definition at line 395 of file gerber_file_image.cpp.

396 {
397  KICAD_T stype;
399  const KICAD_T* p = scanTypes;
400  bool done = false;
401 
402 #if 0 && defined(DEBUG)
403  std::cout << GetClass().mb_str() << ' ';
404 #endif
405 
406  while( !done )
407  {
408  stype = *p;
409 
410  switch( stype )
411  {
412  case GERBER_IMAGE_T:
413  case GERBER_IMAGE_LIST_T:
414  ++p;
415  break;
416 
417  case GERBER_DRAW_ITEM_T:
418  result = IterateForward( &m_Drawings[0], inspector, testData, p );
419  ++p;
420  break;
421 
422  default: // catch EOT or ANY OTHER type here and return.
423  done = true;
424  break;
425  }
426 
427  if( result == SEARCH_QUIT )
428  break;
429  }
430 
431  return result;
432 }
static SEARCH_RESULT IterateForward(EDA_ITEM *listStart, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
Function IterateForward walks through the object tree calling the inspector() on each object type req...
wxString GetClass() const override
Function GetClass returns the class name.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
DLIST< GERBER_DRAW_ITEM > m_Drawings
SEARCH_RESULT
Definition: base_struct.h:66

References GERBER_DRAW_ITEM_T, GERBER_IMAGE_LIST_T, GERBER_IMAGE_T, GERBER_FILE_IMAGE::GetClass(), EDA_ITEM::IterateForward(), GERBER_FILE_IMAGE::m_Drawings, SEARCH_CONTINUE, and SEARCH_QUIT.

Referenced by GBR_LAYOUT::Visit().

Member Data Documentation

◆ m_360Arc_enbl

bool GERBER_FILE_IMAGE::m_360Arc_enbl
inherited

◆ m_AperFunction

wxString GERBER_FILE_IMAGE::m_AperFunction
inherited

◆ m_aperture_macros

APERTURE_MACRO_SET GERBER_FILE_IMAGE::m_aperture_macros
inherited

a collection of APERTURE_MACROS, sorted by name

Definition at line 169 of file gerber_file_image.h.

Referenced by GERBER_FILE_IMAGE::FindApertureMacro(), GERBER_FILE_IMAGE::InitToolTable(), and GERBER_FILE_IMAGE::ReadApertureMacro().

◆ m_ArcRadius

int GERBER_FILE_IMAGE::m_ArcRadius
inherited

◆ m_CommandState

int GERBER_FILE_IMAGE::m_CommandState
inherited

◆ m_ComponentsList

std::map<wxString, int> GERBER_FILE_IMAGE::m_ComponentsList
inherited

◆ m_Current_File

◆ m_Current_Tool

◆ m_CurrentPos

◆ m_Drawings

◆ m_FileFunction

◆ m_FileName

◆ m_Flags

◆ m_FmtLen

◆ m_FmtScale

◆ m_forceVisible

bool EDA_ITEM::m_forceVisible
protectedinherited

Set to true to override the visibility setting of the item.

Definition at line 178 of file base_struct.h.

Referenced by SCH_FIELD::Draw(), EDA_ITEM::initVars(), EDA_ITEM::operator=(), and EDA_ITEM::SetForceVisible().

◆ m_GerbMetric

◆ m_GraphicLayer

◆ m_Has_DCode

◆ m_IJPos

◆ m_ImageJustifyOffset

◆ m_ImageJustifyXCenter

bool GERBER_FILE_IMAGE::m_ImageJustifyXCenter
inherited

◆ m_ImageJustifyYCenter

bool GERBER_FILE_IMAGE::m_ImageJustifyYCenter
inherited

◆ m_ImageName

◆ m_ImageNegative

◆ m_ImageOffset

◆ m_ImageRotation

◆ m_InUse

◆ m_IsVisible

bool GERBER_FILE_IMAGE::m_IsVisible
inherited

◆ m_IsX2_file

bool GERBER_FILE_IMAGE::m_IsX2_file
inherited

◆ m_Iterpolation

◆ m_Last_Pen_Command

int GERBER_FILE_IMAGE::m_Last_Pen_Command
inherited

◆ m_LastArcDataType

◆ m_LastCoordIsIJPos

bool GERBER_FILE_IMAGE::m_LastCoordIsIJPos
inherited

◆ m_LineNum

◆ m_List

DHEAD* EDA_ITEM::m_List
protectedinherited

which DLIST I am on.

Definition at line 172 of file base_struct.h.

Referenced by EDA_ITEM::GetList(), EDA_ITEM::initVars(), and EDA_ITEM::SetList().

◆ m_LocalRotation

double GERBER_FILE_IMAGE::m_LocalRotation
inherited

◆ m_MD5_value

wxString GERBER_FILE_IMAGE::m_MD5_value
inherited

◆ m_MirrorA

bool GERBER_FILE_IMAGE::m_MirrorA
inherited

◆ m_MirrorB

bool GERBER_FILE_IMAGE::m_MirrorB
inherited

◆ m_NetAttributeDict

◆ m_NetnamesList

std::map<wxString, int> GERBER_FILE_IMAGE::m_NetnamesList
inherited

◆ m_NoTrailingZeros

◆ m_Offset

◆ m_Parent

◆ m_PartString

wxString GERBER_FILE_IMAGE::m_PartString
inherited

◆ m_PolygonFillMode

bool GERBER_FILE_IMAGE::m_PolygonFillMode
inherited

◆ m_PolygonFillModeState

int GERBER_FILE_IMAGE::m_PolygonFillModeState
inherited

◆ m_PositiveDrawColor

COLOR4D GERBER_FILE_IMAGE::m_PositiveDrawColor
inherited

◆ m_PreviousPos

wxPoint GERBER_FILE_IMAGE::m_PreviousPos
inherited

◆ m_Relative

◆ m_RouteModeOn

bool EXCELLON_IMAGE::m_RouteModeOn
private

◆ m_RoutePositions

std::vector<EXCELLON_ROUTE_COORD> EXCELLON_IMAGE::m_RoutePositions
private

◆ m_Scale

wxRealPoint GERBER_FILE_IMAGE::m_Scale
inherited

◆ m_Selected_Tool

◆ m_SlotOn

bool EXCELLON_IMAGE::m_SlotOn
private

◆ m_State

excellon_state EXCELLON_IMAGE::m_State
private

Definition at line 141 of file excellon_image.h.

Referenced by EXCELLON_IMAGE(), Execute_HEADER_And_M_Command(), and LoadFile().

◆ m_SwapAxis

bool GERBER_FILE_IMAGE::m_SwapAxis
inherited

◆ m_TimeStamp

timestamp_t EDA_ITEM::m_TimeStamp
protectedinherited

◆ Pback

◆ Pnext


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