KiCad PCB EDA Suite
GENERAL_COLLECTOR Class Reference

Used when the right click button is pressed, or when the select tool is in effect. More...

#include <collectors.h>

Inheritance diagram for GENERAL_COLLECTOR:
PCB_COLLECTOR COLLECTOR

Public Types

using ITER = std::vector< EDA_ITEM * >::iterator
 
using CITER = std::vector< EDA_ITEM * >::const_iterator
 

Public Member Functions

 GENERAL_COLLECTOR ()
 
void Empty2nd ()
 
void Append2nd (BOARD_ITEM *item)
 
void SetGuide (const COLLECTORS_GUIDE *aGuide)
 Record which COLLECTORS_GUIDE to use. More...
 
const COLLECTORS_GUIDEGetGuide () const
 
int GetPrimaryCount ()
 
SEARCH_RESULT Inspect (EDA_ITEM *testItem, void *testData) override
 The examining function within the INSPECTOR which is passed to the Iterate function. More...
 
void Collect (BOARD_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos, const COLLECTORS_GUIDE &aGuide)
 Scan a BOARD_ITEM using this class's Inspector method, which does the collection. More...
 
BOARD_ITEMoperator[] (int ndx) const override
 Overload the COLLECTOR::operator[](int) to return a BOARD_ITEM instead of an EDA_ITEM. More...
 
ITER begin ()
 
CITER begin () const
 
ITER end ()
 
CITER end () const
 
int GetCount () const
 Return the number of objects in the list. More...
 
void Empty ()
 Clear the list. More...
 
void Append (EDA_ITEM *item)
 Add an item to the end of the list. More...
 
void Remove (int aIndex)
 Remove the item at aIndex (first position is 0). More...
 
void Remove (const EDA_ITEM *aItem)
 Remove the item aItem (if exists in the collector). More...
 
bool HasAdditionalItems ()
 Test if the collector has heuristic backup items. More...
 
void Combine ()
 Re-combine the backup list into the main list of the collector. More...
 
void Transfer (int aIndex)
 Move the item at aIndex (first position is 0) to the backup list. More...
 
void Transfer (EDA_ITEM *aItem)
 Move aItem (if exists in the collector) to the backup list. More...
 
bool HasItem (const EDA_ITEM *aItem) const
 Tests if aItem has already been collected. More...
 
void SetScanTypes (const KICAD_T *scanTypes)
 Record the list of KICAD_T types to consider for collection by the Inspect() function. More...
 
void SetRefPos (const wxPoint &aRefPos)
 
const EDA_RECTGetBoundingBox () const
 
int CountType (KICAD_T aType)
 Count the number of items matching aType. More...
 

Public Attributes

int m_Threshold
 
wxString m_MenuTitle
 
bool m_MenuCancelled
 

Static Public Attributes

static const KICAD_T AllBoardItems []
 A scan list for all editable board items. More...
 
static const KICAD_T Zones []
 A scan list for zones outlines only. More...
 
static const KICAD_T BoardLevelItems []
 A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT, such as PAD and FP_TEXT. More...
 
static const KICAD_T Footprints []
 A scan list for only FOOTPRINTs. More...
 
static const KICAD_T PadsOrTracks []
 A scan list for PADs, TRACKs, or VIAs. More...
 
static const KICAD_T FootprintItems []
 A scan list for primary footprint items. More...
 
static const KICAD_T Tracks []
 A scan list for only TRACKs. More...
 
static const KICAD_T LockableItems []
 A scan list for TRACKs, VIAs, FOOTPRINTs. More...
 
static const KICAD_T Dimensions []
 A scan list for dimensions. More...
 
static const KICAD_T DraggableItems []
 A scan list for items that can be dragged. More...
 

Protected Attributes

std::vector< BOARD_ITEM * > m_List2nd
 A place to hold collected objects which don't match precisely the search criteria, but would be acceptable if nothing else is found. More...
 
const COLLECTORS_GUIDEm_Guide
 Determine which items are to be collected by Inspect(). More...
 
int m_PrimaryLength
 The number of items that were originally in the primary list before the m_List2nd was concatenated onto the end of it. More...
 
std::vector< EDA_ITEM * > m_list
 
std::vector< EDA_ITEM * > m_backupList
 
const KICAD_Tm_scanTypes
 
INSPECTOR_FUNC m_inspector
 
wxPoint m_refPos
 
EDA_RECT m_refBox
 

Detailed Description

Used when the right click button is pressed, or when the select tool is in effect.

This class can be used by window classes such as PCB_EDIT_FRAME.

Philosophy: this class knows nothing of the context in which a BOARD is used and that means it knows nothing about which layers are visible or current, but can handle those concerns by the SetPreferredLayer() function and the SetLayerSet() function.

Definition at line 240 of file collectors.h.

Member Typedef Documentation

◆ CITER

using COLLECTOR::CITER = std::vector<EDA_ITEM*>::const_iterator
inherited

Definition at line 77 of file collector.h.

◆ ITER

using COLLECTOR::ITER = std::vector<EDA_ITEM*>::iterator
inherited

Definition at line 76 of file collector.h.

Constructor & Destructor Documentation

◆ GENERAL_COLLECTOR()

GENERAL_COLLECTOR::GENERAL_COLLECTOR ( )
inline

Definition at line 315 of file collectors.h.

316  {
317  m_Guide = nullptr;
318  m_PrimaryLength = 0;
320  }
static const KICAD_T AllBoardItems[]
A scan list for all editable board items.
Definition: collectors.h:267
void SetScanTypes(const KICAD_T *scanTypes)
Record the list of KICAD_T types to consider for collection by the Inspect() function.
Definition: collector.h:220
int m_PrimaryLength
The number of items that were originally in the primary list before the m_List2nd was concatenated on...
Definition: collectors.h:260
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
Definition: collectors.h:254

References AllBoardItems, m_Guide, m_PrimaryLength, and COLLECTOR::SetScanTypes().

Member Function Documentation

◆ Append()

◆ Append2nd()

void GENERAL_COLLECTOR::Append2nd ( BOARD_ITEM item)
inline

Definition at line 327 of file collectors.h.

328  {
329  m_List2nd.push_back( item );
330  }
std::vector< BOARD_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
Definition: collectors.h:249

References m_List2nd.

Referenced by Inspect().

◆ begin() [1/2]

ITER COLLECTOR::begin ( )
inlineinherited

Definition at line 79 of file collector.h.

79 { return m_list.begin(); }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254

References COLLECTOR::m_list.

◆ begin() [2/2]

CITER COLLECTOR::begin ( ) const
inlineinherited

Definition at line 81 of file collector.h.

81 { return m_list.cbegin(); }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254

References COLLECTOR::m_list.

◆ Collect()

void GENERAL_COLLECTOR::Collect ( BOARD_ITEM aItem,
const KICAD_T  aScanList[],
const wxPoint &  aRefPos,
const COLLECTORS_GUIDE aGuide 
)

Scan a BOARD_ITEM using this class's Inspector method, which does the collection.

Parameters
aItemA BOARD_ITEM to scan, may be a BOARD or FOOTPRINT, or whatever.
aScanListA list of KICAD_Ts with a terminating EOT, that specs what is to be collected and the priority order of the resultant collection in "m_list".
aRefPosA wxPoint to use in hit-testing.
aGuideThe COLLECTORS_GUIDE to use in collecting items.

Definition at line 571 of file collectors.cpp.

573 {
574  Empty(); // empty the collection, primary criteria list
575  Empty2nd(); // empty the collection, secondary criteria list
576 
577  // remember guide, pass it to Inspect()
578  SetGuide( &aGuide );
579 
580  SetScanTypes( aScanList );
581 
582  // remember where the snapshot was taken from and pass refPos to
583  // the Inspect() function.
584  SetRefPos( aRefPos );
585 
586  aItem->Visit( m_inspector, nullptr, m_scanTypes );
587 
588  // record the length of the primary list before concatenating on to it.
589  m_PrimaryLength = m_list.size();
590 
591  // append 2nd list onto end of the first list
592  for( unsigned i = 0; i<m_List2nd.size(); ++i )
593  Append( m_List2nd[i] );
594 
595  Empty2nd();
596 }
void Empty()
Clear the list.
Definition: collector.h:95
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
Definition: eda_item.cpp:93
void SetScanTypes(const KICAD_T *scanTypes)
Record the list of KICAD_T types to consider for collection by the Inspect() function.
Definition: collector.h:220
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254
std::vector< BOARD_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
Definition: collectors.h:249
int m_PrimaryLength
The number of items that were originally in the primary list before the m_List2nd was concatenated on...
Definition: collectors.h:260
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition: collector.h:105
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:337
INSPECTOR_FUNC m_inspector
Definition: collector.h:258
void SetRefPos(const wxPoint &aRefPos)
Definition: collector.h:225
const KICAD_T * m_scanTypes
Definition: collector.h:257

References COLLECTOR::Append(), COLLECTOR::Empty(), Empty2nd(), COLLECTOR::m_inspector, COLLECTOR::m_list, m_List2nd, m_PrimaryLength, COLLECTOR::m_scanTypes, SetGuide(), COLLECTOR::SetRefPos(), COLLECTOR::SetScanTypes(), and EDA_ITEM::Visit().

Referenced by PCB_CONTROL::DeleteItemCursor(), PAD_TOOL::EnumeratePads(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_SELECTION_TOOL::selectionContains(), and PCB_SELECTION_TOOL::selectPoint().

◆ Combine()

void COLLECTOR::Combine ( )
inlineinherited

Re-combine the backup list into the main list of the collector.

Definition at line 148 of file collector.h.

149  {
150  std::copy( m_backupList.begin(), m_backupList.end(), std::back_inserter( m_list ) );
151  m_backupList.clear();
152  }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254
std::vector< EDA_ITEM * > m_backupList
Definition: collector.h:255

References COLLECTOR::m_backupList, and COLLECTOR::m_list.

Referenced by EE_SELECTION_TOOL::doSelectionMenu(), and PCB_SELECTION_TOOL::doSelectionMenu().

◆ CountType()

int COLLECTOR::CountType ( KICAD_T  aType)
inlineinherited

Count the number of items matching aType.

Parameters
aTypetype we are interested in.
Returns
number of occurrences.

Definition at line 235 of file collector.h.

236  {
237  int cnt = 0;
238 
239  for( size_t i = 0; i < m_list.size(); i++ )
240  {
241  if( m_list[i]->Type() == aType )
242  cnt++;
243  }
244 
245  return cnt;
246  }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254

References COLLECTOR::m_list.

Referenced by ROUTER_TOOL::NeighboringSegmentFilter().

◆ Empty()

◆ Empty2nd()

void GENERAL_COLLECTOR::Empty2nd ( )
inline

Definition at line 322 of file collectors.h.

323  {
324  m_List2nd.clear();
325  }
std::vector< BOARD_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
Definition: collectors.h:249

References m_List2nd.

Referenced by Collect().

◆ end() [1/2]

ITER COLLECTOR::end ( )
inlineinherited

Definition at line 80 of file collector.h.

80 { return m_list.end(); }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254

References COLLECTOR::m_list.

◆ end() [2/2]

CITER COLLECTOR::end ( ) const
inlineinherited

Definition at line 82 of file collector.h.

82 { return m_list.cend(); }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254

References COLLECTOR::m_list.

◆ GetBoundingBox()

const EDA_RECT& COLLECTOR::GetBoundingBox ( ) const
inlineinherited

Definition at line 227 of file collector.h.

227 { return m_refBox; }
EDA_RECT m_refBox
Definition: collector.h:260

References COLLECTOR::m_refBox.

◆ GetCount()

int COLLECTOR::GetCount ( ) const
inlineinherited

Return the number of objects in the list.

Definition at line 87 of file collector.h.

88  {
89  return (int) m_list.size();
90  }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254

References COLLECTOR::m_list.

Referenced by BuildBoardPolygonOutlines(), BuildFootprintPolygonOutlines(), EDIT_TOOL::ChangeTrackWidth(), EE_SELECTION_TOOL::CollectHits(), connectedItemFilter(), EDIT_TOOL::copyToClipboard(), FOOTPRINT::CoverageRatio(), CONVERT_TOOL::CreateLines(), CONVERT_TOOL::CreatePolys(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally(), ALIGN_DISTRIBUTE_TOOL::DistributeVertically(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), EDIT_TOOL::Drag(), EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), EDIT_TOOL::FilletTracks(), PCB_SELECTION_TOOL::FilterCollectedItems(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), EDIT_TOOL::FootprintFilter(), DSN::SPECCTRA_DB::FromBOARD(), EE_SELECTION_TOOL::GetNode(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), PANEL_SETUP_LAYERS::getRemovedLayersWithItems(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), GENDRILL_WRITER_BASE::getUniqueLayerPairs(), GROUP_TOOL::Group(), PL_SELECTION_TOOL::guessSelectionCandidates(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), EE_SELECTION_TOOL::GuessSelectionCandidates(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_EDIT_FRAME::inferLegacyEdgeClearance(), EE_COLLECTOR::IsCorner(), EE_SELECTION_TOOL::Main(), DSN::SPECCTRA_DB::makeIMAGE(), EDIT_TOOL::MoveExact(), EE_SELECTION_TOOL::narrowSelection(), ROUTER_TOOL::NeighboringSegmentFilter(), GERBER_COLLECTOR::operator[](), EE_COLLECTOR::operator[](), COLLECTOR::operator[](), PCB_COLLECTOR::operator[](), EDIT_TOOL::PadFilter(), POSITION_RELATIVE_TOOL::PositionRelative(), CONVERT_TOOL::SegmentToArc(), PCB_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), and PANEL_SETUP_LAYERS::TransferDataFromWindow().

◆ GetGuide()

const COLLECTORS_GUIDE* GENERAL_COLLECTOR::GetGuide ( ) const
inline

Definition at line 339 of file collectors.h.

339 { return m_Guide; }
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
Definition: collectors.h:254

References m_Guide.

Referenced by FOOTPRINT::CoverageRatio(), FOOTPRINT::GetCoverageArea(), and PCB_SELECTION_TOOL::GuessSelectionCandidates().

◆ GetPrimaryCount()

int GENERAL_COLLECTOR::GetPrimaryCount ( )
inline
Returns
The number of items which met the primary search criteria

Definition at line 344 of file collectors.h.

344 { return m_PrimaryLength; }
int m_PrimaryLength
The number of items that were originally in the primary list before the m_List2nd was concatenated on...
Definition: collectors.h:260

References m_PrimaryLength.

◆ HasAdditionalItems()

bool COLLECTOR::HasAdditionalItems ( )
inlineinherited

Test if the collector has heuristic backup items.

Returns
true if Combine() can run to bring secondary items into the list.

Definition at line 140 of file collector.h.

141  {
142  return !m_backupList.empty();
143  }
std::vector< EDA_ITEM * > m_backupList
Definition: collector.h:255

References COLLECTOR::m_backupList.

Referenced by EE_SELECTION_TOOL::doSelectionMenu(), and PCB_SELECTION_TOOL::doSelectionMenu().

◆ HasItem()

bool COLLECTOR::HasItem ( const EDA_ITEM aItem) const
inlineinherited

Tests if aItem has already been collected.

Parameters
aItemThe EDA_ITEM* to be tested.
Returns
True if aItem is already collected.

Definition at line 203 of file collector.h.

204  {
205  for( size_t i = 0; i < m_list.size(); i++ )
206  {
207  if( m_list[i] == aItem )
208  return true;
209  }
210 
211  return false;
212  }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254

References COLLECTOR::m_list.

Referenced by EDIT_TOOL::copyToClipboard(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), PCB_SELECTION_TOOL::FilterCollectorForHierarchy(), and POSITION_RELATIVE_TOOL::PositionRelative().

◆ Inspect()

SEARCH_RESULT GENERAL_COLLECTOR::Inspect ( EDA_ITEM testItem,
void *  testData 
)
overridevirtual

The examining function within the INSPECTOR which is passed to the Iterate function.

Search and collect all the objects which match the test data.

Parameters
testItemAn EDA_ITEM to examine.
testDatais not used in this class.
Returns
SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE;

Reimplemented from COLLECTOR.

Definition at line 157 of file collectors.cpp.

158 {
159  BOARD_ITEM* item = (BOARD_ITEM*) testItem;
160  FOOTPRINT* footprint = nullptr;
161  PCB_GROUP* group = nullptr;
162  PAD* pad = nullptr;
163  bool pad_through = false;
164  PCB_VIA* via = nullptr;
165  PCB_MARKER* marker = nullptr;
166  ZONE* zone = nullptr;
167  PCB_SHAPE* shape = nullptr;
168  PCB_DIMENSION_BASE* dimension = nullptr;
169 
170 #if 0 // debugging
171  static int breakhere = 0;
172 
173  switch( item->Type() )
174  {
175  case PCB_PAD_T:
176  {
177  FOOTPRINT* footprint = (FOOTPRINT*) item->GetParent();
178 
179  if( footprint->GetReference() == wxT( "Y2" ) )
180  breakhere++;
181  }
182  break;
183 
184  case PCB_VIA_T:
185  breakhere++;
186  break;
187 
188  case PCB_TRACE_T:
189  case PCB_ARC_T:
190  breakhere++;
191  break;
192 
193  case PCB_TEXT_T:
194  breakhere++;
195  break;
196 
197  case PCB_SHAPE_T:
198  breakhere++;
199  break;
200 
201  case PCB_DIM_ALIGNED_T:
202  breakhere++;
203  break;
204 
205  case PCB_FP_TEXT_T:
206  {
207  FP_TEXT* fpText = (FP_TEXT*) item;
208 
209  if( fpText->GetText() == wxT( "10uH" ) )
210  breakhere++;
211  }
212  break;
213 
214  case PCB_FOOTPRINT_T:
215  {
216  FOOTPRINT* footprint = (FOOTPRINT*) item;
217 
218  if( footprint->GetReference() == wxT( "C98" ) )
219  breakhere++;
220  }
221  break;
222 
223  case PCB_MARKER_T:
224  breakhere++;
225  break;
226 
227  default:
228  breakhere++;
229  break;
230  }
231 
232 #endif
233 
234  switch( item->Type() )
235  {
236  case PCB_PAD_T:
237  // there are pad specific visibility controls.
238  // Criteria to select a pad is:
239  // for smd pads: the footprint parent must be visible, and pads on the corresponding
240  // board side must be visible
241  // if pad is a thru hole, then it can be visible when its parent footprint is not.
242  // for through pads: pads on Front or Back board sides must be visible
243  pad = static_cast<PAD*>( item );
244 
245  if( ( pad->GetAttribute() != PAD_ATTRIB::SMD ) &&
246  ( pad->GetAttribute() != PAD_ATTRIB::CONN ) ) // a hole is present, so multiple layers
247  {
248  // proceed to the common tests below, but without the parent footprint test,
249  // by leaving footprint==NULL, but having pad != null
250  pad_through = true;
251  }
252  else // smd, so use pads test after footprint test
253  {
254  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
255  }
256 
257  break;
258 
259  case PCB_VIA_T: // vias are on many layers, so layer test is specific
260  via = static_cast<PCB_VIA*>( item );
261  break;
262 
263  case PCB_TRACE_T:
264  case PCB_ARC_T:
265  if( m_Guide->IgnoreTracks() )
266  goto exit;
267 
268  break;
269 
270  case PCB_FP_ZONE_T:
271  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
272 
273  // Fallthrough to get the zone as well
275 
276  case PCB_ZONE_T:
277  zone = static_cast<ZONE*>( item );
278  break;
279 
280  case PCB_TEXT_T:
281  break;
282 
283  case PCB_SHAPE_T:
284  shape = static_cast<PCB_SHAPE*>( item );
285  break;
286 
287  case PCB_DIM_ALIGNED_T:
288  case PCB_DIM_CENTER_T:
290  case PCB_DIM_LEADER_T:
291  dimension = static_cast<PCB_DIMENSION_BASE*>( item );
292  break;
293 
294  case PCB_TARGET_T:
295  break;
296 
297  case PCB_FP_TEXT_T:
298  {
299  FP_TEXT *text = static_cast<FP_TEXT*>( item );
300 
301  if( m_Guide->IgnoreHiddenFPText() && !text->IsVisible() )
302  goto exit;
303 
304  if( m_Guide->IgnoreFPTextOnBack() && IsBackLayer( text->GetLayer() ) )
305  goto exit;
306 
307  if( m_Guide->IgnoreFPTextOnFront() && IsFrontLayer( text->GetLayer() ) )
308  goto exit;
309 
310  /* The three text types have different criteria: reference
311  * and value have their own ignore flags; user text instead
312  * follows their layer visibility. Checking this here is
313  * simpler than later (when layer visibility is checked for
314  * other entities) */
315 
316  switch( text->GetType() )
317  {
319  if( m_Guide->IgnoreFPReferences() )
320  goto exit;
321 
322  break;
323 
325  if( m_Guide->IgnoreFPValues() )
326  goto exit;
327 
328  break;
329 
331  if( !m_Guide->IsLayerVisible( text->GetLayer() )
333  goto exit;
334 
335  break;
336  }
337 
338  // Extract the footprint since it could be hidden
339  footprint = static_cast<FOOTPRINT*>( item->GetParent() );
340  break;
341  }
342 
343  case PCB_FP_SHAPE_T:
344  shape = static_cast<FP_SHAPE*>( item );
345  break;
346 
347  case PCB_FOOTPRINT_T:
348  footprint = static_cast<FOOTPRINT*>( item );
349  break;
350 
351  case PCB_GROUP_T:
352  group = static_cast<PCB_GROUP*>( item );
353  break;
354 
355  case PCB_MARKER_T:
356  marker = static_cast<PCB_MARKER*>( item );
357  break;
358 
359  default:
360  break;
361  }
362 
363  // common tests:
364 
365  if( footprint ) // true from case PCB_PAD_T, PCB_FP_TEXT_T, or PCB_FOOTPRINT_T
366  {
367  if( m_Guide->IgnoreFootprintsOnBack() && ( footprint->GetLayer() == B_Cu ) )
368  goto exit;
369 
370  if( m_Guide->IgnoreFootprintsOnFront() && ( footprint->GetLayer() == F_Cu ) )
371  goto exit;
372  }
373 
374  // Pads are not sensitive to the layer visibility controls.
375  // They all have their own separate visibility controls
376  // skip them if not visible
377  if( pad )
378  {
379  if( m_Guide->IgnorePads() )
380  goto exit;
381 
382  if( ! pad_through )
383  {
384  if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(F_Cu ) )
385  goto exit;
386 
387  if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(B_Cu ) )
388  goto exit;
389  }
390  }
391 
392  if( marker )
393  {
394  // Markers are not sensitive to the layer
395  if( marker->HitTest( m_refPos ) )
396  Append( item );
397 
398  goto exit;
399  }
400 
401  if( group )
402  {
403  // Groups are not sensitive to the layer ... ?
404  if( group->HitTest( m_refPos ) )
405  Append( item );
406 
407  goto exit;
408  }
409 
410  if( via )
411  {
412  auto type = via->GetViaType();
413 
414  if( ( m_Guide->IgnoreThroughVias() && type == VIATYPE::THROUGH )
416  || ( m_Guide->IgnoreMicroVias() && type == VIATYPE::MICROVIA ) )
417  {
418  goto exit;
419  }
420  }
421 
423  {
424  PCB_LAYER_ID layer = item->GetLayer();
425 
426  // footprints and their subcomponents: reference, value and pads are not sensitive
427  // to the layer visibility controls. They all have their own separate visibility
428  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
429  // text in a footprint *is* sensitive to layer visibility but that was already handled.
430 
431  if( via || footprint || pad || m_Guide->IsLayerVisible( layer )
433  {
434  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
435  {
436  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
437  {
438  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
439 
440  if( zone )
441  {
442  bool testFill = !m_Guide->IgnoreZoneFills();
443 
444  if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
445  || zone->HitTestForEdge( m_refPos, accuracy )
446  || ( testFill && zone->HitTestFilledArea( layer, m_refPos ) ) )
447  {
448  Append( item );
449  goto exit;
450  }
451  }
452  else if( item->Type() == PCB_FOOTPRINT_T )
453  {
454  if( footprint->HitTest( m_refPos, accuracy )
455  && footprint->HitTestAccurate( m_refPos, accuracy ) )
456  {
457  Append( item );
458  goto exit;
459  }
460  }
461  else if( shape )
462  {
463  if( shape->HitTest( m_refPos, accuracy ) )
464  {
465  Append( shape );
466  goto exit;
467  }
468  }
469  else if( dimension )
470  {
471  // Dimensions feel particularly hard to select, probably due to their
472  // noisy shape making it feel like they should have a larger boundary.
473  if( dimension->HitTest( m_refPos, KiROUND( accuracy * 1.5 ) ) )
474  {
475  Append( dimension );
476  goto exit;
477  }
478  }
479  else
480  {
481  if( item->HitTest( m_refPos, accuracy ) )
482  {
483  Append( item );
484  goto exit;
485  }
486  }
487  }
488  }
489  }
490  }
491 
492  if( m_Guide->IncludeSecondary() )
493  {
494  // for now, "secondary" means "tolerate any layer". It has
495  // no effect on other criteria, since there is a separate "ignore" control for
496  // those in the COLLECTORS_GUIDE
497 
498  PCB_LAYER_ID layer = item->GetLayer();
499 
500  // footprints and their subcomponents: reference, value and pads are not sensitive
501  // to the layer visibility controls. They all have their own separate visibility
502  // controls for vias, GetLayer() has no meaning, but IsOnLayer() works fine. User
503  // text in a footprint *is* sensitive to layer visibility but that was already handled.
504 
505  if( via || footprint || pad || zone || m_Guide->IsLayerVisible( layer )
507  {
508  if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
509  {
510  if( !item->IsLocked() || !m_Guide->IgnoreLockedItems() )
511  {
512  int accuracy = KiROUND( 5 * m_Guide->OnePixelInIU() );
513 
514  if( zone )
515  {
516  bool testFill = !m_Guide->IgnoreZoneFills();
517 
518  if( zone->HitTestForCorner( m_refPos, accuracy * 2 )
519  || zone->HitTestForEdge( m_refPos, accuracy )
520  || ( testFill && zone->HitTestFilledArea( layer, m_refPos ) ) )
521  {
522  Append2nd( item );
523  goto exit;
524  }
525  }
526  else if( item->Type() == PCB_FOOTPRINT_T )
527  {
528  if( footprint->HitTest( m_refPos, accuracy )
529  && footprint->HitTestAccurate( m_refPos, accuracy ) )
530  {
531  Append2nd( item );
532  goto exit;
533  }
534  }
535  else if( shape )
536  {
537  if( shape->HitTest( m_refPos, accuracy ) )
538  {
539  Append2nd( shape );
540  goto exit;
541  }
542  }
543  else if( dimension )
544  {
545  // Dimensions feels particularly hard to select, probably due to their
546  // noisy shape making it feel like they should have a larger boundary.
547  if( dimension->HitTest( m_refPos, KiROUND( accuracy * 1.5 ) ) )
548  {
549  Append2nd( dimension );
550  goto exit;
551  }
552  }
553  else
554  {
555  if( item->HitTest( m_refPos, 0 ) )
556  {
557  Append2nd( item );
558  goto exit;
559  }
560  }
561  }
562  }
563  }
564  }
565 
566 exit:
567  return SEARCH_RESULT::CONTINUE; // always when collecting
568 }
virtual bool IsLayerLocked(PCB_LAYER_ID layer) const =0
virtual bool IgnoreBlindBuriedVias() const =0
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:100
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:108
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:50
virtual double OnePixelInIU() const =0
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:102
virtual bool IgnoreFootprintsOnBack() const =0
Like smd, does not appear on the solder paste layer (default)
virtual bool IgnoreZoneFills() const =0
Smd pad, appears on the solder paste layer (default)
virtual bool IgnoreNonVisibleLayers() const =0
void Append2nd(BOARD_ITEM *item)
Definition: collectors.h:327
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
virtual PCB_LAYER_ID GetPreferredLayer() const =0
virtual bool IgnoreFPTextOnFront() const =0
virtual bool IgnoreTracks() const =0
virtual bool IgnoreFootprintsOnFront() const =0
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
class PAD, a pad in a footprint
Definition: typeinfo.h:89
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
Abstract dimension API.
Definition: pcb_dimension.h:95
virtual bool IgnoreMicroVias() const =0
virtual bool IsLocked() const
Definition: board_item.cpp:78
virtual bool IgnoreHiddenFPText() const =0
virtual bool IgnorePreferredLayer() const =0
Provide wildcard behavior regarding the preferred layer.
bool HitTestFilledArea(PCB_LAYER_ID aLayer, const wxPoint &aRefPos, int aAccuracy=0) const
Test if the given wxPoint is within the bounds of a filled area of this zone.
Definition: zone.cpp:506
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a corner.
Definition: zone.cpp:425
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
virtual bool IgnorePadsOnFront() const =0
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition: collector.h:105
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const
Test if aPosition is contained within or on the bounding box of an item.
Definition: eda_item.h:225
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: pcb_shape.cpp:697
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:229
bool IsBackLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a back layer.
Definition: layer_ids.h:886
wxPoint m_refPos
Definition: collector.h:259
const wxString & GetReference() const
Definition: footprint.h:430
Handle a list of polygons defining a copper zone.
Definition: zone.h:56
class ZONE, a copper pour area
Definition: typeinfo.h:105
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
Definition: collectors.h:254
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
Definition: layer_ids.h:863
virtual bool IgnoreThroughVias() const =0
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
virtual bool IgnoreFPTextOnBack() const =0
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:98
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Test if the given wxPoint is near a segment defined by 2 corners.
Definition: zone.cpp:439
virtual bool IgnorePads() const
Definition: collectors.h:152
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: pcb_marker.h:75
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:64
Definition: layer_ids.h:70
class ZONE, managed by a footprint
Definition: typeinfo.h:94
virtual bool IgnoreFPValues() const =0
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:73
virtual bool IsLayerVisible(PCB_LAYER_ID layer) const =0
virtual bool IgnoreFPReferences() const =0
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:103
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
virtual bool IgnorePadsOnBack() const =0
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: footprint.cpp:953
virtual bool IgnoreLockedItems() const =0
virtual bool IgnoreLockedLayers() const =0
Definition: pad.h:57
virtual bool IncludeSecondary() const =0
Determine if the secondary criteria or 2nd choice items should be included.
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:166
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:171
bool HitTestAccurate(const wxPoint &aPosition, int aAccuracy=0) const
Test if a point is inside the bounding polygon of the footprint.
Definition: footprint.cpp:960
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Test if aPosition is contained within or on the bounding box of an item.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

References COLLECTOR::Append(), Append2nd(), B_Cu, BLIND_BURIED, CONN, CONTINUE, exit, F_Cu, BOARD_ITEM::GetLayer(), BOARD_ITEM::GetParent(), COLLECTORS_GUIDE::GetPreferredLayer(), FOOTPRINT::GetReference(), EDA_TEXT::GetText(), group, PCB_MARKER::HitTest(), EDA_ITEM::HitTest(), PCB_DIMENSION_BASE::HitTest(), PCB_SHAPE::HitTest(), FOOTPRINT::HitTest(), FOOTPRINT::HitTestAccurate(), ZONE::HitTestFilledArea(), ZONE::HitTestForCorner(), ZONE::HitTestForEdge(), COLLECTORS_GUIDE::IgnoreBlindBuriedVias(), COLLECTORS_GUIDE::IgnoreFootprintsOnBack(), COLLECTORS_GUIDE::IgnoreFootprintsOnFront(), COLLECTORS_GUIDE::IgnoreFPReferences(), COLLECTORS_GUIDE::IgnoreFPTextOnBack(), COLLECTORS_GUIDE::IgnoreFPTextOnFront(), COLLECTORS_GUIDE::IgnoreFPValues(), COLLECTORS_GUIDE::IgnoreHiddenFPText(), COLLECTORS_GUIDE::IgnoreLockedItems(), COLLECTORS_GUIDE::IgnoreLockedLayers(), COLLECTORS_GUIDE::IgnoreMicroVias(), COLLECTORS_GUIDE::IgnoreNonVisibleLayers(), COLLECTORS_GUIDE::IgnorePads(), COLLECTORS_GUIDE::IgnorePadsOnBack(), COLLECTORS_GUIDE::IgnorePadsOnFront(), COLLECTORS_GUIDE::IgnorePreferredLayer(), COLLECTORS_GUIDE::IgnoreThroughVias(), COLLECTORS_GUIDE::IgnoreTracks(), COLLECTORS_GUIDE::IgnoreZoneFills(), COLLECTORS_GUIDE::IncludeSecondary(), IsBackLayer(), IsFrontLayer(), COLLECTORS_GUIDE::IsLayerLocked(), COLLECTORS_GUIDE::IsLayerVisible(), BOARD_ITEM::IsLocked(), BOARD_ITEM::IsOnLayer(), KI_FALLTHROUGH, KiROUND(), m_Guide, COLLECTOR::m_refPos, MICROVIA, COLLECTORS_GUIDE::OnePixelInIU(), pad, PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_MARKER_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, SMD, text, FP_TEXT::TEXT_is_DIVERS, FP_TEXT::TEXT_is_REFERENCE, FP_TEXT::TEXT_is_VALUE, THROUGH, EDA_ITEM::Type(), and via.

◆ operator[]()

BOARD_ITEM* PCB_COLLECTOR::operator[] ( int  ndx) const
inlineoverridevirtualinherited

Overload the COLLECTOR::operator[](int) to return a BOARD_ITEM instead of an EDA_ITEM.

Parameters
ndxThe index into the list.
Returns
a board item or NULL.

Reimplemented from COLLECTOR.

Definition at line 221 of file collectors.h.

222  {
223  if( (unsigned)ndx < (unsigned)GetCount() )
224  return (BOARD_ITEM*) m_list[ ndx ];
225 
226  return nullptr;
227  }
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:87

References COLLECTOR::GetCount(), and COLLECTOR::m_list.

◆ Remove() [1/2]

◆ Remove() [2/2]

void COLLECTOR::Remove ( const EDA_ITEM aItem)
inlineinherited

Remove the item aItem (if exists in the collector).

Parameters
aItemthe item to be removed.

Definition at line 125 of file collector.h.

126  {
127  m_list.erase( std::remove_if( m_list.begin(), m_list.end(),
128  [&aItem]( const EDA_ITEM* aCandidate )
129  {
130  return aCandidate == aItem;
131  } ),
132  m_list.end() );
133  }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100

References COLLECTOR::m_list.

◆ SetGuide()

void GENERAL_COLLECTOR::SetGuide ( const COLLECTORS_GUIDE aGuide)
inline

Record which COLLECTORS_GUIDE to use.

Parameters
aGuideWhich guide to use in the collection.

Definition at line 337 of file collectors.h.

337 { m_Guide = aGuide; }
const COLLECTORS_GUIDE * m_Guide
Determine which items are to be collected by Inspect().
Definition: collectors.h:254

References m_Guide.

Referenced by Collect().

◆ SetRefPos()

void COLLECTOR::SetRefPos ( const wxPoint &  aRefPos)
inlineinherited

Definition at line 225 of file collector.h.

225 { m_refPos = aRefPos; }
wxPoint m_refPos
Definition: collector.h:259

References COLLECTOR::m_refPos.

Referenced by EE_COLLECTOR::Collect(), GERBER_COLLECTOR::Collect(), and Collect().

◆ SetScanTypes()

void COLLECTOR::SetScanTypes ( const KICAD_T scanTypes)
inlineinherited

Record the list of KICAD_T types to consider for collection by the Inspect() function.

Parameters
scanTypesAn array of KICAD_T, terminated by EOT. No copy is is made of this array (so cannot come from caller's stack).

Definition at line 220 of file collector.h.

221  {
222  m_scanTypes = scanTypes;
223  }
const KICAD_T * m_scanTypes
Definition: collector.h:257

References COLLECTOR::m_scanTypes.

Referenced by EE_COLLECTOR::Collect(), GERBER_COLLECTOR::Collect(), Collect(), EE_COLLECTOR::EE_COLLECTOR(), GENERAL_COLLECTOR(), and GERBER_COLLECTOR::GERBER_COLLECTOR().

◆ Transfer() [1/2]

void COLLECTOR::Transfer ( int  aIndex)
inlineinherited

Move the item at aIndex (first position is 0) to the backup list.

Parameters
aIndexThe index into the list.

Definition at line 159 of file collector.h.

160  {
161  m_backupList.push_back( m_list[aIndex] );
162  m_list.erase( m_list.begin() + aIndex );
163  }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254
std::vector< EDA_ITEM * > m_backupList
Definition: collector.h:255

References COLLECTOR::m_backupList, and COLLECTOR::m_list.

Referenced by PL_SELECTION_TOOL::guessSelectionCandidates(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), and EE_SELECTION_TOOL::GuessSelectionCandidates().

◆ Transfer() [2/2]

void COLLECTOR::Transfer ( EDA_ITEM aItem)
inlineinherited

Move aItem (if exists in the collector) to the backup list.

Parameters
aItemthe item to be moved.

Definition at line 170 of file collector.h.

171  {
172  for( size_t i = 0; i < m_list.size(); i++ )
173  {
174  if( m_list[i] == aItem )
175  {
176  m_list.erase( m_list.begin() + i );
177  m_backupList.push_back( aItem );
178  return;
179  }
180  }
181  }
std::vector< EDA_ITEM * > m_list
Definition: collector.h:254
std::vector< EDA_ITEM * > m_backupList
Definition: collector.h:255

References COLLECTOR::m_backupList, and COLLECTOR::m_list.

Member Data Documentation

◆ AllBoardItems

◆ BoardLevelItems

const KICAD_T GENERAL_COLLECTOR::BoardLevelItems
static

◆ Dimensions

const KICAD_T GENERAL_COLLECTOR::Dimensions
static
Initial value:

A scan list for dimensions.

Definition at line 308 of file collectors.h.

Referenced by PCB_BASE_EDIT_FRAME::unitsChangeRefresh().

◆ DraggableItems

const KICAD_T GENERAL_COLLECTOR::DraggableItems
static
Initial value:

A scan list for items that can be dragged.

Definition at line 313 of file collectors.h.

Referenced by ROUTER_TOOL::CanInlineDrag(), and EDIT_TOOL::Init().

◆ FootprintItems

◆ Footprints

const KICAD_T GENERAL_COLLECTOR::Footprints
static
Initial value:

A scan list for only FOOTPRINTs.

Definition at line 283 of file collectors.h.

◆ LockableItems

const KICAD_T GENERAL_COLLECTOR::LockableItems
static
Initial value:

A scan list for TRACKs, VIAs, FOOTPRINTs.

Definition at line 303 of file collectors.h.

◆ m_backupList

std::vector<EDA_ITEM*> COLLECTOR::m_backupList
protectedinherited

◆ m_Guide

const COLLECTORS_GUIDE* GENERAL_COLLECTOR::m_Guide
protected

Determine which items are to be collected by Inspect().

Definition at line 254 of file collectors.h.

Referenced by GENERAL_COLLECTOR(), GetGuide(), Inspect(), and SetGuide().

◆ m_inspector

INSPECTOR_FUNC COLLECTOR::m_inspector
protectedinherited

◆ m_list

◆ m_List2nd

std::vector<BOARD_ITEM*> GENERAL_COLLECTOR::m_List2nd
protected

A place to hold collected objects which don't match precisely the search criteria, but would be acceptable if nothing else is found.

"2nd" choice, which will be appended to the end of COLLECTOR's prime "list" at the end of the search.

Definition at line 249 of file collectors.h.

Referenced by Append2nd(), Collect(), and Empty2nd().

◆ m_MenuCancelled

bool COLLECTOR::m_MenuCancelled
inherited

◆ m_MenuTitle

◆ m_PrimaryLength

int GENERAL_COLLECTOR::m_PrimaryLength
protected

The number of items that were originally in the primary list before the m_List2nd was concatenated onto the end of it.

Definition at line 260 of file collectors.h.

Referenced by Collect(), GENERAL_COLLECTOR(), and GetPrimaryCount().

◆ m_refBox

EDA_RECT COLLECTOR::m_refBox
protectedinherited

Definition at line 260 of file collector.h.

Referenced by COLLECTOR::GetBoundingBox().

◆ m_refPos

wxPoint COLLECTOR::m_refPos
protectedinherited

◆ m_scanTypes

const KICAD_T* COLLECTOR::m_scanTypes
protectedinherited

◆ m_Threshold

◆ PadsOrTracks

const KICAD_T GENERAL_COLLECTOR::PadsOrTracks
static
Initial value:

A scan list for PADs, TRACKs, or VIAs.

Definition at line 288 of file collectors.h.

Referenced by BOARD_INSPECTION_TOOL::highlightNet().

◆ Tracks

const KICAD_T GENERAL_COLLECTOR::Tracks
static
Initial value:

A scan list for only TRACKs.

Definition at line 298 of file collectors.h.

Referenced by EDIT_TOOL::Init(), EDIT_TOOL::Properties(), PCB_EDIT_FRAME::setupUIConditions(), and BOARD::TracksInNet().

◆ Zones

const KICAD_T GENERAL_COLLECTOR::Zones
static
Initial value:

A scan list for zones outlines only.

Definition at line 272 of file collectors.h.

Referenced by BOARD_INSPECTION_TOOL::highlightNet(), and PCB_EDIT_FRAME::setupUIConditions().


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