Skip to content

Commit

Permalink
New orientation cube from JCSG
Browse files Browse the repository at this point in the history
  • Loading branch information
breiler committed Nov 11, 2024
1 parent 8a9e5c6 commit df28189
Show file tree
Hide file tree
Showing 45 changed files with 329 additions and 252 deletions.
18 changes: 12 additions & 6 deletions ugs-platform/ugs-platform-surfacescanner/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.willwinder</groupId>
Expand All @@ -24,11 +25,16 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-api-annotations-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ConnectionBaudRateToolbarActionId)
@ActionRegistration(
iconBase = BaudRateAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ConnectionBaudRateToolbarTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ConnectionBaudRateToolbarTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.CheckModeActionId)
@ActionRegistration(
iconBase = CheckModeAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.CheckModeTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.CheckModeTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ConfigureFirmwareActionId)
@ActionRegistration(
iconBase = ConnectDisconnectAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ConfigureFirmwareActionTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ConfigureFirmwareActionTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ConnectDisconnectActionId)
@ActionRegistration(
iconBase = ConnectDisconnectAction.ICON_BASE_DISCONNECT,
displayName = "resources.MessagesBundle#" + LocalizingService.ConnectDisconnectActionTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ConnectDisconnectActionTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
category = LocalizingService.CATEGORY_TOOLS,
id = "com.willwinder.ugs.nbp.core.actions.CreateShortcutAction")
@ActionRegistration(
displayName = "resources.MessagesBundle#platform.action.createShortcut",
displayName = "resources/MessagesBundle#platform.action.createShortcut",
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
id = LocalizingService.EditMacrosActionId)
@ActionRegistration(
iconBase = EditMacrosAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.EditMacrosTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.EditMacrosTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This file is part of Universal Gcode Sender (UGS).
)
@ActionRegistration(
iconBase = FirmwareAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ConnectionFirmwareToolbarTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ConnectionFirmwareToolbarTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.GetStateActionId)
@ActionRegistration(
iconBase = GetStateAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.GetStateTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.GetStateTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.HomeActionId)
@ActionRegistration(
iconBase = HomingAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.HomeTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.HomeTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.OpenActionId)
@ActionRegistration(
iconBase = OpenAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.OpenTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.OpenTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.OpenDoorActionId)
@ActionRegistration(
iconBase = OpenDoorAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.OpenDoorTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.OpenDoorTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
category = LocalizingService.CATEGORY_TOOLS,
id = "com.willwinder.ugs.nbp.core.actions.OpenLogDirectoryAction")
@ActionRegistration(
displayName = "resources.MessagesBundle#platform.action.openLogDirectory",
displayName = "resources/MessagesBundle#platform.action.openLogDirectory",
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.OutlineActionId)
@ActionRegistration(
iconBase = OutlineAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.OutlineTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.OutlineTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.PauseActionId)
@ActionRegistration(
iconBase = PauseAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.PauseTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.PauseTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ This file is part of Universal Gcode Sender (UGS).
category = LocalizingService.PendantCategory,
id = LocalizingService.PendantActionId)
@ActionRegistration(
//iconBase = PauseAction.ICON_BASE,
displayName = "Pendant", //resources.MessagesBundle#" + LocalizingService.PendantTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.PendantTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ConnectionSerialPortToolbarActionId)
@ActionRegistration(
iconBase = PortAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ConnectionSerialPortToolbarTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ConnectionSerialPortToolbarTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ResetAZeroActionId)
@ActionRegistration(
iconBase = ResetACoordinateToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ResetAZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ResetAZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ResetBZeroActionId)
@ActionRegistration(
iconBase = ResetBCoordinateToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ResetBZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ResetBZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ResetCZeroActionId)
@ActionRegistration(
iconBase = ResetCCoordinateToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ResetCZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ResetCZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ResetZeroActionId)
@ActionRegistration(
iconBase = ResetCoordinatesToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ResetZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ResetZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ResetXZeroActionId)
@ActionRegistration(
iconBase = ResetXCoordinateToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ResetXZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ResetXZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ResetYZeroActionId)
@ActionRegistration(
iconBase = ResetYCoordinateToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ResetYZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ResetYZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ResetZZeroActionId)
@ActionRegistration(
iconBase = ResetZCoordinateToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ResetZZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ResetZZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ReturnToZeroActionId)
@ActionRegistration(
iconBase = ReturnToZeroAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ReturnToZeroTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ReturnToZeroTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
id = LocalizingService.SaveActionId)
@ActionRegistration(
iconBase = SaveAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.SaveTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.SaveTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.SoftResetActionId)
@ActionRegistration(
iconBase = SoftResetAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.SoftResetTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.SoftResetTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.StartActionId)
@ActionRegistration(
iconBase = StartAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.StartTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.StartTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.StopActionId)
@ActionRegistration(
iconBase = StopAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.StopTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.StopTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.ToggleUnitActionId)
@ActionRegistration(
iconBase = UnlockAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.ToggleUnitTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.ToggleUnitTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This file is part of Universal Gcode Sender (UGS).
id = LocalizingService.UnlockActionId)
@ActionRegistration(
iconBase = UnlockAction.ICON_BASE,
displayName = "resources.MessagesBundle#" + LocalizingService.UnlockTitleKey,
displayName = "resources/MessagesBundle#" + LocalizingService.UnlockTitleKey,
lazy = false)
@ActionReferences({
@ActionReference(
Expand Down
11 changes: 10 additions & 1 deletion ugs-platform/ugs-platform-visualizer/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.willwinder</groupId>
Expand All @@ -23,6 +24,7 @@
<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>eu.mihosoft.vrl.v3d</publicPackage>
</publicPackages>
</configuration>
</plugin>
Expand Down Expand Up @@ -98,5 +100,12 @@
<artifactId>ugs-platform-ugscore</artifactId>
<version>${project.version}</version>
</dependency>

<!-- For creating Constructive Solid Geometry -->
<dependency>
<groupId>com.breiler.jcsg</groupId>
<artifactId>jcsg-core</artifactId>
<version>0.0.1</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 static final int HIGH_FPS = 15;
private static final int LOW_FPS = 4;
private final int highFps;
private final int lowFps;
private final GcodeRenderer gcodeRenderer;
private final AnimatorBase animator;
private final BackendAPI backend;
Expand All @@ -76,11 +76,13 @@ public class RendererInputHandler implements
private Position selectionStart = null;
private Position selectionEnd = null;

public RendererInputHandler(GcodeRenderer gr, AnimatorBase a, BackendAPI backend) {
public RendererInputHandler(GcodeRenderer gr, AnimatorBase a, BackendAPI backend, int lowFps, int highFps) {
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 @@ -271,7 +273,7 @@ public void mouseClicked(MouseEvent e) {
*/
@Override
public void mousePressed(MouseEvent e) {
setFPS(HIGH_FPS);
setFPS(highFps);
// Zoom
if (e.getButton() == MouseEvent.BUTTON1 && e.isMetaDown()) {
selecting = true;
Expand All @@ -282,7 +284,7 @@ public void mousePressed(MouseEvent e) {

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

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

int DELTA_SIZE = 1;

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

public void dispose() {
Expand Down
Loading

0 comments on commit df28189

Please sign in to comment.