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 The 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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef GEOMETRY_POINT_TYPE_H_
21#define GEOMETRY_POINT_TYPE_H_
22
23#include <math/vector2d.h>
24
34{
42 PT_CENTER = 1 << 0,
46 PT_END = 1 << 1,
50 PT_MID = 1 << 2,
54 PT_QUADRANT = 1 << 3,
59 PT_CORNER = 1 << 4,
68 PT_ON_ELEMENT = 1 << 6,
69};
70
72{
74 // Bitwise OR of POINT_TYPE values
76
77 // Clang needs this apparently
78 TYPED_POINT2I( const VECTOR2I& aVec, int aTypes ) : m_point( aVec ), m_types( aTypes ) {}
79
80 bool operator==( const TYPED_POINT2I& ) const = default;
81};
82
83#endif // GEOMETRY_POINT_TYPE_H_
POINT_TYPE
Meanings that can be assigned to a point in pure geometric terms.
Definition point_types.h:34
@ PT_INTERSECTION
The point is an intersection of two (or more) items.
Definition point_types.h:63
@ PT_CENTER
The point is the center of something.
Definition point_types.h:42
@ 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:59
@ PT_NONE
No specific point type.
Definition point_types.h:38
@ PT_QUADRANT
The point is on a quadrant of a circle (N, E, S, W points).
Definition point_types.h:54
@ PT_END
The point is at the end of a segment, arc, etc.
Definition point_types.h:46
@ PT_MID
The point is at the middle of a segment, arc, etc.
Definition point_types.h:50
@ PT_ON_ELEMENT
The point is somewhere on another element, but not some specific point.
Definition point_types.h:68
TYPED_POINT2I(const VECTOR2I &aVec, int aTypes)
Definition point_types.h:78
VECTOR2I m_point
Definition point_types.h:73
bool operator==(const TYPED_POINT2I &) const =default
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683