KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gerber_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) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef GERBER_COLLECTORS_H
21#define GERBER_COLLECTORS_H
22
23#include <collector.h>
24
29{
30public:
32 {
34 }
35
42 EDA_ITEM* operator[]( int ndx ) const override
43 {
44 if( (unsigned)ndx < (unsigned)GetCount() )
45 return (EDA_ITEM*) m_list[ ndx ];
46
47 return nullptr;
48 }
49
57 INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
58
67 void Collect( EDA_ITEM* aItem, const std::vector<KICAD_T>& aScanTypes,
68 const VECTOR2I& aRefPos );
69};
70
71#endif
An abstract class that will find and hold all the objects according to an inspection done by the Insp...
Definition: collector.h:48
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:81
void SetScanTypes(const std::vector< KICAD_T > &aTypes)
Record the list of KICAD_T types to consider for collection by the Inspect() function.
Definition: collector.h:211
std::vector< EDA_ITEM * > m_list
Definition: collector.h:240
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
Use when the right click button is pressed or when the select tool is in effect.
EDA_ITEM * operator[](int ndx) const override
Overload the [](int) operator to return a EDA_ITEM* instead of an EDA_ITEM* type.
INSPECT_RESULT Inspect(EDA_ITEM *testItem, void *testData) override
The examining function within the INSPECTOR which is passed to the Iterate function.
void Collect(EDA_ITEM *aItem, const std::vector< KICAD_T > &aScanTypes, const VECTOR2I &aRefPos)
Scan an EDA_ITEM using this class's Inspector method, which does the collection.
INSPECT_RESULT
Definition: eda_item.h:42
@ GERBER_DRAW_ITEM_T
Definition: typeinfo.h:218
@ GERBER_IMAGE_T
Definition: typeinfo.h:219
@ GERBER_LAYOUT_T
Definition: typeinfo.h:217