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
dbb72d16
Commit
dbb72d16
authored
Jan 04, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some compiler warnings
parent
6b08cb4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
47 deletions
+52
-47
shape_collisions.cpp
common/geometry/shape_collisions.cpp
+45
-47
shapes.cc
polygon/poly2tri/common/shapes.cc
+7
-0
No files found.
common/geometry/shape_collisions.cpp
View file @
dbb72d16
...
...
@@ -160,69 +160,67 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance,
{
switch
(
aA
->
Type
()
)
{
case
SH_RECT
:
switch
(
aB
->
Type
()
)
{
case
SH_CIRCLE
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aA
),
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_RECT
:
switch
(
aB
->
Type
()
)
{
case
SH_CIRCLE
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aA
),
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_LINE_CHAIN
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aA
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_LINE_CHAIN
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aA
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
default:
break
;
}
default:
break
;
}
break
;
case
SH_CIRCLE
:
switch
(
aB
->
Type
()
)
{
case
SH_RECT
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aB
),
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aA
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_CIRCLE
:
switch
(
aB
->
Type
()
)
{
case
SH_RECT
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aB
),
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aA
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_CIRCLE
:
return
Collide
(
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aA
),
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_CIRCLE
:
return
Collide
(
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aA
),
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_LINE_CHAIN
:
return
Collide
(
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aA
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_LINE_CHAIN
:
return
Collide
(
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aA
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
default:
break
;
}
default:
break
;
}
break
;
case
SH_LINE_CHAIN
:
switch
(
aB
->
Type
()
)
{
case
SH_RECT
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aB
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aA
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_CIRCLE
:
return
Collide
(
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aB
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aA
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_LINE_CHAIN
:
switch
(
aB
->
Type
()
)
{
case
SH_RECT
:
return
Collide
(
*
static_cast
<
const
SHAPE_RECT
*>
(
aB
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aA
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_LINE_CHAIN
:
return
Collide
(
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aA
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
case
SH_CIRCLE
:
return
Collide
(
*
static_cast
<
const
SHAPE_CIRCLE
*>
(
aB
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aA
),
aClearance
,
aNeedMTV
,
aMTV
);
default:
break
;
}
break
;
case
SH_LINE_CHAIN
:
return
Collide
(
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aA
),
*
static_cast
<
const
SHAPE_LINE_CHAIN
*>
(
aB
),
aClearance
,
aNeedMTV
,
aMTV
);
default:
break
;
}
}
break
;
bool
unsupported_collision
=
true
;
default:
break
;
}
assert
(
unsupported_collision
==
false
);
assert
(
0
);
// unsupported_collision
return
false
;
}
...
...
polygon/poly2tri/common/shapes.cc
View file @
dbb72d16
...
...
@@ -133,11 +133,15 @@ void Triangle::ClearDelunayEdges()
Point
*
Triangle
::
OppositePoint
(
Triangle
&
t
,
Point
&
p
)
{
Point
*
cw
=
t
.
PointCW
(
p
);
/*
double x = cw->x;
double y = cw->y;
x = p.x;
y = p.y;
*/
return
PointCW
(
*
cw
);
}
...
...
@@ -195,6 +199,7 @@ int Triangle::Index( const Point* p )
}
assert
(
0
);
return
0
;
// you better hope its a Debug build.
}
...
...
@@ -285,6 +290,7 @@ Point* Triangle::PointCW( Point& point )
}
assert
(
0
);
return
NULL
;
// you better hope its a Debug build.
}
...
...
@@ -305,6 +311,7 @@ Point* Triangle::PointCCW( Point& point )
}
assert
(
0
);
return
NULL
;
// you better hope its a Debug build.
}
...
...
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