diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java index fb404fe4..7711f090 100644 --- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java +++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java @@ -319,9 +319,10 @@ public class AxisLabelProcessor { view.getPainter().getTextLengthInPixels(axisLayout.getFont(), verticalAxisLabel); // hack the emulgl vertical Y axis case by ignoring pixel scale for text - if (isEmulGL) + if (isEmulGL) { textLength /= pixelScale.y; - + } + // move the text next to its anchor point, since it has been rotated // from the text center and not from the anchor point that is on the // right most letter side. diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java index 373ebff7..7ce221ba 100644 --- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java +++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java @@ -329,6 +329,8 @@ public class AxisTickProcessor { drawAxisTickNumericLabel(painter, dimension, color, hAlign, vAlign, ticksTxtBounds, tickLabel, tickLabelPosition); + //System.out.println(tickLabelPosition); + // Draw the tick line if (layout.isTickLineDisplayed()) { drawTickLine(painter, color, tickStartPosition, tickLabelPosition); diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/Camera.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/Camera.java index fa092dbc..819fe0f9 100644 --- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/Camera.java +++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/Camera.java @@ -5,8 +5,8 @@ import java.util.List; import java.util.Vector; import java.util.function.Predicate; import org.jzy3d.colors.Color; +import org.jzy3d.maths.Array; import org.jzy3d.maths.BoundingBox2d; -import org.jzy3d.maths.Coord2d; import org.jzy3d.maths.Coord3d; import org.jzy3d.maths.PolygonArray; import org.jzy3d.painters.IPainter; @@ -372,10 +372,19 @@ public class Camera extends AbstractViewportManager { int viewport[] = painter.getViewPortAsInt(); float modelView[] = painter.getModelViewAsFloat(); float projection[] = painter.getProjectionAsFloat(); + + //Array.print("Camera.screenToModel : viewport : ", viewport); + //Array.print("Camera.screenToModel : modelView : ", modelView); + //Array.print("Camera.screenToModel : projection : ", projection); + + //double modelView[] = painter.getModelViewAsDouble(); + //double projection[] = painter.getProjectionAsDouble(); float worldcoord[] = new float[3];// wx, wy, wz;// returned xyz coords boolean s = painter.gluUnProject(screen.x, screen.y, screen.z, modelView, 0, projection, 0, viewport, 0, worldcoord, 0); + + if (!s) failedProjection("Could not retrieve screen coordinates in model."); diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java index 0ee770f4..c933b1da 100644 --- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java +++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java @@ -992,6 +992,16 @@ public class View { } else throw new RuntimeException("Unsupported ViewMode: " + viewmode); } + + /*protected Coord3d computeCameraEyeXZ_DEBUG(Coord3d viewpoint, Coord3d target) { + Coord3d eye = viewpoint; + //eye.x = AZIMUTH_FACING_X_DECREASING; // facing X so that value decrease + eye.x = AZIMUTH_FACING_X_INCREASING; // facing X so that value increase + eye.y = ELEVATION_0 + 0.0001f; // on side + eye = eye.cartesian().add(target); + return eye; + }*/ + protected Coord3d computeCameraEyeFree(Coord3d viewpoint, Coord3d target) { return viewpoint.cartesian().add(target); @@ -1023,6 +1033,13 @@ public class View { //eye.x = AZIMUTH_FACING_Y_DECREASING; // facing Y so that value decrease eye.x = AZIMUTH_FACING_Y_INCREASING; // facing Y so that value decrease eye.y = ELEVATION_0; // on side + + // see https://github.com/jzy3d/jzy3d-api/issues/286 + if(!canvas.isNative() && JGL_INVERSE_MATRIX_WORKAROUND) { + eye.x += 0.01f; + eye.y += 0.01f; + } + eye = eye.cartesian().add(target); return eye; } @@ -1032,9 +1049,17 @@ public class View { //eye.x = AZIMUTH_FACING_X_DECREASING; // facing X so that value decrease eye.x = AZIMUTH_FACING_X_INCREASING; // facing X so that value increase eye.y = ELEVATION_0; // on side + + // see https://github.com/jzy3d/jzy3d-api/issues/286 + if(!canvas.isNative() && JGL_INVERSE_MATRIX_WORKAROUND) { + eye.y += 0.0001f; + } + eye = eye.cartesian().add(target); return eye; } + + protected boolean JGL_INVERSE_MATRIX_WORKAROUND = true; protected void triggerCameraUpEvents(Coord3d viewpoint) { diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java index 478ee302..cc45c001 100644 --- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java +++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java @@ -212,8 +212,6 @@ public class View2DProcessing { marginBottomPx += horizontalAxisDistance; marginBottomPx += axisTextHeight; - //System.err.println("V2DProc : axisTextHeight : " + axisTextHeight + " tickHeight " + tickTextHeight + " H tick " + horizontalTickDistance + " H axis " + horizontalAxisDistance + " BOTTOM = " + marginBottomPx); - //System.err.println("V2DProc : axisTextWidth : " + axisTextWidth + " tickWidth " + tickTextWidth); // --------------------------------------------------- // case of a symetric layout requirement @@ -241,7 +239,6 @@ public class View2DProcessing { for(ILegend legend: legends) { legend.updateMinimumDimension(painter); Dimension minDim = legend.getMinimumDimension(); - //System.out.println("View2DProcessing minDim " + minDim.width); marginRightPx += minDim.width; } } diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java index ccdd9462..e91c81bf 100644 --- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java +++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java @@ -68,7 +68,8 @@ public class TextRenderer extends AbstractTextRenderer implements ITextRenderer // process the aligned position in 3D coordinates Coord3d positionAligned = to3D(painter, screenAligned); - + + // process space stransform if any (log, etc) if (spaceTransformer != null) { positionAligned = spaceTransformer.compute(positionAligned); diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java index 24880151..7a4121ff 100644 --- a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java +++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java @@ -1016,6 +1016,9 @@ public class EmulGLPainter extends AbstractPainter implements IPainter { double objX[] = new double[1]; double objY[] = new double[1]; double objZ[] = new double[1]; + + //Array.print("EmulGL Painter : ", proj); + //Array.print("EmulGL Painter : ", dbl(proj)); boolean st = glu.gluUnProject(winX, winY, winZ, dbl(model), dbl(proj), view, objX, objY, objZ); @@ -1027,6 +1030,26 @@ public class EmulGLPainter extends AbstractPainter implements IPainter { return st; } + //@Override + public boolean gluUnProject(float winX, float winY, float winZ, double[] model, int model_offset, + double[] proj, int proj_offset, int[] view, int view_offset, float[] objPos, + int objPos_offset) { + // throw new NotImplementedException(); + + double objX[] = new double[1]; + double objY[] = new double[1]; + double objZ[] = new double[1]; + + boolean st = glu.gluUnProject(winX, winY, winZ, model, + proj, view, objX, objY, objZ); + + objPos[0] = (float) objX[0]; + objPos[1] = (float) objY[0]; + objPos[2] = (float) objZ[0]; + + return st; + } + protected double[] dbl(float[] values) { double[] dbl = new double[values.length]; for (int i = 0; i < values.length; i++) { diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java index 8e5e23fe..f2bff547 100644 --- a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java +++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java @@ -121,11 +121,4 @@ public class EmulGLViewAndColorbarsLayout extends ViewAndColorbarsLayout { } } } - - /*public boolean isFixHiDPI() { - return fixHiDPI; - } - public void setFixHiDPI(boolean fixHiDPI) { - this.fixHiDPI = fixHiDPI; - }*/ } diff --git a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/GL.java b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/GL.java index ce00e304..6f767fe1 100644 --- a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/GL.java +++ b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/GL.java @@ -86,7 +86,7 @@ public abstract class GL { protected List pixelScaleListeners = new ArrayList<>(); public GL() {} - + public void setThrowExceptionOnGLError(boolean status) { this.CC.setThrowExceptionOnGLError(status); } @@ -129,12 +129,18 @@ public abstract class GL { return desiredHeight; } - /** Return the actual width, which is {@link #getDesiredWidth()} multiplied by {@link #getPixelScaleX()}*/ + /** + * Return the actual width, which is {@link #getDesiredWidth()} multiplied by + * {@link #getPixelScaleX()} + */ public int getActualWidth() { return actualWidth; } - /** Return the actual width, which is {@link #getDesiredHeight()} multiplied by {@link #getPixelScaleY()}*/ + /** + * Return the actual width, which is {@link #getDesiredHeight()} multiplied by + * {@link #getPixelScaleY()} + */ public int getActualHeight() { return actualHeight; } @@ -142,11 +148,11 @@ public abstract class GL { /* ******************** PROVIDE IMAGE ********************/ public void glShadeModel(int mode) { - if(CC.Mode != None) { - CC.gl_error(GL_INVALID_OPERATION, "glShadeModel"); - return; - } - CC.gl_shade_model(mode); + if (CC.Mode != None) { + CC.gl_error(GL_INVALID_OPERATION, "glShadeModel"); + return; + } + CC.gl_shade_model(mode); } @@ -242,13 +248,12 @@ public abstract class GL { return shiftHorizontally; } - /** - * Allows shifting the image of the 3d scene and all images that have been append with - * {@link #appendImageToDraw(Object)} - * - * @param shift - * to the right if value is positive, to the left if the value is negative. - */ + /** + * Allows shifting the image of the 3d scene and all images that have been append with + * {@link #appendImageToDraw(Object)} + * + * @param shift to the right if value is positive, to the left if the value is negative. + */ public void setShiftHorizontally(int shiftHorizontally) { this.shiftHorizontally = shiftHorizontally; } @@ -271,10 +276,10 @@ public abstract class GL { return useOSFontRendering; } - /** - * If true, will use the OS for font rendering of all texts that have been append with - * {@link #appendTextToDraw(Object, String, int, int)} otherwise use a JVM based font rendering. - */ + /** + * If true, will use the OS for font rendering of all texts that have been append with + * {@link #appendTextToDraw(Object, String, int, int)} otherwise use a JVM based font rendering. + */ public void setUseOSFontRendering(boolean useOSFontRendering) { this.useOSFontRendering = useOSFontRendering; } @@ -298,25 +303,24 @@ public abstract class GL { FOREGROUND, BACKGROUND } - public void appendImageToDraw(ImageType image) { + public void appendImageToDraw(ImageType image) { - appendImageToDraw(image, 0, 0); - } + appendImageToDraw(image, 0, 0); + } - public void appendImageToDraw(ImageType image, int x, int y) { + public void appendImageToDraw(ImageType image, int x, int y) { + appendImageToDraw(image, x, y, ImageLayer.BACKGROUND); + } - appendImageToDraw(image, x, y, ImageLayer.BACKGROUND); - } + public void appendImageToDraw(ImageType image, int x, int y, ImageLayer layer) { - public void appendImageToDraw(ImageType image, int x, int y, ImageLayer layer) { + synchronized (imageToDraw) { + imageToDraw.add(new ImageToDraw<>(x, y, image, layer)); + // System.out.println(imageToDraw.size() + " images to draw"); + } + } - synchronized(imageToDraw) { - imageToDraw.add(new ImageToDraw<>(x, y, image, layer)); - // System.out.println(imageToDraw.size() + " images to draw"); - } - } - - public abstract ImageType getRenderedImage(); + public abstract ImageType getRenderedImage(); public void clearImagesBuffer() { synchronized (imageToDraw) { @@ -328,32 +332,34 @@ public abstract class GL { - /** - * To be called by {@link GLUT#glutBitmapString(Object, String, float, float)} to append text to a - * list of text to render at {@link GL#glFlush()} step. - */ - public void appendTextToDraw(FontType font, String string, int x, int y) { + /** + * To be called by {@link GLUT#glutBitmapString(Object, String, float, float)} to append text to a + * list of text to render at {@link GL#glFlush()} step. + */ + public void appendTextToDraw(FontType font, String string, int x, int y) { synchronized (textsToDraw) { - textsToDraw.add(new TextToDraw<>(font, string, x, y)); + //System.out.println("GL:appendText : " + x+ " " + y); + + textsToDraw.add(new TextToDraw<>(font, string, x, y)); } } - /** - * To be called by {@link GLUT#glutBitmapString(Object, String, float, float)} to append text to a - * list of text to render at {@link GL#glFlush()} step. - */ - public void appendTextToDraw(FontType font, String string, int x, int y, float r, float g, float b, - float rotate) { + /** + * To be called by {@link GLUT#glutBitmapString(Object, String, float, float)} to append text to a + * list of text to render at {@link GL#glFlush()} step. + */ + public void appendTextToDraw(FontType font, String string, int x, int y, float r, float g, + float b, float rotate) { synchronized (textsToDraw) { - textsToDraw.add(new TextToDraw<>(font, string, x, y, r, g, b, rotate)); + textsToDraw.add(new TextToDraw<>(font, string, x, y, r, g, b, rotate)); + } + } + + public void clearTextToDraw() { + synchronized (textsToDraw) { + textsToDraw.clear(); // empty text buffer } } - - public void clearTextToDraw() { - synchronized (textsToDraw) { - textsToDraw.clear(); // empty text buffer - } - } /** @@ -540,8 +546,8 @@ public abstract class GL { case GL_INT: case GL_UNSIGNED_INT: case GL_4_BYTES: - return (lists[n << 2]) << 24 | (lists[(n << 2) | 1]) << 16 - | (lists[(n << 2) | 2]) << 8 | (lists[(n << 2) | 3]); + return (lists[n << 2]) << 24 | (lists[(n << 2) | 1]) << 16 | (lists[(n << 2) | 2]) << 8 + | (lists[(n << 2) | 3]); case GL_FLOAT: return (int) ((lists[n << 2]) * 16777216.0f + (lists[(n << 2) | 1]) * 65536.0f + (lists[(n << 2) | 2]) * 256.0f + (lists[(n << 2) | 3])); @@ -1830,7 +1836,8 @@ public abstract class GL { /** GLvoid glBegin (GLenum mode) */ public void glBegin(int mode) { if (CC.Mode != None) { - CC.gl_error(GL_INVALID_OPERATION, "glBegin can not be called as a geometry is already in progress : " + CC.Mode); + CC.gl_error(GL_INVALID_OPERATION, + "glBegin can not be called as a geometry is already in progress : " + CC.Mode); return; } switch (mode) { @@ -1850,8 +1857,9 @@ public abstract class GL { CC.gl_error(GL.GL_INVALID_ENUM, "glBegin(mode)"); } } - - static final String NEED_GL_BEGIN = " is called while no geometry was initialized with glBegin(geom)."; + + static final String NEED_GL_BEGIN = + " is called while no geometry was initialized with glBegin(geom)."; /** GLvoid glEnd (GLvoid) */ public void glEnd() { @@ -6370,7 +6378,7 @@ public abstract class GL { public static final int GLX_BAD_CONTEXT = 5; public static final int GLX_BAD_VALUE = 6; public static final int GLX_BAD_ENUM = 7; - /* Constant of GLE */ - public static final int GL_PHONG = GL_SMOOTH + 1; + /* Constant of GLE */ + public static final int GL_PHONG = GL_SMOOTH + 1; } diff --git a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLU.java b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLU.java index e42f56fd..091b07b0 100644 --- a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLU.java +++ b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLU.java @@ -17,7 +17,7 @@ package jgl.wt.awt; import java.lang.reflect.InvocationTargetException; - +import java.util.Arrays; import jgl.glu.GLUnurbsObj; import jgl.glu.GLUquadricObj; @@ -203,6 +203,21 @@ public class GLU { - d1 * det33(a2, a3, a4, b2, b3, b4, c2, c3, c4)); } + private double det44_row(double[] m) { + return det44(m[0], m[1], m[2], m[3], + m[4], m[5], m[6], m[7], + m[8], m[9], m[10], m[11], + m[12], m[13], m[14], m[15]); + } + + private double det44_col(double[] m) { + return det44(m[0], m[4], m[8], m[12], + m[1], m[5], m[9], m[13], + m[2], m[6], m[10], m[14], + m[3], m[7], m[11], m[15]); + } + + private double[] adjoint44(double a[]) { double m[] = new double[16]; m[0] = det33(a[5], a[6], a[7], a[9], a[10], a[11], a[13], a[14], a[15]); @@ -233,12 +248,22 @@ public class GLU { for (int i = 0; i < 4; i++) { out[4 * i + i] = 1; } + + //print("Identity:", out, 4); - for (int i = 0; i < 4; i++) { - double d = a[4 * i + i]; + // over rows + for (int i = 0; i < 4; i++) { + + // diagonal element : (0,0), (1,1), (2,2) or (3,3) + double d = a[4 * i + i]; + + //System.out.println(" inversing : with d=" + d); + if (d != 1) { for (int j = 0; j < 4; j++) { + out[4 * i + j] /= d; + a[4 * i + j] /= d; } } @@ -250,12 +275,14 @@ public class GLU { for (int k = 0; k < 4; k++) { a[4 * j + k] -= mult * a[4 * i + k]; out[4 * j + k] -= mult * out[4 * i + k]; + } } } - } } + + //print("Inversed:", out, 4); return out; } @@ -271,6 +298,39 @@ public class GLU { } return temp; } + + public static void print(double input[][]) { + for (int i = 0; i < input.length; i++) { + for (int j = 0; j < input[i].length; j++) { + System.out.print(input[i][j] + "\t"); + } + System.out.println(); + } + } + + public static void print(String info, double input[][]) { + System.out.print(info); + print(input); + } + + public static void print(double input[], int width) { + int k=0; + for (int i = 0; i < input.length; i++) { + System.out.print(input[i] + "\t"); + k++; + if(k%width==0) { + System.out.println(); + } + //System.out.println(); + } + } + + public static void print(String info, double input[], int width) { + System.out.println(info); + print(input, width); + } + + public GL gluGetGL() { return JavaGL; @@ -384,6 +444,11 @@ public class GLU { A = mulMatrix44(proj, model); m = inverseMatrix44(A); + // Culprit: this result may contains NaN values + // https://github.com/jzy3d/jzy3d-api/issues/286 + // + //print("m = inverse(A)", m, 4); + out = mulMatrix41(m, in); if (out[3] == 0) return false; @@ -391,6 +456,7 @@ public class GLU { objx[0] = out[0] / out[3]; objy[0] = out[1] / out[3]; objz[0] = out[2] / out[3]; + return true; } diff --git a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLUT.java b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLUT.java index c40f0b9c..147e577d 100644 --- a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLUT.java +++ b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GLUT.java @@ -154,6 +154,7 @@ public class GLUT implements Runnable { */ public void glutBitmapString(Font font, String string, float x, float y, float z, float r, float g, float b, float rotate) { + //System.out.println("GLUT.glutBimap " + x + " " + y + " " + z); double[] win = modelToScreen(x, y, z); double winX = win[0]; @@ -171,10 +172,11 @@ public class GLUT implements Runnable { double winz[] = new double[1]; if (!JavaGLU.gluProject(x, y, z, getModelViewAsDouble(), getProjectionAsDouble(), viewport, - winx, winy, winz)) + winx, winy, winz)) { System.err.println("GLUT.modelToScreen : Could not retrieve model coordinates in screen for " + x + ", " + y + ", " + z); - + } + double[] win = new double[3]; win[0] = winx[0]; win[1] = winy[0]; diff --git a/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md b/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md index c21a1b20..c1514b3d 100644 --- a/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md +++ b/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md @@ -3,8 +3,8 @@ jzy3d-test-java9-generated This is a summary of existing baseline images for tests, which was generated on * OS Name : mac os x * OS Version : 11.4 -* Java Version : 17-panama -* CPU : x86_64 +* Java Version : 17.0.1 +* CPU : aarch64 * GPU : AppleM1 # Surface @@ -83,7 +83,7 @@ This is a summary of existing baseline images for tests, which was generated on -Diff chart:

Actual chart:

Zoom on error:

Following tests of the same section have been skipped. + @@ -115,7 +115,7 @@ This is a summary of existing baseline images for tests, which was generated on -Diff chart:

Actual chart:

Zoom on error:

Following tests of the same section have been skipped. + @@ -139,7 +139,7 @@ This is a summary of existing baseline images for tests, which was generated on -Diff chart:

Actual chart:

Zoom on error:

Following tests of the same section have been skipped. + @@ -167,7 +167,7 @@ This is a summary of existing baseline images for tests, which was generated on -Diff chart:

Actual chart:

Zoom on error:

Following tests of the same section have been skipped. + @@ -176,7 +176,7 @@ This is a summary of existing baseline images for tests, which was generated on -# 2D_Colorbar +# 2D_Colorbar : View=XY @@ -187,12 +187,68 @@ This is a summary of existing baseline images for tests, which was generated on - - - - - - + + + + + + + + + + + + + + + +
Native_AWT HiDPI:ONEmulGL_AWT HiDPI:OFF
+ +# 2D_Colorbar : View=XZ + + + + + + + + + + + + + + + + + + + + + + + + + +
Native_AWT HiDPI:ONNative_AWT HiDPI:OFFNative_Swing HiDPI:ONNative_Swing HiDPI:OFFEmulGL_AWT HiDPI:ONEmulGL_AWT HiDPI:OFF
+ +# 2D_Colorbar : View=YZ + + + + + + + + + + + + + + + + @@ -228,7 +284,7 @@ This is a summary of existing baseline images for tests, which was generated on - + @@ -485,7 +541,7 @@ This is a summary of existing baseline images for tests, which was generated on - +
Native_AWT HiDPI:ONNative_AWT HiDPI:OFFNative_Swing HiDPI:ONNative_Swing HiDPI:OFFEmulGL_AWT HiDPI:ONEmulGL_AWT HiDPI:OFF
Diff chart:

Actual chart:

Zoom on error:

Following tests of the same section have been skipped.
Diff chart:

Actual chart:

Zoom on error:

Following tests of the same section have been skipped.
@@ -543,7 +599,7 @@ This is a summary of existing baseline images for tests, which was generated on -Diff chart:

Actual chart:

Zoom on error:

Following tests of the same section have been skipped. + diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java index ab16e324..fb1c84b1 100644 --- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java +++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java @@ -109,7 +109,9 @@ public class ITTest { section(sb, "Colorbar", "IsModifiedByCustomFont", null); //section(sb, "Colorbar", "HasMinimumWidth", null); - section(sb, "2D_Colorbar"); + section(sb, "2D_Colorbar", "View"+KV+"XY", null); + section(sb, "2D_Colorbar", "View"+KV+"XZ", null); + section(sb, "2D_Colorbar", "View"+KV+"YZ", null); // 2D tests line(sb, "# 2D Layout"); diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D_Colorbar.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D_Colorbar.java index d887ee10..81075fc5 100644 --- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D_Colorbar.java +++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D_Colorbar.java @@ -14,23 +14,21 @@ import org.jzy3d.plot2d.rendering.AWTGraphicsUtils; import org.jzy3d.plot3d.primitives.SampleGeom; import org.jzy3d.plot3d.primitives.Shape; import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout; -import org.jzy3d.plot3d.primitives.axis.layout.LabelOrientation; import org.jzy3d.plot3d.primitives.axis.layout.fonts.HiDPIProportionalFontSizePolicy; import org.jzy3d.plot3d.primitives.axis.layout.providers.RegularTickProvider; import org.jzy3d.plot3d.primitives.axis.layout.renderers.DefaultDecimalTickRenderer; -import org.jzy3d.plot3d.rendering.canvas.Quality; import org.jzy3d.plot3d.rendering.legends.colorbars.AWTColorbarLegend; import org.jzy3d.plot3d.rendering.legends.overlay.LegendLayout; import org.jzy3d.plot3d.rendering.view.AWTImageRenderer; import org.jzy3d.plot3d.rendering.view.AWTView; import org.jzy3d.plot3d.rendering.view.HiDPI; +import org.jzy3d.plot3d.rendering.view.View2D; import org.jzy3d.plot3d.rendering.view.View2DLayout; import org.jzy3d.plot3d.rendering.view.View2DLayout_Debug; -import org.jzy3d.tests.integration.ITTest.WT; public class ITTest_2D_Colorbar extends ITTest { public static void main(String[] args) { - open(new ITTest_2D_Colorbar().when2DChartWithColorbarAndMargins(WT.EmulGL_AWT, HiDPI.ON)); + open(new ITTest_2D_Colorbar().when2DChartWithColorbarAndMargins(WT.EmulGL_AWT, HiDPI.ON, View2D.XY)); //open(new ITTest_AxisLabelRotateLayout().whenAxisLabelOrientationNotHorizontal(WT.Native_AWT, HiDPI.ON)); } @@ -38,49 +36,27 @@ public class ITTest_2D_Colorbar extends ITTest { // ---------------------------------------------------- // TEST MULTIPLE AXIS ORIENTATION SETTINGS // ---------------------------------------------------- - - //static String caseAxisRotated = "whenAxisRotated_ThenApplyMargins"; - /*protected static LabelOrientation[] yOrientations = - {LabelOrientation.VERTICAL, LabelOrientation.HORIZONTAL}; - - - @Test - public void whenAxisRotated_ThenApplyMargins() { - System.out.println("ITTest : " + caseAxisRotated); - - forEach((toolkit, resolution) -> whenAxisRotated_ThenApplyMargins(toolkit, resolution)); - }*/ + View2D[] views = {View2D.XY, View2D.XZ, View2D.YZ}; @Test public void when2DChartWithColorbarAndMargins() { System.out.println("ITTest : when2DChartWithColorbarAndMargins"); - forEach((toolkit, resolution) -> when2DChartWithColorbarAndMargins(toolkit, resolution)); + forEach((toolkit, resolution) -> { + for(View2D view2d: views) { + when2DChartWithColorbarAndMargins(toolkit, resolution, view2d); + } + }); } - protected Chart when2DChartWithColorbarAndMargins(WT wt, HiDPI hidpi) { + protected Chart when2DChartWithColorbarAndMargins(WT wt, HiDPI hidpi, View2D viewMode) { // Given a chart with long Y axis name AWTChart chart = (AWTChart)chart(wt, hidpi); - //chart.add(surface()); - //chart.view2d(); - - //AxisLayout axisLayout = chart.getAxisLayout(); - //axisLayout.setYAxisLabel("Y axis longer than usual"); - /*forEach((yOrientation)->{ - // When : vertical orientation - axisLayout.setYAxisLabelOrientation(yOrientation); - - // Then - assertChart(chart, name(ITTest_2D_Colorbar.this, caseAxisRotated, wt, hidpi, properties(yOrientation))); - - });*/ - - - // --------------------------------------- + // --------------------------------------- // CHART CONTENT // --------------------------------------- @@ -201,13 +177,13 @@ public class ITTest_2D_Colorbar extends ITTest { // Enable 2D mode - chart.view2d(); + chart.view2d(viewMode); // Then - assertChart(chart, name(ITTest_2D_Colorbar.this, null, wt, hidpi)); + assertChart(chart, name(ITTest_2D_Colorbar.this, "View"+KV+viewMode, wt, hidpi)); return chart; } diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_EmulGL_AWT_HiDPI=OFF.png deleted file mode 100644 index e014e151..00000000 Binary files a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_EmulGL_AWT_HiDPI=OFF.png and /dev/null differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_EmulGL_AWT_HiDPI=ON.png deleted file mode 100644 index e014e151..00000000 Binary files a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_EmulGL_AWT_HiDPI=ON.png and /dev/null differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_EmulGL_AWT_HiDPI=OFF.png new file mode 100644 index 00000000..ce86b9c1 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_EmulGL_AWT_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_EmulGL_AWT_HiDPI=ON.png new file mode 100644 index 00000000..ce86b9c1 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_EmulGL_AWT_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_AWT_HiDPI=OFF.png similarity index 99% rename from jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_Swing_HiDPI=OFF.png rename to jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_AWT_HiDPI=OFF.png index 15be0809..7ab95ef5 100644 Binary files a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_Swing_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_AWT_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_AWT_HiDPI=ON.png similarity index 99% rename from jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_Swing_HiDPI=ON.png rename to jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_AWT_HiDPI=ON.png index 15be0809..2ce897e1 100644 Binary files a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_Swing_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_AWT_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_Swing_HiDPI=OFF.png similarity index 99% rename from jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_AWT_HiDPI=OFF.png rename to jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_Swing_HiDPI=OFF.png index e6946395..1fae15c4 100644 Binary files a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_AWT_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_Swing_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_Swing_HiDPI=ON.png similarity index 99% rename from jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_AWT_HiDPI=ON.png rename to jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_Swing_HiDPI=ON.png index 7c3a4807..eab05e20 100644 Binary files a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_Native_AWT_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XY_Native_Swing_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_EmulGL_AWT_HiDPI=OFF.png new file mode 100644 index 00000000..efef7085 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_EmulGL_AWT_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_EmulGL_AWT_HiDPI=ON.png new file mode 100644 index 00000000..efef7085 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_EmulGL_AWT_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_AWT_HiDPI=OFF.png new file mode 100644 index 00000000..6a20562f Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_AWT_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_AWT_HiDPI=ON.png new file mode 100644 index 00000000..e60decc1 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_AWT_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_Swing_HiDPI=OFF.png new file mode 100644 index 00000000..529891b6 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_Swing_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_Swing_HiDPI=ON.png new file mode 100644 index 00000000..8f888e32 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=XZ_Native_Swing_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_EmulGL_AWT_HiDPI=OFF.png new file mode 100644 index 00000000..dfa9a092 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_EmulGL_AWT_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_EmulGL_AWT_HiDPI=ON.png new file mode 100644 index 00000000..dfa9a092 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_EmulGL_AWT_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_AWT_HiDPI=OFF.png new file mode 100644 index 00000000..e4baba89 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_AWT_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_AWT_HiDPI=ON.png new file mode 100644 index 00000000..e4baba89 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_AWT_HiDPI=ON.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_Swing_HiDPI=OFF.png new file mode 100644 index 00000000..01d606c9 Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_Swing_HiDPI=OFF.png differ diff --git a/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_Swing_HiDPI=ON.png new file mode 100644 index 00000000..8e09fd2a Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_11.4_AppleM1/2D_Colorbar_View=YZ_Native_Swing_HiDPI=ON.png differ