Creating scan graph.

This commit is contained in:
Quinn
2023-11-21 21:30:21 -05:00
parent bda601d326
commit 7dc679371a
3 changed files with 42 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import processing.core.PApplet;
public class PointVertex extends Vertex {
private Vector position;
private int[] color = new int[]{127, 255, 0, 0};
/**

View File

@@ -23,7 +23,7 @@ public class Processing extends PApplet {
processing = this;
car = new Car(processing, 100,100,50,40);
size(1000, 1000);
car.addView(360,360);
car.addView(90,180);
// for(int i = 0; i < 10; i++){
// PointVertex vStart = new PointVertex(random(50, 950), random(50, 950));
@@ -40,7 +40,6 @@ public class Processing extends PApplet {
car.drawCar(map, SLAMIsHidden);
strokeWeight(2);
stroke(255);
//car.drive(new int[] {0, 0});
}
public void keyPressed(){
@@ -127,7 +126,4 @@ public class Processing extends PApplet {
PointVertex v = new PointVertex(clickPosition);
map.addVertex(v);
}
}

View 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;
}
}