43 m_parentView( *aTool.getView() )
63 std::set<int> highlightedNets = board->GetHighLightNetCodes();
102 if( dialogResult == wxID_CANCEL )
113 std::make_unique<FP_ZONE>( parent ) :
114 std::make_unique<ZONE>( parent );
127 std::unique_ptr<ZONE> newZone = std::make_unique<ZONE>( board );
130 zoneSettings << aSrcZone;
141 std::vector<ZONE*> newZones;
154 for(
int outline = 0; outline < originalOutline.OutlineCount(); outline++ )
157 newZoneOutline->
AddOutline( originalOutline.Outline( outline ) );
160 for (
int hole = 0; hole < originalOutline.HoleCount( outline ) ; hole++ )
161 newZoneOutline->AddHole( originalOutline.CHole( outline, hole ) );
163 auto newZone =
new ZONE( aZone );
164 newZone->SetOutline( newZoneOutline );
165 newZone->SetLocalFlags( 1 );
166 newZone->HatchBorder();
168 newZones.push_back( newZone );
169 commit.
Add( newZone );
176 commit.
Push(
_(
"Add a zone cutout" ) );
179 if( newZones.empty() )
207 aZone->HatchBorder();
211 commit.
Add( aZone.get() );
213 std::lock_guard<KISPINLOCK> lock( board->
GetConnectivity()->GetLock() );
215 commit.
Push(
_(
"Add a zone" ) );
246 commit.
Push(
_(
"Add a graphical polygon" ) );
299 if( finalPoints.PointCount() < 3 )
308 m_zone->Outline()->NewOutline();
309 auto* outline =
m_zone->Outline();
311 for(
int i = 0; i < finalPoints.PointCount(); ++i )
312 outline->Append( finalPoints.CPoint( i ) );
320 for(
int i = 1; i < pts.PointCount(); i++ )
321 outline->
Append( pts.CPoint( i ) );
324 outline->Outline( 0 ).SetClosed(
true );
325 outline->RemoveNullSegments();
static TOOL_ACTION selectionClear
Clear the current selection.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
void OnComplete(const POLYGON_GEOM_MANAGER &aMgr) override
Add a new zone with the same settings as an existing one.
ZONE * m_sourceZone
Zone leader mode.
void SetStrokeColor(const COLOR4D &aNewColor)
Set the fill color to set before drawing preview.
void SetFilled(bool aFlag)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
const SHAPE_LINE_CHAIN & GetLeaderLinePoints() const
Get the points comprising the leader line (the line from the last locked-in point to the current curs...
void SetPolyShape(const SHAPE_POLY_SET &aShape)
int InvokeNonCopperZonesEditor(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings)
Function InvokeNonCopperZonesEditor invokes up a modal dialog window for non-copper zone editing.
SHAPE_POLY_SET * Outline()
ZONE_CREATE_HELPER(DRAWING_TOOL &aTool, PARAMS &aParams)
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
DRAWING_TOOL & m_tool
Parameters of the zone to be drawn.
PCB_LAYER_ID m_layer
The zone mode to operate in.
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
view that show the preview item
Parameters used to fully describe a zone creation process.
void SetLeaderMode(LEADER_MODE aMode)
Set the leader mode to use when calculating the leader/returner lines.
LEADER_MODE GetLeaderMode() const
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
int GetLineThickness(PCB_LAYER_ID aLayer) const
Return the default graphic segment thickness from the layer class for the given layer.
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
Represent a set of closed polygons.
const ZONE_SETTINGS & GetZoneSettings() const
KIGFX::VIEW & m_parentView
The zone-in-progress.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
const std::deque< EDA_ITEM * > GetItems() const
An interface for classes handling user events controlling the view behavior such as zooming,...
Add a new zone/keepout with fresh settings.
bool OnFirstPoint(POLYGON_GEOM_MANAGER &aMgr) override
Called before the first point is added - clients can do initialization here, and can veto the start o...
void SetWidth(int aWidth)
void commitZone(std::unique_ptr< ZONE > aZone)
Commit the current zone-in-progress to the BOARD.
Handle a list of polygons defining a copper zone.
COMMIT & Remove(EDA_ITEM *aItem)
Notify observers that aItem has been removed.
Unconstrained point-to-point.
void SetFillColor(const COLOR4D &aNewColor)
Set the line width to set before drawing preview.
void SetIsRuleArea(bool aEnable)
void performZoneCutout(ZONE &aZone, const ZONE &aCutout)
Cut one zone out of another one (i.e.
int InvokeRuleAreaEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeRuleAreaEditor invokes up a modal dialog window for copper zone editing.
Make a cutout to an existing zone.
bool Empty() const
Checks if there is anything selected.
class FOOTPRINT, a footprint
ZONE_SETTINGS handles zones parameters.
PARAMS & m_params
The preview item to display.
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new hole to the given outline (default: last) and returns its index.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
void OnGeometryChange(const POLYGON_GEOM_MANAGER &aMgr) override
Called when the polygon is complete.
std::unique_ptr< ZONE > createZoneFromExisting(const ZONE &aSrcZone)
Create a new zone with the settings from an existing zone.
std::unique_ptr< ZONE > m_zone
Common, abstract interface for edit frames.
Information pertinent to a Pcbnew printed circuit board.
PCB_LAYER_ID
A quick note on layer IDs:
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
void SetShape(SHAPE_T aShape)
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
void SetPoints(const SHAPE_LINE_CHAIN &aLockedInPts, const SHAPE_LINE_CHAIN &aLeaderPts)
Set the polygon points.
virtual ~ZONE_CREATE_HELPER()
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
const SHAPE_LINE_CHAIN & GetLockedInPoints() const
Get the "locked-in" points that describe the polygon itself.
std::unique_ptr< ZONE > createNewZone(bool aKeepout)
Prompt the user for new zone settings, and create a new zone with those settings.
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset intersection For aFastMode meaning, see function booleanOp.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
POLYGON_GEOM_MANAGER::LEADER_MODE m_leaderMode
bool m_keepout
< Should create a keepout zone?
Class that handles the drawing of a polygon, including management of last corner deletion and drawing...
ZONE_MODE m_mode
Zone settings source (for similar and cutout zones)
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
KICAD_T Type() const
Returns the type of object.
Position or shape has changed.
A color representation with 4 components: red, green, blue, alpha.