projects
/
sixth-3d-demos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6097d24
)
Code cleanup and formatting.
author
Svjatoslav Agejenko
<svjatoslav@svjatoslav.eu>
Sat, 14 Jul 2018 00:18:48 +0000
(
03:18
+0300)
committer
Svjatoslav Agejenko
<svjatoslav@svjatoslav.eu>
Sat, 14 Jul 2018 00:18:48 +0000
(
03:18
+0300)
src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Star.java
patch
|
blob
|
history
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java
index
679e43f
..
c28dd14
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java
@@
-22,8
+22,7
@@
public class GraphDemo {
private static final double scale = 50d;
private static final double scale = 50d;
- private static Graph getCosineGraph(final Point3D location)
- throws IOException {
+ private static Graph getCosineGraph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.cos(x);
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.cos(x);
@@
-35,8
+34,7
@@
public class GraphDemo {
return new Graph(scale, data, "Cosine", location);
}
return new Graph(scale, data, "Cosine", location);
}
- private static Graph getFormula1Graph(final Point3D location)
- throws IOException {
+ private static Graph getFormula1Graph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(Math.tan(x));
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(Math.tan(x));
@@
-60,8
+58,7
@@
public class GraphDemo {
return new Graph(scale, data, "y = ( (10-x)^2 ) / 30", location);
}
return new Graph(scale, data, "y = ( (10-x)^2 ) / 30", location);
}
- private static Graph getFormula3Graph(final Point3D location)
- throws IOException {
+ private static Graph getFormula3Graph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(x / 2) + Math.sin(x / 1.26);
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(x / 2) + Math.sin(x / 1.26);
@@
-73,8
+70,7
@@
public class GraphDemo {
return new Graph(scale, data, "y = sin(x/2) + sin(x/1.26)", location);
}
return new Graph(scale, data, "y = sin(x/2) + sin(x/1.26)", location);
}
- private static Graph getSineGraph(final Point3D location)
- throws IOException {
+ private static Graph getSineGraph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(x);
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(x);
@@
-86,8
+82,7
@@
public class GraphDemo {
return new Graph(scale, data, "Sine", location);
}
return new Graph(scale, data, "Sine", location);
}
- private static Graph getTangentGraph(final Point3D location)
- throws IOException {
+ private static Graph getTangentGraph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
double y = Math.tan(x);
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
double y = Math.tan(x);
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
index
5e5e15f
..
3234445
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
@@
-9,10
+9,10
@@
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
import eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationTracker;
import eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationTracker;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.octree.OctreeVolume;
import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Camera;
import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.LightSource;
import eu.svjatoslav.sixth.e3d.renderer.octree.OctreeVolume;
import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Camera;
import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.LightSource;
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java
index
0729693
..
9185614
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java
@@
-9,8
+9,8
@@
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.Galaxy;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.Galaxy;
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java
index
b88a105
..
c42f6f8
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java
@@
-9,16
+9,15
@@
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
import eu.svjatoslav.sixth.e3d.gui.ViewRenderListener;
import eu.svjatoslav.sixth.e3d.gui.ViewRenderListener;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas;
-import java.io.IOException;
import java.util.Collection;
import java.util.Random;
import java.util.Collection;
import java.util.Random;
@@
-28,7
+27,7
@@
public class RainingNumbersDemo implements ViewRenderListener {
private final static int AREA = 600;
private final static int AREA_HALF = AREA / 2;
private final static int AREA = 600;
private final static int AREA_HALF = AREA / 2;
- public static void main(final String[] args)
throws IOException
{
+ public static void main(final String[] args) {
new RainingNumbersDemo().run();
}
new RainingNumbersDemo().run();
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java
index
4f26470
..
82210b0
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java
@@
-45,7
+45,7
@@
public class RandomPolygonsDemo {
}
/* I don't want very dark polygons, so ensure there is at least some
}
/* I don't want very dark polygons, so ensure there is at least some
-
* brightness present. */
+ * brightness present. */
private static double getColorChannelBrightness() {
return Math.random() * 0.7 + 0.3f;
}
private static double getColorChannelBrightness() {
return Math.random() * 0.7 + 0.3f;
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java
index
4cc2a75
..
71395c8
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java
@@
-11,10
+11,10
@@
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.geometry.Rectangle;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.geometry.Rectangle;
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.TextEditComponent;
import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.TextEditComponent;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java
index
30c7ee3
..
9a5dc58
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java
@@
-23,7
+23,7
@@
class MenuPanel extends JPanel {
sequentialGroup.addComponent(new JLabel("Choose an example to launch:"));
sequentialGroup.addComponent(new JButton(new ShowOctree()));
sequentialGroup.addComponent(new JButton(new ShowMathGraphs()));
sequentialGroup.addComponent(new JLabel("Choose an example to launch:"));
sequentialGroup.addComponent(new JButton(new ShowOctree()));
sequentialGroup.addComponent(new JButton(new ShowMathGraphs()));
- sequentialGroup.addComponent(new JButton(new ShowPoint
c
loud()));
+ sequentialGroup.addComponent(new JButton(new ShowPoint
C
loud()));
sequentialGroup.addComponent(new JButton(new ShowRain()));
sequentialGroup.addComponent(new JButton(new ShowSinusMap()));
sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
sequentialGroup.addComponent(new JButton(new ShowRain()));
sequentialGroup.addComponent(new JButton(new ShowSinusMap()));
sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
@@
-43,7
+43,7
@@
class MenuPanel extends JPanel {
}
private class ShowSinusMap extends AbstractAction {
}
private class ShowSinusMap extends AbstractAction {
-
public
ShowSinusMap() {
+ ShowSinusMap() {
putValue(NAME, "Wireframe sphere and ploygon landscape");
}
putValue(NAME, "Wireframe sphere and ploygon landscape");
}
@@
-54,22
+54,18
@@
class MenuPanel extends JPanel {
}
private class ShowRain extends AbstractAction {
}
private class ShowRain extends AbstractAction {
-
public
ShowRain() {
+ ShowRain() {
putValue(NAME, "Raining numbers");
}
@Override
public void actionPerformed(final ActionEvent e) {
putValue(NAME, "Raining numbers");
}
@Override
public void actionPerformed(final ActionEvent e) {
- try {
- RainingNumbersDemo.main(null);
- } catch (final IOException e1) {
- e1.printStackTrace();
- }
+ RainingNumbersDemo.main(null);
}
}
}
}
- private class ShowPoint
c
loud extends AbstractAction {
-
public ShowPointc
loud() {
+ private class ShowPoint
C
loud extends AbstractAction {
+
ShowPointC
loud() {
putValue(NAME, "Pointcloud galaxy");
}
putValue(NAME, "Pointcloud galaxy");
}
@@
-80,7
+76,7
@@
class MenuPanel extends JPanel {
}
private class ShowMathGraphs extends AbstractAction {
}
private class ShowMathGraphs extends AbstractAction {
-
public
ShowMathGraphs() {
+ ShowMathGraphs() {
putValue(NAME, "Mathematical graphs");
}
putValue(NAME, "Mathematical graphs");
}
@@
-95,7
+91,7
@@
class MenuPanel extends JPanel {
}
private class ShowRandomPolygons extends AbstractAction {
}
private class ShowRandomPolygons extends AbstractAction {
-
public
ShowRandomPolygons() {
+ ShowRandomPolygons() {
putValue(NAME, "Random polygons");
}
putValue(NAME, "Random polygons");
}
@@
-106,7
+102,7
@@
class MenuPanel extends JPanel {
}
private class ShowOctree extends AbstractAction {
}
private class ShowOctree extends AbstractAction {
-
public
ShowOctree() {
+ ShowOctree() {
putValue(NAME, "Volumetric Octree");
}
putValue(NAME, "Volumetric Octree");
}
@@
-117,7
+113,7
@@
class MenuPanel extends JPanel {
}
private class ShowGameOfLife extends AbstractAction {
}
private class ShowGameOfLife extends AbstractAction {
-
public
ShowGameOfLife() {
+ ShowGameOfLife() {
putValue(NAME, "Game of Life");
}
putValue(NAME, "Game of Life");
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java
index
4d1cca0
..
5817148
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Cell.java
@@
-9,7
+9,7
@@
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCom
/**
* This class corresponds to a single cell within matrix.
*/
/**
* This class corresponds to a single cell within matrix.
*/
-
public
class Cell extends AbstractCompositeShape implements
+class Cell extends AbstractCompositeShape implements
MouseInteractionController {
/**
MouseInteractionController {
/**
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Star.java
b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Star.java
index
693c21d
..
ad242d0
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Star.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Star.java
@@
-7,7
+7,7
@@
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.GlowingPoint;
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
-
public
class Star extends GlowingPoint {
+class Star extends GlowingPoint {
public static final int STAR_SIZE = 10;
public static final int UNIQUE_STARS_COUNT = 30;
public static final int STAR_SIZE = 10;
public static final int UNIQUE_STARS_COUNT = 30;