Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -148,30 +148,29 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
164155 Menu menu;
165156 oe.menuBar.add(menu = new Menu("Edit"));
166157 //editItem = menu.add(new MenuItem("Edit"));
167158 //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
169166 duplicateItem.addActionListener(this);
170
- menu.add("-");
171167 cloneItem = menu.add(new MenuItem("Clone"));
172168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
173171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174172 cloneSupportItem.addActionListener(this);
173
+ }
175174 menu.add("-");
176175 cutItem = menu.add(new MenuItem("Cut"));
177176 cutItem.addActionListener(this);
....@@ -179,27 +178,123 @@
179178 copyItem.addActionListener(this);
180179 pasteItem = menu.add(new MenuItem("Paste"));
181180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
182185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183186 pasteLinkItem.addActionListener(this);
184187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185188 pasteCloneItem.addActionListener(this);
186189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
188192 clearItem = menu.add(new MenuItem("Clear"));
189193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
190198 clearAllItem = menu.add(new MenuItem("Clear All"));
191199 clearAllItem.addActionListener(this);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209
+
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
192237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
193289 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
290
+ if (Globals.ADVANCED)
291
+ {
198292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199293 revertMeshItem.addActionListener(this);
200294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201295 resetreferencesItem.addActionListener(this);
202296 menu.add("-");
297
+ }
203298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204299 overwriteGeoItem.addActionListener(this);
205300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +306,103 @@
211306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212307 overwriteUVItem.addActionListener(this);
213308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
214311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215312 generateMeshItem.addActionListener(this);
216313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217314 poseMeshItem.addActionListener(this);
218315 menu.add("-");
316
+ }
219317 resetsupportItem = menu.add(new MenuItem("Reset support"));
220318 resetsupportItem.addActionListener(this);
221319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222320 linkverticesItem.addActionListener(this);
223321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
225326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226327 setMasterItem.addActionListener(this);
328
+ }
227329
228330 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
231333 backItem = menu.add(new MenuItem("Back"));
232334 backItem.addActionListener(this);
233335 frontItem = menu.add(new MenuItem("Front"));
234336 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238343 hideItem.addActionListener(this);
344
+ }
239345 ungroupItem = menu.add(new MenuItem("Ungroup"));
240346 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
248354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249355 switchGeoItem.addActionListener(this);
250356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251357 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
253359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
254366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255367 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
368
+ }
258369
259370 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
262373 billboardItem = menu.add(new MenuItem("Billboard"));
263374 billboardItem.addActionListener(this);
264375 csgItem = menu.add(new MenuItem("CSG"));
265376 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267378 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269380 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
272386 linkerItem = menu.add(new MenuItem("Linker"));
273387 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276388 attributeItem = menu.add(new MenuItem("Attribute"));
277389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
278392 pointflowItem = menu.add(new MenuItem("Point Flow"));
279393 pointflowItem.addActionListener(this);
394
+ }
280395 menu.add("-");
281396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282397 resetTransformItem.addActionListener(this);
283398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284399 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
287406
288407 oe.menuBar.add(menu = new Menu("Geometry"));
289408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +413,11 @@
294413 genNormalsCADItem.addActionListener(this);
295414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
297418 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298419 genNormalsMINEItem.addActionListener(this);
420
+ }
299421 stripifyItem = menu.add(new MenuItem("Stripify"));
300422 stripifyItem.addActionListener(this);
301423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +439,34 @@
317439 reduce34MeshItem.addActionListener(this);
318440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319441 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
324450
325451 oe.menuBar.add(menu = new Menu("Attributes"));
326452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327453 clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
328458 menu.add("-");
329459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330460 liveleavesItem.addActionListener(this);
331461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
333465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334466 supportleavesItem.addActionListener(this);
335467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336468 unsupportleavesItem.addActionListener(this);
469
+ }
337470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338471 hideleavesItem.addActionListener(this);
339472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +475,14 @@
342475 markleavesItem.addActionListener(this);
343476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
345486 menu.add("-");
346487 flipVItem = menu.add(new MenuItem("Flip V"));
347488 flipVItem.addActionListener(this);
....@@ -377,35 +518,40 @@
377518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378519 sortbynameItem.addActionListener(this);
379520 menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
380528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381529 extractGeometriesItem.addActionListener(this);
382530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383531 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
532
+ }
388533
389534 oe.menuBar.add(menu = new Menu("Insert"));
390535 buildCreateMenu(menu);
391536
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403537 oe.menuBar.add(menu = new Menu("Tools"));
404538 buildToolsMenu(menu);
405539 }
406540
407541 void SetupUI2(ObjEditor oe)
408542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
409555 //new Exception().printStackTrace();
410556
411557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,92 +580,212 @@
434580 oe.radioPanel.add(dummyButton);
435581 oe.buttonGroup.add(dummyButton);
436582 */
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
586
+
437587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438588
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+ undoButton.setEnabled(false);
609
+
610
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ redoButton.setToolTipText("Redo changes");
612
+ redoButton.addActionListener(this);
613
+ redoButton.setEnabled(false);
614
+
615
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ saveButton.setToolTipText("Save changes");
617
+ saveButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
620
+ liveCB.setToolTipText("Enable animation");
441621 liveCB.addItemListener(this);
442622
443
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444
- trackCB.setToolTipText("Enable tracking");
445
- trackCB.addItemListener(this);
446
-
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
623
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ oneStepButton.setToolTipText("Animate one step forward");
625
+ oneStepButton.addActionListener(this);
626
+
627
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
628
+ fastCB.setToolTipText("Fast mode");
629
+ fastCB.addItemListener(this);
630
+
631
+ //oe.toolboxPanel.Return();
632
+
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448634 screenfitButton.setToolTipText("Screen fit");
449635 screenfitButton.addActionListener(this);
450636
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
640
+
451641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452642 // screenfitpointButton.addActionListener(this);
453
-// oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455
- snapobjectButton.addActionListener(this);
456
- snapobjectButton.setToolTipText("Snap Object");
457
- oe.aConstraints.gridx += 1;
458643
459
- //aConstraints.gridx = 0;
460
- //aConstraints.gridy += 1;
461
- oe.aConstraints.weighty = 0;
462
- oe.aConstraints.gridwidth = 1;
463
-
464
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
- flashSelectionButton.setToolTipText("Show selection");
466
- flashSelectionButton.addActionListener(this);
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ snapobjectButton.addActionListener(this);
648
+ snapobjectButton.setToolTipText("Snap Object");
649
+ }
650
+
651
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
467652
468
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
-
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471654 twoButton.setToolTipText("Show center view only");
472655 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
656
+ this.fullscreenLayout = twoButton;
657
+
658
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474659 fourButton.addActionListener(this);
475660 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477662 sixButton.setToolTipText("2-column layout left");
478663 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480665 threeButton.setToolTipText("2-column layout right");
481666 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483668 sevenButton.setToolTipText("3-column layout");
484669 sevenButton.addActionListener(this);
485670 //
486671
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
672
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488673 rootButton.setToolTipText("Edit selection in new tab");
489674 rootButton.addActionListener(this);
490675
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492677 closeButton.setToolTipText("Close tab");
493678 closeButton.addActionListener(this);
494679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495680 //clearButton.addActionListener(this);
496
-
497
- cGridBag commandsPanel = new cGridBag();
681
+
682
+ // INSERT
683
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ gridButton.setToolTipText("Create grid");
685
+ gridButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ boxButton.setToolTipText("Create box");
689
+ boxButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
692
+ sphereButton.setToolTipText("Create sphere");
693
+ sphereButton.addActionListener(this);
694
+
695
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ coneButton.setToolTipText("Create cone");
697
+ coneButton.addActionListener(this);
698
+
699
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ torusButton.setToolTipText("Create torus");
701
+ torusButton.addActionListener(this);
702
+
703
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+ superButton.setToolTipText("Create superellipsoid");
705
+ superButton.addActionListener(this);
706
+
707
+ if (Globals.ADVANCED)
708
+ {
709
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
710
+ kleinButton.setToolTipText("Create Klein bottle");
711
+ kleinButton.addActionListener(this);
712
+ }
498713
499
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
714
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ particlesButton.setToolTipText("Create particle system");
716
+ particlesButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.Return();
719
+
720
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ groupButton.setToolTipText("Create group");
722
+ groupButton.addActionListener(this);
723
+
724
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ compositeButton.setToolTipText("Create composite");
726
+ compositeButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ switchButton.setToolTipText("Create switch");
730
+ switchButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ loopButton.setToolTipText("Create loop");
734
+ loopButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ textureButton.setToolTipText("Create texture");
738
+ textureButton.addActionListener(this);
739
+
740
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ overlayButton.setToolTipText("Create overlay");
742
+ overlayButton.addActionListener(this);
743
+
744
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ lightButton.setToolTipText("Create light");
746
+ lightButton.addActionListener(this);
747
+
748
+ for (int i=6; --i>=0;)
749
+ {
750
+ oe.toolboxPanel.Return();
751
+ oe.toolboxPanel.add(new cGridBag());
752
+ oe.toolboxPanel.add(new cGridBag());
753
+ oe.toolboxPanel.add(new cGridBag());
754
+ oe.toolboxPanel.add(new cGridBag());
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ }
759
+
760
+ // EDIT panel
761
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500762 editButton.setToolTipText("Edit selection");
501763 editButton.addActionListener(this);
502764
503
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
765
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504766 uneditButton.setToolTipText("Unedit selection");
505767 uneditButton.addActionListener(this);
506768
507
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
769
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
+ allParamsButton.setToolTipText("Edit all params");
771
+ allParamsButton.addActionListener(this);
772
+
773
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508774 clearPanelButton.setToolTipText("Clear edit panel");
509775 clearPanelButton.addActionListener(this);
510776
511
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
- allParamsButton.setToolTipText("All params??");
513
- allParamsButton.addActionListener(this);
514
-
515
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
777
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516778 unselectButton.setToolTipText("Unselect");
517779 unselectButton.addActionListener(this);
518780
519
- commandsPanel.preferredHeight = 1;
781
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ flashSelectionButton.setToolTipText("Highlight selection");
783
+ flashSelectionButton.addActionListener(this);
520784
521
- oe.treePanel.add(commandsPanel);
522
- oe.treePanel.Return();
785
+ editCommandsPanel.preferredHeight = 1;
786
+
787
+// oe.treePanel.add(commandsPanel);
788
+// oe.treePanel.Return();
523789
524790 // oe.aConstraints.gridx += 1;
525791 // oe.aConstraints.weighty = 0;
....@@ -536,27 +802,12 @@
536802
537803 JScrollPane jSP;
538804 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
539
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
540806 ResetModel();
541807
542808 oe.treePanel.add(jSPPanel);
543809 oe.treePanel.Return();
544810
545
- cGridBag copyOptionsPanel = new cGridBag();
546
-
547
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
- colorCB.setToolTipText("Copy color when dropped");
549
- colorCB.addItemListener(this);
550
-
551
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
- materialCB.setToolTipText("Copy material when dropped");
553
- materialCB.addItemListener(this);
554
-
555
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
- textureCB.setToolTipText("Copy texture when dropped");
557
- textureCB.addItemListener(this);
558
-
559
- copyOptionsPanel.preferredHeight = 1;
560811 oe.treePanel.add(copyOptionsPanel);
561812 oe.treePanel.Return();
562813
....@@ -587,47 +838,57 @@
587838
588839 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589840 {
590
- //constraints.gridx = 0;
591
- //constraints.gridy = 0;
592
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
- fastCB.setToolTipText("Fast mode");
594
- fastCB.addItemListener(this);
595
- //constraints.gridy += 1;
596
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597
- supportCB.setToolTipText("Enabled rigging");
598
- supportCB.addItemListener(this);
841
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
842
+ colorCB.setToolTipText("Copy color when dropped");
843
+ colorCB.addItemListener(this);
599844
600
- // constraints.gridy += 1;
601
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602
- // localCB.addItemListener(this);
845
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
846
+ materialCB.setToolTipText("Copy material when dropped");
847
+ materialCB.addItemListener(this);
603848
604
- //constraints.gridy += 1;
605
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606
- crowdCB.setToolTipText("Used for crowds");
607
- crowdCB.addItemListener(this);
608
-
609
- //constraints.gridy += 1;
610
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611
- smoothCB.setToolTipText("Snapping delay");
612
- smoothCB.addItemListener(this);
613
-
614
- //constraints.gridy += 1;
615
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616
- slowCB.setToolTipText("Smooth interpolation");
617
- slowCB.addItemListener(this);
618
- //constraints.gridy += 1;
849
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
850
+ textureCB.setToolTipText("Copy texture when dropped");
851
+ textureCB.addItemListener(this);
852
+
853
+ panel.Return();
854
+
619855 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620856 boxCB.setToolTipText("Display bounding boxes");
621857 boxCB.addItemListener(this);
622
- //constraints.gridy += 1;
858
+
623859 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624860 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625861 zoomBoxCB.addItemListener(this);
626862
863
+ if (true) // Globals.ADVANCED)
864
+ {
865
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
+ supportCB.setToolTipText("Enable rigging");
867
+ supportCB.addItemListener(this);
868
+
869
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870
+ // localCB.addItemListener(this);
871
+
872
+ panel.Return();
873
+
874
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
875
+ crowdCB.setToolTipText("Used for crowds");
876
+ crowdCB.addItemListener(this);
877
+
878
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
879
+ smoothCB.setToolTipText("Snapping delay");
880
+ smoothCB.addItemListener(this);
881
+
882
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
883
+ slowCB.setToolTipText("Smooth interpolation");
884
+ slowCB.addItemListener(this);
885
+
627886 // constraints.gridy += 1;
628887 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629888 // speakerMocapCB.addItemListener(this);
630889
890
+ panel.Return();
891
+
631892 if (false)
632893 {
633894 // handled in scripts
....@@ -642,32 +903,72 @@
642903 //constraints.gridy += 1;
643904 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
644905 smoothfocusCB.addItemListener(this);
906
+ panel.Return();
645907 }
646908
647909 //constraints.gridx += 1;
648910 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649911 // debugCB.addItemListener(this);
650912
651
- //constraints.gridy += 1;
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
652917 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
653919 oeilCB.addItemListener(this);
654920
655
- //constraints.gridy += 1;
921
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
+ shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.addItemListener(this);
924
+
925
+ panel.Return();
926
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
927
+ toggleTextureCB.setToolTipText("Load textures");
928
+ toggleTextureCB.addItemListener(this);
929
+
930
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
+ toggleSwitchCB.setToolTipText("Use switch");
932
+ toggleSwitchCB.addItemListener(this);
933
+
934
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
+ autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.addItemListener(this);
937
+
938
+ panel.Return();
939
+ if (Globals.ADVANCED)
940
+ {
656941 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657942 lookAtCB.setToolTipText("Look-at target");
658943 lookAtCB.addItemListener(this);
944
+ }
945
+
946
+ }
659947
660948 cGridBag fill = new cGridBag();
661
-
662949 fill.preferredHeight = 200;
950
+ cGridBag fill2 = new cGridBag();
951
+ fill2.preferredHeight = 200;
952
+ cGridBag fill3 = new cGridBag();
953
+ fill3.preferredHeight = 200;
663954
664955 panel.add(fill);
956
+ panel.add(fill2);
957
+ panel.add(fill3);
665958
666959 }
667960
668961 void EditObject(Object3D obj)
669962 {
670963 cRadio radioButton = new cRadio(obj.name);
964
+
965
+ // Patch to avoid bug with transparency.
966
+ radioButton.hadMaterial = obj.material != null;
967
+ if (!radioButton.hadMaterial)
968
+ {
969
+ obj.material = new cMaterial();
970
+ }
971
+
671972 radioButton.SetObject(obj);
672973 radioButton.layout = sevenButton;
673974 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -676,8 +977,11 @@
676977 buttonGroup.add(radioButton);
677978 radioButton.doClick();
678979 }
980
+
679981 void SetupViews(ObjEditor oe)
680982 {
983
+ theFrame = this;
984
+
681985 oe.SetupViews();
682986
683987 System.out.println("SetupViews");
....@@ -686,23 +990,27 @@
686990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
687991 }
688992
689
- JCheckBox liveCB;
690
- JCheckBox supportCB;
691
- JCheckBox localCB;
692
- JCheckBox crowdCB;
693
- JCheckBox smoothCB;
694
- JCheckBox fastCB;
695
- JCheckBox slowCB;
696
- JCheckBox boxCB;
697
- JCheckBox zoomBoxCB;
698
- JCheckBox trackCB;
699
- JCheckBox smoothfocusCB;
993
+ cToggleButton liveCB;
994
+ cCheckBox supportCB;
995
+ cCheckBox localCB;
996
+ cCheckBox crowdCB;
997
+ cCheckBox smoothCB;
998
+ cToggleButton fastCB;
999
+ cCheckBox slowCB;
1000
+ cCheckBox boxCB;
1001
+ cCheckBox zoomBoxCB;
1002
+ //cToggleButton trackCB;
1003
+ cCheckBox trackCB;
1004
+ cCheckBox smoothfocusCB;
7001005 // JCheckBox speakerMocapCB;
701
- JCheckBox speakerCameraCB;
702
- JCheckBox speakerFocusCB;
703
- JCheckBox debugCB;
704
- JCheckBox oeilCB;
705
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
7061014
7071015 // static int COLOR = 1;
7081016 // static int MATERIAL = 2;
....@@ -710,9 +1018,9 @@
7101018
7111019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7121020
713
- JCheckBox colorCB;
714
- JCheckBox materialCB;
715
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
7161024
7171025 public void itemStateChanged(ItemEvent e)
7181026 {
....@@ -740,6 +1048,7 @@
7401048 } else if(e.getSource() == liveCB)
7411049 {
7421050 cameraView.ToggleLive();
1051
+ refreshContents(false);
7431052 }
7441053 else if(e.getSource() == supportCB)
7451054 {
....@@ -804,6 +1113,14 @@
8041113 {
8051114 cameraView.ToggleOeil();
8061115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
8071124 else if(e.getSource() == lookAtCB)
8081125 {
8091126 cameraView.ToggleLookAt();
....@@ -820,7 +1137,8 @@
8201137
8211138 /**/
8221139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
823
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
8241142 if ((path == null) || (path.getPathCount() <= 1)) {
8251143 // We can't move the root node or an empty selection
8261144 return;
....@@ -892,7 +1210,9 @@
8921210 // objEditor.DropFile((java.io.File[]) object, true);
8931211 // return;
8941212 // }
895
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8961216 {
8971217 // file(s)
8981218 String[] names = string.split("\n");
....@@ -919,7 +1239,7 @@
9191239
9201240 flashIt = false;
9211241 CameraPane pane = (CameraPane) target;
922
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9231243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9241244
9251245 if (group.selection.size() == 1)
....@@ -935,23 +1255,33 @@
9351255
9361256 assert target == objEditor.jTree;
9371257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
9381259 try {
939
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9401261 } catch (Exception e) {
9411262 System.out.println("destinationPath : " + destinationPath);
9421263 return;
9431264 }
9441265
945
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
9461267 {
1268
+ Object3D child = (Object3D)group.selection.elementAt(i);
1269
+
1270
+ // Cannot move into itself
1271
+ if (child == destinationLeaf)
1272
+ return;
1273
+ }
1274
+
1275
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1276
+// {
9471277 loadClipboard(true);
9481278 objEditor.jTree.setSelectionPath(destinationPath);
949
- pasteInto(false);
950
- } else {
951
- loadClipboard(false);
952
- objEditor.jTree.setSelectionPath(destinationPath);
953
- pasteInto(false); // true); // ???
954
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9551285 }
9561286 public void dropActionChanged(DropTargetDragEvent dtde)
9571287 // Called if the user has modified the current drop gesture
....@@ -1056,85 +1386,104 @@
10561386 {
10571387 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10581388 //heightFieldItem.addActionListener(this);
1059
- gridItem = menu.add(new MenuItem("Grid"));
1060
- gridItem.addActionListener(this);
1061
- rectoidItem = menu.add(new MenuItem("Box"));
1062
- rectoidItem.addActionListener(this);
1063
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1064
- ellipsoidItem.addActionListener(this);
1065
- coneItem = menu.add(new MenuItem("Cone"));
1066
- coneItem.addActionListener(this);
1067
- torusItem = menu.add(new MenuItem("Torus"));
1068
- torusItem.addActionListener(this);
1069
- superItem = menu.add(new MenuItem("Superellipsoid"));
1070
- superItem.addActionListener(this);
1389
+// gridItem = menu.add(new MenuItem("Grid"));
1390
+// gridItem.addActionListener(this);
1391
+// rectoidItem = menu.add(new MenuItem("Box"));
1392
+// rectoidItem.addActionListener(this);
1393
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1394
+// ellipsoidItem.addActionListener(this);
1395
+// coneItem = menu.add(new MenuItem("Cone"));
1396
+// coneItem.addActionListener(this);
1397
+// torusItem = menu.add(new MenuItem("Torus"));
1398
+// torusItem.addActionListener(this);
1399
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1400
+// superItem.addActionListener(this);
1401
+
1402
+ cameraItem = menu.add(new MenuItem("Camera"));
1403
+ cameraItem.addActionListener(this);
1404
+
1405
+ if (!Globals.ADVANCED)
1406
+ {
10711407 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10721408 kleinItem.addActionListener(this);
1073
- particleItem = menu.add(new MenuItem("Particle system"));
1074
- particleItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10751415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10761416 ragdollItem.addActionListener(this);
10771417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10781418 ragdoll2Item.addActionListener(this);
1419
+ }
10791420 menu.add("-");
1080
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10811422 meshItem.addActionListener(this);
10821423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10831424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10841427 springItem = menu.add(new MenuItem("Spring"));
10851428 springItem.addActionListener(this);
10861429 flagItem = menu.add(new MenuItem("Flag"));
10871430 flagItem.addActionListener(this);
1088
- bezierItem = menu.add(new MenuItem("Patch"));
1089
- bezierItem.addActionListener(this);
1090
- checkerItem = menu.add(new MenuItem("Checker"));
1091
- checkerItem.addActionListener(this);
10921431 blobItem = menu.add(new MenuItem("Blob"));
10931432 blobItem.addActionListener(this);
10941433 latheItem = menu.add(new MenuItem("Lathe"));
10951434 latheItem.addActionListener(this);
1096
- lightItem = menu.add(new MenuItem("Light"));
1097
- lightItem.addActionListener(this);
1435
+ }
1436
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1437
+ bezierItem.addActionListener(this);
1438
+// overlayItem = menu.add(new MenuItem("Overlay"));
1439
+// overlayItem.addActionListener(this);
1440
+// lightItem = menu.add(new MenuItem("Light"));
1441
+// lightItem.addActionListener(this);
10981442 menu.add("-");
10991443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11001444 //superLoopItem.addActionListener(this);
1101
- loopItem = menu.add(new MenuItem("Loop"));
1102
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
11031447 doubleItem = menu.add(new MenuItem("Fork"));
11041448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
11051451 tripleItem = menu.add(new MenuItem("Trident"));
11061452 tripleItem.addActionListener(this);
1453
+ }
11071454 }
11081455
11091456 void buildToolsMenu(Menu menu)
11101457 {
11111458 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11121459 animationItem.addItemListener(this);
1113
- animationItem.setState(CameraPane.ANIMATION);
1460
+ animationItem.setState(Globals.ANIMATION);
11141461
11151462 menu.add("-");
11161463 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11171464 parseverticesItem.addActionListener(this);
11181465 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11191466 textureFieldItem.addActionListener(this);
1120
- alignItem = menu.add(new MenuItem("Align"));
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
11211468 alignItem.addActionListener(this);
1122
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1123
- mirrorItem.addActionListener(this);
11241469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11251470 reduceMorphItem.addActionListener(this);
11261471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11271472 reduce34MorphItem.addActionListener(this);
1128
-
1473
+ menu.add("-");
11291474 menu.add(computeAOItem = new MenuItem("Compute AO"));
11301475 computeAOItem.addActionListener(this);
1131
- menu.add("-");
11321476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
11331482 menu.add(memoryItem = new MenuItem("Memory Usage"));
11341483 memoryItem.addActionListener(this);
11351484 menu.add(analyzeItem = new MenuItem("Analyze"));
11361485 analyzeItem.addActionListener(this);
1137
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
11381487 dumpItem.addActionListener(this);
11391488 // menu.add(pathItem = new MenuItem("From-to path"));
11401489 // pathItem.addActionListener(this);
....@@ -1152,6 +1501,7 @@
11521501 menu.add("-");
11531502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11541503 editScriptItem.addActionListener(this);
1504
+ }
11551505 }
11561506
11571507 void ScreenFit()
....@@ -1274,6 +1624,7 @@
12741624 shadow.material = new cMaterial(obj.material);
12751625 shadow.material.diffuse = 0.0001f;
12761626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12771628
12781629 makeSomething(shadow);
12791630 }
....@@ -1480,9 +1831,9 @@
14801831
14811832 void Overwrite(int mask)
14821833 {
1483
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14841835 {
1485
- Object3D content = GrafreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
14861837
14871838 if (content instanceof cGroup && ((cGroup)content).transientlink )
14881839 content = ((cGroup)content).get(0);
....@@ -1521,7 +1872,7 @@
15211872 {
15221873 ScreenFit();
15231874 } else
1524
- if (source == switchItem)
1875
+ if (source == switchViewItem)
15251876 {
15261877 cVector v1 = new cVector();
15271878 cVector v2 = new cVector();
....@@ -1530,11 +1881,11 @@
15301881 objEditor.cameraView.renderCamera.setAim(v2, v1);
15311882 objEditor.cameraView.repaint();
15321883 } else
1533
- if (source == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
15341885 {
15351886 makeSomething(new Box());
15361887 } else
1537
- if (source == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
15381889 {
15391890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15401891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1613,27 +1964,27 @@
16131964
16141965 makeSomething(obj);
16151966 } else
1616
- if (source == gridItem)
1967
+ if (source == gridItem || source == gridButton)
16171968 {
16181969 makeSomething(new Grid());
16191970 } else
1620
- if (source == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
16211972 {
16221973 makeSomething(new Sphere());
16231974 } else
1624
- if (source == coneItem)
1975
+ if (source == coneItem || source == coneButton)
16251976 {
16261977 makeSomething(new Cone());
16271978 } else
1628
- if (source == torusItem)
1979
+ if (source == torusItem || source == torusButton)
16291980 {
16301981 makeSomething(new Torus());
16311982 } else
1632
- if (source == superItem)
1983
+ if (source == superItem || source == superButton)
16331984 {
16341985 makeSomething(new Superellipsoid());
16351986 } else
1636
- if (source == kleinItem)
1987
+ if (source == kleinItem || source == kleinButton)
16371988 {
16381989 makeSomething(new Klein());
16391990 } else
....@@ -1653,7 +2004,7 @@
16532004 {
16542005 makeSomething(new BezierSurface());
16552006 } else
1656
- if (source == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
16572008 {
16582009 /*
16592010 Object3D obj = new BezierSurface(5,8);
....@@ -1701,7 +2052,7 @@
17012052 s.setup();
17022053 makeSomething(s);
17032054 } else
1704
- if (source == lightItem)
2055
+ if (source == lightItem || source == lightButton)
17052056 {
17062057 makeSomething(new Light());
17072058 } else
....@@ -1751,7 +2102,7 @@
17512102
17522103 group(g);
17532104 } else
1754
- if (source == loopItem)
2105
+ if (source == loopItem || source == loopButton)
17552106 {
17562107 Composite csg = new GroupLeaf();
17572108 csg.count = 5;
....@@ -1787,23 +2138,6 @@
17872138 csg.addChild(child);
17882139 child.addChild(csg);
17892140 } else
1790
-
1791
- if (source == importGFDItem)
1792
- {
1793
- ImportGFD();
1794
- } else
1795
- if (source == importVRMLX3DItem)
1796
- {
1797
- ImportVRMLX3D();
1798
- } else
1799
- if (source == import3DSItem)
1800
- {
1801
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1802
- } else
1803
- if (source == importOBJItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1806
- } else
18072141 if (source == computeAOItem)
18082142 {
18092143 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1822,7 +2156,7 @@
18222156 if (source == invariantsItem)
18232157 {
18242158 System.out.println("Invariants:");
1825
- GrafreeD.grafreeD.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
18262160 } else
18272161 if (source == memoryItem)
18282162 {
....@@ -1840,6 +2174,35 @@
18402174 if (source == dumpItem)
18412175 {
18422176 DumpObject();
2177
+ } else
2178
+ if (source == minButton)
2179
+ {
2180
+ Minimize();
2181
+ } else
2182
+ if (source == maxButton)
2183
+ {
2184
+ Maximize();
2185
+ } else
2186
+ if (source == fullButton)
2187
+ {
2188
+ ToggleFullScreen();
2189
+ } else
2190
+ if (source == undoButton)
2191
+ {
2192
+ Undo();
2193
+ } else
2194
+ if (source == redoButton)
2195
+ {
2196
+ Redo();
2197
+ } else
2198
+ if (source == saveButton)
2199
+ {
2200
+ Save();
2201
+ } else
2202
+ if (source == oneStepButton)
2203
+ {
2204
+ Globals.ONESTEP = true;
2205
+ cameraView.repaint();
18432206 } else
18442207 if (source == screenfitButton)
18452208 {
....@@ -1890,12 +2253,20 @@
18902253 {
18912254 loadClipboard(true);
18922255 } else
2256
+ if (source == undoItem)
2257
+ {
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
18932264 if (source == duplicateItem)
18942265 {
1895
- Object3D keep = GrafreeD.clipboard;
2266
+ Object3D keep = Grafreed.clipboard;
18962267 loadClipboard(false);
18972268 paste(false);
1898
- GrafreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
18992270 } else
19002271 if (source == cloneItem)
19012272 {
....@@ -1913,13 +2284,17 @@
19132284 {
19142285 paste(false);
19152286 } else
2287
+ if (source == pasteIntoItem)
2288
+ {
2289
+ pasteInto(true, false);
2290
+ } else
19162291 if (source == pasteLinkItem)
19172292 {
1918
- pasteInto(false);
2293
+ pasteInto(false, false);
19192294 } else
19202295 if (source == pasteCloneItem)
19212296 {
1922
- pasteInto(true);
2297
+ pasteInto(true, true);
19232298 } else
19242299 if (source == pasteExpandItem)
19252300 {
....@@ -2111,9 +2486,9 @@
21112486 // group.selection.get(0).setMasterThis(content); // should be identity
21122487 // refreshContents();
21132488 // }
2114
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21152490 {
2116
- Object3D content = GrafreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
21172492
21182493 if (content instanceof cGroup && ((cGroup)content).transientlink )
21192494 content = ((cGroup)content).get(0);
....@@ -2121,11 +2496,11 @@
21212496 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21222497 for (int i=0; i<group.selection.size(); i++)
21232498 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21262501 group.selection.get(i).linkVerticesThis(content);
21272502 // group.selection.get(i).setMasterThis(content); // should be identity
2128
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
21292504 }
21302505 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21312506 refreshContents();
....@@ -2135,20 +2510,20 @@
21352510 {
21362511 for (int i=0; i<group.selection.size(); i++)
21372512 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
21402515 group.selection.get(i).linkVerticesThis(null);
2141
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
21422517 }
21432518
21442519 refreshContents();
21452520 } else
21462521 if (source == relinkverticesItem)
21472522 {
2148
- boolean random = CameraPane.RANDOM;
2149
- CameraPane.RANDOM = false; // parse all random nodes
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
21502525 group.selection.RelinkToSupport();
2151
- CameraPane.RANDOM = random;
2526
+ CameraPane.SWITCH = random;
21522527
21532528 refreshContents();
21542529 } else
....@@ -2163,9 +2538,9 @@
21632538 } else
21642539 if (source == setMasterItem)
21652540 {
2166
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21672542 {
2168
- Object3D content = GrafreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
21692544
21702545 if (content instanceof cGroup && ((cGroup)content).transientlink )
21712546 content = ((cGroup)content).get(0);
....@@ -2178,9 +2553,9 @@
21782553 {
21792554 if (group.selection.size() == 1)
21802555 {
2181
- if (GrafreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
21822557 {
2183
- Object3D content = GrafreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
21842559
21852560 if (content instanceof cGroup && ((cGroup)content).transientlink )
21862561 content = ((cGroup)content).get(0);
....@@ -2197,7 +2572,7 @@
21972572 {
21982573 RevertMeshes();
21992574 } else
2200
- if (source == resetMeshItem)
2575
+ if (source == resetAllItem)
22012576 {
22022577 ResetAll();
22032578 } else
....@@ -2217,9 +2592,9 @@
22172592 {
22182593 ClearSelection(true);
22192594 } else
2220
- if (source == grabItem)
2595
+ if (source == grabItem || source == groupButton)
22212596 {
2222
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
22232598 } else
22242599 if (source == hideItem)
22252600 {
....@@ -2237,16 +2612,16 @@
22372612 {
22382613 makeSomething(new Camera());
22392614 } else
2240
- if (source == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
22412616 {
22422617 group(new Composite());
22432618 } else
2244
- if (source == randomItem)
2619
+ if (source == switchItem || source == switchButton)
22452620 {
22462621 RandomNode random = new RandomNode();
22472622 group(random);
22482623 if (random.size() > 0)
2249
- random.name = random.get(0).name + "Rnd";
2624
+ random.name = random.get(0).name + "Switch";
22502625 } else
22512626 if (source == physicsItem)
22522627 {
....@@ -2343,7 +2718,7 @@
23432718 {
23442719 group(new cLinker());
23452720 } else
2346
- if (source == textureItem)
2721
+ if (source == textureItem || source == textureButton)
23472722 {
23482723 group(new TextureNode());
23492724 } else
....@@ -2363,7 +2738,7 @@
23632738 {
23642739 CastShadow(2);
23652740 } else
2366
- if (source == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
23672742 {
23682743 //ungroup();
23692744 for (int i=0; i<group.selection.size(); i++)
....@@ -2385,7 +2760,7 @@
23852760 } else
23862761 if (source == genNormalsMESHItem)
23872762 {
2388
- GenNormals(true); // TODO
2763
+ GenNormalsMESH();
23892764 } else
23902765 if (source == genNormalsORGANItem)
23912766 {
....@@ -2450,6 +2825,22 @@
24502825 if (source == unmarkleavesItem)
24512826 {
24522827 MarkLeaves(false);
2828
+ } else
2829
+ if (source == rewindleavesItem)
2830
+ {
2831
+ RewindLeaves(true);
2832
+ } else
2833
+ if (source == unrewindleavesItem)
2834
+ {
2835
+ RewindLeaves(false);
2836
+ } else
2837
+ if (source == randomleavesItem)
2838
+ {
2839
+ RandomLeaves(true);
2840
+ } else
2841
+ if (source == unrandomleavesItem)
2842
+ {
2843
+ RandomLeaves(false);
24532844 } else
24542845 if (source == flipVItem)
24552846 {
....@@ -2535,9 +2926,13 @@
25352926 {
25362927 SmoothMesh();
25372928 } else
2538
- if (source == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
25392930 {
25402931 TransformGeometry();
2932
+ } else
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
25412936 } else
25422937 if (source == resetTransformItem)
25432938 {
....@@ -2545,7 +2940,11 @@
25452940 } else
25462941 if (source == resetCentroidItem)
25472942 {
2548
- ResetCentroid();
2943
+ ResetCentroid(true);
2944
+ } else
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
25492948 } else
25502949 if (source == resetParentItem)
25512950 {
....@@ -2677,6 +3076,10 @@
26773076 if (source == twoButton)
26783077 {
26793078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
26803083 // bug
26813084 //gridPanel.setDividerLocation(1.0);
26823085 //bigPanel.setDividerLocation(0.0);
....@@ -2709,10 +3112,31 @@
27093112 bigThree.ClearUI();
27103113 bigThree.add(centralPanel);
27113114 bigThree.FlushUI();
3115
+
3116
+ cameraView.requestFocusInWindow();
3117
+
3118
+// refreshContents(true);
3119
+//
3120
+// try
3121
+// {
3122
+// java.awt.Robot bot = new java.awt.Robot();
3123
+// int mask = InputEvent.BUTTON1_MASK;
3124
+// bot.mouseMove(100, 100);
3125
+// bot.mousePress(mask);
3126
+// bot.mouseRelease(mask);
3127
+// }
3128
+// catch (Exception e)
3129
+// {
3130
+//
3131
+// }
3132
+
27123133 } else
27133134 if (source == threeButton)
27143135 {
27153136 radio.layout = threeButton;
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
27163140
27173141 // bigThree.remove(scenePanel);
27183142 // bigThree.remove(centralPanel);
....@@ -2745,10 +3169,15 @@
27453169 bigThree.add(centralPanel);
27463170 bigThree.add(XYZPanel);
27473171 bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
27483174 } else
27493175 if (source == fourButton)
27503176 {
27513177 radio.layout = fourButton;
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
27523181
27533182 // bigThree.remove(scenePanel);
27543183 // bigThree.remove(centralPanel);
....@@ -2780,10 +3209,15 @@
27803209 bigThree.ClearUI();
27813210 bigThree.add(scenePanel);
27823211 bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
27833214 } else
27843215 if (source == sixButton)
27853216 {
27863217 radio.layout = sixButton;
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
27873221
27883222 // bigThree.remove(scenePanel);
27893223 // bigThree.remove(centralPanel);
....@@ -2816,10 +3250,15 @@
28163250 bigThree.add(scenePanel);
28173251 bigThree.add(centralPanel);
28183252 bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
28193255 } else
28203256 if (source == sevenButton)
28213257 {
28223258 radio.layout = sevenButton;
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
28233262
28243263 // bigThree.remove(scenePanel);
28253264 // bigThree.remove(centralPanel);
....@@ -2853,6 +3292,8 @@
28533292 bigThree.add(centralPanel);
28543293 bigThree.add(XYZPanel);
28553294 bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
28563297 } else
28573298 if (source == rootButton)
28583299 {
....@@ -2864,6 +3305,7 @@
28643305 EditObject(obj);
28653306 }
28663307
3308
+ cameraView.requestFocusInWindow();
28673309 refreshContents(true);
28683310 } else
28693311 if (source == closeButton)
....@@ -2873,22 +3315,37 @@
28733315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28743316 {
28753317 ab = (cRadio)e.nextElement();
2876
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28773319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
28783326 buttonGroup.remove(ab);
28793327 radioPanel.remove(ab);
28803328
2881
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
28823331 // ab.GetObject().objectUI = null; // ?????????
28833332
28843333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28853334 break;
28863335 }
28873336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
28883339 refreshContents(true);
28893340 } else
28903341 if (source == editItem || source == editButton)
28913342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
28923349 EditSelection(false);
28933350 } else
28943351 if (source == uneditButton)
....@@ -2898,12 +3355,13 @@
28983355 Object3D child = (Object3D)e.nextElement();
28993356 if(child.editWindow != null)
29003357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
29013359 child.CloseUI();
29023360 listUI.remove(child);
29033361
2904
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
29053363 }
2906
- objEditor.ctrlPanel.validate();
3364
+ objEditor.ctrlPanel.FlushUI();
29073365 //objEditor.jTree.clearSelection();
29083366 //objEditor.ResetSliders();
29093367 refreshContents(true);
....@@ -2914,6 +3372,7 @@
29143372 //copy.ClearUI();
29153373 for (Object3D obj : listUI)
29163374 {
3375
+ obj.pinned = true;
29173376 obj.CloseUI();
29183377 }
29193378 listUI.clear();
....@@ -2923,7 +3382,7 @@
29233382 {
29243383 assert(copy == group);
29253384
2926
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29273386
29283387 for (Object3D obj : listUI)
29293388 {
....@@ -2987,7 +3446,11 @@
29873446 frontView.object = group;
29883447 sideView.object = group;
29893448 }
2990
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
29913454 /*
29923455 currentLayout = radio.layout;
29933456 if (currentLayout == null)
....@@ -2999,8 +3462,23 @@
29993462 //group.parent = null; // ROOT
30003463 //group.attributes = -1;
30013464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
30023467 refreshContents(true);
3003
- }
3468
+ } else if (event.getSource() == editCameraItem)
3469
+ {
3470
+ cameraView.ProtectCamera();
3471
+ cameraView.repaint();
3472
+ return;
3473
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3474
+ {
3475
+ cameraView.RevertCamera();
3476
+ cameraView.repaint();
3477
+ return;
3478
+ // } else if (event.getSource() == textureButton)
3479
+ // {
3480
+ // return; // true;
3481
+ }
30043482 else
30053483 {
30063484 //return super.action(event, arg);
....@@ -3009,7 +3487,6 @@
30093487 }
30103488
30113489 boolean useclient = false;
3012
- cRadio radio;
30133490
30143491 void ToggleRoot()
30153492 {
....@@ -3061,6 +3538,28 @@
30613538 refreshContents();
30623539 }
30633540
3541
+ void TransformChildren()
3542
+ {
3543
+ Object3D obj;
3544
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3545
+ {
3546
+ obj = (Object3D)e.nextElement();
3547
+ obj.KeepTextureMatrices();
3548
+ obj.TransformChildren();
3549
+ obj.RestoreTextureMatrices();
3550
+
3551
+// if (obj.parent == null)
3552
+// {
3553
+// System.out.println("NULL PARENT!");
3554
+// new Exception().printStackTrace();
3555
+// }
3556
+// else
3557
+// TouchTransform(obj);
3558
+// //obj.parent.Touch();
3559
+ }
3560
+
3561
+ refreshContents();
3562
+ }
30643563
30653564 void ResetTransform()
30663565 {
....@@ -3173,7 +3672,7 @@
31733672 refreshContents();
31743673 }
31753674
3176
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
31773676 {
31783677 Object3D obj;
31793678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3188,12 +3687,16 @@
31883687 LA.matIdentity(Object3D.mat);
31893688 obj.getBounds(minima, maxima, false);
31903689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3191
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31923692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31933693 obj.TransformMesh(Object3D.mat);
3694
+
31943695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3195
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31963698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
31973700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31983701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31993702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3222,7 +3725,8 @@
32223725
32233726 int size = obj.MemorySize();
32243727
3225
- System.err.println((size/1024) + " KB is the size of " + obj);
3728
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3729
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32263730 }
32273731 }
32283732 catch (Exception e)
....@@ -3259,9 +3763,9 @@
32593763 obj = (Object3D)e.nextElement();
32603764
32613765 System.out.println("Object is: " + obj);
3262
- GrafreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
32633767 System.out.println("Boundary rep: " + obj.bRep);
3264
- GrafreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
32653769
32663770 // System.err.println((size/1024) + " KB is the size of " + obj);
32673771 }
....@@ -3303,6 +3807,13 @@
33033807 void GenNormals(boolean crease)
33043808 {
33053809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
33063817
33073818 refreshContents();
33083819 }
....@@ -3475,8 +3986,8 @@
34753986
34763987 void ParseVertices()
34773988 {
3478
- boolean epsequal = GrafreeD.epsequal;
3479
- GrafreeD.epsequal = true;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
34803991
34813992 for (int i=0; i<group.selection.size(); i++)
34823993 {
....@@ -3501,7 +4012,7 @@
35014012 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35024013 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35034014
3504
- g.add(GrafreeD.clipboard);
4015
+ g.add(Grafreed.clipboard);
35054016
35064017 buffer.add(g);
35074018 }
....@@ -3516,7 +4027,7 @@
35164027 makeSomething(buffer, i==group.selection.size()-1);
35174028 }
35184029
3519
- GrafreeD.epsequal = epsequal;
4030
+ Grafreed.epsequal = epsequal;
35204031
35214032 refreshContents();
35224033 }
....@@ -3534,7 +4045,16 @@
35344045 String pigment = Object3D.GetPigment(tex);
35354046 //String bump = Object3D.GetBump(tex);
35364047
3537
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4048
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4049
+
4050
+ try
4051
+ {
4052
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4053
+ }
4054
+ catch (Exception e)
4055
+ {
4056
+ System.err.println("FAIL: " + node);
4057
+ }
35384058
35394059 double s = v.s;
35404060
....@@ -3622,11 +4142,11 @@
36224142
36234143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36244144
3625
- boolean random = CameraPane.RANDOM;
3626
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
36274147 lowres.linkVerticesThis(null);
36284148 lowres.linkVerticesThis(sn);
3629
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
36304150
36314151 System.err.flush();
36324152
....@@ -3666,7 +4186,7 @@
36664186 return;
36674187
36684188 Object3D poses = group.selection.get(0);
3669
- Object3D ref = GrafreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
36704190
36714191 Object3D newgroup = new Object3D("Po:" + poses.name);
36724192
....@@ -3860,9 +4380,9 @@
38604380
38614381 void ClipMesh()
38624382 {
3863
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38644384 {
3865
- Object3D content = GrafreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
38664386
38674387 if (content instanceof cGroup && ((cGroup)content).transientlink )
38684388 content = ((cGroup)content).get(0);
....@@ -3871,7 +4391,7 @@
38714391 // {
38724392 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38734393 // }
3874
- group.selection.ClipMesh(GrafreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
38754395 }
38764396 // group.selection.ClipMesh(GrafreeD.clipboard);
38774397 System.out.println("DONE.");
....@@ -3918,6 +4438,18 @@
39184438 void MarkLeaves(boolean hide)
39194439 {
39204440 group.selection.MarkLeaves(hide);
4441
+ refreshContents();
4442
+ }
4443
+
4444
+ void RewindLeaves(boolean hide)
4445
+ {
4446
+ group.selection.RewindLeaves(hide);
4447
+ refreshContents();
4448
+ }
4449
+
4450
+ void RandomLeaves(boolean hide)
4451
+ {
4452
+ group.selection.RandomLeaves(hide);
39214453 refreshContents();
39224454 }
39234455
....@@ -3992,10 +4524,6 @@
39924524 // }
39934525 // }
39944526
3995
- static boolean allparams = true;
3996
-
3997
- static Vector<Object3D> listUI = new Vector<Object3D>();
3998
-
39994527 void EditSelection(boolean newWindow)
40004528 {
40014529 // aConstraints.gridy = 0;
....@@ -4003,10 +4531,10 @@
40034531 {
40044532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40054533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4006
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40074535
40084536 Object3D elem = (Object3D)group.selection.elementAt(i);
4009
- if(elem != group)
4537
+ if(elem != group || !newWindow)
40104538 {
40114539 // if (!(elem instanceof Composite))
40124540 // newWindow = false;
....@@ -4089,6 +4617,17 @@
40894617
40904618 freezemodel = true;
40914619
4620
+ //for (Object3D obj : listUI)
4621
+ for (int i=listUI.size(); --i>=0;)
4622
+ {
4623
+ Object3D obj = listUI.elementAt(i);
4624
+ if (!obj.pinned)
4625
+ {
4626
+ obj.CloseUI();
4627
+ listUI.remove(i);
4628
+ }
4629
+ }
4630
+
40924631 /**/
40934632 //switch (event.id)
40944633 {
....@@ -4096,7 +4635,6 @@
40964635 //case 702: // Event.LIST_DESELECT
40974636 group.deselectAll();
40984637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4099
- objEditor.ClearInfo(); // .GetMaterial());
41004638 if (tps != null)
41014639 {
41024640 for (int i=0; i < tps.length; i++)
....@@ -4105,10 +4643,8 @@
41054643
41064644 //if (child.parent != null)
41074645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
41084647 group.addSelectee(child);
4109
- objEditor.SetMaterial(child); // .GetMaterial());
4110
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4111
- System.err.println("info : " + child.GetPath());
41124648 }
41134649 }
41144650 // else
....@@ -4118,20 +4654,28 @@
41184654 // System.err.println("info : " + group.GetPath());
41194655 // }
41204656
4121
- objEditor.SetText(); // jan 2014
4122
-
4123
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4657
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41244658 CameraPane.flash = true;
41254659
4126
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41274661 // a camera
41284662 {
4129
- CameraPane.camerachangeframe = 0; // don't refuse it
4130
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4663
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4664
+ {
4665
+ CameraPane.camerachangeframe = 0; // don't refuse it
4666
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4667
+ }
41314668 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41324669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41334670 }
41344671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
41354679 refreshContents();
41364680 //return true;
41374681 }
....@@ -4140,6 +4684,33 @@
41404684
41414685 freezemodel = false;
41424686 }
4687
+
4688
+ void SetPinStates(boolean enabled)
4689
+ {
4690
+ editButton.setEnabled(enabled);
4691
+ uneditButton.setEnabled(enabled);
4692
+ }
4693
+
4694
+ void refreshContents(boolean cp)
4695
+ {
4696
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4698
+ {
4699
+ objEditor.ClearInfo(); // .GetMaterial());
4700
+
4701
+ for (int i=0; i < group.selection.Size(); i++)
4702
+ {
4703
+ Object3D child = (Object3D) group.selection.get(i);
4704
+
4705
+ objEditor.AddInfo(child, this, true);
4706
+ System.err.println("info : " + child.GetPath());
4707
+ }
4708
+
4709
+ objEditor.SetText(); // jan 2014
4710
+ }
4711
+
4712
+ super.refreshContents(cp);
4713
+ }
41434714
41444715 void linkSomething(Object3D thing)
41454716 {
....@@ -4211,16 +4782,19 @@
42114782 {
42124783 if (group.selection.isEmpty())
42134784 return;
4214
- GrafreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
42154787 Composite tGroup = null;
42164788 if (group.selection.size() > 0) // 1)
42174789 {
42184790 tGroup = new cGroup();
4219
- GrafreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
42204792 }
42214793
42224794 if (cut)
42234795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
42244798 //int indices[] = jList.getSelectedIndices();
42254799 //for (int i = indices.length - 1; i >= 0; i--)
42264800 //jList.remove(indices[i]);
....@@ -4256,16 +4830,16 @@
42564830 //System.out.println("cut " + child);
42574831 //System.out.println("parent = " + child.parent);
42584832 // tmp.addChild(child);
4259
- if (GrafreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
42604834 tGroup.add/*Child*/(tmp);
42614835 else
4262
- GrafreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
42634837 }
42644838 else
4265
- if (GrafreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
42664840 tGroup.add/*Child*/(child);
42674841 else
4268
- GrafreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
42694843 }
42704844
42714845 //ResetModel();
....@@ -4297,21 +4871,23 @@
42974871 //System.out.println("cut " + elem);
42984872 //System.out.println("parent = " + elem.parent);
42994873 // tmp.addChild(elem);
4300
- if (GrafreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
43014875 tGroup.add/*Child*/(tmp);
43024876 else
4303
- GrafreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
43044878 }
43054879 else
4306
- if (GrafreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
43074881 tGroup.add/*Child*/(child);
43084882 else
4309
- GrafreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
43104884 }
43114885
43124886 }
4313
- if (GrafreeD.clipboardIsTempGroup)
4314
- GrafreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
43154891 if (cut)
43164892 {
43174893 ResetModel();
....@@ -4325,7 +4901,7 @@
43254901 // return;
43264902 boolean first = true;
43274903
4328
- if (GrafreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
43294905 {
43304906 Composite temp;
43314907
....@@ -4336,7 +4912,7 @@
43364912 temp = (Composite)Applet3D.clipboard.deepCopy();
43374913 */
43384914 Object3D elem;
4339
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4915
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43404916 {
43414917 Object3D child = (Object3D)e.nextElement();
43424918
....@@ -4370,21 +4946,21 @@
43704946 //Object3D cb = Applet3D.clipboard;
43714947 //temp.addChild(cb);
43724948 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4373
- assert(GrafreeD.clipboard.parent == null);
4374
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4375
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4376
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4377
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4949
+ assert(Grafreed.clipboard.parent == null);
4950
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4951
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4952
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4953
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43784954 else
4379
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4380
- GrafreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
43814957 }
43824958
43834959 ResetModel();
43844960 refreshContents();
43854961 }
43864962
4387
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
43884964 {
43894965 // if (GrafreeD.clipboard == null)
43904966 // return;
....@@ -4413,15 +4989,22 @@
44134989 if (copyit)
44144990 {
44154991 // paste(false);
4416
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
44175000 }
44185001 else
44195002 {
44205003 boolean first = true;
44215004
4422
- if (GrafreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
44235006 {
4424
- Composite temp = (Composite)GrafreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
44255008 Object3D copy;
44265009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44275010 {
....@@ -4431,7 +5014,7 @@
44315014 }
44325015 } else
44335016 {
4434
- linkSomething(GrafreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
44355018 }
44365019 }
44375020 }
....@@ -4836,21 +5419,6 @@
48365419 }
48375420 */
48385421
4839
- void ImportGFD()
4840
- {
4841
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4842
- browser.show();
4843
- String filename = browser.getFile();
4844
- if (filename != null && filename.length() > 0)
4845
- {
4846
- String fullname = browser.getDirectory() + filename;
4847
-
4848
- //Object3D readobj =
4849
- objEditor.ReadGFD(fullname, objEditor);
4850
- //makeSomething(readobj);
4851
- }
4852
- }
4853
-
48545422 /*
48555423 public void Callback(Object obj)
48565424 {
....@@ -4874,26 +5442,9 @@
48745442 }
48755443 */
48765444
4877
- void ImportVRMLX3D()
4878
- {
4879
- if (GrafreeD.standAlone)
4880
- {
4881
- /**/
4882
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4883
- browser.show();
4884
- String filename = browser.getFile();
4885
- if (filename != null && filename.length() > 0)
4886
- {
4887
- String fullname = browser.getDirectory() + filename;
4888
- LoadVRMLX3D(fullname);
4889
- }
4890
- /**/
4891
- }
4892
- }
4893
-
48945445 String GetFile(String dialogName)
48955446 {
4896
- if (GrafreeD.standAlone)
5447
+ if (Grafreed.standAlone)
48975448 {
48985449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48995450 browser.show();
....@@ -4957,10 +5508,36 @@
49575508 cButton flashSelectionButton;
49585509 cButton editButton;
49595510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
49605512 cButton clearpanelButton;
4961
- cButton allParamsButton;
49625513 cButton unselectButton;
49635514
5515
+ cButton restoreCameraButton;
5516
+
5517
+ cButton minButton;
5518
+ cButton maxButton;
5519
+ cButton fullButton;
5520
+ cButton saveButton;
5521
+ cButton oneStepButton;
5522
+
5523
+ cButton groupButton;
5524
+ cButton ungroupButton;
5525
+ cButton compositeButton;
5526
+ cButton switchButton;
5527
+ cButton loopButton;
5528
+ cButton textureButton;
5529
+
5530
+ cButton gridButton;
5531
+ cButton boxButton;
5532
+ cButton sphereButton;
5533
+ cButton coneButton;
5534
+ cButton torusButton;
5535
+ cButton superButton;
5536
+ cButton kleinButton;
5537
+ cButton particlesButton;
5538
+ cButton overlayButton;
5539
+ cButton lightButton;
5540
+
49645541 cButton screenfitButton;
49655542 cButton screenfitpointButton;
49665543 cButton snapobjectButton;
....@@ -4972,14 +5549,6 @@
49725549
49735550 cButton setsupportButton;
49745551
4975
- cButton twoButton;
4976
- cButton sixButton;
4977
- cButton threeButton;
4978
- cButton sevenButton;
4979
- cButton fourButton; // full panel
4980
- cButton oneButton; // full XYZ
4981
- //cButton currentLayout;
4982
-
49835552 //
49845553 //Composite
49855554 Object3D // to do !!
....@@ -4989,9 +5558,11 @@
49895558 //JTree jTree;
49905559 private MenuItem lookAtItem;
49915560 private MenuItem lookFromItem;
4992
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
49935562 private MenuItem cutItem;
4994
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
49955566 private MenuItem cloneItem;
49965567 private MenuItem cloneSupportItem;
49975568 private MenuItem overwriteGeoItem;
....@@ -5004,7 +5575,7 @@
50045575 private MenuItem linkverticesItem;
50055576 private MenuItem relinkverticesItem;
50065577 private MenuItem setMasterItem;
5007
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
50085579 private MenuItem stepAllItem;
50095580 private MenuItem revertMeshItem;
50105581 private MenuItem poseMeshItem;
....@@ -5015,6 +5586,7 @@
50155586 private MenuItem mergeGeometriesItem;
50165587 private MenuItem copyItem;
50175588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
50185590 private MenuItem pasteLinkItem;
50195591 private MenuItem pasteCloneItem;
50205592 private MenuItem pasteExpandItem;
....@@ -5053,6 +5625,10 @@
50535625 private MenuItem showleavesItem;
50545626 private MenuItem markleavesItem;
50555627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
50565632
50575633 private MenuItem flipVItem;
50585634 private MenuItem unflipVItem;
....@@ -5064,15 +5640,17 @@
50645640 private MenuItem panoTexturesItem;
50655641
50665642 private MenuItem resetCentroidItem;
5067
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
50685644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
50695647 private MenuItem hideItem;
50705648 private MenuItem grabItem;
50715649 private MenuItem backItem;
50725650 private MenuItem frontItem;
50735651 private MenuItem cameraItem;
50745652 private MenuItem compositeItem;
5075
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
50765654 private MenuItem physicsItem;
50775655 private MenuItem frameselectorItem;
50785656 private MenuItem scriptNodeItem;
....@@ -5112,7 +5690,7 @@
51125690 private MenuItem blobItem;
51135691 private MenuItem latheItem;
51145692 private MenuItem bezierItem;
5115
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
51165694 private MenuItem meshItem;
51175695 // private MenuItem meshGroupItem;
51185696 private MenuItem springItem;
....@@ -5134,11 +5712,6 @@
51345712 private MenuItem doubleItem;
51355713 private MenuItem tripleItem;
51365714
5137
- private MenuItem importGFDItem;
5138
- private MenuItem importVRMLX3DItem;
5139
- private MenuItem import3DSItem;
5140
- private MenuItem importOBJItem;
5141
-
51425715 private MenuItem computeAOItem;
51435716 private MenuItem recompileItem;
51445717 private MenuItem editScriptItem;
....@@ -5148,4 +5721,8 @@
51485721 private MenuItem analyzeItem;
51495722 private MenuItem dumpItem;
51505723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
51515728 }