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
b7db0ef8
Commit
b7db0ef8
authored
Oct 12, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating polygon lib code. A bug removed.
parent
7c5feb61
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
461 additions
and
117 deletions
+461
-117
zones_test_and_combine_areas.cpp
pcbnew/zones_test_and_combine_areas.cpp
+2
-14
PolyLine.cpp
polygon/PolyLine.cpp
+83
-100
PolyLine.h
polygon/PolyLine.h
+2
-2
math_for_graphics.cpp
polygon/math_for_graphics.cpp
+0
-1
polygon_test_point_inside.cpp
polygon/polygon_test_point_inside.cpp
+355
-0
polygon_test_point_inside.h
polygon/polygon_test_point_inside.h
+19
-0
No files found.
pcbnew/zones_test_and_combine_areas.cpp
View file @
b7db0ef8
...
...
@@ -169,16 +169,8 @@ int BOARD::TestAreaPolygon( ZONE_CONTAINER* CurrArea )
int
y2i
=
p
->
GetY
(
is2
);
int
x2f
=
p
->
GetX
(
is2_next
);
int
y2f
=
p
->
GetY
(
is2_next
);
int
ret
=
FindSegmentIntersections
(
x1i
,
y1i
,
x1f
,
y1f
,
style
,
x2i
,
y2i
,
x2f
,
y2f
,
style2
);
int
ret
=
FindSegmentIntersections
(
x1i
,
y1i
,
x1f
,
y1f
,
style
,
x2i
,
y2i
,
x2f
,
y2f
,
style2
);
if
(
ret
)
{
// intersection between non-adjacent sides
...
...
@@ -246,8 +238,6 @@ int BOARD::ClipAreaPolygon( ZONE_CONTAINER* CurrArea,
str
+=
wxT
(
"such as adding cutouts. It can't be fixed automatically.
\n
"
);
str
+=
wxT
(
"Manual correction is recommended."
);
wxMessageBox
(
str
);
// bDontShowSelfIntersectionArcsWarning = dlg.bDontShowBoxState;
}
return
-
1
;
// arcs intersect with other sides, error
}
...
...
@@ -427,8 +417,6 @@ int BOARD::CombineAllAreasInNet( int aNetCode, bool bMessageBox, bool bUseUtilit
curr_area
->
m_Netname
.
GetData
()
);
str
+=
wxT
(
"Therefore, these areas can't be combined."
);
wxMessageBox
(
str
);
// bDontShowIntersectionArcsWarning = dlg.bDontShowBoxState;
}
}
}
...
...
polygon/PolyLine.cpp
View file @
b7db0ef8
This diff is collapsed.
Click to expand it.
polygon/PolyLine.h
View file @
b7db0ef8
...
...
@@ -47,10 +47,10 @@ void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles = false );
#define to_int( x ) (int) round( (x) )
#ifndef min
#define min( x1, x2 ) ( (x1) > (x2)
) ? (x2) : (x1
)
#define min( x1, x2 ) ( (x1) > (x2)
? (x2) : (x1)
)
#endif
#ifndef max
#define max( x1, x2 ) ( (x1) > (x2)
) ? (x1) : (x2
)
#define max( x1, x2 ) ( (x1) > (x2)
? (x1) : (x2)
)
#endif
class
CRect
...
...
polygon/math_for_graphics.cpp
View file @
b7db0ef8
...
...
@@ -639,7 +639,6 @@ bool TestForIntersectionOfStraightLineSegments( int x1i, int y1i, int x1f, int y
int
*
x
,
int
*
y
,
double
*
d
)
{
double
a
,
b
,
dist
;
// first, test for intersection
if
(
x1i
==
x1f
&&
x2i
==
x2f
)
{
...
...
polygon/polygon_test_point_inside.cpp
0 → 100644
View file @
b7db0ef8
This diff is collapsed.
Click to expand it.
polygon/polygon_test_point_inside.h
0 → 100644
View file @
b7db0ef8
/////////////////////////////////////////////////////////////////////////////
// Name: polygon_test_point_inside.h
/////////////////////////////////////////////////////////////////////////////
using
namespace
std
;
/** Function TestPointInsidePolygon
* test if a point is inside or outside a polygon.
* @param aPolysList: the list of polygons
* @param istart: the starting point of a given polygon in m_FilledPolysList.
* @param iend: the ending point of the polygon in m_FilledPolysList.
* @param refx, refy: the point coordinate to test
* @return true if the point is inside, false for outside
*/
bool
TestPointInsidePolygon
(
std
::
vector
<
CPolyPt
>
aPolysList
,
int
istart
,
int
iend
,
int
refx
,
int
refy
);
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