Compare commits
4 Commits
519ce77813
...
08.04.26-m
| Author | SHA1 | Date | |
|---|---|---|---|
| c13bb289ed | |||
| c8ee9b0a37 | |||
| dc2ea03224 | |||
| c62a99089d |
@@ -77,6 +77,13 @@ public class Poisson{
|
||||
this.infestation = infestation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter de l'attribut length
|
||||
* @param length le Double de la nouvelle valeur de la length
|
||||
*/
|
||||
public void setLength(Double length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter de l'attribut des parties de poisson.
|
||||
@@ -95,4 +102,6 @@ public class Poisson{
|
||||
String result = "[ %5s : %4f mm, %4f g, %4f taux d'infestation ]";
|
||||
return String.format(result, this.getClass().getSimpleName(), this.getLength(), this.getWeight(), this.getInfestation() );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package ecoparasite.svg;
|
||||
|
||||
import ecoparasite.representation.ValeursXY;
|
||||
import ecoparasite.svg.elements.Element;
|
||||
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
public class SVGFactory {
|
||||
@@ -73,4 +76,59 @@ public class SVGFactory {
|
||||
|
||||
}
|
||||
|
||||
public static HashMap< String ,HashSet<ValeursXY>> PointAXES(HashSet<ValeursXY> h){
|
||||
|
||||
//Définition initial
|
||||
HashSet<ValeursXY> x = new HashSet<>();
|
||||
HashSet<ValeursXY> y = new HashSet<>();
|
||||
HashSet<ValeursXY> offset = new HashSet<>();
|
||||
HashMap< String, HashSet<ValeursXY> > map = new HashMap<>();
|
||||
|
||||
//Définition des min et max
|
||||
double max_x = Double.MIN_VALUE;
|
||||
double min_x = Double.MAX_VALUE;
|
||||
double max_y = Double.MIN_VALUE;
|
||||
double min_y = Double.MAX_VALUE;
|
||||
|
||||
//Trouvé les min et max
|
||||
for (ValeursXY var : h) {
|
||||
|
||||
if (max_x < var.getX()){
|
||||
max_x = var.getX();
|
||||
} else if (min_x > var.getX()){
|
||||
min_x = var.getX();
|
||||
}
|
||||
|
||||
if (max_y < var.getY()){
|
||||
max_y = var.getY();
|
||||
} else if (min_y > var.getY()){
|
||||
min_y = var.getY();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
double step_x = (max_x - min_x); //TODO
|
||||
double step_y = (max_y - min_y); //TODO
|
||||
|
||||
|
||||
//TODO
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* retourne une valeur arrondi "joli" adapter à un graphique
|
||||
* @param value
|
||||
* @param step
|
||||
* @return
|
||||
*/
|
||||
public static double roundMin(double value, double step) {
|
||||
return Math.floor(value / step) * step;
|
||||
}
|
||||
|
||||
public static double roundMax(double value, double step) {
|
||||
return Math.ceil(value / step) * step;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user