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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef PCB_BOARD_OUTLINE_H
22#define PCB_BOARD_OUTLINE_H
23
25#include <eda_item.h>
26#include <board_item.h>
27#include <memory>
28
29
31{
32public:
33 PCB_BOARD_OUTLINE( BOARD_ITEM* aParent );
34
35 PCB_BOARD_OUTLINE( const PCB_BOARD_OUTLINE& aOther );
36
38
39 ~PCB_BOARD_OUTLINE() override;
40
41 const SHAPE_POLY_SET& GetOutline() const { return m_outlines; }
42
44
45 std::vector<int> ViewGetLayers() const override;
46
47 const BOX2I GetBoundingBox() const override;
48
49 PCB_LAYER_ID GetLayer() const override;
50
51 LSET GetLayerSet() const override;
52
53 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
54
55 double Similarity( const BOARD_ITEM& aItem ) const override;
56
57 bool operator==( const BOARD_ITEM& aItem ) const override;
58
59 EDA_ITEM* Clone() const override;
60
61 bool HasOutline() const { return !m_outlines.IsEmpty(); }
62
63 static void CopyPros( const PCB_BOARD_OUTLINE& aCopyFrom, PCB_BOARD_OUTLINE& aCopyTo );
64
65#if defined( DEBUG )
66
67 void Show( int nestLevel, std::ostream& os ) const override;
68
69#endif
70
71 wxString GetClass() const override;
72
73private:
75};
76
77#endif
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:83
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
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.
PCB_BOARD_OUTLINE(BOARD_ITEM *aParent)
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)
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.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56