KiCad PCB EDA Suite
ZONE_CREATE_HELPER Class Reference

This class is an adjuct helper to the DRAWING_TOOL interactive tool, which handles incoming geometry changes from a POLYGON_GEOM_MANAGER and translates that into a ZONE_CONTAINER based on given parameters. More...

#include <zone_create_helper.h>

Inheritance diagram for ZONE_CREATE_HELPER:
POLYGON_GEOM_MANAGER::CLIENT

Classes

struct  PARAMS
 Parameters used to fully describe a zone creation process. More...
 

Public Member Functions

 ZONE_CREATE_HELPER (DRAWING_TOOL &aTool, PARAMS &aParams)
 
 ~ZONE_CREATE_HELPER ()
 
void OnGeometryChange (const POLYGON_GEOM_MANAGER &aMgr) override
 

Sent when the polygon geometry changes

More...
 
bool OnFirstPoint (POLYGON_GEOM_MANAGER &aMgr) override
 Called before the first point is added - clients can do initialisation here, and can veto the start of the process (e.g. More...
 
void OnComplete (const POLYGON_GEOM_MANAGER &aMgr) override
 

Called when the polygon is complete

More...
 
std::unique_ptr< ZONE_CONTAINERcreateNewZone (bool aKeepout)
 Function createNewZone() More...
 
std::unique_ptr< ZONE_CONTAINERcreateZoneFromExisting (const ZONE_CONTAINER &aSrcZone)
 Function createZoneFromExisting. More...
 
void performZoneCutout (ZONE_CONTAINER &aZone, ZONE_CONTAINER &aCutout)
 Function performZoneCutout() More...
 
void commitZone (std::unique_ptr< ZONE_CONTAINER > aZone)
 Commit the current zone-in-progress to the BOARD. More...
 

Private Attributes

DRAWING_TOOLm_tool
 
PARAMSm_params
 

Parameters of the zone to be drawn

More...
 
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
 

The preview item to display

More...
 
KIGFX::VIEWm_parentView
 

view that show the preview item

More...
 
std::unique_ptr< ZONE_CONTAINERm_zone
 

The zone-in-progress

More...
 

Detailed Description

This class is an adjuct helper to the DRAWING_TOOL interactive tool, which handles incoming geometry changes from a POLYGON_GEOM_MANAGER and translates that into a ZONE_CONTAINER based on given parameters.

Definition at line 43 of file zone_create_helper.h.

Constructor & Destructor Documentation

◆ ZONE_CREATE_HELPER()

ZONE_CREATE_HELPER::ZONE_CREATE_HELPER ( DRAWING_TOOL aTool,
PARAMS aParams 
)
Parameters
aToolthe DRAWING_TOOL to provide the zone tool to
aParamsthe parameters to use to guide the zone creation

Definition at line 40 of file zone_create_helper.cpp.

40  :
41  m_tool( aTool ),
42  m_params( aParams ),
43  m_parentView( *aTool.getView() )
44 {
46 }
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
The preview item to display
KIGFX::VIEW & m_parentView
view that show the preview item
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:35
PARAMS & m_params
Parameters of the zone to be drawn
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:346

References KIGFX::VIEW::Add(), m_parentView, and m_previewItem.

◆ ~ZONE_CREATE_HELPER()

ZONE_CREATE_HELPER::~ZONE_CREATE_HELPER ( )

Definition at line 49 of file zone_create_helper.cpp.

50 {
51  // remove the preview from the view
54 }
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:376
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
The preview item to display
KIGFX::VIEW & m_parentView
view that show the preview item
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1485

References m_parentView, m_previewItem, KIGFX::VIEW::Remove(), and KIGFX::VIEW::SetVisible().

Member Function Documentation

◆ commitZone()

void ZONE_CREATE_HELPER::commitZone ( std::unique_ptr< ZONE_CONTAINER aZone)

Commit the current zone-in-progress to the BOARD.

This might be adding a new zone, or modifying an existing zone with a cutout, depending on parameters.

Parameters
aZone- the drawn zone outline to commit

Definition at line 161 of file zone_create_helper.cpp.

162 {
163  auto& frame = *m_tool.getEditFrame<PCB_EDIT_FRAME>();
164  auto board = m_tool.getModel<BOARD>();
165 
166  switch ( m_params.m_mode )
167  {
169  // For cutouts, subtract from the source
171  break;
172 
175  {
176  BOARD_COMMIT bCommit( &m_tool );
177 
178  aZone->Hatch();
179 
180  if( !m_params.m_keepout )
181  {
182  ZONE_FILLER filler( board );
183  filler.Fill( { aZone.get() } );
184  }
185 
186  bCommit.Add( aZone.release() );
187  bCommit.Push( _( "Add a zone" ) );
188  break;
189  }
190 
192  {
193  BOARD_COMMIT bCommit( &m_tool );
194  BOARD_ITEM_CONTAINER* parent = frame.GetModel();
195 
196  if( m_tool.getDrawingLayer() != Edge_Cuts )
197  {
198  auto poly = m_tool.m_editModules ?
199  new EDGE_MODULE( (MODULE *) parent ) :
200  new DRAWSEGMENT();
201  poly->SetShape ( S_POLYGON );
202  poly->SetLayer( m_tool.getDrawingLayer() );
203  poly->SetPolyShape ( *aZone->Outline() );
204  bCommit.Add( poly );
205  }
206  else
207  {
208  auto outline = aZone->Outline();
209 
210  for( auto seg = outline->IterateSegments( 0 ); seg; seg++ )
211  {
212  auto new_seg = m_tool.m_editModules ?
213  new EDGE_MODULE( (MODULE *) parent ) :
214  new DRAWSEGMENT();
215  new_seg->SetShape( S_SEGMENT );
216  new_seg->SetLayer( m_tool.getDrawingLayer() );
217  new_seg->SetStart( wxPoint( seg.Get().A.x, seg.Get().A.y ) );
218  new_seg->SetEnd( wxPoint( seg.Get().B.x, seg.Get().B.y ) );
219  bCommit.Add( new_seg );
220  }
221  }
222 
223  bCommit.Push( _( "Add a graphical polygon" ) );
224 
225  break;
226  }
227  }
228 }
void SetShape(STROKE_T aShape)
T * getModel() const
Function getModel()
Definition: tool_base.h:199
polygon (not yet used for tracks, but could be in microwave apps)
usual segment : line with rounded ends
Add a new zone with the same settings as an existing one.
void performZoneCutout(ZONE_CONTAINER &aZone, ZONE_CONTAINER &aCutout)
Function performZoneCutout()
ZONE_CONTAINER * m_sourceZone
Zone settings source (for similar and cutout zones)
DRAWING_TOOL::ZONE_MODE m_mode
The zone mode to operate in
PARAMS & m_params
Parameters of the zone to be drawn
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
PCB_LAYER_ID getDrawingLayer() const
Selects a non-copper layer for drawing
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
T * getEditFrame() const
Function getEditFrame()
Definition: tool_base.h:188
Abstract interface for BOARD_ITEMs capable of storing other items inside.
bool m_keepout
Should create a keepout zone?
Add a new zone/keepout with fresh settings.
Make a cutout to an existing zone.

References COMMIT::Add(), DRAWING_TOOL::ADD, DRAWING_TOOL::CUTOUT, Edge_Cuts, ZONE_FILLER::Fill(), DRAWING_TOOL::getDrawingLayer(), TOOL_BASE::getEditFrame(), TOOL_BASE::getModel(), DRAWING_TOOL::GRAPHIC_POLYGON, PCB_TOOL_BASE::m_editModules, ZONE_CREATE_HELPER::PARAMS::m_keepout, ZONE_CREATE_HELPER::PARAMS::m_mode, m_params, ZONE_CREATE_HELPER::PARAMS::m_sourceZone, m_tool, performZoneCutout(), BOARD_COMMIT::Push(), S_POLYGON, S_SEGMENT, and DRAWING_TOOL::SIMILAR.

Referenced by OnComplete().

◆ createNewZone()

std::unique_ptr< ZONE_CONTAINER > ZONE_CREATE_HELPER::createNewZone ( bool  aKeepout)

Function createNewZone()

Prompt the user for new zone settings, and create a new zone with those settings

Parameters
aKeepoutshould the zone be a keepout
Returns
the new zone, can be null if the user aborted

Definition at line 57 of file zone_create_helper.cpp.

58 {
59  auto& frame = *m_tool.getEditFrame<PCB_BASE_EDIT_FRAME>();
60  auto& board = *m_tool.getModel<BOARD>();
62 
63  // Get the current default settings for zones
64  ZONE_SETTINGS zoneInfo = frame.GetZoneSettings();
66  zoneInfo.m_NetcodeSelection = board.GetHighLightNetCode();
67  zoneInfo.SetIsKeepout( m_params.m_keepout );
68 
70  {
71  // Get the current default settings for zones
72 
73  // Show options dialog
74  int dialogResult;
75 
76  if( m_params.m_keepout )
77  dialogResult = InvokeKeepoutAreaEditor( &frame, &zoneInfo );
78  else
79  {
80  if( IsCopperLayer( zoneInfo.m_CurrentZone_Layer ) )
81  dialogResult = InvokeCopperZonesEditor( &frame, &zoneInfo );
82  else
83  dialogResult = InvokeNonCopperZonesEditor( &frame, &zoneInfo );
84  }
85 
86  if( dialogResult == wxID_CANCEL )
87  return nullptr;
88 
89  controls->WarpCursor( controls->GetCursorPosition(), true );
90  }
91 
92  auto newZone = std::make_unique<ZONE_CONTAINER>( &board );
93 
94  // Apply the selected settings
95  zoneInfo.ExportSetting( *newZone );
96 
97  return newZone;
98 }
int InvokeKeepoutAreaEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeKeepoutAreaEditor invokes up a modal dialog window for copper zone editing.
T * getModel() const
Function getModel()
Definition: tool_base.h:199
int InvokeNonCopperZonesEditor(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings)
Function InvokeNonCopperZonesEditor invokes up a modal dialog window for non-copper zone editing.
PCB_LAYER_ID m_layer
Layer to begin drawing
TOOL_MANAGER * GetManager() const
Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:144
int m_NetcodeSelection
Net code selection for the current zone.
Definition: zone_settings.h:74
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...
void SetIsKeepout(bool aEnable)
void ExportSetting(ZONE_CONTAINER &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
DRAWING_TOOL::ZONE_MODE m_mode
The zone mode to operate in
Class ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:49
PARAMS & m_params
Parameters of the zone to be drawn
KIGFX::VIEW_CONTROLS * GetViewControls() const
Definition: tool_manager.h:257
Common, abstract interface for edit frames.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
T * getEditFrame() const
Function getEditFrame()
Definition: tool_base.h:188
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.
bool m_keepout
Should create a keepout zone?
PCB_LAYER_ID m_CurrentZone_Layer
Layer used to create the current zone.
Definition: zone_settings.h:78

References ZONE_SETTINGS::ExportSetting(), TOOL_BASE::getEditFrame(), TOOL_BASE::GetManager(), TOOL_BASE::getModel(), TOOL_MANAGER::GetViewControls(), DRAWING_TOOL::GRAPHIC_POLYGON, InvokeCopperZonesEditor(), InvokeKeepoutAreaEditor(), InvokeNonCopperZonesEditor(), IsCopperLayer(), ZONE_SETTINGS::m_CurrentZone_Layer, ZONE_CREATE_HELPER::PARAMS::m_keepout, ZONE_CREATE_HELPER::PARAMS::m_layer, ZONE_CREATE_HELPER::PARAMS::m_mode, ZONE_SETTINGS::m_NetcodeSelection, m_params, m_tool, and ZONE_SETTINGS::SetIsKeepout().

Referenced by OnFirstPoint().

◆ createZoneFromExisting()

std::unique_ptr< ZONE_CONTAINER > ZONE_CREATE_HELPER::createZoneFromExisting ( const ZONE_CONTAINER aSrcZone)

Function createZoneFromExisting.

Create a new zone with the settings from an existing zone

Parameters
aSrcZonethe zone to copy settings from
Returns
the new zone

Definition at line 101 of file zone_create_helper.cpp.

103 {
104  auto& board = *m_tool.getModel<BOARD>();
105 
106  auto newZone = std::make_unique<ZONE_CONTAINER>( &board );
107 
108  ZONE_SETTINGS zoneSettings;
109  zoneSettings << aSrcZone;
110 
111  zoneSettings.ExportSetting( *newZone );
112 
113  return newZone;
114 }
T * getModel() const
Function getModel()
Definition: tool_base.h:199
void ExportSetting(ZONE_CONTAINER &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
Class ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:49
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170

References ZONE_SETTINGS::ExportSetting(), TOOL_BASE::getModel(), and m_tool.

Referenced by OnFirstPoint().

◆ OnComplete()

void ZONE_CREATE_HELPER::OnComplete ( const POLYGON_GEOM_MANAGER aMgr)
overridevirtual

Called when the polygon is complete

Implements POLYGON_GEOM_MANAGER::CLIENT.

Definition at line 277 of file zone_create_helper.cpp.

278 {
279  auto& finalPoints = aMgr.GetLockedInPoints();
280 
281  if( finalPoints.PointCount() < 3 )
282  {
283  // just scrap the zone in progress
284  m_zone = nullptr;
285  }
286  else
287  {
288  // if m_params.m_mode == DRAWING_TOOL::ZONE_MODE::CUTOUT, m_zone
289  // will be merged to the existing zone as a new hole.
290  m_zone->Outline()->NewOutline();
291  auto* outline = m_zone->Outline();
292 
293  for( int i = 0; i < finalPoints.PointCount(); ++i )
294  {
295  outline->Append( finalPoints.CPoint( i ) );
296  }
297 
298  outline->Outline( 0 ).SetClosed( true );
299  outline->RemoveNullSegments();
300 
301  // hand the zone over to the committer
302  commitZone( std::move( m_zone ) );
303  m_zone = nullptr;
304  }
305 
307 }
void commitZone(std::unique_ptr< ZONE_CONTAINER > aZone)
Commit the current zone-in-progress to the BOARD.
std::unique_ptr< ZONE_CONTAINER > m_zone
The zone-in-progress
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
The preview item to display
KIGFX::VIEW & m_parentView
view that show the preview item
size_t i
Definition: json11.cpp:597
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1485
const SHAPE_LINE_CHAIN & GetLockedInPoints() const
Get the "locked-in" points that describe the polygon itself.

References commitZone(), POLYGON_GEOM_MANAGER::GetLockedInPoints(), i, m_parentView, m_previewItem, m_zone, and KIGFX::VIEW::SetVisible().

◆ OnFirstPoint()

bool ZONE_CREATE_HELPER::OnFirstPoint ( POLYGON_GEOM_MANAGER aMgr)
overridevirtual

Called before the first point is added - clients can do initialisation here, and can veto the start of the process (e.g.

if user cancels a dialog)

Returns
false to veto start of new polygon

Implements POLYGON_GEOM_MANAGER::CLIENT.

Definition at line 231 of file zone_create_helper.cpp.

232 {
233  // if we don't have a zone, create one
234  // the user's choice here can affect things like the colour
235  // of the preview
236  if( !m_zone )
237  {
238  if( m_params.m_sourceZone )
240  else
242 
243  if( m_zone )
244  {
245  // set up poperties from zone
246  const auto& settings = *m_parentView.GetPainter()->GetSettings();
247  COLOR4D color = settings.GetColor( nullptr, m_zone->GetLayer() );
248 
250  m_previewItem.SetFillColor( color.WithAlpha( 0.2 ) );
251 
253 
254  aMgr.SetLeaderMode( m_zone.get()->GetHV45()
257  }
258  }
259 
260  if( !m_zone )
261  {
262  return false;
263  }
264 
265  return true;
266 }
std::unique_ptr< ZONE_CONTAINER > createZoneFromExisting(const ZONE_CONTAINER &aSrcZone)
Function createZoneFromExisting.
void SetStrokeColor(const COLOR4D &aNewColor)
Set the stroke colour to set before drawing preview
int color
Definition: DXF_plotter.cpp:62
std::unique_ptr< ZONE_CONTAINER > m_zone
The zone-in-progress
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
The preview item to display
void SetLeaderMode(LEADER_MODE aMode)
Set the leader mode to use when calculating the leader/returner lines.
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
Unconstrained point-to-point
ZONE_CONTAINER * m_sourceZone
Zone settings source (for similar and cutout zones)
KIGFX::VIEW & m_parentView
view that show the preview item
void SetFillColor(const COLOR4D &aNewColor)
Set the fill colour to set before drawing preview
PARAMS & m_params
Parameters of the zone to be drawn
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
std::unique_ptr< ZONE_CONTAINER > createNewZone(bool aKeepout)
Function createNewZone()
Definition: colors.h:49
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Sets the item visibility.
Definition: view.cpp:1485
bool m_keepout
Should create a keepout zone?
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39

References color, createNewZone(), createZoneFromExisting(), POLYGON_GEOM_MANAGER::DEG45, POLYGON_GEOM_MANAGER::DIRECT, KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), ZONE_CREATE_HELPER::PARAMS::m_keepout, m_params, m_parentView, m_previewItem, ZONE_CREATE_HELPER::PARAMS::m_sourceZone, m_zone, KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::SetFillColor(), POLYGON_GEOM_MANAGER::SetLeaderMode(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::SetStrokeColor(), KIGFX::VIEW::SetVisible(), and WHITE.

◆ OnGeometryChange()

void ZONE_CREATE_HELPER::OnGeometryChange ( const POLYGON_GEOM_MANAGER aMgr)
overridevirtual

Sent when the polygon geometry changes

Implements POLYGON_GEOM_MANAGER::CLIENT.

Definition at line 269 of file zone_create_helper.cpp.

270 {
271  // send the points to the preview item
274 }
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...
KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
The preview item to display
KIGFX::VIEW & m_parentView
view that show the preview item
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1539
void SetPoints(const SHAPE_LINE_CHAIN &aLockedInPts, const SHAPE_LINE_CHAIN &aLeaderPts)
Set the polygon points.
const SHAPE_LINE_CHAIN & GetLockedInPoints() const
Get the "locked-in" points that describe the polygon itself.
Color has changed.
Definition: view_item.h:57

References KIGFX::GEOMETRY, POLYGON_GEOM_MANAGER::GetLeaderLinePoints(), POLYGON_GEOM_MANAGER::GetLockedInPoints(), m_parentView, m_previewItem, KIGFX::PREVIEW::POLYGON_ITEM::SetPoints(), and KIGFX::VIEW::Update().

◆ performZoneCutout()

void ZONE_CREATE_HELPER::performZoneCutout ( ZONE_CONTAINER aZone,
ZONE_CONTAINER aCutout 
)

Function performZoneCutout()

Cut one zone out of another one (i.e. subtraction) and update the zone.

Parameters
aZonethe zone to removed area from
aCutoutthe area to remove

Definition at line 117 of file zone_create_helper.cpp.

118 {
119  BOARD_COMMIT commit( &m_tool );
120  BOARD* board = m_tool.getModel<BOARD>();
121  std::vector<ZONE_CONTAINER*> newZones;
122 
123  // Clear the selection before removing the old zone
124  auto toolMgr = m_tool.GetManager();
125  toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
126 
127  SHAPE_POLY_SET originalOutline( *aZone.Outline() );
128  originalOutline.BooleanSubtract( *aCutout.Outline(), SHAPE_POLY_SET::PM_FAST );
129 
130  for( int i = 0; i < originalOutline.OutlineCount(); i++ )
131  {
132  auto newZoneOutline = new SHAPE_POLY_SET;
133  newZoneOutline->AddOutline( originalOutline.Outline( i ) );
134 
135  for (int j = 0; j < originalOutline.HoleCount(i) ; j++ )
136  {
137  newZoneOutline->AddHole( originalOutline.CHole(i, j), i );
138  }
139 
140  auto newZone = new ZONE_CONTAINER( aZone );
141  newZone->SetOutline( newZoneOutline );
142  newZone->SetLocalFlags( 1 );
143  newZone->Hatch();
144  newZones.push_back( newZone );
145  commit.Add( newZone );
146  }
147 
148  commit.Remove( &aZone );
149  commit.Push( _( "Add a zone cutout" ) );
150 
151  ZONE_FILLER filler( board );
152  filler.Fill( newZones );
153 
154  // Select the new zone and set it as the source for the next cutout
155  toolMgr->RunAction( PCB_ACTIONS::selectItem, true, newZones[0] );
156  m_params.m_sourceZone = newZones[0];
157 
158 }
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:53
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:59
T * getModel() const
Function getModel()
Definition: tool_base.h:199
SHAPE_POLY_SET * Outline()
Definition: class_zone.h:260
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
TOOL_MANAGER * GetManager() const
Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:144
Class SHAPE_POLY_SET.
ZONE_CONTAINER * m_sourceZone
Zone settings source (for similar and cutout zones)
PARAMS & m_params
Parameters of the zone to be drawn
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:170
size_t i
Definition: json11.cpp:597
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
Definition: pcb_actions.h:56
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset difference For aFastMode meaning, see function booleanOp

References COMMIT::Add(), SHAPE_POLY_SET::AddOutline(), SHAPE_POLY_SET::BooleanSubtract(), ZONE_FILLER::Fill(), TOOL_BASE::GetManager(), TOOL_BASE::getModel(), i, m_params, ZONE_CREATE_HELPER::PARAMS::m_sourceZone, m_tool, ZONE_CONTAINER::Outline(), SHAPE_POLY_SET::PM_FAST, BOARD_COMMIT::Push(), COMMIT::Remove(), TOOL_MANAGER::RunAction(), PCB_ACTIONS::selectionClear, and PCB_ACTIONS::selectItem.

Referenced by commitZone().

Member Data Documentation

◆ m_params

PARAMS& ZONE_CREATE_HELPER::m_params
private

Parameters of the zone to be drawn

Definition at line 129 of file zone_create_helper.h.

Referenced by commitZone(), createNewZone(), OnFirstPoint(), and performZoneCutout().

◆ m_parentView

KIGFX::VIEW& ZONE_CREATE_HELPER::m_parentView
private

view that show the preview item

Definition at line 135 of file zone_create_helper.h.

Referenced by OnComplete(), OnFirstPoint(), OnGeometryChange(), ZONE_CREATE_HELPER(), and ~ZONE_CREATE_HELPER().

◆ m_previewItem

KIGFX::PREVIEW::POLYGON_ITEM ZONE_CREATE_HELPER::m_previewItem
private

The preview item to display

Definition at line 132 of file zone_create_helper.h.

Referenced by OnComplete(), OnFirstPoint(), OnGeometryChange(), ZONE_CREATE_HELPER(), and ~ZONE_CREATE_HELPER().

◆ m_tool

DRAWING_TOOL& ZONE_CREATE_HELPER::m_tool
private

◆ m_zone

std::unique_ptr<ZONE_CONTAINER> ZONE_CREATE_HELPER::m_zone
private

The zone-in-progress

Definition at line 138 of file zone_create_helper.h.

Referenced by OnComplete(), and OnFirstPoint().


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