KiCad PCB EDA Suite
collectors.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
5  * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef COLLECTORS_H
26 #define COLLECTORS_H
27 
28 
29 /* This module contains a number of COLLECTOR implementations which are used
30  * to augment the functionality of class PCB_EDIT_FRAME.
31  */
32 
33 
34 #include <collector.h>
35 #include <layers_id_colors_and_visibility.h> // LAYER_COUNT, layer defs
36 #include <view/view.h>
37 #include <class_board_item.h>
38 
39 
40 
60 {
61 
62 public:
63  virtual ~COLLECTORS_GUIDE() {}
64 
68  virtual bool IsLayerLocked( PCB_LAYER_ID layer ) const = 0;
69 
73  virtual bool IsLayerVisible( PCB_LAYER_ID layer ) const = 0;
74 
78  virtual bool IgnoreLockedLayers() const = 0;
79 
83  virtual bool IgnoreNonVisibleLayers() const = 0;
84 
88  virtual PCB_LAYER_ID GetPreferredLayer() const = 0;
89 
95  virtual bool IgnorePreferredLayer() const = 0;
96 
100  virtual bool IgnoreLockedItems() const = 0;
101 
107  virtual bool IncludeSecondary() const = 0;
108 
112  virtual bool IgnoreMTextsMarkedNoShow() const = 0;
113 
117  virtual bool IgnoreMTextsOnBack() const = 0;
118 
122  virtual bool IgnoreMTextsOnFront() const = 0;
123 
127  virtual bool IgnoreModulesOnBack() const = 0;
128 
132  virtual bool IgnoreModulesOnFront() const = 0;
133 
137  virtual bool IgnorePadsOnBack() const = 0;
138 
142  virtual bool IgnorePadsOnFront() const = 0;
143 
147  virtual bool IgnoreThroughHolePads() const = 0;
148 
152  virtual bool IgnorePads() const
153  {
155  }
156 
160  virtual bool IgnoreModulesVals() const = 0;
161 
165  virtual bool IgnoreModulesRefs() const = 0;
166 
170  virtual bool IgnoreThroughVias() const = 0;
171 
175  virtual bool IgnoreBlindBuriedVias() const = 0;
176 
180  virtual bool IgnoreMicroVias() const = 0;
181 
185  virtual bool IgnoreTracks() const = 0;
186 
190  virtual bool IgnoreZoneFills() const = 0;
191 
192  virtual double OnePixelInIU() const = 0;
193 
199 };
200 
201 
202 
212 class PCB_COLLECTOR : public COLLECTOR
213 {
214 public:
221  BOARD_ITEM* operator[]( int ndx ) const override
222  {
223  if( (unsigned)ndx < (unsigned)GetCount() )
224  return (BOARD_ITEM*) m_List[ ndx ];
225 
226  return NULL;
227  }
228 };
229 
230 
241 {
242 protected:
249  std::vector<BOARD_ITEM*> m_List2nd;
250 
255 
261 
262 public:
263 
267  static const KICAD_T AllBoardItems[];
268 
272  static const KICAD_T AllButZones[];
273 
277  static const KICAD_T Zones[];
278 
283  static const KICAD_T BoardLevelItems[];
284 
288  static const KICAD_T Modules[];
289 
293  static const KICAD_T PadsOrModules[];
294 
298  static const KICAD_T PadsOrTracks[];
299 
304 
308  static const KICAD_T ModuleItems[];
309 
313  static const KICAD_T Tracks[];
314 
318  static const KICAD_T LockableItems[];
319 
324  {
325  m_Guide = NULL;
326  m_PrimaryLength = 0;
328  }
329 
330  void Empty2nd()
331  {
332  m_List2nd.clear();
333  }
334 
335  void Append2nd( BOARD_ITEM* item )
336  {
337  m_List2nd.push_back( item );
338  }
339 
345  void SetGuide( const COLLECTORS_GUIDE* aGuide ) { m_Guide = aGuide; }
346 
347  const COLLECTORS_GUIDE* GetGuide() { return m_Guide; }
348 
353 
365  SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
366 
377  void Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
378  const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide );
379 };
380 
381 
387 {
388 private:
389  // the storage architecture here is not important, since this is only
390  // a carrier object and its functions are what is used, and data only indirectly.
391 
394 
397 
400 
403 
419 
421 
422 public:
423 
432  GENERAL_COLLECTORS_GUIDE( LSET aVisibleLayerMask, PCB_LAYER_ID aPreferredLayer,
433  KIGFX::VIEW* aView )
434  {
435  VECTOR2I one( 1, 1 );
436 
437  m_PreferredLayer = aPreferredLayer;
438  m_IgnorePreferredLayer = false;
439  m_LayerVisible = aVisibleLayerMask;
440  m_IgnoreLockedLayers = true;
442  m_IgnoreLockedItems = false;
443 
444 #if defined(USE_MATCH_LAYER)
445  m_IncludeSecondary = false;
446 #else
447  m_IncludeSecondary = true;
448 #endif
449 
450  m_IgnoreMTextsMarkedNoShow = true; // g_ModuleTextNOVColor;
451  m_IgnoreMTextsOnBack = true;
452  m_IgnoreMTextsOnFront = false;
453  m_IgnoreModulesOnBack = true; // !Show_Modules_Cmp;
454  m_IgnoreModulesOnFront = false;
455 
456  m_IgnorePadsOnFront = false;
457  m_IgnorePadsOnBack = false;
458  m_IgnoreThroughHolePads = false;
459 
460  m_IgnoreModulesVals = false;
461  m_IgnoreModulesRefs = false;
462 
463  m_IgnoreThroughVias = false;
464  m_IgnoreBlindBuriedVias = false;
465  m_IgnoreMicroVias = false;
466  m_IgnoreTracks = false;
467  m_IgnoreZoneFills = true;
468 
469  m_OnePixelInIU = aView->ToWorld( one, false ).x;
470  }
471 
475  bool IsLayerLocked( PCB_LAYER_ID aLayerId ) const override
476  {
477  return m_LayerLocked[aLayerId];
478  }
479 
480  void SetLayerLocked( PCB_LAYER_ID aLayerId, bool isLocked )
481  {
482  m_LayerLocked.set( aLayerId, isLocked );
483  }
484 
488  bool IsLayerVisible( PCB_LAYER_ID aLayerId ) const override
489  {
490  return m_LayerVisible[aLayerId];
491  }
492  void SetLayerVisible( PCB_LAYER_ID aLayerId, bool isVisible )
493  {
494  m_LayerVisible.set( aLayerId, isVisible );
495  }
496  void SetLayerVisibleBits( LSET aLayerBits ) { m_LayerVisible = aLayerBits; }
497 
501  bool IgnoreLockedLayers() const override { return m_IgnoreLockedLayers; }
502  void SetIgnoreLockedLayers( bool ignore ) { m_IgnoreLockedLayers = ignore; }
503 
507  bool IgnoreNonVisibleLayers() const override { return m_IgnoreNonVisibleLayers; }
508  void SetIgnoreNonVisibleLayers( bool ignore ) { m_IgnoreLockedLayers = ignore; }
509 
513  PCB_LAYER_ID GetPreferredLayer() const override { return m_PreferredLayer; }
514  void SetPreferredLayer( PCB_LAYER_ID aLayer ) { m_PreferredLayer = aLayer; }
515 
521  bool IgnorePreferredLayer() const override { return m_IgnorePreferredLayer; }
522  void SetIgnorePreferredLayer( bool ignore ) { m_IgnorePreferredLayer = ignore; }
523 
527  bool IgnoreLockedItems() const override { return m_IgnoreLockedItems; }
528  void SetIgnoreLockedItems( bool ignore ) { m_IgnoreLockedItems = ignore; }
529 
535  bool IncludeSecondary() const override { return m_IncludeSecondary; }
536  void SetIncludeSecondary( bool include ) { m_IncludeSecondary = include; }
537 
541  bool IgnoreMTextsMarkedNoShow() const override { return m_IgnoreMTextsMarkedNoShow; }
542  void SetIgnoreMTextsMarkedNoShow( bool ignore ) { m_IgnoreMTextsMarkedNoShow = ignore; }
543 
547  bool IgnoreMTextsOnBack() const override { return m_IgnoreMTextsOnBack; }
548  void SetIgnoreMTextsOnBack( bool ignore ) { m_IgnoreMTextsOnBack = ignore; }
549 
553  bool IgnoreMTextsOnFront() const override { return m_IgnoreMTextsOnFront; }
554  void SetIgnoreMTextsOnFront( bool ignore ) { m_IgnoreMTextsOnFront = ignore; }
555 
559  bool IgnoreModulesOnBack() const override { return m_IgnoreModulesOnBack; }
560  void SetIgnoreModulesOnBack( bool ignore ) { m_IgnoreModulesOnBack = ignore; }
561 
565  bool IgnoreModulesOnFront() const override { return m_IgnoreModulesOnFront; }
566  void SetIgnoreModulesOnFront( bool ignore ) { m_IgnoreModulesOnFront = ignore; }
567 
571  bool IgnorePadsOnBack() const override { return m_IgnorePadsOnBack; }
572  void SetIgnorePadsOnBack(bool ignore) { m_IgnorePadsOnBack = ignore; }
573 
577  bool IgnorePadsOnFront() const override { return m_IgnorePadsOnFront; }
578  void SetIgnorePadsOnFront(bool ignore) { m_IgnorePadsOnFront = ignore; }
579 
583  bool IgnoreThroughHolePads() const override { return m_IgnoreThroughHolePads; }
584  void SetIgnoreThroughHolePads(bool ignore) { m_IgnoreThroughHolePads = ignore; }
585 
589  bool IgnoreModulesVals() const override { return m_IgnoreModulesVals; }
590  void SetIgnoreModulesVals(bool ignore) { m_IgnoreModulesVals = ignore; }
591 
595  bool IgnoreModulesRefs() const override { return m_IgnoreModulesRefs; }
596  void SetIgnoreModulesRefs(bool ignore) { m_IgnoreModulesRefs = ignore; }
597 
598  bool IgnoreThroughVias() const override { return m_IgnoreThroughVias; }
599  void SetIgnoreThroughVias( bool ignore ) { m_IgnoreThroughVias = ignore; }
600 
601  bool IgnoreBlindBuriedVias() const override { return m_IgnoreBlindBuriedVias; }
602  void SetIgnoreBlindBuriedVias( bool ignore ) { m_IgnoreBlindBuriedVias = ignore; }
603 
604  bool IgnoreMicroVias() const override { return m_IgnoreMicroVias; }
605  void SetIgnoreMicroVias( bool ignore ) { m_IgnoreMicroVias = ignore; }
606 
607  bool IgnoreTracks() const override { return m_IgnoreTracks; }
608  void SetIgnoreTracks( bool ignore ) { m_IgnoreTracks = ignore; }
609 
610  bool IgnoreZoneFills() const override { return m_IgnoreZoneFills; }
611  void SetIgnoreZoneFills( bool ignore ) { m_IgnoreZoneFills = ignore; }
612 
613  double OnePixelInIU() const override { return m_OnePixelInIU; }
614 };
615 
616 
623 {
624 public:
625 
634  SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
635 
642  void Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] );
643 };
644 
645 
652 {
654 
655 public:
657  m_layer_id( aLayerId )
658  {
659  }
660 
661  void SetLayerId( PCB_LAYER_ID aLayerId ) { m_layer_id = aLayerId; }
662 
671  SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
672 
679  void Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] );
680 };
681 
682 #endif // COLLECTORS_H
virtual bool IsLayerLocked(PCB_LAYER_ID layer) const =0
void SetIgnoreTracks(bool ignore)
Definition: collectors.h:608
static const KICAD_T BoardLevelItems[]
A scan list for all primary board items, omitting items which are subordinate to a MODULE,...
Definition: collectors.h:283
bool IgnoreModulesOnFront() const override
Definition: collectors.h:565
virtual bool IgnoreBlindBuriedVias() const =0
COLLECTOR class definition.
void SetLayerLocked(PCB_LAYER_ID aLayerId, bool isLocked)
Definition: collectors.h:480
virtual bool IgnoreModulesOnFront() const =0
static const KICAD_T AllBoardItems[]
A scan list for all editable board items, like PcbGeneralLocateAndDisplay()
Definition: collectors.h:267
void SetIgnoreBlindBuriedVias(bool ignore)
Definition: collectors.h:602
static const KICAD_T Tracks[]
A scan list for only TRACKS.
Definition: collectors.h:313
BOARD_ITEM * operator[](int ndx) const override
Overload the COLLECTOR::operator[](int) to return a BOARD_ITEM instead of an EDA_ITEM.
Definition: collectors.h:221
SEARCH_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the iterate function.
Definition: collectors.cpp:521
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
static const KICAD_T Modules[]
A scan list for only MODULEs.
Definition: collectors.h:288
bool IgnoreModulesOnBack() const override
Definition: collectors.h:559
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates.
Definition: view.cpp:475
bool IgnoreMicroVias() const override
Definition: collectors.h:604
void SetScanTypes(const KICAD_T *scanTypes)
Function SetScanTypes records the list of KICAD_T types to consider for collection by the Inspect() f...
Definition: collector.h:215
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.
Definition: collectors.cpp:473
Classes BOARD_ITEM and BOARD_CONNECTED_ITEM.
virtual double OnePixelInIU() const =0
void SetIgnoreModulesVals(bool ignore)
Definition: collectors.h:590
PCB_LAYER_ID m_PreferredLayer
Definition: collectors.h:392
void SetIgnoreMicroVias(bool ignore)
Definition: collectors.h:605
void SetIgnoreModulesOnBack(bool ignore)
Definition: collectors.h:560
void SetIgnorePreferredLayer(bool ignore)
Definition: collectors.h:522
virtual bool IgnoreZoneFills() const =0
virtual bool IgnoreNonVisibleLayers() const =0
void Append2nd(BOARD_ITEM *item)
Definition: collectors.h:335
bool IgnoreThroughVias() const override
Definition: collectors.h:598
void SetIgnoreModulesRefs(bool ignore)
Definition: collectors.h:596
virtual PCB_LAYER_ID GetPreferredLayer() const =0
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Tests a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:537
bool IgnoreModulesVals() const override
Definition: collectors.h:589
PCB_LAYER_ID m_layer_id
Definition: collectors.h:653
static const KICAD_T AllButZones[]
A scan list for all editable board items, except zones.
Definition: collectors.h:272
virtual bool IgnoreTracks() const =0
std::vector< BOARD_ITEM * > m_List2nd
A place to hold collected objects which don't match precisely the search criteria,...
Definition: collectors.h:249
double OnePixelInIU() const override
Definition: collectors.h:613
virtual bool IgnoreMicroVias() const =0
virtual bool IgnoreModulesVals() const =0
static const KICAD_T PadsOrTracks[]
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:298
Collect all BOARD_ITEM objects on a given layer.
Definition: collectors.h:651
const COLLECTORS_GUIDE * GetGuide()
Definition: collectors.h:347
bool IgnorePadsOnBack() const override
Definition: collectors.h:571
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
PCB_LAYER_ID GetPreferredLayer() const override
Definition: collectors.h:513
bool IgnorePreferredLayer() const override
Provide wildcard behavior regarding the preferred layer.
Definition: collectors.h:521
virtual bool IgnorePreferredLayer() const =0
Provide wildcard behavior regarding the preferred layer.
void SetLayerId(PCB_LAYER_ID aLayerId)
Definition: collectors.h:661
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
static const KICAD_T ModulesAndTheirItems[]
A scan list for MODULEs and their items (for Modedit)
Definition: collectors.h:303
virtual bool IgnorePadsOnFront() const =0
void SetGuide(const COLLECTORS_GUIDE *aGuide)
Record which COLLECTORS_GUIDE to use.
Definition: collectors.h:345
virtual bool IgnoreThroughHolePads() const =0
void SetLayerVisibleBits(LSET aLayerBits)
Definition: collectors.h:496
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:114
SEARCH_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
Definition: collectors.cpp:503
PCB_LAYER_ID
A quick note on layer IDs:
void SetPreferredLayer(PCB_LAYER_ID aLayer)
Definition: collectors.h:514
Class LSET is a set of PCB_LAYER_IDs.
LSET m_LayerLocked
bit-mapped layer locked bits
Definition: collectors.h:395
virtual bool IgnoreMTextsOnBack() const =0
void SetIgnoreMTextsOnBack(bool ignore)
Definition: collectors.h:548
void SetIgnorePadsOnFront(bool ignore)
Definition: collectors.h:578
void SetIgnoreMTextsOnFront(bool ignore)
Definition: collectors.h:554
void SetLayerVisible(PCB_LAYER_ID aLayerId, bool isVisible)
Definition: collectors.h:492
bool IgnoreMTextsOnBack() const override
Definition: collectors.h:547
bool IgnoreZoneFills() const override
Definition: collectors.h:610
Collect BOARD_ITEM objects.
Definition: collectors.h:212
bool IgnoreTracks() const override
Definition: collectors.h:607
static const KICAD_T Zones[]
A scan list for zones outlines only.
Definition: collectors.h:277
bool IgnoreModulesRefs() const override
Definition: collectors.h:595
const COLLECTORS_GUIDE * m_Guide
Determines which items are to be collected by Inspect()
Definition: collectors.h:254
bool IgnoreThroughHolePads() const override
Definition: collectors.h:583
void SetIgnoreMTextsMarkedNoShow(bool ignore)
Definition: collectors.h:542
virtual bool IgnoreMTextsMarkedNoShow() const =0
void Collect(BOARD_ITEM *aBoard, const KICAD_T aScanList[])
Collect BOARD_ITEM objects using this class's Inspector method, which does the collection.
Definition: collectors.cpp:513
virtual bool IgnoreThroughVias() const =0
virtual bool IgnoreModulesRefs() const =0
bool IsLayerLocked(PCB_LAYER_ID aLayerId) const override
Definition: collectors.h:475
bool IgnoreMTextsOnFront() const override
Definition: collectors.h:553
bool IgnoreLockedLayers() const override
Definition: collectors.h:501
static const KICAD_T LockableItems[]
A scan list for TRACKS, VIAS, MODULES.
Definition: collectors.h:318
bool IsLayerVisible(PCB_LAYER_ID aLayerId) const override
Definition: collectors.h:488
GENERAL_COLLECTORS_GUIDE(LSET aVisibleLayerMask, PCB_LAYER_ID aPreferredLayer, KIGFX::VIEW *aView)
Grab stuff from global preferences and uses reasonable defaults.
Definition: collectors.h:432
bool IgnoreBlindBuriedVias() const override
Definition: collectors.h:601
bool IgnoreLockedItems() const override
Definition: collectors.h:527
static const KICAD_T PadsOrModules[]
A scan list for PADs or MODULEs.
Definition: collectors.h:293
Board layer functions and definitions.
virtual bool IgnorePads() const
Definition: collectors.h:152
PCB_LAYER_COLLECTOR(PCB_LAYER_ID aLayerId=UNDEFINED_LAYER)
Definition: collectors.h:656
static const KICAD_T ModuleItems[]
A scan list for primary module items.
Definition: collectors.h:308
void SetIgnoreModulesOnFront(bool ignore)
Definition: collectors.h:566
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:240
void SetIgnoreLockedItems(bool ignore)
Definition: collectors.h:528
void SetIgnoreThroughVias(bool ignore)
Definition: collectors.h:599
GENERAL_COLLECTOR()
Constructor GENERALCOLLECTOR.
Definition: collectors.h:323
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157
Class COLLECTOR is an abstract class that will find and hold all the objects according to an inspecti...
Definition: collector.h:55
bool IgnoreNonVisibleLayers() const override
Definition: collectors.h:507
virtual bool IsLayerVisible(PCB_LAYER_ID layer) const =0
virtual bool IgnorePadsOnBack() const =0
An abstract base class whose derivatives may be passed to a GENERAL_COLLECTOR, telling GENERAL_COLLEC...
Definition: collectors.h:59
bool IgnorePadsOnFront() const override
Definition: collectors.h:577
virtual bool IgnoreLockedItems() const =0
void SetIgnoreLockedLayers(bool ignore)
Definition: collectors.h:502
Class VIEW.
Definition: view.h:61
virtual bool IgnoreLockedLayers() const =0
Collect all BOARD_ITEM objects of a given set of KICAD_T type(s).
Definition: collectors.h:622
A general implementation of a COLLECTORS_GUIDE.
Definition: collectors.h:386
SEARCH_RESULT
Definition: base_struct.h:66
std::vector< EDA_ITEM * > m_List
A place to hold collected objects without taking ownership of their memory.
Definition: collector.h:65
LSET m_LayerVisible
bit-mapped layer visible bits
Definition: collectors.h:398
virtual bool IgnoreModulesOnBack() const =0
virtual bool IgnoreMTextsOnFront() const =0
virtual bool IncludeSecondary() const =0
Determine if the secondary criteria or 2nd choice items should be included.
bool IgnoreMTextsMarkedNoShow() const override
Definition: collectors.h:541
void SetIgnoreNonVisibleLayers(bool ignore)
Definition: collectors.h:508
SEARCH_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
Definition: collectors.cpp:149
bool IncludeSecondary() const override
Determine if the secondary criteria, or 2nd choice items should be included.
Definition: collectors.h:535
void SetIgnoreThroughHolePads(bool ignore)
Definition: collectors.h:584
void SetIgnoreZoneFills(bool ignore)
Definition: collectors.h:611
void SetIncludeSecondary(bool include)
Definition: collectors.h:536
virtual ~COLLECTORS_GUIDE()
Definition: collectors.h:63
void SetIgnorePadsOnBack(bool ignore)
Definition: collectors.h:572