Skip to content

Commit 51ef6c6

Browse files
committed
Update readme, minor fixes
1 parent a6b2623 commit 51ef6c6

File tree

10 files changed

+11
-36
lines changed

10 files changed

+11
-36
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#Convex Hull Visualizer
22

3-
This application is currently under development. The purpose of the program is to visualize computational geometry algorithms (ex: Graham Scan) to generate convex hulls for a series of points inputted by the user.
3+
This Android app is currently under development. The purpose of the program is to visualize computational geometry algorithms (ex: Graham Scan) to generate convex hulls for a series of points inputted by the user.
44

5-
##Progress
6-
* Added grid implementation
7-
* Functioning Graham Scan algorithm in O(NlogN) time
5+
##Features
6+
* Allows user to plot points on a canvas
7+
* Permits user to customize canvas using multi-touch gestures and through settings screen
8+
* Features color customization and edge/node size
9+
* Generates convex hull using Graham Scan algorithm in O(NlogN) time
810

911
##Further Development
10-
* Include multi-touch gestures to zoom in/out
1112
* Include Grift-Wrapping Algorithm O(N*H)
12-
* Include settings to change graphic settings
13-
* Add nice icon
13+
* Include nice animations
14+
* Add nice icon
15+
16+
##Screenshot
17+
![Image Unavailable](/screenshots/Screenshot.png)

app/src/main/java/ca/horatiu/convex_hull_visualizer/MainActivity.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ protected void onCreate(Bundle savedInstanceState) {
6666
LinearLayout upper = (LinearLayout) findViewById(R.id.LinearLayout01);
6767

6868
upper.addView(gridRenderer);
69-
//setContentView(gridRenderer);
70-
71-
//setContentView(R.layout.activity_main);
7269

7370
scaleGestureDetector = new ScaleGestureDetector(this, new MyOnScaleGestureListener(this));
7471
mDetector = new GestureDetectorCompat(this,this);
@@ -80,19 +77,6 @@ public void onClick(View v) {
8077
// your handler code here
8178
}
8279
});
83-
84-
/*final Button reset = (Button) findViewById(R.id.rest);
85-
reset.setOnClickListener(new View.OnClickListener() {
86-
public void onClick(View v) {
87-
// your handler code here
88-
//canvas.drawColor(0, PorterDuff.Mode.CLEAR);
89-
points = new ArrayList<Coordinate>();
90-
refresh();
91-
Log.d("Refresh", "Refreshed!");
92-
}
93-
});*/
94-
95-
9680
}
9781

9882
public void settings(View v){
@@ -192,10 +176,8 @@ public boolean onSingleTapConfirmed(MotionEvent event) {
192176
//add here...
193177
int xPos = (int)event.getRawX(); //why? wtf lol
194178
int yPos = (int)event.getRawY() - 150;
195-
196179
yPos = Math.max(0, yPos);
197180

198-
199181
/* Error trap :) */
200182
if (xPos > GridView.width){
201183
xPos = GridView.width-1;
@@ -205,7 +187,6 @@ public boolean onSingleTapConfirmed(MotionEvent event) {
205187
yPos = GridView.height-1;
206188
}
207189

208-
209190
int xIndex = (xPos/gridRenderer.getSkip() + gridRenderer.getXStart());
210191
int yIndex = (yPos/gridRenderer.getSkip() + gridRenderer.getYStart());
211192

@@ -219,20 +200,11 @@ public boolean onSingleTapConfirmed(MotionEvent event) {
219200
grid.setTrue(xPos, yPos); //good enough
220201

221202
points.add(new Coordinate(xPos, yPos, gridRenderer.getSkip())); //change coordinates? ADD GET SKIP -> OK
222-
223203
grid.getPoints().add(new Coordinate(xPos, yPos, 1)); //standard...
224-
225204
gridRenderer = new GridView(this, grid, settings);
226205
setContentView(R.layout.activity_main);
227-
228206
LinearLayout upper = (LinearLayout) findViewById(R.id.LinearLayout01);
229-
230207
upper.addView(gridRenderer);
231-
232-
//no!
233-
234-
//setContentView(gridRenderer);
235-
236208
return true;
237209
}
238210

app/src/main/java/ca/horatiu/convex_hull_visualizer/MyOnScaleGestureListener.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Created by Horatiu on 14/06/2016.
1010
*/
1111
public class MyOnScaleGestureListener extends SimpleOnScaleGestureListener{
12-
1312
MainActivity main;
1413

1514
public MyOnScaleGestureListener(MainActivity main){

screenshots/Screenshot.png

209 KB
Loading
67 KB
Loading
66.4 KB
Loading
36.2 KB
Loading
35.8 KB
Loading
42.5 KB
Loading
42.7 KB
Loading

0 commit comments

Comments
 (0)