@@ -224,7 +224,10 @@ void onExport(ActionEvent event) {
224
224
225
225
@ FXML
226
226
void onFitView (ActionEvent event ) {
227
-
227
+ engine .focusOrentation (
228
+ new TransformNR (0 ,0 ,0 ,new RotationNR (0 ,45 ,-45 )),
229
+ new TransformNR (),
230
+ engine .getFlyingCamera ().getDefaultZoomDepth ());
228
231
}
229
232
230
233
@ FXML
@@ -259,7 +262,10 @@ void onHome(MouseEvent event) {
259
262
260
263
@ FXML
261
264
void onHomeViewButton (ActionEvent event ) {
262
- navigationCube .focusOrentation (new TransformNR (0 ,0 ,0 ,new RotationNR (0 ,45 ,-45 )));
265
+ engine .focusOrentation (
266
+ new TransformNR (0 ,0 ,0 ,new RotationNR (0 ,45 ,-45 )),
267
+ new TransformNR (),
268
+ engine .getFlyingCamera ().getDefaultZoomDepth ());
263
269
}
264
270
265
271
@ FXML
@@ -330,11 +336,15 @@ void onWOrkplane(ActionEvent event) {
330
336
@ FXML
331
337
void onZoomIn (ActionEvent event ) {
332
338
339
+ System .out .println ("Zoom In" );
340
+ engine .setZoom ((int )engine .getFlyingCamera ().getZoomDepth ()+20 );
333
341
}
334
342
335
343
@ FXML
336
344
void onZoomOut (ActionEvent event ) {
345
+ System .out .println ("Zoom Out" );
337
346
347
+ engine .setZoom ((int )engine .getFlyingCamera ().getZoomDepth ()-20 );
338
348
}
339
349
340
350
@ FXML
@@ -352,18 +362,6 @@ void showAll(ActionEvent event) {
352
362
353
363
}
354
364
355
- @ FXML
356
- void zoomInView (MouseEvent event ) {
357
- System .out .println ("Zoom In" );
358
- engine .setZoom ((int )engine .getFlyingCamera ().getZoomDepth ()-20 );
359
- }
360
-
361
- @ FXML
362
- void zoomOutViewButton (MouseEvent event ) {
363
- System .out .println ("Zoom Out" );
364
-
365
- engine .setZoom ((int )engine .getFlyingCamera ().getZoomDepth ()+20 );
366
- }
367
365
368
366
@ FXML // This method is called by the FXMLLoader when initialization is complete
369
367
void initialize () {
@@ -483,7 +481,7 @@ public boolean isRotate(MouseEvent me) {
483
481
boolean primaryButtonDown = me .isPrimaryButtonDown ();
484
482
boolean secondaryButtonDown = me .isSecondaryButtonDown ();
485
483
boolean ctrl = me .isControlDown ();
486
- if (ctrl && primaryButtonDown )
484
+ if (ctrl && primaryButtonDown && (! shiftDown ) )
487
485
return true ;
488
486
if ((!shiftDown )&& secondaryButtonDown )
489
487
return true ;
@@ -493,9 +491,13 @@ public boolean isRotate(MouseEvent me) {
493
491
@ Override
494
492
public boolean isMove (MouseEvent me ) {
495
493
boolean shiftDown = me .isShiftDown ();
494
+ boolean primaryButtonDown = me .isPrimaryButtonDown ();
496
495
boolean secondaryButtonDown = me .isSecondaryButtonDown ();
496
+ boolean ctrl = me .isControlDown ();
497
497
if ((shiftDown )&& secondaryButtonDown )
498
498
return true ;
499
+ if (ctrl && shiftDown && primaryButtonDown )
500
+ return true ;
499
501
return false ;
500
502
}
501
503
});
@@ -505,6 +507,7 @@ private void setUpNavigationCube() {
505
507
navigationCube = new BowlerStudio3dEngine ();
506
508
navigationCube .rebuild (false );
507
509
navigationCube .setZoom (-400 );
510
+ navigationCube .lockZoom ();
508
511
navigationCube .setMouseScale (10 );
509
512
BowlerStudio .runLater (() -> {
510
513
navigationCube .getSubScene ().setFocusTraversable (false );
@@ -527,6 +530,7 @@ private void setUpNavigationCube() {
527
530
ViewCube viewcube = new ViewCube ();
528
531
MeshView viewCubeMesh = viewcube .createTexturedCube (navigationCube );
529
532
navigationCube .addUserNode (viewCubeMesh );
533
+
530
534
}
531
535
532
536
0 commit comments