Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
d48f6e00
Commit
d48f6e00
authored
Jul 31, 2010
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Plain Diff
merge from testing
parents
1f18ff28
e2d4b16b
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
890 additions
and
502 deletions
+890
-502
CMakeLists.txt
CMakeLists.txt
+2
-2
iterator_geometry_to_set.hpp
include/boost/polygon/detail/iterator_geometry_to_set.hpp
+7
-7
polygon_45_formation.hpp
include/boost/polygon/detail/polygon_45_formation.hpp
+10
-4
polygon_45_set_view.hpp
include/boost/polygon/detail/polygon_45_set_view.hpp
+2
-2
polygon_90_set_view.hpp
include/boost/polygon/detail/polygon_90_set_view.hpp
+2
-2
polygon_90_touch.hpp
include/boost/polygon/detail/polygon_90_touch.hpp
+1
-1
polygon_arbitrary_formation.hpp
include/boost/polygon/detail/polygon_arbitrary_formation.hpp
+44
-19
polygon_formation.hpp
include/boost/polygon/detail/polygon_formation.hpp
+1
-1
polygon_set_view.hpp
include/boost/polygon/detail/polygon_set_view.hpp
+2
-2
scan_arbitrary.hpp
include/boost/polygon/detail/scan_arbitrary.hpp
+300
-300
point_data.hpp
include/boost/polygon/point_data.hpp
+15
-3
polygon_45_data.hpp
include/boost/polygon/polygon_45_data.hpp
+1
-1
polygon_45_set_data.hpp
include/boost/polygon/polygon_45_set_data.hpp
+3
-3
polygon_45_set_traits.hpp
include/boost/polygon/polygon_45_set_traits.hpp
+1
-1
polygon_45_with_holes_data.hpp
include/boost/polygon/polygon_45_with_holes_data.hpp
+3
-1
polygon_90_set_data.hpp
include/boost/polygon/polygon_90_set_data.hpp
+303
-1
polygon_data.hpp
include/boost/polygon/polygon_data.hpp
+1
-1
polygon_set_data.hpp
include/boost/polygon/polygon_set_data.hpp
+189
-49
polygon_set_traits.hpp
include/boost/polygon/polygon_set_traits.hpp
+1
-1
polygon_with_holes_data.hpp
include/boost/polygon/polygon_with_holes_data.hpp
+1
-1
zones_convert_brd_items_to_polygons_with_Boost.cpp
pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp
+1
-100
No files found.
CMakeLists.txt
View file @
d48f6e00
...
...
@@ -19,10 +19,10 @@ option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
option
(
wxUSE_UNICODE
"enable/disable building unicode (default OFF)"
)
option
(
KICAD_GOST
"enable/disable building using GOST notation for multiple gates per package (default OFF)"
)
option
(
USE_WX_ZOOM
"Use wxDC to perform zooming (default OFF).
Warning, this is experimental"
)
option
(
USE_WX_ZOOM
"Use wxDC to perform zooming (default OFF). Warning, this is experimental"
)
option
(
USE_WX_GRAPHICS_CONTEXT
"Use wxGraphicsContext for rendering (default OFF).
Warning, this is experimental"
)
"Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental"
)
option
(
USE_BOOST_POLYGON_LIBRARY
"Use boost polygon library instead of Kbool to calculate filled areas in zones (default OFF). Warning, this is experimental"
)
...
...
include/boost/polygon/detail/iterator_geometry_to_set.hpp
View file @
d48f6e00
...
...
@@ -29,7 +29,7 @@ private:
public
:
iterator_geometry_to_set
()
:
rectangle_
(),
vertex_
(),
corner_
(
4
),
orient_
(),
is_hole_
()
{}
iterator_geometry_to_set
(
const
rectangle_type
&
rectangle
,
direction_1d
dir
,
orientation_2d
orient
=
HORIZONTAL
,
bool
is_hole
=
false
)
:
orientation_2d
orient
=
HORIZONTAL
,
bool
is_hole
=
false
,
bool
=
false
,
direction_1d
=
CLOCKWISE
)
:
rectangle_
(),
vertex_
(),
corner_
(
0
),
orient_
(
orient
),
is_hole_
(
is_hole
)
{
assign
(
rectangle_
,
rectangle
);
if
(
dir
==
HIGH
)
corner_
=
4
;
...
...
@@ -93,7 +93,7 @@ private:
int
polygon_index
;
public
:
iterator_geometry_to_set
()
:
vertex_
(),
itrb
(),
itre
(),
last_vertex_
(),
is_hole_
(),
multiplier_
(),
first_pt
(),
second_pt
(),
pts
(),
use_wrap
(),
orient_
(),
polygon_index
(
-
1
)
{}
iterator_geometry_to_set
(
const
polygon_type
&
polygon
,
direction_1d
dir
,
orientation_2d
orient
=
HORIZONTAL
,
bool
is_hole
=
false
)
:
iterator_geometry_to_set
(
const
polygon_type
&
polygon
,
direction_1d
dir
,
orientation_2d
orient
=
HORIZONTAL
,
bool
is_hole
=
false
,
bool
winding_override
=
false
,
direction_1d
w
=
CLOCKWISE
)
:
vertex_
(),
itrb
(),
itre
(),
last_vertex_
(),
is_hole_
(
is_hole
),
multiplier_
(),
first_pt
(),
second_pt
(),
pts
(),
use_wrap
(),
orient_
(
orient
),
polygon_index
(
0
)
{
...
...
@@ -103,7 +103,9 @@ public:
if
(
itrb
==
itre
||
dir
==
HIGH
||
size
(
polygon
)
<
4
)
{
polygon_index
=
-
1
;
}
else
{
direction_1d
wdir
=
winding
(
polygon
);
direction_1d
wdir
=
w
;
if
(
!
winding_override
)
wdir
=
winding
(
polygon
);
multiplier_
=
wdir
==
LOW
?
-
1
:
1
;
if
(
is_hole_
)
multiplier_
*=
-
1
;
first_pt
=
pts
[
0
]
=
*
itrb
;
...
...
@@ -182,9 +184,7 @@ public:
vertex_
.
second
.
first
=
pts
[
1
].
get
(
orient_
);
if
(
pts
[
1
]
==
pts
[
2
])
{
vertex_
.
second
.
second
=
0
;
return
;
}
if
(
pts
[
0
].
get
(
HORIZONTAL
)
!=
pts
[
1
].
get
(
HORIZONTAL
))
{
}
else
if
(
pts
[
0
].
get
(
HORIZONTAL
)
!=
pts
[
1
].
get
(
HORIZONTAL
))
{
vertex_
.
second
.
second
=
-
1
;
}
else
if
(
pts
[
0
].
get
(
VERTICAL
)
!=
pts
[
1
].
get
(
VERTICAL
))
{
vertex_
.
second
.
second
=
1
;
...
...
@@ -214,7 +214,7 @@ private:
public
:
iterator_geometry_to_set
()
:
itrb
(),
itre
(),
itrhib
(),
itrhie
(),
itrhb
(),
itrhe
(),
orient_
(),
is_hole_
(),
started_holes
()
{}
iterator_geometry_to_set
(
const
polygon_with_holes_type
&
polygon
,
direction_1d
dir
,
orientation_2d
orient
=
HORIZONTAL
,
bool
is_hole
=
false
)
:
orientation_2d
orient
=
HORIZONTAL
,
bool
is_hole
=
false
,
bool
=
false
,
direction_1d
=
CLOCKWISE
)
:
itrb
(),
itre
(),
itrhib
(),
itrhie
(),
itrhb
(),
itrhe
(),
orient_
(
orient
),
is_hole_
(
is_hole
),
started_holes
()
{
itre
=
iterator_geometry_to_set
<
polygon_90_concept
,
polygon_with_holes_type
>
(
polygon
,
HIGH
,
orient
,
is_hole_
);
itrhe
=
end_holes
(
polygon
);
...
...
include/boost/polygon/detail/polygon_45_formation.hpp
View file @
d48f6e00
...
...
@@ -251,12 +251,14 @@ namespace boost { namespace polygon{
return
;
}
Unit
firstY
=
(
*
iter
).
y
();
Unit
firstX
=
(
*
iter
).
x
();
++
iter
;
if
(
iter
==
tailp_
->
points
.
end
())
{
tailp_
->
points
.
push_front
(
point
);
return
;
}
if
(
iter
->
y
()
==
point
.
y
()
&&
firstY
==
point
.
y
())
{
if
((
iter
->
y
()
==
point
.
y
()
&&
firstY
==
point
.
y
())
||
(
iter
->
x
()
==
point
.
x
()
&&
firstX
==
point
.
x
())){
--
iter
;
*
iter
=
point
;
}
else
{
...
...
@@ -274,12 +276,14 @@ namespace boost { namespace polygon{
return
;
}
Unit
firstY
=
(
*
iter
).
y
();
Unit
firstX
=
(
*
iter
).
x
();
++
iter
;
if
(
iter
==
tailp_
->
points
.
rend
())
{
tailp_
->
points
.
push_back
(
point
);
return
;
}
if
(
iter
->
y
()
==
point
.
y
()
&&
firstY
==
point
.
y
())
{
if
((
iter
->
y
()
==
point
.
y
()
&&
firstY
==
point
.
y
())
||
(
iter
->
x
()
==
point
.
x
()
&&
firstX
==
point
.
x
())){
--
iter
;
*
iter
=
point
;
}
else
{
...
...
@@ -474,7 +478,7 @@ namespace boost { namespace polygon{
ct
counts
[
4
];
};
typedef
Vertex45CountT
<
int
>
Vertex45Count
;
typedef
Vertex45CountT
<
signed
char
>
Vertex45Count
;
// inline std::ostream& operator<< (std::ostream& o, const Vertex45Count& c) {
// o << c[0] << ", " << c[1] << ", ";
...
...
@@ -492,7 +496,8 @@ namespace boost { namespace polygon{
inline
Vertex45CompactT
(
const
Point
&
point
,
int
riseIn
,
int
countIn
)
:
pt
(
point
),
count
()
{
count
[
riseIn
+
1
]
=
countIn
;
}
inline
Vertex45CompactT
(
const
Vertex45T
&
vertex
)
:
pt
(
vertex
.
pt
),
count
()
{
template
<
typename
ct2
>
inline
Vertex45CompactT
(
const
typename
boolean_op_45
<
Unit
>::
template
Vertex45T
<
ct2
>&
vertex
)
:
pt
(
vertex
.
pt
),
count
()
{
count
[
vertex
.
rise
+
1
]
=
vertex
.
count
;
}
inline
Vertex45CompactT
(
const
Vertex45CompactT
&
vertex
)
:
pt
(
vertex
.
pt
),
count
(
vertex
.
count
)
{}
...
...
@@ -2244,6 +2249,7 @@ namespace boost { namespace polygon{
struct
geometry_concept
<
PolyLine45PolygonData
<
T
>
>
{
typedef
polygon_45_with_holes_concept
type
;
};
template
<
typename
T
>
struct
geometry_concept
<
PolyLine45HoleData
<
T
>
>
{
typedef
polygon_45_concept
type
;
};
}
}
#endif
include/boost/polygon/detail/polygon_45_set_view.hpp
View file @
d48f6e00
...
...
@@ -124,13 +124,13 @@ namespace boost { namespace polygon{
};
template
<
typename
ltype
,
typename
rtype
,
int
op_type
>
typename
polygon_45_set_
view
<
ltype
,
rtype
,
op_type
>::
iterator_type
typename
polygon_45_set_
traits
<
polygon_45_set_view
<
ltype
,
rtype
,
op_type
>
>::
iterator_type
polygon_45_set_traits
<
polygon_45_set_view
<
ltype
,
rtype
,
op_type
>
>::
begin
(
const
polygon_45_set_view
<
ltype
,
rtype
,
op_type
>&
polygon_45_set
)
{
return
polygon_45_set
.
begin
();
}
template
<
typename
ltype
,
typename
rtype
,
int
op_type
>
typename
polygon_45_set_
view
<
ltype
,
rtype
,
op_type
>::
iterator_type
typename
polygon_45_set_
traits
<
polygon_45_set_view
<
ltype
,
rtype
,
op_type
>
>::
iterator_type
polygon_45_set_traits
<
polygon_45_set_view
<
ltype
,
rtype
,
op_type
>
>::
end
(
const
polygon_45_set_view
<
ltype
,
rtype
,
op_type
>&
polygon_45_set
)
{
return
polygon_45_set
.
end
();
...
...
include/boost/polygon/detail/polygon_90_set_view.hpp
View file @
d48f6e00
...
...
@@ -140,13 +140,13 @@ namespace boost { namespace polygon{
};
template
<
typename
ltype
,
typename
rtype
,
typename
op_type
>
typename
polygon_90_set_
view
<
ltype
,
rtype
,
op_type
>::
iterator_type
typename
polygon_90_set_
traits
<
polygon_90_set_view
<
ltype
,
rtype
,
op_type
>
>::
iterator_type
polygon_90_set_traits
<
polygon_90_set_view
<
ltype
,
rtype
,
op_type
>
>::
begin
(
const
polygon_90_set_view
<
ltype
,
rtype
,
op_type
>&
polygon_set
)
{
return
polygon_set
.
begin
();
}
template
<
typename
ltype
,
typename
rtype
,
typename
op_type
>
typename
polygon_90_set_
view
<
ltype
,
rtype
,
op_type
>::
iterator_type
typename
polygon_90_set_
traits
<
polygon_90_set_view
<
ltype
,
rtype
,
op_type
>
>::
iterator_type
polygon_90_set_traits
<
polygon_90_set_view
<
ltype
,
rtype
,
op_type
>
>::
end
(
const
polygon_90_set_view
<
ltype
,
rtype
,
op_type
>&
polygon_set
)
{
return
polygon_set
.
end
();
...
...
include/boost/polygon/detail/polygon_90_touch.hpp
View file @
d48f6e00
...
...
@@ -42,7 +42,7 @@ namespace boost { namespace polygon{
ivlIds_
.
second
=
that
.
ivlIds_
.
second
;
incremented_
=
that
.
incremented_
;
return
*
this
;
}
;
}
inline
bool
operator
==
(
const
iterator
&
that
)
{
return
itr_
==
that
.
itr_
;
}
inline
bool
operator
!=
(
const
iterator
&
that
)
{
return
itr_
!=
that
.
itr_
;
}
inline
iterator
&
operator
++
()
{
...
...
include/boost/polygon/detail/polygon_arbitrary_formation.hpp
View file @
d48f6e00
This diff is collapsed.
Click to expand it.
include/boost/polygon/detail/polygon_formation.hpp
View file @
d48f6e00
...
...
@@ -1721,7 +1721,7 @@ namespace polygon_formation {
unsigned
int
get_polygons
(
output_container
&
container
,
iterator_type
begin
,
iterator_type
end
,
orientation_2d
orient
,
bool
fracture_holes
,
concept_type
)
{
typedef
typename
output_container
::
value_type
polygon_type
;
typedef
typename
iterator_type
::
value_type
::
first_type
coordinate_type
;
typedef
typename
std
::
iterator_traits
<
iterator_type
>
::
value_type
::
first_type
coordinate_type
;
polygon_type
poly
;
unsigned
int
countPolygons
=
0
;
typedef
typename
geometry_concept
<
polygon_type
>::
type
polygon_concept_type
;
...
...
include/boost/polygon/detail/polygon_set_view.hpp
View file @
d48f6e00
...
...
@@ -153,13 +153,13 @@ namespace boost { namespace polygon{
};
template
<
typename
ltype
,
typename
rtype
,
int
op_type
>
typename
polygon_set_
view
<
ltype
,
rtype
,
op_type
>::
iterator_type
typename
polygon_set_
traits
<
polygon_set_view
<
ltype
,
rtype
,
op_type
>
>::
iterator_type
polygon_set_traits
<
polygon_set_view
<
ltype
,
rtype
,
op_type
>
>::
begin
(
const
polygon_set_view
<
ltype
,
rtype
,
op_type
>&
polygon_set
)
{
return
polygon_set
.
begin
();
}
template
<
typename
ltype
,
typename
rtype
,
int
op_type
>
typename
polygon_set_
view
<
ltype
,
rtype
,
op_type
>::
iterator_type
typename
polygon_set_
traits
<
polygon_set_view
<
ltype
,
rtype
,
op_type
>
>::
iterator_type
polygon_set_traits
<
polygon_set_view
<
ltype
,
rtype
,
op_type
>
>::
end
(
const
polygon_set_view
<
ltype
,
rtype
,
op_type
>&
polygon_set
)
{
return
polygon_set
.
end
();
...
...
include/boost/polygon/detail/scan_arbitrary.hpp
View file @
d48f6e00
This diff is collapsed.
Click to expand it.
include/boost/polygon/point_data.hpp
View file @
d48f6e00
...
...
@@ -34,17 +34,29 @@ namespace boost { namespace polygon{
#endif
{
(
*
this
)
=
that
;
}
template
<
typename
other
>
point_data
(
const
other
&
that
)
:
coords_
()
{
(
*
this
)
=
that
;
}
point_data
(
const
other
&
that
)
#ifndef BOOST_POLYGON_MSVC
:
coords_
()
#endif
{
(
*
this
)
=
that
;
}
inline
point_data
&
operator
=
(
const
point_data
&
that
)
{
coords_
[
0
]
=
that
.
coords_
[
0
];
coords_
[
1
]
=
that
.
coords_
[
1
];
return
*
this
;
}
template
<
typename
T1
,
typename
T2
>
inline
point_data
(
const
T1
&
x
,
const
T2
&
y
)
:
coords_
()
{
inline
point_data
(
const
T1
&
x
,
const
T2
&
y
)
#ifndef BOOST_POLYGON_MSVC
:
coords_
()
#endif
{
coords_
[
HORIZONTAL
]
=
(
coordinate_type
)
x
;
coords_
[
VERTICAL
]
=
(
coordinate_type
)
y
;
}
template
<
typename
T2
>
inline
point_data
(
const
point_data
<
T2
>&
rvalue
)
:
coords_
()
{
inline
point_data
(
const
point_data
<
T2
>&
rvalue
)
#ifndef BOOST_POLYGON_MSVC
:
coords_
()
#endif
{
coords_
[
HORIZONTAL
]
=
(
coordinate_type
)(
rvalue
.
x
());
coords_
[
VERTICAL
]
=
(
coordinate_type
)(
rvalue
.
y
());
}
...
...
include/boost/polygon/polygon_45_data.hpp
View file @
d48f6e00
...
...
@@ -62,7 +62,7 @@ public:
inline
std
::
size_t
size
()
const
{
return
coords_
.
size
();
}
p
rivate
:
p
ublic
:
std
::
vector
<
point_data
<
coordinate_type
>
>
coords_
;
};
...
...
include/boost/polygon/polygon_45_set_data.hpp
View file @
d48f6e00
...
...
@@ -1541,11 +1541,11 @@ namespace boost { namespace polygon{
polygon_90_set_data
<
Unit
>
l90sd
(
VERTICAL
),
r90sd
(
VERTICAL
),
output
(
VERTICAL
);
for
(
typename
value_type
::
const_iterator
itr
=
data_
.
begin
();
itr
!=
data_
.
end
();
++
itr
)
{
if
((
*
itr
).
count
[
3
]
==
0
)
continue
;
//skip all non vertical edges
l90sd
.
insert
(
std
::
make_pair
((
*
itr
).
pt
.
x
(),
std
::
make_pair
((
*
itr
).
pt
.
y
(),
(
*
itr
).
count
[
3
])),
false
,
VERTICAL
);
l90sd
.
insert
(
std
::
make_pair
((
*
itr
).
pt
.
x
(),
std
::
make_pair
<
Unit
,
int
>
((
*
itr
).
pt
.
y
(),
(
*
itr
).
count
[
3
])),
false
,
VERTICAL
);
}
for
(
typename
value_type
::
const_iterator
itr
=
rvalue
.
data_
.
begin
();
itr
!=
rvalue
.
data_
.
end
();
++
itr
)
{
if
((
*
itr
).
count
[
3
]
==
0
)
continue
;
//skip all non vertical edges
r90sd
.
insert
(
std
::
make_pair
((
*
itr
).
pt
.
x
(),
std
::
make_pair
((
*
itr
).
pt
.
y
(),
(
*
itr
).
count
[
3
])),
false
,
VERTICAL
);
r90sd
.
insert
(
std
::
make_pair
((
*
itr
).
pt
.
x
(),
std
::
make_pair
<
Unit
,
int
>
((
*
itr
).
pt
.
y
(),
(
*
itr
).
count
[
3
])),
false
,
VERTICAL
);
}
l90sd
.
sort
();
r90sd
.
sort
();
...
...
@@ -1673,7 +1673,7 @@ namespace boost { namespace polygon{
polygon_90_set_data
<
Unit
>
l90sd
(
VERTICAL
);
for
(
typename
value_type
::
const_iterator
itr
=
data_
.
begin
();
itr
!=
data_
.
end
();
++
itr
)
{
if
((
*
itr
).
count
[
3
]
==
0
)
continue
;
//skip all non vertical edges
l90sd
.
insert
(
std
::
make_pair
((
*
itr
).
pt
.
x
(),
std
::
make_pair
((
*
itr
).
pt
.
y
(),
(
*
itr
).
count
[
3
])),
false
,
VERTICAL
);
l90sd
.
insert
(
std
::
make_pair
((
*
itr
).
pt
.
x
(),
std
::
make_pair
<
Unit
,
int
>
((
*
itr
).
pt
.
y
(),
(
*
itr
).
count
[
3
])),
false
,
VERTICAL
);
}
l90sd
.
sort
();
#ifdef BOOST_POLYGON_MSVC
...
...
include/boost/polygon/polygon_45_set_traits.hpp
View file @
d48f6e00
...
...
@@ -137,7 +137,7 @@ namespace boost { namespace polygon{
static
inline
bool
clean
(
const
polygon_45_set_data
<
T
>&
polygon_set
)
{
polygon_set
.
clean
();
return
true
;
}
static
inline
bool
sorted
(
const
polygon_45_set_data
<
T
>&
polygon_set
)
{
int
untested
=
0
;
polygon_set
.
sort
();
return
true
;
}
static
inline
bool
sorted
(
const
polygon_45_set_data
<
T
>&
polygon_set
)
{
polygon_set
.
sort
();
return
true
;
}
};
}
...
...
include/boost/polygon/polygon_45_with_holes_data.hpp
View file @
d48f6e00
...
...
@@ -96,10 +96,12 @@ public:
return
holes_
.
size
();
}
p
rivate
:
p
ublic
:
polygon_45_data
<
coordinate_type
>
self_
;
std
::
list
<
hole_type
>
holes_
;
};
}
}
#endif
...
...
include/boost/polygon/polygon_90_set_data.hpp
View file @
d48f6e00
This diff is collapsed.
Click to expand it.
include/boost/polygon/polygon_data.hpp
View file @
d48f6e00
...
...
@@ -60,7 +60,7 @@ public:
inline
std
::
size_t
size
()
const
{
return
coords_
.
size
();
}
p
rivate
:
p
ublic
:
std
::
vector
<
point_data
<
coordinate_type
>
>
coords_
;
};
...
...
include/boost/polygon/polygon_set_data.hpp
View file @
d48f6e00
This diff is collapsed.
Click to expand it.
include/boost/polygon/polygon_set_traits.hpp
View file @
d48f6e00
...
...
@@ -121,7 +121,7 @@ namespace boost { namespace polygon{
static
inline
bool
clean
(
const
polygon_set_data
<
T
>&
polygon_set
)
{
polygon_set
.
clean
();
return
true
;
}
static
inline
bool
sorted
(
const
polygon_set_data
<
T
>&
polygon_set
)
{
int
untested
=
0
;
polygon_set
.
sort
();
return
true
;
}
static
inline
bool
sorted
(
const
polygon_set_data
<
T
>&
polygon_set
)
{
polygon_set
.
sort
();
return
true
;
}
};
}
...
...
include/boost/polygon/polygon_with_holes_data.hpp
View file @
d48f6e00
...
...
@@ -96,7 +96,7 @@ public:
return
holes_
.
size
();
}
p
rivate
:
p
ublic
:
polygon_data
<
coordinate_type
>
self_
;
std
::
list
<
hole_type
>
holes_
;
};
...
...
pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp
View file @
d48f6e00
...
...
@@ -131,33 +131,10 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
* so m_ZoneMinThickness is the min thickness of the filled zones areas
* the main polygon is stored in polyset_zone_solid_areas
*/
#if 1
{
/* creates the main polygon (i.e. the filled area using only one outline)
* in GroupA in Bool_Engine to do a BOOL_CORRECTION operation
* to reserve a m_ZoneMinThickness/2 margin around the outlines
*/
Bool_Engine
*
booleng
=
new
Bool_Engine
();
ArmBoolEng
(
booleng
,
true
);
CopyPolygonsFromFilledPolysListToBoolengine
(
booleng
,
GROUP_A
);
booleng
->
SetCorrectionFactor
(
(
double
)
-
margin
);
booleng
->
Do_Operation
(
BOOL_CORRECTION
);
/* Now copy the new outline in m_FilledPolysList */
m_FilledPolysList
.
clear
();
CopyPolygonsFromBoolengineToFilledPolysList
(
booleng
);
delete
booleng
;
CopyPolygonsFromFilledPolysListTotKPolygonList
(
this
,
polyset_zone_solid_areas
);
}
#else
/* currently does not work well.
* using kbool gives reliable results
* using boost::polygone gives erroneous results
*/
CopyPolygonsFromFilledPolysListTotKPolygonList
(
this
,
polyset_zone_solid_areas
);
polyset_zone_solid_areas
-=
margin
;
#endif
if
(
polyset_zone_solid_areas
.
size
()
==
0
)
return
;
...
...
@@ -523,82 +500,6 @@ void AddUnconnectedThermalStubsToKPolygonList( std::vector<CPolyPt>& aCornerBuff
}
/** Function CopyPolygonsFromFilledPolysListToBoolengine
* Copy (Add) polygons found in m_FilledPolysList to kbool BoolEngine
* m_FilledPolysList may have more than one polygon
* @param aBoolengine = kbool engine
* @param aGroup = group in kbool engine (GROUP_A or GROUP_B only)
* @return the corner count
*/
int
ZONE_CONTAINER
::
CopyPolygonsFromFilledPolysListToBoolengine
(
Bool_Engine
*
aBoolengine
,
GroupType
aGroup
)
{
unsigned
corners_count
=
m_FilledPolysList
.
size
();
int
count
=
0
;
unsigned
ic
=
0
;
while
(
ic
<
corners_count
)
{
if
(
aBoolengine
->
StartPolygonAdd
(
aGroup
)
)
{
for
(
;
ic
<
corners_count
;
ic
++
)
{
CPolyPt
*
corner
=
&
m_FilledPolysList
[
ic
];
aBoolengine
->
AddPoint
(
corner
->
x
,
corner
->
y
);
count
++
;
if
(
corner
->
end_contour
)
{
ic
++
;
break
;
}
}
aBoolengine
->
EndPolygonAdd
();
}
}
return
count
;
}
/** Function CopyPolygonsFromBoolengineToFilledPolysList
* Copy (Add) polygons created by kbool (after Do_Operation) to m_FilledPolysList
* @param aBoolengine = kbool engine
* @return the corner count
*/
int
ZONE_CONTAINER
::
CopyPolygonsFromBoolengineToFilledPolysList
(
Bool_Engine
*
aBoolengine
)
{
int
count
=
0
;
while
(
aBoolengine
->
StartPolygonGet
()
)
{
CPolyPt
corner
(
0
,
0
,
false
);
while
(
aBoolengine
->
PolygonHasMorePoints
()
)
{
corner
.
x
=
(
int
)
aBoolengine
->
GetPolygonXPoint
();
corner
.
y
=
(
int
)
aBoolengine
->
GetPolygonYPoint
();
corner
.
end_contour
=
false
;
// Flag this corner if starting a hole connection segment:
// This is used by draw functions to draw only useful segments (and not extra segments)
corner
.
utility
=
(
aBoolengine
->
GetPolygonPointEdgeType
()
==
KB_FALSE_EDGE
)
?
1
:
0
;
m_FilledPolysList
.
push_back
(
corner
);
count
++
;
}
corner
.
end_contour
=
true
;
m_FilledPolysList
.
pop_back
();
m_FilledPolysList
.
push_back
(
corner
);
aBoolengine
->
EndPolygonGet
();
}
return
count
;
}
void
AddPolygonCornersToKPolygonList
(
std
::
vector
<
CPolyPt
>&
aCornersBuffer
,
KPolygonSet
&
aKPolyList
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment