BoundaryRep.java | ●●●●● patch | view | raw | blame | history | |
CameraPane.java | ●●●●● patch | view | raw | blame | history | |
Globals.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history |
BoundaryRep.java
.. .. @@ -4155,6 +4155,8 @@ 4155 4155 4156 4156 void MergeNormals() 4157 4157 { 4158 + assert(!trimmed);4159 +4158 4160 boolean smooth = Grafreed.smoothmode; 4159 4161 boolean link = Grafreed.linkUV; 4160 4162 Grafreed.smoothmode = true; CameraPane.java
.. .. @@ -37,7 +37,6 @@ 37 37 static boolean[] selectedstack = new boolean[65536]; 38 38 static int materialdepth = 0; 39 39 40 - static boolean DEBUG = false;41 40 static boolean FRUSTUM = false; // still bogus true; // frustum culling 42 41 43 42 // camera change fix .. .. @@ -2267,7 +2266,7 @@ 2267 2266 2268 2267 void ToggleDebug() 2269 2268 { 2270 - DEBUG ^= true;2269 + Globals.DEBUG ^= true;2271 2270 } 2272 2271 2273 2272 void ToggleLookAt() .. .. @@ -11459,6 +11458,24 @@ 11459 11458 11460 11459 static boolean zoomonce = false; 11461 11460 11461 + void CreateSelectedPoint()11462 + {11463 + if (selectedpoint == null)11464 + {11465 + debugpointG = new Sphere();11466 + debugpointP = new Sphere();11467 + debugpointC = new Sphere();11468 + debugpointR = new Sphere();11469 +11470 + selectedpoint = new Superellipsoid();11471 +11472 + for (int i=0; i<8; i++)11473 + {11474 + debugpoints[i] = new Sphere();11475 + }11476 + }11477 + }11478 +11462 11479 void DrawObject(GL gl, boolean draw) 11463 11480 { 11464 11481 //System.out.println("DRAW OBJECT " + mouseDown); .. .. @@ -11539,8 +11556,9 @@ 11539 11556 11540 11557 if (DrawMode() == DEFAULT) 11541 11558 { 11542 - if (DEBUG)11559 + if (Globals.DEBUG)11543 11560 { 11561 + CreateSelectedPoint();11544 11562 float radius = 0.05f; 11545 11563 if (selectedpoint.radius != radius) 11546 11564 { .. .. @@ -14902,8 +14920,14 @@ 14902 14920 RevertCamera(); 14903 14921 repaint(); 14904 14922 break; 14905 - case 'L':14906 14923 case 'l': 14924 + lightMode ^= true;14925 + Globals.lighttouched = true;14926 + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;14927 + targetLookAt.set(manipCamera.lookAt);14928 + repaint();14929 + break;14930 + case 'L':14907 14931 if (lightMode) 14908 14932 { 14909 14933 lightMode = false; .. .. @@ -15050,16 +15074,14 @@ 15050 15074 kompactbit = 6; 15051 15075 break; 15052 15076 case ' ': 15053 - lightMode ^= true;15054 - Globals.lighttouched = true;15055 - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;15056 - targetLookAt.set(manipCamera.lookAt);15077 + ObjEditor.theFrame.ToggleFullScreen();15057 15078 repaint(); 15058 15079 break; 15059 15080 //case '`' : 15060 15081 case ESC: 15061 15082 RENDERPROGRAM += 1; 15062 15083 RENDERPROGRAM %= 3; 15084 +15063 15085 repaint(); 15064 15086 break; 15065 15087 case 'Z': .. .. @@ -17235,23 +17257,15 @@ 17235 17257 int AAbuffersize = 0; 17236 17258 17237 17259 //double[] selectedpoint = new double[3]; 17238 - static Superellipsoid selectedpoint = new Superellipsoid();17260 + static Superellipsoid selectedpoint;17239 17261 static Sphere previousselectedpoint = null; 17240 - static Sphere debugpointG = new Sphere();17241 - static Sphere debugpointP = new Sphere();17242 - static Sphere debugpointC = new Sphere();17243 - static Sphere debugpointR = new Sphere();17262 + static Sphere debugpointG;17263 + static Sphere debugpointP;17264 + static Sphere debugpointC;17265 + static Sphere debugpointR;17244 17266 17245 17267 static Sphere debugpoints[] = new Sphere[8]; 17246 17268 17247 - static17248 - {17249 - for (int i=0; i<8; i++)17250 - {17251 - debugpoints[i] = new Sphere();17252 - }17253 - }17254 -17255 17269 static void InitPoints(float radius) 17256 17270 { 17257 17271 for (int i=0; i<8; i++) Globals.java
.. .. @@ -1,7 +1,8 @@ 1 1 2 2 public class Globals 3 3 { 4 - public static boolean ADVANCED = true; //false;4 + public static boolean DEBUG = false;5 + public static boolean ADVANCED = false;5 6 6 7 static iCameraPane theRenderer; 7 8 GroupEditor.java
.. .. @@ -246,7 +246,7 @@ 246 246 247 247 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); 248 248 toggleDebugItem.addItemListener(this); 249 - toggleDebugItem.setState(CameraPane.DEBUG);249 + toggleDebugItem.setState(Globals.DEBUG);250 250 251 251 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); 252 252 toggleFrustumItem.addItemListener(this); .. .. @@ -535,6 +535,18 @@ 535 535 536 536 void SetupUI2(ObjEditor oe) 537 537 { 538 + // June 2019539 + if (oe == null)540 + {541 + //super.SetupUI2(this);542 + //return;543 + }544 +545 + if (copy != group)546 + {547 + //super.SetupUI2(this);548 + }549 +538 550 //new Exception().printStackTrace(); 539 551 540 552 oe.radioPanel = new JPanel(new GridBagLayout()); .. .. @@ -565,15 +577,27 @@ 565 577 */ 566 578 //this.AddOptions(oe.toolbarPanel, oe.aConstraints); 567 579 568 - oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);580 + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);581 + //minButton.setToolTipText("Minimize window");582 + //minButton.addActionListener(this);583 +584 + oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);585 + maxButton.setToolTipText("Maximize window");586 + maxButton.addActionListener(this);587 +588 + oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);589 + fullButton.setToolTipText("Full-screen window");590 + fullButton.addActionListener(this);591 +592 + oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);569 593 undoButton.setToolTipText("Undo changes"); 570 594 undoButton.addActionListener(this); 571 595 572 - oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);596 + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);573 597 redoButton.setToolTipText("Redo changes"); 574 598 redoButton.addActionListener(this); 575 599 576 - oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);600 + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);577 601 saveButton.setToolTipText("Save changes"); 578 602 saveButton.addActionListener(this); 579 603 .. .. @@ -581,7 +605,7 @@ 581 605 liveCB.setToolTipText("Enable animation"); 582 606 liveCB.addItemListener(this); 583 607 584 - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);608 + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);585 609 oneStepButton.setToolTipText("Animate one step forward"); 586 610 oneStepButton.addActionListener(this); 587 611 .. .. @@ -589,7 +613,7 @@ 589 613 fastCB.setToolTipText("Fast mode"); 590 614 fastCB.addItemListener(this); 591 615 592 - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);616 + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);593 617 trackCB.setToolTipText("Enable tracking"); 594 618 trackCB.addItemListener(this); 595 619 .. .. @@ -817,6 +841,8 @@ 817 841 818 842 void SetupViews(ObjEditor oe) 819 843 { 844 + theFrame = this;845 +820 846 oe.SetupViews(); 821 847 822 848 System.out.println("SetupViews"); .. .. @@ -1978,6 +2004,18 @@ 1978 2004 { 1979 2005 DumpObject(); 1980 2006 } else 2007 + if (source == minButton)2008 + {2009 + Minimize();2010 + } else2011 + if (source == maxButton)2012 + {2013 + Maximize();2014 + } else2015 + if (source == fullButton)2016 + {2017 + ToggleFullScreen();2018 + } else1981 2019 if (source == undoButton) 1982 2020 { 1983 2021 Undo(); .. .. @@ -2899,6 +2937,24 @@ 2899 2937 bigThree.ClearUI(); 2900 2938 bigThree.add(centralPanel); 2901 2939 bigThree.FlushUI(); 2940 +2941 + cameraView.requestFocusInWindow();2942 +2943 +// refreshContents(true);2944 +//2945 +// try2946 +// {2947 +// java.awt.Robot bot = new java.awt.Robot();2948 +// int mask = InputEvent.BUTTON1_MASK;2949 +// bot.mouseMove(100, 100);2950 +// bot.mousePress(mask);2951 +// bot.mouseRelease(mask);2952 +// }2953 +// catch (Exception e)2954 +// {2955 +//2956 +// }2957 +2902 2958 } else 2903 2959 if (source == threeButton) 2904 2960 { .. .. @@ -2935,6 +2991,8 @@ 2935 2991 bigThree.add(centralPanel); 2936 2992 bigThree.add(XYZPanel); 2937 2993 bigThree.FlushUI(); 2994 +2995 + cameraView.requestFocusInWindow();2938 2996 } else 2939 2997 if (source == fourButton) 2940 2998 { .. .. @@ -2970,6 +3028,8 @@ 2970 3028 bigThree.ClearUI(); 2971 3029 bigThree.add(scenePanel); 2972 3030 bigThree.FlushUI(); 3031 +3032 + cameraView.requestFocusInWindow();2973 3033 } else 2974 3034 if (source == sixButton) 2975 3035 { .. .. @@ -3006,6 +3066,8 @@ 3006 3066 bigThree.add(scenePanel); 3007 3067 bigThree.add(centralPanel); 3008 3068 bigThree.FlushUI(); 3069 +3070 + cameraView.requestFocusInWindow();3009 3071 } else 3010 3072 if (source == sevenButton) 3011 3073 { .. .. @@ -3043,6 +3105,8 @@ 3043 3105 bigThree.add(centralPanel); 3044 3106 bigThree.add(XYZPanel); 3045 3107 bigThree.FlushUI(); 3108 +3109 + cameraView.requestFocusInWindow();3046 3110 } else 3047 3111 if (source == rootButton) 3048 3112 { .. .. @@ -3054,6 +3118,7 @@ 3054 3118 EditObject(obj); 3055 3119 } 3056 3120 3121 + cameraView.requestFocusInWindow();3057 3122 refreshContents(true); 3058 3123 } else 3059 3124 if (source == closeButton) .. .. @@ -3075,6 +3140,8 @@ 3075 3140 break; 3076 3141 } 3077 3142 } 3143 +3144 + cameraView.requestFocusInWindow();3078 3145 refreshContents(true); 3079 3146 } else 3080 3147 if (source == editItem || source == editButton) .. .. @@ -3179,7 +3246,7 @@ 3179 3246 } 3180 3247 3181 3248 // fix "+" issue 3182 - group.editWindow = this;3249 + //group.editWindow = this;3183 3250 3184 3251 /* 3185 3252 currentLayout = radio.layout; .. .. @@ -3192,6 +3259,8 @@ 3192 3259 //group.parent = null; // ROOT 3193 3260 //group.attributes = -1; 3194 3261 ResetModel(); 3262 +3263 + cameraView.requestFocusInWindow();3195 3264 refreshContents(true); 3196 3265 } else if (event.getSource() == editCameraItem) 3197 3266 { .. .. @@ -3215,7 +3284,6 @@ 3215 3284 } 3216 3285 3217 3286 boolean useclient = false; 3218 - cRadio radio;3219 3287 3220 3288 void ToggleRoot() 3221 3289 { .. .. @@ -5219,9 +5287,12 @@ 5219 5287 cButton clearpanelButton; 5220 5288 cButton unselectButton; 5221 5289 5222 - cButton saveButton;5290 + cButton minButton;5291 + cButton maxButton;5292 + cButton fullButton;5223 5293 cButton undoButton; 5224 5294 cButton redoButton; 5295 + cButton saveButton;5225 5296 cButton oneStepButton; 5226 5297 5227 5298 cButton screenfitButton; .. .. @@ -5234,14 +5305,6 @@ 5234 5305 cButton closeButton; 5235 5306 5236 5307 cButton setsupportButton; 5237 -5238 - cButton twoButton;5239 - cButton sixButton;5240 - cButton threeButton;5241 - cButton sevenButton;5242 - cButton fourButton; // full panel5243 - cButton oneButton; // full XYZ5244 - //cButton currentLayout;5245 5308 5246 5309 // 5247 5310 //Composite ObjEditor.java
.. .. @@ -36,6 +36,8 @@ 36 36 GroupEditor callee; 37 37 JFrame frame; 38 38 39 + static ObjEditor theFrame;40 +39 41 // SCRIPT 40 42 41 43 transient JFrame textpanel = null; .. .. @@ -244,6 +246,7 @@ 244 246 //localCopy.parent = null; 245 247 246 248 frame = new JFrame(); 249 + frame.setUndecorated(true);247 250 objEditor = this; 248 251 this.callee = callee; 249 252 .. .. @@ -583,19 +586,89 @@ 583 586 } 584 587 } 585 588 589 +static GraphicsDevice device = GraphicsEnvironment590 + .getLocalGraphicsEnvironment().getScreenDevices()[0];591 +592 + Rectangle keeprect;593 + cRadio radio;594 +595 +cButton keepButton;596 + cButton twoButton; // Full 3D597 + cButton sixButton;598 + cButton threeButton;599 + cButton sevenButton;600 + cButton fourButton; // full panel601 + cButton oneButton; // full XYZ602 + //cButton currentLayout;603 +604 + boolean maximized;605 +606 + void Minimize()607 + {608 + frame.setState(Frame.ICONIFIED);609 + }610 +611 + void Maximize()612 + {613 + if (maximized)614 + {615 + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);616 + }617 + else618 + {619 + keeprect = frame.getBounds();620 + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();621 + Dimension rect2 = frame.getToolkit().getScreenSize();622 + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);623 +// frame.setState(Frame.MAXIMIZED_BOTH);624 + }625 +626 + maximized ^= true;627 + }628 +586 629 void ToggleFullScreen() 587 630 { 588 631 if (CameraPane.FULLSCREEN) 589 632 { 590 - frame.getContentPane().remove(/*"Center",*/bigThree);591 - framePanel.add(bigThree);592 - frame.getContentPane().add(/*"Center",*/framePanel);633 + device.setFullScreenWindow(null);634 + //frame.setVisible(false);635 +// frame.removeNotify();636 +// frame.setUndecorated(false);637 +// frame.addNotify();638 + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);639 +640 +// X frame.getContentPane().remove(/*"Center",*/bigThree);641 +// X framePanel.add(bigThree);642 +// X frame.getContentPane().add(/*"Center",*/framePanel);643 + framePanel.setDividerLocation(1);644 +645 + //frame.setVisible(true);646 + radio.layout = keepButton;647 + //theFrame = null;648 + keepButton = null;649 + radio.layout.doClick();650 +593 651 } else 594 652 { 595 - frame.getContentPane().remove(/*"Center",*/framePanel);596 - framePanel.remove(bigThree);597 - frame.getContentPane().add(/*"Center",*/bigThree);653 + keepButton = radio.layout;654 + //keeprect = frame.getBounds();655 +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,656 +// frame.getToolkit().getScreenSize().height);657 + //frame.setVisible(false);658 + device.setFullScreenWindow(frame);659 +// frame.removeNotify();660 +// frame.setUndecorated(true);661 +// frame.addNotify();662 +// X frame.getContentPane().remove(/*"Center",*/framePanel);663 +// X framePanel.remove(bigThree);664 +// X frame.getContentPane().add(/*"Center",*/bigThree);665 + framePanel.setDividerLocation(0);666 +667 + radio.layout = twoButton;668 + radio.layout.doClick();669 + //frame.setVisible(true);598 670 } 671 +599 672 cameraView.ToggleFullScreen(); 600 673 } 601 674 .. .. @@ -947,7 +1020,7 @@ 947 1020 rewindCB.setToolTipText("Rewind animation"); 948 1021 949 1022 randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); 950 - randomCB.setToolTipText("Rewind or Go back and forth randomly");1023 + randomCB.setToolTipText("Randomly Rewind or Go back and forth");951 1024 952 1025 if (Globals.ADVANCED) 953 1026 { .. .. @@ -1184,8 +1257,11 @@ 1184 1257 //worldPanel.setName("World"); 1185 1258 centralPanel = new cGridBag(); 1186 1259 centralPanel.preferredWidth = 20; 1187 - timelinePanel = new JPanel(new BorderLayout());1188 - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);1260 +1261 + if (Globals.ADVANCED)1262 + {1263 + timelinePanel = new JPanel(new BorderLayout());1264 + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);1189 1265 1190 1266 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); 1191 1267 cameraPanel.setContinuousLayout(true); .. .. @@ -1194,7 +1270,10 @@ 1194 1270 // cameraPanel.setDividerSize(9); 1195 1271 cameraPanel.setResizeWeight(1.0); 1196 1272 1273 + }1274 +1197 1275 centralPanel.add(cameraView); 1276 + centralPanel.setFocusable(true);1198 1277 //frame.setJMenuBar(timelineMenubar); 1199 1278 //centralPanel.add(timelinePanel); 1200 1279 .. .. @@ -1392,6 +1471,8 @@ 1392 1471 frame.setSize(1280, 860); 1393 1472 frame.setVisible(true); 1394 1473 1474 + cameraView.requestFocusInWindow();1475 +1395 1476 gridPanel.setDividerLocation(1.0); 1396 1477 1397 1478 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); Object3D.java
.. .. @@ -2387,6 +2387,10 @@ 2387 2387 } 2388 2388 */ 2389 2389 } 2390 + else2391 + {2392 + //((ObjEditor)editWindow).SetupUI2(null);2393 + }2390 2394 } 2391 2395 2392 2396 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) .. .. @@ -6361,6 +6365,11 @@ 6361 6365 return; 6362 6366 } 6363 6367 6368 + if (dontselect)6369 + {6370 + //bRep.GenerateNormalsMINE();6371 + }6372 +6364 6373 display.DrawGeometry(bRep, flipV, selectmode); 6365 6374 } else // catch (Error e) 6366 6375 { .. .. @@ -7796,6 +7805,10 @@ 7796 7805 editWindow = null; 7797 7806 } // ? 7798 7807 } 7808 + else7809 + {7810 + //editWindow.closeUI();7811 + }7799 7812 } 7800 7813 7801 7814 boolean root; // patch for edit windows