Commit 50df6dba authored by Arthur POIGNONNEC's avatar Arthur POIGNONNEC

[DEV] Initialisation des objets Edge / Polygon / Segment

parent 159fb883
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
package main;
import java.util.ArrayList;
import java.util.List;
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) {
//Fill the list of the peaks
for (int i = 0; i < x.length; i++) {
this.points[i] = new Point(x[i], y[i]);
}
public void addPoints(List<Point> l){
points.addAll(l);
}
public List<Point> getPoints(){
return points;
}
}
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;
}
}
......@@ -8,9 +8,6 @@ public class TestEdge {
@Test
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
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment