KiCad PCB EDA Suite
Loading...
Searching...
No Matches
geom_test_utils.cpp
Go to the documentation of this file.
1
2
3#include "geom_test_utils.h"
4
5
6std::string toString( const POINT_TYPE& aType )
7{
8 switch( aType )
9 {
10 case PT_NONE: return "PT_NONE";
11 case PT_CENTER: return "PT_CENTER";
12 case PT_END: return "PT_END";
13 case PT_MID: return "PT_MID";
14 case PT_QUADRANT: return "PT_QUADRANT";
15 case PT_CORNER: return "PT_CORNER";
16 case PT_INTERSECTION: return "PT_INTERSECTION";
17 default: return "Unknown POINT_TYPE: " + std::to_string( (int) aType );
18 }
19}
20
21std::ostream& operator<<( std::ostream& os, const TYPED_POINT2I& aPt )
22{
23 os << "TYPED_POINT2I: " << aPt.m_point << " (" << aPt.m_types << ")";
24 return os;
25}
std::string toString(const POINT_TYPE &aType)
std::ostream & operator<<(std::ostream &os, const TYPED_POINT2I &aPt)
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
VECTOR2I m_point
Definition point_types.h:77