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 *&Text)
 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
 
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 (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) const
 Function HitTest tests if aPosition is contained within or on the bounding area 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 () 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
 

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
 
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_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 SelectUnits (bool aMetric)
 

Private Attributes

excellon_state m_State
 
bool m_SlotOn
 
bool m_format_known
 

Detailed Description

Definition at line 89 of file excellon_image.h.

Member Enumeration Documentation

Enumerator
READ_HEADER_STATE 
READ_PROGRAM_STATE 

Definition at line 92 of file excellon_image.h.

92  {
93  READ_HEADER_STATE, // When we are in this state, we are reading header
94  READ_PROGRAM_STATE // When we are in this state, we are reading drill data
95  };

Constructor & Destructor Documentation

EXCELLON_IMAGE::EXCELLON_IMAGE ( int  layer)
inline

Definition at line 101 of file excellon_image.h.

101  : EXCELLON_IMAGE( int layer ) :
102  GERBER_FILE_IMAGE( layer )
103  {
105  m_SlotOn = false;
106  m_format_known = false;
107  }
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
EXCELLON_IMAGE::~EXCELLON_IMAGE ( )
inline

Definition at line 110 of file excellon_image.h.

110 {};

Member Function Documentation

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

Function AddMessageToList Add a message to the message list.

Definition at line 298 of file gerber_file_image.h.

Referenced by GERBER_FILE_IMAGE::Execute_DCODE_Command(), GERBER_FILE_IMAGE::Execute_G_Command(), GERBER_FILE_IMAGE::ExecuteRS274XCommand(), and GERBER_FILE_IMAGE::ReadApertureMacro().

299  {
300  m_messagesList.Add( aMessage );
301  }
wxArrayString m_messagesList
EDA_ITEM* EDA_ITEM::Back ( ) const
inlineinherited

Definition at line 218 of file base_struct.h.

References EDA_ITEM::Pback.

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

218 { return Pback; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:176
void GERBER_FILE_IMAGE::Clear_GERBER_FILE_IMAGE ( )
inherited
void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 244 of file base_struct.h.

References BRIGHTENED, EDA_ITEM::ClearFlags(), and EDA_ITEM::SetModified().

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

244 { ClearFlags( BRIGHTENED ); }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:133
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:265
void EDA_ITEM::ClearFlags ( STATUS_FLAGS  aMask = EDA_ITEM_ALL_FLAGS)
inlineinherited

Definition at line 265 of file base_struct.h.

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(), abortMoveBitmap(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToList(), PNS_KICAD_IFACE::AddItem(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearHighlighted(), DRAG_LIST::ClearList(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), 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(), 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(), EraseDragList(), PCB_EDIT_FRAME::Exchange_Module(), ExitSheet(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), MarkItemsInBloc(), MirrorX(), MirrorY(), moveBitmap(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnRotateItem(), SCH_EDIT_FRAME::OnSelectUnit(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), SCH_FIELD::Place(), 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(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), BOARD_COMMIT::Revert(), PCB_BASE_FRAME::Rotate_Module(), RotateListOfItems(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::savePin(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

265 { m_Flags &= ~aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 243 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

243 { ClearFlags( HIGHLIGHTED ); }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:132
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:265
void GERBER_FILE_IMAGE::ClearMessageList ( )
inlineinherited

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

Definition at line 289 of file gerber_file_image.h.

290  {
291  m_messagesList.Clear();
292  }
wxArrayString m_messagesList
void EDA_ITEM::ClearSelected ( )
inlineinherited
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, SCH_COMPONENT, MODULE, ZONE_CONTAINER, SCH_SHEET, LIB_PIN, VIA, SEGZONE, SCH_HIERLABEL, SCH_GLOBALLABEL, TRACK, SCH_LABEL, DRAWSEGMENT, LIB_FIELD, DIMENSION, TEXTE_MODULE, SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, SCH_LINE, SCH_BUS_BUS_ENTRY, LIB_ARC, TEXTE_PCB, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, LIB_TEXT, EDGE_MODULE, LIB_POLYLINE, LIB_RECTANGLE, LIB_BEZIER, LIB_CIRCLE, SCH_MARKER, SCH_NO_CONNECT, PCB_TARGET, SCH_JUNCTION, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 124 of file base_struct.cpp.

References EDA_ITEM::GetClass().

Referenced by PCB_EDIT_FRAME::Block_Duplicate(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), CopyMarkedItems(), LIB_PART::CopySelectedItems(), LIB_EDIT_FRAME::copySelectedItems(), BOARD::Duplicate(), DuplicateStruct(), SCH_SCREEN::ExtractWires(), EDA_ITEM::HitTest(), LIB_PART::LIB_PART(), LIB_EDIT_FRAME::LoadOneSymbol(), new_clone(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::pasteClipboard(), SCH_EDIT_FRAME::RepeatDrawItem(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), LIB_PART::SetConversion(), SCH_EDIT_FRAME::SetRepeatItem(), SCH_EDIT_FRAME::SetUndoItem(), LIB_PART::SetUnitCount(), and COMMIT::Stage().

125 {
126  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
127  wxT( ". Bad programmer!" ) );
128 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.
int GERBER_FILE_IMAGE::DCodeNumber ( char *&  Text)
inherited

Definition at line 438 of file rs274d.cpp.

References IsNumber.

Referenced by GERBER_FILE_IMAGE::Execute_G_Command().

439 {
440  int ii = 0;
441  char* text;
442  char line[1024];
443 
444  if( Text == NULL )
445  return 0;
446 
447  Text++;
448  text = line;
449  while( IsNumber( *Text ) )
450  *(text++) = *(Text++);
451 
452  *text = 0;
453  ii = atoi( line );
454  return ii;
455 }
#define IsNumber(x)
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 334 of file gerber_file_image.cpp.

References EDA_DRAW_FRAME::AppendMsgPanel(), BROWN, EDA_DRAW_FRAME::ClearMsgPanel(), CYAN, DARKRED, g_UserUnit, 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, GERBER_FILE_IMAGE::m_ImageRotation, wxPoint::x, and wxPoint::y.

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

335 {
336  wxString msg;
337 
338  aMainFrame->ClearMsgPanel();
339 
340  // Display Image name (Image specific)
341  aMainFrame->AppendMsgPanel( _( "Image name" ), m_ImageName, CYAN );
342 
343  // Display graphic layer number used to draw this Image
344  // (not a Gerber parameter but is also image specific)
345  msg.Printf( wxT( "%d" ), m_GraphicLayer + 1 );
346  aMainFrame->AppendMsgPanel( _( "Graphic layer" ), msg, BROWN );
347 
348  // Display Image rotation (Image specific)
349  msg.Printf( wxT( "%d" ), m_ImageRotation );
350  aMainFrame->AppendMsgPanel( _( "Img Rot." ), msg, CYAN );
351 
352  // Display Image polarity (Image specific)
353  msg = m_ImageNegative ? _("Negative") : _("Normal");
354  aMainFrame->AppendMsgPanel( _( "Polarity" ), msg, BROWN );
355 
356  // Display Image justification and offset for justification (Image specific)
357  msg = m_ImageJustifyXCenter ? _("Center") : _("Normal");
358  aMainFrame->AppendMsgPanel( _( "X Justify" ), msg, DARKRED );
359 
360  msg = m_ImageJustifyYCenter ? _("Center") : _("Normal");
361  aMainFrame->AppendMsgPanel( _( "Y Justify" ), msg, DARKRED );
362 
363  if( g_UserUnit == INCHES )
364  msg.Printf( wxT( "X=%f Y=%f" ), Iu2Mils( m_ImageJustifyOffset.x ) / 1000.0,
365  Iu2Mils( m_ImageJustifyOffset.y ) / 1000.0 );
366  else
367  msg.Printf( wxT( "X=%f Y=%f" ), Iu2Millimeter( m_ImageJustifyOffset.x ),
368  Iu2Millimeter( m_ImageJustifyOffset.y ) );
369 
370  aMainFrame->AppendMsgPanel( _( "Image Justify Offset" ), msg, DARKRED );
371 }
Definition: colors.h:54
Definition: common.h:146
Definition: colors.h:59
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
Definition: draw_frame.cpp:811
void ClearMsgPanel(void)
Clear all messages from the message panel.
Definition: draw_frame.cpp:822
Definition: colors.h:62
bool EXCELLON_IMAGE::Execute_Drill_Command ( char *&  text)
private

Definition at line 530 of file excellon_read_drill_file.cpp.

References fillFlashedGBRITEM(), fillLineGBRITEM(), fmtIntegerInch, fmtIntegerMM, IsNumber, D_CODE::m_Num_Dcode, D_CODE::m_Shape, and D_CODE::m_Size.

531 {
532  D_CODE* tool;
533  GERBER_DRAW_ITEM * gbritem;
534 
535  while( true )
536  {
537  switch( *text )
538  {
539  case 'X':
540  case 'Y':
541  // Decode the coordinate format
542  if( !m_format_known )
543  {
544  int nbdigits = 0;
545  int integer = m_GerbMetric ? fmtIntegerMM : fmtIntegerInch;
546  int mantissa;
547  char* read = text + 1;
548 
549  while( IsNumber( *read ) )
550  {
551  if( *read == '.' )
552  {
553  integer = nbdigits;
554  read++;
555  continue;
556  }
557 
558  if( ( *read >= '0' ) && ( *read <='9' ) )
559  nbdigits++;
560 
561  read++;
562  }
563 
564  mantissa = nbdigits - integer;
565 
566  // Enforce minimum mantissa of 3 for metric
567  if( m_GerbMetric && mantissa < 3 )
568  mantissa = 3;
569 
570  m_FmtScale.x = m_FmtScale.y = mantissa;
571  m_FmtLen.x = m_FmtLen.y = integer + mantissa;
572 
573  m_format_known = true;
574  }
575 
576  ReadXYCoord( text );
577  break;
578 
579  case 'G': // G85 is found here for oval holes
582  break;
583 
584  case 0: // E.O.L: execute command
585  tool = GetDCODE( m_Current_Tool );
586 
587  if( !tool )
588  {
589  wxString msg;
590  msg.Printf( _( "Tool %d not defined" ), m_Current_Tool );
591  AddMessageToList( msg );
592  return false;
593  }
594 
595  gbritem = new GERBER_DRAW_ITEM( this );
596  m_Drawings.Append( gbritem );
597 
598  if( m_SlotOn ) // Oblong hole
599  {
600  fillLineGBRITEM( gbritem, tool->m_Num_Dcode,
602  tool->m_Size, false );
603  // the hole is made: reset the slot on command (G85)
604  // (it is needed for each oblong hole)
605  m_SlotOn = false;
606  }
607  else
608  {
609  fillFlashedGBRITEM( gbritem, tool->m_Shape, tool->m_Num_Dcode,
610  m_CurrentPos, tool->m_Size, false );
611  }
612 
613  StepAndRepeatItem( *gbritem );
615  return true;
616  break;
617 
618  default:
619  text++;
620  break;
621  }
622  }
623 
624  return true;
625 }
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE...
wxPoint ReadXYCoord(char *&Text)
Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm) ...
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
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
static const int fmtIntegerInch
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:107
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
static const int fmtIntegerMM
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
DLIST< GERBER_DRAW_ITEM > m_Drawings
#define IsNumber(x)
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:162
bool EXCELLON_IMAGE::Execute_EXCELLON_G_Command ( char *&  text)
private

Definition at line 666 of file excellon_read_drill_file.cpp.

References 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, FROM_UTF8(), GERB_INTERPOL_ARC_NEG, GERB_INTERPOL_ARC_POS, GERB_INTERPOL_LINEAR_1X, GetChars(), EXCELLON_CMD::m_Code, and EXCELLON_CMD::m_Name.

667 {
668  EXCELLON_CMD* cmd = NULL;
669  bool success = false;
670  int id = DRILL_G_UNKNOWN;
671 
672  // Search command in list
673  EXCELLON_CMD* candidate;
674  char * gcmd = text; // gcmd points the G command, for error messages.
675 
676  for( unsigned ii = 0; ; ii++ )
677  {
678  candidate = &excellon_G_CmdList[ii];
679  int len = candidate->m_Name.size();
680  if( len == 0 ) // End of list reached
681  break;
682  if( candidate->m_Name.compare( 0, len, text, len ) == 0 ) // found.
683  {
684  cmd = candidate;
685  text += len;
686  success = true;
687  id = cmd->m_Code;
688  break;
689  }
690  }
691 
692  switch( id )
693  {
694  case DRILL_G_ZERO_SET:
695  ReadXYCoord( text );
697  break;
698 
699  case DRILL_G_ROUT:
700  m_SlotOn = false;
701  m_PolygonFillMode = true;
702  break;
703 
704  case DRILL_G_DRILL:
705  m_SlotOn = false;
706  m_PolygonFillMode = false;
707  break;
708 
709  case DRILL_G_SLOT:
710  m_SlotOn = true;
711  break;
712 
713  case DRILL_G_LINEARMOVE:
715  break;
716 
717  case DRILL_G_CWMOVE:
719  break;
720 
721  case DRILL_G_CCWMOVE:
723  break;
724 
725  case DRILL_G_ABSOLUTE:
726  m_Relative = false; // false = absolute coord
727  break;
728 
729  case DRILL_G_INCREMENTAL:
730  m_Relative = true; // true = relative coord
731  break;
732 
733  case DRILL_G_UNKNOWN:
734  default:
735  {
736  wxString msg;
737  msg.Printf( _( "Unknown Excellon G Code: &lt;%s&gt;" ), GetChars(FROM_UTF8(gcmd)) );
738  AddMessageToList( msg );
739  while( *text )
740  text++;
741  return false;
742  }
743  }
744  return success;
745 }
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:53
wxPoint ReadXYCoord(char *&Text)
Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm) ...
std::string m_Name
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:92
bool EXCELLON_IMAGE::Execute_HEADER_Command ( char *&  text)
private

Definition at line 327 of file excellon_read_drill_file.cpp.

References 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_ENDHEADER, DRILL_M_ENDPATTERN, DRILL_M_ENDREWIND, DRILL_M_HEADER, DRILL_M_LONGMESSAGE, DRILL_M_MESSAGE, DRILL_M_METRIC, DRILL_M_TIPCHECK, DRILL_M_UNKNOWN, DRILL_METRIC_HEADER, DRILL_RESET_CMD, DRILL_REWIND_STOP, DRILL_SKIP, DRILL_TOOL_CHANGE_STOP, DRILL_TOOL_INFORMATION, EXCELLON_CMD::m_Code, and EXCELLON_CMD::m_Name.

328 {
329  EXCELLON_CMD* cmd = NULL;
330  wxString msg;
331 
332  // Search command in list
333  for( unsigned ii = 0; ; ii++ )
334  {
335  EXCELLON_CMD* candidate = &excellonHeaderCmdList[ii];
336  int len = candidate->m_Name.size();
337 
338  if( len == 0 ) // End of list reached
339  break;
340 
341  if( candidate->m_Name.compare( 0, len, text, len ) == 0 ) // found.
342  {
343  cmd = candidate;
344  text += len;
345  break;
346  }
347  }
348 
349  if( !cmd )
350  {
351  msg.Printf( wxT( "Unknown Excellon command &lt;%s&gt;" ), text );
352  AddMessageToList( msg );
353  while( *text )
354  text++;
355 
356  return false;
357  }
358 
359  // Execute command
360  // some do nothing
361  switch( cmd->m_Code )
362  {
363  case DRILL_SKIP:
364  case DRILL_M_UNKNOWN:
365  break;
366 
367  case DRILL_M_END:
368  break;
369 
370  case DRILL_M_ENDREWIND:
371  break;
372 
373  case DRILL_M_MESSAGE:
374  break;
375 
376  case DRILL_M_LONGMESSAGE:
377  break;
378 
379  case DRILL_M_HEADER:
381  break;
382 
383  case DRILL_M_ENDHEADER:
385  break;
386 
387  case DRILL_REWIND_STOP: // End of header. No action in a viewer
389  break;
390 
391  case DRILL_M_METRIC:
392  SelectUnits( true );
393  break;
394 
395  case DRILL_IMPERIAL_HEADER: // command like INCH,TZ or INCH,LZ
396  case DRILL_METRIC_HEADER: // command like METRIC,TZ or METRIC,LZ
397  SelectUnits( cmd->m_Code == DRILL_METRIC_HEADER ? true : false );
398 
399  if( *text != ',' )
400  {
401  // No TZ or LZ specified. Can be a decimal format
402  // I am not sure this is incorrect and must be reported.
403  // AddMessageToList( _( "METRIC or INCH command has no parameter" ) );
404  // use default TZ setting, for now
405  m_NoTrailingZeros = false;
406  break;
407  }
408 
409  text++; // skip separator
410  if( *text == 'T' )
411  m_NoTrailingZeros = false;
412  else
413  m_NoTrailingZeros = true;
414  break;
415 
417  break;
418 
419  case DRILL_M_ENDPATTERN:
420  break;
421 
422  case DRILL_M_CANNEDTEXT:
423  break;
424 
425  case DRILL_M_TIPCHECK:
426  break;
427 
428  case DRILL_DETECT_BROKEN:
429  break;
430 
432  if( *text != ',' )
433  {
434  AddMessageToList( _( "ICI command has no parameter" ) );
435  break;
436  }
437  text++; // skip separator
438  // Parameter should be ON or OFF
439  if( strncasecmp( text, "OFF", 3 ) == 0 )
440  m_Relative = false;
441  else if( strncasecmp( text, "ON", 2 ) == 0 )
442  m_Relative = true;
443  else
444  AddMessageToList( _( "ICI command has incorrect parameter" ) );
445  break;
446 
448  break;
449 
451  break;
452 
453  case DRILL_AXIS_VERSION:
454  break;
455 
456  case DRILL_RESET_CMD:
457  break;
458 
460  break;
461 
462  case DRILL_FMT:
463  break;
464 
466  readToolInformation( text );
467  break;
468  }
469 
470  while( *text )
471  text++;
472 
473  return true;
474 }
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 SelectUnits(bool aMetric)
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.

References GERBER_FILE_IMAGE::m_aperture_macros.

Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand().

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
int GERBER_FILE_IMAGE::GCodeNumber ( char *&  Text)
inherited

Definition at line 415 of file rs274d.cpp.

References IsNumber.

416 {
417  int ii = 0;
418  char* text;
419  char line[1024];
420 
421  if( Text == NULL )
422  return 0;
423  Text++;
424  text = line;
425  while( IsNumber( *Text ) )
426  {
427  *(text++) = *(Text++);
428  }
429 
430  *text = 0;
431  ii = atoi( line );
432  return ii;
433 }
#define IsNumber(x)
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, SCH_HIERLABEL, LIB_PART, SCH_COMPONENT, SCH_GLOBALLABEL, LIB_ITEM, SCH_LABEL, GERBER_DRAW_ITEM, DIMENSION, DRAWSEGMENT, LIB_FIELD, TEXTE_MODULE, MODULE, TEXTE_PCB, ZONE_CONTAINER, SCH_TEXT, LIB_PIN, TRACK, MARKER_PCB, SCH_LINE, GBR_LAYOUT, LIB_ARC, SCH_FIELD, LIB_TEXT, SCH_BITMAP, PCB_TARGET, SCH_BUS_ENTRY_BASE, LIB_BEZIER, LIB_POLYLINE, LIB_RECTANGLE, LIB_CIRCLE, SCH_MARKER, SCH_NO_CONNECT, and SCH_JUNCTION.

Definition at line 111 of file base_struct.cpp.

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), CN_ITEM::BBox(), MODULE::CoverageRatio(), SCH_EDIT_FRAME::DeleteItem(), getAnchorPoint(), LIB_ITEM::GetBoundingBox(), GetBoundingBoxes(), getRect(), getSheetBbox(), EDA_ITEM::HitTest(), SELECTION_TOOL::selectable(), SELECTION_TOOL::selectMultiple(), and EDA_ITEM::ViewBBox().

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

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 234 of file gerber_file_image.h.

Referenced by GERBER_FILE_IMAGE::Visit().

235  {
236  return wxT( "GERBER_FILE_IMAGE" );
237  }
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.

References DIM, FIRST_DCODE, and GERBER_FILE_IMAGE::m_Aperture_List.

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

152 {
153  unsigned ndx = aDCODE - FIRST_DCODE;
154 
155  if( ndx < (unsigned) DIM( m_Aperture_List ) )
156  {
157  return m_Aperture_List[ndx];
158  }
159 
160  return NULL;
161 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
#define FIRST_DCODE
Definition: dcode.h:71
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.

References DIM, FIRST_DCODE, and GERBER_FILE_IMAGE::m_Aperture_List.

Referenced by GERBER_FILE_IMAGE::ExecuteRS274XCommand().

132 {
133  unsigned ndx = aDCODE - FIRST_DCODE;
134 
135  if( ndx < (unsigned) DIM( 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 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
#define FIRST_DCODE
Definition: dcode.h:71
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
int GERBER_FILE_IMAGE::GetDcodesCount ( )
inherited
Returns
the count of Dcode tools in used by the image

Definition at line 260 of file gerber_file_image.cpp.

References DIM, 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().

261 {
262  int count = 0;
263 
264  for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
265  {
266  if( m_Aperture_List[ii] )
267  if( m_Aperture_List[ii]->m_InUse || m_Aperture_List[ii]->m_Defined )
268  ++count;
269  }
270 
271  return count;
272 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
STATUS_FLAGS EDA_ITEM::GetFlags ( ) const
inlineinherited

Definition at line 266 of file base_struct.h.

References EDA_ITEM::m_Flags.

Referenced by AbortMoveAndEditTarget(), SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForBitmap(), AddMenusForBusEntry(), AddMenusForComponent(), AddMenusForComponentField(), AddMenusForEditComponent(), AddMenusForGLabel(), AddMenusForHierchicalSheet(), AddMenusForHLabel(), AddMenusForLabel(), AddMenusForSheetPin(), AddMenusForText(), SCH_EDIT_FRAME::BeginSegment(), SCH_EDIT_FRAME::ChangeTextOrient(), Collect_TrackSegmentsToDrag(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_EDIT_FRAME::copySelectedItems(), LIB_EDIT_FRAME::CreatePin(), 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::DeleteItem(), SCH_EDIT_FRAME::DeleteItemsInList(), SCH_EDIT_FRAME::DeleteJunction(), BOARD::Draw(), PCB_EDIT_FRAME::Edit_TrackSegm_Width(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_VIEW_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), InitialiseDragParameters(), EDA_DRAW_FRAME::isBusy(), Magnetize(), SCH_EDIT_FRAME::MirrorImage(), SCH_EDIT_FRAME::MirrorSheet(), moveBitmap(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnHotKey(), SCH_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(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), SCH_EDIT_FRAME::OnMoveItem(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_EDIT_FRAME::OrientComponent(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), TRACKS_CLEANER::removeDuplicatesOfTrack(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_EDIT_FRAME::RotateField(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), SCH_EDIT_FRAME::RotateImage(), PCB_BASE_FRAME::RotateTextModule(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SCREEN::SelectBlockItems(), SCH_EDIT_FRAME::SetBusEntryShape(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

266 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
GERBER_LAYER& GERBER_FILE_IMAGE::GetLayerParams ( )
inlineinherited
DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited
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, MODULE, SCH_COMPONENT, ZONE_CONTAINER, SCH_SHEET, LIB_PIN, VIA, SEGZONE, SCH_HIERLABEL, GERBER_DRAW_ITEM, SCH_GLOBALLABEL, TRACK, DRAWSEGMENT, SCH_LABEL, LIB_FIELD, DIMENSION, TEXTE_MODULE, SCH_SHEET_PIN, SCH_BUS_BUS_ENTRY, SCH_TEXT, SCH_FIELD, SCH_LINE, LIB_ARC, SCH_BUS_WIRE_ENTRY, TEXTE_PCB, LIB_TEXT, SCH_BITMAP, EDGE_MODULE, LIB_POLYLINE, MARKER_PCB, LIB_RECTANGLE, LIB_CIRCLE, PCB_TARGET, SCH_MARKER, SCH_NO_CONNECT, and SCH_JUNCTION.

Definition at line 281 of file base_struct.cpp.

References dummy_xpm, EDA_ITEM::GetClass(), i, operator<<(), wxPoint::x, and wxPoint::y.

Referenced by SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SELECTION_TOOL::disambiguationMenu(), EDA_ITEM::HitTest(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), and PCB_BASE_FRAME::PcbGeneralLocateAndDisplay().

282 {
283  return dummy_xpm;
284 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: base_struct.cpp:57
const wxArrayString& GERBER_FILE_IMAGE::GetMessages ( ) const
inlineinherited

Definition at line 250 of file gerber_file_image.h.

References GERBER_LAYER::ResetDefaultValues().

Referenced by GERBVIEW_FRAME::Read_GERBER_File().

250 { return m_messagesList; }
wxArrayString m_messagesList
virtual void EDA_ITEM::GetMsgPanelInfo ( 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, LIB_ITEM, NETINFO_ITEM, TRACK, DIMENSION, SCH_TEXT, DRAWSEGMENT, TEXTE_MODULE, LIB_FIELD, LIB_PIN, EDGE_MODULE, MARKER_PCB, LIB_BEZIER, LIB_ARC, ZONE_CONTAINER, LIB_TEXT, TEXTE_PCB, SCH_MARKER, LIB_POLYLINE, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 288 of file base_struct.h.

Referenced by SCH_EDIT_FRAME::LocateItem(), EDA_DRAW_FRAME::SetMsgPanel(), FOOTPRINT_VIEWER_FRAME::UpdateMsgPanel(), PCB_BASE_FRAME::UpdateMsgPanel(), and FOOTPRINT_EDIT_FRAME::UpdateMsgPanel().

289  {
290  }
COLOR4D GERBER_FILE_IMAGE::GetPositiveDrawColor ( ) const
inlineinherited

Definition at line 259 of file gerber_file_image.h.

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

259 { return m_PositiveDrawColor; }
wxString EDA_ITEM::GetSelectMenuText ( ) 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, MODULE, SCH_COMPONENT, ZONE_CONTAINER, SCH_SHEET, LIB_PIN, VIA, SEGZONE, SCH_HIERLABEL, DELETED_SCH_ITEM, GERBER_DRAW_ITEM, SCH_GLOBALLABEL, TRACK, DRAWSEGMENT, SCH_LABEL, LIB_FIELD, DIMENSION, TEXTE_MODULE, SCH_SHEET_PIN, SCH_TEXT, SCH_BUS_BUS_ENTRY, SCH_FIELD, SCH_LINE, LIB_ARC, SCH_BUS_WIRE_ENTRY, TEXTE_PCB, LIB_TEXT, SCH_BITMAP, EDGE_MODULE, LIB_POLYLINE, MARKER_PCB, LIB_RECTANGLE, LIB_CIRCLE, PCB_TARGET, SCH_MARKER, SCH_NO_CONNECT, and SCH_JUNCTION.

Definition at line 174 of file base_struct.cpp.

References EDA_ITEM::GetClass().

Referenced by SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), SELECTION_TOOL::disambiguationMenu(), DRC::fillMarker(), SCH_FIND_COLLECTOR::GetText(), EDA_ITEM::HitTest(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), and PCB_BASE_FRAME::PcbGeneralLocateAndDisplay().

175 {
176  wxFAIL_MSG( wxT( "GetSelectMenuText() was not overridden for schematic item type " ) +
177  GetClass() );
178 
179  return wxString( wxT( "Undefined menu text for " ) + GetClass() );
180 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.
STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 261 of file base_struct.h.

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format(), and GERBER_DRAW_ITEM::HitTest().

261 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:172
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 236 of file gerber_file_image.cpp.

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

237 {
238  if( m_hasNegativeItems < 0 ) // negative items are not yet searched: find them if any
239  {
240  if( m_ImageNegative ) // A negative layer is expected having always negative objects.
241  m_hasNegativeItems = 1;
242  else
243  {
244  m_hasNegativeItems = 0;
245  for( GERBER_DRAW_ITEM* item = GetItemsList(); item; item = item->Next() )
246  {
247  if( item->GetLayer() != m_GraphicLayer )
248  continue;
249  if( item->HasNegativeItems() )
250  {
251  m_hasNegativeItems = 1;
252  break;
253  }
254  }
255  }
256  }
257  return m_hasNegativeItems == 1;
258 }
GERBER_DRAW_ITEM * Next() const
GERBER_DRAW_ITEM * GetItemsList()
Function GetItemsList.
virtual bool EDA_ITEM::HitTest ( const wxPoint aPosition) const
inlinevirtualinherited

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

Parameters
aPositionA reference to a wxPoint object containing the coordinates to test.
Returns
True if aPosition is within or on the item bounding area.

Reimplemented in D_PAD, MODULE, VIA, SCH_ITEM, BOARD_ITEM, GERBER_DRAW_ITEM, ZONE_CONTAINER, TRACK, LIB_ITEM, DIMENSION, DRAWSEGMENT, TEXTE_MODULE, LIB_FIELD, LIB_PIN, MARKER_PCB, LIB_ARC, TEXTE_PCB, PCB_TARGET, LIB_TEXT, LIB_BEZIER, LIB_POLYLINE, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 299 of file base_struct.h.

References EDA_ITEM::Clone(), EDA_ITEM::GetBoundingBox(), EDA_ITEM::GetClass(), EDA_ITEM::GetMenuImage(), EDA_ITEM::GetSelectMenuText(), EDA_ITEM::IterateForward(), and EDA_ITEM::Visit().

Referenced by LIB_ITEM::HitTest(), BOARD_ITEM::HitTest(), GERBER_COLLECTOR::Inspect(), and SCH_COLLECTOR::Inspect().

300  {
301  return false; // derived classes should override this function
302  }
void GERBER_FILE_IMAGE::InitToolTable ( )
inherited

Function InitToolTable.

Definition at line 275 of file gerber_file_image.cpp.

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.

276 {
277  for( int count = 0; count < TOOLS_MAX_COUNT; count++ )
278  {
279  if( m_Aperture_List[count] == NULL )
280  continue;
281 
282  m_Aperture_List[count]->m_Num_Dcode = count + FIRST_DCODE;
284  }
285 
286  m_aperture_macros.clear();
287 }
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
bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

Definition at line 235 of file base_struct.h.

References BRIGHTENED.

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

235 { return m_Flags & BRIGHTENED; }
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:133
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
bool EDA_ITEM::IsDragging ( ) const
inlineinherited
bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 234 of file base_struct.h.

References HIGHLIGHTED.

234 { return m_Flags & HIGHLIGHTED; }
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:132
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 228 of file base_struct.h.

References IS_CHANGED.

Referenced by LIB_EDIT_FRAME::OnEditPin().

228 { return m_Flags & IS_CHANGED; }
#define IS_CHANGED
std::function passed to nested users by ref, avoids copying std::function
Definition: base_struct.h:105
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
bool EDA_ITEM::IsNew ( ) const
inlineinherited

Definition at line 227 of file base_struct.h.

References IS_NEW.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_MoveOrCopyModule(), Abort_Zone_Create_Outline(), AbortBuildDimension(), AbortMoveAndEditTarget(), abortMoveBitmap(), abortMoveItem(), AbortPinMove(), AbortSymbolTraceOn(), SCH_EDIT_FRAME::addCurrentItemToList(), SCH_EDIT_FRAME::addJunctionMenuEntries(), AddMenusForBus(), AddMenusForWire(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteCurrentSegment(), LIB_ARC::drawEditGraphics(), LIB_ARC::drawGraphic(), DrawMovePin(), SCH_EDIT_FRAME::EditSheetPin(), LIB_PIN::EnableEditMode(), LIB_EDIT_FRAME::EndDrawGraphicItem(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), LIB_PART::LIB_PART(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), LIB_EDIT_FRAME::OnEditPin(), SCH_EDIT_FRAME::OnHotKey(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_BASE_FRAME::PlaceModule(), LIB_EDIT_FRAME::PlacePin(), PCB_EDIT_FRAME::PlaceTarget(), SCH_EDIT_FRAME::PrepareMoveItem(), SCH_EDIT_FRAME::ReSizeSheet(), ShowClearance(), PCB_EDIT_FRAME::StartMoveTextePcb(), PCB_EDIT_FRAME::SwitchLayer(), and DIALOG_LABEL_EDITOR::TextPropertiesAccept().

227 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:109
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
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 455 of file base_struct.h.

References EDA_ITEM::operator<().

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

455 { return false; }
bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 233 of file base_struct.h.

References IS_RESIZED.

Referenced by ExitSheet().

233 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:110
bool EDA_ITEM::IsSelected ( ) const
inlineinherited

Definition at line 232 of file base_struct.h.

References SELECTED.

Referenced by SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForPin(), KIGFX::PCB_PAINTER::draw(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_TEXT::drawGraphic(), LIB_ARC::drawGraphic(), LIB_FIELD::drawGraphic(), DrawMovingBlockOutlines(), LIB_PIN::DrawPinElectricalTypeName(), LIB_PIN::DrawPinSymbol(), LIB_PIN::DrawPinTexts(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), LIB_EDIT_FRAME::GlobalSetPins(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), MirrorMarkedItems(), MoveMarkedItems(), MoveMarkedItemsExactly(), LIB_TEXT::Plot(), RotateMarkedItems(), SELECTION_TOOL::SanitizeSelection(), GERBVIEW_SELECTION_TOOL::select(), SELECTION_TOOL::select(), SCH_SCREEN::SelectBlockItems(), GERBVIEW_SELECTION_TOOL::toggleSelection(), SELECTION_TOOL::toggleSelection(), GERBVIEW_SELECTION_TOOL::unselect(), and SELECTION_TOOL::unselect().

232 { return m_Flags & SELECTED; }
#define SELECTED
Definition: base_struct.h:116
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 231 of file base_struct.h.

References IS_WIRE_IMAGE.

Referenced by abortMoveItem(), and SCH_FIELD::Draw().

231 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:113
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
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 131 of file base_struct.cpp.

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

Referenced by SCH_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::Collect(), SCH_TYPE_COLLECTOR::Collect(), SCH_FIND_COLLECTOR::GetItem(), EDA_ITEM::HitTest(), GERBER_FILE_IMAGE::Visit(), MODULE::Visit(), and BOARD::Visit().

135 {
136  EDA_ITEM* p = listStart;
137 
138  for( ; p; p = p->Pnext )
139  {
140  if( SEARCH_QUIT == p->Visit( inspector, testData, scanTypes ) )
141  return SEARCH_QUIT;
142  }
143 
144  return SEARCH_CONTINUE;
145 }
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:162
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:175
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 236 of file excellon_read_drill_file.cpp.

References GERBVIEW_FRAME::ClearMessageList(), dummy(), file_attribute, LINE_READER::Line(), X2_ATTRIBUTE::ParseAttribCmd(), READ_HEADER_STATE, FILE_LINE_READER::ReadLine(), and StrPurge().

237 {
238  // Set the default parmeter values:
241 
242  m_Current_File = wxFopen( aFullFileName, wxT( "rt" ) );
243 
244  if( m_Current_File == NULL )
245  return false;
246 
247  m_FileName = aFullFileName;
248 
249  LOCALE_IO toggleIo;
250 
251  // FILE_LINE_READER will close the file.
252  FILE_LINE_READER excellonReader( m_Current_File, m_FileName );
253 
254  while( true )
255  {
256  if( excellonReader.ReadLine() == 0 )
257  break;
258 
259  char* line = excellonReader.Line();
260  char* text = StrPurge( line );
261 
262  if( *text == ';' ) // comment: skip line
263  continue;
264 
266  {
267  Execute_HEADER_Command( text );
268  }
269  else
270  {
271  switch( *text )
272  {
273  case 'M':
274  Execute_HEADER_Command( text );
275  break;
276 
277  case 'G': /* Line type Gxx : command */
279  break;
280 
281  case 'X':
282  case 'Y': // command like X12550Y19250
283  Execute_Drill_Command(text);
284  break;
285 
286  case 'I':
287  case 'J': /* Auxiliary Move command */
288  m_IJPos = ReadIJCoord( text );
289  if( *text == '*' ) // command like X35142Y15945J504
290  {
291  Execute_Drill_Command( text);
292  }
293  break;
294 
295  case 'T': // Tool command
296  Select_Tool( text );
297  break;
298 
299  case '%':
300  break;
301 
302  default:
303  {
304  wxString msg;
305  msg.Printf( wxT( "Unexpected symbol &lt;%c&gt;" ), *text );
306  AddMessageToList( msg );
307  }
308  break;
309  } // End switch
310  }
311  }
312 
313  // Add our file attribute, to identify the drill file
315  char* text = (char*)file_attribute;
316  int dummyline = 0;
317  dummy.ParseAttribCmd( NULL, NULL, 0, text, dummyline );
318  delete m_FileFunction;
320 
321  m_InUse = true;
322 
323  return true;
324 }
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)
Function StrPurge removes leading and training spaces, tabs and end of line chars in text return a po...
Definition: string.cpp:194
virtual void ResetDefaultValues() override
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown...
Definition: common.h:167
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)
bool Execute_HEADER_Command(char *&text)
Class FILE_LINE_READER is a LINE_READER that reads from an open file.
Definition: richio.h:180
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 ParseAttribCmd(FILE *aFile, char *aBuffer, int aBuffSize, char *&aText, int &aLineNum)
parse a TF command terminated with a % and fill m_Prms by the parameters found.
bool Execute_EXCELLON_G_Command(char *&text)
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 114 of file readgerb.cpp.

References GERBVIEW_FRAME::ClearMessageList(), CMD_IDLE, END_BLOCK, ENTER_RS274X_CMD, GERBER_BUFZ, lineBuffer, and StrPurge().

Referenced by GERBVIEW_FRAME::Read_GERBER_File().

115 {
116  int G_command = 0; // command number for G commands like G04
117  int D_commande = 0; // command number for D commands like D02
118  char* text;
119 
120  ClearMessageList( );
122 
123  // Read the gerber file */
124  m_Current_File = wxFopen( aFullFileName, wxT( "rt" ) );
125 
126  if( m_Current_File == 0 )
127  return false;
128 
129  m_FileName = aFullFileName;
130 
131  LOCALE_IO toggleIo;
132 
133  wxString msg;
134 
135  while( true )
136  {
137  if( fgets( lineBuffer, GERBER_BUFZ, m_Current_File ) == NULL )
138  break;
139 
140  m_LineNum++;
141  text = StrPurge( lineBuffer );
142 
143  while( text && *text )
144  {
145  switch( *text )
146  {
147  case ' ':
148  case '\r':
149  case '\n':
150  text++;
151  break;
152 
153  case '*': // End command
155  text++;
156  break;
157 
158  case 'M': // End file
160  while( *text )
161  text++;
162  break;
163 
164  case 'G': /* Line type Gxx : command */
165  G_command = GCodeNumber( text );
166  Execute_G_Command( text, G_command );
167  break;
168 
169  case 'D': /* Line type Dxx : Tool selection (xx > 0) or
170  * command if xx = 0..9 */
171  D_commande = DCodeNumber( text );
172  Execute_DCODE_Command( text, D_commande );
173  break;
174 
175  case 'X':
176  case 'Y': /* Move or draw command */
177  m_CurrentPos = ReadXYCoord( text );
178  if( *text == '*' ) // command like X12550Y19250*
179  {
181  }
182  break;
183 
184  case 'I':
185  case 'J': /* Auxiliary Move command */
186  m_IJPos = ReadIJCoord( text );
187 
188  if( *text == '*' ) // command like X35142Y15945J504*
189  {
191  }
192  break;
193 
194  case '%':
196  {
199  }
200  else //Error
201  {
202  AddMessageToList( wxT("Expected RS274X Command") );
204  text++;
205  }
206  break;
207 
208  default:
209  text++;
210  msg.Printf( wxT("Unexpected symbol <%c>"), *text );
211  AddMessageToList( msg );
212  break;
213  }
214  }
215  }
216 
217  fclose( m_Current_File );
218 
219  m_InUse = true;
220 
221  return true;
222 }
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:594
char * StrPurge(char *text)
Function StrPurge removes leading and training spaces, tabs and end of line chars in text return a po...
Definition: string.cpp:194
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown...
Definition: common.h:167
wxPoint ReadXYCoord(char *&Text)
Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm) ...
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:415
static char lineBuffer[GERBER_BUFZ+1]
Definition: readgerb.cpp:112
int DCodeNumber(char *&Text)
Definition: rs274d.cpp:438
#define GERBER_BUFZ
Definition: readgerb.cpp:110
bool Execute_G_Command(char *&text, int G_command)
Definition: rs274d.cpp:458
bool ReadRS274XCommand(char *aBuff, unsigned int aBuffSize, char *&aText)
reads a single RS274X command terminated with a %
Definition: rs274x.cpp:186
virtual void ResetDefaultValues()
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_SHEET_PIN, SCH_FIELD, SCH_TEXT, LIB_PIN, and SCH_MARKER.

Definition at line 411 of file base_struct.h.

References EDA_ITEM::Replace().

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

412  {
413  return false;
414  }
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 183 of file base_struct.cpp.

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

184 {
185  wxString text = aText;
186  wxString searchText = aSearchData.GetFindString();
187 
188  // Don't match if searching for replaceable item and the item doesn't support text replace.
189  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
190  return false;
191 
192  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
193  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
194 
195  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
196  {
197  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
198  return text.Matches( searchText );
199 
200  return text.MakeUpper().Matches( searchText.MakeUpper() );
201  }
202 
203  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
204  return aText.Find( searchText ) != wxNOT_FOUND;
205 
206  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
207 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:455
Perform search using simple wild card matching (* & ?).
Perform a search for a item that has replaceable text.
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 240 of file base_struct.cpp.

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

Referenced by EDA_ITEM::IsReplaceable(), and LIB_ALIAS::operator==().

241 {
242  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
243  GetChars( GetClass() ) ) );
244 
245  return false;
246 }
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:92
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
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 172 of file rs274_read_XY_and_IJ_coordinates.cpp.

References IsNumber, 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_NoTrailingZeros, scale_list, wxPoint::x, and wxPoint::y.

173 {
174  wxPoint pos( 0, 0 );
175 
176  int type_coord = 0, current_coord, nbdigits;
177  bool is_float = false;
178  char* text;
179  char line[256];
180 
181  if( Text == NULL )
182  return pos;
183 
184  text = line;
185  while( *Text )
186  {
187  if( (*Text == 'I') || (*Text == 'J') )
188  {
189  type_coord = *Text;
190  Text++;
191  text = line;
192  nbdigits = 0;
193  while( IsNumber( *Text ) )
194  {
195  if( *Text == '.' )
196  is_float = true;
197 
198  // count digits only (sign and decimal point are not counted)
199  if( (*Text >= '0') && (*Text <='9') )
200  nbdigits++;
201 
202  *(text++) = *(Text++);
203  }
204 
205  *text = 0;
206  if( is_float )
207  {
208  // When X or Y values are float numbers, they are given in mm or inches
209  if( m_GerbMetric ) // units are mm
210  current_coord = KiROUND( atof( line ) * IU_PER_MILS / 0.0254 );
211  else // units are inches
212  current_coord = KiROUND( atof( line ) * IU_PER_MILS * 1000 );
213  }
214  else
215  {
216  int fmt_scale =
217  (type_coord == 'I') ? m_FmtScale.x : m_FmtScale.y;
218 
219  if( m_NoTrailingZeros )
220  {
221  int min_digit =
222  (type_coord == 'I') ? m_FmtLen.x : m_FmtLen.y;
223  while( nbdigits < min_digit )
224  {
225  *(text++) = '0';
226  nbdigits++;
227  }
228 
229  *text = 0;
230  }
231 
232  current_coord = atoi( line );
233 
234  double real_scale = scale_list[fmt_scale];
235 
236  if( m_GerbMetric )
237  real_scale = real_scale / 25.4;
238 
239  current_coord = KiROUND( current_coord * real_scale );
240  }
241  if( type_coord == 'I' )
242  pos.x = current_coord;
243  else if( type_coord == 'J' )
244  pos.y = current_coord;
245 
246  continue;
247  }
248  else
249  break;
250  }
251 
252  m_IJPos = pos;
253  return pos;
254 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:106
static double scale_list[SCALE_LIST_SIZE]
#define IsNumber(x)
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 477 of file excellon_read_drill_file.cpp.

References APT_CIRCLE, FIRST_DCODE, Format(), KiROUND(), D_CODE::m_Defined, D_CODE::m_Shape, D_CODE::m_Size, ReadDouble(), and ReadInt().

478 {
479  // Read a tool definition like T1C0.02 or T1F00S00C0.02 or T1C0.02F00S00
480  // and enter the TCODE param in list (using the D_CODE param management, which
481  // is similar to TCODE params.
482  if( *aText == 'T' ) // This is the beginning of the definition
483  aText++;
484 
485  // Read tool number:
486  int iprm = ReadInt( aText, false );
487 
488  // Skip Feed rate and Spindle speed, if any here
489  while( *aText && ( *aText == 'F' || *aText == 'S' ) )
490  {
491  aText++;
492  ReadInt( aText, false );
493  }
494 
495  // Read tool shape
496  if( ! *aText )
498  _( "Tool definition shape not found" ) ) );
499  else if( *aText != 'C' )
501  _( "Tool definition '%c' not supported" ), *aText ) );
502  if( *aText )
503  aText++;
504 
505  //read tool diameter:
506  double dprm = ReadDouble( aText, false );
507  m_Has_DCode = true;
508 
509  // Initialize Dcode to handle this Tool
510  // Remember: dcodes are >= FIRST_DCODE
511  D_CODE* dcode = GetDCODEOrCreate( iprm + FIRST_DCODE );
512 
513  if( dcode == NULL )
514  return false;
515 
516  // conv_scale = scaling factor from inch to Internal Unit
517  double conv_scale = IU_PER_MILS * 1000;
518 
519  if( m_GerbMetric )
520  conv_scale /= 25.4;
521 
522  dcode->m_Size.x = dcode->m_Size.y = KiROUND( dprm * conv_scale );
523  dcode->m_Shape = APT_CIRCLE;
524  dcode->m_Defined = true;
525 
526  return true;
527 }
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:106
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.
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.
wxPoint GERBER_FILE_IMAGE::ReadXYCoord ( char *&  Text)
inherited

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

Definition at line 72 of file rs274_read_XY_and_IJ_coordinates.cpp.

References IsNumber, KiROUND(), GERBER_FILE_IMAGE::m_CurrentPos, GERBER_FILE_IMAGE::m_FmtLen, GERBER_FILE_IMAGE::m_FmtScale, GERBER_FILE_IMAGE::m_GerbMetric, GERBER_FILE_IMAGE::m_NoTrailingZeros, GERBER_FILE_IMAGE::m_Relative, scale_list, wxPoint::x, and wxPoint::y.

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') )
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 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  int min_digit =
127  (type_coord == 'X') ? m_FmtLen.x : m_FmtLen.y;
128  while( nbdigits < min_digit )
129  {
130  *(text++) = '0';
131  nbdigits++;
132  }
133 
134  *text = 0;
135  }
136 
137  current_coord = atoi( line );
138  double real_scale = scale_list[fmt_scale];
139 
140  if( m_GerbMetric )
141  real_scale = real_scale / 25.4;
142 
143  current_coord = KiROUND( current_coord * real_scale );
144  }
145 
146  if( type_coord == 'X' )
147  pos.x = current_coord;
148  else if( type_coord == 'Y' )
149  pos.y = current_coord;
150 
151  continue;
152  }
153  else
154  break;
155  }
156 
157  if( m_Relative )
158  {
159  pos.x += m_CurrentPos.x;
160  pos.y += m_CurrentPos.y;
161  }
162 
163  m_CurrentPos = pos;
164  return pos;
165 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:106
static double scale_list[SCALE_LIST_SIZE]
#define IsNumber(x)
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 374 of file gerber_file_image.cpp.

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

375 {
376  /* Called when a %TD command is found
377  * Remove the attribute specified by the %TD command.
378  * is no attribute, all current attributes specified by the %TO and the %TA
379  * commands are cleared.
380  * if a attribute name is specified (for instance %TD.CN*%) is specified,
381  * only this attribute is cleared
382  */
383  m_NetAttributeDict.ClearAttribute( &aAttribute.GetPrm( 1 ) );
384 
385  if( aAttribute.GetPrm( 1 ).IsEmpty() || aAttribute.GetPrm( 1 ) == ".AperFunction" )
386  m_AperFunction.Clear();
387 }
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 ...
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 210 of file base_struct.cpp.

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

Referenced by EDA_ITEM::Matches(), SCH_TEXT::Replace(), SCH_FIELD::Replace(), SCH_SHEET_PIN::Replace(), SCH_SHEET::Replace(), and SCH_FIND_COLLECTOR::ReplaceItem().

211 {
212  wxCHECK_MSG( IsReplaceable(), false,
213  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
214 
215  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
216 
217  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
218  aSearchData.GetFindString() :
219  aSearchData.GetFindString().Upper() );
220 
221  if( result == wxNOT_FOUND )
222  return false;
223 
224  wxString prefix = aText.Left( result );
225  wxString suffix;
226 
227  if( aSearchData.GetFindString().length() + result < aText.length() )
228  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
229 
230  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
231  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
232  GetChars( suffix ) );
233 
234  aText = prefix + aSearchData.GetReplaceString() + suffix;
235 
236  return true;
237 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:455
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:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
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_SHEET_PIN, SCH_FIELD, and SCH_TEXT.

Definition at line 443 of file base_struct.h.

443 { return false; }
virtual void EXCELLON_IMAGE::ResetDefaultValues ( )
inlineoverridevirtual

Reimplemented from GERBER_FILE_IMAGE.

Definition at line 112 of file excellon_image.h.

References GERBER_FILE_IMAGE::ResetDefaultValues().

113  {
115  SelectUnits( false );
116  }
void SelectUnits(bool aMetric)
virtual void ResetDefaultValues()
bool EXCELLON_IMAGE::Select_Tool ( char *&  text)
private

Definition at line 628 of file excellon_read_drill_file.cpp.

References FIRST_DCODE, D_CODE::m_InUse, and TOOLS_MAX_COUNT.

629 {
630  // Select the tool from the command line Tn, with n = 1 ... TOOLS_MAX_COUNT - 1
631  // Because some drill file have an embedded TCODE definition (like T1C.008F0S0)
632  // in tool selection command, if the tool is not defined in list,
633  // and the definition is embedded, it will be entered in list
634  char * startline = text; // the tool id starts here.
635  int tool_id = TCodeNumber( text );
636 
637  // T0 is legal, but is not a selection tool. it is a special command
638  if( tool_id >= 0 )
639  {
640  int dcode_id = tool_id + FIRST_DCODE; // Remember: dcodes are >= FIRST_DCODE
641 
642  if( dcode_id > (TOOLS_MAX_COUNT - 1) )
643  dcode_id = TOOLS_MAX_COUNT - 1;
644 
645  m_Current_Tool = dcode_id;
646  D_CODE* currDcode = GetDCODEOrCreate( dcode_id, true );
647 
648  if( currDcode == NULL && tool_id > 0 ) // if the definition is embedded, enter it
649  {
650  text = startline; // text starts at the beginning of the command
651  readToolInformation( text );
652  currDcode = GetDCODE( dcode_id );
653  }
654 
655  if( currDcode )
656  currDcode->m_InUse = true;
657  }
658 
659  while( *text )
660  text++;
661 
662  return tool_id >= 0;
663 }
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE...
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
#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...
void EXCELLON_IMAGE::SelectUnits ( bool  aMetric)
private

Definition at line 747 of file excellon_read_drill_file.cpp.

References fmtIntegerInch, fmtIntegerMM, fmtMantissaInch, and fmtMantissaMM.

748 {
749  /* Coordinates are measured either in inch or metric (millimeters).
750  * Inch coordinates are in six digits (00.0000) with increments
751  * as small as 0.0001 (1/10,000).
752  * Metric coordinates can be measured in microns (thousandths of a millimeter)
753  * in one of the following three ways:
754  * Five digit 10 micron resolution (000.00)
755  * Six digit 10 micron resolution (0000.00)
756  * Six digit micron resolution (000.000)
757  *
758  * Inches: Default fmt = 2.4 for X and Y axis: 6 digits with 0.0001 resolution
759  * metric: Default fmt = 3.3 for X and Y axis: 6 digits, 1 micron resolution
760  */
761  if( aMetric )
762  {
763  m_GerbMetric = true;
764  // number of digits in mantissa
766  // number of digits (mantissa+interger)
768  }
769  else
770  {
771  m_GerbMetric = false;
774  }
775 }
static const int fmtMantissaInch
static const int fmtIntegerInch
static const int fmtMantissaMM
static const int fmtIntegerMM
void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 223 of file base_struct.h.

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

223 { Pback = aBack; }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:176
void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 240 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::SetFlags().

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

240 { SetFlags( BRIGHTENED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:264
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:133
void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 264 of file base_struct.h.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), 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(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_PART::CopySelectedItems(), LIB_EDIT_FRAME::copySelectedItems(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), SCH_EDIT_FRAME::DeleteItem(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), SCH_EDIT_FRAME::Load_Component(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), moveBitmap(), SCH_EDIT_FRAME::MoveImage(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), SCH_EDIT_FRAME::OnSelectUnit(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PrepareMoveItem(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_EDIT_FRAME::ReSizeSheet(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_SCREEN::SelectBlockItems(), 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(), LIB_EDIT_FRAME::StartMovePin(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

264 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
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 276 of file base_struct.h.

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

276 { m_forceVisible = aEnable; }
bool m_forceVisible
Set to true to override the visibility setting of the item.
Definition: base_struct.h:183
void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 239 of file base_struct.h.

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

239 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:264
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:132
void EDA_ITEM::SetList ( DHEAD aList)
inlineinherited

Definition at line 225 of file base_struct.h.

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

225 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:177
void EDA_ITEM::SetModified ( )
inherited
void EDA_ITEM::SetNext ( EDA_ITEM aNext)
inlineinherited

Definition at line 222 of file base_struct.h.

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

222 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:175
void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlineinherited

Definition at line 224 of file base_struct.h.

Referenced by MODULE::Add(), BOARD::Add(), BOARD_NETLIST_UPDATER::addNewComponent(), LIB_FIELD::Copy(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), SCH_EDIT_FRAME::CreateSheet(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), PCB_EDIT_FRAME::Exchange_Module(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), DIALOG_FOOTPRINT_FP_EDITOR::initModeditProperties(), DIALOG_FOOTPRINT_BOARD_EDITOR::InitModeditProperties(), LIB_PART::LIB_PART(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), SCH_LEGACY_PLUGIN::loadHierarchy(), LIB_EDIT_FRAME::LoadOneSymbol(), MODULE::MODULE(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnEditReference(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnEditValue(), DIALOG_LIB_EDIT_PIN::OnPaintShowPanel(), MODULE::operator=(), SCH_COMPONENT::operator=(), PCB_PARSER::parseMODULE_unchecked(), LIB_EDIT_FRAME::pasteClipboard(), PCBNEW_CONTROL::PasteItemsFromClipboard(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), FOOTPRINT_PREVIEW_PANEL::renderFootprint(), BOARD_NETLIST_UPDATER::replaceComponent(), BOARD::ReplaceNetlist(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SaveCopyOfZones(), SCH_COMPONENT::SCH_COMPONENT(), SCH_SHEET::SCH_SHEET(), SCH_SHEET_PIN::SCH_SHEET_PIN(), LIB_PART::SetFields(), SetSchItemParent(), PCB_EDIT_FRAME::StartMoveModule(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), and SwapItemData().

224 { m_Parent = aParent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:179
void EDA_ITEM::SetSelected ( )
inlineinherited

Definition at line 238 of file base_struct.h.

References SELECTED, and EDA_ITEM::SetFlags().

Referenced by LIB_EDIT_FRAME::pasteClipboard(), GERBVIEW_SELECTION_TOOL::selectVisually(), and SELECTION_TOOL::selectVisually().

238 { SetFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:116
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:264
void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited
void EDA_ITEM::SetTimeStamp ( timestamp_t  aNewTimeStamp)
inlineinherited

Definition at line 214 of file base_struct.h.

Referenced by 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(), SCH_EDIT_FRAME::CreateSheet(), Diagnose(), DuplicateItemsInList(), DuplicateStruct(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::Exchange_Module(), DIALOG_FOOTPRINT_BOARD_EDITOR::GotoModuleEditor(), 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_EDIT_FRAME::PasteListOfItems(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), BOARD::ReplaceNetlist(), SCH_SHEET::SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), and DIALOG_ERC::TestErc().

214 { m_TimeStamp = aNewTimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:180
void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 237 of file base_struct.h.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

Referenced by moveItemWithMouseCursor().

237 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:264
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:113
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 474 of file base_struct.h.

References EDA_ITEM::Matches(), EDA_ITEM::operator=(), EDA_ITEM::ViewBBox(), and EDA_ITEM::ViewGetLayers().

Referenced by PART_LIB::GetEntryTypePowerNames().

474 { return *aLeft < *aRight; }
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 298 of file gerber_file_image.cpp.

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(), scaletoIU(), wxPoint::x, and wxPoint::y.

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

299 {
300  if( GetLayerParams().m_XRepeatCount < 2 &&
301  GetLayerParams().m_YRepeatCount < 2 )
302  return; // Nothing to repeat
303 
304  // Duplicate item:
305  for( int ii = 0; ii < GetLayerParams().m_XRepeatCount; ii++ )
306  {
307  for( int jj = 0; jj < GetLayerParams().m_YRepeatCount; jj++ )
308  {
309  // the first gerber item already exists (this is the template)
310  // create duplicate only if ii or jj > 0
311  if( jj == 0 && ii == 0 )
312  continue;
313  GERBER_DRAW_ITEM* dupItem = new GERBER_DRAW_ITEM( aItem );
314  wxPoint move_vector;
315  move_vector.x = scaletoIU( ii * GetLayerParams().m_StepForRepeat.x,
316  GetLayerParams().m_StepForRepeatMetric );
317  move_vector.y = scaletoIU( jj * GetLayerParams().m_StepForRepeat.y,
318  GetLayerParams().m_StepForRepeatMetric );
319  dupItem->MoveXY( move_vector );
320  m_Drawings.Append( dupItem );
321  }
322  }
323 }
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.
int EXCELLON_IMAGE::TCodeNumber ( char *&  aText)
inlineprivate

Definition at line 139 of file excellon_image.h.

140  {
141  return DCodeNumber( aText );
142  }
int DCodeNumber(char *&Text)
Definition: rs274d.cpp:438
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 209 of file base_struct.h.

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), abortMoveBitmap(), abortMoveItem(), AbortPinMove(), MODULE::Add(), CN_CLUSTER::Add(), BOARD::Add(), CN_CONNECTIVITY_ALGO::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), SCH_SCREEN::addConnectedItemsToBlock(), POINT_EDITOR::addCorner(), POINT_EDITOR::addCornerCondition(), SCH_EDIT_FRAME::addCurrentItemToList(), AddMenusForComponent(), AddMenusForEditComponent(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::Begin_Route(), SCH_EDIT_FRAME::BeginSegment(), 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(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), SCH_NO_CONNECT::CanConnect(), SCH_JUNCTION::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(), DIALOG_EXCHANGE_FOOTPRINTS::changeSameFootprints(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_EDIT_FRAME::CheckListConnections(), CN_VISITOR::checkZoneItemConnection(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), TEXTE_PCB::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), MODULE::ClassOf(), D_PAD::ClassOf(), BOARD::ClassOf(), VIA::ClassOf(), SCH_SHEET::CleanupSheet(), Collect_TrackSegmentsToDrag(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), SCH_SHEET::ComponentCount(), GRID_HELPER::computeAnchors(), SCH_SCREEN::CountConnectedItems(), SCH_SHEET::CountSheets(), MODULE::CoverageRatio(), LIB_EDIT_FRAME::CreateGraphicItem(), 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(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), LIB_EDIT_FRAME::deleteItem(), SCH_EDIT_FRAME::DeleteItem(), DeleteNullTrackSegments(), PYTHON_ACTION_PLUGINS::deregister_action(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_ERC::DisplayERC_MarkersList(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DrawMovePin(), DrawMovingBlockOutlines(), drawPickedItems(), CN_ITEM::Dump(), BOARD::Duplicate(), MODULE::Duplicate(), PCB_EDIT_FRAME::duplicateItems(), DuplicateItemsInList(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditSymbolText(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::EraseRedundantTrack(), ExitSheet(), SCH_SCREEN::ExtractWires(), DRC::fillMarker(), 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(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), getAnchorPoint(), TRACK::GetBestInsertPoint(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_SCREEN::GetConnection(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetEndPoints(), SCH_SHEET::GetEndPoints(), GetFirstTrack(), GetFirstVia(), SCH_SCREEN::GetHierarchicalItems(), SCH_SCREENS::GetLibNicknames(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), BOARD_CONNECTED_ITEM::GetNetClass(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), SCH_SCREEN::GetPin(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), getRect(), SELECTION::GetTopLeftItem(), LIB_EDIT_FRAME::GlobalSetPins(), SELECTION_TOOL::guessSelectionCandidates(), hash_eda(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), SCH_EDIT_FRAME::ImportSheetPin(), DIALOG_LABEL_EDITOR::InitDialog(), ROUTER_TOOL::InlineDrag(), SCH_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), CN_ANCHOR::IsDangling(), SCH_TEXT::IsDanglingStateChanged(), SCH_COLLECTOR::IsNode(), TRACK::IsNull(), SCH_LINE::IsParallel(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), SCH_EDIT_FRAME::LocateAndShowItem(), SCH_EDIT_FRAME::LocateItem(), SCH_SHEET::LocatePathOfScreen(), Magnetize(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), MarkItemsInBloc(), BOARD::MarkTrace(), TRACKS_CLEANER::mergeCollinearSegmentIfPossible(), TRACKS_CLEANER::MergeCollinearTracks(), SCH_LINE::MergeOverlap(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), moveItemWithMouseCursor(), MoveMarkedItems(), MoveMarkedItemsExactly(), ROUTER_TOOL::NeighboringSegmentFilter(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), SCH_EDIT_FRAME::OnHotKey(), 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(), SCH_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftDClick(), LIB_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnMoveItem(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), LIB_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), 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(), SCH_EDIT_FRAME::OrientComponent(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::PasteItemsFromClipboard(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), LIB_EDIT_FRAME::PlacePin(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), SCH_EDIT_FRAME::PrepareMoveItem(), GAL_ARRAY_CREATOR::prePushAction(), PCB_EDIT_FRAME::PrintPage(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), RedrawWhileMovingCursor(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), BOARD::Remove(), CN_CONNECTIVITY_ALGO::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_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SCREEN::ReplaceWires(), PCB_EDIT_FRAME::Reset_All_Tracks_And_Vias_To_Netclass_Values(), PCB_BASE_FRAME::ResetTextSize(), SCH_EDIT_FRAME::ReSizeSheet(), BOARD_COMMIT::Revert(), SCH_EDIT_FRAME::RotateField(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_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(), SELECTION_TOOL::selectable(), SCH_SCREEN::SelectBlockItems(), PCB_EDIT_FRAME::SelectHighLight(), SELECTION_TOOL::selectVisually(), ITEM_PICKER::SetItem(), SetSchItemParent(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_MoveNode(), ShowClearance(), ShowNewTrackWhenMovingCursor(), SortByTimeStamp(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SCH_NO_CONNECT::SwapData(), SCH_JUNCTION::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_FIELD::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), DIMENSION::SwapData(), DRAWSEGMENT::SwapData(), TRACK::SwapData(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), VIA::SwapData(), ZONE_CONTAINER::SwapData(), MODULE::SwapData(), D_PAD::SwapData(), SwapItemData(), PCB_EDIT_FRAME::SwitchLayer(), TestDuplicateSheetNames(), TRACKS_CLEANER::testTrackEndpointDangling(), TEXTE_MODULE::TEXTE_MODULE(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), TraceSegmentPcb(), SELECTION_TOOL::unselectVisually(), SCH_SHEET_PATH::UpdateAllScreenReferences(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), POINT_EDITOR::updateItem(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), EDA_ITEM::Visit(), SCH_SHEET::Visit(), and SCH_COMPONENT::Visit().

210  {
211  return m_StructType;
212  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:171
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, 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 266 of file base_struct.cpp.

References EDA_ITEM::GetBoundingBox().

Referenced by EDA_ITEM::Sort(), BRIGHT_BOX::ViewBBox(), DIMENSION::ViewBBox(), DRAWSEGMENT::ViewBBox(), BRIGHT_BOX::ViewDraw(), and COMMON_TOOLS::ZoomFitScreen().

267 {
268  // Basic fallback
269  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
270  VECTOR2I( GetBoundingBox().GetSize() ) );
271 }
virtual const EDA_RECT GetBoundingBox() const
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
BOX2< VECTOR2I > BOX2I
Definition: box2.h:468
VECTOR2< int > VECTOR2I
Definition: vector2d.h:589
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::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.

References KIGFX::VIEW_ITEM::ViewGetLayers().

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

117  {}
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, EDIT_POINTS, VIA, BOARD_ITEM, GERBER_DRAW_ITEM, TRACK, TEXTE_MODULE, ZONE_CONTAINER, MARKER_PCB, KIGFX::WORKSHEET_VIEWITEM, ROUTER_PREVIEW_ITEM, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, BRIGHT_BOX, KIGFX::RATSNEST_VIEWITEM, and KIGFX::PREVIEW::RULER_ITEM.

Definition at line 274 of file base_struct.cpp.

Referenced by EDA_ITEM::Sort().

275 {
276  // Basic fallback
277  aCount = 1;
278  aLayers[0] = 0;
279 }
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.

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

141  {
142  // By default always show the item
143  return 0;
144  }
SEARCH_RESULT GERBER_FILE_IMAGE::Visit ( INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
overridevirtualinherited

>

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

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

Reimplemented from EDA_ITEM.

Definition at line 390 of file gerber_file_image.cpp.

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

391 {
392  KICAD_T stype;
394  const KICAD_T* p = scanTypes;
395  bool done = false;
396 
397 #if 0 && defined(DEBUG)
398  std::cout << GetClass().mb_str() << ' ';
399 #endif
400 
401  while( !done )
402  {
403  stype = *p;
404 
405  switch( stype )
406  {
407  case GERBER_IMAGE_T:
408  case GERBER_IMAGE_LIST_T:
409  ++p;
410  break;
411 
412  case GERBER_DRAW_ITEM_T:
413  result = IterateForward( &m_Drawings[0], inspector, testData, p );
414  ++p;
415  break;
416 
417  default: // catch EOT or ANY OTHER type here and return.
418  done = true;
419  break;
420  }
421 
422  if( result == SEARCH_QUIT )
423  break;
424  }
425 
426  return result;
427 }
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:64

Member Data Documentation

bool GERBER_FILE_IMAGE::m_360Arc_enbl
inherited
wxString GERBER_FILE_IMAGE::m_AperFunction
inherited
APERTURE_MACRO_SET GERBER_FILE_IMAGE::m_aperture_macros
inherited

a collection of APERTURE_MACROS, sorted by name

Definition at line 158 of file gerber_file_image.h.

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

int GERBER_FILE_IMAGE::m_CommandState
inherited
std::map<wxString, int> GERBER_FILE_IMAGE::m_ComponentsList
inherited
FILE* GERBER_FILE_IMAGE::m_Current_File
inherited
int GERBER_FILE_IMAGE::m_Current_Tool
inherited
wxPoint GERBER_FILE_IMAGE::m_CurrentPos
inherited
STATUS_FLAGS EDA_ITEM::m_Flags
protectedinherited

Flag bits for editing and other uses.

Definition at line 186 of file base_struct.h.

Referenced by LIB_CIRCLE::BeginEdit(), LIB_RECTANGLE::BeginEdit(), LIB_POLYLINE::BeginEdit(), LIB_TEXT::BeginEdit(), LIB_ARC::BeginEdit(), LIB_FIELD::BeginEdit(), LIB_CIRCLE::calcEdit(), LIB_POLYLINE::calcEdit(), LIB_RECTANGLE::calcEdit(), LIB_TEXT::calcEdit(), LIB_ARC::calcEdit(), LIB_FIELD::calcEdit(), LIB_TEXT::Clone(), LIB_CIRCLE::ContinueEdit(), LIB_RECTANGLE::ContinueEdit(), LIB_POLYLINE::ContinueEdit(), LIB_TEXT::ContinueEdit(), LIB_ARC::ContinueEdit(), LIB_FIELD::ContinueEdit(), SCH_LINE::Draw(), TRACK::Draw(), DRAWSEGMENT::Draw(), MODULE::Draw(), SEGZONE::Draw(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_ARC::drawGraphic(), DRAWSEGMENT::DRAWSEGMENT(), LIB_CIRCLE::EndEdit(), LIB_RECTANGLE::EndEdit(), LIB_POLYLINE::EndEdit(), LIB_TEXT::EndEdit(), LIB_ARC::EndEdit(), LIB_ITEM::EndEdit(), LIB_FIELD::EndEdit(), EDA_ITEM::GetFlags(), TRACK::GetMsgPanelInfoBase_Common(), SCH_JUNCTION::HitTest(), SCH_LINE::HitTest(), GERBER_DRAW_ITEM::HitTest(), SCH_COMPONENT::HitTest(), LIB_ITEM::InEditMode(), EDA_ITEM::initVars(), SCH_ITEM::IsConnected(), SCH_LINE::Move(), EDA_ITEM::operator=(), SCH_COMPONENT::SCH_COMPONENT(), LIB_PIN::SetConversion(), LIB_PIN::SetLength(), LIB_PIN::SetName(), LIB_PIN::SetNameTextSize(), LIB_PIN::SetNumberTextSize(), LIB_PIN::SetOrientation(), LIB_PIN::SetPartNumber(), LIB_PIN::SetPinPosition(), LIB_PIN::SetShape(), LIB_PIN::SetType(), and LIB_PIN::SetVisible().

bool EDA_ITEM::m_forceVisible
protectedinherited

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

Definition at line 183 of file base_struct.h.

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

bool EXCELLON_IMAGE::m_format_known
private

Definition at line 99 of file excellon_image.h.

bool GERBER_FILE_IMAGE::m_Has_DCode
inherited
bool GERBER_FILE_IMAGE::m_ImageJustifyXCenter
inherited
bool GERBER_FILE_IMAGE::m_ImageJustifyYCenter
inherited
bool GERBER_FILE_IMAGE::m_InUse
inherited
bool GERBER_FILE_IMAGE::m_IsVisible
inherited
bool GERBER_FILE_IMAGE::m_IsX2_file
inherited
int GERBER_FILE_IMAGE::m_Last_Pen_Command
inherited
DHEAD* EDA_ITEM::m_List
protectedinherited

which DLIST I am on.

Definition at line 177 of file base_struct.h.

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

double GERBER_FILE_IMAGE::m_LocalRotation
inherited
wxString GERBER_FILE_IMAGE::m_MD5_value
inherited
bool GERBER_FILE_IMAGE::m_MirrorA
inherited
bool GERBER_FILE_IMAGE::m_MirrorB
inherited
std::map<wxString, int> GERBER_FILE_IMAGE::m_NetnamesList
inherited
wxString GERBER_FILE_IMAGE::m_PartString
inherited
bool GERBER_FILE_IMAGE::m_PolygonFillMode
inherited
int GERBER_FILE_IMAGE::m_PolygonFillModeState
inherited
COLOR4D GERBER_FILE_IMAGE::m_PositiveDrawColor
inherited

Definition at line 112 of file gerber_file_image.h.

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

wxPoint GERBER_FILE_IMAGE::m_PreviousPos
inherited
wxRealPoint GERBER_FILE_IMAGE::m_Scale
inherited
bool EXCELLON_IMAGE::m_SlotOn
private

Definition at line 98 of file excellon_image.h.

excellon_state EXCELLON_IMAGE::m_State
private

Definition at line 97 of file excellon_image.h.

bool GERBER_FILE_IMAGE::m_SwapAxis
inherited
EDA_ITEM* EDA_ITEM::Pback
protectedinherited

previous in linked list

Definition at line 176 of file base_struct.h.

Referenced by SCH_LINE::Back(), TRACK::Back(), BOARD_ITEM::Back(), EDA_ITEM::Back(), EDA_ITEM::initVars(), and TRACK::SetBack().


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