KiCad PCB EDA Suite
MODULE_ZONE_CONTAINER Class Reference

MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER is living in a board MODULE_ZONE_CONTAINER is living in a footprint althougt the are similar, these items need a specific type to be easily managed in many functions using the type id in switches A few virtual methods are different. More...

#include <class_zone.h>

Inheritance diagram for MODULE_ZONE_CONTAINER:
ZONE_CONTAINER BOARD_CONNECTED_ITEM BOARD_ITEM EDA_ITEM KIGFX::VIEW_ITEM

Public Member Functions

 MODULE_ZONE_CONTAINER (BOARD_ITEM_CONTAINER *aParent)
 
 MODULE_ZONE_CONTAINER (const MODULE_ZONE_CONTAINER &aZone)
 
MODULE_ZONE_CONTAINERoperator= (const MODULE_ZONE_CONTAINER &aOther)
 
EDA_ITEMClone () const override
 Function Clone creates a duplicate of this item with linked list members set to NULL. More...
 
unsigned int ViewGetLOD (int aLayer, KIGFX::VIEW *aView) const override
 Function ViewGetLOD() Returns the level of detail (LOD) of the item. More...
 
const wxPoint GetPosition () const override
 
void SetPosition (const wxPoint &aPos) override
 
void SetPriority (unsigned aPriority)
 Function SetPriority. More...
 
unsigned GetPriority () const
 Function GetPriority. More...
 
void GetMsgPanelInfo (EDA_UNITS aUnits, std::vector< MSG_PANEL_ITEM > &aList) override
 Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for display purposes. More...
 
void SetLayerSet (LSET aLayerSet)
 
virtual LSET GetLayerSet () const override
 Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segment or VIA physically resides. More...
 
void Print (PCB_BASE_FRAME *aFrame, wxDC *DC, const wxPoint &offset=ZeroOffset) override
 Function Print Prints the zone outline. More...
 
void PrintFilledArea (PCB_BASE_FRAME *aFrame, wxDC *DC, const wxPoint &offset=ZeroOffset)
 Function PrintFilledArea Draws the filled area for this zone (polygon list .m_FilledPolysList) More...
 
const EDA_RECT GetBoundingBox () const override
 Function GetBoundingBox (virtual) More...
 
int GetClearance (BOARD_CONNECTED_ITEM *aItem=NULL) const override
 Function GetClearance returns the clearance in internal units. More...
 
bool IsOnCopperLayer () const override
 Function IsOnCopperLayer. More...
 
bool CommonLayerExists (const LSET aLayerSet) const
 Function CommonLayerExist Test if this zone shares a common layer with the given layer set. More...
 
virtual void SetLayer (PCB_LAYER_ID aLayer) override
 Function SetLayer sets the layer this item is on. More...
 
virtual PCB_LAYER_ID GetLayer () const override
 Function GetLayer returns the primary layer this item is on. More...
 
virtual bool IsOnLayer (PCB_LAYER_ID) const override
 Function IsOnLayer tests to see if this object is on the given layer. More...
 
virtual void ViewGetLayers (int aLayers[], int &aCount) const override
 Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on. More...
 
void SetFillMode (ZONE_FILL_MODE aFillMode)
 
ZONE_FILL_MODE GetFillMode () const
 
void SetThermalReliefGap (int aThermalReliefGap)
 
int GetThermalReliefGap (D_PAD *aPad=NULL) const
 
void SetThermalReliefCopperBridge (int aThermalReliefCopperBridge)
 
int GetThermalReliefCopperBridge (D_PAD *aPad=NULL) const
 
bool IsFilled () const
 
void SetIsFilled (bool isFilled)
 
bool NeedRefill () const
 
void SetNeedRefill (bool aNeedRefill)
 
int GetZoneClearance () const
 
void SetZoneClearance (int aZoneClearance)
 
ZONE_CONNECTION GetPadConnection (D_PAD *aPad=NULL) const
 
void SetPadConnection (ZONE_CONNECTION aPadConnection)
 
int GetMinThickness () const
 
void SetMinThickness (int aMinThickness)
 
int GetHatchFillTypeThickness () const
 
void SetHatchFillTypeThickness (int aThickness)
 
int GetHatchFillTypeGap () const
 
void SetHatchFillTypeGap (int aStep)
 
double GetHatchFillTypeOrientation () const
 
void SetHatchFillTypeOrientation (double aStep)
 
int GetHatchFillTypeSmoothingLevel () const
 
void SetHatchFillTypeSmoothingLevel (int aLevel)
 
double GetHatchFillTypeSmoothingValue () const
 
void SetHatchFillTypeSmoothingValue (double aValue)
 
int GetSelectedCorner () const
 
void SetSelectedCorner (int aCorner)
 
void SetSelectedCorner (const wxPoint &aPosition, int aAccuracy)
 
int GetLocalFlags () const
 
void SetLocalFlags (int aFlags)
 
ZONE_SEGMENT_FILLFillSegments ()
 
const ZONE_SEGMENT_FILLFillSegments () const
 
SHAPE_POLY_SETOutline ()
 
const SHAPE_POLY_SETOutline () const
 
void SetOutline (SHAPE_POLY_SET *aOutline)
 
bool HitTest (const wxPoint &aPosition, int aAccuracy=0) const override
 Function HitTest tests if a point is near an outline edge or a corner of this zone. More...
 
bool HitTest (const EDA_RECT &aRect, bool aContained=true, int aAccuracy=0) const override
 
bool HitTestFilledArea (const wxPoint &aRefPos) const
 Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this zone. More...
 
void GetColinearCorners (BOARD *aBoard, std::set< VECTOR2I > &colinearCorners)
 Some intersecting zones, despite being on the same layer with the same net, cannot be merged due to other parameters such as fillet radius. More...
 
void TransformSolidAreasShapesToPolygonSet (SHAPE_POLY_SET &aCornerBuffer, int aError=ARC_HIGH_DEF) const
 Function TransformSolidAreasShapesToPolygonSet Convert solid areas full shapes to polygon set (the full shape is the polygon area with a thick outline) Used in 3D view Arcs (ends of segments) are approximated by segments. More...
 
void TransformOutlinesShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, int aMinClearanceValue, bool aUseNetClearance, std::set< VECTOR2I > *aPreserveCorners=nullptr) const
 Function TransformOutlinesShapeWithClearanceToPolygon Convert the outlines shape to a polygon with no holes inflated (optional) by max( aClearanceValue, the zone clearance) (holes are linked to external outline by overlapping segments) Used in filling zones calculations Circles (vias) and arcs (ends of tracks) are approximated by segments. More...
 
void TransformShapeWithClearanceToPolygon (SHAPE_POLY_SET &aCornerBuffer, int aClearanceValue, int aError=ARC_HIGH_DEF, bool ignoreLineWidth=false) const override
 Function TransformShapeWithClearanceToPolygon Convert the zone shape to a closed polygon Used in filling zones calculations Circles and arcs are approximated by segments. More...
 
bool HitTestForCorner (const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
 Function HitTestForCorner tests if the given wxPoint is near a corner. More...
 
bool HitTestForCorner (const wxPoint &refPos, int aAccuracy) const
 Function HitTestForCorner tests if the given wxPoint is near a corner. More...
 
bool HitTestForEdge (const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
 Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners. More...
 
bool HitTestForEdge (const wxPoint &refPos, int aAccuracy) const
 Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners. More...
 
bool UnFill ()
 Function UnFill Removes the zone filling. More...
 
void Move (const wxPoint &offset) override
 Function Move Move the outlines. More...
 
void Move (const VECTOR2I &aMoveVector)
 
void MoveEdge (const wxPoint &offset, int aEdge)
 Function MoveEdge Move the outline Edge. More...
 
void Rotate (const wxPoint &centre, double angle) override
 Function Rotate Move the outlines. More...
 
void Rotate (const VECTOR2I &aRotCentre, double aAngle)
 
virtual void Flip (const wxPoint &aCentre, bool aFlipLeftRight) override
 Function Flip Flip this object, i.e. More...
 
void Flip (const VECTOR2I &aCentre, bool aFlipLeftRight)
 
void Mirror (const wxPoint &aMirrorRef, bool aMirrorLeftRight)
 Function Mirror Mirror the outlines , relative to a given horizontal axis the layer is not changed. More...
 
wxString GetClass () const override
 Function GetClass returns the class name. More...
 
int GetNumCorners (void) const
 Access to m_Poly parameters. More...
 
SHAPE_POLY_SET::ITERATOR Iterate ()
 Function Iterate returns an iterator to visit all points of the zone's main outline without holes. More...
 
SHAPE_POLY_SET::ITERATOR IterateWithHoles ()
 Function IterateWithHoles returns an iterator to visit all points of the zone's main outline with holes. More...
 
SHAPE_POLY_SET::CONST_ITERATOR CIterateWithHoles () const
 Function CIterateWithHoles returns an iterator to visit all points of the zone's main outline with holes. More...
 
void RemoveAllContours (void)
 
const VECTOR2IGetCornerPosition (int aCornerIndex) const
 
void SetCornerPosition (int aCornerIndex, wxPoint new_pos)
 
void NewHole ()
 Function NewHole creates a new hole on the zone; i.e., a new contour on the zone's outline. More...
 
bool AppendCorner (wxPoint aPosition, int aHoleIdx, bool aAllowDuplication=false)
 Add a new corner to the zone outline (to the main outline or a hole) More...
 
ZONE_HATCH_STYLE GetHatchStyle () const
 
void SetHatchStyle (ZONE_HATCH_STYLE aStyle)
 
bool IsSame (const ZONE_CONTAINER &aZoneToCompare)
 Function IsSame tests if 2 zones are equivalent: 2 zones are equivalent if they have same parameters and same outlines info, filling is not taken into account. More...
 
void ClearFilledPolysList ()
 Function ClearFilledPolysList clears the list of filled polygons. More...
 
const SHAPE_POLY_SETGetFilledPolysList () const
 Function GetFilledPolysList returns a reference to the list of filled polygons. More...
 
void CacheTriangulation ()
 (re)create a list of triangles that "fill" the solid areas. More...
 
void SetFilledPolysList (SHAPE_POLY_SET &aPolysList)
 Function SetFilledPolysList sets the list of filled polygons. More...
 
void SetRawPolysList (SHAPE_POLY_SET &aPolysList)
 Function SetFilledPolysList sets the list of filled polygons. More...
 
bool BuildSmoothedPoly (SHAPE_POLY_SET &aSmoothedPoly, std::set< VECTOR2I > *aPreserveCorners) const
 Function GetSmoothedPoly returns a pointer to the corner-smoothed version of m_Poly. More...
 
void SetCornerSmoothingType (int aType)
 
int GetCornerSmoothingType () const
 
void SetCornerRadius (unsigned int aRadius)
 
unsigned int GetCornerRadius () const
 
bool GetFilledPolysUseThickness () const
 
void SetFilledPolysUseThickness (bool aOption)
 
void AddPolygon (std::vector< wxPoint > &aPolygon)
 add a polygon to the zone outline if the zone outline is empty, this is the main outline else it is a hole inside the main outline More...
 
void AddPolygon (const SHAPE_LINE_CHAIN &aPolygon)
 
void SetFillSegments (const ZONE_SEGMENT_FILL &aSegments)
 
SHAPE_POLY_SETRawPolysList ()
 
wxString GetSelectMenuText (EDA_UNITS aUnits) 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...
 
BITMAP_DEF GetMenuImage () const override
 Function GetMenuImage returns a pointer to an image to be used in menus. More...
 
bool GetIsKeepout () const
 Accessors to parameters used in Keepout zones: More...
 
bool GetDoNotAllowCopperPour () const
 
bool GetDoNotAllowVias () const
 
bool GetDoNotAllowTracks () const
 
void SetIsKeepout (bool aEnable)
 
void SetDoNotAllowCopperPour (bool aEnable)
 
void SetDoNotAllowVias (bool aEnable)
 
void SetDoNotAllowTracks (bool aEnable)
 
int GetHatchPitch () const
 Hatch related methods. More...
 
void SetHatch (ZONE_HATCH_STYLE aHatchStyle, int aHatchPitch, bool aRebuildHatch)
 Function SetHatch sets all hatch parameters for the zone. More...
 
void SetHatchPitch (int aPitch)
 Function SetHatchPitch sets the hatch pitch parameter for the zone. More...
 
void UnHatch ()
 Function UnHatch clears the zone's hatch. More...
 
void Hatch ()
 Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_HatchLines. More...
 
const std::vector< SEG > & GetHatchLines () const
 
bool GetHV45 () const
 
void SetHV45 (bool aConstrain)
 
MD5_HASH GetHashValue ()
 
void BuildHashValue ()
 Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash. More...
 
virtual void SwapData (BOARD_ITEM *aImage) override
 Swap data between aItem and aImage. More...
 
bool IsConnected () const override
 

More...
 
NETINFO_ITEMGetNet () const
 Function GetNet Returns NET_INFO object for a given item. More...
 
void SetNet (NETINFO_ITEM *aNetInfo)
 Function SetNet Sets a NET_INFO object for the item. More...
 
int GetNetCode () const
 Function GetNetCode. More...
 
bool SetNetCode (int aNetCode, bool aNoAssert=false)
 Sets net using a net code. More...
 
const wxString & GetNetname () const
 Function GetNetname. More...
 
wxString GetNetnameMsg () const
 Function GetNetnameMsg. More...
 
const wxString & GetShortNetname () const
 Function GetShortNetname. More...
 
std::shared_ptr< NETCLASSGetNetClass () const
 Function GetNetClass returns the NETCLASS for this item. More...
 
wxString GetNetClassName () const
 Function GetNetClassName returns a pointer to the netclass of the zone. More...
 
void SetLocalRatsnestVisible (bool aVisible)
 
bool GetLocalRatsnestVisible () const
 
virtual const wxPoint GetCenter () const
 Function GetCenter() More...
 
BOARD_ITEM_CONTAINERGetParent () const
 
bool IsTrack () const
 Function IsTrack tests to see if this object is a track or via (or microvia). More...
 
virtual bool IsLocked () const
 Function IsLocked. More...
 
virtual void SetLocked (bool aLocked)
 Function SetLocked modifies 'lock' status for of the item. More...
 
void DeleteStructure ()
 Function DeleteStructure deletes this object after removing from its parent if it has one. More...
 
virtual BOARDGetBoard () const
 Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none. More...
 
wxString GetLayerName () const
 Function GetLayerName returns the name of the PCB layer on which the item resides. More...
 
KICAD_T Type () const
 Function Type() More...
 
void SetTimeStamp (timestamp_t aNewTimeStamp)
 
timestamp_t GetTimeStamp () const
 
void SetParent (EDA_ITEM *aParent)
 
bool IsNew () const
 
bool IsModified () const
 
bool IsMoving () const
 
bool IsDragging () const
 
bool IsWireImage () const
 
bool IsSelected () const
 
bool IsResized () const
 
bool IsHighlighted () const
 
bool IsBrightened () const
 
void SetWireImage ()
 
void SetSelected ()
 
void SetHighlighted ()
 
void SetBrightened ()
 
void ClearSelected ()
 
void ClearHighlighted ()
 
void ClearBrightened ()
 
void SetModified ()
 
int GetState (int type) const
 
void SetState (int type, int state)
 
STATUS_FLAGS GetStatus () const
 
void SetStatus (STATUS_FLAGS aStatus)
 
void SetFlags (STATUS_FLAGS aMask)
 
void ClearFlags (STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
STATUS_FLAGS GetFlags () const
 
bool HasFlag (STATUS_FLAGS aFlag)
 
STATUS_FLAGS GetEditFlags () const
 
void ClearTempFlags ()
 
void ClearEditFlags ()
 
virtual bool IsType (const KICAD_T aScanTypes[]) const
 Function IsType Checks whether the item is one of the listed types. More...
 
void SetForceVisible (bool aEnable)
 Function SetForceVisible is used to set and cleag force visible flag used to force the item to be drawn even if it's draw attribute is set to not visible. More...
 
virtual 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 its member data. More...
 
virtual bool Matches (wxFindReplaceData &aSearchData, void *aAuxData)
 Function Matches compares the item against the search criteria in aSearchData. More...
 
virtual bool Replace (wxFindReplaceData &aSearchData, void *aAuxData=NULL)
 Function Replace performs a text replace using the find and replace criteria in aSearchData on items that support text find and replace. More...
 
virtual bool IsReplaceable () const
 Function IsReplaceable. More...
 
bool operator< (const EDA_ITEM &aItem) const
 Test if another item is less than this object. More...
 
virtual const BOX2I ViewBBox () const override
 Function ViewBBox() returns the bounding box of the item covering all its layers. More...
 
virtual void ViewDraw (int aLayer, VIEW *aView) const
 Function ViewDraw() Draws the parts of the object belonging to layer aLayer. More...
 
VIEW_ITEM_DATA * viewPrivData () const
 
void ClearViewPrivData ()
 

Static Public Member Functions

static bool ClassOf (const EDA_ITEM *aItem)
 
static int GetDefaultHatchPitch ()
 Function GetDefaultHatchPitchMils. More...
 
static wxString ShowShape (STROKE_T aShape)
 Function ShowShape converts the enum STROKE_T integer value to a wxString. More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::deque< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
template<class T >
static SEARCH_RESULT IterateForward (std::vector< T > &aList, INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
 IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T ) More...
 
static 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...
 
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...
 

Static Public Attributes

static wxPoint ZeroOffset
 A value of wxPoint(0,0) which can be passed to the Draw() functions. More...
 

Protected Member Functions

void initDataFromSrcInCopyCtor (const ZONE_CONTAINER &aZone)
 Copy aZone data to me members are expected non initialize in this. More...
 
bool Matches (const wxString &aText, wxFindReplaceData &aSearchData)
 Function Matches compares aText against search criteria in aSearchData. More...
 

Static Protected Member Functions

static int getNextNumberInSequence (const std::set< int > &aSeq, bool aFillSequenceGaps)
 

Protected Attributes

SHAPE_POLY_SETm_Poly
 Outline of the zone. More...
 
int m_cornerSmoothingType
 
unsigned int m_cornerRadius
 
LSET m_layerSet
 
unsigned m_priority
 
bool m_isKeepout
 
bool m_doNotAllowCopperPour
 
bool m_doNotAllowVias
 
bool m_doNotAllowTracks
 
ZONE_CONNECTION m_PadConnection
 
int m_ZoneClearance
 Clearance value in internal units. More...
 
int m_ZoneMinThickness
 Minimum thickness value in filled areas. More...
 
bool m_FilledPolysUseThickness
 outline of filled polygons have thickness. More...
 
bool m_IsFilled
 True when a zone was filled, false after deleting the filled areas. More...
 
bool m_needRefill
 False when a zone was refilled, true after changes in zone params. More...
 
int m_ThermalReliefGap
 Width of the copper bridge in thermal reliefs. More...
 
int m_ThermalReliefCopperBridge
 
ZONE_FILL_MODE m_FillMode
 How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => use a grid pattern as shape. More...
 
int m_HatchFillTypeThickness
 Grid style shape: thickness of lines (if 0 -> solid shape) More...
 
int m_HatchFillTypeGap
 Grid style shape: dist between center of lines (grid size) (0 -> solid shape) More...
 
double m_HatchFillTypeOrientation
 Grid style shape: orientation in degrees of the grid lines. More...
 
int m_HatchFillTypeSmoothingLevel
 Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet, >= 2 = arc. More...
 
double m_HatchFillTypeSmoothingValue
 Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap and the chamfer size. More...
 
SHAPE_POLY_SET::VERTEX_INDEXm_CornerSelection
 The index of the corner being moved or nullptr if no corner is selected. More...
 
int m_localFlgs
 Variable used in polygon calculations. More...
 
ZONE_SEGMENT_FILL m_FillSegmList
 Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used. More...
 
SHAPE_POLY_SET m_FilledPolysList
 
SHAPE_POLY_SET m_RawPolysList
 
MD5_HASH m_filledPolysHash
 
ZONE_HATCH_STYLE m_hatchStyle
 
int m_hatchPitch
 
std::vector< SEGm_HatchLines
 
std::vector< int > m_insulatedIslands
 
bool m_hv45
 
NETINFO_ITEMm_netinfo
 Stores all informations about the net that item belongs to. More...
 
PCB_LAYER_ID m_Layer
 
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...
 

Detailed Description

MODULE_ZONE_CONTAINER is the same item as ZONE_CONTAINER, but with a specific type id ZONE_CONTAINER is living in a board MODULE_ZONE_CONTAINER is living in a footprint althougt the are similar, these items need a specific type to be easily managed in many functions using the type id in switches A few virtual methods are different.

Definition at line 828 of file class_zone.h.

Constructor & Destructor Documentation

◆ MODULE_ZONE_CONTAINER() [1/2]

MODULE_ZONE_CONTAINER::MODULE_ZONE_CONTAINER ( BOARD_ITEM_CONTAINER aParent)

Definition at line 1313 of file class_zone.cpp.

1313  :
1314  ZONE_CONTAINER( aParent, true )
1315 {
1316  // in a footprint, net classes are not managed.
1317  // so set the net to NETINFO_LIST::ORPHANED_ITEM
1318  SetNetCode( -1, true );
1319 }
ZONE_CONTAINER(BOARD_ITEM_CONTAINER *parent, bool aInModule=false)
The ctor to build ZONE_CONTAINER, but comaptible with MODULE_ZONE_CONTAINER requirement.
Definition: class_zone.cpp:46
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Sets net using a net code.

References BOARD_CONNECTED_ITEM::SetNetCode().

Referenced by Clone().

◆ MODULE_ZONE_CONTAINER() [2/2]

MODULE_ZONE_CONTAINER::MODULE_ZONE_CONTAINER ( const MODULE_ZONE_CONTAINER aZone)

Definition at line 1322 of file class_zone.cpp.

1323  : ZONE_CONTAINER( aZone.GetParent(), true )
1324 {
1325  initDataFromSrcInCopyCtor( aZone );
1326 }
ZONE_CONTAINER(BOARD_ITEM_CONTAINER *parent, bool aInModule=false)
The ctor to build ZONE_CONTAINER, but comaptible with MODULE_ZONE_CONTAINER requirement.
Definition: class_zone.cpp:46
void initDataFromSrcInCopyCtor(const ZONE_CONTAINER &aZone)
Copy aZone data to me members are expected non initialize in this.
Definition: class_zone.cpp:128
BOARD_ITEM_CONTAINER * GetParent() const

References ZONE_CONTAINER::initDataFromSrcInCopyCtor().

Member Function Documentation

◆ AddPolygon() [1/2]

void ZONE_CONTAINER::AddPolygon ( std::vector< wxPoint > &  aPolygon)
inherited

add a polygon to the zone outline if the zone outline is empty, this is the main outline else it is a hole inside the main outline

Definition at line 890 of file class_zone.cpp.

891 {
892  if( aPolygon.empty() )
893  return;
894 
895  SHAPE_LINE_CHAIN outline;
896 
897  // Create an outline and populate it with the points of aPolygon
898  for( unsigned i = 0; i < aPolygon.size(); i++ )
899  {
900  outline.Append( VECTOR2I( aPolygon[i] ) );
901  }
902 
903  outline.SetClosed( true );
904 
905  // Add the outline as a new polygon in the polygon set
906  if( m_Poly->OutlineCount() == 0 )
907  m_Poly->AddOutline( outline );
908  else
909  m_Poly->AddHole( outline );
910 
911  SetNeedRefill( true );
912 }
int OutlineCount() const
Returns the number of outlines in the set
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
void SetClosed(bool aClosed)
Function SetClosed()
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
int AddHole(const SHAPE_LINE_CHAIN &aHole, int aOutline=-1)
Adds a new hole to the given outline (default: last) and returns its index
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
SHAPE_LINE_CHAIN.
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::AddOutline(), SHAPE_LINE_CHAIN::Append(), ZONE_CONTAINER::m_Poly, SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::SetClosed(), and ZONE_CONTAINER::SetNeedRefill().

Referenced by EAGLE_PLUGIN::loadPolygon().

◆ AddPolygon() [2/2]

void ZONE_CONTAINER::AddPolygon ( const SHAPE_LINE_CHAIN aPolygon)
inherited

Definition at line 876 of file class_zone.cpp.

877 {
878  wxASSERT( aPolygon.IsClosed() );
879 
880  // Add the outline as a new polygon in the polygon set
881  if( m_Poly->OutlineCount() == 0 )
882  m_Poly->AddOutline( aPolygon );
883  else
884  m_Poly->AddHole( aPolygon );
885 
886  SetNeedRefill( true );
887 }
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
int AddHole(const SHAPE_LINE_CHAIN &aHole, int aOutline=-1)
Adds a new hole to the given outline (default: last) and returns its index
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
bool IsClosed() const
Function IsClosed()
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References SHAPE_POLY_SET::AddHole(), SHAPE_POLY_SET::AddOutline(), SHAPE_LINE_CHAIN::IsClosed(), ZONE_CONTAINER::m_Poly, SHAPE_POLY_SET::OutlineCount(), and ZONE_CONTAINER::SetNeedRefill().

◆ AppendCorner()

bool ZONE_CONTAINER::AppendCorner ( wxPoint  aPosition,
int  aHoleIdx,
bool  aAllowDuplication = false 
)
inherited

Add a new corner to the zone outline (to the main outline or a hole)

Parameters
aPositionis the position of the new corner.
aHoleIdxis the index of the hole (-1 for the main outline, >= 0 for hole).
aAllowDuplicationis a flag to indicate whether it is allowed to add this corner even if it is duplicated.
Returns
true if the corner was added, false if error (aHoleIdx > hole count -1)

Definition at line 915 of file class_zone.cpp.

916 {
917  // Ensure the main outline exists:
918  if( m_Poly->OutlineCount() == 0 )
919  m_Poly->NewOutline();
920 
921  // If aHoleIdx >= 0, the corner musty be added to the hole, index aHoleIdx.
922  // (remember: the index of the first hole is 0)
923  // Return error if if does dot exist.
924  if( aHoleIdx >= m_Poly->HoleCount( 0 ) )
925  return false;
926 
927  m_Poly->Append( aPosition.x, aPosition.y, -1, aHoleIdx, aAllowDuplication );
928 
929  SetNeedRefill( true );
930 
931  return true;
932 }
int OutlineCount() const
Returns the number of outlines in the set
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
int NewOutline()
Creates a new empty polygon in the set and returns its index
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
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 SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References SHAPE_POLY_SET::Append(), SHAPE_POLY_SET::HoleCount(), ZONE_CONTAINER::m_Poly, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), ZONE_CONTAINER::SetNeedRefill(), wxPoint::x, and wxPoint::y.

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), BOARD::InsertArea(), and EAGLE_PLUGIN::loadPlain().

◆ BuildHashValue()

void ZONE_CONTAINER::BuildHashValue ( )
inlineinherited

Build the hash value of m_FilledPolysList, and store it internally in m_filledPolysHash.

Used in zone filling calculations, to know if m_FilledPolysList is up to date.

Definition at line 702 of file class_zone.h.

MD5_HASH GetHash() const
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
MD5_HASH m_filledPolysHash
Definition: class_zone.h:808

References SHAPE_POLY_SET::GetHash(), ZONE_CONTAINER::m_filledPolysHash, and ZONE_CONTAINER::m_FilledPolysList.

◆ BuildSmoothedPoly()

bool ZONE_CONTAINER::BuildSmoothedPoly ( SHAPE_POLY_SET aSmoothedPoly,
std::set< VECTOR2I > *  aPreserveCorners 
) const
inherited

Function GetSmoothedPoly returns a pointer to the corner-smoothed version of m_Poly.

Parameters
aPreserveCorners- set of corners which should /not/ be smoothed
Returns
SHAPE_POLY_SET* - pointer to the polygon.

Definition at line 1225 of file class_zone.cpp.

1227 {
1228  if( GetNumCorners() <= 2 ) // malformed zone. polygon calculations do not like it ...
1229  return false;
1230 
1231  // Make a smoothed polygon out of the user-drawn polygon if required
1232  switch( m_cornerSmoothingType )
1233  {
1235  aSmoothedPoly = m_Poly->Chamfer( m_cornerRadius, aPreserveCorners );
1236  break;
1237 
1239  {
1240  auto board = GetBoard();
1241  int maxError = ARC_HIGH_DEF;
1242 
1243  if( board )
1244  maxError = board->GetDesignSettings().m_MaxError;
1245 
1246  aSmoothedPoly = m_Poly->Fillet( m_cornerRadius, maxError, aPreserveCorners );
1247  break;
1248  }
1249  default:
1250  // Acute angles between adjacent edges can create issues in calculations,
1251  // in inflate/deflate outlines transforms, especially when the angle is very small.
1252  // We can avoid issues by creating a very small chamfer which remove acute angles,
1253  // or left it without chamfer and use only CPOLYGONS_LIST::InflateOutline to create
1254  // clearance areas
1255  aSmoothedPoly = m_Poly->Chamfer( Millimeter2iu( 0.0 ), aPreserveCorners );
1256  break;
1257  }
1258 
1259  return true;
1260 };
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
int m_cornerSmoothingType
Definition: class_zone.h:720
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: class_zone.h:432
unsigned int m_cornerRadius
Definition: class_zone.h:721
SHAPE_POLY_SET Fillet(int aRadius, int aErrorMax, std::set< VECTOR2I > *aPreserveCorners=nullptr)
Function Fillet returns a filleted version of the polygon set.
SHAPE_POLY_SET Chamfer(int aDistance, std::set< VECTOR2I > *aPreserveCorners=nullptr)
Function Chamfer returns a chamfered version of the polygon set.

References SHAPE_POLY_SET::Chamfer(), SHAPE_POLY_SET::Fillet(), BOARD_ITEM::GetBoard(), ZONE_CONTAINER::GetNumCorners(), ZONE_CONTAINER::m_cornerRadius, ZONE_CONTAINER::m_cornerSmoothingType, ZONE_CONTAINER::m_Poly, ZONE_SETTINGS::SMOOTHING_CHAMFER, and ZONE_SETTINGS::SMOOTHING_FILLET.

Referenced by ZONE_FILLER::fillSingleZone(), PNS_KICAD_IFACE::syncZone(), DRC::TestZoneToZoneOutline(), and ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon().

◆ CacheTriangulation()

void ZONE_CONTAINER::CacheTriangulation ( )
inherited

(re)create a list of triangles that "fill" the solid areas.

used for instance to draw these solid areas on opengl

Definition at line 1171 of file class_zone.cpp.

1172 {
1174 }
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806

References SHAPE_POLY_SET::CacheTriangulation(), and ZONE_CONTAINER::m_FilledPolysList.

◆ CIterateWithHoles()

SHAPE_POLY_SET::CONST_ITERATOR ZONE_CONTAINER::CIterateWithHoles ( ) const
inlineinherited

Function CIterateWithHoles returns an iterator to visit all points of the zone's main outline with holes.

Returns
SHAPE_POLY_SET::ITERATOR - an iterator to visit the zone vertices with holes.

Definition at line 462 of file class_zone.h.

463  {
464  return m_Poly->CIterateWithHoles();
465  }
CONST_ITERATOR CIterateWithHoles(int aOutline) const
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References SHAPE_POLY_SET::CIterateWithHoles(), and ZONE_CONTAINER::m_Poly.

◆ ClassOf()

static bool ZONE_CONTAINER::ClassOf ( const EDA_ITEM aItem)
inlinestaticinherited

Definition at line 79 of file class_zone.h.

80  {
81  return aItem && aItem->Type() == PCB_ZONE_AREA_T;
82  }
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:101
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207

References PCB_ZONE_AREA_T, and EDA_ITEM::Type().

◆ ClearBrightened()

void EDA_ITEM::ClearBrightened ( )
inlineinherited

Definition at line 235 of file base_struct.h.

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

References BRIGHTENED, and EDA_ITEM::ClearFlags().

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

◆ ClearEditFlags()

◆ ClearFilledPolysList()

void ZONE_CONTAINER::ClearFilledPolysList ( )
inlineinherited

Function ClearFilledPolysList clears the list of filled polygons.

Definition at line 543 of file class_zone.h.

544  {
546  }
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.

References ZONE_CONTAINER::m_FilledPolysList, and SHAPE_POLY_SET::RemoveAllContours().

Referenced by POINT_EDITOR::updateItem().

◆ ClearFlags()

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

Definition at line 256 of file base_struct.h.

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

References EDA_ITEM::m_Flags.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PNS_KICAD_IFACE::AddItem(), SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_COMPONENT::ClearAllHighlightFlags(), EDA_ITEM::ClearBrightened(), EDA_ITEM::ClearEditFlags(), EDA_ITEM::ClearHighlighted(), clearModuleItemFlags(), EDA_ITEM::ClearSelected(), EDA_ITEM::ClearTempFlags(), SCH_EDIT_FRAME::ConvertPart(), LIB_EDIT_TOOL::Copy(), MWAVE::CreateMicrowaveInductor(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), KIGFX::SCH_PAINTER::draw(), LIB_EDIT_TOOL::Duplicate(), SCH_ITEM::Duplicate(), PCB_EDIT_FRAME::Exchange_Module(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), KIGFX::SCH_VIEW::HighlightItem(), MODULE_EDITOR_TOOLS::ImportFootprint(), FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), FOOTPRINT_EDIT_FRAME::OpenProjectFiles(), PCB_BASE_FRAME::PlaceModule(), LIB_PIN_TOOL::PlacePin(), DRAWING_TOOL::PlaceText(), FOOTPRINT_EDIT_FRAME::Process_Special_Functions(), BOARD_COMMIT::Push(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::RollbackPartFromUndo(), SCH_EDIT_FRAME::SaveCopyForRepeatItem(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_LEGACY_PLUGIN_CACHE::savePin(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ ClearHighlighted()

void EDA_ITEM::ClearHighlighted ( )
inlineinherited

Definition at line 234 of file base_struct.h.

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

References EDA_ITEM::ClearFlags(), and HIGHLIGHTED.

◆ ClearSelected()

void EDA_ITEM::ClearSelected ( )
inlineinherited

◆ ClearTempFlags()

void EDA_ITEM::ClearTempFlags ( )
inlineinherited

Definition at line 268 of file base_struct.h.

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

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

Referenced by SCH_EDIT_FRAME::PutDataInPreviousState().

◆ ClearViewPrivData()

void KIGFX::VIEW_ITEM::ClearViewPrivData ( )
inlineinherited

Definition at line 153 of file view_item.h.

154  {
156  }
VIEW_ITEM_DATA * m_viewPrivData
Definition: view_item.h:161
#define NULL

References KIGFX::VIEW_ITEM::m_viewPrivData, and NULL.

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

◆ Clone()

EDA_ITEM * MODULE_ZONE_CONTAINER::Clone ( ) const
overridevirtual

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

Definition at line 1336 of file class_zone.cpp.

1337 {
1338  return new MODULE_ZONE_CONTAINER( *this );
1339 }
MODULE_ZONE_CONTAINER(BOARD_ITEM_CONTAINER *aParent)

References MODULE_ZONE_CONTAINER().

◆ CommonLayerExists()

bool ZONE_CONTAINER::CommonLayerExists ( const LSET  aLayerSet) const
inherited

Function CommonLayerExist Test if this zone shares a common layer with the given layer set.

Definition at line 223 of file class_zone.cpp.

224 {
225  LSET common = GetLayerSet() & aLayerSet;
226 
227  return common.count() > 0;
228 }
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:268
LSET is a set of PCB_LAYER_IDs.

References ZONE_CONTAINER::GetLayerSet().

Referenced by ZONE_FILLER::buildCopperItemClearances().

◆ DeleteStructure()

void BOARD_ITEM::DeleteStructure ( )
inherited

Function DeleteStructure deletes this object after removing from its parent if it has one.

Definition at line 117 of file class_board_item.cpp.

118 {
119  auto parent = GetParent();
120 
121  if( parent )
122  parent->Remove( this );
123 
124  delete this;
125 }
BOARD_ITEM_CONTAINER * GetParent() const

References BOARD_ITEM::GetParent().

Referenced by BOARD::PadDelete(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), and DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow().

◆ FillSegments() [1/2]

ZONE_SEGMENT_FILL& ZONE_CONTAINER::FillSegments ( )
inlineinherited

Definition at line 244 of file class_zone.h.

244 { return m_FillSegmList; }
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:796

References ZONE_CONTAINER::m_FillSegmList.

Referenced by PCB_IO::format().

◆ FillSegments() [2/2]

const ZONE_SEGMENT_FILL& ZONE_CONTAINER::FillSegments ( ) const
inlineinherited

Definition at line 245 of file class_zone.h.

245 { return m_FillSegmList; }
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:796

References ZONE_CONTAINER::m_FillSegmList.

◆ Flip() [1/2]

void BOARD_ITEM::Flip ( const VECTOR2I aCentre,
bool  aFlipLeftRight 
)
inlineinherited

Definition at line 269 of file class_board_item.h.

270  {
271  Flip( wxPoint( aCentre.x, aCentre.y ), aFlipLeftRight );
272  }
virtual void Flip(const wxPoint &aCentre, bool aFlipLeftRight)
Function Flip Flip this object, i.e.

References BOARD_ITEM::Flip(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Flip() [2/2]

void ZONE_CONTAINER::Flip ( const wxPoint aCentre,
bool  aFlipLeftRight 
)
overridevirtualinherited

Function Flip Flip this object, i.e.

change the board side for this object (like Mirror() but changes layer)

Parameters
aCentre- the rotation point.

Reimplemented from BOARD_ITEM.

Definition at line 826 of file class_zone.cpp.

827 {
828  Mirror( aCentre, aFlipLeftRight );
829  int copperLayerCount = GetBoard()->GetCopperLayerCount();
830 
831  if( GetIsKeepout() )
832  {
833  SetLayerSet( FlipLayerMask( GetLayerSet(), copperLayerCount ) );
834  }
835  else
836  {
837  SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
838  }
839 }
void Mirror(const wxPoint &aMirrorRef, bool aMirrorLeftRight)
Function Mirror Mirror the outlines , relative to a given horizontal axis the layer is not changed.
Definition: class_zone.cpp:842
LSET FlipLayerMask(LSET aMask, int aCopperLayersCount)
Calculate the mask layer when flipping a footprint BACK and FRONT copper layers, mask,...
Definition: lset.cpp:531
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:485
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:204
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:268
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:239
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Function SetLayer sets the layer this item is on.
Definition: class_zone.cpp:231
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
int GetCopperLayerCount() const
Function GetCopperLayerCount.

References FlipLayer(), FlipLayerMask(), BOARD_ITEM::GetBoard(), BOARD::GetCopperLayerCount(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayer(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::Mirror(), ZONE_CONTAINER::SetLayer(), and ZONE_CONTAINER::SetLayerSet().

◆ GetBoard()

BOARD * BOARD_ITEM::GetBoard ( ) const
virtualinherited

Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.

Definition at line 54 of file class_board_item.cpp.

55 {
56  if( Type() == PCB_T )
57  return (BOARD*) this;
58 
59  BOARD_ITEM* parent = GetParent();
60 
61  if( parent )
62  return parent->GetBoard();
63 
64  return NULL;
65 }
Definition: typeinfo.h:85
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
#define NULL
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
BOARD_ITEM_CONTAINER * GetParent() const
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207

References BOARD_ITEM::GetBoard(), BOARD_ITEM::GetParent(), NULL, PCB_T, and EDA_ITEM::Type().

Referenced by ZONE_CONTAINER::BuildSmoothedPoly(), DRC::checkClearancePadToPad(), DRC::checkClearanceSegmToPad(), TEXTE_PCB::Flip(), TRACK::Flip(), VIA::Flip(), ZONE_CONTAINER::Flip(), BOARD_ITEM::GetBoard(), MODULE::GetBoundingPoly(), BOARD_CONNECTED_ITEM::GetClearance(), BOARD_ITEM::GetLayerName(), PCB_DRAW_PANEL_GAL::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), D_PAD::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase(), VIA::GetMsgPanelInfoBase(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetClass(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), VIA::GetSelectMenuText(), D_PAD::GetSelectMenuText(), D_PAD::GetSolderMaskMargin(), D_PAD::GetSolderPasteMargin(), BOARD::GetTrackLength(), D_PAD::HitTest(), D_PAD::MergePrimitivesAsPolygon(), EAGLE_PLUGIN::packageWire(), TEXTE_PCB::Print(), PCB_TARGET::Print(), ZONE_CONTAINER::Print(), EDGE_MODULE::Print(), TRACK::Print(), TEXTE_MODULE::Print(), DIMENSION::Print(), DRAWSEGMENT::Print(), VIA::Print(), MODULE::Print(), D_PAD::Print(), ZONE_CONTAINER::PrintFilledArea(), BOARD_CONNECTED_ITEM::SetNet(), BOARD_CONNECTED_ITEM::SetNetCode(), ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon(), ZONE_CONTAINER::TransformSolidAreasShapesToPolygonSet(), MODULE::ViewBBox(), VIA::ViewGetLOD(), and D_PAD::ViewGetLOD().

◆ GetBoundingBox()

const EDA_RECT ZONE_CONTAINER::GetBoundingBox ( ) const
overridevirtualinherited

Function GetBoundingBox (virtual)

Returns
an EDA_RECT that is the bounding box of the zone outline

Reimplemented from EDA_ITEM.

Definition at line 497 of file class_zone.cpp.

498 {
499  const int PRELOAD = 0x7FFFFFFF; // Biggest integer (32 bits)
500 
501  int ymax = -PRELOAD;
502  int ymin = PRELOAD;
503  int xmin = PRELOAD;
504  int xmax = -PRELOAD;
505 
506  int count = GetNumCorners();
507 
508  for( int i = 0; i<count; ++i )
509  {
510  wxPoint corner = static_cast<wxPoint>( GetCornerPosition( i ) );
511 
512  ymax = std::max( ymax, corner.y );
513  xmax = std::max( xmax, corner.x );
514  ymin = std::min( ymin, corner.y );
515  xmin = std::min( xmin, corner.x );
516  }
517 
518  EDA_RECT ret( wxPoint( xmin, ymin ), wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
519 
520  return ret;
521 }
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: class_zone.h:432
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition: class_zone.h:472

References ZONE_CONTAINER::GetCornerPosition(), ZONE_CONTAINER::GetNumCorners(), wxPoint::x, and wxPoint::y.

Referenced by ZONE_FILLER::buildCopperItemClearances(), ZONE_FILLER::buildThermalSpokes(), hasThermalConnection(), and ZONE_CONTAINER::HitTest().

◆ GetCenter()

virtual const wxPoint BOARD_ITEM::GetCenter ( ) const
inlinevirtualinherited

Function GetCenter()

This defaults to the same point as returned by GetPosition(), unless overridden

Returns
centre point of the item

Reimplemented in DRAWSEGMENT.

Definition at line 98 of file class_board_item.h.

98 { return GetPosition(); }
virtual const wxPoint GetPosition() const =0

References BOARD_ITEM::GetPosition().

Referenced by ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), and ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically().

◆ GetClass()

wxString ZONE_CONTAINER::GetClass ( ) const
inlineoverridevirtualinherited

Function GetClass returns the class name.

Returns
wxString

Implements EDA_ITEM.

Definition at line 425 of file class_zone.h.

426  {
427  return wxT( "ZONE_CONTAINER" );
428  }

◆ GetClearance()

int ZONE_CONTAINER::GetClearance ( BOARD_CONNECTED_ITEM aItem = NULL) const
overridevirtualinherited

Function GetClearance returns the clearance in internal units.

If aItem is not NULL then the returned clearance is the greater of this object's NETCLASS clearance and aItem's NETCLASS clearance. If aItem is NULL, then this objects clearance is returned.

Parameters
aItemis another BOARD_CONNECTED_ITEM or NULL
Returns
int - the clearance in internal units.

Reimplemented from BOARD_CONNECTED_ITEM.

Definition at line 650 of file class_zone.cpp.

651 {
652  int myClearance = m_ZoneClearance;
653 
654  // The actual zone clearance is the biggest of the zone netclass clearance
655  // and the zone clearance setting in the zone properties dialog.
656  if( !m_isKeepout ) // Net class has no meaning for a keepout area.
657  {
658  NETCLASSPTR myClass = GetNetClass();
659 
660  if( myClass )
661  myClearance = std::max( myClearance, myClass->GetClearance() );
662  }
663 
664  // Get the final clearance between me and aItem
665  if( aItem )
666  {
667  int hisClearance = aItem->GetClearance( NULL );
668  myClearance = std::max( hisClearance, myClearance );
669  }
670 
671  return myClearance;
672 }
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:744
#define NULL
virtual int GetClearance(BOARD_CONNECTED_ITEM *aItem=NULL) const
Function GetClearance returns the clearance in internal units.
std::shared_ptr< NETCLASS > GetNetClass() const
Function GetNetClass returns the NETCLASS for this item.

References BOARD_CONNECTED_ITEM::GetClearance(), BOARD_CONNECTED_ITEM::GetNetClass(), ZONE_CONTAINER::m_isKeepout, ZONE_CONTAINER::m_ZoneClearance, and NULL.

Referenced by GERBER_JOBFILE_WRITER::addJSONDesignRules(), ZONE_FILLER::buildCopperItemClearances(), BOARD::TestAreaIntersections(), DRC::TestZoneToZoneOutline(), and ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon().

◆ GetColinearCorners()

void ZONE_CONTAINER::GetColinearCorners ( BOARD aBoard,
std::set< VECTOR2I > &  colinearCorners 
)
inherited

Some intersecting zones, despite being on the same layer with the same net, cannot be merged due to other parameters such as fillet radius.

The copper pour will end up effectively merged though, so we want to keep the corners of such intersections sharp.

Definition at line 1182 of file class_zone.cpp.

1183 {
1184  int epsilon = Millimeter2iu( 0.001 );
1185 
1186  // Things get messy when zone of different nets intersect. To do it right we'd need to
1187  // run our colinear test with the final filled regions rather than the outline regions.
1188  // However, since there's no order dependance the only way to do that is to iterate
1189  // through successive zone fills until the results are no longer changing -- and that's
1190  // not going to happen. So we punt and ignore any "messy" corners.
1191  std::set<VECTOR2I> colinearCorners;
1192  std::set<VECTOR2I> messyCorners;
1193 
1194  for( ZONE_CONTAINER* candidate : aBoard->Zones() )
1195  {
1196  if( candidate == this )
1197  continue;
1198 
1199  if( candidate->GetLayerSet() != GetLayerSet() )
1200  continue;
1201 
1202  if( candidate->GetIsKeepout() != GetIsKeepout() )
1203  continue;
1204 
1205  for( auto iter = m_Poly->CIterate(); iter; iter++ )
1206  {
1207  if( candidate->m_Poly->Collide( iter.Get(), epsilon ) )
1208  {
1209  if( candidate->GetNetCode() == GetNetCode() )
1210  colinearCorners.insert( VECTOR2I( iter.Get() ) );
1211  else
1212  messyCorners.insert( VECTOR2I( iter.Get() ) );
1213  }
1214  }
1215  }
1216 
1217  for( VECTOR2I corner : colinearCorners )
1218  {
1219  if( messyCorners.count( corner ) == 0 )
1220  aCorners.insert( corner );
1221  }
1222 }
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:60
int GetNetCode() const
Function GetNetCode.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:268
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
CONST_ITERATOR CIterate(int aFirst, int aLast, bool aIterateHoles=false) const
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
ZONE_CONTAINERS & Zones()
Definition: class_board.h:240

References SHAPE_POLY_SET::CIterate(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::m_Poly, and BOARD::Zones().

Referenced by ZONE_FILLER::fillSingleZone(), PNS_KICAD_IFACE::syncZone(), and DRC::TestZoneToZoneOutline().

◆ GetCornerPosition()

const VECTOR2I& ZONE_CONTAINER::GetCornerPosition ( int  aCornerIndex) const
inlineinherited

Definition at line 472 of file class_zone.h.

473  {
475 
476  // Convert global to relative indices
477  if( !m_Poly->GetRelativeIndices( aCornerIndex, &index ) )
478  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
479 
480  return m_Poly->CVertex( index );
481  }
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
Struct VERTEX_INDEX.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Function GetRelativeIndices.

References SHAPE_POLY_SET::CVertex(), SHAPE_POLY_SET::GetRelativeIndices(), and ZONE_CONTAINER::m_Poly.

Referenced by ZONE_CONTAINER::GetBoundingBox(), and ZONE_CONTAINER::GetPosition().

◆ GetCornerRadius()

unsigned int ZONE_CONTAINER::GetCornerRadius ( ) const
inlineinherited

◆ GetCornerSmoothingType()

int ZONE_CONTAINER::GetCornerSmoothingType ( ) const
inlineinherited

◆ GetDefaultHatchPitch()

int ZONE_CONTAINER::GetDefaultHatchPitch ( )
staticinherited

Function GetDefaultHatchPitchMils.

Returns
int - the default hatch pitch in internal units.

Definition at line 1151 of file class_zone.cpp.

1152 {
1153  return Mils2iu( 20 );
1154 }

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPlain(), LEGACY_PLUGIN::loadZONE_CONTAINER(), PCB_PARSER::parseZONE_CONTAINER(), and ZONE_CONTAINER::ZONE_CONTAINER().

◆ GetDoNotAllowCopperPour()

bool ZONE_CONTAINER::GetDoNotAllowCopperPour ( ) const
inlineinherited

◆ GetDoNotAllowTracks()

◆ GetDoNotAllowVias()

bool ZONE_CONTAINER::GetDoNotAllowVias ( ) const
inlineinherited

◆ GetEditFlags()

STATUS_FLAGS EDA_ITEM::GetEditFlags ( ) const
inlineinherited

Definition at line 260 of file base_struct.h.

261  {
265  return m_Flags & mask;
266  }
#define TEMP_SELECTED
flag indicating that the structure has already selected
Definition: base_struct.h:128
#define END_ONPAD
Pcbnew: flag set for track segment ending on a pad.
Definition: base_struct.h:139
#define BEGIN_ONPAD
Pcbnew: flag set for track segment starting on a pad.
Definition: base_struct.h:138
#define EDA_ITEM_ALL_FLAGS
Definition: base_struct.h:154
#define SELECTED
Definition: base_struct.h:127
#define BRIGHTENED
item is drawn with a bright contour
Definition: base_struct.h:143
#define DP_COUPLED
item is coupled with another item making a differential pair
Definition: base_struct.h:145
#define HIGHLIGHTED
item is drawn in normal colors, when the rest is darkened
Definition: base_struct.h:142
#define IS_DANGLING
indicates a pin is dangling
Definition: base_struct.h:149
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:184
#define ENDPOINT
ends. (Used to support dragging.)
Definition: base_struct.h:126
#define STARTPOINT
When a line is selected, these flags indicate which.
Definition: base_struct.h:125

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

Referenced by SCH_EDIT_TOOL::ChangeShape(), EDA_ITEM::ClearEditFlags(), SCH_EDIT_FRAME::ConvertTextType(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_TOOL::editComponentFieldText(), SCH_EDITOR_CONTROL::EditWithLibEdit(), LIB_MOVE_TOOL::Main(), POINT_EDITOR::OnSelectionChange(), LIB_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_EDIT_FRAME::SelectUnit(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_EDIT_PIN::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), and SCH_EDIT_FRAME::TrimWire().

◆ GetFilledPolysList()

const SHAPE_POLY_SET& ZONE_CONTAINER::GetFilledPolysList ( ) const
inlineinherited

Function GetFilledPolysList returns a reference to the list of filled polygons.

Returns
Reference to the list of filled polygons.

Definition at line 553 of file class_zone.h.

554  {
555  return m_FilledPolysList;
556  }
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806

References ZONE_CONTAINER::m_FilledPolysList.

Referenced by CN_LIST::Add(), CINFO3D_VISU::AddSolidAreasShapesToContainer(), CN_ZONE::CN_ZONE(), KIGFX::PCB_PAINTER::draw(), export_vrml_zones(), CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands(), PCB_IO::format(), DRC_MARKER_FACTORY::NewMarker(), and ZONE_CONTAINER::TransformSolidAreasShapesToPolygonSet().

◆ GetFilledPolysUseThickness()

bool ZONE_CONTAINER::GetFilledPolysUseThickness ( ) const
inlineinherited

◆ GetFillMode()

ZONE_FILL_MODE ZONE_CONTAINER::GetFillMode ( ) const
inlineinherited

Definition at line 156 of file class_zone.h.

156 { return m_FillMode; }
ZONE_FILL_MODE m_FillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:768

References ZONE_CONTAINER::m_FillMode.

Referenced by ZONE_FILLER::computeRawFilledArea(), ZONE_FILLER::fillSingleZone(), PCB_IO::format(), ZONE_CONTAINER::IsSame(), and ZONE_SETTINGS::operator<<().

◆ GetFlags()

◆ GetHashValue()

MD5_HASH ZONE_CONTAINER::GetHashValue ( )
inlineinherited
Returns
the hash value previously calculated by BuildHashValue(). used in zone filling calculations

Definition at line 696 of file class_zone.h.

696 { return m_filledPolysHash; }
MD5_HASH m_filledPolysHash
Definition: class_zone.h:808

References ZONE_CONTAINER::m_filledPolysHash.

◆ GetHatchFillTypeGap()

int ZONE_CONTAINER::GetHatchFillTypeGap ( ) const
inlineinherited

Definition at line 198 of file class_zone.h.

198 { return m_HatchFillTypeGap; }
int m_HatchFillTypeGap
Grid style shape: dist between center of lines (grid size) (0 -> solid shape)
Definition: class_zone.h:774

References ZONE_CONTAINER::m_HatchFillTypeGap.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), PCB_IO::format(), and ZONE_SETTINGS::operator<<().

◆ GetHatchFillTypeOrientation()

double ZONE_CONTAINER::GetHatchFillTypeOrientation ( ) const
inlineinherited

Definition at line 201 of file class_zone.h.

201 { return m_HatchFillTypeOrientation; }
double m_HatchFillTypeOrientation
Grid style shape: orientation in degrees of the grid lines.
Definition: class_zone.h:777

References ZONE_CONTAINER::m_HatchFillTypeOrientation.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), PCB_IO::format(), and ZONE_SETTINGS::operator<<().

◆ GetHatchFillTypeSmoothingLevel()

int ZONE_CONTAINER::GetHatchFillTypeSmoothingLevel ( ) const
inlineinherited

Definition at line 204 of file class_zone.h.

int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: class_zone.h:781

References ZONE_CONTAINER::m_HatchFillTypeSmoothingLevel.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), PCB_IO::format(), and ZONE_SETTINGS::operator<<().

◆ GetHatchFillTypeSmoothingValue()

double ZONE_CONTAINER::GetHatchFillTypeSmoothingValue ( ) const
inlineinherited

Definition at line 207 of file class_zone.h.

double m_HatchFillTypeSmoothingValue
Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap ...
Definition: class_zone.h:785

References ZONE_CONTAINER::m_HatchFillTypeSmoothingValue.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), PCB_IO::format(), and ZONE_SETTINGS::operator<<().

◆ GetHatchFillTypeThickness()

int ZONE_CONTAINER::GetHatchFillTypeThickness ( ) const
inlineinherited

Definition at line 195 of file class_zone.h.

195 { return m_HatchFillTypeThickness; }
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: class_zone.h:771

References ZONE_CONTAINER::m_HatchFillTypeThickness.

Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), PCB_IO::format(), and ZONE_SETTINGS::operator<<().

◆ GetHatchLines()

const std::vector<SEG>& ZONE_CONTAINER::GetHatchLines ( ) const
inlineinherited

Definition at line 688 of file class_zone.h.

688 { return m_HatchLines; }
std::vector< SEG > m_HatchLines
Definition: class_zone.h:813

References ZONE_CONTAINER::m_HatchLines.

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

◆ GetHatchPitch()

int ZONE_CONTAINER::GetHatchPitch ( ) const
inherited

Hatch related methods.

Function GetHatchPitch

Returns
int - the zone hatch pitch in iu.

Definition at line 952 of file class_zone.cpp.

953 {
954  return m_hatchPitch;
955 }

References ZONE_CONTAINER::m_hatchPitch.

Referenced by PCB_IO::format(), and ZONE_CONTAINER::operator=().

◆ GetHatchStyle()

ZONE_HATCH_STYLE ZONE_CONTAINER::GetHatchStyle ( ) const
inlineinherited

Definition at line 520 of file class_zone.h.

521  {
522  return m_hatchStyle;
523  }
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:811

References ZONE_CONTAINER::m_hatchStyle.

Referenced by PCB_IO::format(), BOARD::NormalizeAreaPolygon(), ZONE_SETTINGS::operator<<(), and ZONE_CONTAINER::operator=().

◆ GetHV45()

bool ZONE_CONTAINER::GetHV45 ( ) const
inlineinherited

Definition at line 690 of file class_zone.h.

690 { return m_hv45; }

References ZONE_CONTAINER::m_hv45.

Referenced by DRAWING_TOOL::DrawZone(), and ZONE_SETTINGS::operator<<().

◆ GetIsKeepout()

◆ GetLayer()

◆ GetLayerName()

wxString BOARD_ITEM::GetLayerName ( ) const
inherited

Function GetLayerName returns the name of the PCB layer on which the item resides.

Returns
wxString containing the layer name associated with this item.

Definition at line 68 of file class_board_item.cpp.

69 {
70  BOARD* board = GetBoard();
71 
72  if( board )
73  return board->GetLayerName( m_Layer );
74 
75  // If no parent, return standard name
77 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
PCB_LAYER_ID m_Layer
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Function GetStandardLayerName returns an "English Standard" name of a PCB layer when given aLayerNumb...
Definition: class_board.h:646

References BOARD_ITEM::GetBoard(), BOARD::GetLayerName(), BOARD::GetStandardLayerName(), and BOARD_ITEM::m_Layer.

Referenced by PCB_IO::format(), PCB_IO::formatLayer(), TEXTE_PCB::GetMsgPanelInfo(), ZONE_CONTAINER::GetMsgPanelInfo(), TEXTE_MODULE::GetMsgPanelInfo(), DRAWSEGMENT::GetMsgPanelInfo(), TEXTE_PCB::GetSelectMenuText(), EDGE_MODULE::GetSelectMenuText(), TRACK::GetSelectMenuText(), TEXTE_MODULE::GetSelectMenuText(), DIMENSION::GetSelectMenuText(), DRAWSEGMENT::GetSelectMenuText(), MODULE::GetSelectMenuText(), ZONE_CONTAINER::GetSelectMenuText(), and TEXT_MOD_GRID_TABLE::GetValue().

◆ GetLayerSet()

LSET ZONE_CONTAINER::GetLayerSet ( ) const
overridevirtualinherited

Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segment or VIA physically resides.

Returns
int - a layer mask, see layers_id_colors_visibility.h.

Reimplemented from BOARD_ITEM.

Definition at line 268 of file class_zone.cpp.

269 {
270  // TODO - Enable multi-layer zones for all zone types
271  // not just keepout zones
272  if( GetIsKeepout() )
273  {
274  return m_layerSet;
275  }
276  else
277  {
278  return LSET( m_Layer );
279  }
280 }
PCB_LAYER_ID m_Layer
LSET is a set of PCB_LAYER_IDs.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631

References ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::m_Layer, and ZONE_CONTAINER::m_layerSet.

Referenced by ZONE_CONTAINER::CommonLayerExists(), ZONE_CONTAINER::Flip(), PCB_IO::format(), ZONE_CONTAINER::GetColinearCorners(), ZONE_CONTAINER::initDataFromSrcInCopyCtor(), ZONE_SETTINGS::operator<<(), ZONE_CONTAINER::operator=(), ZONE_CONTAINER::Print(), PNS_KICAD_IFACE::syncZone(), and BOARD::TestAreaIntersections().

◆ GetLocalFlags()

int ZONE_CONTAINER::GetLocalFlags ( ) const
inlineinherited

Definition at line 241 of file class_zone.h.

241 { return m_localFlgs; }
int m_localFlgs
Variable used in polygon calculations.
Definition: class_zone.h:791

References ZONE_CONTAINER::m_localFlgs.

Referenced by BOARD::CombineAllAreasInNet(), and ZONE_CONTAINER::initDataFromSrcInCopyCtor().

◆ GetLocalRatsnestVisible()

bool BOARD_CONNECTED_ITEM::GetLocalRatsnestVisible ( ) const
inlineinherited

◆ GetMenuImage()

BITMAP_DEF ZONE_CONTAINER::GetMenuImage ( ) const
overridevirtualinherited

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

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

Returns
The menu image associated with the item.

Reimplemented from EDA_ITEM.

Definition at line 1157 of file class_zone.cpp.

1158 {
1159  return add_zone_xpm;
1160 }
const BITMAP_OPAQUE add_zone_xpm[1]
Definition: add_zone.cpp:74

References add_zone_xpm.

◆ GetMinThickness()

◆ GetMsgPanelInfo()

void ZONE_CONTAINER::GetMsgPanelInfo ( EDA_UNITS  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
overridevirtualinherited

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 681 of file class_zone.cpp.

682 {
683  wxString msg;
684 
685  msg = _( "Zone Outline" );
686 
687  // Display Cutout instead of Outline for holes inside a zone
688  // i.e. when num contour !=0
689  // Check whether the selected corner is in a hole; i.e., in any contour but the first one.
690  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
691  msg << wxT( " " ) << _( "(Cutout)" );
692 
693  aList.emplace_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) );
694 
695  if( GetIsKeepout() )
696  {
697  msg.Empty();
698 
699  if( GetDoNotAllowVias() )
700  AccumulateDescription( msg, _( "No via" ) );
701 
702  if( GetDoNotAllowTracks() )
703  AccumulateDescription( msg, _("No track") );
704 
706  AccumulateDescription( msg, _("No copper pour") );
707 
708  aList.emplace_back( MSG_PANEL_ITEM( _( "Keepout" ), msg, RED ) );
709  }
710  else if( IsOnCopperLayer() )
711  {
712  if( GetNetCode() >= 0 )
713  {
714  NETINFO_ITEM* net = GetNet();
715 
716  if( net )
717  msg = UnescapeString( net->GetNetname() );
718  else // Should not occur
719  msg = _( "<unknown>" );
720  }
721  else // a netcode < 0 is an error
722  msg = wxT( "<error>" );
723 
724  aList.emplace_back( MSG_PANEL_ITEM( _( "NetName" ), msg, RED ) );
725 
726  // Display net code : (useful in test or debug)
727  msg.Printf( wxT( "%d" ), GetNetCode() );
728  aList.emplace_back( MSG_PANEL_ITEM( _( "NetCode" ), msg, RED ) );
729 
730  // Display priority level
731  msg.Printf( wxT( "%d" ), GetPriority() );
732  aList.emplace_back( MSG_PANEL_ITEM( _( "Priority" ), msg, BLUE ) );
733  }
734  else
735  {
736  aList.emplace_back( MSG_PANEL_ITEM( _( "Non Copper Zone" ), wxEmptyString, RED ) );
737  }
738 
739  aList.emplace_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), BROWN ) );
740 
741  msg.Printf( wxT( "%d" ), (int) m_Poly->TotalVertices() );
742  aList.emplace_back( MSG_PANEL_ITEM( _( "Vertices" ), msg, BLUE ) );
743 
744  switch( m_FillMode )
745  {
747  msg = _( "Solid" ); break;
749  msg = _( "Hatched" ); break;
750  default:
751  msg = _( "Unknown" ); break;
752  }
753 
754  aList.emplace_back( MSG_PANEL_ITEM( _( "Fill Mode" ), msg, BROWN ) );
755 
756  // Useful for statistics :
757  msg.Printf( wxT( "%d" ), (int) m_HatchLines.size() );
758  aList.emplace_back( MSG_PANEL_ITEM( _( "Hatch Lines" ), msg, BLUE ) );
759 
760  if( !m_FilledPolysList.IsEmpty() )
761  {
762  msg.Printf( wxT( "%d" ), m_FilledPolysList.TotalVertices() );
763  aList.emplace_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) );
764  }
765 }
Definition: colors.h:57
int TotalVertices() const
Returns total number of vertices stored in the set.
int GetNetCode() const
Function GetNetCode.
NETINFO_ITEM * GetNet() const
Function GetNet Returns NET_INFO object for a given item.
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:788
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
bool GetDoNotAllowVias() const
Definition: class_zone.h:633
std::vector< SEG > m_HatchLines
Definition: class_zone.h:813
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:632
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:233
Definition: colors.h:60
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
void AccumulateDescription(wxString &aDesc, const wxString &aItem)
Utility to build comma separated lists in messages.
Definition: macros.h:74
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
ZONE_FILL_MODE m_FillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:768
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:100
#define _(s)
Definition: 3d_actions.cpp:31
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:131
bool GetDoNotAllowTracks() const
Definition: class_zone.h:634
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.
bool IsOnCopperLayer() const override
Function IsOnCopperLayer.
Definition: class_zone.cpp:210
Definition: colors.h:62

References _, AccumulateDescription(), BLUE, BROWN, DARKCYAN, ZONE_CONTAINER::GetDoNotAllowCopperPour(), ZONE_CONTAINER::GetDoNotAllowTracks(), ZONE_CONTAINER::GetDoNotAllowVias(), ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::GetLayerName(), BOARD_CONNECTED_ITEM::GetNet(), BOARD_CONNECTED_ITEM::GetNetCode(), NETINFO_ITEM::GetNetname(), ZONE_CONTAINER::GetPriority(), HATCH_PATTERN, SHAPE_POLY_SET::IsEmpty(), ZONE_CONTAINER::IsOnCopperLayer(), SHAPE_POLY_SET::VERTEX_INDEX::m_contour, ZONE_CONTAINER::m_CornerSelection, ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillMode, ZONE_CONTAINER::m_HatchLines, ZONE_CONTAINER::m_Poly, POLYGONS, RED, SHAPE_POLY_SET::TotalVertices(), and UnescapeString().

◆ GetNet()

NETINFO_ITEM* BOARD_CONNECTED_ITEM::GetNet ( ) const
inlineinherited

Function GetNet Returns NET_INFO object for a given item.

Definition at line 80 of file board_connected_item.h.

81  {
82  return m_netinfo;
83  }
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

References BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by PNS_PCBNEW_RULE_RESOLVER::DpNetPair(), DRAWING_TOOL::DrawVia(), ZONE_CONTAINER::GetMsgPanelInfo(), VIA::GetMsgPanelInfoBase(), TRACK::GetMsgPanelInfoBase_Common(), VIA::Print(), BOARD::SetAreasNetCodesFromNetNames(), and PCB_EDIT_FRAME::SetTrackSegmentWidth().

◆ GetNetClass()

NETCLASSPTR BOARD_CONNECTED_ITEM::GetNetClass ( ) const
inherited

Function GetNetClass returns the NETCLASS for this item.

Definition at line 96 of file board_connected_item.cpp.

97 {
98  NETCLASSPTR netclass = m_netinfo->GetNetClass();
99 
100  if( netclass )
101  return netclass;
102  else
103  return GetBoard()->GetDesignSettings().GetDefault();
104 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
NETCLASSPTR GetDefault() const
Function GetDefault.
NETCLASSPTR GetNetClass()
Definition: netinfo.h:122
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

References BOARD_ITEM::GetBoard(), BOARD_DESIGN_SETTINGS::GetDefault(), BOARD::GetDesignSettings(), NETINFO_ITEM::GetNetClass(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by DRC::doTrackDrc(), ZONE_CONTAINER::GetClearance(), VIA::GetDrillValue(), TRACK::GetMsgPanelInfo(), ROUTER_TOOL::prepareInteractive(), and DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().

◆ GetNetClassName()

wxString BOARD_CONNECTED_ITEM::GetNetClassName ( ) const
inherited

Function GetNetClassName returns a pointer to the netclass of the zone.

If the net is not found (can happen when a netlist is reread, and the net name does not exist, return the default net class (should not return a null pointer).

Returns
the Net Class name of this item

Definition at line 107 of file board_connected_item.cpp.

108 {
109  return m_netinfo->GetClassName();
110 }
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
wxString GetClassName() const
Function GetClassName returns the class name.
Definition: netinfo.h:131

References NETINFO_ITEM::GetClassName(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem().

◆ GetNetCode()

int BOARD_CONNECTED_ITEM::GetNetCode ( ) const
inlineinherited

Function GetNetCode.

Returns
int - the net code.

Definition at line 99 of file board_connected_item.h.

100  {
101  return m_netinfo ? m_netinfo->GetNet() : -1;
102  }
int GetNet() const
Function GetNet.
Definition: netinfo.h:225
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

References NETINFO_ITEM::GetNet(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by ZONE_FILLER::buildCopperItemClearances(), BOARD::CombineAllAreasInNet(), connectedItemFilter(), CreateRoutesSection(), DRC::doPadToPadsDrc(), DRC::doTrackDrc(), KIGFX::PCB_PAINTER::draw(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::Exchange_Module(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PNS::NODE::FindItemByParent(), PCB_IO::format(), DSN::SPECCTRA_DB::FromBOARD(), ZONE_CONTAINER::GetColinearCorners(), CONNECTIVITY_DATA::GetConnectedItems(), ZONE_CONTAINER::GetMsgPanelInfo(), TRACK::GetMsgPanelInfoBase_Common(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), hash_eda(), hasThermalConnection(), DIALOG_PAD_PROPERTIES::initValues(), ZONE_CONTAINER::IsSame(), DSN::SPECCTRA_DB::makeIMAGE(), AR_AUTOPLACER::nearestPad(), CONNECTIVITY_DATA::NearestUnconnectedTargets(), ROUTER_TOOL::NeighboringSegmentFilter(), CN_ITEM::Net(), BOARD::NormalizeAreaPolygon(), BOARD::OnAreaPolygonModified(), ZONE_SETTINGS::operator<<(), DIALOG_PAD_PROPERTIES::PadTypeSelected(), VIA::Print(), D_PAD::PrintShape(), process(), PCB_SELECTION_CONDITIONS::sameNetFunc(), SaveCopyOfZones(), SELECTION_TOOL::selectNet(), BOARD::SetAreasNetCodesFromNetNames(), setupDummyPadForHole(), PNS_KICAD_IFACE::syncPad(), PNS_KICAD_IFACE::syncTrack(), PNS_KICAD_IFACE::syncVia(), BOARD::TestAreaIntersections(), DRC::testZones(), DRC::TestZoneToZoneOutline(), BOARD::TracksInNet(), NETINFO_MAPPING::Update(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::visitItem(), and PCB_EDITOR_CONTROL::ZoneMerge().

◆ GetNetname()

const wxString& BOARD_CONNECTED_ITEM::GetNetname ( ) const
inlineinherited

Function GetNetname.

Returns
wxString - the full netname

Definition at line 119 of file board_connected_item.h.

120  {
121  return m_netinfo->GetNetname();
122  }
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:233
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

References NETINFO_ITEM::GetNetname(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by KIGFX::PCB_PAINTER::draw(), PCB_IO::format(), DSN::SPECCTRA_DB::FromBOARD(), D_PAD::GetMsgPanelInfo(), BOARD_NETLIST_UPDATER::getNetname(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), CN_CLUSTER::OriginNetName(), BRDITEMS_PLOTTER::PlotFilledAreas(), BRDITEMS_PLOTTER::PlotPad(), PlotStandardLayer(), and BOARD_NETLIST_UPDATER::updateCopperZoneNets().

◆ GetNetnameMsg()

wxString BOARD_CONNECTED_ITEM::GetNetnameMsg ( ) const
inlineinherited

Function GetNetnameMsg.

Returns
wxString - the full netname or "<no net>" in square braces, followed by "(Not Found)" if the netcode is undefined.

Definition at line 129 of file board_connected_item.h.

130  {
131  if( !GetBoard() )
132  return wxT( "[** NO BOARD DEFINED **]" );
133 
134  wxString netname = GetNetname();
135 
136  if( !netname.length() )
137  return wxT( "[<no net>]" );
138  else if( GetNetCode() < 0 )
139  return wxT( "[" + UnescapeString( netname ) + "](" + _( "Not Found" ) + ")" );
140  else
141  return wxT( "[" + UnescapeString( netname ) + "]" );
142  }
int GetNetCode() const
Function GetNetCode.
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
const wxString & GetNetname() const
Function GetNetname.
#define _(s)
Definition: 3d_actions.cpp:31
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:131

References _, BOARD_ITEM::GetBoard(), BOARD_CONNECTED_ITEM::GetNetCode(), BOARD_CONNECTED_ITEM::GetNetname(), and UnescapeString().

Referenced by TRACK::GetSelectMenuText(), VIA::GetSelectMenuText(), and ZONE_CONTAINER::GetSelectMenuText().

◆ getNextNumberInSequence()

int BOARD_ITEM::getNextNumberInSequence ( const std::set< int > &  aSeq,
bool  aFillSequenceGaps 
)
staticprotectedinherited

Definition at line 88 of file class_board_item.cpp.

89 {
90  if( aSeq.empty() )
91  return 1;
92 
93  // By default go to the end of the sequence
94  int candidate = *aSeq.rbegin();
95 
96  // Filling in gaps in pad numbering
97  if( aFillSequenceGaps )
98  {
99  // start at the beginning
100  candidate = *aSeq.begin();
101 
102  for( auto it : aSeq )
103  {
104  if( it - candidate > 1 )
105  break;
106 
107  candidate = it;
108  }
109  }
110 
111  ++candidate;
112 
113  return candidate;
114 }

Referenced by MODULE::GetNextPadName().

◆ GetNumCorners()

int ZONE_CONTAINER::GetNumCorners ( void  ) const
inlineinherited

Access to m_Poly parameters.

Definition at line 432 of file class_zone.h.

433  {
434  return m_Poly->TotalVertices();
435  }
int TotalVertices() const
Returns total number of vertices stored in the set.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References ZONE_CONTAINER::m_Poly, and SHAPE_POLY_SET::TotalVertices().

Referenced by ZONE_CONTAINER::BuildSmoothedPoly(), PCB_IO::format(), ZONE_CONTAINER::GetBoundingBox(), BOARD::OnAreaPolygonModified(), and ZONE_CONTAINER::Print().

◆ GetPadConnection()

ZONE_CONNECTION ZONE_CONTAINER::GetPadConnection ( D_PAD aPad = NULL) const
inherited

Definition at line 867 of file class_zone.cpp.

868 {
869  if( aPad == NULL || aPad->GetZoneConnection() == ZONE_CONNECTION::INHERITED )
870  return m_PadConnection;
871  else
872  return aPad->GetZoneConnection();
873 }
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:743
#define NULL
ZONE_CONNECTION GetZoneConnection() const
Definition: class_pad.cpp:725

References D_PAD::GetZoneConnection(), INHERITED, ZONE_CONTAINER::m_PadConnection, and NULL.

Referenced by ZONE_FILLER::buildCopperItemClearances(), PCB_IO::format(), hasThermalConnection(), ZONE_SETTINGS::operator<<(), and BOARD::TestAreaIntersections().

◆ GetParent()

BOARD_ITEM_CONTAINER* BOARD_ITEM::GetParent ( void  ) const
inlineinherited

Definition at line 125 of file class_board_item.h.

125 { return (BOARD_ITEM_CONTAINER*) m_Parent; }
EDA_ITEM * m_Parent
Linked list: Link (parent struct)
Definition: base_struct.h:177
Abstract interface for BOARD_ITEMs capable of storing other items inside.

References EDA_ITEM::m_Parent.

Referenced by POINT_EDITOR::addCorner(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), BOARD_ITEM::DeleteStructure(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), KIGFX::PCB_PAINTER::draw(), EditToolSelectionFilter(), PCB_IO::format(), FormatProbeItem(), BOARD_ITEM::GetBoard(), EDGE_MODULE::GetMsgPanelInfo(), EDGE_MODULE::GetSelectMenuText(), TEXTE_MODULE::GetSelectMenuText(), TEXTE_MODULE::GetShownText(), SELECTION_TOOL::GuessSelectionCandidates(), GENERAL_COLLECTOR::Inspect(), ARRAY_CREATOR::Invoke(), EDGE_MODULE::IsParentFlipped(), TEXTE_MODULE::IsParentFlipped(), LEGACY_PLUGIN::loadMODULE_TEXT(), BRDITEMS_PLOTTER::Plot_1_EdgeModule(), BRDITEMS_PLOTTER::PlotTextModule(), BOARD_COMMIT::Push(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SELECTION_TOOL::select(), SELECTION_TOOL::Selectable(), SwapItemData(), DRC::testCopperDrawItem(), DIALOG_TEXT_PROPERTIES::TransferDataToWindow(), ViewGetLOD(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ GetPosition()

const wxPoint ZONE_CONTAINER::GetPosition ( ) const
overridevirtualinherited
Returns
a wxPoint, position of the first point of the outline

Implements BOARD_ITEM.

Definition at line 198 of file class_zone.cpp.

199 {
200  return (wxPoint) GetCornerPosition( 0 );
201 }
const VECTOR2I & GetCornerPosition(int aCornerIndex) const
Definition: class_zone.h:472

References ZONE_CONTAINER::GetCornerPosition().

Referenced by EAGLE_PLUGIN::loadPlain(), DRC_MARKER_FACTORY::NewMarker(), PNS_KICAD_IFACE::syncZone(), and DRC::testZones().

◆ GetPriority()

unsigned ZONE_CONTAINER::GetPriority ( ) const
inlineinherited

◆ GetSelectedCorner()

int ZONE_CONTAINER::GetSelectedCorner ( ) const
inlineinherited

Definition at line 210 of file class_zone.h.

211  {
212  // Transform relative indices to global index
213  int globalIndex = -1;
214 
215  if( m_CornerSelection )
216  m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
217 
218  return globalIndex;
219  }
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:788
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
bool GetGlobalIndex(VERTEX_INDEX aRelativeIndices, int &aGlobalIdx)
Function GetGlobalIndex computes the global index of a vertex from the relative indices of polygon,...

References SHAPE_POLY_SET::GetGlobalIndex(), ZONE_CONTAINER::m_CornerSelection, and ZONE_CONTAINER::m_Poly.

◆ GetSelectMenuText()

wxString ZONE_CONTAINER::GetSelectMenuText ( EDA_UNITS  aUnits) const
overridevirtualinherited

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 935 of file class_zone.cpp.

936 {
937  wxString text;
938 
939  // Check whether the selected contour is a hole (contour index > 0)
940  if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
941  text << wxT( " " ) << _( "(Cutout)" );
942 
943  if( GetIsKeepout() )
944  text << wxT( " " ) << _( "(Keepout)" );
945  else
946  text << GetNetnameMsg();
947 
948  return wxString::Format( _( "Zone Outline %s on %s" ), text, GetLayerName() );
949 }
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:788
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
wxString GetNetnameMsg() const
Function GetNetnameMsg.
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
#define _(s)
Definition: 3d_actions.cpp:31
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.

References _, Format(), ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::GetLayerName(), BOARD_CONNECTED_ITEM::GetNetnameMsg(), SHAPE_POLY_SET::VERTEX_INDEX::m_contour, and ZONE_CONTAINER::m_CornerSelection.

Referenced by PNS_KICAD_IFACE::syncZone().

◆ GetShortNetname()

const wxString& BOARD_CONNECTED_ITEM::GetShortNetname ( ) const
inlineinherited

Function GetShortNetname.

Returns
wxString - the short netname

Definition at line 148 of file board_connected_item.h.

149  {
150  return m_netinfo->GetShortNetname();
151  }
const wxString & GetShortNetname() const
Function GetShortNetname.
Definition: netinfo.h:239
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

References NETINFO_ITEM::GetShortNetname(), and BOARD_CONNECTED_ITEM::m_netinfo.

Referenced by KIGFX::PCB_PAINTER::draw(), and D_PAD::PrintShape().

◆ GetState()

int EDA_ITEM::GetState ( int  type) const
inlineinherited

Definition at line 239 of file base_struct.h.

240  {
241  return m_Status & type;
242  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by SELECTION_TOOL::expandConnection(), TRACK::GetMsgPanelInfoBase_Common(), TRACK::IsLocked(), TRACK::Print(), and ZONE_CONTAINER::PrintFilledArea().

◆ GetStatus()

STATUS_FLAGS EDA_ITEM::GetStatus ( ) const
inlineinherited

Definition at line 252 of file base_struct.h.

252 { return m_Status; }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by PCB_IO::format().

◆ GetThermalReliefCopperBridge()

int ZONE_CONTAINER::GetThermalReliefCopperBridge ( D_PAD aPad = NULL) const
inherited

Definition at line 533 of file class_zone.cpp.

534 {
535  if( aPad == NULL || aPad->GetThermalWidth() == 0 )
537  else
538  return aPad->GetThermalWidth();
539 }
int m_ThermalReliefCopperBridge
Definition: class_zone.h:761
#define NULL
int GetThermalWidth() const
Definition: class_pad.cpp:736

References D_PAD::GetThermalWidth(), ZONE_CONTAINER::m_ThermalReliefCopperBridge, and NULL.

Referenced by ZONE_FILLER::buildThermalSpokes(), PCB_IO::format(), ZONE_SETTINGS::operator<<(), and BOARD::TestAreaIntersections().

◆ GetThermalReliefGap()

int ZONE_CONTAINER::GetThermalReliefGap ( D_PAD aPad = NULL) const
inherited

Definition at line 524 of file class_zone.cpp.

525 {
526  if( aPad == NULL || aPad->GetThermalGap() == 0 )
527  return m_ThermalReliefGap;
528  else
529  return aPad->GetThermalGap();
530 }
int GetThermalGap() const
Definition: class_pad.cpp:747
#define NULL
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:758

References D_PAD::GetThermalGap(), ZONE_CONTAINER::m_ThermalReliefGap, and NULL.

Referenced by ZONE_FILLER::buildThermalSpokes(), PCB_IO::format(), hasThermalConnection(), ZONE_FILLER::knockoutThermalReliefs(), ZONE_SETTINGS::operator<<(), and BOARD::TestAreaIntersections().

◆ GetTimeStamp()

◆ GetZoneClearance()

int ZONE_CONTAINER::GetZoneClearance ( ) const
inlineinherited

◆ HasFlag()

◆ Hatch()

void ZONE_CONTAINER::Hatch ( )
inherited

Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's attribute m_HatchLines.

Definition at line 988 of file class_zone.cpp.

989 {
990  UnHatch();
991 
993  return;
994 
995  // define range for hatch lines
996  int min_x = m_Poly->CVertex( 0 ).x;
997  int max_x = m_Poly->CVertex( 0 ).x;
998  int min_y = m_Poly->CVertex( 0 ).y;
999  int max_y = m_Poly->CVertex( 0 ).y;
1000 
1001  for( auto iterator = m_Poly->IterateWithHoles(); iterator; iterator++ )
1002  {
1003  if( iterator->x < min_x )
1004  min_x = iterator->x;
1005 
1006  if( iterator->x > max_x )
1007  max_x = iterator->x;
1008 
1009  if( iterator->y < min_y )
1010  min_y = iterator->y;
1011 
1012  if( iterator->y > max_y )
1013  max_y = iterator->y;
1014  }
1015 
1016  // Calculate spacing between 2 hatch lines
1017  int spacing;
1018 
1020  spacing = m_hatchPitch;
1021  else
1022  spacing = m_hatchPitch * 2;
1023 
1024  // set the "length" of hatch lines (the length on horizontal axis)
1025  int hatch_line_len = m_hatchPitch;
1026 
1027  // To have a better look, give a slope depending on the layer
1028  LAYER_NUM layer = GetLayer();
1029  int slope_flag = (layer & 1) ? 1 : -1; // 1 or -1
1030  double slope = 0.707106 * slope_flag; // 45 degrees slope
1031  int max_a, min_a;
1032 
1033  if( slope_flag == 1 )
1034  {
1035  max_a = KiROUND( max_y - slope * min_x );
1036  min_a = KiROUND( min_y - slope * max_x );
1037  }
1038  else
1039  {
1040  max_a = KiROUND( max_y - slope * max_x );
1041  min_a = KiROUND( min_y - slope * min_x );
1042  }
1043 
1044  min_a = (min_a / spacing) * spacing;
1045 
1046  // calculate an offset depending on layer number,
1047  // for a better look of hatches on a multilayer board
1048  int offset = (layer * 7) / 8;
1049  min_a += offset;
1050 
1051  // loop through hatch lines
1052  #define MAXPTS 200 // Usually we store only few values per one hatch line
1053  // depending on the complexity of the zone outline
1054 
1055  static std::vector<VECTOR2I> pointbuffer;
1056  pointbuffer.clear();
1057  pointbuffer.reserve( MAXPTS + 2 );
1058 
1059  for( int a = min_a; a < max_a; a += spacing )
1060  {
1061  // get intersection points for this hatch line
1062 
1063  // Note: because we should have an even number of intersections with the
1064  // current hatch line and the zone outline (a closed polygon,
1065  // or a set of closed polygons), if an odd count is found
1066  // we skip this line (should not occur)
1067  pointbuffer.clear();
1068 
1069  // Iterate through all vertices
1070  for( auto iterator = m_Poly->IterateSegmentsWithHoles(); iterator; iterator++ )
1071  {
1072  double x, y, x2, y2;
1073  int ok;
1074 
1075  SEG segment = *iterator;
1076 
1077  ok = FindLineSegmentIntersection( a, slope,
1078  segment.A.x, segment.A.y,
1079  segment.B.x, segment.B.y,
1080  &x, &y, &x2, &y2 );
1081 
1082  if( ok )
1083  {
1084  VECTOR2I point( KiROUND( x ), KiROUND( y ) );
1085  pointbuffer.push_back( point );
1086  }
1087 
1088  if( ok == 2 )
1089  {
1090  VECTOR2I point( KiROUND( x2 ), KiROUND( y2 ) );
1091  pointbuffer.push_back( point );
1092  }
1093 
1094  if( pointbuffer.size() >= MAXPTS ) // overflow
1095  {
1096  wxASSERT( 0 );
1097  break;
1098  }
1099  }
1100 
1101  // ensure we have found an even intersection points count
1102  // because intersections are the ends of segments
1103  // inside the polygon(s) and a segment has 2 ends.
1104  // if not, this is a strange case (a bug ?) so skip this hatch
1105  if( pointbuffer.size() % 2 != 0 )
1106  continue;
1107 
1108  // sort points in order of descending x (if more than 2) to
1109  // ensure the starting point and the ending point of the same segment
1110  // are stored one just after the other.
1111  if( pointbuffer.size() > 2 )
1112  sort( pointbuffer.begin(), pointbuffer.end(), sortEndsByDescendingX );
1113 
1114  // creates lines or short segments inside the complex polygon
1115  for( unsigned ip = 0; ip < pointbuffer.size(); ip += 2 )
1116  {
1117  int dx = pointbuffer[ip + 1].x - pointbuffer[ip].x;
1118 
1119  // Push only one line for diagonal hatch,
1120  // or for small lines < twice the line length
1121  // else push 2 small lines
1123  || std::abs( dx ) < 2 * hatch_line_len )
1124  {
1125  m_HatchLines.emplace_back( SEG( pointbuffer[ip], pointbuffer[ip + 1] ) );
1126  }
1127  else
1128  {
1129  double dy = pointbuffer[ip + 1].y - pointbuffer[ip].y;
1130  slope = dy / dx;
1131 
1132  if( dx > 0 )
1133  dx = hatch_line_len;
1134  else
1135  dx = -hatch_line_len;
1136 
1137  int x1 = KiROUND( pointbuffer[ip].x + dx );
1138  int x2 = KiROUND( pointbuffer[ip + 1].x - dx );
1139  int y1 = KiROUND( pointbuffer[ip].y + dx * slope );
1140  int y2 = KiROUND( pointbuffer[ip + 1].y - dx * slope );
1141 
1142  m_HatchLines.emplace_back( SEG( pointbuffer[ip].x, pointbuffer[ip].y, x1, y1 ) );
1143 
1144  m_HatchLines.emplace_back( SEG( pointbuffer[ip+1].x, pointbuffer[ip+1].y, x2, y2 ) );
1145  }
1146  }
1147  }
1148 }
SEGMENT_ITERATOR IterateSegmentsWithHoles()
Returns an iterator object, for all outlines in the set (with holes)
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:204
#define MAXPTS
bool sortEndsByDescendingX(const VECTOR2I &ref, const VECTOR2I &tst)
Definition: class_zone.cpp:982
std::vector< SEG > m_HatchLines
Definition: class_zone.h:813
ITERATOR IterateWithHoles(int aOutline)
Function IterateWithHoles.
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:811
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
Definition: seg.h:39
void UnHatch()
Function UnHatch clears the zone's hatch.
Definition: class_zone.cpp:974
VECTOR2I A
Definition: seg.h:47
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:61
VECTOR2I B
Definition: seg.h:48

References SEG::A, SEG::B, SHAPE_POLY_SET::CVertex(), DIAGONAL_EDGE, DIAGONAL_FULL, ZONE_CONTAINER::GetLayer(), SHAPE_POLY_SET::IsEmpty(), SHAPE_POLY_SET::IterateSegmentsWithHoles(), SHAPE_POLY_SET::IterateWithHoles(), KiROUND(), ZONE_CONTAINER::m_HatchLines, ZONE_CONTAINER::m_hatchPitch, ZONE_CONTAINER::m_hatchStyle, ZONE_CONTAINER::m_Poly, MAXPTS, NO_HATCH, sortEndsByDescendingX(), ZONE_CONTAINER::UnHatch(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOARD::CombineAreas(), ZONE_CONTAINER::Mirror(), ZONE_CONTAINER::Move(), ZONE_CONTAINER::MoveEdge(), BOARD::NormalizeAreaPolygon(), ZONE_CONTAINER::Rotate(), ZONE_CONTAINER::SetHatch(), and POINT_EDITOR::updateItem().

◆ HitTest() [1/2]

bool ZONE_CONTAINER::HitTest ( const wxPoint aPosition,
int  aAccuracy = 0 
) const
overridevirtualinherited

Function HitTest tests if a point is near an outline edge or a corner of this zone.

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

Reimplemented from EDA_ITEM.

Definition at line 551 of file class_zone.cpp.

552 {
553  // Normally accuracy is zoom-relative, but for the generic HitTest we just use
554  // a fixed (small) value.
555  int accuracy = std::max( aAccuracy, Millimeter2iu( 0.1 ) );
556 
557  return HitTestForCorner( aPosition, accuracy * 2 ) || HitTestForEdge( aPosition, accuracy );
558 }
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:576
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.
Definition: class_zone.cpp:590

References ZONE_CONTAINER::HitTestForCorner(), and ZONE_CONTAINER::HitTestForEdge().

◆ HitTest() [2/2]

bool ZONE_CONTAINER::HitTest ( const EDA_RECT aRect,
bool  aContained = true,
int  aAccuracy = 0 
) const
overridevirtualinherited

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

Reimplemented from EDA_ITEM.

Definition at line 604 of file class_zone.cpp.

605 {
606  // Calculate bounding box for zone
607  EDA_RECT bbox = GetBoundingBox();
608  bbox.Normalize();
609 
610  EDA_RECT arect = aRect;
611  arect.Normalize();
612  arect.Inflate( aAccuracy );
613 
614  if( aContained )
615  {
616  return arect.Contains( bbox );
617  }
618  else // Test for intersection between aBox and the polygon
619  // For a polygon, using its bounding box has no sense here
620  {
621  // Fast test: if aBox is outside the polygon bounding box, rectangles cannot intersect
622  if( !arect.Intersects( bbox ) )
623  return false;
624 
625  int count = m_Poly->TotalVertices();
626 
627  for( int ii = 0; ii < count; ii++ )
628  {
629  auto vertex = m_Poly->CVertex( ii );
630  auto vertexNext = m_Poly->CVertex( ( ii + 1 ) % count );
631 
632  // Test if the point is within the rect
633  if( arect.Contains( ( wxPoint ) vertex ) )
634  {
635  return true;
636  }
637 
638  // Test if this edge intersects the rect
639  if( arect.Intersects( ( wxPoint ) vertex, ( wxPoint ) vertexNext ) )
640  {
641  return true;
642  }
643  }
644 
645  return false;
646  }
647 }
int TotalVertices() const
Returns total number of vertices stored in the set.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox (virtual)
Definition: class_zone.cpp:497
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
bool Contains(const wxPoint &aPoint) const
Function Contains.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
void Normalize()
Function Normalize ensures that the height ant width are positive.
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.

References EDA_RECT::Contains(), SHAPE_POLY_SET::CVertex(), ZONE_CONTAINER::GetBoundingBox(), EDA_RECT::Inflate(), EDA_RECT::Intersects(), ZONE_CONTAINER::m_Poly, EDA_RECT::Normalize(), and SHAPE_POLY_SET::TotalVertices().

◆ HitTestFilledArea()

bool ZONE_CONTAINER::HitTestFilledArea ( const wxPoint aRefPos) const
inherited

Function HitTestFilledArea tests if the given wxPoint is within the bounds of a filled area of this zone.

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

Definition at line 675 of file class_zone.cpp.

676 {
677  return m_FilledPolysList.Contains( VECTOR2I( aRefPos.x, aRefPos.y ) );
678 }
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, int aAccuracy=0, bool aUseBBoxCaches=false) const
Returns true if a given subpolygon contains the point aP.
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806

References SHAPE_POLY_SET::Contains(), ZONE_CONTAINER::m_FilledPolysList, wxPoint::x, and wxPoint::y.

Referenced by CN_ANCHOR::ConnectedItemsCount(), GENERAL_COLLECTOR::Inspect(), and CN_ANCHOR::IsDangling().

◆ HitTestForCorner() [1/2]

bool ZONE_CONTAINER::HitTestForCorner ( const wxPoint refPos,
int  aAccuracy,
SHAPE_POLY_SET::VERTEX_INDEX aCornerHit 
) const
inherited

Function HitTestForCorner tests if the given wxPoint is near a corner.

Parameters
refPosis the wxPoint to test.
aAccuracyincrease the item bounding box by this amount.
aCornerHit[out] is the index of the closest vertex found, useless when return value is false.
Returns
bool - true if some corner was found to be closer to refPos than aClearance; false otherwise.

Definition at line 576 of file class_zone.cpp.

578 {
579  return m_Poly->CollideVertex( VECTOR2I( refPos ), aCornerHit, aAccuracy );
580 }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
bool CollideVertex(const VECTOR2I &aPoint, VERTEX_INDEX &aClosestVertex, int aClearance=0)
Function CollideVertex Checks whether aPoint collides with any vertex of any of the contours of the p...

References SHAPE_POLY_SET::CollideVertex(), and ZONE_CONTAINER::m_Poly.

Referenced by ZONE_CONTAINER::HitTest(), ZONE_CONTAINER::HitTestForCorner(), GENERAL_COLLECTOR::Inspect(), and ZONE_CONTAINER::SetSelectedCorner().

◆ HitTestForCorner() [2/2]

bool ZONE_CONTAINER::HitTestForCorner ( const wxPoint refPos,
int  aAccuracy 
) const
inherited

Function HitTestForCorner tests if the given wxPoint is near a corner.

Parameters
refPosis the wxPoint to test.
aAccuracyincrease the item bounding box by this amount.
Returns
bool - true if some corner was found to be closer to refPos than aClearance; false otherwise.

Definition at line 583 of file class_zone.cpp.

584 {
586  return HitTestForCorner( refPos, aAccuracy, dummy );
587 }
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:576
Struct VERTEX_INDEX.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.

References dummy(), and ZONE_CONTAINER::HitTestForCorner().

◆ HitTestForEdge() [1/2]

bool ZONE_CONTAINER::HitTestForEdge ( const wxPoint refPos,
int  aAccuracy,
SHAPE_POLY_SET::VERTEX_INDEX aCornerHit 
) const
inherited

Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.

Parameters
refPosis the wxPoint to test.
aAccuracyincrease the item bounding box by this amount.
aCornerHit[out] is the index of the closest vertex found, useless when return value is false.
Returns
bool - true if some edge was found to be closer to refPos than aClearance.

Definition at line 590 of file class_zone.cpp.

592 {
593  return m_Poly->CollideEdge( VECTOR2I( refPos ), aCornerHit, aAccuracy );
594 }
bool CollideEdge(const VECTOR2I &aPoint, VERTEX_INDEX &aClosestVertex, int aClearance=0)
Function CollideEdge Checks whether aPoint collides with any edge of any of the contours of the polyg...
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References SHAPE_POLY_SET::CollideEdge(), and ZONE_CONTAINER::m_Poly.

Referenced by ZONE_CONTAINER::HitTest(), ZONE_CONTAINER::HitTestForEdge(), GENERAL_COLLECTOR::Inspect(), and ZONE_CONTAINER::SetSelectedCorner().

◆ HitTestForEdge() [2/2]

bool ZONE_CONTAINER::HitTestForEdge ( const wxPoint refPos,
int  aAccuracy 
) const
inherited

Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.

Parameters
refPosis the wxPoint to test.
aAccuracyincrease the item bounding box by this amount.
Returns
bool - true if some edge was found to be closer to refPos than aClearance.

Definition at line 597 of file class_zone.cpp.

598 {
600  return HitTestForEdge( refPos, aAccuracy, dummy );
601 }
Struct VERTEX_INDEX.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.
Definition: class_zone.cpp:590

References dummy(), and ZONE_CONTAINER::HitTestForEdge().

◆ initDataFromSrcInCopyCtor()

void ZONE_CONTAINER::initDataFromSrcInCopyCtor ( const ZONE_CONTAINER aZone)
protectedinherited

Copy aZone data to me members are expected non initialize in this.

copyDataFromSrc() is expected to be called only from a copy constructor.

Definition at line 128 of file class_zone.cpp.

129 {
130  // members are expected non initialize in this.
131  // initDataFromSrcInCopyCtor() is expected to be called
132  // only from a copy constructor.
133  m_isKeepout = aZone.m_isKeepout;
134  SetLayerSet( aZone.GetLayerSet() );
135 
136  m_Poly = new SHAPE_POLY_SET( *aZone.m_Poly );
137 
138  // For corner moving, corner index to drag, or nullptr if no selection
139  m_CornerSelection = nullptr;
140  m_IsFilled = aZone.m_IsFilled;
141  m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
144  m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons)
145  m_hv45 = aZone.m_hv45;
146  m_priority = aZone.m_priority;
151  m_FillSegmList = aZone.m_FillSegmList; // vector <> copy
152 
156 
159 
160  m_hatchStyle = aZone.m_hatchStyle;
161  m_hatchPitch = aZone.m_hatchPitch;
162  m_HatchLines = aZone.m_HatchLines;
163 
169 
170  SetLocalFlags( aZone.GetLocalFlags() );
171 
172  // Now zone type and layer are set, transfer net info
173  // (has meaning only for copper zones)
174  m_netinfo = aZone.m_netinfo;
175 
176  SetNeedRefill( aZone.NeedRefill() );
177 }
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:744
bool m_doNotAllowTracks
Definition: class_zone.h:741
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:788
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:796
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:743
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:268
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:239
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: class_zone.h:781
int m_ThermalReliefCopperBridge
Definition: class_zone.h:761
std::vector< SEG > m_HatchLines
Definition: class_zone.h:813
SHAPE_POLY_SET.
double m_HatchFillTypeOrientation
Grid style shape: orientation in degrees of the grid lines.
Definition: class_zone.h:777
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:749
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:811
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
unsigned m_priority
Definition: class_zone.h:729
bool m_doNotAllowVias
Definition: class_zone.h:740
int m_cornerSmoothingType
Definition: class_zone.h:720
double m_HatchFillTypeSmoothingValue
Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap ...
Definition: class_zone.h:785
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
unsigned int m_cornerRadius
Definition: class_zone.h:721
bool NeedRefill() const
Definition: class_zone.h:173
bool m_doNotAllowCopperPour
Definition: class_zone.h:739
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:758
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:745
ZONE_FILL_MODE m_FillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:768
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: class_zone.h:771
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
void SetLocalFlags(int aFlags)
Definition: class_zone.h:242
int m_HatchFillTypeGap
Grid style shape: dist between center of lines (grid size) (0 -> solid shape)
Definition: class_zone.h:774
int GetLocalFlags() const
Definition: class_zone.h:241
bool m_FilledPolysUseThickness
outline of filled polygons have thickness.
Definition: class_zone.h:746
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 SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References SHAPE_POLY_SET::Append(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::GetLocalFlags(), ZONE_CONTAINER::m_cornerRadius, ZONE_CONTAINER::m_CornerSelection, ZONE_CONTAINER::m_cornerSmoothingType, ZONE_CONTAINER::m_doNotAllowCopperPour, ZONE_CONTAINER::m_doNotAllowTracks, ZONE_CONTAINER::m_doNotAllowVias, ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FilledPolysUseThickness, ZONE_CONTAINER::m_FillMode, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_HatchFillTypeGap, ZONE_CONTAINER::m_HatchFillTypeOrientation, ZONE_CONTAINER::m_HatchFillTypeSmoothingLevel, ZONE_CONTAINER::m_HatchFillTypeSmoothingValue, ZONE_CONTAINER::m_HatchFillTypeThickness, ZONE_CONTAINER::m_HatchLines, ZONE_CONTAINER::m_hatchPitch, ZONE_CONTAINER::m_hatchStyle, ZONE_CONTAINER::m_hv45, ZONE_CONTAINER::m_IsFilled, ZONE_CONTAINER::m_isKeepout, BOARD_CONNECTED_ITEM::m_netinfo, ZONE_CONTAINER::m_PadConnection, ZONE_CONTAINER::m_Poly, ZONE_CONTAINER::m_priority, ZONE_CONTAINER::m_ThermalReliefCopperBridge, ZONE_CONTAINER::m_ThermalReliefGap, ZONE_CONTAINER::m_ZoneClearance, ZONE_CONTAINER::m_ZoneMinThickness, ZONE_CONTAINER::NeedRefill(), ZONE_CONTAINER::SetLayerSet(), ZONE_CONTAINER::SetLocalFlags(), and ZONE_CONTAINER::SetNeedRefill().

Referenced by MODULE_ZONE_CONTAINER(), and ZONE_CONTAINER::ZONE_CONTAINER().

◆ IsBrightened()

bool EDA_ITEM::IsBrightened ( ) const
inlineinherited

◆ IsConnected()

bool BOARD_CONNECTED_ITEM::IsConnected ( ) const
inlineoverridevirtualinherited

Reimplemented from BOARD_ITEM.

Definition at line 71 of file board_connected_item.h.

72  {
73  return true;
74  }

◆ IsDragging()

bool EDA_ITEM::IsDragging ( ) const
inlineinherited

Definition at line 221 of file base_struct.h.

221 { return m_Flags & IS_DRAGGED; }
#define IS_DRAGGED
Item being dragged.
Definition: base_struct.h:122
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:184

References IS_DRAGGED, and EDA_ITEM::m_Flags.

Referenced by DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), KIGFX::SCH_PAINTER::setDeviceColors(), and ShowClearance().

◆ IsFilled()

bool ZONE_CONTAINER::IsFilled ( ) const
inlineinherited

Definition at line 170 of file class_zone.h.

170 { return m_IsFilled; }
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:749

References ZONE_CONTAINER::m_IsFilled.

Referenced by PCB_EDIT_FRAME::Edit_Zone_Params(), export_vrml_zones(), PCB_IO::format(), and DRC_MARKER_FACTORY::NewMarker().

◆ IsHighlighted()

bool EDA_ITEM::IsHighlighted ( ) const
inlineinherited

Definition at line 225 of file base_struct.h.

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

References HIGHLIGHTED, and EDA_ITEM::m_Flags.

Referenced by SCH_COMPONENT::ClearAllHighlightFlags(), KIGFX::SCH_PAINTER::draw(), KIGFX::PCB_RENDER_SETTINGS::GetColor(), KIGFX::SCH_PAINTER::getRenderColor(), and KIGFX::SCH_VIEW::HighlightItem().

◆ IsLocked()

virtual bool BOARD_ITEM::IsLocked ( ) const
inlinevirtualinherited

Function IsLocked.

Returns
bool - true if the object is locked, else false

Reimplemented in MODULE, and TRACK.

Definition at line 198 of file class_board_item.h.

199  {
200  // only MODULEs & TRACKs can be locked at this time.
201  return false;
202  }

Referenced by PCBNEW_CONTROL::DeleteItemCursor(), EditToolSelectionFilter(), GENERAL_COLLECTOR::Inspect(), and PCB_EDITOR_CONTROL::modifyLockSelected().

◆ IsModified()

bool EDA_ITEM::IsModified ( ) const
inlineinherited

Definition at line 219 of file base_struct.h.

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

References IS_CHANGED, and EDA_ITEM::m_Flags.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ IsMoving()

◆ IsNew()

◆ IsOnCopperLayer()

bool ZONE_CONTAINER::IsOnCopperLayer ( ) const
overridevirtualinherited

Function IsOnCopperLayer.

Returns
true if this zone is on a copper layer, false if on a technical layer

Reimplemented from BOARD_ITEM.

Definition at line 210 of file class_zone.cpp.

211 {
212  if( GetIsKeepout() )
213  {
214  return ( m_layerSet & LSET::AllCuMask() ).count() > 0;
215  }
216  else
217  {
218  return IsCopperLayer( GetLayer() );
219  }
220 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:686
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:204
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.

References LSET::AllCuMask(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayer(), IsCopperLayer(), and ZONE_CONTAINER::m_layerSet.

Referenced by GERBER_JOBFILE_WRITER::addJSONDesignRules(), BOARD_NETLIST_UPDATER::cacheCopperZoneConnections(), ZONE_FILLER::fillSingleZone(), ZONE_CONTAINER::GetMsgPanelInfo(), BRDITEMS_PLOTTER::PlotFilledAreas(), BOARD::SetAreasNetCodesFromNetNames(), DRC::testZones(), DRC::TestZoneToZoneOutline(), ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon(), and BOARD_NETLIST_UPDATER::updateCopperZoneNets().

◆ IsOnLayer()

bool ZONE_CONTAINER::IsOnLayer ( PCB_LAYER_ID  aLayer) const
overridevirtualinherited

Function IsOnLayer tests to see if this object is on the given layer.

Is virtual so objects like D_PAD, which reside on multiple layers can do their own form of testing.

Parameters
aLayerThe layer to test for.
Returns
bool - true if on given layer, else false.

Reimplemented from BOARD_ITEM.

Definition at line 301 of file class_zone.cpp.

302 {
303  if( GetIsKeepout() )
304  return m_layerSet.test( aLayer );
305 
306  return BOARD_ITEM::IsOnLayer( aLayer );
307 }
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Function IsOnLayer tests to see if this object is on the given layer.
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631

References ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::IsOnLayer(), and ZONE_CONTAINER::m_layerSet.

Referenced by CINFO3D_VISU::createLayers(), KIGFX::PCB_PAINTER::draw(), DSN::SPECCTRA_DB::FromBOARD(), and ZONE_CONTAINER::Print().

◆ IsReplaceable()

virtual bool EDA_ITEM::IsReplaceable ( ) const
inlinevirtualinherited

Function IsReplaceable.

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

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

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

Definition at line 515 of file base_struct.h.

515 { return false; }

Referenced by EDA_ITEM::Matches().

◆ IsResized()

bool EDA_ITEM::IsResized ( ) const
inlineinherited

Definition at line 224 of file base_struct.h.

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

References IS_RESIZED, and EDA_ITEM::m_Flags.

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

◆ IsSame()

bool ZONE_CONTAINER::IsSame ( const ZONE_CONTAINER aZoneToCompare)
inherited

Function IsSame tests if 2 zones are equivalent: 2 zones are equivalent if they have same parameters and same outlines info, filling is not taken into account.

Function IsSame test is 2 zones are equivalent: 2 zones are equivalent if they have same parameters and same outlines info relative to filling is not take in account.

Parameters
aZoneToCompare= zone to compare with "this"

Definition at line 62 of file zones_functions_for_undo_redo.cpp.

63 {
64  // compare basic parameters:
65  if( GetLayer() != aZoneToCompare.GetLayer() )
66  return false;
67 
68  if( GetNetCode() != aZoneToCompare.GetNetCode() )
69  return false;
70 
71  if( GetPriority() != aZoneToCompare.GetPriority() )
72  return false;
73 
74  // Compare zone specific parameters
75  if( GetIsKeepout() != aZoneToCompare.GetIsKeepout() )
76  return false;
77 
78  if( GetIsKeepout() )
79  {
80  if( GetDoNotAllowCopperPour() != aZoneToCompare.GetDoNotAllowCopperPour() )
81  return false;
82 
83  if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() )
84  return false;
85 
86  if( GetDoNotAllowTracks() != aZoneToCompare.GetDoNotAllowTracks() )
87  return false;
88  }
89 
90  if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance )
91  return false;
92 
93  if( m_ZoneMinThickness != aZoneToCompare.GetMinThickness() )
94  return false;
95 
96  if( m_FillMode != aZoneToCompare.GetFillMode() )
97  return false;
98 
99  if( m_PadConnection != aZoneToCompare.m_PadConnection )
100  return false;
101 
102  if( m_ThermalReliefGap != aZoneToCompare.m_ThermalReliefGap )
103  return false;
104 
106  return false;
107 
108 
109  // Compare outlines
110  wxASSERT( m_Poly ); // m_Poly == NULL Should never happen
111  wxASSERT( aZoneToCompare.Outline() );
112 
113  if( Outline() != aZoneToCompare.Outline() ) // Compare vector
114  return false;
115 
116  return true;
117 }
int m_ZoneClearance
Clearance value in internal units.
Definition: class_zone.h:744
int GetNetCode() const
Function GetNetCode.
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:204
SHAPE_POLY_SET * Outline()
Definition: class_zone.h:247
bool GetDoNotAllowVias() const
Definition: class_zone.h:633
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:743
int m_ThermalReliefCopperBridge
Definition: class_zone.h:761
ZONE_FILL_MODE GetFillMode() const
Definition: class_zone.h:156
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
bool GetDoNotAllowCopperPour() const
Definition: class_zone.h:632
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:758
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:745
ZONE_FILL_MODE m_FillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:768
unsigned GetPriority() const
Function GetPriority.
Definition: class_zone.h:100
int GetMinThickness() const
Definition: class_zone.h:186
bool GetDoNotAllowTracks() const
Definition: class_zone.h:634

References ZONE_CONTAINER::GetDoNotAllowCopperPour(), ZONE_CONTAINER::GetDoNotAllowTracks(), ZONE_CONTAINER::GetDoNotAllowVias(), ZONE_CONTAINER::GetFillMode(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayer(), ZONE_CONTAINER::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), ZONE_CONTAINER::GetPriority(), ZONE_CONTAINER::m_FillMode, ZONE_CONTAINER::m_PadConnection, ZONE_CONTAINER::m_Poly, ZONE_CONTAINER::m_ThermalReliefCopperBridge, ZONE_CONTAINER::m_ThermalReliefGap, ZONE_CONTAINER::m_ZoneClearance, ZONE_CONTAINER::m_ZoneMinThickness, and ZONE_CONTAINER::Outline().

Referenced by UpdateCopyOfZonesList().

◆ IsSelected()

◆ IsTrack()

bool BOARD_ITEM::IsTrack ( ) const
inlineinherited

Function IsTrack tests to see if this object is a track or via (or microvia).

form of testing.

Returns
bool - true if a track or via, else false.

Definition at line 189 of file class_board_item.h.

190  {
191  return ( Type() == PCB_TRACE_T ) || ( Type() == PCB_VIA_T );
192  }
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
KICAD_T Type() const
Function Type()
Definition: base_struct.h:207

References PCB_TRACE_T, PCB_VIA_T, and EDA_ITEM::Type().

◆ IsType()

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

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

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

Reimplemented in SCH_LABEL, SCH_FIELD, and SCH_LINE.

Definition at line 284 of file base_struct.h.

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

References EOT, EDA_ITEM::m_StructType, and SCH_LOCATE_ANY_T.

Referenced by SCH_LINE_WIRE_BUS_TOOL::IsDrawingBus(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingLine(), SCH_LINE_WIRE_BUS_TOOL::IsDrawingWire(), SCH_LINE::IsType(), SCH_FIELD::IsType(), SCH_LABEL::IsType(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::RequestSelection(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), EDA_ITEM::Visit(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().

◆ IsWireImage()

bool EDA_ITEM::IsWireImage ( ) const
inlineinherited

Definition at line 222 of file base_struct.h.

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

References IS_WIRE_IMAGE, and EDA_ITEM::m_Flags.

◆ Iterate()

SHAPE_POLY_SET::ITERATOR ZONE_CONTAINER::Iterate ( )
inlineinherited

Function Iterate returns an iterator to visit all points of the zone's main outline without holes.

Returns
SHAPE_POLY_SET::ITERATOR - an iterator to visit the zone vertices without holes.

Definition at line 442 of file class_zone.h.

443  {
444  return m_Poly->Iterate();
445  }
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...
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References SHAPE_POLY_SET::Iterate(), and ZONE_CONTAINER::m_Poly.

◆ IterateForward() [1/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::deque< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use the main queue instead

Definition at line 397 of file base_struct.h.

401  {
402  for( auto it : aList )
403  {
404  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
406  return SEARCH_RESULT::QUIT;
407  }
408 
410  }
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...

References CONTINUE, QUIT, and EDA_ITEM::Visit().

Referenced by GERBER_FILE_IMAGE::Visit(), and BOARD::Visit().

◆ IterateForward() [2/2]

template<class T >
static SEARCH_RESULT EDA_ITEM::IterateForward ( std::vector< T > &  aList,
INSPECTOR  inspector,
void *  testData,
const KICAD_T  scanTypes[] 
)
inlinestaticinherited

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

IterateForward( EDA_ITEM*, INSPECTOR, void*, const KICAD_T )

This changes first parameter to avoid the DList and use std::vector instead

Definition at line 418 of file base_struct.h.

420  {
421  for( auto it : aList )
422  {
423  if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
425  return SEARCH_RESULT::QUIT;
426  }
427 
429  }
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...

References CONTINUE, QUIT, and EDA_ITEM::Visit().

◆ IterateWithHoles()

SHAPE_POLY_SET::ITERATOR ZONE_CONTAINER::IterateWithHoles ( )
inlineinherited

Function IterateWithHoles returns an iterator to visit all points of the zone's main outline with holes.

Returns
SHAPE_POLY_SET::ITERATOR - an iterator to visit the zone vertices with holes.

Definition at line 452 of file class_zone.h.

453  {
454  return m_Poly->IterateWithHoles();
455  }
ITERATOR IterateWithHoles(int aOutline)
Function IterateWithHoles.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References SHAPE_POLY_SET::IterateWithHoles(), and ZONE_CONTAINER::m_Poly.

Referenced by PCB_IO::format(), and DSN::SPECCTRA_DB::FromBOARD().

◆ Matches() [1/2]

virtual bool EDA_ITEM::Matches ( wxFindReplaceData &  aSearchData,
void *  aAuxData 
)
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.
Returns
True if the item's text matches the search criteria in aSearchData.

Reimplemented in SCH_COMPONENT, SCH_SHEET, SCH_TEXT, SCH_FIELD, SCH_SHEET_PIN, LIB_PIN, MARKER_PCB, SCH_PIN, SCH_MARKER, TEXTE_MODULE, and TEXTE_PCB.

Definition at line 471 of file base_struct.h.

472  {
473  return false;
474  }

Referenced by SCH_EDITOR_CONTROL::HasMatch(), TEXTE_PCB::Matches(), TEXTE_MODULE::Matches(), SCH_MARKER::Matches(), MARKER_PCB::Matches(), LIB_PIN::Matches(), SCH_SHEET_PIN::Matches(), SCH_FIELD::Matches(), SCH_TEXT::Matches(), SCH_SHEET::Matches(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Matches() [2/2]

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

Function Matches compares aText against search criteria in aSearchData.

This is a helper function for simplify derived class logic.

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

Definition at line 153 of file base_struct.cpp.

154 {
155  wxString text = aText;
156  wxString searchText = aSearchData.GetFindString();
157 
158  // Don't match if searching for replaceable item and the item doesn't support text replace.
159  if( (aSearchData.GetFlags() & FR_SEARCH_REPLACE) && !IsReplaceable() )
160  return false;
161 
162  if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
163  return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );
164 
165  if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
166  {
167  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
168  return text.Matches( searchText );
169 
170  return text.MakeUpper().Matches( searchText.MakeUpper() );
171  }
172 
173  if( aSearchData.GetFlags() & wxFR_MATCHCASE )
174  return aText.Find( searchText ) != wxNOT_FOUND;
175 
176  return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
177 }
virtual bool IsReplaceable() const
Function IsReplaceable.
Definition: base_struct.h:515

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

◆ Mirror()

void ZONE_CONTAINER::Mirror ( const wxPoint aMirrorRef,
bool  aMirrorLeftRight 
)
inherited

Function Mirror Mirror the outlines , relative to a given horizontal axis the layer is not changed.

Parameters
aMirrorRef= axis position
aMirrorLeftRightmirror across Y axis (otherwise mirror across X)

Definition at line 842 of file class_zone.cpp.

843 {
844  // ZONE_CONTAINERs mirror about the x-axis (why?!?)
845  m_Poly->Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
846 
847  Hatch();
848 
849  m_FilledPolysList.Mirror( aMirrorLeftRight, !aMirrorLeftRight, VECTOR2I( aMirrorRef ) );
850 
851  for( SEG& seg : m_FillSegmList )
852  {
853  if( aMirrorLeftRight )
854  {
855  MIRROR( seg.A.x, aMirrorRef.x );
856  MIRROR( seg.B.x, aMirrorRef.x );
857  }
858  else
859  {
860  MIRROR( seg.A.y, aMirrorRef.y );
861  MIRROR( seg.B.y, aMirrorRef.y );
862  }
863  }
864 }
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:796
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
void Mirror(bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 })
Mirrors the line points about y or x (or both)
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:123
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
Definition: seg.h:39
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:988

References ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, MIRROR(), SHAPE_POLY_SET::Mirror(), wxPoint::x, and wxPoint::y.

Referenced by ZONE_CONTAINER::Flip().

◆ Move() [1/2]

void BOARD_ITEM::Move ( const VECTOR2I aMoveVector)
inlineinherited

Definition at line 237 of file class_board_item.h.

238  {
239  Move( wxPoint( aMoveVector.x, aMoveVector.y ) );
240  }
virtual void Move(const wxPoint &aMoveVector)
Function Move move this object.

References BOARD_ITEM::Move(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Move() [2/2]

void ZONE_CONTAINER::Move ( const wxPoint offset)
overridevirtualinherited

Function Move Move the outlines.

Parameters
offset= moving vector

Reimplemented from BOARD_ITEM.

Definition at line 770 of file class_zone.cpp.

771 {
772  /* move outlines */
773  m_Poly->Move( offset );
774 
775  Hatch();
776 
777  m_FilledPolysList.Move( offset );
778 
779  for( SEG& seg : m_FillSegmList )
780  {
781  seg.A += VECTOR2I( offset );
782  seg.B += VECTOR2I( offset );
783  }
784 }
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:796
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
void Move(const VECTOR2I &aVector) override
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
Definition: seg.h:39
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:988

References ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, and SHAPE_POLY_SET::Move().

◆ MoveEdge()

void ZONE_CONTAINER::MoveEdge ( const wxPoint offset,
int  aEdge 
)
inherited

Function MoveEdge Move the outline Edge.

Parameters
offset= moving vector
aEdge= start point of the outline edge

Definition at line 787 of file class_zone.cpp.

788 {
789  int next_corner;
790 
791  if( m_Poly->GetNeighbourIndexes( aEdge, nullptr, &next_corner ) )
792  {
793  m_Poly->SetVertex( aEdge, m_Poly->CVertex( aEdge ) + VECTOR2I( offset ) );
794  m_Poly->SetVertex( next_corner, m_Poly->CVertex( next_corner ) + VECTOR2I( offset ) );
795  Hatch();
796 
797  SetNeedRefill( true );
798  }
799 }
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
bool GetNeighbourIndexes(int aGlobalIndex, int *aPrevious, int *aNext)
Returns the global indexes of the previous and the next corner of the aGlobalIndex-th corner of a con...
void SetVertex(const VERTEX_INDEX &aIndex, const VECTOR2I &aPos)
Function SetVertex Accessor function to set the position of a specific point.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:988
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References SHAPE_POLY_SET::CVertex(), SHAPE_POLY_SET::GetNeighbourIndexes(), ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_Poly, ZONE_CONTAINER::SetNeedRefill(), and SHAPE_POLY_SET::SetVertex().

◆ NeedRefill()

bool ZONE_CONTAINER::NeedRefill ( ) const
inlineinherited

Definition at line 173 of file class_zone.h.

173 { return m_needRefill; }
bool m_needRefill
False when a zone was refilled, true after changes in zone params.
Definition: class_zone.h:755

References ZONE_CONTAINER::m_needRefill.

Referenced by ZONE_CONTAINER::initDataFromSrcInCopyCtor().

◆ NewHole()

void ZONE_CONTAINER::NewHole ( )
inlineinherited

Function NewHole creates a new hole on the zone; i.e., a new contour on the zone's outline.

Definition at line 505 of file class_zone.h.

506  {
507  m_Poly->NewHole();
508  }
int NewHole(int aOutline=-1)
Creates a new hole in a given outline
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References ZONE_CONTAINER::m_Poly, and SHAPE_POLY_SET::NewHole().

◆ operator<()

bool EDA_ITEM::operator< ( const EDA_ITEM aItem) const
inherited

Test if another item is less than this object.

Parameters
aItem- Item to compare against.
Returns
- True if aItem is less than the item.

Definition at line 207 of file base_struct.cpp.

208 {
209  wxFAIL_MSG( wxString::Format( wxT( "Less than operator not defined for item type %s." ),
210  GetChars( GetClass() ) ) );
211 
212  return false;
213 }
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:101
virtual wxString GetClass() const =0
Function GetClass returns the class name.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

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

◆ operator=()

MODULE_ZONE_CONTAINER & MODULE_ZONE_CONTAINER::operator= ( const MODULE_ZONE_CONTAINER aOther)

Definition at line 1329 of file class_zone.cpp.

1330 {
1331  ZONE_CONTAINER::operator=( aOther );
1332  return *this;
1333 }
ZONE_CONTAINER & operator=(const ZONE_CONTAINER &aOther)
Definition: class_zone.cpp:84

References ZONE_CONTAINER::operator=().

◆ Outline() [1/2]

◆ Outline() [2/2]

const SHAPE_POLY_SET* ZONE_CONTAINER::Outline ( ) const
inlineinherited

Definition at line 248 of file class_zone.h.

248 { return const_cast< SHAPE_POLY_SET* >( m_Poly ); }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References ZONE_CONTAINER::m_Poly.

◆ Print()

void ZONE_CONTAINER::Print ( PCB_BASE_FRAME aFrame,
wxDC *  DC,
const wxPoint offset = ZeroOffset 
)
overridevirtualinherited

Function Print Prints the zone outline.

Parameters
aFrame= current Frame
DC= current Device Context
aDrawMode= GR_OR, GR_XOR, GR_COPY ..
offset= Draw offset (usually wxPoint(0,0))

Implements BOARD_ITEM.

Definition at line 310 of file class_zone.cpp.

311 {
312  if( !DC )
313  return;
314 
315  wxPoint seg_start, seg_end;
316  PCB_LAYER_ID curr_layer = aFrame->GetActiveLayer();
317  BOARD* brd = GetBoard();
318  PCB_LAYER_ID draw_layer = UNDEFINED_LAYER;
319 
320  LSET layers = GetLayerSet() & brd->GetVisibleLayers();
321 
322  // If there are no visible layers, return
323  if( layers.count() == 0 )
324  return;
325 
326  /* Keepout zones can exist on multiple layers
327  * Thus, determining which color to use to render them is a bit tricky.
328  * In descending order of priority:
329  *
330  * 1. If in GR_HIGHLIGHT mode:
331  * a. If zone is on selected layer, use layer color!
332  * b. Else, use grey
333  * 1. Not in GR_HIGHLIGHT mode
334  * a. If zone is on selected layer, use layer color
335  * b. Else, use color of top-most (visible) layer
336  *
337  */
338  if( GetIsKeepout() )
339  {
340  // At least one layer must be provided!
341  assert( GetLayerSet().count() > 0 );
342 
343  // Not on any visible layer?
344  if( layers.count() == 0 )
345  return;
346 
347  // Is keepout zone present on the selected layer?
348  if( layers.test( curr_layer ) )
349  {
350  draw_layer = curr_layer;
351  }
352  else
353  {
354  // Select the first (top) visible layer
355  if( layers.count() > 0 )
356  {
357  draw_layer = layers.Seq()[0];
358  }
359  else
360  {
361  draw_layer = GetLayerSet().Seq()[0];
362  }
363  }
364 
365  }
366  /* Non-keepout zones are easier to deal with
367  */
368  else
369  {
370  if( brd->IsLayerVisible( GetLayer() ) == false )
371  return;
372 
373  draw_layer = GetLayer();
374  }
375 
376  assert( draw_layer != UNDEFINED_LAYER );
377 
378  auto color = aFrame->Settings().Colors().GetLayerColor( draw_layer );
379 
380  auto displ_opts = aFrame->GetDisplayOptions();
381 
382  if( displ_opts.m_ContrastModeDisplay )
383  {
384  if( !IsOnLayer( curr_layer ) )
386  }
387 
388  color.a = 0.588;
389 
390  // draw the lines
391  std::vector<wxPoint> lines;
392  lines.reserve( (GetNumCorners() * 2) + 2 );
393 
394  // Iterate through the segments of the outline
395  for( auto iterator = m_Poly->IterateSegmentsWithHoles(); iterator; iterator++ )
396  {
397  // Create the segment
398  SEG segment = *iterator;
399 
400  lines.push_back( static_cast<wxPoint>( segment.A ) + offset );
401  lines.push_back( static_cast<wxPoint>( segment.B ) + offset );
402  }
403 
404  GRLineArray( nullptr, DC, lines, 0, color );
405 
406  // draw hatches
407  lines.clear();
408  lines.reserve( (m_HatchLines.size() * 2) + 2 );
409 
410  for( unsigned ic = 0; ic < m_HatchLines.size(); ic++ )
411  {
412  seg_start = static_cast<wxPoint>( m_HatchLines[ic].A ) + offset;
413  seg_end = static_cast<wxPoint>( m_HatchLines[ic].B ) + offset;
414  lines.push_back( seg_start );
415  lines.push_back( seg_end );
416  }
417 
418  GRLineArray( nullptr, DC, lines, 0, color );
419 }
SEGMENT_ITERATOR IterateSegmentsWithHoles()
Returns an iterator object, for all outlines in the set (with holes)
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Function IsOnLayer tests to see if this object is on the given layer.
Definition: class_zone.cpp:301
int color
Definition: DXF_plotter.cpp:61
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:204
LSET GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:377
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use Display options are relative to...
virtual LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_zone.cpp:268
virtual PCB_LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
std::vector< SEG > m_HatchLines
Definition: class_zone.h:813
PCB_GENERAL_SETTINGS & Settings()
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
int GetNumCorners(void) const
Access to m_Poly parameters.
Definition: class_zone.h:432
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
COLORS_DESIGN_SETTINGS & Colors()
Definition: seg.h:39
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:449
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
VECTOR2I A
Definition: seg.h:47
void GRLineArray(EDA_RECT *aClipBox, wxDC *aDC, std::vector< wxPoint > &aLines, int aWidth, COLOR4D aColor)
Function GRLineArray draws an array of lines (not a polygon).
Definition: gr_basic.cpp:284
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
VECTOR2I B
Definition: seg.h:48

References SEG::A, SEG::B, color, PCB_GENERAL_SETTINGS::Colors(), DARKDARKGRAY, PCB_BASE_FRAME::GetActiveLayer(), BOARD_ITEM::GetBoard(), PCB_BASE_FRAME::GetDisplayOptions(), ZONE_CONTAINER::GetIsKeepout(), ZONE_CONTAINER::GetLayer(), COLORS_DESIGN_SETTINGS::GetLayerColor(), ZONE_CONTAINER::GetLayerSet(), ZONE_CONTAINER::GetNumCorners(), BOARD::GetVisibleLayers(), GRLineArray(), BOARD::IsLayerVisible(), ZONE_CONTAINER::IsOnLayer(), SHAPE_POLY_SET::IterateSegmentsWithHoles(), ZONE_CONTAINER::m_HatchLines, ZONE_CONTAINER::m_Poly, LSET::Seq(), PCB_BASE_FRAME::Settings(), and UNDEFINED_LAYER.

◆ PrintFilledArea()

void ZONE_CONTAINER::PrintFilledArea ( PCB_BASE_FRAME aFrame,
wxDC *  DC,
const wxPoint offset = ZeroOffset 
)
inherited

Function PrintFilledArea Draws the filled area for this zone (polygon list .m_FilledPolysList)

Parameters
aFrame= current Frame
DC= current Device Context
offset= Draw offset (usually wxPoint(0,0))
aDrawMode= GR_OR, GR_XOR, GR_COPY ..

Definition at line 422 of file class_zone.cpp.

423 {
424  static std::vector <wxPoint> CornersBuffer;
425 
426  BOARD* brd = GetBoard();
428  auto& displ_opts = aFrame->GetDisplayOptions();
429  bool outline_mode = displ_opts.m_DisplayZonesMode == 2;
430 
431  if( DC == NULL )
432  return;
433 
434  if( displ_opts.m_DisplayZonesMode == 1 ) // Do not show filled areas
435  return;
436 
437  if( m_FilledPolysList.IsEmpty() ) // Nothing to draw
438  return;
439 
440  if( brd->IsLayerVisible( GetLayer() ) == false )
441  return;
442 
443  color.a = 0.588;
444 
445  for( int ic = 0; ic < m_FilledPolysList.OutlineCount(); ic++ )
446  {
447  const SHAPE_LINE_CHAIN& path = m_FilledPolysList.COutline( ic );
448 
449  CornersBuffer.clear();
450 
451  wxPoint p0;
452 
453  for( int j = 0; j < path.PointCount(); j++ )
454  {
455  const VECTOR2I& corner = path.CPoint( j );
456 
457  wxPoint coord( corner.x + offset.x, corner.y + offset.y );
458 
459  if( j == 0 )
460  p0 = coord;
461 
462  CornersBuffer.push_back( coord );
463  }
464 
465  CornersBuffer.push_back( p0 );
466 
467  // Draw outlines:
468  int outline_thickness = GetFilledPolysUseThickness() ? GetMinThickness() : 0;
469 
470  if( ( outline_thickness > 1 ) || outline_mode )
471  {
472  int ilim = CornersBuffer.size() - 1;
473 
474  for( int is = 0, ie = ilim; is <= ilim; ie = is, is++ )
475  {
476  // Draw only basic outlines, not extra segments.
477  if( !displ_opts.m_DisplayPcbTrackFill || GetState( FORCE_SKETCH ) )
478  {
479  GRCSegm( nullptr, DC, CornersBuffer[is], CornersBuffer[ie],
480  outline_thickness, color );
481  }
482  else
483  {
484  GRFilledSegment( nullptr, DC, CornersBuffer[is], CornersBuffer[ie],
485  outline_thickness, color );
486  }
487  }
488  }
489 
490  // Draw fill:
491  if( !outline_mode )
492  GRPoly( nullptr, DC, CornersBuffer.size(), &CornersBuffer[0], true, 0, color, color );
493  }
494 }
int OutlineCount() const
Returns the number of outlines in the set
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:542
int color
Definition: DXF_plotter.cpp:61
bool IsEmpty() const
Returns true if the set is empty (no polygons at all)
virtual PCB_LAYER_ID GetLayer() const override
Function GetLayer returns the primary layer this item is on.
Definition: class_zone.cpp:204
bool GetFilledPolysUseThickness() const
Definition: class_zone.h:599
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:312
int PointCount() const
Function PointCount()
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use Display options are relative to...
const VECTOR2I & CPoint(int aIndex) const
Function Point()
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
#define NULL
PCB_GENERAL_SETTINGS & Settings()
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
COLORS_DESIGN_SETTINGS & Colors()
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:449
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
SHAPE_LINE_CHAIN.
void GRFilledSegment(EDA_RECT *aClipBox, wxDC *aDC, wxPoint aStart, wxPoint aEnd, int aWidth, COLOR4D aColor)
Definition: gr_basic.cpp:423
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
int GetMinThickness() const
Definition: class_zone.h:186
#define FORCE_SKETCH
Definition: pcbnew.h:44
int GetState(int type) const
Definition: base_struct.h:239
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References color, PCB_GENERAL_SETTINGS::Colors(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), FORCE_SKETCH, BOARD_ITEM::GetBoard(), PCB_BASE_FRAME::GetDisplayOptions(), ZONE_CONTAINER::GetFilledPolysUseThickness(), ZONE_CONTAINER::GetLayer(), COLORS_DESIGN_SETTINGS::GetLayerColor(), ZONE_CONTAINER::GetMinThickness(), EDA_ITEM::GetState(), GRCSegm(), GRFilledSegment(), GRPoly(), SHAPE_POLY_SET::IsEmpty(), BOARD::IsLayerVisible(), PCB_DISPLAY_OPTIONS::m_DisplayZonesMode, ZONE_CONTAINER::m_FilledPolysList, NULL, SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::PointCount(), PCB_BASE_FRAME::Settings(), wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

◆ RawPolysList()

SHAPE_POLY_SET& ZONE_CONTAINER::RawPolysList ( )
inlineinherited

Definition at line 617 of file class_zone.h.

618  {
619  return m_RawPolysList;
620  }
SHAPE_POLY_SET m_RawPolysList
Definition: class_zone.h:807

References ZONE_CONTAINER::m_RawPolysList.

◆ RemoveAllContours()

void ZONE_CONTAINER::RemoveAllContours ( void  )
inlineinherited

Definition at line 467 of file class_zone.h.

468  {
470  }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.

References ZONE_CONTAINER::m_Poly, and SHAPE_POLY_SET::RemoveAllContours().

◆ Replace() [1/2]

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

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

181 {
182  wxString searchString = (aSearchData.GetFlags() & wxFR_MATCHCASE) ? aText : aText.Upper();
183 
184  int result = searchString.Find( (aSearchData.GetFlags() & wxFR_MATCHCASE) ?
185  aSearchData.GetFindString() :
186  aSearchData.GetFindString().Upper() );
187 
188  if( result == wxNOT_FOUND )
189  return false;
190 
191  wxString prefix = aText.Left( result );
192  wxString suffix;
193 
194  if( aSearchData.GetFindString().length() + result < aText.length() )
195  suffix = aText.Right( aText.length() - ( aSearchData.GetFindString().length() + result ) );
196 
197  wxLogTrace( traceFindReplace, wxT( "Replacing '%s', prefix '%s', replace '%s', suffix '%s'." ),
198  GetChars( aText ), GetChars( prefix ), GetChars( aSearchData.GetReplaceString() ),
199  GetChars( suffix ) );
200 
201  aText = prefix + aSearchData.GetReplaceString() + suffix;
202 
203  return true;
204 }
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:101

References GetChars(), and traceFindReplace.

Referenced by SCH_FIELD::Replace(), EDA_TEXT::Replace(), SCH_SHEET::Replace(), and SCH_EDITOR_CONTROL::ReplaceAndFindNext().

◆ Replace() [2/2]

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

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

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

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

Reimplemented in SCH_SHEET, SCH_TEXT, SCH_FIELD, and SCH_SHEET_PIN.

Definition at line 503 of file base_struct.h.

503 { return false; }

◆ Rotate() [1/2]

void BOARD_ITEM::Rotate ( const VECTOR2I aRotCentre,
double  aAngle 
)
inlineinherited

Definition at line 253 of file class_board_item.h.

254  {
255  Rotate( wxPoint( aRotCentre.x, aRotCentre.y ), aAngle );
256  }
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Function Rotate Rotate this object.

References BOARD_ITEM::Rotate(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Rotate() [2/2]

void ZONE_CONTAINER::Rotate ( const wxPoint centre,
double  angle 
)
overridevirtualinherited

Function Rotate Move the outlines.

Parameters
centre= rot centre
angle= in 0.1 degree

Reimplemented from BOARD_ITEM.

Definition at line 802 of file class_zone.cpp.

803 {
804  wxPoint pos;
805 
806  angle = -DECIDEG2RAD( angle );
807 
808  m_Poly->Rotate( angle, VECTOR2I( centre ) );
809  Hatch();
810 
811  /* rotate filled areas: */
812  m_FilledPolysList.Rotate( angle, VECTOR2I( centre ) );
813 
814  for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ )
815  {
816  wxPoint a( m_FillSegmList[ic].A );
817  RotatePoint( &a, centre, angle );
818  m_FillSegmList[ic].A = a;
819  wxPoint b( m_FillSegmList[ic].B );
820  RotatePoint( &b, centre, angle );
821  m_FillSegmList[ic].B = a;
822  }
823 }
void Rotate(double aAngle, const VECTOR2I &aCenter={ 0, 0 })
Function Rotate rotates all vertices by a given angle.
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:796
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
VECTOR2< int > VECTOR2I
Definition: vector2d.h:594
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
double DECIDEG2RAD(double deg)
Definition: trigo.h:214
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:988

References PNS::angle(), DECIDEG2RAD(), ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_FilledPolysList, ZONE_CONTAINER::m_FillSegmList, ZONE_CONTAINER::m_Poly, SHAPE_POLY_SET::Rotate(), and RotatePoint().

Referenced by EAGLE_PLUGIN::loadPlain().

◆ SetBrightened()

void EDA_ITEM::SetBrightened ( )
inlineinherited

Definition at line 231 of file base_struct.h.

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

References BRIGHTENED, and EDA_ITEM::SetFlags().

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

◆ SetCornerPosition()

void ZONE_CONTAINER::SetCornerPosition ( int  aCornerIndex,
wxPoint  new_pos 
)
inlineinherited

Definition at line 483 of file class_zone.h.

484  {
485  SHAPE_POLY_SET::VERTEX_INDEX relativeIndices;
486 
487  // Convert global to relative indices
488  if( m_Poly->GetRelativeIndices( aCornerIndex, &relativeIndices ) )
489  {
490  if( m_Poly->CVertex( relativeIndices ).x != new_pos.x
491  || m_Poly->CVertex( relativeIndices ).y != new_pos.y )
492  {
493  SetNeedRefill( true );
494  m_Poly->SetVertex( relativeIndices, new_pos );
495  }
496  }
497  else
498  throw( std::out_of_range( "aCornerIndex-th vertex does not exist" ) );
499  }
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Returns the index-th vertex in a given hole outline within a given outline
Struct VERTEX_INDEX.
void SetVertex(const VERTEX_INDEX &aIndex, const VECTOR2I &aPos)
Function SetVertex Accessor function to set the position of a specific point.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Function GetRelativeIndices.
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References SHAPE_POLY_SET::CVertex(), SHAPE_POLY_SET::GetRelativeIndices(), ZONE_CONTAINER::m_Poly, ZONE_CONTAINER::SetNeedRefill(), SHAPE_POLY_SET::SetVertex(), wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

◆ SetCornerRadius()

void ZONE_CONTAINER::SetCornerRadius ( unsigned int  aRadius)
inherited

Definition at line 542 of file class_zone.cpp.

543 {
544  if( m_cornerRadius != aRadius )
545  SetNeedRefill( true );
546 
547  m_cornerRadius = aRadius;
548 }
unsigned int m_cornerRadius
Definition: class_zone.h:721
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References ZONE_CONTAINER::m_cornerRadius, and ZONE_CONTAINER::SetNeedRefill().

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetCornerSmoothingType()

void ZONE_CONTAINER::SetCornerSmoothingType ( int  aType)
inlineinherited

Definition at line 591 of file class_zone.h.

591 { m_cornerSmoothingType = aType; };
int m_cornerSmoothingType
Definition: class_zone.h:720

References ZONE_CONTAINER::m_cornerSmoothingType.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetDoNotAllowCopperPour()

void ZONE_CONTAINER::SetDoNotAllowCopperPour ( bool  aEnable)
inlineinherited

◆ SetDoNotAllowTracks()

void ZONE_CONTAINER::SetDoNotAllowTracks ( bool  aEnable)
inlineinherited

◆ SetDoNotAllowVias()

void ZONE_CONTAINER::SetDoNotAllowVias ( bool  aEnable)
inlineinherited

◆ SetFilledPolysList()

void ZONE_CONTAINER::SetFilledPolysList ( SHAPE_POLY_SET aPolysList)
inlineinherited

Function SetFilledPolysList sets the list of filled polygons.

Definition at line 567 of file class_zone.h.

568  {
569  m_FilledPolysList = aPolysList;
570  }
SHAPE_POLY_SET m_FilledPolysList
Definition: class_zone.h:806

References ZONE_CONTAINER::m_FilledPolysList.

Referenced by ZONE_FILLER::Fill().

◆ SetFilledPolysUseThickness()

void ZONE_CONTAINER::SetFilledPolysUseThickness ( bool  aOption)
inlineinherited

Definition at line 600 of file class_zone.h.

600 { m_FilledPolysUseThickness = aOption; }
bool m_FilledPolysUseThickness
outline of filled polygons have thickness.
Definition: class_zone.h:746

References ZONE_CONTAINER::m_FilledPolysUseThickness.

Referenced by ZONE_FILLER::Fill().

◆ SetFillMode()

void ZONE_CONTAINER::SetFillMode ( ZONE_FILL_MODE  aFillMode)
inlineinherited

Definition at line 155 of file class_zone.h.

155 { m_FillMode = aFillMode; }
ZONE_FILL_MODE m_FillMode
How to fill areas: ZONE_FILL_MODE::POLYGONS => use solid polygons ZONE_FILL_MODE::HATCH_PATTERN => us...
Definition: class_zone.h:768

References ZONE_CONTAINER::m_FillMode.

Referenced by export_vrml_zones(), ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetFillSegments()

void ZONE_CONTAINER::SetFillSegments ( const ZONE_SEGMENT_FILL aSegments)
inlineinherited

Definition at line 612 of file class_zone.h.

613  {
614  m_FillSegmList = aSegments;
615  }
ZONE_SEGMENT_FILL m_FillSegmList
Segments used to fill the zone (m_FillMode ==1 ), when fill zone by segment is used.
Definition: class_zone.h:796

References ZONE_CONTAINER::m_FillSegmList.

◆ SetFlags()

void EDA_ITEM::SetFlags ( STATUS_FLAGS  aMask)
inlineinherited

Definition at line 255 of file base_struct.h.

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

References EDA_ITEM::m_Flags.

Referenced by SCH_EAGLE_PLUGIN::addBusEntries(), PCB_BASE_FRAME::AddModuleToBoard(), PCBNEW_CONTROL::AppendBoard(), SCH_EDIT_FRAME::ConvertPart(), SCH_EDIT_FRAME::ConvertTextType(), SCH_EDIT_FRAME::CreateNewText(), LIB_PIN_TOOL::CreatePin(), SCH_EDIT_FRAME::CreateSheetPin(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), LIB_DRAWING_TOOLS::DrawShape(), SCH_EDIT_TOOL::Duplicate(), LIB_EDIT_FRAME::GetComponentFromRedoList(), LIB_EDIT_FRAME::GetComponentFromUndoList(), SCH_MOVE_TOOL::getConnectedDragItems(), KIGFX::SCH_VIEW::HighlightItem(), EDIT_POINTS_FACTORY::Make(), TRACKS_CLEANER::mergeCollinearSegments(), SCH_MOVE_TOOL::moveItem(), LIB_MOVE_TOOL::moveItem(), KIGFX::ORIGIN_VIEWITEM::ORIGIN_VIEWITEM(), LIB_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PCB_EDITOR_CONTROL::PlaceModule(), DRAWING_TOOL::PlaceText(), SCH_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_TOOL::RepeatDrawItem(), LIB_PIN_TOOL::RepeatPin(), LIB_EDIT_FRAME::SaveCopyInUndoList(), EE_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::SelectPoint(), SCH_EDIT_FRAME::SelectUnit(), EDA_ITEM::SetBrightened(), LIB_PIN::SetConversion(), EDA_ITEM::SetHighlighted(), EDA_ITEM::SetModified(), EDA_ITEM::SetSelected(), EDA_ITEM::SetWireImage(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), WS_DATA_ITEM::SyncDrawItems(), WS_DATA_ITEM_TEXT::SyncDrawItems(), DIALOG_TARGET_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), LIB_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().

◆ SetForceVisible()

void EDA_ITEM::SetForceVisible ( bool  aEnable)
inlineinherited

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

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

Definition at line 306 of file base_struct.h.

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

References EDA_ITEM::m_forceVisible.

◆ SetHatch()

void ZONE_CONTAINER::SetHatch ( ZONE_HATCH_STYLE  aHatchStyle,
int  aHatchPitch,
bool  aRebuildHatch 
)
inherited

Function SetHatch sets all hatch parameters for the zone.

Parameters
aHatchStyleis the style of the hatch, specified as one of HATCH_STYLE possible values.
aHatchPitchis the hatch pitch in iu.
aRebuildHatchis a flag to indicate whether to re-hatch after having set the previous parameters.

Definition at line 958 of file class_zone.cpp.

959 {
960  SetHatchPitch( aHatchPitch );
961  m_hatchStyle = aHatchStyle;
962 
963  if( aRebuildHatch )
964  Hatch();
965 }
void SetHatchPitch(int aPitch)
Function SetHatchPitch sets the hatch pitch parameter for the zone.
Definition: class_zone.cpp:968
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:811
void Hatch()
Function Hatch computes the hatch lines depending on the hatch parameters and stores it in the zone's...
Definition: class_zone.cpp:988

References ZONE_CONTAINER::Hatch(), ZONE_CONTAINER::m_hatchStyle, and ZONE_CONTAINER::SetHatchPitch().

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPlain().

◆ SetHatchFillTypeGap()

void ZONE_CONTAINER::SetHatchFillTypeGap ( int  aStep)
inlineinherited

Definition at line 199 of file class_zone.h.

199 { m_HatchFillTypeGap = aStep; }
int m_HatchFillTypeGap
Grid style shape: dist between center of lines (grid size) (0 -> solid shape)
Definition: class_zone.h:774

References ZONE_CONTAINER::m_HatchFillTypeGap.

Referenced by ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetHatchFillTypeOrientation()

void ZONE_CONTAINER::SetHatchFillTypeOrientation ( double  aStep)
inlineinherited

Definition at line 202 of file class_zone.h.

202 { m_HatchFillTypeOrientation = aStep; }
double m_HatchFillTypeOrientation
Grid style shape: orientation in degrees of the grid lines.
Definition: class_zone.h:777

References ZONE_CONTAINER::m_HatchFillTypeOrientation.

Referenced by ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetHatchFillTypeSmoothingLevel()

void ZONE_CONTAINER::SetHatchFillTypeSmoothingLevel ( int  aLevel)
inlineinherited

Definition at line 205 of file class_zone.h.

205 { m_HatchFillTypeSmoothingLevel = aLevel; }
int m_HatchFillTypeSmoothingLevel
Grid pattern smoothing type, similar to corner smoothing type 0 = no smoothing, 1 = fillet,...
Definition: class_zone.h:781

References ZONE_CONTAINER::m_HatchFillTypeSmoothingLevel.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchFillTypeSmoothingValue()

void ZONE_CONTAINER::SetHatchFillTypeSmoothingValue ( double  aValue)
inlineinherited

Definition at line 208 of file class_zone.h.

208 { m_HatchFillTypeSmoothingValue = aValue; }
double m_HatchFillTypeSmoothingValue
Grid pattern smoothing value for smoothing shape size calculations this is the ratio between the gap ...
Definition: class_zone.h:785

References ZONE_CONTAINER::m_HatchFillTypeSmoothingValue.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetHatchFillTypeThickness()

void ZONE_CONTAINER::SetHatchFillTypeThickness ( int  aThickness)
inlineinherited

Definition at line 196 of file class_zone.h.

196 { m_HatchFillTypeThickness = aThickness; }
int m_HatchFillTypeThickness
Grid style shape: thickness of lines (if 0 -> solid shape)
Definition: class_zone.h:771

References ZONE_CONTAINER::m_HatchFillTypeThickness.

Referenced by ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetHatchPitch()

void ZONE_CONTAINER::SetHatchPitch ( int  aPitch)
inherited

Function SetHatchPitch sets the hatch pitch parameter for the zone.

Parameters
aPitchis the hatch pitch in iu.

Definition at line 968 of file class_zone.cpp.

969 {
970  m_hatchPitch = aPitch;
971 }

References ZONE_CONTAINER::m_hatchPitch.

Referenced by ZONE_CONTAINER::operator=(), and ZONE_CONTAINER::SetHatch().

◆ SetHatchStyle()

void ZONE_CONTAINER::SetHatchStyle ( ZONE_HATCH_STYLE  aStyle)
inlineinherited

Definition at line 525 of file class_zone.h.

526  {
527  m_hatchStyle = aStyle;
528  }
ZONE_HATCH_STYLE m_hatchStyle
Definition: class_zone.h:811

References ZONE_CONTAINER::m_hatchStyle.

Referenced by BOARD::InsertArea(), EAGLE_PLUGIN::loadPolygon(), and ZONE_CONTAINER::operator=().

◆ SetHighlighted()

void EDA_ITEM::SetHighlighted ( )
inlineinherited

Definition at line 230 of file base_struct.h.

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

References HIGHLIGHTED, and EDA_ITEM::SetFlags().

◆ SetHV45()

void ZONE_CONTAINER::SetHV45 ( bool  aConstrain)
inlineinherited

Definition at line 691 of file class_zone.h.

691 { m_hv45 = aConstrain; }

References ZONE_CONTAINER::m_hv45.

Referenced by ZONE_SETTINGS::ExportSetting().

◆ SetIsFilled()

void ZONE_CONTAINER::SetIsFilled ( bool  isFilled)
inlineinherited

Definition at line 171 of file class_zone.h.

171 { m_IsFilled = isFilled; }
bool m_IsFilled
True when a zone was filled, false after deleting the filled areas.
Definition: class_zone.h:749

References ZONE_CONTAINER::m_IsFilled.

Referenced by ZONE_FILLER::Fill().

◆ SetIsKeepout()

void ZONE_CONTAINER::SetIsKeepout ( bool  aEnable)
inlineinherited

◆ SetLayer()

void ZONE_CONTAINER::SetLayer ( PCB_LAYER_ID  aLayer)
overridevirtualinherited

Function SetLayer sets the layer this item is on.

Parameters
aLayerThe layer number. is virtual because some items (in fact: class DIMENSION) have a slightly different initialization

Reimplemented from BOARD_ITEM.

Definition at line 231 of file class_zone.cpp.

232 {
233  SetLayerSet( LSET( aLayer ) );
234 
235  m_Layer = aLayer;
236 }
PCB_LAYER_ID m_Layer
void SetLayerSet(LSET aLayerSet)
Definition: class_zone.cpp:239
LSET is a set of PCB_LAYER_IDs.

References BOARD_ITEM::m_Layer, and ZONE_CONTAINER::SetLayerSet().

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), ZONE_SETTINGS::ExportSetting(), ZONE_CONTAINER::Flip(), BOARD::InsertArea(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), and PlotSolderMaskLayer().

◆ SetLayerSet()

void ZONE_CONTAINER::SetLayerSet ( LSET  aLayerSet)
inherited

Definition at line 239 of file class_zone.cpp.

240 {
241  if( GetIsKeepout() )
242  {
243  // Keepouts can only exist on copper layers
244  aLayerSet &= LSET::AllCuMask();
245  }
246 
247  if( aLayerSet.count() == 0 )
248  return;
249 
250  if( m_layerSet != aLayerSet )
251  SetNeedRefill( true );
252 
253  m_layerSet = aLayerSet;
254 
255  // Set the single layer parameter.
256  // For keepout zones that can be on many layers, this parameter does not have
257  // really meaning and is a bit arbitrary if more than one layer is set.
258  // But many functions are using it.
259  // So we need to initialize it to a reasonable value.
260  // Priority is F_Cu then B_Cu then to the first selected layer
261  m_Layer = aLayerSet.Seq()[0];
262 
263  if( m_Layer != F_Cu && aLayerSet[B_Cu] )
264  m_Layer = B_Cu;
265 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:686
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:377
PCB_LAYER_ID m_Layer
bool GetIsKeepout() const
Accessors to parameters used in Keepout zones:
Definition: class_zone.h:631
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References LSET::AllCuMask(), B_Cu, F_Cu, ZONE_CONTAINER::GetIsKeepout(), BOARD_ITEM::m_Layer, ZONE_CONTAINER::m_layerSet, LSET::Seq(), and ZONE_CONTAINER::SetNeedRefill().

Referenced by ZONE_SETTINGS::ExportSetting(), ZONE_CONTAINER::Flip(), ZONE_CONTAINER::initDataFromSrcInCopyCtor(), ZONE_CONTAINER::operator=(), and ZONE_CONTAINER::SetLayer().

◆ SetLocalFlags()

void ZONE_CONTAINER::SetLocalFlags ( int  aFlags)
inlineinherited

Definition at line 242 of file class_zone.h.

242 { m_localFlgs = aFlags; }
int m_localFlgs
Variable used in polygon calculations.
Definition: class_zone.h:791

References ZONE_CONTAINER::m_localFlgs.

Referenced by BOARD::CombineAreas(), ZONE_CONTAINER::initDataFromSrcInCopyCtor(), BOARD::NormalizeAreaPolygon(), and ZONE_CONTAINER::ZONE_CONTAINER().

◆ SetLocalRatsnestVisible()

void BOARD_CONNECTED_ITEM::SetLocalRatsnestVisible ( bool  aVisible)
inlineinherited

◆ SetLocked()

virtual void BOARD_ITEM::SetLocked ( bool  aLocked)
inlinevirtualinherited

Function SetLocked modifies 'lock' status for of the item.

Reimplemented in MODULE, and TRACK.

Definition at line 208 of file class_board_item.h.

209  {
210  // only MODULEs & TRACKs can be locked at this time.
211  }

Referenced by PCB_EDITOR_CONTROL::modifyLockSelected().

◆ SetMinThickness()

void ZONE_CONTAINER::SetMinThickness ( int  aMinThickness)
inlineinherited

Definition at line 187 of file class_zone.h.

188  {
189  if( m_ZoneMinThickness != aMinThickness )
190  SetNeedRefill( true );
191 
192  m_ZoneMinThickness = aMinThickness;
193  }
int m_ZoneMinThickness
Minimum thickness value in filled areas.
Definition: class_zone.h:745
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References ZONE_CONTAINER::m_ZoneMinThickness, and ZONE_CONTAINER::SetNeedRefill().

Referenced by ZONE_SETTINGS::ExportSetting(), EAGLE_PLUGIN::loadPolygon(), and PlotSolderMaskLayer().

◆ SetModified()

◆ SetNeedRefill()

◆ SetNet()

void BOARD_CONNECTED_ITEM::SetNet ( NETINFO_ITEM aNetInfo)
inlineinherited

Function SetNet Sets a NET_INFO object for the item.

Definition at line 89 of file board_connected_item.h.

90  {
91  assert( aNetInfo->GetBoard() == GetBoard() );
92  m_netinfo = aNetInfo;
93  }
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.

References BOARD_ITEM::GetBoard(), and BOARD_CONNECTED_ITEM::m_netinfo.

◆ SetNetCode()

bool BOARD_CONNECTED_ITEM::SetNetCode ( int  aNetCode,
bool  aNoAssert = false 
)
inherited

Sets net using a net code.

Parameters
aNetCodeis a net code for the new net. It has to exist in NETINFO_LIST held by BOARD.
aNoAssertif true, do not assert that the net exists. Otherwise, item is assigned to the unconnected net.
Returns
true on success, false if the net did not exist Note also items (in fact pads) not on copper layers will have their net code always set to 0 (not connected)

Definition at line 50 of file board_connected_item.cpp.

51 {
52  if( !IsOnCopperLayer() )
53  aNetCode = 0;
54 
55  // if aNetCode < 0 ( typically NETINFO_LIST::FORCE_ORPHANED )
56  // or no parent board,
57  // set the m_netinfo to the dummy NETINFO_LIST::ORPHANED
58 
59  BOARD* board = GetBoard();
60  //auto connectivity = board ? board->GetConnectivity() : nullptr;
61  //bool addRatsnest = false;
62 
63  //if( connectivity )
64  //addRatsnest = connectivity->Remove( this );
65 
66  if( ( aNetCode >= 0 ) && board )
67  m_netinfo = board->FindNet( aNetCode );
68  else
70 
71  if( !aNoAssert )
72  wxASSERT( m_netinfo );
73 
74  // Add only if it was previously added to the ratsnest
75  //if( addRatsnest )
76  // connectivity->Add( this );
77 
78  return ( m_netinfo != NULL );
79 }
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
#define NULL
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
static NETINFO_ITEM ORPHANED_ITEM
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
Definition: netinfo.h:471
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:160
NETINFO_ITEM * m_netinfo
Stores all informations about the net that item belongs to.
virtual bool IsOnCopperLayer() const

References BOARD::FindNet(), BOARD_ITEM::GetBoard(), BOARD_ITEM::IsOnCopperLayer(), BOARD_CONNECTED_ITEM::m_netinfo, NULL, and NETINFO_LIST::ORPHANED_ITEM.

Referenced by PNS_KICAD_IFACE::AddItem(), PCAD2KICAD::PCB_LINE::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToBoard(), PCAD2KICAD::PCB_POLYGON::AddToBoard(), PCAD2KICAD::PCB_PAD::AddToModule(), BOARD_NETLIST_UPDATER::deleteSinglePadNets(), DRAWING_TOOL::DrawVia(), PCB_EDIT_FRAME::Edit_Zone_Params(), ZONE_SETTINGS::ExportSetting(), BOARD::InsertArea(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadSignals(), LEGACY_PLUGIN::loadTrackList(), DSN::SPECCTRA_DB::makeTRACK(), MODULE_ZONE_CONTAINER(), BOARD::SetAreasNetCodesFromNetNames(), setupDummyPadForHole(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_PAD_PROPERTIES::TransferDataFromWindow(), and DIALOG_PAD_PROPERTIES::transferDataToPad().

◆ SetOutline()

void ZONE_CONTAINER::SetOutline ( SHAPE_POLY_SET aOutline)
inlineinherited

Definition at line 250 of file class_zone.h.

250 { m_Poly = aOutline; }
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719

References ZONE_CONTAINER::m_Poly.

Referenced by BOARD::CombineAreas(), and BOARD::NormalizeAreaPolygon().

◆ SetPadConnection()

void ZONE_CONTAINER::SetPadConnection ( ZONE_CONNECTION  aPadConnection)
inlineinherited

Definition at line 181 of file class_zone.h.

182  {
183  m_PadConnection = aPadConnection;
184  }
ZONE_CONNECTION m_PadConnection
Definition: class_zone.h:743

References ZONE_CONTAINER::m_PadConnection.

Referenced by ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetParent()

◆ SetPosition()

void ZONE_CONTAINER::SetPosition ( const wxPoint aPos)
inlineoverridevirtualinherited

Implements BOARD_ITEM.

Definition at line 88 of file class_zone.h.

88 {}

◆ SetPriority()

void ZONE_CONTAINER::SetPriority ( unsigned  aPriority)
inlineinherited

Function SetPriority.

Parameters
aPriority= the priority level

Definition at line 94 of file class_zone.h.

94 { m_priority = aPriority; }
unsigned m_priority
Definition: class_zone.h:729

References ZONE_CONTAINER::m_priority.

Referenced by PCAD2KICAD::PCB_POLYGON::AddToBoard(), ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetRawPolysList()

void ZONE_CONTAINER::SetRawPolysList ( SHAPE_POLY_SET aPolysList)
inlineinherited

Function SetFilledPolysList sets the list of filled polygons.

Definition at line 576 of file class_zone.h.

577  {
578  m_RawPolysList = aPolysList;
579  }
SHAPE_POLY_SET m_RawPolysList
Definition: class_zone.h:807

References ZONE_CONTAINER::m_RawPolysList.

Referenced by ZONE_FILLER::Fill().

◆ SetSelected()

void EDA_ITEM::SetSelected ( )
inlineinherited

◆ SetSelectedCorner() [1/2]

void ZONE_CONTAINER::SetSelectedCorner ( int  aCorner)
inlineinherited

Definition at line 221 of file class_zone.h.

222  {
223  SHAPE_POLY_SET::VERTEX_INDEX selectedCorner;
224 
225  // If the global index of the corner is correct, assign it to m_CornerSelection
226  if( m_Poly->GetRelativeIndices( aCorner, &selectedCorner ) )
227  {
228  if( m_CornerSelection == nullptr )
230 
231  *m_CornerSelection = selectedCorner;
232  }
233  else
234  throw( std::out_of_range( "aCorner-th vertex does not exist" ) );
235  }
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:788
Struct VERTEX_INDEX.
struct SHAPE_POLY_SET::VERTEX_INDEX VERTEX_INDEX
Struct VERTEX_INDEX.
SHAPE_POLY_SET * m_Poly
Outline of the zone.
Definition: class_zone.h:719
bool GetRelativeIndices(int aGlobalIdx, VERTEX_INDEX *aRelativeIndices) const
Function GetRelativeIndices.

References SHAPE_POLY_SET::GetRelativeIndices(), ZONE_CONTAINER::m_CornerSelection, and ZONE_CONTAINER::m_Poly.

◆ SetSelectedCorner() [2/2]

void ZONE_CONTAINER::SetSelectedCorner ( const wxPoint aPosition,
int  aAccuracy 
)
inherited

Definition at line 561 of file class_zone.cpp.

562 {
564 
565  // If there is some corner to be selected, assign it to m_CornerSelection
566  if( HitTestForCorner( aPosition, aAccuracy * 2, corner )
567  || HitTestForEdge( aPosition, aAccuracy, corner ) )
568  {
569  if( m_CornerSelection == nullptr )
571 
572  *m_CornerSelection = corner;
573  }
574 }
SHAPE_POLY_SET::VERTEX_INDEX * m_CornerSelection
The index of the corner being moved or nullptr if no corner is selected.
Definition: class_zone.h:788
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
Definition: class_zone.cpp:576
Struct VERTEX_INDEX.
struct SHAPE_POLY_SET::VERTEX_INDEX VERTEX_INDEX
Struct VERTEX_INDEX.
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.
Definition: class_zone.cpp:590

References ZONE_CONTAINER::HitTestForCorner(), ZONE_CONTAINER::HitTestForEdge(), and ZONE_CONTAINER::m_CornerSelection.

◆ SetState()

void EDA_ITEM::SetState ( int  type,
int  state 
)
inlineinherited

Definition at line 244 of file base_struct.h.

245  {
246  if( state )
247  m_Status |= type; // state = ON or OFF
248  else
249  m_Status &= ~type;
250  }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by LEGACY_PLUGIN::loadTrackList(), TRACKS_CLEANER::mergeCollinearSegments(), SELECTION_TOOL::selectConnectedTracks(), and TRACK::SetLocked().

◆ SetStatus()

void EDA_ITEM::SetStatus ( STATUS_FLAGS  aStatus)
inlineinherited

Definition at line 253 of file base_struct.h.

253 { m_Status = aStatus; }
STATUS_FLAGS m_Status
Definition: base_struct.h:173

References EDA_ITEM::m_Status.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ SetThermalReliefCopperBridge()

void ZONE_CONTAINER::SetThermalReliefCopperBridge ( int  aThermalReliefCopperBridge)
inlineinherited

Definition at line 161 of file class_zone.h.

162  {
163  if( m_ThermalReliefCopperBridge != aThermalReliefCopperBridge )
164  SetNeedRefill( true );
165 
166  m_ThermalReliefCopperBridge = aThermalReliefCopperBridge;
167  }
int m_ThermalReliefCopperBridge
Definition: class_zone.h:761
void SetNeedRefill(bool aNeedRefill)
Definition: class_zone.h:174

References ZONE_CONTAINER::m_ThermalReliefCopperBridge, and ZONE_CONTAINER::SetNeedRefill().

Referenced by ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetThermalReliefGap()

void ZONE_CONTAINER::SetThermalReliefGap ( int  aThermalReliefGap)
inlineinherited

Definition at line 158 of file class_zone.h.

158 { m_ThermalReliefGap = aThermalReliefGap; }
int m_ThermalReliefGap
Width of the copper bridge in thermal reliefs.
Definition: class_zone.h:758

References ZONE_CONTAINER::m_ThermalReliefGap.

Referenced by ZONE_SETTINGS::ExportSetting(), and EAGLE_PLUGIN::loadPolygon().

◆ SetTimeStamp()

void EDA_ITEM::SetTimeStamp ( timestamp_t  aNewTimeStamp)
inlineinherited

Definition at line 212 of file base_struct.h.

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

References EDA_ITEM::m_TimeStamp.

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

◆ SetWireImage()

void EDA_ITEM::SetWireImage ( )
inlineinherited

Definition at line 228 of file base_struct.h.

228 { SetFlags( IS_WIRE_IMAGE ); }
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:255
#define IS_WIRE_IMAGE