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 (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 () const override
 Function GetSelectMenuText returns the text to display to be used in the selection clarification context menu when multiple items are found at the current cursor position. More...
 
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
 
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 BITMAP_DEF GetMenuImage () const
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData, wxPoint *aFindLocation)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
bool Replace (wxFindReplaceData &aSearchData, wxString &aText)
 Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual 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 43 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().

43  :
45 {
46  m_GerberImageFile = aGerberImageFile;
48  m_Flashed = false;
49  m_DCode = 0;
50  m_UnitsMetric = false;
51  m_LayerNegative = false;
52  m_swapAxis = false;
53  m_mirrorA = false;
54  m_mirrorB = false;
55  m_drawScale.x = m_drawScale.y = 1.0;
56  m_lyrRotation = 0;
57 
58  if( m_GerberImageFile )
60 }
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:65
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:162
GERBER_FILE_IMAGE * m_GerberImageFile
wxRealPoint m_drawScale
GERBER_DRAW_ITEM::~GERBER_DRAW_ITEM ( )

Definition at line 63 of file gerber_draw_item.cpp.

64 {
65 }

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:176
void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 244 of file base_struct.h.

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

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

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

Definition at line 265 of file base_struct.h.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_Move_Pad(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), Abort_Zone_Move_Corner_Or_Outlines(), AbortMoveAndEditTarget(), abortMoveBitmap(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), AbortPinMove(), SCH_SCREEN::addConnectedItemsToBlock(), SCH_EDIT_FRAME::addCurrentItemToList(), PNS_KICAD_IFACE::AddItem(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_SCREEN::ClearAnnotation(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearHighlighted(), DRAG_LIST::ClearList(), ClearMarkItems(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), MWAVE::CreateMicrowaveInductor(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment_Edge(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Zone(), EraseDragList(), PCB_EDIT_FRAME::Exchange_Module(), ExitSheet(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), MarkItemsInBloc(), MirrorX(), MirrorY(), moveBitmap(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnRotateItem(), SCH_EDIT_FRAME::OnSelectUnit(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), SCH_FIELD::Place(), PCB_EDIT_FRAME::Place_DrawItem(), FOOTPRINT_EDIT_FRAME::Place_EdgeMod(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCBNEW_CONTROL::placeBoardItems(), PCB_EDIT_FRAME::PlaceDimensionText(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_EDIT_FRAME::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_BASE_FRAME::PlaceTexteModule(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), BOARD_COMMIT::Revert(), PCB_BASE_FRAME::Rotate_Module(), RotateListOfItems(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::savePin(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), SCH_EDIT_FRAME::SetRepeatItem(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

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

Definition at line 243 of file base_struct.h.

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

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

Function Clone creates a duplicate of this item with linked list members set to NULL.

The default version will return NULL in release builds and likely crash the program. In debug builds, a warning message indicating the derived class has not implemented cloning. This really should be a pure virtual function. Due to the fact that there are so many objects derived from EDA_ITEM, the decision was made to return NULL until all the objects derived from EDA_ITEM implement cloning. Once that happens, this function should be made pure.

Returns
A clone of the item.

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

Definition at line 124 of file base_struct.cpp.

References EDA_ITEM::GetClass().

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

125 {
126  wxCHECK_MSG( false, NULL, wxT( "Clone not implemented in derived class " ) + GetClass() +
127  wxT( ". Bad programmer!" ) );
128 }
virtual wxString GetClass() const =0
Function GetClass returns the class name.
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 595 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().

596 {
599 
600  wxPoint start = m_Start;
601  wxPoint end = m_End;
602 
603  // make calculations more easy if ensure start.x < end.x
604  // (only 2 quadrants to consider)
605  if( start.x > end.x )
606  std::swap( start, end );
607 
608  // calculate values relative to start point:
609  wxPoint delta = end - start;
610 
611  // calculate corners for the first quadrant only (delta.x and delta.y > 0 )
612  // currently, delta.x already is > 0.
613  // make delta.y > 0
614  bool change = delta.y < 0;
615 
616  if( change )
617  delta.y = -delta.y;
618 
619  // Now create the full polygon.
620  // Due to previous changes, the shape is always something like
621  // 3 4
622  // 2 5
623  // 1 6
624  wxPoint corner;
625  corner.x -= m_Size.x/2;
626  corner.y -= m_Size.y/2;
627  wxPoint close = corner;
628  m_Polygon.Append( VECTOR2I( corner ) ); // Lower left corner, start point (1)
629  corner.y += m_Size.y;
630  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, start point (2)
631 
632  if( delta.x || delta.y)
633  {
634  corner += delta;
635  m_Polygon.Append( VECTOR2I( corner ) ); // upper left corner, end point (3)
636  }
637 
638  corner.x += m_Size.x;
639  m_Polygon.Append( VECTOR2I( corner ) ); // upper right corner, end point (4)
640  corner.y -= m_Size.y;
641  m_Polygon.Append( VECTOR2I( corner ) ); // lower right corner, end point (5)
642 
643  if( delta.x || delta.y )
644  {
645  corner -= delta;
646  m_Polygon.Append( VECTOR2I( corner ) ); // lower left corner, start point (6)
647  }
648 
649  m_Polygon.Append( VECTOR2I( close ) ); // close the shape
650 
651  // Create final polygon:
652  for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
653  {
654  if( change )
655  ( *it ).y = -( *it ).y;
656 
657  *it += start;
658  }
659 }
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:589
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 452 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().

454 {
455  // used when a D_CODE is not found. default D_CODE to draw a flashed item
456  static D_CODE dummyD_CODE( 0 );
457  bool isFilled;
458  int radius;
459  int halfPenWidth;
460  static bool show_err;
461  D_CODE* d_codeDescr = GetDcodeDescr();
462 
463  if( d_codeDescr == NULL )
464  d_codeDescr = &dummyD_CODE;
465 
467 
468  if( ( aDrawMode & GR_HIGHLIGHT ) && !( aDrawMode & GR_AND ) )
469  color.SetToLegacyHighlightColor();
470 
471  /* isDark is true if flash is positive and should use a drawing
472  * color other than the background color, else use the background color
473  * when drawing so that an erasure happens.
474  */
476 
477  if( !isDark )
478  {
479  // draw in background color ("negative" color)
480  color = aDrawOptions->m_NegativeDrawColor;
481  }
482 
483  GRSetDrawMode( aDC, aDrawMode );
484 
485  isFilled = aDrawOptions->m_DisplayLinesFill;
486 
487  switch( m_Shape )
488  {
489  case GBR_POLYGON:
490  isFilled = aDrawOptions->m_DisplayPolygonsFill;
491 
492  if( !isDark )
493  isFilled = true;
494 
495  DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled );
496  break;
497 
498  case GBR_CIRCLE:
499  radius = KiROUND( GetLineLength( m_Start, m_End ) );
500 
501  halfPenWidth = m_Size.x >> 1;
502 
503  if( !isFilled )
504  {
505  // draw the border of the pen's path using two circles, each as narrow as possible
506  GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
507  radius - halfPenWidth, 0, color );
508  GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
509  radius + halfPenWidth, 0, color );
510  }
511  else // Filled mode
512  {
513  GRCircle( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
514  radius, m_Size.x, color );
515  }
516  break;
517 
518  case GBR_ARC:
519  // Currently, arcs plotted with a rectangular aperture are not supported.
520  // a round pen only is expected.
521 
522 #if 0 // for arc debug only
523  GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
525  GRLine( aPanel->GetClipBox(), aDC, GetABPosition( m_End ),
527 #endif
528 
529  if( !isFilled )
530  {
531  GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
533  0, color );
534  }
535  else
536  {
537  GRArc1( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
539  m_Size.x, color );
540  }
541 
542  break;
543 
544  case GBR_SPOT_CIRCLE:
545  case GBR_SPOT_RECT:
546  case GBR_SPOT_OVAL:
547  case GBR_SPOT_POLY:
548  case GBR_SPOT_MACRO:
549  isFilled = aDrawOptions->m_DisplayFlashedItemsFill;
550  d_codeDescr->DrawFlashedShape( this, aPanel->GetClipBox(), aDC, color,
551  m_Start, isFilled );
552  break;
553 
554  case GBR_SEGMENT:
555  /* Plot a line from m_Start to m_End.
556  * Usually, a round pen is used, but some gerber files use a rectangular pen
557  * In fact, any aperture can be used to plot a line.
558  * currently: only a square pen is handled (I believe using a polygon gives a strange plot).
559  */
560  if( d_codeDescr->m_Shape == APT_RECT )
561  {
562  if( m_Polygon.OutlineCount() == 0 )
564 
565  DrawGbrPoly( aPanel->GetClipBox(), aDC, color, aOffset, isFilled );
566  }
567  else
568  {
569  if( !isFilled )
570  {
571  GRCSegm( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
572  GetABPosition( m_End ), m_Size.x, color );
573  }
574  else
575  {
576  GRFilledSegment( aPanel->GetClipBox(), aDC, GetABPosition( m_Start ),
577  GetABPosition( m_End ), m_Size.x, color );
578  }
579  }
580 
581  break;
582 
583  default:
584  if( !show_err )
585  {
586  wxMessageBox( wxT( "Trace_Segment() type error" ) );
587  show_err = true;
588  }
589 
590  break;
591  }
592 }
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:318
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
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:510
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)
EDA_RECT * GetClipBox()
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:380
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:621
void GRCircle(EDA_RECT *ClipBox, wxDC *DC, int xc, int yc, int r, int width, COLOR4D Color)
Definition: gr_basic.cpp:850
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:894
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 662 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().

667 {
668  std::vector<wxPoint> points;
669  SHAPE_LINE_CHAIN& poly = m_Polygon.Outline( 0 );
670  int pointCount = poly.PointCount() - 1;
671 
672  points.reserve( pointCount );
673 
674  for( int ii = 0; ii < pointCount; ii++ )
675  {
676  wxPoint p( poly.Point( ii ).x, poly.Point( ii ).y );
677  points[ii] = p + aOffset;
678  points[ii] = GetABPosition( points[ii] );
679  }
680 
681  GRClosedPoly( aClipBox, aDC, pointCount, &points[0], aFilledShape, aColor, aColor );
682 }
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:806
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 154 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().

155 {
156  /* Note: RS274Xrevd_e is obscure about the order of transforms:
157  * For instance: Rotation must be made after or before mirroring ?
158  * Note: if something is changed here, GetYXPosition must reflect changes
159  */
160  wxPoint abPos = aXYPosition + m_GerberImageFile->m_ImageJustifyOffset;
161 
162  if( m_swapAxis )
163  std::swap( abPos.x, abPos.y );
164 
166  abPos.x = KiROUND( abPos.x * m_drawScale.x );
167  abPos.y = KiROUND( abPos.y * m_drawScale.y );
168  double rotation = m_lyrRotation * 10 + m_GerberImageFile->m_ImageRotation * 10;
169 
170  if( rotation )
171  RotatePoint( &abPos, -rotation );
172 
173  // Negate A axis if mirrored
174  if( m_mirrorA )
175  abPos.x = -abPos.x;
176 
177  // abPos.y must be negated when no mirror, because draw axis is top to bottom
178  if( !m_mirrorB )
179  abPos.y = -abPos.y;
180  return abPos;
181 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
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:589
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 285 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().

286 {
287  // return a rectangle which is (pos,dim) in nature. therefore the +1
288  EDA_RECT bbox( m_Start, wxSize( 1, 1 ) );
289  D_CODE* code = GetDcodeDescr();
290 
291  // TODO(JE) GERBER_DRAW_ITEM maybe should actually be a number of subclasses.
292  // Until/unless that is changed, we need to do different things depending on
293  // what is actually being represented by this GERBER_DRAW_ITEM.
294 
295  switch( m_Shape )
296  {
297  case GBR_POLYGON:
298  {
299  auto bb = m_Polygon.BBox();
300  bbox.Inflate( bb.GetWidth() / 2, bb.GetHeight() / 2 );
301  bbox.SetOrigin( bb.GetOrigin().x, bb.GetOrigin().y );
302  break;
303  }
304 
305  case GBR_CIRCLE:
306  {
307  double radius = GetLineLength( m_Start, m_End );
308  bbox.Inflate( radius, radius );
309  break;
310  }
311 
312  case GBR_ARC:
313  {
314  // Note: using a larger-than-necessary BB to simplify computation
315  double radius = GetLineLength( m_Start, m_ArcCentre );
316  bbox.Move( m_ArcCentre - m_Start );
317  bbox.Inflate( radius + m_Size.x, radius + m_Size.x );
318  break;
319  }
320 
321  case GBR_SPOT_CIRCLE:
322  {
323  if( code )
324  {
325  int radius = code->m_Size.x >> 1;
326  bbox.Inflate( radius, radius );
327  }
328  break;
329  }
330 
331  case GBR_SPOT_RECT:
332  {
333  if( code )
334  bbox.Inflate( code->m_Size.x / 2, code->m_Size.y / 2 );
335  break;
336  }
337 
338  case GBR_SPOT_OVAL:
339  {
340  if( code )
341  bbox.Inflate( code->m_Size.x, code->m_Size.y );
342  break;
343  }
344 
345  case GBR_SPOT_POLY:
346  {
347  if( code )
348  {
349  if( code->m_Polygon.OutlineCount() == 0 )
350  code->ConvertShapeToPolygon();
351 
352  bbox.Inflate( code->m_Polygon.BBox().GetWidth() / 2,
353  code->m_Polygon.BBox().GetHeight() / 2 );
354  }
355  break;
356  }
357  case GBR_SPOT_MACRO:
358  {
359  if( code )
360  {
361  // Update the shape drawings and the bounding box coordiantes:
362  code->GetMacro()->GetApertureMacroShape( this, m_Start );
363  // now the bounding box is valid:
364  bbox = code->GetMacro()->GetBoundingBox();
365  }
366  break;
367  }
368 
369  case GBR_SEGMENT:
370  {
371  if( code && code->m_Shape == APT_RECT )
372  {
373  if( m_Polygon.OutlineCount() > 0 )
374  {
375  auto bb = m_Polygon.BBox();
376  bbox.Inflate( bb.GetWidth() / 2, bb.GetHeight() / 2 );
377  bbox.SetOrigin( bb.GetOrigin().x, bb.GetOrigin().y );
378  }
379  }
380  else
381  {
382  int radius = ( m_Size.x + 1 ) / 2;
383 
384  int ymax = std::max( m_Start.y, m_End.y ) + radius;
385  int xmax = std::max( m_Start.x, m_End.x ) + radius;
386 
387  int ymin = std::min( m_Start.y, m_End.y ) - radius;
388  int xmin = std::min( m_Start.x, m_End.x ) - radius;
389 
390  bbox = EDA_RECT( wxPoint( xmin, ymin ), wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
391  }
392 
393  break;
394  }
395  default:
396  wxASSERT_MSG( false, wxT( "GERBER_DRAW_ITEM shape is unknown!" ) );
397  break;
398  }
399 
400  // calculate the corners coordinates in current gerber axis orientations
401  wxPoint org = GetABPosition( bbox.GetOrigin() );
402  wxPoint end = GetABPosition( bbox.GetEnd() );
403 
404  // Set the corners position:
405  bbox.SetOrigin( org );
406  bbox.SetEnd( end );
407  bbox.Normalize();
408 
409  return bbox;
410 }
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:185
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:186
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:266
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:198
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 273 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().

274 {
275  if( (m_DCode < FIRST_DCODE) || (m_DCode > LAST_DCODE) )
276  return NULL;
277 
278  if( m_GerberImageFile == NULL )
279  return NULL;
280 
282 }
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 266 of file base_struct.h.

References EDA_ITEM::m_Flags.

Referenced by AbortMoveAndEditTarget(), SCH_SCREEN::addConnectedItemsToBlock(), AddMenusForBitmap(), AddMenusForBusEntry(), AddMenusForComponent(), AddMenusForComponentField(), AddMenusForEditComponent(), AddMenusForGLabel(), AddMenusForHierchicalSheet(), AddMenusForHLabel(), AddMenusForLabel(), AddMenusForSheetPin(), AddMenusForText(), SCH_EDIT_FRAME::BeginSegment(), SCH_EDIT_FRAME::ChangeTextOrient(), Collect_TrackSegmentsToDrag(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_EDIT_FRAME::copySelectedItems(), LIB_EDIT_FRAME::CreatePin(), PCB_EDIT_FRAME::createPopUpMenuForFootprints(), PCB_EDIT_FRAME::createPopUpMenuForFpPads(), PCB_EDIT_FRAME::createPopUpMenuForFpTexts(), PCB_EDIT_FRAME::createPopUpMenuForTexts(), PCB_EDIT_FRAME::createPopupMenuForTracks(), PCB_EDIT_FRAME::createPopUpMenuForZones(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_EDIT_FRAME::DeleteItem(), SCH_EDIT_FRAME::DeleteItemsInList(), SCH_EDIT_FRAME::DeleteJunction(), BOARD::Draw(), PCB_EDIT_FRAME::Edit_TrackSegm_Width(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditImage(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_VIEW_FRAME::GeneralControl(), SCH_EDIT_FRAME::GeneralControl(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), InitialiseDragParameters(), EDA_DRAW_FRAME::isBusy(), Magnetize(), SCH_EDIT_FRAME::MirrorImage(), SCH_EDIT_FRAME::MirrorSheet(), moveBitmap(), SCH_EDIT_FRAME::OnAutoplaceFields(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), LIB_EDIT_FRAME::OnEditPin(), FOOTPRINT_EDIT_FRAME::OnHotKey(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyBeginRoute(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnLeftClick(), PCB_EDIT_FRAME::OnLeftClick(), FOOTPRINT_EDIT_FRAME::OnLeftDClick(), SCH_EDIT_FRAME::OnLeftDClick(), PCB_EDIT_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnMouseEvent(), SCH_EDIT_FRAME::OnMoveItem(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_EDIT_FRAME::OnOrient(), FOOTPRINT_EDIT_FRAME::OnRightClick(), GERBVIEW_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_EDIT_FRAME::OrientComponent(), PCBNEW_CONTROL::placeBoardItems(), PCB_EDIT_FRAME::PlaceTarget(), FOOTPRINT_EDIT_FRAME::PrepareItemForHotkey(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), TRACKS_CLEANER::removeDuplicatesOfTrack(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), SCH_EDIT_FRAME::RotateField(), SCH_EDIT_FRAME::RotateHierarchicalSheet(), SCH_EDIT_FRAME::RotateImage(), PCB_BASE_FRAME::RotateTextModule(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SCREEN::SelectBlockItems(), SCH_EDIT_FRAME::SetBusEntryShape(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), Show_Drag_Track_Segment_With_Cte_Slope(), Show_MoveNode(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

266 { return m_Flags; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
int GERBER_DRAW_ITEM::GetLayer ( ) const

Function GetLayer returns the layer this item is on.

Definition at line 81 of file gerber_draw_item.cpp.

References m_GerberImageFile, and GERBER_FILE_IMAGE::m_GraphicLayer.

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

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

Function GetMenuImage returns a pointer to an image to be used in menus.

The default version returns the right arrow image. Override this function to provide object specific menu images.

Returns
The menu image associated with the item.

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

Definition at line 281 of file base_struct.cpp.

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

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

282 {
283  return dummy_xpm;
284 }
static const BITMAP_OPAQUE dummy_xpm[1]
Definition: base_struct.cpp:57
void GERBER_DRAW_ITEM::GetMsgPanelInfo ( 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 685 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().

686 {
687  wxString msg;
688  wxString text;
689 
690  msg = ShowGBRShape();
691  aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) );
692 
693  // Display D_Code value with its attributes:
694  msg.Printf( _( "D Code %d" ), m_DCode );
695  D_CODE* apertDescr = GetDcodeDescr();
696 
697  if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
698  text = _( "No attribute" );
699  else
700  text = apertDescr->m_AperFunction;
701 
702  aList.push_back( MSG_PANEL_ITEM( msg, text, RED ) );
703 
704  // Display graphic layer name
706  aList.push_back( MSG_PANEL_ITEM( _( "Graphic Layer" ), msg, DARKGREEN ) );
707 
708  // Display item rotation
709  // The full rotation is Image rotation + m_lyrRotation
710  // but m_lyrRotation is specific to this object
711  // so we display only this parameter
712  msg.Printf( wxT( "%f" ), m_lyrRotation );
713  aList.push_back( MSG_PANEL_ITEM( _( "Rotation" ), msg, BLUE ) );
714 
715  // Display item polarity (item specific)
716  msg = m_LayerNegative ? _("Clear") : _("Dark");
717  aList.push_back( MSG_PANEL_ITEM( _( "Polarity" ), msg, BLUE ) );
718 
719  // Display mirroring (item specific)
720  msg.Printf( wxT( "A:%s B:%s" ),
721  m_mirrorA ? _("Yes") : _("No"),
722  m_mirrorB ? _("Yes") : _("No"));
723  aList.push_back( MSG_PANEL_ITEM( _( "Mirror" ), msg, DARKRED ) );
724 
725  // Display AB axis swap (item specific)
726  msg = m_swapAxis ? wxT( "A=Y B=X" ) : wxT( "A=X B=Y" );
727  aList.push_back( MSG_PANEL_ITEM( _( "AB axis" ), msg, DARKRED ) );
728 
729  // Display net info, if exists
731  return;
732 
733  // Build full net info:
734  wxString net_msg;
735  wxString cmp_pad_msg;
736 
738  {
739  net_msg = _( "Net:" );
740  net_msg << " ";
741 
742  if( m_netAttributes.m_Netname.IsEmpty() )
743  net_msg << "<no net name>";
744  else
745  net_msg << m_netAttributes.m_Netname;
746  }
747 
749  {
750  cmp_pad_msg.Printf( _( "Cmp: %s; Pad: %s" ),
753  }
754 
756  {
757  cmp_pad_msg = _( "Cmp:" );
758  cmp_pad_msg << " " << m_netAttributes.m_Cmpref;
759  }
760 
761  aList.push_back( MSG_PANEL_ITEM( net_msg, cmp_pad_msg, DARKCYAN ) );
762 }
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 ( ) 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 956 of file gerber_draw_item.cpp.

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

957 {
958  wxString text, layerName;
959 
961 
962  text.Printf( _( "%s (D%d) on layer %d: %s" ), ShowGBRShape(), m_DCode,
963  GetLayer() + 1, layerName );
964 
965  return text;
966 }
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()
STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 261 of file base_struct.h.

References EDA_ITEM::m_Status.

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

261 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:172
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 88 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().

89 {
90  // calculate the best size and orientation of the D_Code text
91 
92  if( m_DCode <= 0 )
93  return false; // No D_Code for this item
94 
95  if( m_Flashed || m_Shape == GBR_ARC )
96  {
97  aPos = m_Start;
98  }
99  else // it is a line:
100  {
101  aPos = ( m_Start + m_End) / 2;
102  }
103 
104  aPos = GetABPosition( aPos );
105 
106  int size; // the best size for the text
107 
108  if( GetDcodeDescr() )
109  size = GetDcodeDescr()->GetShapeDim( this );
110  else
111  size = std::min( m_Size.x, m_Size.y );
112 
113  aOrientation = TEXT_ANGLE_HORIZ;
114 
115  if( m_Flashed )
116  {
117  // A reasonable size for text is min_dim/3 because most of time this text has 3 chars.
118  aSize = size / 3;
119  }
120  else // this item is a line
121  {
123 
124  aOrientation = RAD2DECIDEG( atan2( (double)delta.y, (double)delta.x ) );
125  NORMALIZE_ANGLE_90( aOrientation );
126 
127  // A reasonable size for text is size/2 because text needs margin below and above it.
128  // a margin = size/4 seems good, expecting the line len is large enough to show 3 chars,
129  // that is the case most of time.
130  aSize = size / 2;
131  }
132 
133  return true;
134 }
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Definition: common.h:91
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 137 of file gerber_draw_item.cpp.

References DECIDEG2RAD(), and GetTextD_CodePrms().

138 {
139  // aOrientation is returned in radians
140  int size;
141  wxPoint pos;
142 
143  if( ! GetTextD_CodePrms( size, pos, aOrientation ) )
144  return false;
145 
146  aPos = pos;
147  aSize = (double) size;
148  aOrientation = DECIDEG2RAD( aOrientation );
149 
150  return true;
151 }
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
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 184 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().

185 {
186  // do the inverse transform made by GetABPosition
187  wxPoint xyPos = aABPosition;
188 
189  if( m_mirrorA )
190  xyPos.x = -xyPos.x;
191 
192  if( !m_mirrorB )
193  xyPos.y = -xyPos.y;
194 
195  double rotation = m_lyrRotation * 10 + m_GerberImageFile->m_ImageRotation * 10;
196 
197  if( rotation )
198  RotatePoint( &xyPos, rotation );
199 
200  xyPos.x = KiROUND( xyPos.x / m_drawScale.x );
201  xyPos.y = KiROUND( xyPos.y / m_drawScale.y );
203 
204  if( m_swapAxis )
205  std::swap( xyPos.x, xyPos.y );
206 
207  return xyPos - m_GerberImageFile->m_ImageJustifyOffset;
208 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
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 443 of file gerber_draw_item.cpp.

References m_GerberImageFile, GERBER_FILE_IMAGE::m_ImageNegative, and m_LayerNegative.

444 {
446 
447  // if isClear is true, this item has negative shape
448  return isClear;
449 }
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 765 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().

766 {
767  // In case the item has a very tiny width defined, allow it to be selected
768  const int MIN_HIT_TEST_RADIUS = Millimeter2iu( 0.01 );
769 
770  // calculate aRefPos in XY gerber axis:
771  wxPoint ref_pos = GetXYPosition( aRefPos );
772 
773  SHAPE_POLY_SET poly;
774 
775  switch( m_Shape )
776  {
777  case GBR_POLYGON:
778  poly = m_Polygon;
779  return poly.Contains( VECTOR2I( ref_pos ), 0 );
780 
781  case GBR_SPOT_POLY:
782  poly = GetDcodeDescr()->m_Polygon;
783  poly.Move( m_Start );
784  return poly.Contains( VECTOR2I( ref_pos ), 0 );
785 
786  case GBR_SPOT_RECT:
787  return GetBoundingBox().Contains( aRefPos );
788 
789  case GBR_ARC:
790  {
791  double radius = GetLineLength( m_Start, m_ArcCentre );
792  VECTOR2D test_radius = VECTOR2D( ref_pos ) - VECTOR2D( m_ArcCentre );
793 
794  int size = ( ( m_Size.x < MIN_HIT_TEST_RADIUS ) ? MIN_HIT_TEST_RADIUS
795  : m_Size.x );
796 
797  // Are we close enough to the radius?
798  bool radius_hit = ( std::fabs( test_radius.EuclideanNorm() - radius) < size );
799 
800  if( radius_hit )
801  {
802  // Now check that we are within the arc angle
803 
804  VECTOR2D start = VECTOR2D( m_Start ) - VECTOR2D( m_ArcCentre );
806 
807  double start_angle = NormalizeAngleRadiansPos( start.Angle() );
808  double end_angle = NormalizeAngleRadiansPos( end.Angle() );
809 
810  if( m_Start == m_End )
811  {
812  start_angle = 0;
813  end_angle = 2 * M_PI;
814  }
815  else if( end_angle < start_angle )
816  {
817  end_angle += 2 * M_PI;
818  }
819 
820  double test_angle = NormalizeAngleRadiansPos( test_radius.Angle() );
821 
822  return ( test_angle > start_angle && test_angle < end_angle );
823  }
824 
825  return false;
826  }
827 
828  case GBR_SPOT_MACRO:
829  // Aperture macro polygons are already in absolute coordinates
830  auto p = GetDcodeDescr()->GetMacro()->GetApertureMacroShape( this, m_Start );
831  for( int i = 0; i < p->OutlineCount(); ++i )
832  {
833  if( p->Contains( VECTOR2I( aRefPos ), i ) )
834  return true;
835  }
836  return false;
837  }
838 
839  // TODO: a better analyze of the shape (perhaps create a D_CODE::HitTest for flashed items)
840  int radius = std::min( m_Size.x, m_Size.y ) >> 1;
841 
842  if( radius < MIN_HIT_TEST_RADIUS )
843  radius = MIN_HIT_TEST_RADIUS;
844 
845  if( m_Flashed )
846  return HitTestPoints( m_Start, ref_pos, radius );
847  else
848  return TestSegmentHit( ref_pos, m_Start, m_End, radius );
849 }
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:589
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:308
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:294
VECTOR2< double > VECTOR2D
Definition: vector2d.h:588
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 852 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.

853 {
854  wxPoint pos = GetABPosition( m_Start );
855 
856  if( aRefArea.Contains( pos ) )
857  return true;
858 
859  pos = GetABPosition( m_End );
860 
861  if( aRefArea.Contains( pos ) )
862  return true;
863 
864  return false;
865 }
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 235 of file base_struct.h.

References BRIGHTENED.

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

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

Definition at line 234 of file base_struct.h.

References HIGHLIGHTED.

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

Definition at line 228 of file base_struct.h.

References IS_CHANGED.

Referenced by LIB_EDIT_FRAME::OnEditPin().

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

Definition at line 227 of file base_struct.h.

References IS_NEW.

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

227 { return m_Flags & IS_NEW; }
#define IS_NEW
New item, just created.
Definition: base_struct.h:109
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

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

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

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

Definition at line 455 of file base_struct.h.

References EDA_ITEM::operator<().

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

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

Definition at line 233 of file base_struct.h.

References IS_RESIZED.

Referenced by ExitSheet().

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

Definition at line 232 of file base_struct.h.

References SELECTED.

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

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

Definition at line 231 of file base_struct.h.

References IS_WIRE_IMAGE.

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

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

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

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

Definition at line 131 of file base_struct.cpp.

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

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

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

Function Matches compares the item against the search criteria in aSearchData.

The base class returns false since many of the objects derived from EDA_ITEM do not have any text to search.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
aFindLocationA pointer to a wxPoint object to store the location of matched item. The pointer can be NULL if it is not used.
Returns
True if the item's text matches the search criteria in aSearchData.

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

Definition at line 411 of file base_struct.h.

References EDA_ITEM::Replace().

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

412  {
413  return false;
414  }
bool EDA_ITEM::Matches ( const wxString &  aText,
wxFindReplaceData &  aSearchData 
)
protectedinherited

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

Parameters
aTextA reference to a wxString object containing the string to test.
aSearchDataThe criteria to search against.
Returns
True if aText matches the search criteria in aSearchData.

Definition at line 183 of file base_struct.cpp.

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

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

Function MoveAB move this object.

Parameters
aMoveVector- the move vector for this object.

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

414 {
415  wxPoint xymove = GetXYPosition( aMoveVector );
416 
417  m_Start += xymove;
418  m_End += xymove;
419  m_ArcCentre += xymove;
420 
421  if( m_Polygon.OutlineCount() > 0 )
422  {
423  for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
424  *it += xymove;
425  }
426 }
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 429 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().

430 {
431  m_Start += aMoveVector;
432  m_End += aMoveVector;
433  m_ArcCentre += aMoveVector;
434 
435  if( m_Polygon.OutlineCount() > 0 )
436  {
437  for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
438  *it += aMoveVector;
439  }
440 }
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 240 of file base_struct.cpp.

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

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

241 {
242  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
243  GetChars( GetClass() ) ) );
244 
245  return false;
246 }
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
wxString &  aText 
)
inherited

Helper function used in search and replace dialog Function Replace performs a text replace on aText using the find and replace criteria in aSearchData on items that support text find and replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aTextA reference to a wxString object containing the text to be replaced.
Returns
True if aText was modified, otherwise false.

Definition at line 210 of file base_struct.cpp.

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

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

211 {
212  wxCHECK_MSG( IsReplaceable(), false,
213  wxT( "Attempt to replace text in <" ) + GetClass() + wxT( "> item." ) );
214 
215  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
216 
217  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
218  aSearchData.GetFindString() :
219  aSearchData.GetFindString().Upper() );
220 
221  if( result == wxNOT_FOUND )
222  return false;
223 
224  wxString prefix = aText.Left( result );
225  wxString suffix;
226 
227  if( aSearchData.GetFindString().length() + result < aText.length() )
228  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
229 
230  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
231  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
232  GetChars( suffix ) );
233 
234  aText = prefix + aSearchData.GetReplaceString() + suffix;
235 
236  return true;
237 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:455
const wxChar *const traceFindReplace
Flag to enable find and replace debug tracing.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
virtual wxString GetClass() const =0
Function GetClass returns the class name.
virtual bool EDA_ITEM::Replace ( wxFindReplaceData &  aSearchData,
void *  aAuxData = NULL 
)
inlinevirtualinherited

Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace.

This function must be overridden for items that support text replace.

Parameters
aSearchDataA reference to a wxFindReplaceData object containing the search and replace criteria.
aAuxDataA pointer to optional data required for the search or NULL if not used.
Returns
True if the item text was modified, otherwise false.

Reimplemented in SCH_SHEET, SCH_SHEET_PIN, SCH_FIELD, and SCH_TEXT.

Definition at line 443 of file base_struct.h.

443 { return false; }
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:176
void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 240 of file base_struct.h.

References BRIGHTENED, and EDA_ITEM::SetFlags().

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

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

Definition at line 264 of file base_struct.h.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), SCH_SCREEN::addConnectedItemsToBlock(), PCB_BASE_FRAME::AddModuleToBoard(), AddSegmentToDragList(), PCBNEW_CONTROL::AppendBoard(), PCB_EDIT_FRAME::AppendBoardFile(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Change_Side_Module(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::copyBlockItems(), CopyMarkedItems(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), LIB_PART::CopySelectedItems(), LIB_EDIT_FRAME::copySelectedItems(), SCH_EDIT_FRAME::CreateBusBusEntry(), SCH_EDIT_FRAME::CreateBusWireEntry(), SCH_EDIT_FRAME::CreateNewImage(), SCH_EDIT_FRAME::CreateNewText(), LIB_EDIT_FRAME::CreatePin(), SCH_EDIT_FRAME::CreateSheet(), SCH_EDIT_FRAME::CreateSheetPin(), PCB_EDIT_FRAME::CreateTarget(), PCB_EDIT_FRAME::CreateTextePcb(), FOOTPRINT_EDIT_FRAME::CreateTextModule(), SCH_EDIT_FRAME::DeleteItem(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::FlipTextePcb(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_SCREEN::GetConnection(), PCB_BASE_FRAME::GlobalChange_PadSettings(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), PCB_BASE_FRAME::Import_Pad_Settings(), SCH_EDIT_FRAME::ImportSheetPin(), SCH_JUNCTION::IsSelectStateChanged(), SCH_NO_CONNECT::IsSelectStateChanged(), SCH_MARKER::IsSelectStateChanged(), SCH_BUS_ENTRY_BASE::IsSelectStateChanged(), SCH_BITMAP::IsSelectStateChanged(), SCH_LINE::IsSelectStateChanged(), SCH_TEXT::IsSelectStateChanged(), SCH_SHEET::IsSelectStateChanged(), SCH_COMPONENT::IsSelectStateChanged(), SCH_EDIT_FRAME::Load_Component(), SCH_SCREEN::MarkConnections(), MarkItemsInBloc(), moveBitmap(), SCH_EDIT_FRAME::MoveImage(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), LIB_EDIT_FRAME::OnEditPin(), TARGET_PROPERTIES_DIALOG_EDITOR::OnOkClick(), SCH_EDIT_FRAME::OnSelectUnit(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), PCB_EDIT_FRAME::Other_Layer_Route(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PrepareMoveItem(), LIB_EDIT_FRAME::Process_Special_Functions(), EDIT_TOOL::Properties(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_EDIT_FRAME::ReSizeSheet(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::Rotate_Texte_Pcb(), LIB_EDIT_FRAME::SaveCopyInUndoList(), SCH_SCREEN::SelectBlockItems(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), BLOCK_SELECTOR::SetFlags(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), LIB_EDIT_FRAME::StartMovePin(), PCB_BASE_FRAME::StartMoveTexteModule(), PCB_EDIT_FRAME::StartMoveTextePcb(), DIALOG_PCB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and UndrawAndMarkSegmentsToDrag().

264 { m_Flags |= aMask; }
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:186
void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible.

Parameters
aEnableTrue forces the item to be drawn. False uses the item's visibility setting to determine if the item is to be drawn.

Definition at line 276 of file base_struct.h.

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

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

Definition at line 239 of file base_struct.h.

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

239 { SetFlags( HIGHLIGHTED ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:264
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:132
void 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 211 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().

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

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

225 { m_List = aList; }
DHEAD * m_List
which DLIST I am on.
Definition: base_struct.h:177
void EDA_ITEM::SetModified ( )
inherited
void GERBER_DRAW_ITEM::SetNetAttributes ( const GBR_NETLIST_METADATA aNetAttributes)

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

69 {
70  m_netAttributes = aNetAttributes;
71 
74  m_GerberImageFile->m_ComponentsList.insert( std::make_pair( m_netAttributes.m_Cmpref, 0 ) );
75 
77  m_GerberImageFile->m_NetnamesList.insert( std::make_pair( m_netAttributes.m_Netname, 0 ) );
78 }
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:175
void EDA_ITEM::SetParent ( EDA_ITEM aParent)
inlineinherited

Definition at line 224 of file base_struct.h.

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

224 { m_Parent = aParent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:179
void 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 238 of file base_struct.h.

References SELECTED, and EDA_ITEM::SetFlags().

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

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

Definition at line 214 of file base_struct.h.

Referenced by PCB_BASE_FRAME::AddModuleToBoard(), BOARD_NETLIST_UPDATER::addNewComponent(), PCAD2KICAD::PCB_TEXT::AddToBoard(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_ARC::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), PCAD2KICAD::PCB_MODULE::AddToBoard(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::Begin_Zone(), SCH_EDIT_FRAME::CreateSheet(), Diagnose(), DuplicateItemsInList(), DuplicateStruct(), EDIT_TOOL::editFootprintInFpEditor(), PCB_EDIT_FRAME::Exchange_Module(), DIALOG_FOOTPRINT_BOARD_EDITOR::GotoModuleEditor(), EDA_ITEM::initVars(), BOARD::InsertArea(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadPCB_TARGET(), LEGACY_PLUGIN::loadPCB_TEXT(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), EDA_ITEM::operator=(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), PCB_PARSER::parseDIMENSION(), SCH_EDIT_FRAME::PasteListOfItems(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), BOARD::ReplaceNetlist(), SCH_SHEET::SCH_SHEET(), SCH_COMPONENT::SetTimeStamp(), SimilarLabelsDiagnose(), SwapItemData(), TestDuplicateSheetNames(), and DIALOG_ERC::TestErc().

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

Definition at line 237 of file base_struct.h.

References IS_WIRE_IMAGE, and EDA_ITEM::SetFlags().

Referenced by moveItemWithMouseCursor().

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

229 {
230  switch( m_Shape )
231  {
232  case GBR_SEGMENT:
233  return _( "Line" );
234 
235  case GBR_ARC:
236  return _( "Arc" );
237 
238  case GBR_CIRCLE:
239  return _( "Circle" );
240 
241  case GBR_SPOT_OVAL:
242  return wxT( "spot_oval" );
243 
244  case GBR_SPOT_CIRCLE:
245  return wxT( "spot_circle" );
246 
247  case GBR_SPOT_RECT:
248  return wxT( "spot_rect" );
249 
250  case GBR_SPOT_POLY:
251  return wxT( "spot_poly" );
252 
253  case GBR_POLYGON:
254  return wxT( "polygon" );
255 
256  case GBR_SPOT_MACRO:
257  {
258  wxString name = wxT( "apt_macro" );
259  D_CODE* dcode = GetDcodeDescr();
260 
261  if( dcode && dcode->GetMacro() )
262  name << wxT(" ") << dcode->GetMacro()->name;
263 
264  return name;
265  }
266 
267  default:
268  return wxT( "??" );
269  }
270 }
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 474 of file base_struct.h.

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

Referenced by PART_LIB::GetEntryTypePowerNames().

474 { return *aLeft < *aRight; }
KICAD_T EDA_ITEM::Type ( ) const
inlineinherited

Function Type()

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

Returns
KICAD_T - the type of object.

Definition at line 209 of file base_struct.h.

References EDA_ITEM::m_StructType.

Referenced by Abort_Move_ModuleOutline(), abortMoveBitmap(), abortMoveItem(), AbortPinMove(), MODULE::Add(), CN_CLUSTER::Add(), BOARD::Add(), CN_CONNECTIVITY_ALGO::Add(), PCB_EDIT_FRAME::Add45DegreeSegment(), SCH_SCREEN::addConnectedItemsToBlock(), POINT_EDITOR::addCorner(), POINT_EDITOR::addCornerCondition(), SCH_EDIT_FRAME::addCurrentItemToList(), AddMenusForComponent(), AddMenusForEditComponent(), SCH_SHEET::AddPin(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), PCB_EDIT_FRAME::Attribut_Track(), PCB_EDIT_FRAME::Autoroute(), PCB_EDIT_FRAME::Begin_Route(), SCH_EDIT_FRAME::BeginSegment(), PCB_EDIT_FRAME::Block_Delete(), PCB_EDIT_FRAME::Block_Duplicate(), PCB_EDIT_FRAME::Block_Flip(), PCB_EDIT_FRAME::Block_Move(), PCB_EDIT_FRAME::Block_Rotate(), HIERARCHY_NAVIG_DLG::buildHierarchyTree(), SCH_SCREENS::buildScreenList(), SCH_SHEET_LIST::BuildSheetList(), calcArea(), calcMaxArea(), SCH_NO_CONNECT::CanConnect(), SCH_JUNCTION::CanConnect(), SCH_BUS_WIRE_ENTRY::CanConnect(), SCH_LINE::CanConnect(), SCH_BUS_BUS_ENTRY::CanConnect(), SCH_LABEL::CanConnect(), SCH_GLOBALLABEL::CanConnect(), SCH_HIERLABEL::CanConnect(), SCH_SHEET::CanConnect(), SCH_COMPONENT::CanConnect(), ROUTER_TOOL::CanInlineDrag(), DIALOG_EXCHANGE_FOOTPRINTS::changeSameFootprints(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_EDIT_FRAME::CheckListConnections(), EDGE_MODULE::ClassOf(), BOARD_CONNECTED_ITEM::ClassOf(), TEXTE_PCB::ClassOf(), TEXTE_MODULE::ClassOf(), DRAWSEGMENT::ClassOf(), TRACK::ClassOf(), NETINFO_ITEM::ClassOf(), MODULE::ClassOf(), D_PAD::ClassOf(), BOARD::ClassOf(), VIA::ClassOf(), SCH_SHEET::CleanupSheet(), Collect_TrackSegmentsToDrag(), LIB_BEZIER::compare(), LIB_CIRCLE::compare(), LIB_RECTANGLE::compare(), LIB_POLYLINE::compare(), LIB_TEXT::compare(), LIB_ARC::compare(), LIB_FIELD::compare(), LIB_PIN::compare(), SCH_SHEET::ComponentCount(), GRID_HELPER::computeAnchors(), SCH_SCREEN::CountConnectedItems(), SCH_SHEET::CountSheets(), MODULE::CoverageRatio(), LIB_EDIT_FRAME::CreateGraphicItem(), CINFO3D_VISU::createLayers(), BOARD::CreateLockPoint(), SCH_EDIT_FRAME::CreateNewText(), CINFO3D_VISU::createNewTrack(), PCB_EDIT_FRAME::createPopupMenuForTracks(), CreateRoutesSection(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), D_PAD::D_PAD(), FOOTPRINT_EDIT_FRAME::Delete_Edge_Module(), PCB_EDIT_FRAME::Delete_Segment_Edge(), SCH_SCREENS::DeleteAllMarkers(), SCH_SCREEN::DeleteItem(), LIB_EDIT_FRAME::deleteItem(), deleteItem(), SCH_EDIT_FRAME::DeleteItem(), DeleteNullTrackSegments(), PYTHON_ACTION_PLUGINS::deregister_action(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), DIALOG_ERC::DisplayERC_MarkersList(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), DRC::doTrackDrc(), DRC::doTrackKeepoutDrc(), KIGFX::GERBVIEW_PAINTER::Draw(), KIGFX::PCB_PAINTER::Draw(), KIGFX::PCB_PAINTER::draw(), DrawMovePin(), DrawMovingBlockOutlines(), drawPickedItems(), CN_ITEM::Dump(), BOARD::Duplicate(), MODULE::Duplicate(), PCB_EDIT_FRAME::duplicateItems(), DuplicateItemsInList(), SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditSymbolText(), SCH_EDIT_FRAME::EndSegment(), PCB_EDIT_FRAME::EraseRedundantTrack(), ExitSheet(), SCH_SCREEN::ExtractWires(), DRC::fillMarker(), find_vias_and_tracks_at(), SCH_EDIT_FRAME::FindComponentAndItem(), NETLIST_EXPORTER::findNextComponent(), NETLIST_EXPORTER::findNextComponentAndCreatePinList(), SCH_SHEET_PATH::FindNextItem(), SCH_SHEET_LIST::FindNextItem(), SCH_SHEET_PATH::FindPreviousItem(), SCH_SHEET_LIST::FindPreviousItem(), EDIT_TOOL::FootprintFilter(), FootprintWriteShape(), PCB_IO::Format(), PCB_IO::format(), FormatProbeItem(), POINT_EDITOR::get45DegConstrainer(), getAnchorPoint(), TRACK::GetBestInsertPoint(), BOARD_ITEM::GetBoard(), TRACK::GetBoundingBox(), BOARD_CONNECTED_ITEM::GetClearance(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), NETLIST_OBJECT::GetComponentParent(), SCH_SCREEN::GetConnection(), SCH_TEXT::GetConnectionPoints(), SCH_TEXT::GetEndPoints(), SCH_SHEET::GetEndPoints(), GetFirstTrack(), GetFirstVia(), SCH_SCREEN::GetHierarchicalItems(), SCH_SCREENS::GetLibNicknames(), TEXTE_PCB::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), BOARD_CONNECTED_ITEM::GetNetClass(), CONNECTIVITY_DATA::GetNetItems(), LIB_PART::GetNextDrawItem(), DRAWSEGMENT::GetParentModule(), SCH_SCREEN::GetPin(), LIB_PART::GetPin(), SCH_COMPONENT::GetPinPhysicalPosition(), getRect(), SELECTION::GetTopLeftItem(), LIB_EDIT_FRAME::GlobalSetPins(), SELECTION_TOOL::guessSelectionCandidates(), hash_eda(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), SCH_EDIT_FRAME::ImportSheetPin(), DIALOG_LABEL_EDITOR::InitDialog(), ROUTER_TOOL::InlineDrag(), SCH_COLLECTOR::Inspect(), GENERAL_COLLECTOR::Inspect(), SCH_FIND_COLLECTOR::Inspect(), PCB_LAYER_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), CN_ANCHOR::IsDangling(), SCH_TEXT::IsDanglingStateChanged(), SCH_COLLECTOR::IsNode(), TRACK::IsNull(), SCH_LINE::IsParallel(), SCH_SCREEN::IsTerminalPoint(), BOARD_ITEM::IsTrack(), itemIsIncludedByFilter(), CLIPBOARD_IO::Load(), PNS_PCBNEW_RULE_RESOLVER::localPadClearance(), SCH_EDIT_FRAME::LocateAndShowItem(), SCH_EDIT_FRAME::LocateItem(), SCH_SHEET::LocatePathOfScreen(), Magnetize(), EDIT_POINTS_FACTORY::Make(), SCH_SCREEN::MarkConnections(), CONNECTIVITY_DATA::MarkItemNetAsDirty(), CN_CONNECTIVITY_ALGO::markItemNetAsDirty(), MarkItemsInBloc(), BOARD::MarkTrace(), TRACKS_CLEANER::mergeCollinearSegmentIfPossible(), TRACKS_CLEANER::MergeCollinearTracks(), SCH_LINE::MergeOverlap(), FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay(), moveItemWithMouseCursor(), MoveMarkedItems(), MoveMarkedItemsExactly(), ROUTER_TOOL::NeighboringSegmentFilter(), SCH_EDIT_FRAME::OnConvertTextType(), SCH_EDIT_FRAME::OnCopySchematicItemRequest(), SCH_EDIT_FRAME::OnDragItem(), SCH_EDIT_FRAME::OnEditItem(), FOOTPRINT_EDIT_FRAME::OnEditItemRequest(), PCB_EDIT_FRAME::OnEditItemRequest(), SCH_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::OnHotkeyCopyItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDeleteItem(), PCB_EDIT_FRAME::OnHotkeyDeleteItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyDuplicateItem(), PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyEditItem(), PCB_EDIT_FRAME::OnHotkeyFlipItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItem(), PCB_EDIT_FRAME::OnHotkeyMoveItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyMoveItemExact(), PCB_EDIT_FRAME::OnHotkeyPlaceItem(), FOOTPRINT_EDIT_FRAME::OnHotkeyRotateItem(), PCB_EDIT_FRAME::OnHotkeyRotateItem(), FOOTPRINT_EDIT_FRAME::OnLeftClick(), LIB_EDIT_FRAME::OnLeftClick(), SCH_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(), LIB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRightClick(), PCB_EDIT_FRAME::OnRightClick(), SCH_EDIT_FRAME::OnRotate(), SCH_EDIT_FRAME::OnSelectUnit(), SCH_LINE::operator<(), LIB_ITEM::operator<(), SCH_ITEM::operator<(), SCH_COMPONENT::operator<(), SCH_BITMAP::operator=(), SCH_SHEET::operator=(), SCH_COMPONENT::operator=(), LIB_ITEM::operator==(), OrCell_Trace(), SCH_EDIT_FRAME::OrientComponent(), BOARD_COMMIT::parentObject(), PCBNEW_CONTROL::PasteItemsFromClipboard(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_FRAME::PcbGeneralLocateAndDisplay(), LIB_EDIT_FRAME::PlacePin(), SCH_FIELD::Plot(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), SCH_EDIT_FRAME::PrepareMoveItem(), GAL_ARRAY_CREATOR::prePushAction(), PCB_EDIT_FRAME::PrintPage(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), LIB_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::Process_Special_Functions(), PCB_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), RedrawWhileMovingCursor(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), MODULE::Remove(), BOARD::Remove(), CN_CONNECTIVITY_ALGO::Remove(), POINT_EDITOR::removeCorner(), POINT_EDITOR::removeCornerCondition(), LIB_PART::RemoveDrawItem(), TRACKS_CLEANER::removeDuplicatesOfTrack(), SCH_SHEET::RemovePin(), FOOTPRINT_EDIT_FRAME::RemoveStruct(), PCB_EDIT_FRAME::RemoveStruct(), SCH_EDIT_FRAME::RepeatDrawItem(), LIB_EDIT_FRAME::RepeatPinItem(), SCH_SCREENS::ReplaceDuplicateTimeStamps(), SCH_SCREEN::ReplaceWires(), GERBVIEW_SELECTION_TOOL::RequestSelection(), SELECTION_TOOL::RequestSelection(), PCB_EDIT_FRAME::Reset_All_Tracks_And_Vias_To_Netclass_Values(), PCB_BASE_FRAME::ResetTextSize(), SCH_EDIT_FRAME::ReSizeSheet(), BOARD_COMMIT::Revert(), SCH_EDIT_FRAME::RotateField(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveBezier(), SCH_LEGACY_PLUGIN_CACHE::saveCircle(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN_CACHE::savePin(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), SCH_LEGACY_PLUGIN_CACHE::saveRectangle(), SCH_LEGACY_PLUGIN_CACHE::saveText(), SCH_EDIT_FRAME::SaveUndoItemInUndoList(), SCH_EDIT_FRAME::SchematicCleanUp(), CN_CONNECTIVITY_ALGO::searchConnections(), SCH_SHEET::SearchHierarchy(), SELECTION_TOOL::select(), SELECTION_TOOL::selectable(), SCH_SCREEN::SelectBlockItems(), PCB_EDIT_FRAME::SelectHighLight(), SELECTION_TOOL::selectVisually(), ITEM_PICKER::SetItem(), SetSchItemParent(), DIALOG_LABEL_EDITOR::SetTitle(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), PCB_EDIT_FRAME::Show_1_Ratsnest(), Show_MoveNode(), ShowClearance(), ShowNewTrackWhenMovingCursor(), SortByTimeStamp(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), LIB_EDIT_FRAME::StartMoveDrawSymbol(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), SCH_NO_CONNECT::SwapData(), SCH_JUNCTION::SwapData(), SCH_BITMAP::SwapData(), PCB_TARGET::SwapData(), SCH_FIELD::SwapData(), SCH_SHEET_PIN::SwapData(), TEXTE_PCB::SwapData(), DIMENSION::SwapData(), DRAWSEGMENT::SwapData(), TRACK::SwapData(), SCH_SHEET::SwapData(), SCH_COMPONENT::SwapData(), VIA::SwapData(), ZONE_CONTAINER::SwapData(), MODULE::SwapData(), D_PAD::SwapData(), SwapItemData(), PCB_EDIT_FRAME::SwitchLayer(), TestDuplicateSheetNames(), TRACKS_CLEANER::testTrackEndpointDangling(), TEXTE_MODULE::TEXTE_MODULE(), DIALOG_LABEL_EDITOR::TextPropertiesAccept(), TraceSegmentPcb(), SELECTION_TOOL::unselectVisually(), SCH_SHEET_PATH::UpdateAllScreenReferences(), DIALOG_SCH_EDIT_ONE_FIELD::UpdateField(), POINT_EDITOR::updateItem(), POINT_EDITOR::updatePoints(), PCB_BRIGHT_BOX::ViewDraw(), TRACK::Visit(), Visit(), EDA_ITEM::Visit(), SCH_SHEET::Visit(), and SCH_COMPONENT::Visit().

210  {
211  return m_StructType;
212  }
KICAD_T m_StructType
Run time identification, keep private so it can never be changed after a constructor sets it...
Definition: base_struct.h:171
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:220
const BOX2I GERBER_DRAW_ITEM::ViewBBox ( ) const
overridevirtual

Reimplemented from EDA_ITEM.

Definition at line 898 of file gerber_draw_item.cpp.

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

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

899 {
900  EDA_RECT bbox = GetBoundingBox();
901  return BOX2I( VECTOR2I( bbox.GetOrigin() ),
902  VECTOR2I( bbox.GetSize() ) );
903 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:468
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:589
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::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 889 of file gerber_draw_item.cpp.

References GERBER_DCODE_LAYER, GERBER_DRAW_LAYER, and GetLayer().

890 {
891  aCount = 2;
892 
893  aLayers[0] = GERBER_DRAW_LAYER( GetLayer() );
894  aLayers[1] = GERBER_DCODE_LAYER( aLayers[0] );
895 }
#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 906 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.

907 {
908  // DCodes will be shown only if zoom is appropriate:
909  // Returns the level of detail of the item.
910  // A level of detail (LOD) is the minimal VIEW scale that
911  // is sufficient for an item to be shown on a given layer.
912  if( IsDCodeLayer( aLayer ) )
913  {
914  int size = 0;
915 
916  switch( m_Shape )
917  {
918  case GBR_SPOT_MACRO:
920  break;
921 
922  case GBR_ARC:
923  size = GetLineLength( m_Start, m_ArcCentre );
924  break;
925 
926  default:
927  size = m_Size.x;
928  }
929 
930  // the level of details is chosen experimentally, to show
931  // only a readable text:
932  const int level = Millimeter2iu( 500 );
933  return ( level / ( size + 1 ) );
934  }
935 
936  // Other layers are shown without any conditions
937  return 0;
938 }
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 941 of file gerber_draw_item.cpp.

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

942 {
943  KICAD_T stype = *scanTypes;
944 
945  // If caller wants to inspect my type
946  if( stype == Type() )
947  {
948  if( SEARCH_QUIT == inspector( this, testData ) )
949  return SEARCH_QUIT;
950  }
951 
952  return SEARCH_CONTINUE;
953 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:209
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 186 of file base_struct.h.

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

bool EDA_ITEM::m_forceVisible
protectedinherited

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

Definition at line 183 of file base_struct.h.

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

bool 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 177 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
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 176 of file base_struct.h.

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


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