Skip to content

Commit

Permalink
Revert "Orientation cube using JCSG (winder#2631)"
Browse files Browse the repository at this point in the history
This reverts commit 4eeb0cc.
  • Loading branch information
breiler committed Oct 30, 2024
1 parent 0c97326 commit e21f23f
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 346 deletions.
76 changes: 0 additions & 76 deletions ugs-platform/ugs-platform-visualizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@
<publicPackage>com.willwinder.ugs.nbm.visualizer.shared</publicPackage>
<publicPackage>com.willwinder.ugs.nbm.visualizer.options</publicPackage>
<publicPackage>com.willwinder.ugs.nbm.visualizer.renderables</publicPackage>
<publicPackage>org.apache.commons.io</publicPackage>
<publicPackage>javax.xml.datatype</publicPackage>
<publicPackage>org.w3c.dom</publicPackage>
<publicPackage>org.w3c.dom.ls</publicPackage>
<publicPackage>org.xml.sax</publicPackage>
<publicPackage>javax.xml.parsers</publicPackage>
<publicPackage>org.w3c.dom.bootstrap</publicPackage>
<publicPackage>org.xml.sax.helpers</publicPackage>
<publicPackage>com.jogamp.opengl</publicPackage>
</publicPackages>
</configuration>
</plugin>
Expand Down Expand Up @@ -107,72 +98,5 @@
<artifactId>ugs-platform-ugscore</artifactId>
<version>${project.version}</version>
</dependency>

<!-- For creating Constructive Solid Geometry -->
<dependency>
<groupId>com.neuronrobotics</groupId>
<artifactId>JavaCad</artifactId>
<version>1.8.8</version>
</dependency>
<dependency>
<groupId>eu.mihosoft.vvecmath</groupId>
<artifactId>vvecmath</artifactId>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>17.0.8</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>17.0.8</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.9</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.9</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>17.0.9</version>
</dependency>

<!-- For geometric operations -->
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
<version>${jts.version}</version>
</dependency>

<!-- For reading SVG -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-all</artifactId>
<version>${batik.version}</version>
</dependency>
<dependency>
<groupId>javax.vecmath</groupId>
<artifactId>vecmath</artifactId>
<version>1.5.2</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ This file is part of Universal Gcode Sender (UGS).
public class RendererInputHandler implements
WindowListener, MouseWheelListener, MouseMotionListener,
MouseListener, KeyListener, PreferenceChangeListener, UGSEventListener {
private final int highFps;
private final int lowFps;
private static final int HIGH_FPS = 15;
private static final int LOW_FPS = 4;
private final GcodeRenderer gcodeRenderer;
private final AnimatorBase animator;
private final BackendAPI backend;
Expand All @@ -76,13 +76,11 @@ public class RendererInputHandler implements
private Position selectionStart = null;
private Position selectionEnd = null;

public RendererInputHandler(GcodeRenderer gr, AnimatorBase a, BackendAPI backend, int lowFps, int highFps) {
public RendererInputHandler(GcodeRenderer gr, AnimatorBase a, BackendAPI backend) {
gcodeRenderer = gr;
animator = a;
this.backend = backend;
settings = backend.getSettings();
this.highFps = highFps;
this.lowFps = lowFps;

gcodeModel = new GcodeModel(Localization.getString("platform.visualizer.renderable.gcode-model"), backend);
sizeDisplay = new SizeDisplay(Localization.getString("platform.visualizer.renderable.gcode-model-size"));
Expand Down Expand Up @@ -273,7 +271,7 @@ public void mouseClicked(MouseEvent e) {
*/
@Override
public void mousePressed(MouseEvent e) {
setFPS(highFps);
setFPS(HIGH_FPS);
// Zoom
if (e.getButton() == MouseEvent.BUTTON1 && e.isMetaDown()) {
selecting = true;
Expand All @@ -284,7 +282,7 @@ public void mousePressed(MouseEvent e) {

@Override
public void mouseReleased(MouseEvent e) {
setFPS(lowFps);
setFPS(LOW_FPS);

// Finish selecting.
if (selecting) {
Expand Down Expand Up @@ -319,7 +317,7 @@ public void keyTyped(KeyEvent ke) {
*/
@Override
public void keyPressed(KeyEvent ke) {
setFPS(highFps);
setFPS(HIGH_FPS);

int DELTA_SIZE = 1;

Expand Down Expand Up @@ -360,7 +358,7 @@ public void keyPressed(KeyEvent ke) {
*/
@Override
public void keyReleased(KeyEvent ke) {
setFPS(lowFps);
setFPS(LOW_FPS);
}

public void dispose() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This file is part of Universal Gcode Sender (UGS).
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLException;
import com.jogamp.opengl.util.FPSAnimator;
import com.jogamp.opengl.util.Animator;
import com.willwinder.ugs.nbm.visualizer.RendererInputHandler;
import com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions;
import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_NEWT_SAMPLES;
Expand Down Expand Up @@ -134,8 +134,8 @@ private NewtCanvasAWT makeWindow() throws GLException {
lock.lock();
lock.unlock();

FPSAnimator animator = new FPSAnimator(glWindow, 60);
this.rih = new RendererInputHandler(renderer, animator, backend, 30, 60);
Animator animator = new Animator(glWindow);
this.rih = new RendererInputHandler(renderer, animator, backend);

Preferences pref = NbPreferences.forModule(VisualizerOptionsPanel.class);
pref.addPreferenceChangeListener(this.rih);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private GLJPanel makeWindow() throws GLException {
}

FPSAnimator animator = new FPSAnimator(p, 15);
this.rih = new RendererInputHandler(renderer, animator, backend, 4, 15);
this.rih = new RendererInputHandler(renderer, animator, backend);

Preferences pref = NbPreferences.forModule(VisualizerOptionsPanel.class);
pref.addPreferenceChangeListener(this.rih);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@ This file is part of Universal Gcode Sender (UGS).

import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import com.jogamp.opengl.GLAutoDrawable;
import com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions;
import com.willwinder.ugs.nbm.visualizer.shader.PlainShader;
import com.willwinder.ugs.nbm.visualizer.shared.VertexObjectRenderable;
import com.willwinder.universalgcodesender.model.Position;

import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_GRID;
import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_X;
import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_XY_GRID;
import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_Y;
import static com.willwinder.ugs.nbm.visualizer.options.VisualizerOptions.VISUALIZER_OPTION_Z;
import com.willwinder.ugs.nbm.visualizer.shared.VertexObjectRenderable;
import com.willwinder.universalgcodesender.model.Position;

/**
* @author wwinder
Expand All @@ -42,7 +39,7 @@ public class Grid extends VertexObjectRenderable {
private float[] zAxisColor;

public Grid(String title) {
super(6, title, VISUALIZER_OPTION_GRID, new PlainShader());
super(6, title, VISUALIZER_OPTION_GRID);
reloadPreferences(new VisualizerOptions());
}

Expand All @@ -56,8 +53,7 @@ public final void reloadPreferences(VisualizerOptions vo) {
}

@Override
public void render(GLAutoDrawable drawable) {
GL2 gl = drawable.getGL().getGL2();
public void render(GL2 gl) {
gl.glLineWidth(1.2f);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glDrawArrays(GL.GL_LINES, 0, getVertexCount());
Expand Down
Loading

0 comments on commit e21f23f

Please sign in to comment.