KiCad PCB EDA Suite
GERBER_DRAW_ITEM Class Reference

#include <gerber_draw_item.h>

Inheritance diagram for GERBER_DRAW_ITEM:
EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 GERBER_DRAW_ITEM (GERBER_FILE_IMAGE *aGerberparams)
 
 ~GERBER_DRAW_ITEM ()
 
GERBER_DRAW_ITEMNext () const
 
GERBER_DRAW_ITEMBack () const
 
void SetNetAttributes (const GBR_NETLIST_METADATA &aNetAttributes)
 
const GBR_NETLIST_METADATAGetNetAttributes () const
 
int GetLayer () const
 Function GetLayer returns the layer this item is on. More...
 
bool GetLayerPolarity () const
 
bool GetTextD_CodePrms (int &aSize, wxPoint &aPos, double &aOrientation)
 Returns the best size and orientation to display the D_Code on screen. More...
 
bool GetTextD_CodePrms (double &aSize, VECTOR2D &aPos, double &aOrientation)
 Returns the best size and orientation to display the D_Code in GAL aOrientation is returned in radians. More...
 
bool HasNegativeItems ()
 Function HasNegativeItems. More...
 
void SetLayerParameters ()
 Function SetLayerParameters Initialize parameters from Image and Layer parameters found in the gerber file: m_UnitsMetric, m_MirrorA, m_MirrorB, m_DrawScale, m_DrawOffset. More...
 
void SetLayerPolarity (bool aNegative)
 
void MoveAB (const wxPoint &aMoveVector)
 Function MoveAB move this object. More...
 
void MoveXY (const wxPoint &aMoveVector)
 Function MoveXY move this object. More...
 
const wxPoint GetPosition () const
 Function GetPosition returns the position of this object. More...
 
void SetPosition (const wxPoint &aPos)
 
wxPoint GetABPosition (const wxPoint &aXYPosition) const
 Function GetABPosition returns the image position of aPosition for this object. More...
 
VECTOR2I GetABPosition (const VECTOR2I &aXYPosition) const
 
wxPoint GetXYPosition (const wxPoint &aABPosition) const
 Function GetXYPosition returns the image position of aPosition for this object. More...
 
D_CODEGetDcodeDescr () const
 Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL. More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes. More...
 
void Draw (EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset, GBR_DISPLAY_OPTIONS *aDrawOptions)
 
void ConvertSegmentToPolygon ()
 Function ConvertSegmentToPolygon convert a line to an equivalent polygon. More...
 
void DrawGbrPoly (EDA_RECT *aClipBox, wxDC *aDC, COLOR4D aColor, const wxPoint &aOffset, bool aFilledShape)
 Function DrawGbrPoly a helper function used to draw the polygon stored in m_PolyCorners. More...
 
int Shape () const
 
void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
wxString ShowGBRShape () const
 
bool HitTest (const wxPoint &aRefPos) const override
 Function HitTest tests if the given wxPoint is within the bounds of this object. More...
 
bool HitTest (const EDA_RECT &aRefArea) const
 Function HitTest (overloaded) tests if the given wxRect intersect this object. More...
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
void UnLink ()
 Function UnLink detaches this object from its owner. More...
 
void DeleteStructure ()
 Function DeleteStructure deletes this object after UnLink()ing it from its owner. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 
virtual const BOX2I ViewBBox () const override
 
virtual unsigned int ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 
SEARCH_RESULT Visit (INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
 > More...
 
virtual wxString GetSelectMenuText (EDA_UNITS_T aUnits) const override
 > More...
 
BITMAP_DEF GetMenuImage () const override
 > More...
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
EDA_ITEMGetParent () const
 
DHEADGetList () const
 
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 EDA_ITEMClone () const
 Function Clone creates a duplicate of this item with linked list members set to NULL. 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 void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. 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

bool m_UnitsMetric
 
int m_Shape
 
wxPoint m_Start
 
wxPoint m_End
 
wxPoint m_ArcCentre
 
SHAPE_POLY_SET m_Polygon
 
wxSize m_Size
 
bool m_Flashed
 
int m_DCode
 
GERBER_FILE_IMAGEm_GerberImageFile
 

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

void SetNext (EDA_ITEM *aNext)
 
void SetBack (EDA_ITEM *aBack)
 

Private Attributes

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

Detailed Description

Definition at line 68 of file gerber_draw_item.h.

Constructor & Destructor Documentation

GERBER_DRAW_ITEM::GERBER_DRAW_ITEM ( GERBER_FILE_IMAGE aGerberparams)

Definition at line 44 of file gerber_draw_item.cpp.

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

44  :
46 {
47  m_GerberImageFile = aGerberImageFile;
49  m_Flashed = false;
50  m_DCode = 0;
51  m_UnitsMetric = false;
52  m_LayerNegative = false;
53  m_swapAxis = false;
54  m_mirrorA = false;
55  m_mirrorB = false;
56  m_drawScale.x = m_drawScale.y = 1.0;
57  m_lyrRotation = 0;
58 
59  if( m_GerberImageFile )
61 }
void SetLayerParameters()
Function SetLayerParameters Initialize parameters from Image and Layer parameters found in the gerber...
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
GERBER_FILE_IMAGE * m_GerberImageFile
wxRealPoint m_drawScale
GERBER_DRAW_ITEM::~GERBER_DRAW_ITEM ( )

Definition at line 64 of file gerber_draw_item.cpp.

65 {
66 }

Member Function Documentation

GERBER_DRAW_ITEM* GERBER_DRAW_ITEM::Back ( ) const
inline

Definition at line 122 of file gerber_draw_item.h.

122 { return static_cast<GERBER_DRAW_ITEM*>( Pback ); }
EDA_ITEM * Pback
previous in linked list
Definition: base_struct.h:168
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 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.
void GERBER_DRAW_ITEM::ConvertSegmentToPolygon ( )

Function ConvertSegmentToPolygon convert a line to an equivalent polygon.

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

Definition at line 596 of file gerber_draw_item.cpp.

References SHAPE_POLY_SET::Append(), delta, SHAPE_POLY_SET::Iterate(), m_End, m_Polygon, m_Size, m_Start, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::RemoveAllContours(), wxPoint::x, and wxPoint::y.

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

597 {
600 
601  wxPoint start = m_Start;
602  wxPoint end = m_End;
603 
604  // make calculations more easy if ensure start.x < end.x
605  // (only 2 quadrants to consider)
606  if( start.x > end.x )
607  std::swap( start, end );
608 
609  // calculate values relative to start point:
610  wxPoint delta = end - start;
611 
612  // calculate corners for the first quadrant only (delta.x and delta.y > 0 )
613  // currently, delta.x already is > 0.
614  // make delta.y > 0
615  bool change = delta.y < 0;
616 
617  if( change )
618  delta.y = -delta.y;
619 
620  // Now create the full polygon.
621  // Due to previous changes, the shape is always something like
622  // 3 4
623  // 2 5
624  // 1 6
625  wxPoint corner;
626  corner.x -= m_Size.x/2;
627  corner.y -= m_Size.y/2;
628  wxPoint close = corner;
629  m_Polygon.Append( VECTOR2I( corner ) ); // Lower left corner, start point (1)
630  corner.y += m_Size.y;
631  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, start point (2)
632 
633  if( delta.x || delta.y)
634  {
635  corner += delta;
636  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, end point (3)
637  }
638 
639  corner.x += m_Size.x;
640  m_Polygon.Append( VECTOR2I( corner ) ); // upper right corner, end point (4)
641  corner.y -= m_Size.y;
642  m_Polygon.Append( VECTOR2I( corner ) ); // lower right corner, end point (5)
643 
644  if( delta.x || delta.y )
645  {
646  corner -= delta;
647  m_Polygon.Append( VECTOR2I( corner ) ); // lower left corner, start point (6)
648  }
649 
650  m_Polygon.Append( VECTOR2I( close ) ); // close the shape
651 
652  // Create final polygon:
653  for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
654  {
655  if( change )
656  ( *it ).y = -( *it ).y;
657 
658  *it += start;
659  }
660 }
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Function Iterate returns an object to iterate through the points of the polygons between aFirst and a...
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
SHAPE_POLY_SET m_Polygon
static const int delta[8][2]
Definition: solve.cpp:112
int NewOutline()
Creates a new empty polygon in the set and returns its index
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
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) ...
void GERBER_DRAW_ITEM::DeleteStructure ( )
inline

Function DeleteStructure deletes this object after UnLink()ing it from its owner.

Definition at line 304 of file gerber_draw_item.h.

305  {
306  UnLink();
307  delete this;
308  }
void UnLink()
Function UnLink detaches this object from its owner.
void GERBER_DRAW_ITEM::Draw ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
GR_DRAWMODE  aDrawMode,
const wxPoint aOffset,
GBR_DISPLAY_OPTIONS aDrawOptions 
)

Definition at line 453 of file gerber_draw_item.cpp.

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

455 {
456  // used when a D_CODE is not found. default D_CODE to draw a flashed item
457  static D_CODE dummyD_CODE( 0 );
458  bool isFilled;
459  int radius;
460  int halfPenWidth;
461  static bool show_err;
462  D_CODE* d_codeDescr = GetDcodeDescr();
463 
464  if( d_codeDescr == NULL )
465  d_codeDescr = &dummyD_CODE;
466 
468 
469  if( ( aDrawMode & GR_HIGHLIGHT ) && !( aDrawMode & GR_AND ) )
470  color.SetToLegacyHighlightColor();
471 
472  /* isDark is true if flash is positive and should use a drawing
473  * color other than the background color, else use the background color
474  * when drawing so that an erasure happens.
475  */
477 
478  if( !isDark )
479  {
480  // draw in background color ("negative" color)
481  color = aDrawOptions->m_NegativeDrawColor;
482  }
483 
484  GRSetDrawMode( aDC, aDrawMode );
485 
486  isFilled = aDrawOptions->m_DisplayLinesFill;
487 
488  switch( m_Shape )
489  {
490  case GBR_POLYGON:
491  isFilled = aDrawOptions->m_DisplayPolygonsFill;
492 
493  if( !isDark )
494  isFilled = true;
495 
496  DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled );
497  break;
498 
499  case GBR_CIRCLE:
500  radius = KiROUND( GetLineLength( m_Start, m_End ) );
501 
502  halfPenWidth = m_Size.x >> 1;
503 
504  if( !isFilled )
505  {
506  // draw the border of the pen's path using two circles, each as narrow as possible
507  GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
508  radius - halfPenWidth, 0, color );
509  GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
510  radius + halfPenWidth, 0, color );
511  }
512  else // Filled mode
513  {
514  GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
515  radius, m_Size.x, color );
516  }
517  break;
518 
519  case GBR_ARC:
520  // Currently, arcs plotted with a rectangular aperture are not supported.
521  // a round pen only is expected.
522 
523 #if 0 // for arc debug only
524  GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
526  GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_End ),
528 #endif
529 
530  if( !isFilled )
531  {
532  GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
534  0, color );
535  }
536  else
537  {
538  GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
540  m_Size.x, color );
541  }
542 
543  break;
544 
545  case GBR_SPOT_CIRCLE:
546  case GBR_SPOT_RECT:
547  case GBR_SPOT_OVAL:
548  case GBR_SPOT_POLY:
549  case GBR_SPOT_MACRO:
550  isFilled = aDrawOptions->m_DisplayFlashedItemsFill;
551  d_codeDescr->DrawFlashedShape( this, aPanel->GetClipBox(), aDC, color,
552  m_Start, isFilled );
553  break;
554 
555  case GBR_SEGMENT:
556  /* Plot a line from m_Start to m_End.
557  * Usually, a round pen is used, but some gerber files use a rectangular pen
558  * In fact, any aperture can be used to plot a line.
559  * currently: only a square pen is handled (I believe using a polygon gives a strange plot).
560  */
561  if( d_codeDescr->m_Shape == APT_RECT )
562  {
563  if( m_Polygon.OutlineCount() == 0 )
565 
566  DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled );
567  }
568  else
569  {
570  if( !isFilled )
571  {
572  GRCSegm( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
573  GetABPosition( m_End ), m_Size.x, color );
574  }
575  else
576  {
577  GRFilledSegment( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
578  GetABPosition( m_End ), m_Size.x, color );
579  }
580  }
581 
582  break;
583 
584  default:
585  if( !show_err )
586  {
587  wxMessageBox( wxT( "Trace_Segment() type error" ) );
588  show_err = true;
589  }
590 
591  break;
592  }
593 }
COLOR4D GetPositiveDrawColor() const
void DrawGbrPoly(EDA_RECT *aClipBox, wxDC *aDC, COLOR4D aColor, const wxPoint &aOffset, bool aFilledShape)
Function DrawGbrPoly a helper function used to draw the polygon stored in m_PolyCorners.
bool m_DisplayPolygonsFill
Option to draw polygons (filled/sketch)
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Function GetLineLength returns the length of a line segment defined by aPointA and aPointB...
Definition: trigo.h:191
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:223
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
APERTURE_T m_Shape
shape ( Line, rectangle, circle , oval .. )
Definition: dcode.h:95
int color
Definition: DXF_plotter.cpp:62
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, COLOR4D Color)
Definition: gr_basic.cpp:415
virtual EDA_RECT * GetClipBox()
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:52
bool m_DisplayLinesFill
Option to draw line items (filled/sketch)
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
COLOR4D m_NegativeDrawColor
The color used to draw negative objects, usually the background color, but not always, when negative objects must be visible.
bool m_DisplayFlashedItemsFill
Option to draw flashed items (filled/sketch)
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:285
void ConvertSegmentToPolygon()
Function ConvertSegmentToPolygon convert a line to an equivalent polygon.
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void DrawFlashedShape(GERBER_DRAW_ITEM *aParent, EDA_RECT *aClipBox, wxDC *aDC, COLOR4D aColor, wxPoint aShapePos, bool aFilledShape)
Function DrawFlashedShape Draw the dcode shape for flashed items.
Definition: dcode.cpp:154
void GRFilledSegment(EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
Definition: gr_basic.cpp:526
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:755
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Function GetABPosition returns the image position of aPosition for this object.
GERBER_FILE_IMAGE * m_GerberImageFile
void GRArc1(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int xc, int yc, COLOR4D Color)
Definition: gr_basic.cpp:799
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
void GERBER_DRAW_ITEM::DrawGbrPoly ( EDA_RECT aClipBox,
wxDC *  aDC,
COLOR4D  aColor,
const wxPoint aOffset,
bool  aFilledShape 
)

Function DrawGbrPoly a helper function used to draw the polygon stored in m_PolyCorners.

Definition at line 663 of file gerber_draw_item.cpp.

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

Referenced by Draw().

668 {
669  std::vector<wxPoint> points;
670  SHAPE_LINE_CHAIN& poly = m_Polygon.Outline( 0 );
671  int pointCount = poly.PointCount() - 1;
672 
673  points.reserve( pointCount );
674 
675  for( int ii = 0; ii < pointCount; ii++ )
676  {
677  wxPoint p( poly.Point( ii ).x, poly.Point( ii ).y );
678  points[ii] = p + aOffset;
679  points[ii] = GetABPosition( points[ii] );
680  }
681 
682  GRClosedPoly( aClipBox, aDC, pointCount, &points[0], aFilledShape, aColor, aColor );
683 }
int PointCount() const
Function PointCount()
SHAPE_POLY_SET m_Polygon
void GRClosedPoly(EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, COLOR4D Color, COLOR4D BgColor)
Function GRClosedPoly draws a closed polygon onto the drawing context aDC and optionally fills and/or...
Definition: gr_basic.cpp:711
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
Class SHAPE_LINE_CHAIN.
VECTOR2I & Point(int aIndex)
Function Point()
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Function GetABPosition returns the image position of aPosition for this object.
wxPoint GERBER_DRAW_ITEM::GetABPosition ( const wxPoint aXYPosition) const

Function GetABPosition returns the image position of aPosition for this object.

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

Parameters
aXYPosition= position in X,Y gerber axis
Returns
const wxPoint - The given position in plotter A,B axis.

Definition at line 155 of file gerber_draw_item.cpp.

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

Referenced by KIGFX::GERBVIEW_PAINTER::draw(), Draw(), AM_PRIMITIVE::DrawBasicShape(), D_CODE::DrawFlashedPolygon(), D_CODE::DrawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), DrawGbrPoly(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), APERTURE_MACRO::GetApertureMacroShape(), GetBoundingBox(), GetTextD_CodePrms(), and HitTest().

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

Definition at line 210 of file gerber_draw_item.h.

References VECTOR2< T >::x, and VECTOR2< T >::y.

211  {
212  return VECTOR2I( GetABPosition( wxPoint( aXYPosition.x, aXYPosition.y ) ) );
213  }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Function GetABPosition returns the image position of aPosition for this object.
const EDA_RECT GERBER_DRAW_ITEM::GetBoundingBox ( ) const
overridevirtual

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 from EDA_ITEM.

Definition at line 286 of file gerber_draw_item.cpp.

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

Referenced by HitTest(), and ViewBBox().

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

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 282 of file gerber_draw_item.h.

Referenced by HitTest().

283  {
284  return wxT( "GERBER_DRAW_ITEM" );
285  }
D_CODE * GERBER_DRAW_ITEM::GetDcodeDescr ( ) const

Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.

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

Definition at line 274 of file gerber_draw_item.cpp.

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

Referenced by AM_PRIMITIVE::ConvertShapeToPolygon(), KIGFX::GERBVIEW_PAINTER::draw(), Draw(), KIGFX::GERBVIEW_PAINTER::drawApertureMacro(), AM_PRIMITIVE::DrawBasicShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), fillFlashedGBRITEM(), GetBoundingBox(), KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), GetMsgPanelInfo(), AM_PRIMITIVE::GetShapeDim(), GetTextD_CodePrms(), GERBVIEW_CONTROL::HighlightControl(), HitTest(), AM_PRIMITIVE::IsAMPrimitiveExposureOn(), GERBVIEW_FRAME::OnRightClick(), GERBVIEW_FRAME::Process_Special_Functions(), ShowGBRShape(), and ViewGetLOD().

275 {
276  if( (m_DCode < FIRST_DCODE) || (m_DCode > LAST_DCODE) )
277  return NULL;
278 
279  if( m_GerberImageFile == NULL )
280  return NULL;
281 
283 }
D_CODE * GetDCODE(int aDCODE) const
Function GetDCODE returns a pointer to the D_CODE within this GERBER for the given aDCODE...
#define LAST_DCODE
Definition: dcode.h:72
#define FIRST_DCODE
Definition: dcode.h:71
GERBER_FILE_IMAGE * m_GerberImageFile
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_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::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
int GERBER_DRAW_ITEM::GetLayer ( ) const

Function GetLayer returns the layer this item is on.

Definition at line 82 of file gerber_draw_item.cpp.

References m_GerberImageFile, and GERBER_FILE_IMAGE::m_GraphicLayer.

Referenced by GetMsgPanelInfo(), GetSelectMenuText(), HitTest(), and ViewGetLayers().

83 {
84  // returns the layer this item is on, or 0 if the m_GerberImageFile is NULL.
86 }
GERBER_FILE_IMAGE * m_GerberImageFile
bool GERBER_DRAW_ITEM::GetLayerPolarity ( ) const
inline
DHEAD* EDA_ITEM::GetList ( ) const
inlineinherited
BITMAP_DEF GERBER_DRAW_ITEM::GetMenuImage ( ) const
overridevirtual

>

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 from EDA_ITEM.

Definition at line 766 of file gerber_draw_item.cpp.

References GBR_ARC, GBR_CIRCLE, GBR_POLYGON, GBR_SEGMENT, GBR_SPOT_CIRCLE, GBR_SPOT_MACRO, GBR_SPOT_OVAL, GBR_SPOT_POLY, GBR_SPOT_RECT, m_Flashed, and m_Shape.

767 {
768  if( m_Flashed )
769  return pad_xpm;
770 
771  switch( m_Shape )
772  {
773  case GBR_SEGMENT:
774  case GBR_ARC:
775  case GBR_CIRCLE:
776  return add_line_xpm;
777 
778  case GBR_SPOT_OVAL:
779  case GBR_SPOT_CIRCLE:
780  case GBR_SPOT_RECT:
781  case GBR_SPOT_POLY:
782  case GBR_SPOT_MACRO:
783  // should be handles by m_Flashed == true
784  return pad_xpm;
785 
786  case GBR_POLYGON:
787  return add_graphical_polygon_xpm;
788  }
789 
790  return info_xpm;
791 }
void GERBER_DRAW_ITEM::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtual

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 from EDA_ITEM.

Definition at line 686 of file gerber_draw_item.cpp.

References BLUE, DARKCYAN, DARKGREEN, DARKRED, GBR_NETLIST_METADATA::GBR_NETINFO_CMP, GBR_NETLIST_METADATA::GBR_NETINFO_NET, GBR_NETLIST_METADATA::GBR_NETINFO_PAD, GBR_NETLIST_METADATA::GBR_NETINFO_UNSPECIFIED, GetChars(), GetDcodeDescr(), GERBER_FILE_IMAGE_LIST::GetDisplayName(), GERBER_FILE_IMAGE_LIST::GetImagesList(), GetLayer(), D_CODE::m_AperFunction, GBR_NETLIST_METADATA::m_Cmpref, m_DCode, m_LayerNegative, m_lyrRotation, m_mirrorA, m_mirrorB, GBR_NETLIST_METADATA::m_NetAttribType, m_netAttributes, GBR_NETLIST_METADATA::m_Netname, GBR_NETLIST_METADATA::m_Padname, m_swapAxis, RED, and ShowGBRShape().

Referenced by GERBVIEW_FRAME::Locate(), and GERBVIEW_FRAME::SetCurItem().

687 {
688  wxString msg;
689  wxString text;
690 
691  msg = ShowGBRShape();
692  aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) );
693 
694  // Display D_Code value with its attributes:
695  msg.Printf( _( "D Code %d" ), m_DCode );
696  D_CODE* apertDescr = GetDcodeDescr();
697 
698  if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
699  text = _( "No attribute" );
700  else
701  text = apertDescr->m_AperFunction;
702 
703  aList.push_back( MSG_PANEL_ITEM( msg, text, RED ) );
704 
705  // Display graphic layer name
707  aList.push_back( MSG_PANEL_ITEM( _( "Graphic Layer" ), msg, DARKGREEN ) );
708 
709  // Display item rotation
710  // The full rotation is Image rotation + m_lyrRotation
711  // but m_lyrRotation is specific to this object
712  // so we display only this parameter
713  msg.Printf( wxT( "%f" ), m_lyrRotation );
714  aList.push_back( MSG_PANEL_ITEM( _( "Rotation" ), msg, BLUE ) );
715 
716  // Display item polarity (item specific)
717  msg = m_LayerNegative ? _("Clear") : _("Dark");
718  aList.push_back( MSG_PANEL_ITEM( _( "Polarity" ), msg, BLUE ) );
719 
720  // Display mirroring (item specific)
721  msg.Printf( wxT( "A:%s B:%s" ),
722  m_mirrorA ? _("Yes") : _("No"),
723  m_mirrorB ? _("Yes") : _("No"));
724  aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), msg, DARKRED ) );
725 
726  // Display AB axis swap (item specific)
727  msg = m_swapAxis ? wxT( "A=Y B=X" ) : wxT( "A=X B=Y" );
728  aList.push_back( MSG_PANEL_ITEM( _( "AB axis" ), msg, DARKRED ) );
729 
730  // Display net info, if exists
732  return;
733 
734  // Build full net info:
735  wxString net_msg;
736  wxString cmp_pad_msg;
737 
739  {
740  net_msg = _( "Net:" );
741  net_msg << " ";
742 
743  if( m_netAttributes.m_Netname.IsEmpty() )
744  net_msg << "<no net name>";
745  else
746  net_msg << m_netAttributes.m_Netname;
747  }
748 
750  {
751  cmp_pad_msg.Printf( _( "Cmp: %s; Pad: %s" ),
754  }
755 
757  {
758  cmp_pad_msg = _( "Cmp:" );
759  cmp_pad_msg << " " << m_netAttributes.m_Cmpref;
760  }
761 
762  aList.push_back( MSG_PANEL_ITEM( net_msg, cmp_pad_msg, DARKCYAN ) );
763 }
Definition: colors.h:57
print info associated to a component (TO.C attribute)
const wxString GetDisplayName(int aIdx, bool aNameOnly=false)
wxString m_Cmpref
the component reference parent of the data
Definition: colors.h:54
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
int GetLayer() const
Function GetLayer returns the layer this item is on.
wxString m_Padname
for a flashed pad: the pad name ((TO.P attribute)
wxString ShowGBRShape() const
static GERBER_FILE_IMAGE_LIST & GetImagesList()
GBR_NETLIST_METADATA m_netAttributes
the string given by a TO attribute set in aperture (dcode).
wxString m_Netname
for items associated to a net: the netname
Definition: colors.h:60
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE ...
Definition: dcode.h:105
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
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
print info associated to a flashed pad (TO.P attribute)
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
print info associated to a net (TO.N attribute)
int m_NetAttribType
the type of net info (used to define the gerber string to create)
const GBR_NETLIST_METADATA& GERBER_DRAW_ITEM::GetNetAttributes ( ) const
inline

Definition at line 125 of file gerber_draw_item.h.

References GetLayer().

Referenced by KIGFX::GERBVIEW_RENDER_SETTINGS::GetColor(), GERBVIEW_CONTROL::HighlightControl(), GERBVIEW_FRAME::OnRightClick(), GERBVIEW_FRAME::Process_Special_Functions(), and HIGHLIGHT_MENU::update().

125 { return m_netAttributes; }
GBR_NETLIST_METADATA m_netAttributes
the string given by a TO attribute set in aperture (dcode).
const wxPoint GERBER_DRAW_ITEM::GetPosition ( ) const
inline

Function GetPosition returns the position of this object.

Returns
const wxPoint& - The position of this object. This function exists mainly to satisfy the virtual GetPosition() in parent class

Definition at line 197 of file gerber_draw_item.h.

197 { return m_Start; }
wxString GERBER_DRAW_ITEM::GetSelectMenuText ( EDA_UNITS_T  aUnits) const
overridevirtual

>

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 from EDA_ITEM.

Definition at line 985 of file gerber_draw_item.cpp.

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

986 {
987  wxString layerName;
988 
990 
991  return wxString::Format( _( "%s (D%d) on layer %d: %s" ),
992  ShowGBRShape(),
993  m_DCode,
994  GetLayer() + 1,
995  layerName );
996 }
const wxString GetDisplayName(int aIdx, bool aNameOnly=false)
int GetLayer() const
Function GetLayer returns the layer this item is on.
wxString ShowGBRShape() const
static GERBER_FILE_IMAGE_LIST & GetImagesList()
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
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 HitTest().

253 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:164
bool GERBER_DRAW_ITEM::GetTextD_CodePrms ( int &  aSize,
wxPoint aPos,
double &  aOrientation 
)

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

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

Definition at line 89 of file gerber_draw_item.cpp.

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

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

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

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

Definition at line 138 of file gerber_draw_item.cpp.

References DECIDEG2RAD(), and GetTextD_CodePrms().

139 {
140  // aOrientation is returned in radians
141  int size;
142  wxPoint pos;
143 
144  if( ! GetTextD_CodePrms( size, pos, aOrientation ) )
145  return false;
146 
147  aPos = pos;
148  aSize = (double) size;
149  aOrientation = DECIDEG2RAD( aOrientation );
150 
151  return true;
152 }
bool GetTextD_CodePrms(int &aSize, wxPoint &aPos, double &aOrientation)
Returns the best size and orientation to display the D_Code on screen.
double DECIDEG2RAD(double deg)
Definition: trigo.h:203
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_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::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
wxPoint GERBER_DRAW_ITEM::GetXYPosition ( const wxPoint aABPosition) const

Function GetXYPosition returns the image position of aPosition for this object.

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

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

Definition at line 185 of file gerber_draw_item.cpp.

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

Referenced by HitTest(), and MoveAB().

186 {
187  // do the inverse transform made by GetABPosition
188  wxPoint xyPos = aABPosition;
189 
190  if( m_mirrorA )
191  xyPos.x = -xyPos.x;
192 
193  if( !m_mirrorB )
194  xyPos.y = -xyPos.y;
195 
196  double rotation = m_lyrRotation * 10 + m_GerberImageFile->m_ImageRotation * 10;
197 
198  if( rotation )
199  RotatePoint( &xyPos, rotation );
200 
201  xyPos.x = KiROUND( xyPos.x / m_drawScale.x );
202  xyPos.y = KiROUND( xyPos.y / m_drawScale.y );
204 
205  if( m_swapAxis )
206  std::swap( xyPos.x, xyPos.y );
207 
208  return xyPos - m_GerberImageFile->m_ImageJustifyOffset;
209 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:120
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:216
GERBER_FILE_IMAGE * m_GerberImageFile
wxRealPoint m_drawScale
bool GERBER_DRAW_ITEM::HasNegativeItems ( )

Function HasNegativeItems.

Returns
true if this item or at least one shape (when using aperture macros 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 444 of file gerber_draw_item.cpp.

References m_GerberImageFile, GERBER_FILE_IMAGE::m_ImageNegative, and m_LayerNegative.

445 {
447 
448  // if isClear is true, this item has negative shape
449  return isClear;
450 }
GERBER_FILE_IMAGE * m_GerberImageFile
bool GERBER_DRAW_ITEM::HitTest ( const wxPoint aRefPos) const
overridevirtual

Function HitTest tests if the given wxPoint is within the bounds of this object.

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

Reimplemented from EDA_ITEM.

Definition at line 794 of file gerber_draw_item.cpp.

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

Referenced by GERBVIEW_FRAME::Block_Move().

795 {
796  // In case the item has a very tiny width defined, allow it to be selected
797  const int MIN_HIT_TEST_RADIUS = Millimeter2iu( 0.01 );
798 
799  // calculate aRefPos in XY gerber axis:
800  wxPoint ref_pos = GetXYPosition( aRefPos );
801 
802  SHAPE_POLY_SET poly;
803 
804  switch( m_Shape )
805  {
806  case GBR_POLYGON:
807  poly = m_Polygon;
808  return poly.Contains( VECTOR2I( ref_pos ), 0 );
809 
810  case GBR_SPOT_POLY:
811  poly = GetDcodeDescr()->m_Polygon;
812  poly.Move( m_Start );
813  return poly.Contains( VECTOR2I( ref_pos ), 0 );
814 
815  case GBR_SPOT_RECT:
816  return GetBoundingBox().Contains( aRefPos );
817 
818  case GBR_ARC:
819  {
820  double radius = GetLineLength( m_Start, m_ArcCentre );
821  VECTOR2D test_radius = VECTOR2D( ref_pos ) - VECTOR2D( m_ArcCentre );
822 
823  int size = ( ( m_Size.x < MIN_HIT_TEST_RADIUS ) ? MIN_HIT_TEST_RADIUS
824  : m_Size.x );
825 
826  // Are we close enough to the radius?
827  bool radius_hit = ( std::fabs( test_radius.EuclideanNorm() - radius) < size );
828 
829  if( radius_hit )
830  {
831  // Now check that we are within the arc angle
832 
833  VECTOR2D start = VECTOR2D( m_Start ) - VECTOR2D( m_ArcCentre );
835 
836  double start_angle = NormalizeAngleRadiansPos( start.Angle() );
837  double end_angle = NormalizeAngleRadiansPos( end.Angle() );
838 
839  if( m_Start == m_End )
840  {
841  start_angle = 0;
842  end_angle = 2 * M_PI;
843  }
844  else if( end_angle < start_angle )
845  {
846  end_angle += 2 * M_PI;
847  }
848 
849  double test_angle = NormalizeAngleRadiansPos( test_radius.Angle() );
850 
851  return ( test_angle > start_angle && test_angle < end_angle );
852  }
853 
854  return false;
855  }
856 
857  case GBR_SPOT_MACRO:
858  // Aperture macro polygons are already in absolute coordinates
859  auto p = GetDcodeDescr()->GetMacro()->GetApertureMacroShape( this, m_Start );
860  for( int i = 0; i < p->OutlineCount(); ++i )
861  {
862  if( p->Contains( VECTOR2I( aRefPos ), i ) )
863  return true;
864  }
865  return false;
866  }
867 
868  // TODO: a better analyze of the shape (perhaps create a D_CODE::HitTest for flashed items)
869  int radius = std::min( m_Size.x, m_Size.y ) >> 1;
870 
871  if( radius < MIN_HIT_TEST_RADIUS )
872  radius = MIN_HIT_TEST_RADIUS;
873 
874  if( m_Flashed )
875  return HitTestPoints( m_Start, ref_pos, radius );
876  else
877  return TestSegmentHit( ref_pos, m_Start, m_End, radius );
878 }
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Function GetLineLength returns the length of a line segment defined by aPointA and aPointB...
Definition: trigo.h:191
bool Contains(const wxPoint &aPoint) const
Function Contains.
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, bool aIgnoreHoles=false) const
Returns true if a given subpolygon contains the point aP.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
double NormalizeAngleRadiansPos(double Angle)
Definition: trigo.h:265
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
SHAPE_POLY_SET m_Polygon
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
double Angle() const
Function Angle computes the angle of the vector.
Definition: vector2d.h:306
SHAPE_POLY_SET * GetApertureMacroShape(const GERBER_DRAW_ITEM *aParent, wxPoint aShapePos)
Function GetApertureMacroShape Calculate the primitive shape for flashed items.
T EuclideanNorm() const
Destructor.
Definition: vector2d.h:292
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
void Move(const VECTOR2I &aVector) override
Class SHAPE_POLY_SET.
bool HitTestPoints(const wxPoint &pointA, const wxPoint &pointB, double threshold)
Test, if two points are near each other.
Definition: trigo.h:150
size_t i
Definition: json11.cpp:597
SHAPE_POLY_SET m_Polygon
Definition: dcode.h:107
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Function TestSegmentHit test for hit on line segment i.e.
Definition: trigo.cpp:122
wxPoint GetXYPosition(const wxPoint &aABPosition) const
Function GetXYPosition returns the image position of aPosition for this object.
#define min(a, b)
Definition: auxiliary.h:85
bool GERBER_DRAW_ITEM::HitTest ( const EDA_RECT aRefArea) const

Function HitTest (overloaded) tests if the given wxRect intersect this object.

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

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

Definition at line 881 of file gerber_draw_item.cpp.

References EDA_RECT::Contains(), GetABPosition(), GetClass(), GetLayer(), EDA_ITEM::GetStatus(), m_End, EDA_ITEM::m_Flags, m_Shape, m_Size, and m_Start.

882 {
883  wxPoint pos = GetABPosition( m_Start );
884 
885  if( aRefArea.Contains( pos ) )
886  return true;
887 
888  pos = GetABPosition( m_End );
889 
890  if( aRefArea.Contains( pos ) )
891  return true;
892 
893  return false;
894 }
bool Contains(const wxPoint &aPoint) const
Function Contains.
wxPoint GetABPosition(const wxPoint &aXYPosition) const
Function GetABPosition returns the image position of aPosition for this object.
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(), GERBER_FILE_IMAGE::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
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.
void GERBER_DRAW_ITEM::MoveAB ( const wxPoint aMoveVector)

Function MoveAB move this object.

Parameters
aMoveVector- the move vector for this object.

Definition at line 414 of file gerber_draw_item.cpp.

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

Referenced by GERBVIEW_FRAME::Block_Move().

415 {
416  wxPoint xymove = GetXYPosition( aMoveVector );
417 
418  m_Start += xymove;
419  m_End += xymove;
420  m_ArcCentre += xymove;
421 
422  if( m_Polygon.OutlineCount() > 0 )
423  {
424  for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
425  *it += xymove;
426  }
427 }
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Function Iterate returns an object to iterate through the points of the polygons between aFirst and a...
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET m_Polygon
wxPoint GetXYPosition(const wxPoint &aABPosition) const
Function GetXYPosition returns the image position of aPosition for this object.
void GERBER_DRAW_ITEM::MoveXY ( const wxPoint aMoveVector)

Function MoveXY move this object.

Parameters
aMoveVector- the move vector for this object, in XY gerber axis.

Definition at line 430 of file gerber_draw_item.cpp.

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

Referenced by GERBER_FILE_IMAGE::StepAndRepeatItem().

431 {
432  m_Start += aMoveVector;
433  m_End += aMoveVector;
434  m_ArcCentre += aMoveVector;
435 
436  if( m_Polygon.OutlineCount() > 0 )
437  {
438  for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
439  *it += aMoveVector;
440  }
441 }
ITERATOR Iterate(int aFirst, int aLast, bool aIterateHoles=false)
Function Iterate returns an object to iterate through the points of the polygons between aFirst and a...
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET m_Polygon
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 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_DRAW_ITEM::SetBack ( EDA_ITEM aBack)
inlineprivate

Definition at line 74 of file gerber_draw_item.h.

74 { 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_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_TARGET_PROPERTIES::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 GERBER_DRAW_ITEM::SetLayerParameters ( )

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

Definition at line 212 of file gerber_draw_item.cpp.

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

Referenced by GERBER_DRAW_ITEM().

213 {
215  m_swapAxis = m_GerberImageFile->m_SwapAxis; // false if A = X, B = Y;
216 
217  // true if A =Y, B = Y
218  m_mirrorA = m_GerberImageFile->m_MirrorA; // true: mirror / axe A
219  m_mirrorB = m_GerberImageFile->m_MirrorB; // true: mirror / axe B
220  m_drawScale = m_GerberImageFile->m_Scale; // A and B scaling factor
221  m_layerOffset = m_GerberImageFile->m_Offset; // Offset from OF command
222 
223  // Rotation from RO command:
226 }
GERBER_FILE_IMAGE * m_GerberImageFile
GERBER_LAYER & GetLayerParams()
Function GetLayerParams.
wxRealPoint m_drawScale
void GERBER_DRAW_ITEM::SetLayerPolarity ( bool  aNegative)
inline

Definition at line 172 of file gerber_draw_item.h.

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

173  {
174  m_LayerNegative = aNegative;
175  }
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 GERBER_DRAW_ITEM::SetNetAttributes ( const GBR_NETLIST_METADATA aNetAttributes)

Definition at line 69 of file gerber_draw_item.cpp.

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

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

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

Definition at line 73 of file gerber_draw_item.h.

73 { Pnext = aNext; }
EDA_ITEM * Pnext
next in linked list
Definition: base_struct.h:167
void GERBER_DRAW_ITEM::SetPosition ( const wxPoint aPos)
inline

Definition at line 198 of file gerber_draw_item.h.

198 { m_Start = aPos; }
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
int GERBER_DRAW_ITEM::Shape ( ) const
inline

Definition at line 254 of file gerber_draw_item.h.

254 { return m_Shape; }
wxString GERBER_DRAW_ITEM::ShowGBRShape ( ) const

Definition at line 229 of file gerber_draw_item.cpp.

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

Referenced by GetMsgPanelInfo(), and GetSelectMenuText().

230 {
231  switch( m_Shape )
232  {
233  case GBR_SEGMENT:
234  return _( "Line" );
235 
236  case GBR_ARC:
237  return _( "Arc" );
238 
239  case GBR_CIRCLE:
240  return _( "Circle" );
241 
242  case GBR_SPOT_OVAL:
243  return wxT( "spot_oval" );
244 
245  case GBR_SPOT_CIRCLE:
246  return wxT( "spot_circle" );
247 
248  case GBR_SPOT_RECT:
249  return wxT( "spot_rect" );
250 
251  case GBR_SPOT_POLY:
252  return wxT( "spot_poly" );
253 
254  case GBR_POLYGON:
255  return wxT( "polygon" );
256 
257  case GBR_SPOT_MACRO:
258  {
259  wxString name = wxT( "apt_macro" );
260  D_CODE* dcode = GetDcodeDescr();
261 
262  if( dcode && dcode->GetMacro() )
263  name << wxT(" ") << dcode->GetMacro()->name;
264 
265  return name;
266  }
267 
268  default:
269  return wxT( "??" );
270  }
271 }
wxString name
The name of the aperture macro.
Definition: am_primitive.h:165
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
Class D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
const char * name
Definition: DXF_plotter.cpp:61
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157
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; }
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(), 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
void GERBER_DRAW_ITEM::UnLink ( )
inline

Function UnLink detaches this object from its owner.

Definition at line 291 of file gerber_draw_item.h.

292  {
294  wxASSERT( list );
295 
296  if( list )
297  list->Remove( this );
298  }
DHEAD * GetList() const
Definition: base_struct.h:212
const BOX2I GERBER_DRAW_ITEM::ViewBBox ( ) const
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 927 of file gerber_draw_item.cpp.

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

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

928 {
929  EDA_RECT bbox = GetBoundingBox();
930  return BOX2I( VECTOR2I( bbox.GetOrigin() ),
931  VECTOR2I( bbox.GetSize() ) );
932 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:520
const wxPoint GetOrigin() const
Definition: eda_rect.h:112
const wxSize GetSize() const
Definition: eda_rect.h:101
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
VECTOR2< int > VECTOR2I
Definition: vector2d.h:587
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
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 GERBER_DRAW_ITEM::ViewGetLayers ( int  aLayers[],
int &  aCount 
) const
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 918 of file gerber_draw_item.cpp.

References GERBER_DCODE_LAYER, GERBER_DRAW_LAYER, and GetLayer().

919 {
920  aCount = 2;
921 
922  aLayers[0] = GERBER_DRAW_LAYER( GetLayer() );
923  aLayers[1] = GERBER_DCODE_LAYER( aLayers[0] );
924 }
#define GERBER_DCODE_LAYER(x)
int GetLayer() const
Function GetLayer returns the layer this item is on.
#define GERBER_DRAW_LAYER(x)
unsigned int GERBER_DRAW_ITEM::ViewGetLOD ( int  aLayer,
KIGFX::VIEW aView 
) const
overridevirtual

Reimplemented from KIGFX::VIEW_ITEM.

Definition at line 935 of file gerber_draw_item.cpp.

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

936 {
937  // DCodes will be shown only if zoom is appropriate:
938  // Returns the level of detail of the item.
939  // A level of detail (LOD) is the minimal VIEW scale that
940  // is sufficient for an item to be shown on a given layer.
941  if( IsDCodeLayer( aLayer ) )
942  {
943  int size = 0;
944 
945  switch( m_Shape )
946  {
947  case GBR_SPOT_MACRO:
949  break;
950 
951  case GBR_ARC:
952  size = GetLineLength( m_Start, m_ArcCentre );
953  break;
954 
955  default:
956  size = m_Size.x;
957  }
958 
959  // the level of details is chosen experimentally, to show
960  // only a readable text:
961  const int level = Millimeter2iu( 500 );
962  return ( level / ( size + 1 ) );
963  }
964 
965  // Other layers are shown without any conditions
966  return 0;
967 }
bool IsDCodeLayer(int aLayer)
double GetLineLength(const wxPoint &aPointA, const wxPoint &aPointB)
Function GetLineLength returns the length of a line segment defined by aPointA and aPointB...
Definition: trigo.h:191
D_CODE * GetDcodeDescr() const
Function GetDcodeDescr returns the GetDcodeDescr of this object, or NULL.
EDA_RECT GetBoundingBox() const
Returns the bounding box of the shape.
Definition: am_primitive.h:231
int GetWidth() const
Definition: eda_rect.h:117
APERTURE_MACRO * GetMacro() const
Definition: dcode.h:157
SEARCH_RESULT GERBER_DRAW_ITEM::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 970 of file gerber_draw_item.cpp.

References SEARCH_CONTINUE, SEARCH_QUIT, and EDA_ITEM::Type().

971 {
972  KICAD_T stype = *scanTypes;
973 
974  // If caller wants to inspect my type
975  if( stype == Type() )
976  {
977  if( SEARCH_QUIT == inspector( this, testData ) )
978  return SEARCH_QUIT;
979  }
980 
981  return SEARCH_CONTINUE;
982 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78

Member Data Documentation

wxRealPoint GERBER_DRAW_ITEM::m_drawScale
private
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(), HitTest(), SCH_COMPONENT::HitTest(), LIB_ITEM::InEditMode(), EDA_ITEM::initVars(), SCH_ITEM::IsConnected(), SCH_LINE::Move(), EDA_ITEM::operator=(), SCH_COMPONENT::SCH_COMPONENT(), LIB_PIN::SetConversion(), LIB_PIN::SetLength(), LIB_PIN::SetName(), LIB_PIN::SetNameTextSize(), LIB_PIN::SetNumberTextSize(), LIB_PIN::SetOrientation(), LIB_PIN::SetPartNumber(), LIB_PIN::SetPinPosition(), LIB_PIN::SetShape(), LIB_PIN::SetType(), and LIB_PIN::SetVisible().

bool EDA_ITEM::m_forceVisible
protectedinherited

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

Definition at line 175 of file base_struct.h.

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

bool GERBER_DRAW_ITEM::m_LayerNegative
private
wxPoint GERBER_DRAW_ITEM::m_layerOffset
private

Definition at line 111 of file gerber_draw_item.h.

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

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_DRAW_ITEM::m_lyrRotation
private
bool GERBER_DRAW_ITEM::m_mirrorA
private
bool GERBER_DRAW_ITEM::m_mirrorB
private
GBR_NETLIST_METADATA GERBER_DRAW_ITEM::m_netAttributes
private

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

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

Definition at line 113 of file gerber_draw_item.h.

Referenced by GetMsgPanelInfo(), and SetNetAttributes().

bool GERBER_DRAW_ITEM::m_swapAxis
private
timestamp_t EDA_ITEM::m_TimeStamp
protectedinherited
bool GERBER_DRAW_ITEM::m_UnitsMetric

Definition at line 78 of file gerber_draw_item.h.

Referenced by GERBER_DRAW_ITEM(), and SetLayerParameters().

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: