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 (C) 1992-2022 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#include "object_2d.h"
26#include <map>
27
29
30
31OBJECT_2D::OBJECT_2D( OBJECT_2D_TYPE aObjType, const BOARD_ITEM& aBoardItem ) :
32 m_boardItem( aBoardItem )
33{
34 m_obj_type = aObjType;
36}
37
38
39/*
40 * Lookup table for OBJECT_2D_TYPE printed names
41 */
42// clang-format off
43const std::map<OBJECT_2D_TYPE, const char*> objectTypeNames
44{
45 { OBJECT_2D_TYPE::FILLED_CIRCLE, "OBJECT_2D_TYPE::FILLED_CIRCLE" },
46 { OBJECT_2D_TYPE::CSG, "OBJECT_2D_TYPE::CSG" },
47 { OBJECT_2D_TYPE::POLYGON, "OBJECT_2D_TYPE::POLYGON" },
48 { OBJECT_2D_TYPE::DUMMYBLOCK, "OBJECT_2D_TYPE::DUMMYBLOCK" },
49 { OBJECT_2D_TYPE::POLYGON4PT, "OBJECT_2D_TYPE::POLYGON4PT" },
50 { OBJECT_2D_TYPE::RING, "OBJECT_2D_TYPE::RING" },
51 { OBJECT_2D_TYPE::ROUNDSEG, "OBJECT_2D_TYPE::ROUNDSEG" },
52 { OBJECT_2D_TYPE::TRIANGLE, "OBJECT_2D_TYPE::TRIANGLE" },
53 { OBJECT_2D_TYPE::CONTAINER, "OBJECT_2D_TYPE::CONTAINER" },
54 { OBJECT_2D_TYPE::BVHCONTAINER, "OBJECT_2D_TYPE::BVHCONTAINER" },
55};
56// 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:79
void AddOne(OBJECT_2D_TYPE aObjType)
Definition: object_2d.h:132
static OBJECT_2D_STATS * s_instance
Definition: object_2d.h:153
static OBJECT_2D_STATS & Instance()
Definition: object_2d.h:137
OBJECT_2D_TYPE m_obj_type
Definition: object_2d.h:112
OBJECT_2D(OBJECT_2D_TYPE aObjType, const BOARD_ITEM &aBoardItem)
Definition: object_2d.cpp:31
const std::map< OBJECT_2D_TYPE, const char * > objectTypeNames
Definition: object_2d.cpp:44
OBJECT_2D_TYPE
Definition: object_2d.h:45