Creating scan graph.
This commit is contained in:
@@ -4,6 +4,7 @@ import processing.core.PApplet;
|
|||||||
|
|
||||||
public class PointVertex extends Vertex {
|
public class PointVertex extends Vertex {
|
||||||
private Vector position;
|
private Vector position;
|
||||||
|
|
||||||
private int[] color = new int[]{127, 255, 0, 0};
|
private int[] color = new int[]{127, 255, 0, 0};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class Processing extends PApplet {
|
|||||||
processing = this;
|
processing = this;
|
||||||
car = new Car(processing, 100,100,50,40);
|
car = new Car(processing, 100,100,50,40);
|
||||||
size(1000, 1000);
|
size(1000, 1000);
|
||||||
car.addView(360,360);
|
car.addView(90,180);
|
||||||
|
|
||||||
// for(int i = 0; i < 10; i++){
|
// for(int i = 0; i < 10; i++){
|
||||||
// PointVertex vStart = new PointVertex(random(50, 950), random(50, 950));
|
// PointVertex vStart = new PointVertex(random(50, 950), random(50, 950));
|
||||||
@@ -40,7 +40,6 @@ public class Processing extends PApplet {
|
|||||||
car.drawCar(map, SLAMIsHidden);
|
car.drawCar(map, SLAMIsHidden);
|
||||||
strokeWeight(2);
|
strokeWeight(2);
|
||||||
stroke(255);
|
stroke(255);
|
||||||
//car.drive(new int[] {0, 0});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void keyPressed(){
|
public void keyPressed(){
|
||||||
@@ -127,7 +126,4 @@ public class Processing extends PApplet {
|
|||||||
PointVertex v = new PointVertex(clickPosition);
|
PointVertex v = new PointVertex(clickPosition);
|
||||||
map.addVertex(v);
|
map.addVertex(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
40
src/ScanGraph/PointScan.java
Normal file
40
src/ScanGraph/PointScan.java
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
package ScanGraph;
|
||||||
|
|
||||||
|
import Graph.PointGraph;
|
||||||
|
import Graph.Vertex;
|
||||||
|
import Vector.Vector;
|
||||||
|
import processing.core.PApplet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class PointScan extends Vertex{
|
||||||
|
|
||||||
|
private Vector position;
|
||||||
|
private ArrayList<Vector> scan;
|
||||||
|
|
||||||
|
PointScan(Vector scanPosition, ArrayList<Vector> scan){
|
||||||
|
super();
|
||||||
|
this.position = scanPosition;
|
||||||
|
this.scan = scan;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param x the new x position of the vertex
|
||||||
|
* @param y the new y posiiton of the vertex
|
||||||
|
*/
|
||||||
|
public void setPos(float x, float y){
|
||||||
|
this.position = new Vector(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a two eleement float array containing the x and y coordinates of the vertex respectively.
|
||||||
|
*/
|
||||||
|
public Vector getPos(){
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<Vector> getScan(){
|
||||||
|
return this.scan;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user