projects
/
sixth-3d.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8bceefb
)
Code cleanup and formatting.
author
Svjatoslav Agejenko
<svjatoslav@svjatoslav.eu>
Sat, 14 Jul 2018 00:11:01 +0000
(
03:11
+0300)
committer
Svjatoslav Agejenko
<svjatoslav@svjatoslav.eu>
Sat, 14 Jul 2018 00:11:01 +0000
(
03:11
+0300)
26 files changed:
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
patch
|
blob
|
history
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java
b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java
index
1cfd39c
..
d650a9e
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java
@@
-34,7
+34,7
@@
public class Point2D implements Cloneable {
return this;
}
return this;
}
- public boolean isZero(){
+ public boolean isZero()
{
return (x == 0) && (y == 0);
}
return (x == 0) && (y == 0);
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java
b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java
index
462f310
..
4cae6ae
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java
@@
-9,9
+9,7
@@
package eu.svjatoslav.sixth.e3d.geometry;
package eu.svjatoslav.sixth.e3d.geometry;
-import static java.lang.Math.cos;
-import static java.lang.Math.sin;
-import static java.lang.Math.sqrt;
+import static java.lang.Math.*;
/**
* Used to represent point in a 3D space or vector.
/**
* Used to represent point in a 3D space or vector.
@@
-74,7
+72,7
@@
public class Point3D extends Point2D implements Cloneable {
}
@Override
}
@Override
- public boolean isZero(){
+ public boolean isZero()
{
return (x == 0) && (y == 0) && (z == 0);
}
return (x == 0) && (y == 0) && (z == 0);
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
index
8dae301
..
52d78b2
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
@@
-21,6
+21,10
@@
public class Avatar implements ViewRenderListener {
* Just in case we want to adjust global speed for some reason.
*/
private static final double SPEED_MULTIPLIER = .02d;
* Just in case we want to adjust global speed for some reason.
*/
private static final double SPEED_MULTIPLIER = .02d;
+ /**
+ * Determines amount of friction user experiences every millisecond while moving around in space.
+ */
+ private static final double MILLISECOND_FRICTION = 1.005;
/**
* Avatar movement speed, relative to avatar itself. When avatar coordinates
* are updated within the world, avatar orientation relative to the world is
/**
* Avatar movement speed, relative to avatar itself. When avatar coordinates
* are updated within the world, avatar orientation relative to the world is
@@
-32,23
+36,16
@@
public class Avatar implements ViewRenderListener {
* Avatar location within the 3D world.
*/
private Point3D location = new Point3D();
* Avatar location within the 3D world.
*/
private Point3D location = new Point3D();
-
/**
* Avatar orientation on the X-Z plane. It changes when turning left or
* right.
*/
private double orientationXZ;
/**
* Avatar orientation on the X-Z plane. It changes when turning left or
* right.
*/
private double orientationXZ;
-
/**
* Avatar orientation on the Y-Z plane. It changes when looking up or down.
*/
private double orientationYZ;
/**
* Avatar orientation on the Y-Z plane. It changes when looking up or down.
*/
private double orientationYZ;
- /**
- * Determines amount of friction user experiences every millisecond while moving around in space.
- */
- private static final double MILLISECOND_FRICTION = 1.005;
-
public Avatar() {
}
public Avatar() {
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java
index
15e2d77
..
64dc879
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java
@@
-11,10
+11,10
@@
package eu.svjatoslav.sixth.e3d.gui;
import eu.svjatoslav.sixth.e3d.geometry.Box;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.geometry.Box;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
import eu.svjatoslav.sixth.e3d.gui.humaninput.UserInputHandler;
import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.KeyboardHelper;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
import eu.svjatoslav.sixth.e3d.gui.humaninput.UserInputHandler;
import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.KeyboardHelper;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.WireframeBox;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.WireframeBox;
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java
index
91b7376
..
afbe22d
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java
@@
-20,21
+20,14
@@
import java.awt.image.WritableRaster;
public class RenderingContext {
public static final int bufferedImageType = BufferedImage.TYPE_4BYTE_ABGR;
public class RenderingContext {
public static final int bufferedImageType = BufferedImage.TYPE_4BYTE_ABGR;
-
- final BufferedImage bufferedImage;
-
public final Graphics2D graphics;
public final Graphics2D graphics;
-
public final byte[] pixels;
public final byte[] pixels;
-
public final int width;
public final int height;
public final int width;
public final int height;
-
public final int xCenter;
public final int yCenter;
public final int xCenter;
public final int yCenter;
-
public final double zoom;
public final double zoom;
-
+ final BufferedImage bufferedImage;
public int frameNumber = 0;
/**
public int frameNumber = 0;
/**
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java
index
0cf3610
..
3dc7201
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java
@@
-49,12
+49,8
@@
public class TextPointer implements Comparable<TextPointer> {
if (textPointer.row < row)
return 1;
if (textPointer.row < row)
return 1;
- if (textPointer.column > column)
- return -1;
- if (textPointer.column < column)
- return 1;
+ return Integer.compare(column, textPointer.column);
- return 0;
}
public boolean isBetween(final TextPointer start, final TextPointer end) {
}
public boolean isBetween(final TextPointer start, final TextPointer end) {
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java
index
175c10a
..
8708398
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java
@@
-10,8
+10,8
@@
package eu.svjatoslav.sixth.e3d.gui;
package eu.svjatoslav.sixth.e3d.gui;
-import eu.svjatoslav.sixth.e3d.math.GeometryCoordinate;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
+import eu.svjatoslav.sixth.e3d.math.GeometryCoordinate;
import eu.svjatoslav.sixth.e3d.math.TransformPipe;
public class UserRelativityTracker {
import eu.svjatoslav.sixth.e3d.math.TransformPipe;
public class UserRelativityTracker {
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java
index
f38d3c0
..
2c6afe2
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java
@@
-23,33
+23,12
@@
import java.util.List;
import java.util.Timer;
public class ViewPanel extends JPanel implements ComponentListener {
import java.util.Timer;
public class ViewPanel extends JPanel implements ComponentListener {
+ private static final long serialVersionUID = 1683277888885045387L;
private final UserInputTracker userInputTracker = new UserInputTracker(this);
private final UserInputTracker userInputTracker = new UserInputTracker(this);
-
private final KeyboardFocusTracker keyboardFocusTracker = new KeyboardFocusTracker(
this);
private final KeyboardFocusTracker keyboardFocusTracker = new KeyboardFocusTracker(
this);
-
private final Avatar avatar = new Avatar();
private final Avatar avatar = new Avatar();
-
private final ShapeCollection rootShapeCollection = new ShapeCollection();
private final ShapeCollection rootShapeCollection = new ShapeCollection();
-
-
- public Avatar getAvatar() {
- return avatar;
- }
-
- public KeyboardFocusTracker getKeyboardFocusTracker() {
- return keyboardFocusTracker;
- }
-
- public ShapeCollection getRootShapeCollection() {
- return rootShapeCollection;
- }
-
- public UserInputTracker getUserInputTracker() {
- return userInputTracker;
- }
-
- private static final long serialVersionUID = 1683277888885045387L;
private final List<ViewRenderListener> viewRenderListeners = new ArrayList<>();
/**
* Last time this view was updated.
private final List<ViewRenderListener> viewRenderListeners = new ArrayList<>();
/**
* Last time this view was updated.
@@
-58,24
+37,20
@@
public class ViewPanel extends JPanel implements ComponentListener {
private Timer canvasUpdateTimer;
private ViewUpdateTimerTask canvasUpdateTimerTask;
private RenderingContext renderingContext = null;
private Timer canvasUpdateTimer;
private ViewUpdateTimerTask canvasUpdateTimerTask;
private RenderingContext renderingContext = null;
-
/**
* UI component that mouse is currently hovering over.
*/
private MouseInteractionController currentMouseOverComponent;
/**
* UI component that mouse is currently hovering over.
*/
private MouseInteractionController currentMouseOverComponent;
-
/**
* Currently target FPS for this view. It can be changed at runtime. Also when nothing
* changes in the view, then frames are not really repainted.
*/
private int targetFPS = 30;
/**
* Currently target FPS for this view. It can be changed at runtime. Also when nothing
* changes in the view, then frames are not really repainted.
*/
private int targetFPS = 30;
-
/**
* Set to true if it is known than next frame reeds to be painted. Flag is cleared
* immediately after frame got updated.
*/
private boolean viewRepaintNeeded = true;
/**
* Set to true if it is known than next frame reeds to be painted. Flag is cleared
* immediately after frame got updated.
*/
private boolean viewRepaintNeeded = true;
-
public ViewPanel() {
viewRenderListeners.add(avatar);
viewRenderListeners.add(userInputTracker);
public ViewPanel() {
viewRenderListeners.add(avatar);
viewRenderListeners.add(userInputTracker);
@@
-87,6
+62,22
@@
public class ViewPanel extends JPanel implements ComponentListener {
addComponentListener(this);
}
addComponentListener(this);
}
+ public Avatar getAvatar() {
+ return avatar;
+ }
+
+ public KeyboardFocusTracker getKeyboardFocusTracker() {
+ return keyboardFocusTracker;
+ }
+
+ public ShapeCollection getRootShapeCollection() {
+ return rootShapeCollection;
+ }
+
+ public UserInputTracker getUserInputTracker() {
+ return userInputTracker;
+ }
+
public void addViewUpdateListener(final ViewRenderListener listener) {
viewRenderListeners.add(listener);
}
public void addViewUpdateListener(final ViewRenderListener listener) {
viewRenderListeners.add(listener);
}
@@
-240,7
+231,7
@@
public class ViewPanel extends JPanel implements ComponentListener {
* graphics is needed.
*/
public void updateView() {
* graphics is needed.
*/
public void updateView() {
- if (renderingContext != null){
+ if (renderingContext != null)
{
renderingContext.mouseClick = null;
renderingContext.clickedItem = null;
}
renderingContext.mouseClick = null;
renderingContext.clickedItem = null;
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java
index
5444852
..
a36b77b
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java
@@
-14,9
+14,9
@@
public interface ViewRenderListener {
/**
* Notifies that it is about time to render next frame and
* allows listener to do any related processing that it needs to.
/**
* Notifies that it is about time to render next frame and
* allows listener to do any related processing that it needs to.
- *
+ *
<p>
* Each {@link ViewRenderListener} will be notified exactly once before every frame is rendered.
* Each {@link ViewRenderListener} will be notified exactly once before every frame is rendered.
- *
+ *
<p>
* {@link ViewRenderListener} can determine if frame repaint is actually
* needed from its perspective. Frame will be rendered only if at least one listener says yes.
*
* {@link ViewRenderListener} can determine if frame repaint is actually
* needed from its perspective. Frame will be rendered only if at least one listener says yes.
*
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java
index
f22995f
..
b7d96af
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java
@@
-19,7
+19,7
@@
public class Character {
this.value = value;
}
this.value = value;
}
- boolean
isEmpty
() {
- return value
=
= ' ';
+ boolean
hasValue
() {
+ return value
!
= ' ';
}
}
}
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java
index
bba0717
..
ee4def7
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java
@@
-10,10
+10,10
@@
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.GuiComponent;
import eu.svjatoslav.sixth.e3d.gui.TextPointer;
import eu.svjatoslav.sixth.e3d.gui.GuiComponent;
import eu.svjatoslav.sixth.e3d.gui.TextPointer;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
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.shapes.composite.textcanvas.TextCanvas;
@@
-360,7
+360,6
@@
public class TextEditComponent extends GuiComponent implements ClipboardOwner {
}
cursorLocation.column = 0;
}
cursorLocation.column = 0;
- return;
}
}
}
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java
b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java
index
a8a3de6
..
a8f2129
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java
@@
-107,7
+107,7
@@
public class TextLine {
return 0;
for (int i = 0; i < chars.size(); i++)
return 0;
for (int i = 0; i < chars.size(); i++)
- if (
!chars.get(i).isEmpty
())
+ if (
chars.get(i).hasValue
())
return i;
throw new RuntimeException("This code shall never execute");
return i;
throw new RuntimeException("This code shall never execute");
@@
-172,7
+172,7
@@
public class TextLine {
int newLength = 0;
for (int i = chars.size() - 1; i >= 0; i--)
int newLength = 0;
for (int i = chars.size() - 1; i >= 0; i--)
- if (
!chars.get(i).isEmpty
()) {
+ if (
chars.get(i).hasValue
()) {
newLength = i + 1;
break;
}
newLength = i + 1;
break;
}
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
index
035c862
..
4ee1b48
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
@@
-5,11
+5,9
@@
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
*
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
*
+ * Realtime voxel renderer (in software).
+ * Uses octree for data compression.
*/
package eu.svjatoslav.sixth.e3d.renderer.octree;
*/
package eu.svjatoslav.sixth.e3d.renderer.octree;
-/**
- * Realtime voxel renderer (in software).
- * Uses octree for data compression.
- */
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
index
e4dd649
..
84fbb6a
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
@@
-10,8
+10,8
@@
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.Avatar;
import eu.svjatoslav.sixth.e3d.gui.Avatar;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.TexturedRectangle;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.TexturedRectangle;
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
index
35ec06b
..
79ae21c
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
@@
-107,36
+107,29
@@
public class RayTracer implements Runnable {
texture.resetResampledBitmapCache();
viewPanel.repaintDuringNextViewUpdate();
texture.resetResampledBitmapCache();
viewPanel.repaintDuringNextViewUpdate();
- // System.out.println("Raytracing done.");
- // System.out.println("New lights computed:" + computedLights);
}
}
- public int traceLight(final LightSource l, final int cubeX,
- final int cubeY, final int cubeZ) {
- return 0;
- }
-
- public int traceRay(final Ray r) {
+ private int traceRay(final Ray ray) {
- final int
re
= octreeVolume.traceCell(0, 0, 0,
- octreeVolume.masterCellSize, 0, r);
+ final int
intersectingCell
= octreeVolume.traceCell(0, 0, 0,
+ octreeVolume.masterCellSize, 0, r
ay
);
- if (
re
!= -1) {
+ if (
intersectingCell
!= -1) {
// if lightening not computed, compute it
// if lightening not computed, compute it
- if (octreeVolume.ce3[
re
] == -1)
+ if (octreeVolume.ce3[
intersectingCell
] == -1)
// if cell is larger than 1
// if cell is larger than 1
- if (r.hitCellSize > 1) {
+ if (r
ay
.hitCellSize > 1) {
// break it up
// break it up
- octreeVolume.breakSolidCell(
re
);
- return traceRay(r);
+ octreeVolume.breakSolidCell(
intersectingCell
);
+ return traceRay(r
ay
);
} else {
computedLights++;
float red = 30, green = 30, blue = 30;
for (final LightSource l : lights) {
} else {
computedLights++;
float red = 30, green = 30, blue = 30;
for (final LightSource l : lights) {
- final int xDist = (l.x - r.hitCellX);
- final int yDist = (l.y - r.hitCellY);
- final int zDist = (l.z - r.hitCellZ);
+ final int xDist = (l.x - r
ay
.hitCellX);
+ final int yDist = (l.y - r
ay
.hitCellY);
+ final int zDist = (l.z - r
ay
.hitCellZ);
double newRed = 0, newGreen = 0, newBlue = 0;
double tempRed, tempGreen, tempBlue;
double newRed = 0, newGreen = 0, newBlue = 0;
double tempRed, tempGreen, tempBlue;
@@
-145,12
+138,12
@@
public class RayTracer implements Runnable {
+ (yDist * yDist) + (zDist * zDist));
distance = (distance / 3) + 1;
+ (yDist * yDist) + (zDist * zDist));
distance = (distance / 3) + 1;
- final Ray r1 = new Ray(r
.hitCellX, r
.hitCellY
- - (float) 1.5, r.hitCellZ,
+ final Ray r1 = new Ray(r
ay.hitCellX, ray
.hitCellY
+ - (float) 1.5, r
ay
.hitCellZ,
- (float) l.x - (float) r.hitCellX, l.y
- - (r.hitCellY - (float) 1.5), (float) l.z
- - (float) r.hitCellZ);
+ (float) l.x - (float) r
ay
.hitCellX, l.y
+ - (r
ay
.hitCellY - (float) 1.5), (float) l.z
+ - (float) r
ay
.hitCellZ);
final int rt1 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r1);
final int rt1 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r1);
@@
-161,12
+154,12
@@
public class RayTracer implements Runnable {
newBlue = (l.color.b * l.brightness) / distance;
}
newBlue = (l.color.b * l.brightness) / distance;
}
- final Ray r2 = new Ray(r.hitCellX - (float) 1.5,
- r
.hitCellY, r
.hitCellZ,
+ final Ray r2 = new Ray(r
ay
.hitCellX - (float) 1.5,
+ r
ay.hitCellY, ray
.hitCellZ,
- l.x - (r.hitCellX - (float) 1.5), (float) l.y
- - (float) r.hitCellY, (float) l.z
- - (float) r.hitCellZ);
+ l.x - (r
ay
.hitCellX - (float) 1.5), (float) l.y
+ - (float) r
ay
.hitCellY, (float) l.z
+ - (float) r
ay
.hitCellZ);
final int rt2 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r2);
final int rt2 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r2);
@@
-184,12
+177,12
@@
public class RayTracer implements Runnable {
newBlue = tempBlue;
}
newBlue = tempBlue;
}
- final Ray r3 = new Ray(r
.hitCellX, r
.hitCellY,
- r.hitCellZ - (float) 1.5,
+ final Ray r3 = new Ray(r
ay.hitCellX, ray
.hitCellY,
+ r
ay
.hitCellZ - (float) 1.5,
- (float) l.x - (float) r.hitCellX, (float) l.y
- - (float) r.hitCellY, l.z
- - (r.hitCellZ - (float) 1.5));
+ (float) l.x - (float) r
ay
.hitCellX, (float) l.y
+ - (float) r
ay
.hitCellY, l.z
+ - (r
ay
.hitCellZ - (float) 1.5));
final int rt3 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r3);
final int rt3 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r3);
@@
-206,12
+199,12
@@
public class RayTracer implements Runnable {
newBlue = tempBlue;
}
newBlue = tempBlue;
}
- final Ray r4 = new Ray(r
.hitCellX, r
.hitCellY
- + (float) 1.5, r.hitCellZ,
+ final Ray r4 = new Ray(r
ay.hitCellX, ray
.hitCellY
+ + (float) 1.5, r
ay
.hitCellZ,
- (float) l.x - (float) r.hitCellX, l.y
- - (r.hitCellY + (float) 1.5), (float) l.z
- - (float) r.hitCellZ);
+ (float) l.x - (float) r
ay
.hitCellX, l.y
+ - (r
ay
.hitCellY + (float) 1.5), (float) l.z
+ - (float) r
ay
.hitCellZ);
final int rt4 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r4);
final int rt4 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r4);
@@
-228,12
+221,12
@@
public class RayTracer implements Runnable {
newBlue = tempBlue;
}
newBlue = tempBlue;
}
- final Ray r5 = new Ray(r.hitCellX + (float) 1.5,
- r
.hitCellY, r
.hitCellZ,
+ final Ray r5 = new Ray(r
ay
.hitCellX + (float) 1.5,
+ r
ay.hitCellY, ray
.hitCellZ,
- l.x - (r.hitCellX + (float) 1.5), (float) l.y
- - (float) r.hitCellY, (float) l.z
- - (float) r.hitCellZ);
+ l.x - (r
ay
.hitCellX + (float) 1.5), (float) l.y
+ - (float) r
ay
.hitCellY, (float) l.z
+ - (float) r
ay
.hitCellZ);
final int rt5 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r5);
final int rt5 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r5);
@@
-250,12
+243,12
@@
public class RayTracer implements Runnable {
newBlue = tempBlue;
}
newBlue = tempBlue;
}
- final Ray r6 = new Ray(r
.hitCellX, r
.hitCellY,
- r.hitCellZ + (float) 1.5,
+ final Ray r6 = new Ray(r
ay.hitCellX, ray
.hitCellY,
+ r
ay
.hitCellZ + (float) 1.5,
- (float) l.x - (float) r.hitCellX, (float) l.y
- - (float) r.hitCellY, l.z
- - (r.hitCellZ + (float) 1.5));
+ (float) l.x - (float) r
ay
.hitCellX, (float) l.y
+ - (float) r
ay
.hitCellY, l.z
+ - (r
ay
.hitCellZ + (float) 1.5));
final int rt6 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r6);
final int rt6 = octreeVolume.traceCell(0, 0, 0,
octreeVolume.masterCellSize, 0, r6);
@@
-277,7
+270,7
@@
public class RayTracer implements Runnable {
}
}
- final int cellColor = octreeVolume.ce2[
re
];
+ final int cellColor = octreeVolume.ce2[
intersectingCell
];
red = (red * ((cellColor & 0xFF0000) >> 16)) / 255;
green = (green * ((cellColor & 0xFF00) >> 8)) / 255;
red = (red * ((cellColor & 0xFF0000) >> 16)) / 255;
green = (green * ((cellColor & 0xFF00) >> 8)) / 255;
@@
-290,13
+283,13
@@
public class RayTracer implements Runnable {
if (blue > 255)
blue = 255;
if (blue > 255)
blue = 255;
- octreeVolume.ce3[
re
] = (((int) red) << 16)
+ octreeVolume.ce3[
intersectingCell
] = (((int) red) << 16)
+ (((int) green) << 8) + ((int) blue);
}
+ (((int) green) << 8) + ((int) blue);
}
- if (octreeVolume.ce3[
re
] == 0)
- return octreeVolume.ce2[
re
];
- return octreeVolume.ce3[
re
];
+ if (octreeVolume.ce3[
intersectingCell
] == 0)
+ return octreeVolume.ce2[
intersectingCell
];
+ return octreeVolume.ce3[
intersectingCell
];
}
// return (200 << 16) + (200 << 8) + 255;
}
// return (200 << 16) + (200 << 8) + 255;
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
index
b99cb5c
..
6dd7832
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
@@
-5,10
+5,8
@@
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
*
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
*
+ * Raytracer through voxel data.
*/
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
*/
package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
-/**
- * Raytracer through voxel data.
- */
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
index
5cfba3b
..
284685d
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
@@
-5,10
+5,8
@@
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
*
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
*
+ * Various 3D renderers utilizing different rendering approaches.
*/
package eu.svjatoslav.sixth.e3d.renderer;
*/
package eu.svjatoslav.sixth.e3d.renderer;
-/**
- * Various 3D renderers utilizing different rendering approaches.
- */
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
index
89d1c68
..
0af46f7
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
@@
-5,11
+5,6
@@
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
*
* 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.renderer.raster;
-
-/**
* <pre>
* Realtime renderer (in software) using traditional approaches:
* Wireframe
* <pre>
* Realtime renderer (in software) using traditional approaches:
* Wireframe
@@
-17,3
+12,6
@@
package eu.svjatoslav.sixth.e3d.renderer.raster;
* Z-Buffer
* </pre>
*/
* Z-Buffer
* </pre>
*/
+
+package eu.svjatoslav.sixth.e3d.renderer.raster;
+
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
index
97ffc7b
..
4e36d2e
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
@@
-9,10
+9,10
@@
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
-import eu.svjatoslav.sixth.e3d.math.GeometryCoordinate;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
+import eu.svjatoslav.sixth.e3d.math.GeometryCoordinate;
+import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator;
import java.util.concurrent.atomic.AtomicInteger;
import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator;
import java.util.concurrent.atomic.AtomicInteger;
@@
-21,8
+21,8
@@
public abstract class AbstractCoordinateShape extends AbstractShape {
public static final AtomicInteger lastShapeId = new AtomicInteger();
public final int shapeId;
public static final AtomicInteger lastShapeId = new AtomicInteger();
public final int shapeId;
+ public final GeometryCoordinate[] coordinates;
public double onScreenZ;
public double onScreenZ;
- public GeometryCoordinate[] coordinates;
public AbstractCoordinateShape(final int pointsCount) {
coordinates = new GeometryCoordinate[pointsCount];
public AbstractCoordinateShape(final int pointsCount) {
coordinates = new GeometryCoordinate[pointsCount];
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
index
c33ceb7
..
fe44afc
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
@@
-9,9
+9,9
@@
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
-import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
+import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator;
public abstract class AbstractShape {
import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator;
public abstract class AbstractShape {
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
index
4d2bb1f
..
8cec310
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
@@
-19,7
+19,7
@@
import eu.svjatoslav.sixth.e3d.renderer.raster.texture.TextureBitmap;
public class ForwardOrientedTexture extends AbstractCoordinateShape {
private static final double SIZE_MULTIPLIER = 0.005;
public class ForwardOrientedTexture extends AbstractCoordinateShape {
private static final double SIZE_MULTIPLIER = 0.005;
- public Texture texture;
+ public
final
Texture texture;
private double scale;
public ForwardOrientedTexture(final Point3D point, final double scale,
private double scale;
public ForwardOrientedTexture(final Point3D point, final double scale,
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java
index
8b37068
..
2727a17
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java
@@
-20,7
+20,7
@@
import java.util.WeakHashMap;
public class GlowingPoint extends ForwardOrientedTexture {
private static final int TEXTURE_SIZE = 50;
public class GlowingPoint extends ForwardOrientedTexture {
private static final int TEXTURE_SIZE = 50;
- private static final Set<GlowingPoint> glowingPoints = Collections.newSetFromMap(new WeakHashMap<
GlowingPoint, Boolean
>());
+ private static final Set<GlowingPoint> glowingPoints = Collections.newSetFromMap(new WeakHashMap<>());
private final Color color;
public GlowingPoint(final Point3D point, final double pointSize,
private final Color color;
public GlowingPoint(final Point3D point, final double pointSize,
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java
index
45d5b96
..
18058d8
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java
@@
-33,12
+33,8
@@
public class LineInterpolator implements Comparable<LineInterpolator> {
if (absoluteHeight > o.absoluteHeight)
return -1;
if (absoluteHeight > o.absoluteHeight)
return -1;
- if (width < o.width)
- return 1;
- if (width > o.width)
- return -1;
+ return Integer.compare(o.width, width);
- return 0;
}
@Override
}
@Override
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java
index
674c1e3
..
2c38a9a
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java
@@
-17,7
+17,6
@@
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.Line;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas;
-import java.io.IOException;
import java.util.List;
public class Graph extends AbstractCompositeShape {
import java.util.List;
public class Graph extends AbstractCompositeShape {
@@
-32,7
+31,7
@@
public class Graph extends AbstractCompositeShape {
private final Color plotColor;
public Graph(final double scale, final List<Point2D> data,
private final Color plotColor;
public Graph(final double scale, final List<Point2D> data,
- final String label, final Point3D location)
throws IOException
{
+ final String label, final Point3D location) {
super(location);
width = 20;
super(location);
width = 20;
@@
-49,7
+48,7
@@
public class Graph extends AbstractCompositeShape {
plotColor = new Color(255, 0, 0, 100);
addVerticalLines(scale);
plotColor = new Color(255, 0, 0, 100);
addVerticalLines(scale);
- addX
l
abels(scale);
+ addX
L
abels(scale);
addHorizontalLinesAndLabels(scale);
plotData(scale, data);
addHorizontalLinesAndLabels(scale);
plotData(scale, data);
@@
-62,8
+61,7
@@
public class Graph extends AbstractCompositeShape {
addShape(labelCanvas);
}
addShape(labelCanvas);
}
- public void addHorizontalLinesAndLabels(final double scale)
- throws IOException {
+ private void addHorizontalLinesAndLabels(final double scale) {
for (double y = yMin; y <= yMax; y += verticalStep) {
final Point3D p1 = new Point3D(0, y, 0).scaleUp(scale);
for (double y = yMin; y <= yMax; y += verticalStep) {
final Point3D p1 = new Point3D(0, y, 0).scaleUp(scale);
@@
-86,7
+84,7
@@
public class Graph extends AbstractCompositeShape {
}
}
}
}
- p
ublic
void addVerticalLines(final double scale) {
+ p
rivate
void addVerticalLines(final double scale) {
for (double x = 0; x <= width; x += horizontalStep) {
final Point3D p1 = new Point3D(x, yMin, 0).scaleUp(scale);
for (double x = 0; x <= width; x += horizontalStep) {
final Point3D p1 = new Point3D(x, yMin, 0).scaleUp(scale);
@@
-99,7
+97,7
@@
public class Graph extends AbstractCompositeShape {
}
}
}
}
- p
ublic void addXlabels(final double scale) throws IOException
{
+ p
rivate void addXLabels(final double scale)
{
for (double x = 0; x <= width; x += horizontalStep * 2) {
final Point3D labelLocation = new Point3D(x, yMin - 0.4, 0)
.scaleUp(scale);
for (double x = 0; x <= width; x += horizontalStep * 2) {
final Point3D labelLocation = new Point3D(x, yMin - 0.4, 0)
.scaleUp(scale);
@@
-112,7
+110,7
@@
public class Graph extends AbstractCompositeShape {
}
}
}
}
- p
ublic
void plotData(final double scale, final List<Point2D> data) {
+ p
rivate
void plotData(final double scale, final List<Point2D> data) {
Point3D previousPoint = null;
for (final Point2D point : data) {
Point3D previousPoint = null;
for (final Point2D point : data) {
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java
index
7d2ae4c
..
aa7c30e
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java
@@
-10,11
+10,11
@@
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.math.Transform;
-import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.UserRelativityTracker;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.UserRelativityTracker;
import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
+import eu.svjatoslav.sixth.e3d.math.Transform;
+import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
@@
-153,7
+153,7
@@
public class AbstractCompositeShape extends AbstractShape {
}
public void setGroupForUngrouped(final String groupIdentifier) {
}
public void setGroupForUngrouped(final String groupIdentifier) {
- originalSubShapes.stream().filter(
subShape -> subShape.isUngrouped()
).forEach(subShape -> subShape.setGroup(groupIdentifier));
+ originalSubShapes.stream().filter(
SubShape::isUngrouped
).forEach(subShape -> subShape.setGroup(groupIdentifier));
}
@Override
}
@Override
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
index
956cf2c
..
737a5b8
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java
@@
-10,10
+10,10
@@
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.math.Transform;
-import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.TextPointer;
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.gui.TextPointer;
+import eu.svjatoslav.sixth.e3d.math.Transform;
+import eu.svjatoslav.sixth.e3d.math.TransformPipe;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.TexturedRectangle;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.TexturedRectangle;