KiCad PCB EDA Suite
Loading...
Searching...
No Matches
object_2d.cpp
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) 2015-2020 Mario Luzeiro <[email protected]>
5 * Copyright The 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#include "object_2d.h"
22#include <map>
23
25
26
27OBJECT_2D::OBJECT_2D( OBJECT_2D_TYPE aObjType, const BOARD_ITEM& aBoardItem ) :
28 m_boardItem( aBoardItem )
29{
30 m_obj_type = aObjType;
32}
33
34
35/*
36 * Lookup table for OBJECT_2D_TYPE printed names
37 */
38// clang-format off
39const std::map<OBJECT_2D_TYPE, const char*> objectTypeNames
40{
41 { OBJECT_2D_TYPE::FILLED_CIRCLE, "OBJECT_2D_TYPE::FILLED_CIRCLE" },
42 { OBJECT_2D_TYPE::CSG, "OBJECT_2D_TYPE::CSG" },
43 { OBJECT_2D_TYPE::POLYGON, "OBJECT_2D_TYPE::POLYGON" },
44 { OBJECT_2D_TYPE::DUMMYBLOCK, "OBJECT_2D_TYPE::DUMMYBLOCK" },
45 { OBJECT_2D_TYPE::POLYGON4PT, "OBJECT_2D_TYPE::POLYGON4PT" },
46 { OBJECT_2D_TYPE::RING, "OBJECT_2D_TYPE::RING" },
47 { OBJECT_2D_TYPE::ROUNDSEG, "OBJECT_2D_TYPE::ROUNDSEG" },
48 { OBJECT_2D_TYPE::TRIANGLE, "OBJECT_2D_TYPE::TRIANGLE" },
49 { OBJECT_2D_TYPE::CONTAINER, "OBJECT_2D_TYPE::CONTAINER" },
50 { OBJECT_2D_TYPE::BVHCONTAINER, "OBJECT_2D_TYPE::BVHCONTAINER" },
51};
52// clang-format on
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
void AddOne(OBJECT_2D_TYPE aObjType)
Definition object_2d.h:128
static OBJECT_2D_STATS * s_instance
Definition object_2d.h:149
static OBJECT_2D_STATS & Instance()
Definition object_2d.h:133
OBJECT_2D_TYPE m_obj_type
Definition object_2d.h:108
const BOARD_ITEM & m_boardItem
Definition object_2d.h:110
OBJECT_2D(OBJECT_2D_TYPE aObjType, const BOARD_ITEM &aBoardItem)
Definition object_2d.cpp:27
const std::map< OBJECT_2D_TYPE, const char * > objectTypeNames
Definition object_2d.cpp:40
OBJECT_2D_TYPE
Definition object_2d.h:41