KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_board_outline.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) 2023 Ethan Chien <[email protected]>
5 * Copyright (C) 2023 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 PCB_BOARD_OUTLINE_H
26#define PCB_BOARD_OUTLINE_H
27
29#include <eda_item.h>
30#include <board_item.h>
31#include <memory>
32
33
35{
36public:
37 PCB_BOARD_OUTLINE( BOARD_ITEM* aParent );
38
39 PCB_BOARD_OUTLINE( const PCB_BOARD_OUTLINE& aOther );
40
42
43 ~PCB_BOARD_OUTLINE() override;
44
45 const SHAPE_POLY_SET& GetOutline() const { return m_outlines; }
46
48
49 std::vector<int> ViewGetLayers() const override;
50
51 const BOX2I GetBoundingBox() const override;
52
53 PCB_LAYER_ID GetLayer() const override;
54
55 LSET GetLayerSet() const override;
56
57 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
58
59 double Similarity( const BOARD_ITEM& aItem ) const override;
60
61 bool operator==( const BOARD_ITEM& aItem ) const override;
62
63 EDA_ITEM* Clone() const override;
64
65 bool HasOutline() const { return !m_outlines.IsEmpty(); }
66
67 static void CopyPros( const PCB_BOARD_OUTLINE& aCopyFrom, PCB_BOARD_OUTLINE& aCopyTo );
68
69#if defined( DEBUG )
70
71 void Show( int nestLevel, std::ostream& os ) const override;
72
73#endif
74
75 wxString GetClass() const override;
76
77private:
79};
80
81#endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:97
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:37
SHAPE_POLY_SET m_outlines
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
bool HasOutline() const
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
double Similarity(const BOARD_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
wxString GetClass() const override
Return the class name.
bool operator==(const BOARD_ITEM &aItem) const override
const SHAPE_POLY_SET & GetOutline() const
PCB_BOARD_OUTLINE & operator=(const PCB_BOARD_OUTLINE &aOther)
SHAPE_POLY_SET & GetOutline()
static void CopyPros(const PCB_BOARD_OUTLINE &aCopyFrom, PCB_BOARD_OUTLINE &aCopyTo)
~PCB_BOARD_OUTLINE() override
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Represent a set of closed polygons.
bool IsEmpty() const
Return true if the set is empty (no polygons at all)
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60