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
6
std::ostream&
boost_test_print_type
( std::ostream& os,
const
SHAPE_LINE_CHAIN
& c )
7
{
8
os <<
"SHAPE_LINE_CHAIN: "
<< c.
PointCount
() <<
" points: [\n"
;
9
10
for
(
int
i = 0; i < c.
PointCount
(); ++i )
11
{
12
os <<
" "
<< i <<
": "
<< c.
CPoint
( i ) <<
"\n"
;
13
}
14
15
os <<
"]"
;
16
return
os;
17
}
18
19
std::string
toString
(
const
POINT_TYPE
& aType )
20
{
21
switch
( aType )
22
{
23
case
PT_NONE
:
return
"PT_NONE"
;
24
case
PT_CENTER
:
return
"PT_CENTER"
;
25
case
PT_END
:
return
"PT_END"
;
26
case
PT_MID
:
return
"PT_MID"
;
27
case
PT_QUADRANT
:
return
"PT_QUADRANT"
;
28
case
PT_CORNER
:
return
"PT_CORNER"
;
29
case
PT_INTERSECTION
:
return
"PT_INTERSECTION"
;
30
default
:
return
"Unknown POINT_TYPE: "
+ std::to_string( (
int
) aType );
31
}
32
}
33
34
std::ostream&
operator<<
( std::ostream& os,
const
TYPED_POINT2I
& aPt )
35
{
36
os <<
"TYPED_POINT2I: "
<< aPt.
m_point
<<
" ("
<< aPt.
m_types
<<
")"
;
37
return
os;
38
}
SHAPE_LINE_CHAIN
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Definition:
shape_line_chain.h:83
SHAPE_LINE_CHAIN::PointCount
int PointCount() const
Return the number of points (vertices) in this line chain.
Definition:
shape_line_chain.h:356
SHAPE_LINE_CHAIN::CPoint
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
Definition:
shape_line_chain.h:407
operator<<
std::ostream & operator<<(std::ostream &aStream, const EDA_TEXT &aText)
Definition:
eda_text.cpp:1210
toString
std::string toString(const POINT_TYPE &aType)
Definition:
geom_test_utils.cpp:19
boost_test_print_type
std::ostream & boost_test_print_type(std::ostream &os, const SHAPE_LINE_CHAIN &c)
Definition:
geom_test_utils.cpp:6
geom_test_utils.h
POINT_TYPE
POINT_TYPE
Meanings that can be assigned to a point in pure geometric terms.
Definition:
point_types.h:38
PT_INTERSECTION
@ PT_INTERSECTION
The point is an intersection of two (or more) items.
Definition:
point_types.h:67
PT_CENTER
@ PT_CENTER
The point is the center of something.
Definition:
point_types.h:46
PT_CORNER
@ 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
@ PT_NONE
No specific point type.
Definition:
point_types.h:42
PT_QUADRANT
@ PT_QUADRANT
The point is on a quadrant of a circle (N, E, S, W points).
Definition:
point_types.h:58
PT_END
@ PT_END
The point is at the end of a segment, arc, etc.
Definition:
point_types.h:50
PT_MID
@ PT_MID
The point is at the middle of a segment, arc, etc.
Definition:
point_types.h:54
TYPED_POINT2I
Definition:
point_types.h:76
TYPED_POINT2I::m_point
VECTOR2I m_point
Definition:
point_types.h:77
TYPED_POINT2I::m_types
int m_types
Definition:
point_types.h:79
src
qa
tests
libs
kimath
geometry
geom_test_utils.cpp
Generated on Thu Nov 21 2024 00:06:50 for KiCad PCB EDA Suite by
1.9.6