KiCad PCB EDA Suite
Loading...
Searching...
No Matches
point_types.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 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef GEOMETRY_POINT_TYPE_H_
25#define GEOMETRY_POINT_TYPE_H_
26
27#include <math/vector2d.h>
28
38{
46 PT_CENTER = 1 << 0,
50 PT_END = 1 << 1,
54 PT_MID = 1 << 2,
58 PT_QUADRANT = 1 << 3,
63 PT_CORNER = 1 << 4,
72 PT_ON_ELEMENT = 1 << 6,
73};
74
76{
78 // Bitwise OR of POINT_TYPE values
80
81 // Clang needs this apparently
82 TYPED_POINT2I( const VECTOR2I& aVec, int aTypes ) : m_point( aVec ), m_types( aTypes ) {}
83
84 bool operator==( const TYPED_POINT2I& ) const = default;
85};
86
87#endif // GEOMETRY_POINT_TYPE_H_
POINT_TYPE
Meanings that can be assigned to a point in pure geometric terms.
Definition: point_types.h:38
@ PT_INTERSECTION
The point is an intersection of two (or more) items.
Definition: point_types.h:67
@ PT_CENTER
The point is the center of something.
Definition: point_types.h:46
@ PT_CORNER
The point is a corner of a polygon, rectangle, etc (you may want to infer PT_END from this)
Definition: point_types.h:63
@ PT_NONE
No specific point type.
Definition: point_types.h:42
@ PT_QUADRANT
The point is on a quadrant of a circle (N, E, S, W points).
Definition: point_types.h:58
@ PT_END
The point is at the end of a segment, arc, etc.
Definition: point_types.h:50
@ PT_MID
The point is at the middle of a segment, arc, etc.
Definition: point_types.h:54
@ PT_ON_ELEMENT
The point is somewhere on another element, but not some specific point.
Definition: point_types.h:72
TYPED_POINT2I(const VECTOR2I &aVec, int aTypes)
Definition: point_types.h:82
VECTOR2I m_point
Definition: point_types.h:77
bool operator==(const TYPED_POINT2I &) const =default