KiCad PCB EDA Suite
GERBER_FILE_IMAGE Class Reference

Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters (TODO: move them in GERBER_LAYER class. More...

#include <gerber_file_image.h>

Inheritance diagram for GERBER_FILE_IMAGE:
EDA_ITEM KIGFX::VIEW_ITEM EXCELLON_IMAGE

Public Member Functions

 GERBER_FILE_IMAGE (int layer)
 
virtual ~GERBER_FILE_IMAGE ()
 
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 ()
 
virtual void ResetDefaultValues ()
 
COLOR4D GetPositiveDrawColor () const
 
GERBER_DRAW_ITEMGetItemsList ()
 Function GetItemsList. More...
 
GERBER_LAYERGetLayerParams ()
 Function GetLayerParams. More...
 
bool HasNegativeItems ()
 Function HasNegativeItems. More...
 
void ClearMessageList ()
 Function ClearMessageList Clear the message list Call it before reading a Gerber file. More...
 
void AddMessageToList (const wxString &aMessage)
 Function AddMessageToList Add a message to the message list. More...
 
void InitToolTable ()
 Function InitToolTable. More...
 
wxPoint ReadXYCoord (char *&aText, bool aExcellonMode=false)
 Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm) More...
 
wxPoint ReadIJCoord (char *&Text)
 Returns the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) These coordinates are relative, so if coordinate is absent, it's value defaults to 0. More...
 
int GCodeNumber (char *&Text)
 
int DCodeNumber (char *&Text)
 
D_CODEGetDCODEOrCreate (int aDCODE, bool aCreateIfNoExist=true)
 Function GetDCODEOrCreate returns a pointer to the D_CODE within this GERBER for the given aDCODE. More...
 
D_CODEGetDCODE (int aDCODE) const
 Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE. More...
 
APERTURE_MACROFindApertureMacro (const APERTURE_MACRO &aLookup)
 Function FindApertureMacro looks up a previously read in aperture macro. More...
 
void StepAndRepeatItem (const GERBER_DRAW_ITEM &aItem)
 Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called when reading a gerber file and after creating a new gerber item that must be repeated (i.e when m_XRepeatCount or m_YRepeatCount are > 1) More...
 
void DisplayImageInfo (GERBVIEW_FRAME *aMainFrame)
 Function DisplayImageInfo has knowledge about the frame and how and where to put status information about this object into the frame's message panel. More...
 
void RemoveAttribute (X2_ATTRIBUTE &aAttribute)
 Function RemoveAttribute. More...
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
 > More...
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
EDA_ITEMNext () const
 
EDA_ITEMBack () const
 
EDA_ITEMGetParent () const
 
DHEADGetList () const
 
void SetNext (EDA_ITEM *aNext)
 
void SetBack (EDA_ITEM *aBack)
 
void SetParent (EDA_ITEM *aParent)
 
void SetList (DHEAD *aList)
 
bool IsNew () const
 
bool IsModified () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool IsType (const KICAD_T aScanTypes[])
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
virtual void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList)
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
virtual bool HitTest (const wxPoint &aPosition) 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 (EDA_UNITS_T aUnits) const
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
virtual BITMAP_DEF GetMenuImage () const
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
virtual unsigned int ViewGetLOD (int aLayer, VIEW *aView) const
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 

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
 
int m_ArcRadius
 
LAST_EXTRA_ARC_DATA_TYPE m_LastArcDataType
 
FILE * m_Current_File
 
int m_Selected_Tool
 
bool m_Has_DCode
 
bool m_360Arc_enbl
 
bool m_PolygonFillMode
 
int m_PolygonFillModeState
 
APERTURE_MACRO_SET m_aperture_macros
 a collection of APERTURE_MACROS, sorted by name More...
 
GBR_NETLIST_METADATA m_NetAttributeDict
 
wxString m_AperFunction
 
std::map< wxString, int > m_ComponentsList
 
std::map< wxString, int > m_NetnamesList
 

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

char * GetNextLine (char *aBuff, unsigned int aBuffSize, char *aText, FILE *aFile)
 test for an end of line if a end of line is found: read a new line More...
 
bool GetEndOfBlock (char *aBuff, unsigned int aBuffSize, char *&aText, FILE *aGerberFile)
 
bool ReadRS274XCommand (char *aBuff, unsigned int aBuffSize, char *&aText)
 reads a single RS274X command terminated with a % More...
 
bool ExecuteRS274XCommand (int aCommand, char *aBuff, unsigned int aBuffSize, char *&aText)
 executes a RS274X command More...
 
int ReadXCommandID (char *&text)
 reads two bytes of data and assembles them into an int with the first byte in the sequence put into the most significant part of a 16 bit value to build a RS274X command identifier. More...
 
bool ReadApertureMacro (char *aBuff, unsigned int aBuffSize, char *&text, FILE *gerber_file)
 reads in an aperture macro and saves it in m_aperture_macros. More...
 
bool Execute_G_Command (char *&text, int G_command)
 
bool Execute_DCODE_Command (char *&text, int D_command)
 

Private Attributes

D_CODEm_Aperture_List [TOOLS_MAX_COUNT]
 Dcode (Aperture) List for this layer (max 999) More...
 
bool m_Exposure
 whether an aperture macro tool is flashed on or off More...
 
GERBER_LAYER m_GBRLayerParams
 
wxArrayString m_messagesList
 
int m_hasNegativeItems
 

Detailed Description

Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters (TODO: move them in GERBER_LAYER class.

Definition at line 107 of file gerber_file_image.h.

Constructor & Destructor Documentation

GERBER_FILE_IMAGE::GERBER_FILE_IMAGE ( int  layer)

Definition at line 92 of file gerber_file_image.cpp.

References DIM, m_Aperture_List, m_FileFunction, m_GraphicLayer, m_IsVisible, m_PositiveDrawColor, m_Selected_Tool, ResetDefaultValues(), and WHITE.

92  :
94 {
95  m_GraphicLayer = aLayer; // Graphic layer Number
96  m_IsVisible = true; // must be drawn
97  m_PositiveDrawColor = WHITE; // The color used to draw positive items for this image
98 
99  m_Selected_Tool = 0;
100  m_FileFunction = NULL; // file function parameters
101 
103 
104  for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
105  m_Aperture_List[ii] = 0;
106 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
X2_ATTRIBUTE_FILEFUNCTION * m_FileFunction
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
Definition: base_struct.cpp:64
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
Definition: colors.h:49
virtual void ResetDefaultValues()
GERBER_FILE_IMAGE::~GERBER_FILE_IMAGE ( )
virtual

Definition at line 109 of file gerber_file_image.cpp.

References DHEAD::DeleteAll(), DIM, m_Aperture_List, m_Drawings, and m_FileFunction.

110 {
112 
113  for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
114  {
115  delete m_Aperture_List[ii];
116  }
117 
118  delete m_FileFunction;
119 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
X2_ATTRIBUTE_FILEFUNCTION * m_FileFunction
void DeleteAll()
Function DeleteAll deletes all items on the list and leaves the list empty.
Definition: dlist.cpp:44
D_CODE * m_Aperture_List[TOOLS_MAX_COUNT]
Dcode (Aperture) List for this layer (max 999)
DLIST< GERBER_DRAW_ITEM > m_Drawings

Member Function Documentation

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

Function AddMessageToList Add a message to the message list.

Definition at line 308 of file gerber_file_image.h.

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

309  {
310  m_messagesList.Add( aMessage );
311  }
wxArrayString m_messagesList
EDA_ITEM* EDA_ITEM::Back ( ) const
inlineinherited

Definition at line 210 of file base_struct.h.

References EDA_ITEM::Pback.

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

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

Definition at line 236 of file base_struct.h.

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

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

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

Definition at line 257 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(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToScreen(), 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(), LIB_EDIT_FRAME::BlockCopySelectedItems(), 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(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), 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::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(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), MarkItemsInBloc(), MirrorX(), MirrorY(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnOrient(), LIB_EDIT_FRAME::OnRotate(), 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(), 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(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

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

Definition at line 235 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

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

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

Definition at line 299 of file gerber_file_image.h.

300  {
301  m_messagesList.Clear();
302  }
wxArrayString m_messagesList
void EDA_ITEM::ClearSelected ( )
inlineinherited

Definition at line 234 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and SELECTED.

Referenced by POINT_EDITOR::addCorner(), EDIT_TOOL::Duplicate(), GAL_ARRAY_CREATOR::prePushAction(), SELECTION_TOOL::unhighlight(), and GERBVIEW_SELECTION_TOOL::unselectVisually().

234 { ClearFlags( SELECTED ); }
#define SELECTED
Definition: base_struct.h:121
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:257
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, ZONE_CONTAINER, MODULE, SCH_SHEET, LIB_PIN, VIA, SEGZONE, SCH_HIERLABEL, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, SCH_LABEL, DIMENSION, LIB_FIELD, TEXTE_MODULE, SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, SCH_LINE, SCH_BUS_BUS_ENTRY, SCH_BITMAP, LIB_ARC, SCH_BUS_WIRE_ENTRY, LIB_TEXT, EDGE_MODULE, TEXTE_PCB, LIB_POLYLINE, SCH_NO_CONNECT, LIB_RECTANGLE, SCH_JUNCTION, SCH_MARKER, LIB_BEZIER, PCB_TARGET, LIB_CIRCLE, and KIGFX::ORIGIN_VIEWITEM.

Definition at line 123 of file base_struct.cpp.

References EDA_ITEM::GetClass().

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

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

Definition at line 438 of file rs274d.cpp.

References IsNumber.

Referenced by 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)

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 338 of file gerber_file_image.cpp.

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

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

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

Definition at line 594 of file rs274d.cpp.

References AddMessageToList(), DLIST< T >::Append(), SHAPE_POLY_SET::Append(), APT_CIRCLE, fillArcGBRITEM(), fillArcPOLY(), fillFlashedGBRITEM(), fillLineGBRITEM(), FIRST_DCODE, GBR_POLYGON, GERB_INTERPOL_ARC_NEG, GERB_INTERPOL_ARC_POS, GERB_INTERPOL_LINEAR_001X, GERB_INTERPOL_LINEAR_01X, GERB_INTERPOL_LINEAR_10X, GERB_INTERPOL_LINEAR_1X, GetDCODE(), GetItemsList(), DLIST< T >::GetLast(), GetLayerParams(), m_360Arc_enbl, m_Current_Tool, m_CurrentPos, m_Drawings, GERBER_DRAW_ITEM::m_End, m_Exposure, GERBER_DRAW_ITEM::m_Flashed, m_IJPos, D_CODE::m_InUse, m_Iterpolation, m_Last_Pen_Command, D_CODE::m_Num_Dcode, GERBER_DRAW_ITEM::m_Polygon, m_PolygonFillMode, m_PolygonFillModeState, m_PreviousPos, GERBER_DRAW_ITEM::m_Shape, D_CODE::m_Shape, D_CODE::m_Size, GERBER_DRAW_ITEM::m_Start, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), StepAndRepeatItem(), TOOLS_MAX_COUNT, and SHAPE_POLY_SET::Vertex().

595 {
596  wxSize size( 15, 15 );
597 
598  APERTURE_T aperture = APT_CIRCLE;
599  GERBER_DRAW_ITEM* gbritem;
600 
601  int dcode = 0;
602  D_CODE* tool = NULL;
603  wxString msg;
604 
605  if( D_commande >= FIRST_DCODE ) // This is a "Set tool" command
606  {
607  if( D_commande > (TOOLS_MAX_COUNT - 1) )
608  D_commande = TOOLS_MAX_COUNT - 1;
609 
610  // remember which tool is selected, nothing is done with it in this
611  // call
612  m_Current_Tool = D_commande;
613 
614  D_CODE* pt_Dcode = GetDCODE( D_commande );
615  if( pt_Dcode )
616  pt_Dcode->m_InUse = true;
617 
618  return true;
619  }
620  else // D_commande = 0..9: this is a pen command (usually D1, D2 or D3)
621  {
622  m_Last_Pen_Command = D_commande;
623  }
624 
625  if( m_PolygonFillMode ) // Enter a polygon description:
626  {
627  switch( D_commande )
628  {
629  case 1: // code D01 Draw line, exposure ON
630  if( !m_Exposure ) // Start a new polygon outline:
631  {
632  m_Exposure = true;
633  gbritem = new GERBER_DRAW_ITEM( this );
634  m_Drawings.Append( gbritem );
635  gbritem->m_Shape = GBR_POLYGON;
636  gbritem->m_Flashed = false;
637  }
638 
639  switch( m_Iterpolation )
640  {
643  gbritem = m_Drawings.GetLast();
644 
645  fillArcPOLY( gbritem, m_PreviousPos,
647  ( m_Iterpolation == GERB_INTERPOL_ARC_NEG ) ? false : true,
648  m_360Arc_enbl, GetLayerParams().m_LayerNegative );
649  break;
650 
651  default:
652  gbritem = m_Drawings.GetLast();
653 
654  gbritem->m_Start = m_PreviousPos; // m_Start is used as temporary storage
655  if( gbritem->m_Polygon.OutlineCount() == 0 )
656  {
657  gbritem->m_Polygon.NewOutline();
658  gbritem->m_Polygon.Append( VECTOR2I( gbritem->m_Start ) );
659  }
660 
661  gbritem->m_End = m_CurrentPos; // m_End is used as temporary storage
662  gbritem->m_Polygon.Append( VECTOR2I( gbritem->m_End ) );
663  break;
664  }
665 
668  break;
669 
670  case 2: // code D2: exposure OFF (i.e. "move to")
671  if( m_Exposure && GetItemsList() ) // End of polygon
672  {
673  gbritem = m_Drawings.GetLast();
674  gbritem->m_Polygon.Append( gbritem->m_Polygon.Vertex( 0 ) );
675  StepAndRepeatItem( *gbritem );
676  }
677  m_Exposure = false;
680  break;
681 
682  default:
683  return false;
684  }
685  }
686  else
687  {
688  switch( D_commande )
689  {
690  case 1: // code D01 Draw line, exposure ON
691  m_Exposure = true;
692 
693  tool = GetDCODE( m_Current_Tool );
694  if( tool )
695  {
696  size = tool->m_Size;
697  dcode = tool->m_Num_Dcode;
698  aperture = tool->m_Shape;
699  }
700 
701  switch( m_Iterpolation )
702  {
704  gbritem = new GERBER_DRAW_ITEM( this );
705  m_Drawings.Append( gbritem );
706 
707  fillLineGBRITEM( gbritem, dcode, m_PreviousPos,
708  m_CurrentPos, size, GetLayerParams().m_LayerNegative );
709  StepAndRepeatItem( *gbritem );
710  break;
711 
715  wxBell();
716  break;
717 
720  gbritem = new GERBER_DRAW_ITEM( this );
721  m_Drawings.Append( gbritem );
722 
723  fillArcGBRITEM( gbritem, dcode, m_PreviousPos,
724  m_CurrentPos, m_IJPos, size,
726  false : true, m_360Arc_enbl, GetLayerParams().m_LayerNegative );
727  StepAndRepeatItem( *gbritem );
728  break;
729 
730  default:
731  msg.Printf( wxT( "RS274D: DCODE Command: interpol error (type %X)" ),
732  m_Iterpolation );
733  AddMessageToList( msg );
734  break;
735  }
736 
738  break;
739 
740  case 2: // code D2: exposure OFF (i.e. "move to")
741  m_Exposure = false;
743  break;
744 
745  case 3: // code D3: flash aperture
746  tool = GetDCODE( m_Current_Tool );
747  if( tool )
748  {
749  size = tool->m_Size;
750  dcode = tool->m_Num_Dcode;
751  aperture = tool->m_Shape;
752  }
753 
754  gbritem = new GERBER_DRAW_ITEM( this );
755  m_Drawings.Append( gbritem );
756  fillFlashedGBRITEM( gbritem, aperture, dcode, m_CurrentPos,
757  size, GetLayerParams().m_LayerNegative );
758  StepAndRepeatItem( *gbritem );
760  break;
761 
762  default:
763  return false;
764  }
765  }
766 
767  return true;
768 }
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...
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
static void fillArcPOLY(GERBER_DRAW_ITEM *aGbrItem, const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &rel_center, bool aClockwise, bool aMultiquadrant, bool aLayerNegative)
Function fillArcPOLY creates an arc G code when found in poly outlines.
Definition: rs274d.cpp:338
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
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
int OutlineCount() const
Returns the number of outlines in the set
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
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
SHAPE_POLY_SET m_Polygon
VECTOR2I & Vertex(int aIndex, int aOutline, int aHole)
Returns the index-th vertex in a given hole outline within a given outline
T * GetLast() const
Function GetLast returns the last T* in the list without removing it, or NULL if the list is empty...
Definition: dlist.h:170
#define FIRST_DCODE
Definition: dcode.h:71
APERTURE_T
Enum APERTURE_T is the set of all gerber aperture types allowed, according to page 16 of http://gerbv...
Definition: dcode.h:50
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
int NewOutline()
Creates a new empty polygon in the set and returns its index
void fillArcGBRITEM(GERBER_DRAW_ITEM *aGbrItem, int Dcode_index, const wxPoint &aStart, const wxPoint &aEnd, const wxPoint &aRelCenter, wxSize aPenSize, bool aClockwise, bool aMultiquadrant, bool aLayerNegative)
Function fillArcGBRITEM initializes a given GBRITEM so that it can draw an arc G code.
Definition: rs274d.cpp:211
bool m_Exposure
whether an aperture macro tool is flashed on or off
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
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
DLIST< GERBER_DRAW_ITEM > m_Drawings
GERBER_DRAW_ITEM * GetItemsList()
Function GetItemsList.
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
void StepAndRepeatItem(const GERBER_DRAW_ITEM &aItem)
Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called wh...
GERBER_LAYER & GetLayerParams()
Function GetLayerParams.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline) ...
bool GERBER_FILE_IMAGE::Execute_G_Command ( char *&  text,
int  G_command 
)
private

Definition at line 458 of file rs274d.cpp.

References AddMessageToList(), SHAPE_POLY_SET::Append(), DCodeNumber(), ExecuteRS274XCommand(), FIRST_DCODE, GC_CIRCLE_NEG_INTERPOL, GC_CIRCLE_POS_INTERPOL, GC_COMMENT, GC_LINEAR_INTERPOL_0P01X, GC_LINEAR_INTERPOL_0P1X, GC_LINEAR_INTERPOL_10X, GC_LINEAR_INTERPOL_1X, GC_MOVE, GC_PHOTO_MODE, GC_SELECT_TOOL, GC_SPECIFY_ABSOLUES_COORD, GC_SPECIFY_INCHES, GC_SPECIFY_MILLIMETERS, GC_SPECIFY_RELATIVEES_COORD, GC_TURN_OFF_360_INTERPOL, GC_TURN_OFF_POLY_FILL, GC_TURN_ON_360_INTERPOL, GC_TURN_ON_POLY_FILL, GERB_INTERPOL_ARC_NEG, GERB_INTERPOL_ARC_POS, GERB_INTERPOL_LINEAR_001X, GERB_INTERPOL_LINEAR_01X, GERB_INTERPOL_LINEAR_10X, GERB_INTERPOL_LINEAR_1X, GetDCODE(), GetItemsList(), DLIST< T >::GetLast(), m_360Arc_enbl, m_Current_Tool, m_Drawings, m_Exposure, m_GerbMetric, D_CODE::m_InUse, m_Iterpolation, GERBER_DRAW_ITEM::m_Polygon, m_PolygonFillMode, m_PolygonFillModeState, m_Relative, ReadXCommandID(), StepAndRepeatItem(), TOOLS_MAX_COUNT, and SHAPE_POLY_SET::Vertex().

459 {
460 // D( printf( "%22s: G_CODE<%d>\n", __func__, G_command ); )
461 
462  switch( G_command )
463  {
464  case GC_PHOTO_MODE: // can starts a D03 flash command: redundant, can
465  // be safely ignored
466  break;
467 
470  break;
471 
474  break;
475 
478  break;
479 
480  case GC_COMMENT:
481  // Skip comment, but only if the line does not start by "G04 #@! "
482  // which is a metadata, i.e. a X2 command inside the comment.
483  // this comment is called a "structured comment"
484  if( strncmp( text, " #@! ", 5 ) == 0 )
485  {
486  text += 5;
487  // The string starting at text is the same as the X2 attribute,
488  // but a X2 attribute ends by '%'. So we build the X2 attribute string
489  std::string x2buf;
490 
491  while( *text && (*text != '*') )
492  {
493  x2buf += *text;
494  text++;
495  }
496  // add the end of X2 attribute string
497  x2buf += "*%";
498  x2buf += '\0';
499 
500  char* cptr = (char*)x2buf.data();
501  int code_command = ReadXCommandID( cptr );
502  ExecuteRS274XCommand( code_command, NULL, 0, cptr );
503  }
504 
505  while( *text && (*text != '*') )
506  text++;
507  break;
508 
511  break;
512 
515  break;
516 
519  break;
520 
521  case GC_SELECT_TOOL:
522  {
523  int D_commande = DCodeNumber( text );
524  if( D_commande < FIRST_DCODE )
525  return false;
526  if( D_commande > (TOOLS_MAX_COUNT - 1) )
527  D_commande = TOOLS_MAX_COUNT - 1;
528  m_Current_Tool = D_commande;
529  D_CODE* pt_Dcode = GetDCODE( D_commande );
530  if( pt_Dcode )
531  pt_Dcode->m_InUse = true;
532  break;
533  }
534 
535  case GC_SPECIFY_INCHES:
536  m_GerbMetric = false; // false = Inches, true = metric
537  break;
538 
540  m_GerbMetric = true; // false = Inches, true = metric
541  break;
542 
543  case GC_TURN_OFF_360_INTERPOL: // disable Multi cadran arc and Arc interpol
544  m_360Arc_enbl = false;
545  m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // not sure it should be done
546  break;
547 
549  m_360Arc_enbl = true;
550  break;
551 
553  m_Relative = false; // false = absolute Coord, true = relative
554  // Coord
555  break;
556 
558  m_Relative = true; // false = absolute Coord, true = relative
559  // Coord
560  break;
561 
563  m_PolygonFillMode = true;
564  m_Exposure = false;
565  break;
566 
568  if( m_Exposure && GetItemsList() ) // End of polygon
569  {
570  GERBER_DRAW_ITEM * gbritem = m_Drawings.GetLast();
571  gbritem->m_Polygon.Append( gbritem->m_Polygon.Vertex( 0 ) );
572  StepAndRepeatItem( *gbritem );
573  }
574  m_Exposure = false;
575  m_PolygonFillMode = false;
577  break;
578 
579  case GC_MOVE: // Non existent
580  default:
581  {
582  wxString msg;
583  msg.Printf( wxT( "G%0.2d command not handled" ), G_command );
584  AddMessageToList( msg );
585  return false;
586  }
587  }
588 
589 
590  return true;
591 }
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...
bool m_InUse
false if the aperure (previously defined) is not used to draw something
Definition: dcode.h:102
SHAPE_POLY_SET m_Polygon
int ReadXCommandID(char *&text)
reads two bytes of data and assembles them into an int with the first byte in the sequence put into t...
Definition: rs274x.cpp:114
VECTOR2I & Vertex(int aIndex, int aOutline, int aHole)
Returns the index-th vertex in a given hole outline within a given outline
bool ExecuteRS274XCommand(int aCommand, char *aBuff, unsigned int aBuffSize, char *&aText)
executes a RS274X command
Definition: rs274x.cpp:239
T * GetLast() const
Function GetLast returns the last T* in the list without removing it, or NULL if the list is empty...
Definition: dlist.h:170
#define FIRST_DCODE
Definition: dcode.h:71
int DCodeNumber(char *&Text)
Definition: rs274d.cpp:438
bool m_Exposure
whether an aperture macro tool is flashed on or off
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
DLIST< GERBER_DRAW_ITEM > m_Drawings
GERBER_DRAW_ITEM * GetItemsList()
Function GetItemsList.
#define TOOLS_MAX_COUNT
Definition: dcode.h:73
void StepAndRepeatItem(const GERBER_DRAW_ITEM &aItem)
Function StepAndRepeatItem Gerber format has a command Step an Repeat This function must be called wh...
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline) ...
bool GERBER_FILE_IMAGE::ExecuteRS274XCommand ( int  aCommand,
char *  aBuff,
unsigned int  aBuffSize,
char *&  aText 
)
private

executes a RS274X command

Definition at line 239 of file rs274x.cpp.

References AddMessageToList(), AP_DEFINITION, AP_MACRO, APERTURE_ATTRIBUTE, D_CODE::AppendParam(), APT_CIRCLE, APT_DEF_RECT_HOLE, APT_DEF_ROUND_HOLE, APT_MACRO, APT_OVAL, APT_POLYGON, APT_RECT, AXIS_SELECT, dummy(), FILE_ATTRIBUTE, FindApertureMacro(), FORMAT_STATEMENT, fromGerberString(), GBR_NETLIST_METADATA::GBR_NETINFO_CMP, GBR_NETLIST_METADATA::GBR_NETINFO_NET, GBR_NETLIST_METADATA::GBR_NETINFO_PAD, GERB_INTERPOL_LINEAR_1X, X2_ATTRIBUTE::GetAttribute(), GetDCODEOrCreate(), GetEndOfBlock(), GetLayerParams(), X2_ATTRIBUTE::GetPrm(), X2_ATTRIBUTE::GetPrmCount(), IMAGE_JUSTIFY, IMAGE_NAME, IMAGE_OFFSET, IMAGE_POLARITY, IMAGE_ROTATION, INCH, X2_ATTRIBUTE::IsFileFunction(), X2_ATTRIBUTE::IsFileMD5(), X2_ATTRIBUTE::IsFilePart(), IU_PER_MILS, KiROUND(), KNOCKOUT, LOAD_NAME, LOAD_POLARITY, D_CODE::m_AperFunction, m_AperFunction, GBR_NETLIST_METADATA::m_Cmpref, m_Current_File, D_CODE::m_Defined, D_CODE::m_Drill, D_CODE::m_DrillShape, D_CODE::m_EdgesCount, m_FileFunction, m_FileName, m_FmtLen, m_FmtScale, m_GerbMetric, m_Has_DCode, m_ImageJustifyOffset, m_ImageJustifyXCenter, m_ImageJustifyYCenter, m_ImageName, m_ImageNegative, m_ImageOffset, m_ImageRotation, m_IsX2_file, m_Iterpolation, GERBER_LAYER::m_LayerNegative, m_LineNum, m_LocalRotation, m_MD5_value, m_MirrorA, m_MirrorB, GBR_NETLIST_METADATA::m_NetAttribType, m_NetAttributeDict, GBR_NETLIST_METADATA::m_Netname, m_NoTrailingZeros, m_Offset, GBR_NETLIST_METADATA::m_Padname, m_PartString, m_Relative, D_CODE::m_Rotation, m_Scale, D_CODE::m_Shape, D_CODE::m_Size, GERBER_LAYER::m_StepForRepeat, GERBER_LAYER::m_StepForRepeatMetric, m_SwapAxis, GERBER_LAYER::m_XRepeatCount, GERBER_LAYER::m_YRepeatCount, MILLIMETER, MIRROR_IMAGE, MODE_OF_UNITS, APERTURE_MACRO::name, NET_ATTRIBUTE, OFFSET, X2_ATTRIBUTE::ParseAttribCmd(), ReadApertureMacro(), ReadDouble(), ReadInt(), ReadXCommandID(), REMOVE_APERTURE_ATTRIBUTE, RemoveAttribute(), ROTATE, SCALE_FACTOR, D_CODE::SetMacro(), STEP_AND_REPEAT, TO_UTF8, wxPoint::x, and wxPoint::y.

Referenced by Execute_G_Command(), and ReadRS274XCommand().

241 {
242  int code;
243  int seq_len; // not used, just provided
244  int seq_char;
245  bool ok = true;
246  wxString msg;
247  double fcoord;
248  bool x_fmt_known = false;
249  bool y_fmt_known = false;
250 
251  // conv_scale = scaling factor from inch to Internal Unit
252  double conv_scale = IU_PER_MILS * 1000;
253 
254  if( m_GerbMetric )
255  conv_scale /= 25.4;
256 
257  switch( aCommand )
258  {
259  case FORMAT_STATEMENT:
260  seq_len = 2;
261 
262  while( *aText != '*' )
263  {
264  switch( *aText )
265  {
266  case ' ':
267  aText++;
268  break;
269 
270  case 'D': // Non-standard option for all zeros (leading + tailing)
271  msg.Printf( _( "RS274X: Invalid GERBER format command '%c' at line %d: \"%s\"" ),
272  'D', m_LineNum, aBuff );
273  AddMessageToList( msg );
274  msg.Printf( _("GERBER file \"%s\" may not display as intended." ),
275  m_FileName.ToAscii() );
276  AddMessageToList( msg );
277  // Fallthrough
278 
279  case 'L': // No Leading 0
280  m_NoTrailingZeros = false;
281  aText++;
282  break;
283 
284  case 'T': // No trailing 0
285  m_NoTrailingZeros = true;
286  aText++;
287  break;
288 
289  case 'A': // Absolute coord
290  m_Relative = false;
291  aText++;
292  break;
293 
294  case 'I': // Relative coord
295  m_Relative = true;
296  aText++;
297  break;
298 
299  case 'G':
300  case 'N': // Sequence code (followed by one digit: the sequence len)
301  // (sometimes found before the X,Y sequence)
302  // Obscure option
303  aText++;
304  seq_char = *aText++;
305  if( (seq_char >= '0') && (seq_char <= '9') )
306  seq_len = seq_char - '0';
307  break;
308 
309  case 'M': // Sequence code (followed by one digit: the sequence len)
310  // (sometimes found after the X,Y sequence)
311  // Obscure option
312  code = *aText++;
313  if( ( *aText >= '0' ) && ( *aText<= '9' ) )
314  aText++; // skip the digit
315  break;
316 
317  case 'X':
318  case 'Y':
319  {
320  code = *(aText++);
321  char ctmp = *(aText++) - '0';
322  if( code == 'X' )
323  {
324  x_fmt_known = true;
325  // number of digits after the decimal point (0 to 7 allowed)
326  m_FmtScale.x = *aText - '0';
327  m_FmtLen.x = ctmp + m_FmtScale.x;
328 
329  // m_FmtScale is 0 to 7
330  // (Old Gerber specification was 0 to 6)
331  if( m_FmtScale.x < 0 )
332  m_FmtScale.x = 0;
333  if( m_FmtScale.x > 7 )
334  m_FmtScale.x = 7;
335  }
336  else
337  {
338  y_fmt_known = true;
339  m_FmtScale.y = *aText - '0';
340  m_FmtLen.y = ctmp + m_FmtScale.y;
341  if( m_FmtScale.y < 0 )
342  m_FmtScale.y = 0;
343  if( m_FmtScale.y > 7 )
344  m_FmtScale.y = 7;
345  }
346  aText++;
347  }
348  break;
349 
350  case '*':
351  break;
352 
353  default:
354  msg.Printf( wxT( "Unknown id (%c) in FS command" ),
355  *aText );
356  AddMessageToList( msg );
357  GetEndOfBlock( aBuff, aBuffSize, aText, m_Current_File );
358  ok = false;
359  break;
360  }
361  }
362  if( !x_fmt_known || !y_fmt_known )
363  AddMessageToList( wxT( "RS274X: Format Statement (FS) without X or Y format" ) );
364 
365  break;
366 
367  case AXIS_SELECT: // command ASAXBY*% or %ASAYBX*%
368  m_SwapAxis = false;
369  if( strncasecmp( aText, "AYBX", 4 ) == 0 )
370  m_SwapAxis = true;
371  break;
372 
373  case MIRROR_IMAGE: // command %MIA0B0*%, %MIA0B1*%, %MIA1B0*%, %MIA1B1*%
374  m_MirrorA = m_MirrorB = 0;
375  while( *aText && *aText != '*' )
376  {
377  switch( *aText )
378  {
379  case 'A': // Mirror A axis ?
380  aText++;
381  if( *aText == '1' )
382  m_MirrorA = true;
383  break;
384 
385  case 'B': // Mirror B axis ?
386  aText++;
387  if( *aText == '1' )
388  m_MirrorB = true;
389  break;
390 
391  default:
392  aText++;
393  break;
394  }
395  }
396  break;
397 
398  case MODE_OF_UNITS:
399  code = ReadXCommandID( aText );
400  if( code == INCH )
401  m_GerbMetric = false;
402  else if( code == MILLIMETER )
403  m_GerbMetric = true;
404  conv_scale = m_GerbMetric ? IU_PER_MILS / 25.4 : IU_PER_MILS;
405  break;
406 
407  case FILE_ATTRIBUTE: // Command %TF ...
408  m_IsX2_file = true;
409  {
411  dummy.ParseAttribCmd( m_Current_File, aBuff, aBuffSize, aText, m_LineNum );
412 
413  if( dummy.IsFileFunction() )
414  {
415  delete m_FileFunction;
417  }
418  else if( dummy.IsFileMD5() )
419  {
420  m_MD5_value = dummy.GetPrm( 1 );
421  }
422  else if( dummy.IsFilePart() )
423  {
424  m_PartString = dummy.GetPrm( 1 );
425  }
426  }
427  break;
428 
429  case APERTURE_ATTRIBUTE: // Command %TA
430  {
432  dummy.ParseAttribCmd( m_Current_File, aBuff, aBuffSize, aText, m_LineNum );
433 
434  if( dummy.GetAttribute() == ".AperFunction" )
435  {
436  m_AperFunction = dummy.GetPrm( 1 );
437 
438  // A few function values can have other parameters. Add them
439  for( int ii = 2; ii < dummy.GetPrmCount(); ii++ )
440  m_AperFunction << "," << dummy.GetPrm( ii );
441  }
442  }
443  break;
444 
445  case NET_ATTRIBUTE: // Command %TO currently %TO.P %TO.N and %TO.C
446  {
448 
449  dummy.ParseAttribCmd( m_Current_File, aBuff, aBuffSize, aText, m_LineNum );
450 
451  if( dummy.GetAttribute() == ".N" )
452  {
455  }
456  else if( dummy.GetAttribute() == ".C" )
457  {
460  }
461  else if( dummy.GetAttribute() == ".P" )
462  {
466  }
467  }
468  break;
469 
470  case REMOVE_APERTURE_ATTRIBUTE: // Command %TD ...
471  {
473  dummy.ParseAttribCmd( m_Current_File, aBuff, aBuffSize, aText, m_LineNum );
474  RemoveAttribute( dummy );
475  }
476  break;
477 
478  case OFFSET: // command: OFAnnBnn (nn = float number) = layer Offset
479  m_Offset.x = m_Offset.y = 0;
480  while( *aText != '*' )
481  {
482  switch( *aText )
483  {
484  case 'A': // A axis offset in current unit (inch or mm)
485  aText++;
486  fcoord = ReadDouble( aText );
487  m_Offset.x = KiROUND( fcoord * conv_scale );
488  break;
489 
490  case 'B': // B axis offset in current unit (inch or mm)
491  aText++;
492  fcoord = ReadDouble( aText );
493  m_Offset.y = KiROUND( fcoord * conv_scale );
494  break;
495  }
496  }
497  break;
498 
499  case SCALE_FACTOR:
500  m_Scale.x = m_Scale.y = 1.0;
501  while( *aText != '*' )
502  {
503  switch( *aText )
504  {
505  case 'A': // A axis scale
506  aText++;
507  m_Scale.x = ReadDouble( aText );
508  break;
509 
510  case 'B': // B axis scale
511  aText++;
512  m_Scale.y = ReadDouble( aText );
513  break;
514  }
515  }
516  break;
517 
518  case IMAGE_OFFSET: // command: IOAnnBnn (nn = float number) = Image Offset
520  while( *aText != '*' )
521  {
522  switch( *aText )
523  {
524  case 'A': // A axis offset in current unit (inch or mm)
525  aText++;
526  fcoord = ReadDouble( aText );
527  m_ImageOffset.x = KiROUND( fcoord * conv_scale );
528  break;
529 
530  case 'B': // B axis offset in current unit (inch or mm)
531  aText++;
532  fcoord = ReadDouble( aText );
533  m_ImageOffset.y = KiROUND( fcoord * conv_scale );
534  break;
535  }
536  }
537  break;
538 
539  case IMAGE_ROTATION: // command IR0* or IR90* or IR180* or IR270*
540  if( strncasecmp( aText, "0*", 2 ) == 0 )
541  m_ImageRotation = 0;
542  else if( strncasecmp( aText, "90*", 3 ) == 0 )
543  m_ImageRotation = 90;
544  else if( strncasecmp( aText, "180*", 4 ) == 0 )
545  m_ImageRotation = 180;
546  else if( strncasecmp( aText, "270*", 4 ) == 0 )
547  m_ImageRotation = 270;
548  else
549  AddMessageToList( _( "RS274X: Command \"IR\" rotation value not allowed" ) );
550  break;
551 
552  case STEP_AND_REPEAT: // command SR, like %SRX3Y2I5.0J2*%
553  m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // Start a new Gerber layer
555  GetLayerParams().m_StepForRepeat.x = 0.0; // offset for Step and Repeat command
557  GetLayerParams().m_YRepeatCount = 1; // The repeat count
558  GetLayerParams().m_StepForRepeatMetric = m_GerbMetric; // the step units
559  while( *aText && *aText != '*' )
560  {
561  switch( *aText )
562  {
563  case 'I': // X axis offset
564  aText++;
566  break;
567 
568  case 'J': // Y axis offset
569  aText++;
571  break;
572 
573  case 'X': // X axis repeat count
574  aText++;
576  break;
577 
578  case 'Y': // Y axis offset
579  aText++;
581  break;
582  default:
583  aText++;
584  break;
585  }
586  }
587  break;
588 
589  case IMAGE_JUSTIFY: // Command IJAnBn*
590  m_ImageJustifyXCenter = false; // Image Justify Center on X axis (default = false)
591  m_ImageJustifyYCenter = false; // Image Justify Center on Y axis (default = false)
592  m_ImageJustifyOffset = wxPoint(0,0); // Image Justify Offset on XY axis (default = 0,0)
593  while( *aText && *aText != '*' )
594  {
595  // IJ command is (for A or B axis) AC or AL or A<coordinate>
596  switch( *aText )
597  {
598  case 'A': // A axis justify
599  aText++;
600  if( *aText == 'C' )
601  {
602  m_ImageJustifyXCenter = true;
603  aText++;
604  }
605  else if( *aText == 'L' )
606  {
607  m_ImageJustifyXCenter = true;
608  aText++;
609  }
610  else m_ImageJustifyOffset.x = KiROUND( ReadDouble( aText ) * conv_scale);
611  break;
612 
613  case 'B': // B axis justify
614  aText++;
615  if( *aText == 'C' )
616  {
617  m_ImageJustifyYCenter = true;
618  aText++;
619  }
620  else if( *aText == 'L' )
621  {
622  m_ImageJustifyYCenter = true;
623  aText++;
624  }
625  else m_ImageJustifyOffset.y = KiROUND( ReadDouble( aText ) * conv_scale);
626  break;
627  default:
628  aText++;
629  break;
630  }
631  }
636  break;
637 
638  case KNOCKOUT:
639  m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // Start a new Gerber layer
640  msg = _( "RS274X: Command KNOCKOUT ignored by GerbView" ) ;
641  AddMessageToList( msg );
642  break;
643 
644  case ROTATE: // Layer rotation: command like %RO45*%
645  m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // Start a new Gerber layer
646  m_LocalRotation =ReadDouble( aText ); // Store layer rotation in degrees
647  break;
648 
649  case IMAGE_NAME:
650  m_ImageName.Empty();
651  while( *aText != '*' )
652  {
653  m_ImageName.Append( *aText++ );
654  }
655 
656  break;
657 
658  case LOAD_NAME:
659  // %LN is a (deprecated) equivalentto G04: a comment
660  while( *aText && *aText != '*' )
661  {
662  aText++; // Skip text
663  }
664 
665  break;
666 
667  case IMAGE_POLARITY:
668  if( strncasecmp( aText, "NEG", 3 ) == 0 )
669  m_ImageNegative = true;
670  else
671  m_ImageNegative = false;
672 
673  break;
674 
675  case LOAD_POLARITY:
676  if( *aText == 'C' )
678  else
680 
681  break;
682 
683  case AP_MACRO: // lines like %AMMYMACRO*
684  // 5,1,8,0,0,1.08239X$1,22.5*
685  // %
686  /*ok = */ReadApertureMacro( aBuff, aBuffSize, aText, m_Current_File );
687  break;
688 
689  case AP_DEFINITION:
690  /* input example: %ADD30R,0.081800X0.101500*%
691  * Aperture definition has 4 options: C, R, O, P
692  * (Circle, Rect, Oval, regular Polygon)
693  * and shapes can have a hole (round or rectangular).
694  * All optional parameters values start by X
695  * at this point, text points to 2nd 'D'
696  */
697  if( *aText++ != 'D' )
698  {
699  ok = false;
700  break;
701  }
702 
703  m_Has_DCode = true;
704 
705  code = ReadInt( aText );
706 
707  D_CODE* dcode;
708  dcode = GetDCODEOrCreate( code );
709 
710  if( dcode == NULL )
711  break;
712 
714 
715  // at this point, text points to character after the ADD<num>,
716  // i.e. R in example above. If aText[0] is one of the usual
717  // apertures: (C,R,O,P), there is a comma after it.
718  if( aText[1] == ',' )
719  {
720  char stdAperture = *aText;
721 
722  aText += 2; // skip "C," for example
723 
724  dcode->m_Size.x = KiROUND( ReadDouble( aText ) * conv_scale );
725  dcode->m_Size.y = dcode->m_Size.x;
726 
727  switch( stdAperture ) // Aperture desceiption has optional parameters. Read them
728  {
729  case 'C': // Circle
730  dcode->m_Shape = APT_CIRCLE;
731  while( *aText == ' ' )
732  aText++;
733 
734  if( *aText == 'X' )
735  {
736  aText++;
737  dcode->m_Drill.x = dcode->m_Drill.y =
738  KiROUND( ReadDouble( aText ) * conv_scale );
740  }
741 
742  while( *aText == ' ' )
743  aText++;
744 
745  if( *aText == 'X' )
746  {
747  aText++;
748  dcode->m_Drill.y =
749  KiROUND( ReadDouble( aText ) * conv_scale );
750 
752  }
753  dcode->m_Defined = true;
754  break;
755 
756  case 'O': // oval
757  case 'R': // rect
758  dcode->m_Shape = (stdAperture == 'O') ? APT_OVAL : APT_RECT;
759 
760  while( *aText == ' ' )
761  aText++;
762 
763  if( *aText == 'X' )
764  {
765  aText++;
766  dcode->m_Size.y =
767  KiROUND( ReadDouble( aText ) * conv_scale );
768  }
769 
770  while( *aText == ' ' )
771  aText++;
772 
773  if( *aText == 'X' )
774  {
775  aText++;
776  dcode->m_Drill.x = KiROUND( ReadDouble( aText ) * conv_scale );
777  dcode->m_Drill.y = dcode->m_Drill.x;
779  }
780 
781  while( *aText == ' ' )
782  aText++;
783 
784  if( *aText == 'X' )
785  {
786  aText++;
787  dcode->m_Drill.y =
788  KiROUND( ReadDouble( aText ) * conv_scale );
790  }
791  dcode->m_Defined = true;
792  break;
793 
794  case 'P':
795 
796  /* Regular polygon: a command line like %ADD12P,0.040X10X25X0.025X0.025X0.0150*%
797  * params are: <diameter>, X<edge count>, X<Rotation>, X<X hole dim>, X<Y hole dim>
798  */
799  dcode->m_Shape = APT_POLYGON;
800  while( *aText == ' ' )
801  aText++;
802 
803  if( *aText == 'X' )
804  {
805  aText++;
806  dcode->m_EdgesCount = ReadInt( aText );
807  }
808 
809  while( *aText == ' ' )
810  aText++;
811 
812  if( *aText == 'X' )
813  {
814  aText++;
815  dcode->m_Rotation = ReadDouble( aText );
816  }
817 
818  while( *aText == ' ' )
819  aText++;
820 
821  if( *aText == 'X' )
822  {
823  aText++;
824  dcode->m_Drill.x = KiROUND( ReadDouble( aText ) * conv_scale );
825  dcode->m_Drill.y = dcode->m_Drill.x;
827  }
828 
829  while( *aText == ' ' )
830  aText++;
831 
832  if( *aText == 'X' )
833  {
834  aText++;
835  dcode->m_Drill.y = KiROUND( ReadDouble( aText ) * conv_scale );
837  }
838  dcode->m_Defined = true;
839  break;
840  }
841  }
842  else // aText[0] starts an aperture macro name
843  {
844  APERTURE_MACRO am_lookup;
845 
846  while( *aText && *aText != '*' && *aText != ',' )
847  am_lookup.name.Append( *aText++ );
848 
849  // When an aperture definition is like %AMLINE2* 22,1,$1,$2,0,0,-45*
850  // the ADDxx<MACRO_NAME> command has parameters, like %ADD14LINE2,0.8X0.5*%
851  if( *aText == ',' )
852  { // Read aperture macro parameters and store them
853  aText++; // aText points the first parameter
854 
855  while( *aText && *aText != '*' )
856  {
857  double param = ReadDouble( aText );
858  dcode->AppendParam( param );
859 
860  while( isspace( *aText ) )
861  aText++;
862 
863  // Skip 'X' separator:
864  if( *aText == 'X' || *aText == 'x' )
865  aText++;
866  }
867  }
868 
869  // lookup the aperture macro here.
870  APERTURE_MACRO* pam = FindApertureMacro( am_lookup );
871 
872  if( !pam )
873  {
874  msg.Printf( wxT( "RS274X: aperture macro %s not found\n" ),
875  TO_UTF8( am_lookup.name ) );
876  AddMessageToList( msg );
877  ok = false;
878  break;
879  }
880 
881  dcode->m_Shape = APT_MACRO;
882  dcode->SetMacro( pam );
883  }
884 
885  break;
886 
887  default:
888  ok = false;
889  break;
890  }
891 
892  (void) seq_len; // quiet g++, or delete the unused variable.
893 
894  ok = GetEndOfBlock( aBuff, aBuffSize, aText, m_Current_File );
895 
896  return ok;
897 }
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 ...
wxString name
The name of the aperture macro.
Definition: am_primitive.h:165
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
print info associated to a component (TO.C attribute)
wxSize m_Size
Horizontal and vertical dimensions.
Definition: dcode.h:94
int ReadInt(char *&text, bool aSkipSeparator=true)
Function ReadInt reads an int from an ASCII character buffer.
Definition: dcode.h:53
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
double m_Rotation
shape rotation in degrees
Definition: dcode.h:99
wxSize m_Drill
dimension of the hole (if any) (draill file)
Definition: dcode.h:97
wxRealPoint m_StepForRepeat
wxString m_Cmpref
the component reference parent of the data
const wxString & GetPrm(int aIdx)
int ReadXCommandID(char *&text)
reads two bytes of data and assembles them into an int with the first byte in the sequence put into t...
Definition: rs274x.cpp:114
Definition: dcode.h:52
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
double ReadDouble(char *&text, bool aSkipSeparator=true)
Function ReadDouble reads a double from an ASCII character buffer.
bool IsFileMD5()
return true if the attribute is .MD5
bool m_Defined
false if the aperture is not defined in the header
Definition: dcode.h:104
wxString m_Padname
for a flashed pad: the pad name ((TO.P attribute)
void AppendParam(double aValue)
AppendParam() Add a parameter to the D_CODE parameter list.
Definition: dcode.h:122
bool IsFilePart()
return true if the attribute is .Part
wxString m_Netname
for items associated to a net: the netname
APERTURE_MACRO * FindApertureMacro(const APERTURE_MACRO &aLookup)
Function FindApertureMacro looks up a previously read in aperture macro.
static const wxString fromGerberString(const wxString &aGbrString)
Convert a string read from a gerber file to an unicode string Usual chars (ASCII7 values) are the onl...
Definition: rs274x.cpp:150
bool m_StepForRepeatMetric
bool IsFileFunction()
return true if the attribute is .FileFunction
bool ReadApertureMacro(char *aBuff, unsigned int aBuffSize, char *&text, FILE *gerber_file)
reads in an aperture macro and saves it in m_aperture_macros.
Definition: rs274x.cpp:954
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE ...
Definition: dcode.h:105
void RemoveAttribute(X2_ATTRIBUTE &aAttribute)
Function RemoveAttribute.
APERTURE_DEF_HOLETYPE m_DrillShape
shape of the hole (0 = no hole, round = 1, rect = 2) */
Definition: dcode.h:98
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
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...
Definition: rs274x.cpp:62
GBR_NETLIST_METADATA m_NetAttributeDict
void SetMacro(APERTURE_MACRO *aMacro)
Definition: dcode.h:151
bool GetEndOfBlock(char *aBuff, unsigned int aBuffSize, char *&aText, FILE *aGerberFile)
Definition: rs274x.cpp:900
#define IU_PER_MILS
Definition: plotter.cpp:134
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.
int m_EdgesCount
in aperture definition Polygon only: number of edges for the polygon
Definition: dcode.h:100
const wxString & GetAttribute()
print info associated to a flashed pad (TO.P attribute)
Struct APERTURE_MACRO helps support the "aperture macro" defined within standard RS274X.
Definition: am_primitive.h:163
print info associated to a net (TO.N attribute)
D_CODE * GetDCODEOrCreate(int aDCODE, bool aCreateIfNoExist=true)
Function GetDCODEOrCreate returns a pointer to the D_CODE within this GERBER for the given aDCODE...
GERBER_LAYER & GetLayerParams()
Function GetLayerParams.
int m_NetAttribType
the type of net info (used to define the gerber string to create)
APERTURE_MACRO * GERBER_FILE_IMAGE::FindApertureMacro ( const APERTURE_MACRO aLookup)

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 m_aperture_macros.

Referenced by 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)

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

Definition at line 110 of file base_struct.cpp.

Referenced by PCB_EDIT_FRAME::AppendBoardFile(), CN_ITEM::BBox(), SCH_EDIT_FRAME::copyBlockItems(), MODULE::CoverageRatio(), LIB_ITEM::GetBoundingBox(), GetBoundingBoxes(), getRect(), getSheetBbox(), SCH_BASE_FRAME::HandleBlockBegin(), EDA_ITEM::HitTest(), and EDA_ITEM::ViewBBox().

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

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 244 of file gerber_file_image.h.

Referenced by Visit().

245  {
246  return wxT( "GERBER_FILE_IMAGE" );
247  }
D_CODE * GERBER_FILE_IMAGE::GetDCODE ( int  aDCODE) const

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 m_Aperture_List.

Referenced by Execute_DCODE_Command(), 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 
)

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 m_Aperture_List.

Referenced by 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 ( )
Returns
the count of Dcode tools in used by the image

Definition at line 264 of file gerber_file_image.cpp.

References DIM, m_Aperture_List, and m_InUse.

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

265 {
266  int count = 0;
267 
268  for( unsigned ii = 0; ii < DIM( m_Aperture_List ); ii++ )
269  {
270  if( m_Aperture_List[ii] )
271  if( m_Aperture_List[ii]->m_InUse || m_Aperture_List[ii]->m_Defined )
272  ++count;
273  }
274 
275  return count;
276 }
#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)
bool GERBER_FILE_IMAGE::GetEndOfBlock ( char *  aBuff,
unsigned int  aBuffSize,
char *&  aText,
FILE *  aGerberFile 
)
private

Definition at line 900 of file rs274x.cpp.

References m_LineNum.

Referenced by ExecuteRS274XCommand().

901 {
902  for( ; ; )
903  {
904  while( (aText < aBuff + aBuffSize) && *aText )
905  {
906  if( *aText == '*' )
907  return true;
908 
909  if( *aText == '%' )
910  return true;
911 
912  aText++;
913  }
914 
915  if( fgets( aBuff, aBuffSize, gerber_file ) == NULL )
916  break;
917 
918  m_LineNum++;
919  aText = aBuff;
920  }
921 
922  return false;
923 }
STATUS_FLAGS EDA_ITEM::GetFlags ( ) const
inlineinherited

Definition at line 258 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(), 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(), PCB_BASE_FRAME::DeleteTextModule(), 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(), 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(), 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(), 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(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

258 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
GERBER_DRAW_ITEM * GERBER_FILE_IMAGE::GetItemsList ( )
GERBER_LAYER& GERBER_FILE_IMAGE::GetLayerParams ( )
inline

Function GetLayerParams.

Returns
the current layers params

Definition at line 281 of file gerber_file_image.h.

Referenced by Execute_DCODE_Command(), ExecuteRS274XCommand(), GERBER_DRAW_ITEM::SetLayerParameters(), StepAndRepeatItem(), and GERBVIEW_FRAME::UpdateTitleAndInfo().

282  {
283  return m_GBRLayerParams;
284  }
GERBER_LAYER m_GBRLayerParams
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, ZONE_CONTAINER, SCH_COMPONENT, MODULE, SCH_SHEET, LIB_PIN, VIA, SEGZONE, SCH_HIERLABEL, GERBER_DRAW_ITEM, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, DIMENSION, SCH_LABEL, LIB_FIELD, TEXTE_MODULE, SCH_BUS_BUS_ENTRY, SCH_SHEET_PIN, SCH_TEXT, SCH_FIELD, SCH_LINE, LIB_ARC, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, LIB_TEXT, EDGE_MODULE, TEXTE_PCB, LIB_POLYLINE, MARKER_PCB, LIB_RECTANGLE, PCB_TARGET, LIB_CIRCLE, SCH_MARKER, SCH_NO_CONNECT, and SCH_JUNCTION.

Definition at line 280 of file base_struct.cpp.

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

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

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

Definition at line 260 of file gerber_file_image.h.

References GERBER_LAYER::ResetDefaultValues().

Referenced by GERBVIEW_FRAME::Read_GERBER_File().

260 { return m_messagesList; }
wxArrayString m_messagesList
virtual void EDA_ITEM::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
inlinevirtualinherited

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

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

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

Definition at line 297 of file base_struct.h.

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

298  {
299  }
char * GERBER_FILE_IMAGE::GetNextLine ( char *  aBuff,
unsigned int  aBuffSize,
char *  aText,
FILE *  aFile 
)
private

test for an end of line if a end of line is found: read a new line

Parameters
aBuff= buffer (size = GERBER_BUFZ) to fill with a new line
aText= pointer to the last useful char in aBuff on return: points the beginning of the next line.
aBuffSize= the size in bytes of aBuff
aFile= the opened GERBER file to read
Returns
a pointer to the beginning of the next line or NULL if end of file

Definition at line 926 of file rs274x.cpp.

References m_LineNum.

Referenced by ReadApertureMacro().

927 {
928  for( ; ; )
929  {
930  switch (*aText )
931  {
932  case ' ': // skip blanks
933  case '\n':
934  case '\r': // Skip line terminators
935  ++aText;
936  break;
937 
938  case 0: // End of text found in aBuff: Read a new string
939  if( fgets( aBuff, aBuffSize, aFile ) == NULL )
940  return NULL;
941 
942  m_LineNum++;
943  aText = aBuff;
944  return aText;
945 
946  default:
947  return aText;
948  }
949  }
950  return aText;
951 }
COLOR4D GERBER_FILE_IMAGE::GetPositiveDrawColor ( ) const
inline

Definition at line 269 of file gerber_file_image.h.

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

269 { return m_PositiveDrawColor; }
wxString EDA_ITEM::GetSelectMenuText ( EDA_UNITS_T  aUnits) const
virtualinherited

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

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

Returns
The menu text string.

Reimplemented in D_PAD, ZONE_CONTAINER, SCH_COMPONENT, MODULE, SCH_SHEET, LIB_PIN, VIA, SEGZONE, DELETED_SCH_ITEM, SCH_HIERLABEL, GERBER_DRAW_ITEM, TRACK, SCH_GLOBALLABEL, DRAWSEGMENT, DIMENSION, SCH_LABEL, LIB_FIELD, TEXTE_MODULE, SCH_SHEET_PIN, SCH_BUS_BUS_ENTRY, SCH_TEXT, SCH_FIELD, SCH_LINE, LIB_ARC, SCH_BUS_WIRE_ENTRY, SCH_BITMAP, LIB_TEXT, EDGE_MODULE, TEXTE_PCB, LIB_POLYLINE, MARKER_PCB, LIB_RECTANGLE, PCB_TARGET, LIB_CIRCLE, SCH_MARKER, SCH_NO_CONNECT, SCH_JUNCTION, and DELETED_BOARD_ITEM.

Definition at line 173 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::doSelectionMenu(), SCH_FIND_COLLECTOR::GetText(), EDA_ITEM::HitTest(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), DRC_ITEM::SetData(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

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

Definition at line 253 of file base_struct.h.

References EDA_ITEM::m_Status.

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

253 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:164
timestamp_t EDA_ITEM::GetTimeStamp ( ) const
inlineinherited

Definition at line 207 of file base_struct.h.

References EDA_ITEM::m_TimeStamp.

Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), SCH_COMPONENT::AddSheetPathReferenceEntryIfMissing(), SCH_EDIT_FRAME::AnnotateComponents(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyData(), PCB_EDIT_FRAME::Delete_OldZone_Fill(), PCB_EDIT_FRAME::Delete_Zone_Contour(), DuplicateStruct(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::format(), FormatProbeItem(), NETLIST_OBJECT::GetShortNetName(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), NETLIST_EXPORTER_GENERIC::makeComponents(), mapExistingAnnotation(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), SCH_SHEET_PATH::Path(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN::saveSheet(), SCH_REFERENCE::SCH_REFERENCE(), ZONE_FILLER_TOOL::SegzoneDeleteFill(), SortByTimeStamp(), SwapItemData(), DIALOG_SCH_SHEET_PROPS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS().

207 { return m_TimeStamp; }
timestamp_t m_TimeStamp
Time stamp used for logical links.
Definition: base_struct.h:172
bool GERBER_FILE_IMAGE::HasNegativeItems ( )

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 240 of file gerber_file_image.cpp.

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

Referenced by GBR_LAYOUT::Draw().

241 {
242  if( m_hasNegativeItems < 0 ) // negative items are not yet searched: find them if any
243  {
244  if( m_ImageNegative ) // A negative layer is expected having always negative objects.
245  m_hasNegativeItems = 1;
246  else
247  {
248  m_hasNegativeItems = 0;
249  for( GERBER_DRAW_ITEM* item = GetItemsList(); item; item = item->Next() )
250  {
251  if( item->GetLayer() != m_GraphicLayer )
252  continue;
253  if( item->HasNegativeItems() )
254  {
255  m_hasNegativeItems = 1;
256  break;
257  }
258  }
259  }
260  }
261  return m_hasNegativeItems == 1;
262 }
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, DIMENSION, LIB_ITEM, TRACK, DRAWSEGMENT, TEXTE_MODULE, LIB_FIELD, LIB_PIN, MARKER_PCB, LIB_ARC, PCB_TARGET, LIB_TEXT, TEXTE_PCB, LIB_BEZIER, LIB_POLYLINE, LIB_RECTANGLE, and LIB_CIRCLE.

Definition at line 308 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().

309  {
310  return false; // derived classes should override this function
311  }
void GERBER_FILE_IMAGE::InitToolTable ( )

Function InitToolTable.

Definition at line 279 of file gerber_file_image.cpp.

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

280 {
281  for( int count = 0; count < TOOLS_MAX_COUNT; count++ )
282  {
283  if( m_Aperture_List[count] == NULL )
284  continue;
285 
286  m_Aperture_List[count]->m_Num_Dcode = count + FIRST_DCODE;
288  }
289 
290  m_aperture_macros.clear();
291 }
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 227 of file base_struct.h.

References BRIGHTENED.

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

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

Definition at line 226 of file base_struct.h.

References HIGHLIGHTED.

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

Definition at line 220 of file base_struct.h.

References IS_CHANGED.

Referenced by LIB_EDIT_FRAME::OnEditPin().

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

Definition at line 219 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(), abortMoveItem(), AbortPinMove(), AbortSymbolTraceOn(), SCH_EDIT_FRAME::addCurrentItemToScreen(), 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(), LIB_PIN::EnableEditMode(), LIB_EDIT_FRAME::EndDrawGraphicItem(), SCH_EDIT_FRAME::EndSegment(), ExitSheet(), LIB_PART::LIB_PART(), EDIT_TOOL::MoveExact(), 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(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), and DIALOG_LABEL_EDITOR::TransferDataFromWindow().

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

References EDA_ITEM::operator<().

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

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

Definition at line 225 of file base_struct.h.

References IS_RESIZED.

Referenced by ExitSheet().

225 { return m_Flags & IS_RESIZED; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
#define IS_RESIZED
Item being resized.
Definition: base_struct.h:115
bool EDA_ITEM::IsSelected ( ) const
inlineinherited
bool EDA_ITEM::IsType ( const KICAD_T  aScanTypes[])
inlineinherited

Function IsType Checks whether the item is one of the listed types.

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

Definition at line 266 of file base_struct.h.

References EOT.

267  {
268  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
269  {
270  if( m_StructType == *p )
271  return true;
272  }
273 
274  return false;
275  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:163
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 223 of file base_struct.h.

References IS_WIRE_IMAGE.

Referenced by SCH_FIELD::Draw().

223 { return m_Flags & IS_WIRE_IMAGE; }
#define IS_WIRE_IMAGE
Item to be drawn as wireframe while editing.
Definition: base_struct.h:118
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:178
SEARCH_RESULT EDA_ITEM::IterateForward ( EDA_ITEM listStart,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
staticinherited

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

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

Definition at line 130 of file base_struct.cpp.

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(), Visit(), MODULE::Visit(), and BOARD::Visit().

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

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 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( "Expected RS274X Command" );
204  text++;
205  }
206  break;
207 
208  default:
209  msg.Printf( "Unexpected char 0x%2.2X &lt;%c&lt;", *text, *text );
210  AddMessageToList( msg );
211  text++;
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:271
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown...
Definition: common.h:179
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
wxPoint ReadXYCoord(char *&aText, bool aExcellonMode=false)
Function ReadXYCoord Returns the current coordinate type pointed to by XnnYnn Text (XnnnnYmmmm) ...
bool Execute_G_Command(char *&text, int G_command)
Definition: rs274d.cpp: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 420 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().

421  {
422  return false;
423  }
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 182 of file base_struct.cpp.

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

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

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

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

240 {
241  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
242  GetChars( GetClass() ) ) );
243 
244  return false;
245 }
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
bool GERBER_FILE_IMAGE::ReadApertureMacro ( char *  aBuff,
unsigned int  aBuffSize,
char *&  text,
FILE *  gerber_file 
)
private

reads in an aperture macro and saves it in m_aperture_macros.

Parameters
aBuffa character buffer at least GERBER_BUFZ long that can be used to read successive lines from the gerber file.
textA reference to a character pointer which gives the initial text to read from.
aBuffSizeis the size of aBuff
gerber_fileWhich file to read from for continuation.
Returns
bool - true if a macro was read in successfully, else false.

Definition at line 954 of file rs274x.cpp.

References AddMessageToList(), AMP_CIRCLE, AMP_COMMENT, AMP_EOF, AMP_LINE2, AMP_LINE20, AMP_LINE_CENTER, AMP_LINE_LOWER_LEFT, AMP_MOIRE, AMP_OUTLINE, AMP_POLYGON, AMP_THERMAL, AMP_UNKNOWN, FROM_UTF8(), GetChars(), GetNextLine(), m_aperture_macros, m_GerbMetric, m_LineNum, APERTURE_MACRO::m_localparamStack, APERTURE_MACRO::name, AM_PRIMITIVE::params, AM_PRIMITIVE::primitive_id, APERTURE_MACRO::primitives, ReadInt(), and AM_PARAM::ReadParam().

Referenced by ExecuteRS274XCommand().

957 {
958  wxString msg;
959  APERTURE_MACRO am;
960 
961  // read macro name
962  while( *aText )
963  {
964  if( *aText == '*' )
965  {
966  ++aText;
967  break;
968  }
969 
970  am.name.Append( *aText++ );
971  }
972 
973  // Read aperture macro parameters
974  for( ; ; )
975  {
976  if( *aText == '*' )
977  ++aText;
978 
979  aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
980 
981  if( aText == NULL ) // End of File
982  return false;
983 
984  // aText points the beginning of a new line.
985 
986  // Test for the last line in aperture macro lis:
987  // last line is % or *% sometime found.
988  if( *aText == '*' )
989  ++aText;
990 
991  if( *aText == '%' )
992  break; // exit with aText still pointing at %
993 
994  int paramCount = 0; // will be set to the minimal parameters count,
995  // depending on the actual primitive
996  int primitive_type = AMP_UNKNOWN;
997  // Test for a valid symbol at the beginning of a description:
998  // it can be: a parameter declaration like $1=$2/4
999  // or a digit (macro primitive selection)
1000  // all other symbols are illegal.
1001  if( *aText == '$' ) // local parameter declaration, inside the aperture macro
1002  {
1003  am.m_localparamStack.push_back( AM_PARAM() );
1004  AM_PARAM& param = am.m_localparamStack.back();
1005  aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
1006  if( aText == NULL) // End of File
1007  return false;
1008  param.ReadParam( aText );
1009  continue;
1010  }
1011  else if( !isdigit(*aText) ) // Ill. symbol
1012  {
1013  msg.Printf( wxT( "RS274X: Aperture Macro \"%s\": ill. symbol, line: \"%s\"" ),
1014  GetChars( am.name ), GetChars( FROM_UTF8( aBuff ) ) );
1015  AddMessageToList( msg );
1016  primitive_type = AMP_COMMENT;
1017  }
1018  else
1019  primitive_type = ReadInt( aText );
1020 
1021  bool is_comment = false;
1022 
1023  switch( primitive_type )
1024  {
1025  case AMP_COMMENT: // lines starting by 0 are a comment
1026  paramCount = 0;
1027  is_comment = true;
1028  // Skip comment
1029  while( *aText && ( *aText != '*' ) )
1030  aText++;
1031  break;
1032 
1033  case AMP_CIRCLE:
1034  paramCount = 4; // minimal count. can have a optional parameter (rotation)
1035  break;
1036 
1037  case AMP_LINE2:
1038  case AMP_LINE20:
1039  paramCount = 7;
1040  break;
1041 
1042  case AMP_LINE_CENTER:
1043  case AMP_LINE_LOWER_LEFT:
1044  paramCount = 6;
1045  break;
1046 
1047  case AMP_EOF:
1048  paramCount = 0;
1049  break;
1050 
1051  case AMP_OUTLINE:
1052  paramCount = 4;
1053  break;
1054 
1055  case AMP_POLYGON:
1056  paramCount = 6;
1057  break;
1058 
1059  case AMP_MOIRE:
1060  paramCount = 9;
1061  break;
1062 
1063  case AMP_THERMAL:
1064  paramCount = 6;
1065  break;
1066 
1067  default:
1068  msg.Printf( wxT( "RS274X: Aperture Macro \"%s\": Invalid primitive id code %d, line %d: \"%s\"" ),
1069  GetChars( am.name ), primitive_type, m_LineNum, GetChars( FROM_UTF8( aBuff ) ) );
1070  AddMessageToList( msg );
1071  return false;
1072  }
1073 
1074  if( is_comment )
1075  continue;
1076 
1077  AM_PRIMITIVE prim( m_GerbMetric );
1078  prim.primitive_id = (AM_PRIMITIVE_ID) primitive_type;
1079  int ii;
1080 
1081  for( ii = 0; ii < paramCount && *aText && *aText != '*'; ++ii )
1082  {
1083  prim.params.push_back( AM_PARAM() );
1084 
1085  AM_PARAM& param = prim.params.back();
1086 
1087  aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
1088 
1089  if( aText == NULL) // End of File
1090  return false;
1091 
1092  param.ReadParam( aText );
1093  }
1094 
1095  if( ii < paramCount )
1096  {
1097  // maybe some day we can throw an exception and track a line number
1098  msg.Printf( wxT( "RS274X: read macro descr type %d: read %d parameters, insufficient parameters\n" ),
1099  prim.primitive_id, ii );
1100  AddMessageToList( msg );
1101  }
1102  // there are more parameters to read if this is an AMP_OUTLINE
1103  if( prim.primitive_id == AMP_OUTLINE )
1104  {
1105  // so far we have read [0]:exposure, [1]:#points, [2]:X start, [3]: Y start
1106  // Now read all the points, plus trailing rotation in degrees.
1107 
1108  // params[1] is a count of polygon points, so it must be given
1109  // in advance, i.e. be immediate.
1110  wxASSERT( prim.params[1].IsImmediate() );
1111 
1112  paramCount = (int) prim.params[1].GetValue( 0 ) * 2 + 1;
1113 
1114  for( int jj = 0; jj < paramCount && *aText != '*'; ++jj )
1115  {
1116  prim.params.push_back( AM_PARAM() );
1117 
1118  AM_PARAM& param = prim.params.back();
1119 
1120  aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
1121 
1122  if( aText == NULL ) // End of File
1123  return false;
1124 
1125  param.ReadParam( aText );
1126  }
1127  }
1128 
1129  am.primitives.push_back( prim );
1130  }
1131 
1132  m_aperture_macros.insert( am );
1133 
1134  return true;
1135 }
APERTURE_MACRO_SET m_aperture_macros
a collection of APERTURE_MACROS, sorted by name
void AddMessageToList(const wxString &aMessage)
Function AddMessageToList Add a message to the message list.
wxString name
The name of the aperture macro.
Definition: am_primitive.h:165
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
int ReadInt(char *&text, bool aSkipSeparator=true)
Function ReadInt reads an int from an ASCII character buffer.
bool ReadParam(char *&aText)
Function ReadParam Read one aperture macro parameter a parameter can be: a number a reference to an a...
Definition: am_param.cpp:171
AM_PARAMS m_localparamStack
Definition: am_primitive.h:174
char * GetNextLine(char *aBuff, unsigned int aBuffSize, char *aText, FILE *aFile)
test for an end of line if a end of line is found: read a new line
Definition: rs274x.cpp:926
Class AM_PARAM holds a parameter value for an "aperture macro" as defined within standard RS274X...
Definition: am_param.h:286
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
AM_PRIMITIVES primitives
A sequence of AM_PRIMITIVEs.
Definition: am_primitive.h:166
Struct AM_PRIMITIVE holds an aperture macro primitive as given in Table 3 of http://gerbv.sourceforge.net/docs/rs274xrevd_e.pdf.
Definition: am_primitive.h:92
AM_PRIMITIVE_ID
Enum AM_PRIMITIVE_ID is the set of all "aperture macro primitives" (primitive numbers).
Definition: am_primitive.h:71
Struct APERTURE_MACRO helps support the "aperture macro" defined within standard RS274X.
Definition: am_primitive.h:163
wxPoint GERBER_FILE_IMAGE::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.

Definition at line 190 of file rs274_read_XY_and_IJ_coordinates.cpp.

References ARC_INFO_TYPE_CENTER, IsNumber, IU_PER_MILS, KiROUND(), m_FmtLen, m_FmtScale, m_GerbMetric, m_IJPos, m_LastArcDataType, m_NoTrailingZeros, scale_list, wxPoint::x, and wxPoint::y.

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

reads a single RS274X command terminated with a %

Definition at line 186 of file rs274x.cpp.

References CMD_IDLE, ExecuteRS274XCommand(), m_CommandState, m_Current_File, m_LineNum, and ReadXCommandID().

187 {
188  bool ok = true;
189  int code_command;
190 
191  aText++;
192 
193  for( ; ; )
194  {
195  while( *aText )
196  {
197  switch( *aText )
198  {
199  case '%': // end of command
200  aText++;
202  goto exit; // success completion
203 
204  case ' ':
205  case '\r':
206  case '\n':
207  aText++;
208  break;
209 
210  case '*':
211  aText++;
212  break;
213 
214  default:
215  code_command = ReadXCommandID( aText );
216  ok = ExecuteRS274XCommand( code_command, aBuff, aBuffSize, aText );
217  if( !ok )
218  goto exit;
219  break;
220  }
221  }
222 
223  // end of current line, read another one.
224  if( fgets( aBuff, aBuffSize, m_Current_File ) == NULL )
225  {
226  // end of file
227  ok = false;
228  break;
229  }
230  m_LineNum++;
231  aText = aBuff;
232  }
233 
234 exit:
235  return ok;
236 }
int ReadXCommandID(char *&text)
reads two bytes of data and assembles them into an int with the first byte in the sequence put into t...
Definition: rs274x.cpp:114
bool ExecuteRS274XCommand(int aCommand, char *aBuff, unsigned int aBuffSize, char *&aText)
executes a RS274X command
Definition: rs274x.cpp:239
int GERBER_FILE_IMAGE::ReadXCommandID ( char *&  text)
private

reads two bytes of data and assembles them into an int with the first byte in the sequence put into the most significant part of a 16 bit value to build a RS274X command identifier.

Parameters
textA reference to a pointer to read bytes from and to advance as they are read.
Returns
a RS274X command identifier.

Definition at line 114 of file rs274x.cpp.

Referenced by Execute_G_Command(), ExecuteRS274XCommand(), and ReadRS274XCommand().

115 {
116  /* reads two bytes of data and assembles them into an int with the first
117  * byte in the sequence put into the most significant part of a 16 bit value
118  */
119  int result;
120  int currbyte;
121 
122  if( text && *text )
123  {
124  currbyte = *text++;
125  result = ( currbyte & 0xFF ) << 8;
126  }
127  else
128  return -1;
129 
130  if( text && *text )
131  {
132  currbyte = *text++;
133  result += currbyte & 0xFF;
134  }
135  else
136  return -1;
137 
138  return result;
139 }
wxPoint GERBER_FILE_IMAGE::ReadXYCoord ( char *&  aText,
bool  aExcellonMode = false 
)

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

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

Definition at line 72 of file rs274_read_XY_and_IJ_coordinates.cpp.

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

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 378 of file gerber_file_image.cpp.

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

Referenced by ExecuteRS274XCommand().

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

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

452 { return false; }
void GERBER_FILE_IMAGE::ResetDefaultValues ( )
virtual

Reimplemented in EXCELLON_IMAGE.

Definition at line 178 of file gerber_file_image.cpp.

References ARC_INFO_TYPE_NONE, GERB_INTERPOL_LINEAR_1X, m_360Arc_enbl, m_ArcRadius, m_CommandState, m_Current_File, m_Current_Tool, m_CurrentPos, m_Exposure, m_FileFunction, m_FileName, m_FmtLen, m_FmtScale, m_GBRLayerParams, m_GerbMetric, m_Has_DCode, m_hasNegativeItems, m_IJPos, m_ImageJustifyOffset, m_ImageJustifyXCenter, m_ImageJustifyYCenter, m_ImageName, m_ImageNegative, m_ImageOffset, m_ImageRotation, m_InUse, m_IsX2_file, m_Iterpolation, m_Last_Pen_Command, m_LastArcDataType, m_LineNum, m_LocalRotation, m_MD5_value, m_MirrorA, m_MirrorB, m_NoTrailingZeros, m_Offset, m_PartString, m_PolygonFillMode, m_PolygonFillModeState, m_PreviousPos, m_Relative, m_Scale, m_Selected_Tool, m_SwapAxis, GERBER_LAYER::ResetDefaultValues(), wxPoint::x, and wxPoint::y.

Referenced by GERBER_FILE_IMAGE(), and EXCELLON_IMAGE::ResetDefaultValues().

179 {
180  m_InUse = false;
182  m_FileName.Empty();
183  m_ImageName = wxT( "no name" ); // Image name from the IN command
184  m_ImageNegative = false; // true = Negative image
185  m_IsX2_file = false; // true only if a %TF, %TA or %TD command
186  delete m_FileFunction; // file function parameters
187  m_FileFunction = NULL;
188  m_MD5_value.Empty(); // MD5 value found in a %TF.MD5 command
189  m_PartString.Empty(); // string found in a %TF.Part command
190  m_hasNegativeItems = -1; // set to uninitialized
191  m_ImageJustifyOffset = wxPoint(0,0); // Image justify Offset
192  m_ImageJustifyXCenter = false; // Image Justify Center on X axis (default = false)
193  m_ImageJustifyYCenter = false; // Image Justify Center on Y axis (default = false)
194  m_GerbMetric = false; // false = Inches (default), true = metric
195  m_Relative = false; // false = absolute Coord,
196  // true = relative Coord
197  m_NoTrailingZeros = false; // true: trailing zeros deleted
198  m_ImageOffset.x = m_ImageOffset.y = 0; // Coord Offset, from IO command
199  m_ImageRotation = 0; // Allowed 0, 90, 180, 270 (in degree)
200  m_LocalRotation = 0.0; // Layer totation from RO command (in 0.1 degree)
201  m_Offset.x = 0;
202  m_Offset.y = 0; // Coord Offset, from OF command
203  m_Scale.x = m_Scale.y = 1.0; // scale (A and B) this layer
204  m_MirrorA = false; // true: miror / axe A (default = X)
205  m_MirrorB = false; // true: miror / axe B (default = Y)
206  m_SwapAxis = false; // false if A = X, B = Y; true if A =Y, B = Y
207  m_Has_DCode = false; // true = DCodes in file
208  // false = no DCode->
209  // search for separate DCode file
210  m_FmtScale.x = m_FmtScale.y = 4; // Initialize default format to 3.4 => 4
211  m_FmtLen.x = m_FmtLen.y = 3 + 4; // Initialize default format len = 3+4
212 
213  m_Iterpolation = GERB_INTERPOL_LINEAR_1X; // Linear, 90 arc, Circ.
214  m_360Arc_enbl = false; // 360 deg circular
215  // interpolation disable
216  m_Current_Tool = 0; // Current Dcode selected
217  m_CommandState = 0; // State of the current command
218  m_CurrentPos.x = m_CurrentPos.y = 0; // current specified coord
219  m_PreviousPos.x = m_PreviousPos.y = 0; // last specified coord
220  m_IJPos.x = m_IJPos.y = 0; // current centre coord for
221  // plot arcs & circles
222  m_ArcRadius = 0; // radius of arcs in circular interpol (given by A## command).
223  // in command like X##Y##A##
224  m_LastArcDataType = ARC_INFO_TYPE_NONE; // Extra coordinate info type for arcs
225  // (radius or IJ center coord)
226  m_LineNum = 0; // line number in file being read
227  m_Current_File = NULL; // Gerber file to read
228  m_PolygonFillMode = false;
230  m_Selected_Tool = 0;
231  m_Last_Pen_Command = 0;
232  m_Exposure = false;
233 }
X2_ATTRIBUTE_FILEFUNCTION * m_FileFunction
GERBER_LAYER m_GBRLayerParams
bool m_Exposure
whether an aperture macro tool is flashed on or off
LAST_EXTRA_ARC_DATA_TYPE m_LastArcDataType
void EDA_ITEM::SetBack ( EDA_ITEM aBack)
inlineinherited

Definition at line 215 of file base_struct.h.

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

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

Definition at line 232 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::SetFlags().

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

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

Definition at line 256 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(), LIB_EDIT_FRAME::BlockCopySelectedItems(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), 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(), DrawMovingBlockOutlines(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockPlace(), 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(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), 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(), 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_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

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

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

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

Definition at line 231 of file base_struct.h.

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

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

Definition at line 217 of file base_struct.h.

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

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

Definition at line 214 of file base_struct.h.

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

214 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167
void EDA_ITEM::SetSelected ( )
inlineinherited

Definition at line 230 of file base_struct.h.

References SELECTED, and EDA_ITEM::SetFlags().

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

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

Definition at line 206 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(), SCH_EDIT_FRAME::DuplicateItemsInList(), DuplicateStruct(), DIALOG_FOOTPRINT_BOARD_EDITOR::EditFootprint(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::Exchange_Module(), PCB_IO::FootprintSave(), EDA_ITEM::initVars(), BOARD::InsertArea(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), EDA_ITEM::operator=(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), PCB_PARSER::parseDIMENSION(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDIT_FRAME::Process_Special_Functions(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), BOARD::ReplaceNetlist(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_SHEET::SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), and DIALOG_ERC::TestErc().

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

Definition at line 229 of file base_struct.h.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

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

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

Referenced by PART_LIB::GetEntryTypePowerNames().

483 { return *aLeft < *aRight; }
void GERBER_FILE_IMAGE::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)

Parameters
aItem= the item to repeat

Definition at line 302 of file gerber_file_image.cpp.

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

Referenced by Execute_DCODE_Command(), and Execute_G_Command().

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

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), abortMoveItem(), AbortPinMove(), MODULE::Add(), CN_CONNECTIVITY_ALGO::Add(), BOARD::Add(), CN_CLUSTER::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), SCH_SCREEN::addConnectedItemsToBlock(), POINT_EDITOR::addCorner(), SCH_EDIT_FRAME::addCurrentItemToScreen(), AddMenusForComponent(), AddMenusForEditComponent(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), CN_ITEM::AnchorCount(), PCB_EDIT_FRAME::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(), LIB_EDIT_FRAME::BlockCopySelectedItems(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), POINT_EDITOR::canAddCorner(), SCH_JUNCTION::CanConnect(), SCH_NO_CONNECT::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_EDIT_FRAME::CheckListConnections(), CN_VISITOR::checkZoneItemConnection(), TEXTE_PCB::ClassOf(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), PCB_TARGET::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), ZONE_CONTAINER::ClassOf(), MARKER_PCB::ClassOf(), TRACK::ClassOf(), DIMENSION::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(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), LIB_EDIT_FRAME::deleteItem(), SCH_EDIT_FRAME::DeleteItem(), DeleteNullTrackSegments(), PYTHON_ACTION_PLUGINS::deregister_action(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_ERC::DisplayERC_MarkersList(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), KIGFX::SCH_PAINTER::draw(), 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(), SCH_EDIT_FRAME::DuplicateItemsInList(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditSymbolText(), EditToolSelectionFilter(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::EraseRedundantTrack(), ExitSheet(), 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(), CN_ITEM::GetAnchor(), TRACK::GetBestInsertPoint(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), 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(), SELECTION_TOOL::highlight(), SCH_EDIT_FRAME::ImportSheetPin(), ROUTER_TOOL::InlineDrag(), SCH_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), CN_ANCHOR::IsDangling(), 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(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), MarkItemsInBloc(), BOARD::MarkTrace(), TRACKS_CLEANER::mergeCollinearSegmentIfPossible(), TRACKS_CLEANER::MergeCollinearTracks(), SCH_LINE::MergeOverlap(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), moveItemWithMouseCursor(), MoveMarkedItems(), MoveMarkedItemsExactly(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), LIB_EDIT_FRAME::OnEditComponentProperties(), 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(), POINT_EDITOR::OnSelectionChange(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), LIB_ITEM::operator==(), OrCell_Trace(), 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(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::processItem(), DIALOG_EXCHANGE_FOOTPRINTS::processMatchingModules(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_BASE_FRAME::RefreshItem(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), CN_CONNECTIVITY_ALGO::Remove(), BOARD::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), TRACKS_CLEANER::removeDuplicatesOfTrack(), SCH_SHEET::RemovePin(), FOOTPRINT_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::RemoveStruct(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SCREEN::ReplaceWires(), PCB_BASE_FRAME::ResetTextSize(), SCH_EDIT_FRAME::ReSizeSheet(), BOARD_COMMIT::Revert(), SCH_TEXT::Rotate(), 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::SaveWireImage(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SELECTION_TOOL::select(), SELECTION_TOOL::selectable(), SCH_SCREEN::SelectBlockItems(), PCB_EDIT_FRAME::SelectHighLight(), 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_JUNCTION::SwapData(), SCH_NO_CONNECT::SwapData(), PCB_TARGET::SwapData(), SCH_BITMAP::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(), AR_MATRIX::TraceSegmentPcb(), TraceSegmentPcb(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_LABEL_EDITOR::TransferDataToWindow(), SELECTION_TOOL::unhighlight(), SCH_SHEET_PATH::UpdateAllScreenReferences(), SCH_TEXT::UpdateDanglingState(), POINT_EDITOR::updateItem(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), SCH_BUS_ENTRY_BASE::ViewGetLayers(), TRACK::Visit(), GERBER_DRAW_ITEM::Visit(), EDA_ITEM::Visit(), SCH_SHEET::Visit(), and SCH_COMPONENT::Visit().

202  {
203  return m_StructType;
204  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:163
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, MARKER_PCB, KIGFX::WORKSHEET_VIEWITEM, 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 265 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().

266 {
267  // Basic fallback
268  return BOX2I( VECTOR2I( GetBoundingBox().GetOrigin() ),
269  VECTOR2I( GetBoundingBox().GetSize() ) );
270 }
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:520
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
virtual void KIGFX::VIEW_ITEM::ViewDraw ( int  aLayer,
VIEW aView 
) const
inlinevirtualinherited

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

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

Parameters
aLayercurrent drawing layer
aViewpointer to the VIEW device we are drawing on

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

Definition at line 116 of file view_item.h.

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, SCH_SHEET, EDIT_POINTS, VIA, LIB_PART, BOARD_ITEM, GERBER_DRAW_ITEM, TRACK, TEXTE_MODULE, LIB_ITEM, LIB_ALIAS, ZONE_CONTAINER, SCH_ITEM, LIB_FIELD, SCH_COMPONENT, MARKER_PCB, KIGFX::WORKSHEET_VIEWITEM, SCH_BITMAP, ROUTER_PREVIEW_ITEM, SCH_BUS_ENTRY_BASE, LIB_TEXT, KIGFX::ORIGIN_VIEWITEM, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM, SCH_NO_CONNECT, SCH_JUNCTION, BRIGHT_BOX, SCH_MARKER, KIGFX::RATSNEST_VIEWITEM, and KIGFX::PREVIEW::RULER_ITEM.

Definition at line 273 of file base_struct.cpp.

Referenced by EDA_ITEM::Sort().

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

>

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 394 of file gerber_file_image.cpp.

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

Referenced by GBR_LAYOUT::Visit().

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

Member Data Documentation

bool GERBER_FILE_IMAGE::m_360Arc_enbl
wxString GERBER_FILE_IMAGE::m_AperFunction

Definition at line 172 of file gerber_file_image.h.

Referenced by ExecuteRS274XCommand(), and RemoveAttribute().

D_CODE* GERBER_FILE_IMAGE::m_Aperture_List[TOOLS_MAX_COUNT]
private

Dcode (Aperture) List for this layer (max 999)

Definition at line 109 of file gerber_file_image.h.

Referenced by GERBER_FILE_IMAGE(), GetDCODE(), GetDCODEOrCreate(), GetDcodesCount(), InitToolTable(), and ~GERBER_FILE_IMAGE().

APERTURE_MACRO_SET GERBER_FILE_IMAGE::m_aperture_macros

a collection of APERTURE_MACROS, sorted by name

Definition at line 168 of file gerber_file_image.h.

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

int GERBER_FILE_IMAGE::m_ArcRadius

Definition at line 157 of file gerber_file_image.h.

Referenced by ReadXYCoord(), and ResetDefaultValues().

int GERBER_FILE_IMAGE::m_CommandState

Definition at line 152 of file gerber_file_image.h.

Referenced by ReadRS274XCommand(), and ResetDefaultValues().

std::map<wxString, int> GERBER_FILE_IMAGE::m_ComponentsList
FILE* GERBER_FILE_IMAGE::m_Current_File
int GERBER_FILE_IMAGE::m_Current_Tool
wxPoint GERBER_FILE_IMAGE::m_CurrentPos

Definition at line 154 of file gerber_file_image.h.

Referenced by Execute_DCODE_Command(), ReadXYCoord(), and ResetDefaultValues().

bool GERBER_FILE_IMAGE::m_Exposure
private

whether an aperture macro tool is flashed on or off

Definition at line 110 of file gerber_file_image.h.

Referenced by Execute_DCODE_Command(), Execute_G_Command(), and ResetDefaultValues().

STATUS_FLAGS EDA_ITEM::m_Flags
protectedinherited

Flag bits for editing and other uses.

Definition at line 178 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_PIN::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().

wxSize GERBER_FILE_IMAGE::m_FmtLen
wxSize GERBER_FILE_IMAGE::m_FmtScale
bool EDA_ITEM::m_forceVisible
protectedinherited

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

Definition at line 175 of file base_struct.h.

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

GERBER_LAYER GERBER_FILE_IMAGE::m_GBRLayerParams
private

Definition at line 112 of file gerber_file_image.h.

Referenced by ResetDefaultValues().

bool GERBER_FILE_IMAGE::m_Has_DCode
int GERBER_FILE_IMAGE::m_hasNegativeItems
private

Definition at line 180 of file gerber_file_image.h.

Referenced by HasNegativeItems(), and ResetDefaultValues().

wxPoint GERBER_FILE_IMAGE::m_IJPos

Definition at line 156 of file gerber_file_image.h.

Referenced by Execute_DCODE_Command(), ReadIJCoord(), and ResetDefaultValues().

bool GERBER_FILE_IMAGE::m_ImageJustifyXCenter

Definition at line 131 of file gerber_file_image.h.

Referenced by DisplayImageInfo(), ExecuteRS274XCommand(), and ResetDefaultValues().

bool GERBER_FILE_IMAGE::m_ImageJustifyYCenter

Definition at line 132 of file gerber_file_image.h.

Referenced by DisplayImageInfo(), ExecuteRS274XCommand(), and ResetDefaultValues().

wxString GERBER_FILE_IMAGE::m_ImageName
bool GERBER_FILE_IMAGE::m_InUse
bool GERBER_FILE_IMAGE::m_IsVisible
bool GERBER_FILE_IMAGE::m_IsX2_file
int GERBER_FILE_IMAGE::m_Iterpolation
int GERBER_FILE_IMAGE::m_Last_Pen_Command

Definition at line 151 of file gerber_file_image.h.

Referenced by Execute_DCODE_Command(), and ResetDefaultValues().

LAST_EXTRA_ARC_DATA_TYPE GERBER_FILE_IMAGE::m_LastArcDataType

Definition at line 158 of file gerber_file_image.h.

Referenced by ReadIJCoord(), ReadXYCoord(), and ResetDefaultValues().

int GERBER_FILE_IMAGE::m_LineNum
DHEAD* EDA_ITEM::m_List
protectedinherited

which DLIST I am on.

Definition at line 169 of file base_struct.h.

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

double GERBER_FILE_IMAGE::m_LocalRotation
wxString GERBER_FILE_IMAGE::m_MD5_value

Definition at line 127 of file gerber_file_image.h.

Referenced by ExecuteRS274XCommand(), and ResetDefaultValues().

wxArrayString GERBER_FILE_IMAGE::m_messagesList
private

Definition at line 179 of file gerber_file_image.h.

bool GERBER_FILE_IMAGE::m_MirrorA
bool GERBER_FILE_IMAGE::m_MirrorB
GBR_NETLIST_METADATA GERBER_FILE_IMAGE::m_NetAttributeDict
std::map<wxString, int> GERBER_FILE_IMAGE::m_NetnamesList
bool GERBER_FILE_IMAGE::m_NoTrailingZeros
wxPoint GERBER_FILE_IMAGE::m_Offset
wxString GERBER_FILE_IMAGE::m_PartString

Definition at line 128 of file gerber_file_image.h.

Referenced by ExecuteRS274XCommand(), and ResetDefaultValues().

bool GERBER_FILE_IMAGE::m_PolygonFillMode
int GERBER_FILE_IMAGE::m_PolygonFillModeState
COLOR4D GERBER_FILE_IMAGE::m_PositiveDrawColor

Definition at line 121 of file gerber_file_image.h.

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

wxPoint GERBER_FILE_IMAGE::m_PreviousPos

Definition at line 155 of file gerber_file_image.h.

Referenced by Execute_DCODE_Command(), and ResetDefaultValues().

bool GERBER_FILE_IMAGE::m_Relative
wxRealPoint GERBER_FILE_IMAGE::m_Scale
bool GERBER_FILE_IMAGE::m_SwapAxis
timestamp_t EDA_ITEM::m_TimeStamp
protectedinherited
EDA_ITEM* EDA_ITEM::Pback
protectedinherited

previous in linked list

Definition at line 168 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: