Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Projet GORDYJAN_BAGNOLY_GARCIA_POIGNONNEC
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POIGNONNEC
Projet GORDYJAN_BAGNOLY_GARCIA_POIGNONNEC
Commits
50df6dba
Commit
50df6dba
authored
Apr 29, 2019
by
Arthur POIGNONNEC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] Initialisation des objets Edge / Polygon / Segment
parent
159fb883
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
10 deletions
+102
-10
Edge.java
src/main/Edge.java
+45
-1
Polygon.java
src/main/Polygon.java
+18
-6
Segment.java
src/main/Segment.java
+39
-0
TestEdge.java
src/tests/TestEdge.java
+0
-3
No files found.
src/main/Edge.java
View file @
50df6dba
package
main
;
package
main
;
public
class
Edge
{
public
class
Edge
extends
Point
{
// VARIABLES
private
Boolean
begin
;
private
Segment
segment
;
private
Double
angle
;
private
Boolean
visualize
;
// CONSTRUCOR
public
Edge
(
Double
_x
,
Double
_y
){
super
(
_x
,
_y
);
}
// GETTERS / SETTERS
public
Boolean
getBegin
()
{
return
begin
;
}
public
void
setBegin
(
Boolean
begin
)
{
this
.
begin
=
begin
;
}
public
Segment
getSegment
()
{
return
segment
;
}
public
void
setSegment
(
Segment
segment
)
{
this
.
segment
=
segment
;
}
public
Double
getAngle
()
{
return
angle
;
}
public
void
setAngle
(
Double
angle
)
{
this
.
angle
=
angle
;
}
public
Boolean
getVisualize
()
{
return
visualize
;
}
public
void
setVisualize
(
Boolean
visualize
)
{
this
.
visualize
=
visualize
;
}
}
}
\ No newline at end of file
src/main/Polygon.java
View file @
50df6dba
package
main
;
package
main
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Polygon
{
public
class
Polygon
{
private
Point
[]
points
;
private
List
<
Point
>
points
;
public
Polygon
(
double
x
,
double
y
)
{
points
=
new
ArrayList
<>();
points
.
add
(
new
Point
(
x
,
y
));
}
public
void
addPoint
(
Point
p
){
points
.
add
(
p
);
}
public
Polygon
(
double
[]
x
,
double
[]
y
)
{
public
void
addPoints
(
List
<
Point
>
l
){
//Fill the list of the peaks
points
.
addAll
(
l
);
for
(
int
i
=
0
;
i
<
x
.
length
;
i
++)
{
this
.
points
[
i
]
=
new
Point
(
x
[
i
],
y
[
i
]);
}
}
}
public
List
<
Point
>
getPoints
(){
return
points
;
}
}
}
src/main/Segment.java
0 → 100644
View file @
50df6dba
package
main
;
public
class
Segment
{
// VARIABLES
private
Edge
p1
;
private
Edge
p2
;
private
Double
distance
;
//CONSTRUCTOR
public
Segment
(){
}
// GETTERS / SETTERS
public
Edge
getP1
()
{
return
p1
;
}
public
void
setP1
(
Edge
p1
)
{
this
.
p1
=
p1
;
}
public
Edge
getP2
()
{
return
p2
;
}
public
void
setP2
(
Edge
p2
)
{
this
.
p2
=
p2
;
}
public
Double
getDistance
()
{
return
distance
;
}
public
void
setDistance
(
Double
distance
)
{
this
.
distance
=
distance
;
}
}
src/tests/TestEdge.java
View file @
50df6dba
...
@@ -8,9 +8,6 @@ public class TestEdge {
...
@@ -8,9 +8,6 @@ public class TestEdge {
@Test
@Test
public
void
testCreatingEdge
()
{
public
void
testCreatingEdge
()
{
Edge
e
=
new
Edge
(
new
Point
(
1
,
1
),
new
Point
(
10
,
20
));
//accès aux coordonnées des extrémités
//intersection avec un rayon
}
}
}
}
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