Code cleanup. Copyright update.
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 7 Jul 2018 22:31:20 +0000 (01:31 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 7 Jul 2018 22:31:20 +0000 (01:31 +0300)
14 files changed:
pom.xml
sixth-3d-demos.iml [new file with mode: 0644]
src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/GridSpace.java [deleted file]
src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/PointCloudDemo.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java [new file with mode: 0755]
src/main/java/eu/svjatoslav/sixth/e3d/examples/SphereDemo.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/MenuPanel.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/life/Star.java
src/main/java/eu/svjatoslav/sixth/e3d/examples/package-info.java

diff --git a/pom.xml b/pom.xml
index d58b8b2..63a3c6a 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
         <dependency>
             <groupId>eu.svjatoslav</groupId>
             <artifactId>sixth-3d</artifactId>
-            <version>1.1</version>
+            <version>1.2-SNAPSHOT</version>
         </dependency>
 
         <dependency>
diff --git a/sixth-3d-demos.iml b/sixth-3d-demos.iml
new file mode 100644 (file)
index 0000000..e5c814c
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="JRebel" name="JRebel">
+      <configuration>
+        <option name="deleteUnindexed" value="false" />
+        <option name="httpAuthEnabled" value="false" />
+        <option name="httpPassword" />
+        <option name="httpUsername" />
+        <option name="ideModuleStorage">
+          <map>
+            <entry key="com.zeroturnaround.jrebel.FormatVersion" value="7.0.0" />
+            <entry key="com.zeroturnaround.jrebel.remoting.DeleteUnindexedFiles" value="false" />
+            <entry key="com.zeroturnaround.jrebel.remoting.ModuleRemoteServerSelection" value="off" />
+            <entry key="jrebelEnabled" value="true" />
+          </map>
+        </option>
+        <option name="masterModuleName" />
+        <option name="overrideStandardXmlFolder" value="false" />
+        <option name="remotingEnabled" value="false" />
+        <option name="secure" value="true" />
+        <option name="url" />
+        <option name="xmlDir" />
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.1" level="project" />
+    <orderEntry type="module" module-name="sixth-3d" />
+    <orderEntry type="library" scope="TEST" name="Maven: eu.svjatoslav:javainspect:1.5" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: eu.svjatoslav:svjatoslavcommons:1.5" level="project" />
+  </component>
+</module>
\ No newline at end of file
index 2bbd237..7bcaed7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GridSpace.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GridSpace.java
deleted file mode 100755 (executable)
index 5e9b53b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- */
-
-package eu.svjatoslav.sixth.e3d.examples;
-
-import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
-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.shapes.basic.solidpolygon.SolidPolygon;
-import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D;
-
-class GridSpace {
-
-    private static void addRandomPolygon(final ShapeCollection geometryCollection) {
-        final Point3D polygonLocation = getRandomPoint(1000);
-
-        final double polygonAverageSize = 30;
-
-        final Point3D point1 = new Point3D(polygonLocation);
-        point1.add(getRandomPoint(polygonAverageSize));
-
-        final Point3D point2 = new Point3D(polygonLocation);
-        point2.add(getRandomPoint(polygonAverageSize));
-
-        final Point3D point3 = new Point3D(polygonLocation);
-        point3.add(getRandomPoint(polygonAverageSize));
-
-        final Color color = new Color(Math.random(), Math.random(),
-                Math.random(), 0.5d);
-
-        final SolidPolygon polygon = new SolidPolygon(point1, point2, point3,
-                color);
-        geometryCollection.addShape(polygon);
-    }
-
-    private static Point3D getRandomPoint(final double amplitude) {
-        return new Point3D((Math.random() * amplitude * 2d) - amplitude,
-                (Math.random() * amplitude * 2d) - amplitude, (Math.random()
-                * amplitude * 2d)
-                - amplitude);
-    }
-
-    public static void main(final String[] args) {
-
-        final ViewFrame viewFrame = new ViewFrame();
-
-        final ShapeCollection shapeCollection = viewFrame.getView()
-                .getContext().getRootShapeCollection();
-
-        // add grid
-        final LineAppearance appearance = new LineAppearance(5, new Color(100,
-                100, 255, 60));
-
-        shapeCollection.addShape(new Grid3D(new Point3D(1000, -1000, -1000),
-                new Point3D(-1000, 1000, 1000), 300, appearance));
-
-        // add random polygons
-        for (int i = 0; i < 3000; i++)
-            addRandomPolygon(shapeCollection);
-
-    }
-}
index c26245f..0865ee7 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
@@ -27,7 +27,6 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextC
 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D;
 
 import java.awt.event.KeyEvent;
-import java.io.IOException;
 import java.util.Vector;
 
 public class OctreeDemo extends WorldNavigationTracker {
@@ -40,7 +39,7 @@ public class OctreeDemo extends WorldNavigationTracker {
     private ShapeCollection shapeCollection;
     private ViewContext context;
 
-    public static void main(final String[] args) throws IOException {
+    public static void main(final String[] args) {
         new OctreeDemo().init();
     }
 
@@ -88,7 +87,7 @@ public class OctreeDemo extends WorldNavigationTracker {
         }
     }
 
-    private void init() throws IOException {
+    private void init() {
 
         final ViewFrame viewFrame = new ViewFrame();
         context = viewFrame.getView().getContext();
index d92a9d1..71b2855 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
index a077cb9..ea44ca6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java
new file mode 100755 (executable)
index 0000000..3640e4b
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+ */
+
+package eu.svjatoslav.sixth.e3d.examples;
+
+import eu.svjatoslav.sixth.e3d.geometry.Point3D;
+import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+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.shapes.basic.solidpolygon.SolidPolygon;
+import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D;
+
+public class RandomPolygonsDemo {
+
+    private static void addRandomPolygon(final ShapeCollection geometryCollection) {
+        final Point3D polygonLocation = getRandomPoint(1000);
+
+        final double polygonAverageSize = 30;
+
+        final Point3D point1 = new Point3D(polygonLocation);
+        point1.add(getRandomPoint(polygonAverageSize));
+
+        final Point3D point2 = new Point3D(polygonLocation);
+        point2.add(getRandomPoint(polygonAverageSize));
+
+        final Point3D point3 = new Point3D(polygonLocation);
+        point3.add(getRandomPoint(polygonAverageSize));
+
+        final Color color = new Color(Math.random(), Math.random(),
+                Math.random(), 0.5d);
+
+        final SolidPolygon polygon = new SolidPolygon(point1, point2, point3,
+                color);
+        geometryCollection.addShape(polygon);
+    }
+
+    private static Point3D getRandomPoint(final double amplitude) {
+        return new Point3D((Math.random() * amplitude * 2d) - amplitude,
+                (Math.random() * amplitude * 2d) - amplitude, (Math.random()
+                * amplitude * 2d)
+                - amplitude);
+    }
+
+    public static void main(final String[] args) {
+
+        final ViewFrame viewFrame = new ViewFrame();
+
+        final ShapeCollection shapeCollection = viewFrame.getView()
+                .getContext().getRootShapeCollection();
+
+        // add grid
+        final LineAppearance appearance = new LineAppearance(5, new Color(100,
+                100, 255, 60));
+
+        shapeCollection.addShape(new Grid3D(new Point3D(1000, -1000, -1000),
+                new Point3D(-1000, 1000, 1000), 300, appearance));
+
+        // add random polygons
+        for (int i = 0; i < 3000; i++)
+            addRandomPolygon(shapeCollection);
+
+    }
+}
index 9a9b706..22b9dee 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
index 6f5d4d2..9f56342 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
index 512f30c..6d0f1a8 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
@@ -18,12 +18,8 @@ class Main extends javax.swing.JFrame {
     private Main() {
         super();
         initGUI();
-
     }
 
-    /**
-     * Auto-generated main method to display this JFrame
-     */
     public static void main(final String[] args) {
         SwingUtilities.invokeLater(() -> {
             final Main inst = new Main();
index 10178e3..30c7ee3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
@@ -17,8 +17,7 @@ import java.io.IOException;
 class MenuPanel extends JPanel {
     private static final long serialVersionUID = 2012721856427052560L;
 
-    public MenuPanel() {
-
+    MenuPanel() {
         final GroupLayout groupLayout = new GroupLayout(this);
         GroupLayout.SequentialGroup sequentialGroup = groupLayout.createSequentialGroup();
         sequentialGroup.addComponent(new JLabel("Choose an example to launch:"));
@@ -29,10 +28,11 @@ class MenuPanel extends JPanel {
         sequentialGroup.addComponent(new JButton(new ShowSinusMap()));
         sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
         sequentialGroup.addComponent(new JButton(new ShowGameOfLife()));
+        sequentialGroup.addComponent(new JButton(new ShowRandomPolygons()));
     }
 
     private class ShowTextEditors extends AbstractAction {
-        public ShowTextEditors() {
+        ShowTextEditors() {
             putValue(NAME, "Text editors");
         }
 
@@ -94,6 +94,17 @@ class MenuPanel extends JPanel {
         }
     }
 
+    private class ShowRandomPolygons extends AbstractAction {
+        public ShowRandomPolygons() {
+            putValue(NAME, "Random polygons");
+        }
+
+        @Override
+        public void actionPerformed(final ActionEvent e) {
+            RandomPolygonsDemo.main(null);
+        }
+    }
+
     private class ShowOctree extends AbstractAction {
         public ShowOctree() {
             putValue(NAME, "Volumetric Octree");
@@ -101,11 +112,7 @@ class MenuPanel extends JPanel {
 
         @Override
         public void actionPerformed(final ActionEvent e) {
-            try {
-                OctreeDemo.main(null);
-            } catch (final IOException e1) {
-                e1.printStackTrace();
-            }
+            OctreeDemo.main(null);
         }
     }
 
index 81e7198..693c21d 100644 (file)
@@ -7,7 +7,7 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.GlowingPoint;
 import java.util.ArrayList;
 import java.util.List;
 
-public class Star extends GlowingPoint{
+public class Star extends GlowingPoint {
     public static final int STAR_SIZE = 10;
 
     public static final int UNIQUE_STARS_COUNT = 30;
index 4946f36..7e9a3b3 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License