Normand Briere
2019-06-25 d2f456cf5280f59425084532bd2397ec625f7577
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,98 +580,199 @@
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
+
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ redoButton.setToolTipText("Redo changes");
611
+ redoButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ saveButton.setToolTipText("Save changes");
615
+ saveButton.addActionListener(this);
616
+
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618
+ liveCB.setToolTipText("Enable animation");
441619 liveCB.addItemListener(this);
442620
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);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ oneStepButton.setToolTipText("Animate one step forward");
623
+ oneStepButton.addActionListener(this);
624
+
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626
+ fastCB.setToolTipText("Fast mode");
627
+ fastCB.addItemListener(this);
628
+
629
+ //oe.toolboxPanel.Return();
630
+
631
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448632 screenfitButton.setToolTipText("Screen fit");
449633 screenfitButton.addActionListener(this);
450634
635
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636
+// trackCB.setToolTipText("Enable tracking");
637
+// trackCB.addItemListener(this);
638
+
451639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452640 // 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;
458641
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);
642
+ if (Globals.ADVANCED)
643
+ {
644
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ snapobjectButton.addActionListener(this);
646
+ snapobjectButton.setToolTipText("Snap Object");
647
+ }
648
+
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
467650
468
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
-
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471652 twoButton.setToolTipText("Show center view only");
472653 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
654
+ this.fullscreenLayout = twoButton;
655
+
656
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474657 fourButton.addActionListener(this);
475658 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
659
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477660 sixButton.setToolTipText("2-column layout left");
478661 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480663 threeButton.setToolTipText("2-column layout right");
481664 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
665
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483666 sevenButton.setToolTipText("3-column layout");
484667 sevenButton.addActionListener(this);
485668 //
486669
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- rootButton.setToolTipText("Edit object in new tab");
670
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ rootButton.setToolTipText("Edit selection in new tab");
489672 rootButton.addActionListener(this);
490
- oe.aConstraints.gridx += 1;
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
673
+
674
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492675 closeButton.setToolTipText("Close tab");
493676 closeButton.addActionListener(this);
494677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495678 //clearButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
-
498
- oe.aConstraints.gridx = 1; //
499
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
500
- editButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.aConstraints.weighty = 0;
503
- oe.aConstraints.gridwidth = 1;
504679
505
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
680
+ // INSERT
681
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ gridButton.setToolTipText("Create grid");
683
+ gridButton.addActionListener(this);
684
+
685
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ boxButton.setToolTipText("Create box");
687
+ boxButton.addActionListener(this);
688
+
689
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ sphereButton.setToolTipText("Create sphere");
691
+ sphereButton.addActionListener(this);
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.Return();
717
+
718
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ groupButton.setToolTipText("Create group");
720
+ groupButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ compositeButton.setToolTipText("Create composite");
724
+ compositeButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ switchButton.setToolTipText("Create switch");
728
+ switchButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ loopButton.setToolTipText("Create loop");
732
+ loopButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ textureButton.setToolTipText("Create texture");
736
+ textureButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ overlayButton.setToolTipText("Create overlay");
740
+ overlayButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ lightButton.setToolTipText("Create light");
744
+ lightButton.addActionListener(this);
745
+
746
+ // EDIT panel
747
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ editButton.setToolTipText("Edit selection");
749
+ editButton.addActionListener(this);
750
+
751
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ uneditButton.setToolTipText("Unedit selection");
506753 uneditButton.addActionListener(this);
507754
508
- oe.aConstraints.gridx += 1;
509
- oe.aConstraints.weighty = 0;
510
- oe.aConstraints.gridwidth = 1;
511
-
512
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
513
- clearPanelButton.addActionListener(this);
514
-
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518
-
519
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
755
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
+ allParamsButton.setToolTipText("Edit all params");
520757 allParamsButton.addActionListener(this);
521758
522
- oe.aConstraints.gridx += 1;
523
- oe.aConstraints.weighty = 0;
524
- oe.aConstraints.gridwidth = 1;
525
-
526
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
759
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ clearPanelButton.setToolTipText("Clear edit panel");
761
+ clearPanelButton.addActionListener(this);
762
+
763
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ unselectButton.setToolTipText("Unselect");
527765 unselectButton.addActionListener(this);
528766
767
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ flashSelectionButton.setToolTipText("Highlight selection");
769
+ flashSelectionButton.addActionListener(this);
770
+
771
+ editCommandsPanel.preferredHeight = 1;
772
+
773
+// oe.treePanel.add(commandsPanel);
774
+// oe.treePanel.Return();
775
+
529776 // oe.aConstraints.gridx += 1;
530777 // oe.aConstraints.weighty = 0;
531778 // oe.aConstraints.gridwidth = 1;
....@@ -537,40 +784,22 @@
537784 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
538785 // gcButton.addActionListener(this);
539786
540
- oe.aConstraints.gridx = 0;
541
- oe.aConstraints.gridy += 1;
542
-
543
- //ctrlPanel.add(objList = new List(5, true));
544
- oe.aConstraints.gridwidth = 100;
545
- // oe.aConstraints.gridheight = 100;
546
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
547
- oe.aConstraints.gridheight = 1;
548
- oe.aConstraints.weighty = 0.5;
549
- oe.aConstraints.gridx = 0;
550
- JScrollPane jSP;
787
+ cGridBag jSPPanel = new cGridBag();
788
+
789
+ JScrollPane jSP;
551790 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
552
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
553792 ResetModel();
554
- oe.aConstraints.weighty = 0.5;
555
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
556
- oe.aConstraints.gridy += 1;
557
- oe.aConstraints.gridwidth = 1;
558
-
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 2;
561
-
562
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
563
- colorCB.addItemListener(this);
564
- oe.aConstraints.gridx += 2;
565
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
566
- materialCB.addItemListener(this);
567
- oe.aConstraints.gridx += 2;
568
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
569
- textureCB.addItemListener(this);
570
-
571
- oe.aConstraints.gridx = 0;
572
- oe.aConstraints.gridy += 1;
573793
794
+ oe.treePanel.add(jSPPanel);
795
+ oe.treePanel.Return();
796
+
797
+ oe.treePanel.add(copyOptionsPanel);
798
+ oe.treePanel.Return();
799
+
800
+// mainPanel.setDividerLocation(0.5); //1.0);
801
+// mainPanel.setResizeWeight(0.5);
802
+
574803 //jList.addListSelectionListener(this);
575804 oe.jTree.addTreeSelectionListener(this);
576805 //jTree.setRootVisible(false);
....@@ -595,47 +824,57 @@
595824
596825 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
597826 {
598
- //constraints.gridx = 0;
599
- //constraints.gridy = 0;
600
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
- fastCB.setToolTipText("Fast mode");
602
- fastCB.addItemListener(this);
603
- //constraints.gridy += 1;
604
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
- supportCB.setToolTipText("Enabled rigging");
606
- supportCB.addItemListener(this);
827
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
828
+ colorCB.setToolTipText("Copy color when dropped");
829
+ colorCB.addItemListener(this);
607830
608
- // constraints.gridy += 1;
609
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
610
- // localCB.addItemListener(this);
831
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
832
+ materialCB.setToolTipText("Copy material when dropped");
833
+ materialCB.addItemListener(this);
611834
612
- //constraints.gridy += 1;
613
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
614
- crowdCB.setToolTipText("Used for crowds");
615
- crowdCB.addItemListener(this);
616
-
617
- //constraints.gridy += 1;
618
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
619
- smoothCB.setToolTipText("Snapping delay");
620
- smoothCB.addItemListener(this);
621
-
622
- //constraints.gridy += 1;
623
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624
- slowCB.setToolTipText("Smooth interpolation");
625
- slowCB.addItemListener(this);
626
- //constraints.gridy += 1;
835
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
836
+ textureCB.setToolTipText("Copy texture when dropped");
837
+ textureCB.addItemListener(this);
838
+
839
+ panel.Return();
840
+
627841 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628842 boxCB.setToolTipText("Display bounding boxes");
629843 boxCB.addItemListener(this);
630
- //constraints.gridy += 1;
844
+
631845 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632846 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633847 zoomBoxCB.addItemListener(this);
634848
849
+ if (true) // Globals.ADVANCED)
850
+ {
851
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
+ supportCB.setToolTipText("Enable rigging");
853
+ supportCB.addItemListener(this);
854
+
855
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
856
+ // localCB.addItemListener(this);
857
+
858
+ panel.Return();
859
+
860
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
861
+ crowdCB.setToolTipText("Used for crowds");
862
+ crowdCB.addItemListener(this);
863
+
864
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
865
+ smoothCB.setToolTipText("Snapping delay");
866
+ smoothCB.addItemListener(this);
867
+
868
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
869
+ slowCB.setToolTipText("Smooth interpolation");
870
+ slowCB.addItemListener(this);
871
+
635872 // constraints.gridy += 1;
636873 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
637874 // speakerMocapCB.addItemListener(this);
638875
876
+ panel.Return();
877
+
639878 if (false)
640879 {
641880 // handled in scripts
....@@ -650,26 +889,72 @@
650889 //constraints.gridy += 1;
651890 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
652891 smoothfocusCB.addItemListener(this);
892
+ panel.Return();
653893 }
654894
655895 //constraints.gridx += 1;
656896 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
657897 // debugCB.addItemListener(this);
658898
659
- //constraints.gridy += 1;
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
660903 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
661905 oeilCB.addItemListener(this);
662906
663
- //constraints.gridy += 1;
907
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
+ shadowCB.setToolTipText("Compute shadows when live");
909
+ shadowCB.addItemListener(this);
910
+
911
+ panel.Return();
912
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
913
+ toggleTextureCB.setToolTipText("Load textures");
914
+ toggleTextureCB.addItemListener(this);
915
+
916
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
+ toggleSwitchCB.setToolTipText("Use switch");
918
+ toggleSwitchCB.addItemListener(this);
919
+
920
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
+ autosaveCB.setToolTipText("Auto-save on structure change");
922
+ autosaveCB.addItemListener(this);
923
+
924
+ panel.Return();
925
+ if (Globals.ADVANCED)
926
+ {
664927 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665928 lookAtCB.setToolTipText("Look-at target");
666929 lookAtCB.addItemListener(this);
930
+ }
931
+
932
+ }
933
+
934
+ cGridBag fill = new cGridBag();
935
+ fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
940
+
941
+ panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
667944
668945 }
669946
670947 void EditObject(Object3D obj)
671948 {
672949 cRadio radioButton = new cRadio(obj.name);
950
+
951
+ // Patch to avoid bug with transparency.
952
+ radioButton.hadMaterial = obj.material != null;
953
+ if (!radioButton.hadMaterial)
954
+ {
955
+ obj.material = new cMaterial();
956
+ }
957
+
673958 radioButton.SetObject(obj);
674959 radioButton.layout = sevenButton;
675960 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -678,8 +963,11 @@
678963 buttonGroup.add(radioButton);
679964 radioButton.doClick();
680965 }
966
+
681967 void SetupViews(ObjEditor oe)
682968 {
969
+ theFrame = this;
970
+
683971 oe.SetupViews();
684972
685973 System.out.println("SetupViews");
....@@ -688,23 +976,27 @@
688976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
689977 }
690978
691
- JCheckBox liveCB;
692
- JCheckBox supportCB;
693
- JCheckBox localCB;
694
- JCheckBox crowdCB;
695
- JCheckBox smoothCB;
696
- JCheckBox fastCB;
697
- JCheckBox slowCB;
698
- JCheckBox boxCB;
699
- JCheckBox zoomBoxCB;
700
- JCheckBox trackCB;
701
- JCheckBox smoothfocusCB;
979
+ cToggleButton liveCB;
980
+ cCheckBox supportCB;
981
+ cCheckBox localCB;
982
+ cCheckBox crowdCB;
983
+ cCheckBox smoothCB;
984
+ cToggleButton fastCB;
985
+ cCheckBox slowCB;
986
+ cCheckBox boxCB;
987
+ cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
989
+ cCheckBox trackCB;
990
+ cCheckBox smoothfocusCB;
702991 // JCheckBox speakerMocapCB;
703
- JCheckBox speakerCameraCB;
704
- JCheckBox speakerFocusCB;
705
- JCheckBox debugCB;
706
- JCheckBox oeilCB;
707
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
7081000
7091001 // static int COLOR = 1;
7101002 // static int MATERIAL = 2;
....@@ -712,9 +1004,9 @@
7121004
7131005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7141006
715
- JCheckBox colorCB;
716
- JCheckBox materialCB;
717
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
7181010
7191011 public void itemStateChanged(ItemEvent e)
7201012 {
....@@ -742,6 +1034,7 @@
7421034 } else if(e.getSource() == liveCB)
7431035 {
7441036 cameraView.ToggleLive();
1037
+ refreshContents(false);
7451038 }
7461039 else if(e.getSource() == supportCB)
7471040 {
....@@ -806,6 +1099,14 @@
8061099 {
8071100 cameraView.ToggleOeil();
8081101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
8091110 else if(e.getSource() == lookAtCB)
8101111 {
8111112 cameraView.ToggleLookAt();
....@@ -822,7 +1123,8 @@
8221123
8231124 /**/
8241125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
825
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
8261128 if ((path == null) || (path.getPathCount() <= 1)) {
8271129 // We can't move the root node or an empty selection
8281130 return;
....@@ -894,7 +1196,9 @@
8941196 // objEditor.DropFile((java.io.File[]) object, true);
8951197 // return;
8961198 // }
897
- if (string.charAt(0) == '/')
1199
+
1200
+ // File path for Mac and Windows
1201
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8981202 {
8991203 // file(s)
9001204 String[] names = string.split("\n");
....@@ -921,7 +1225,7 @@
9211225
9221226 flashIt = false;
9231227 CameraPane pane = (CameraPane) target;
924
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1228
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9251229 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9261230
9271231 if (group.selection.size() == 1)
....@@ -937,23 +1241,33 @@
9371241
9381242 assert target == objEditor.jTree;
9391243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
9401245 try {
941
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9421247 } catch (Exception e) {
9431248 System.out.println("destinationPath : " + destinationPath);
9441249 return;
9451250 }
9461251
947
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
9481253 {
1254
+ Object3D child = (Object3D)group.selection.elementAt(i);
1255
+
1256
+ // Cannot move into itself
1257
+ if (child == destinationLeaf)
1258
+ return;
1259
+ }
1260
+
1261
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1262
+// {
9491263 loadClipboard(true);
9501264 objEditor.jTree.setSelectionPath(destinationPath);
951
- pasteInto(false);
952
- } else {
953
- loadClipboard(false);
954
- objEditor.jTree.setSelectionPath(destinationPath);
955
- pasteInto(false); // true); // ???
956
- }
1265
+ pasteInto(false, false);
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
9571271 }
9581272 public void dropActionChanged(DropTargetDragEvent dtde)
9591273 // Called if the user has modified the current drop gesture
....@@ -1058,85 +1372,104 @@
10581372 {
10591373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10601374 //heightFieldItem.addActionListener(this);
1061
- gridItem = menu.add(new MenuItem("Grid"));
1062
- gridItem.addActionListener(this);
1063
- rectoidItem = menu.add(new MenuItem("Box"));
1064
- rectoidItem.addActionListener(this);
1065
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1066
- ellipsoidItem.addActionListener(this);
1067
- coneItem = menu.add(new MenuItem("Cone"));
1068
- coneItem.addActionListener(this);
1069
- torusItem = menu.add(new MenuItem("Torus"));
1070
- torusItem.addActionListener(this);
1071
- superItem = menu.add(new MenuItem("Superellipsoid"));
1072
- superItem.addActionListener(this);
1375
+// gridItem = menu.add(new MenuItem("Grid"));
1376
+// gridItem.addActionListener(this);
1377
+// rectoidItem = menu.add(new MenuItem("Box"));
1378
+// rectoidItem.addActionListener(this);
1379
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1380
+// ellipsoidItem.addActionListener(this);
1381
+// coneItem = menu.add(new MenuItem("Cone"));
1382
+// coneItem.addActionListener(this);
1383
+// torusItem = menu.add(new MenuItem("Torus"));
1384
+// torusItem.addActionListener(this);
1385
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1386
+// superItem.addActionListener(this);
1387
+
1388
+ cameraItem = menu.add(new MenuItem("Camera"));
1389
+ cameraItem.addActionListener(this);
1390
+
1391
+ if (!Globals.ADVANCED)
1392
+ {
10731393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10741394 kleinItem.addActionListener(this);
1075
- particleItem = menu.add(new MenuItem("Particle system"));
1076
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
1399
+ if (Globals.ADVANCED)
1400
+ {
10771401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10781402 ragdollItem.addActionListener(this);
10791403 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10801404 ragdoll2Item.addActionListener(this);
1405
+ }
10811406 menu.add("-");
1082
- meshItem = menu.add(new MenuItem("Mesh"));
1407
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10831408 meshItem.addActionListener(this);
10841409 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10851410 // meshGroupItem.addActionListener(this);
1411
+ if (Globals.ADVANCED)
1412
+ {
10861413 springItem = menu.add(new MenuItem("Spring"));
10871414 springItem.addActionListener(this);
10881415 flagItem = menu.add(new MenuItem("Flag"));
10891416 flagItem.addActionListener(this);
1090
- bezierItem = menu.add(new MenuItem("Patch"));
1091
- bezierItem.addActionListener(this);
1092
- checkerItem = menu.add(new MenuItem("Checker"));
1093
- checkerItem.addActionListener(this);
10941417 blobItem = menu.add(new MenuItem("Blob"));
10951418 blobItem.addActionListener(this);
10961419 latheItem = menu.add(new MenuItem("Lathe"));
10971420 latheItem.addActionListener(this);
1098
- lightItem = menu.add(new MenuItem("Light"));
1099
- lightItem.addActionListener(this);
1421
+ }
1422
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1423
+ bezierItem.addActionListener(this);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
11001428 menu.add("-");
11011429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11021430 //superLoopItem.addActionListener(this);
1103
- loopItem = menu.add(new MenuItem("Loop"));
1104
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
11051433 doubleItem = menu.add(new MenuItem("Fork"));
11061434 doubleItem.addActionListener(this);
1435
+ if (Globals.ADVANCED)
1436
+ {
11071437 tripleItem = menu.add(new MenuItem("Trident"));
11081438 tripleItem.addActionListener(this);
1439
+ }
11091440 }
11101441
11111442 void buildToolsMenu(Menu menu)
11121443 {
11131444 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11141445 animationItem.addItemListener(this);
1115
- animationItem.setState(CameraPane.ANIMATION);
1446
+ animationItem.setState(Globals.ANIMATION);
11161447
11171448 menu.add("-");
11181449 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11191450 parseverticesItem.addActionListener(this);
11201451 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11211452 textureFieldItem.addActionListener(this);
1122
- alignItem = menu.add(new MenuItem("Align"));
1453
+ alignItem = menu.add(new MenuItem("Align Objects"));
11231454 alignItem.addActionListener(this);
1124
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1125
- mirrorItem.addActionListener(this);
11261455 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11271456 reduceMorphItem.addActionListener(this);
11281457 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11291458 reduce34MorphItem.addActionListener(this);
1130
-
1459
+ menu.add("-");
11311460 menu.add(computeAOItem = new MenuItem("Compute AO"));
11321461 computeAOItem.addActionListener(this);
1133
- menu.add("-");
11341462
1463
+ if (Globals.ADVANCED)
1464
+ {
1465
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1466
+ mirrorItem.addActionListener(this);
1467
+ menu.add("-");
11351468 menu.add(memoryItem = new MenuItem("Memory Usage"));
11361469 memoryItem.addActionListener(this);
11371470 menu.add(analyzeItem = new MenuItem("Analyze"));
11381471 analyzeItem.addActionListener(this);
1139
- menu.add(dumpItem = new MenuItem("Dump"));
1472
+ menu.add(dumpItem = new MenuItem("Print"));
11401473 dumpItem.addActionListener(this);
11411474 // menu.add(pathItem = new MenuItem("From-to path"));
11421475 // pathItem.addActionListener(this);
....@@ -1154,6 +1487,7 @@
11541487 menu.add("-");
11551488 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11561489 editScriptItem.addActionListener(this);
1490
+ }
11571491 }
11581492
11591493 void ScreenFit()
....@@ -1276,6 +1610,7 @@
12761610 shadow.material = new cMaterial(obj.material);
12771611 shadow.material.diffuse = 0.0001f;
12781612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
12791614
12801615 makeSomething(shadow);
12811616 }
....@@ -1482,9 +1817,9 @@
14821817
14831818 void Overwrite(int mask)
14841819 {
1485
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1820
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14861821 {
1487
- Object3D content = GrafreeD.clipboard.get(0);
1822
+ Object3D content = Grafreed.clipboard.get(0);
14881823
14891824 if (content instanceof cGroup && ((cGroup)content).transientlink )
14901825 content = ((cGroup)content).get(0);
....@@ -1523,7 +1858,7 @@
15231858 {
15241859 ScreenFit();
15251860 } else
1526
- if (source == switchItem)
1861
+ if (source == switchViewItem)
15271862 {
15281863 cVector v1 = new cVector();
15291864 cVector v2 = new cVector();
....@@ -1532,11 +1867,11 @@
15321867 objEditor.cameraView.renderCamera.setAim(v2, v1);
15331868 objEditor.cameraView.repaint();
15341869 } else
1535
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
15361871 {
15371872 makeSomething(new Box());
15381873 } else
1539
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
15401875 {
15411876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15421877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1615,27 +1950,27 @@
16151950
16161951 makeSomething(obj);
16171952 } else
1618
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
16191954 {
16201955 makeSomething(new Grid());
16211956 } else
1622
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
16231958 {
16241959 makeSomething(new Sphere());
16251960 } else
1626
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
16271962 {
16281963 makeSomething(new Cone());
16291964 } else
1630
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
16311966 {
16321967 makeSomething(new Torus());
16331968 } else
1634
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
16351970 {
16361971 makeSomething(new Superellipsoid());
16371972 } else
1638
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
16391974 {
16401975 makeSomething(new Klein());
16411976 } else
....@@ -1655,7 +1990,7 @@
16551990 {
16561991 makeSomething(new BezierSurface());
16571992 } else
1658
- if (source == checkerItem)
1993
+ if (source == overlayItem || source == overlayButton)
16591994 {
16601995 /*
16611996 Object3D obj = new BezierSurface(5,8);
....@@ -1703,7 +2038,7 @@
17032038 s.setup();
17042039 makeSomething(s);
17052040 } else
1706
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
17072042 {
17082043 makeSomething(new Light());
17092044 } else
....@@ -1753,7 +2088,7 @@
17532088
17542089 group(g);
17552090 } else
1756
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
17572092 {
17582093 Composite csg = new GroupLeaf();
17592094 csg.count = 5;
....@@ -1789,23 +2124,6 @@
17892124 csg.addChild(child);
17902125 child.addChild(csg);
17912126 } else
1792
-
1793
- if (source == importGFDItem)
1794
- {
1795
- ImportGFD();
1796
- } else
1797
- if (source == importVRMLX3DItem)
1798
- {
1799
- ImportVRMLX3D();
1800
- } else
1801
- if (source == import3DSItem)
1802
- {
1803
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1804
- } else
1805
- if (source == importOBJItem)
1806
- {
1807
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1808
- } else
18092127 if (source == computeAOItem)
18102128 {
18112129 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1824,7 +2142,7 @@
18242142 if (source == invariantsItem)
18252143 {
18262144 System.out.println("Invariants:");
1827
- GrafreeD.grafreeD.universe.invariants();
2145
+ Grafreed.grafreeD.universe.invariants();
18282146 } else
18292147 if (source == memoryItem)
18302148 {
....@@ -1842,6 +2160,35 @@
18422160 if (source == dumpItem)
18432161 {
18442162 DumpObject();
2163
+ } else
2164
+ if (source == minButton)
2165
+ {
2166
+ Minimize();
2167
+ } else
2168
+ if (source == maxButton)
2169
+ {
2170
+ Maximize();
2171
+ } else
2172
+ if (source == fullButton)
2173
+ {
2174
+ ToggleFullScreen();
2175
+ } else
2176
+ if (source == undoButton)
2177
+ {
2178
+ Undo();
2179
+ } else
2180
+ if (source == redoButton)
2181
+ {
2182
+ Redo();
2183
+ } else
2184
+ if (source == saveButton)
2185
+ {
2186
+ Save();
2187
+ } else
2188
+ if (source == oneStepButton)
2189
+ {
2190
+ Globals.ONESTEP = true;
2191
+ cameraView.repaint();
18452192 } else
18462193 if (source == screenfitButton)
18472194 {
....@@ -1892,12 +2239,20 @@
18922239 {
18932240 loadClipboard(true);
18942241 } else
2242
+ if (source == undoItem)
2243
+ {
2244
+ Undo();
2245
+ } else
2246
+ if (source == redoItem)
2247
+ {
2248
+ Redo();
2249
+ } else
18952250 if (source == duplicateItem)
18962251 {
1897
- Object3D keep = GrafreeD.clipboard;
2252
+ Object3D keep = Grafreed.clipboard;
18982253 loadClipboard(false);
18992254 paste(false);
1900
- GrafreeD.clipboard = keep;
2255
+ Grafreed.clipboard = keep;
19012256 } else
19022257 if (source == cloneItem)
19032258 {
....@@ -1915,13 +2270,17 @@
19152270 {
19162271 paste(false);
19172272 } else
2273
+ if (source == pasteIntoItem)
2274
+ {
2275
+ pasteInto(true, false);
2276
+ } else
19182277 if (source == pasteLinkItem)
19192278 {
1920
- pasteInto(false);
2279
+ pasteInto(false, false);
19212280 } else
19222281 if (source == pasteCloneItem)
19232282 {
1924
- pasteInto(true);
2283
+ pasteInto(true, true);
19252284 } else
19262285 if (source == pasteExpandItem)
19272286 {
....@@ -2113,9 +2472,9 @@
21132472 // group.selection.get(0).setMasterThis(content); // should be identity
21142473 // refreshContents();
21152474 // }
2116
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2475
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21172476 {
2118
- Object3D content = GrafreeD.clipboard.get(0);
2477
+ Object3D content = Grafreed.clipboard.get(0);
21192478
21202479 if (content instanceof cGroup && ((cGroup)content).transientlink )
21212480 content = ((cGroup)content).get(0);
....@@ -2123,11 +2482,11 @@
21232482 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21242483 for (int i=0; i<group.selection.size(); i++)
21252484 {
2126
- boolean random = CameraPane.RANDOM;
2127
- CameraPane.RANDOM = false; // parse all random nodes
2485
+ boolean random = CameraPane.SWITCH;
2486
+ CameraPane.SWITCH = false; // parse all random nodes
21282487 group.selection.get(i).linkVerticesThis(content);
21292488 // group.selection.get(i).setMasterThis(content); // should be identity
2130
- CameraPane.RANDOM = random;
2489
+ CameraPane.SWITCH = random;
21312490 }
21322491 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21332492 refreshContents();
....@@ -2137,20 +2496,20 @@
21372496 {
21382497 for (int i=0; i<group.selection.size(); i++)
21392498 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21422501 group.selection.get(i).linkVerticesThis(null);
2143
- CameraPane.RANDOM = random;
2502
+ CameraPane.SWITCH = random;
21442503 }
21452504
21462505 refreshContents();
21472506 } else
21482507 if (source == relinkverticesItem)
21492508 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2509
+ boolean random = CameraPane.SWITCH;
2510
+ CameraPane.SWITCH = false; // parse all random nodes
21522511 group.selection.RelinkToSupport();
2153
- CameraPane.RANDOM = random;
2512
+ CameraPane.SWITCH = random;
21542513
21552514 refreshContents();
21562515 } else
....@@ -2165,9 +2524,9 @@
21652524 } else
21662525 if (source == setMasterItem)
21672526 {
2168
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2527
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21692528 {
2170
- Object3D content = GrafreeD.clipboard.get(0);
2529
+ Object3D content = Grafreed.clipboard.get(0);
21712530
21722531 if (content instanceof cGroup && ((cGroup)content).transientlink )
21732532 content = ((cGroup)content).get(0);
....@@ -2180,9 +2539,9 @@
21802539 {
21812540 if (group.selection.size() == 1)
21822541 {
2183
- if (GrafreeD.clipboard.size() == 1)
2542
+ if (Grafreed.clipboard.size() == 1)
21842543 {
2185
- Object3D content = GrafreeD.clipboard.get(0);
2544
+ Object3D content = Grafreed.clipboard.get(0);
21862545
21872546 if (content instanceof cGroup && ((cGroup)content).transientlink )
21882547 content = ((cGroup)content).get(0);
....@@ -2199,7 +2558,7 @@
21992558 {
22002559 RevertMeshes();
22012560 } else
2202
- if (source == resetMeshItem)
2561
+ if (source == resetAllItem)
22032562 {
22042563 ResetAll();
22052564 } else
....@@ -2219,9 +2578,9 @@
22192578 {
22202579 ClearSelection(true);
22212580 } else
2222
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
22232582 {
2224
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
22252584 } else
22262585 if (source == hideItem)
22272586 {
....@@ -2239,16 +2598,16 @@
22392598 {
22402599 makeSomething(new Camera());
22412600 } else
2242
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
22432602 {
22442603 group(new Composite());
22452604 } else
2246
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
22472606 {
22482607 RandomNode random = new RandomNode();
22492608 group(random);
22502609 if (random.size() > 0)
2251
- random.name = random.get(0).name + "Rnd";
2610
+ random.name = random.get(0).name + "Switch";
22522611 } else
22532612 if (source == physicsItem)
22542613 {
....@@ -2345,7 +2704,7 @@
23452704 {
23462705 group(new cLinker());
23472706 } else
2348
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
23492708 {
23502709 group(new TextureNode());
23512710 } else
....@@ -2365,7 +2724,7 @@
23652724 {
23662725 CastShadow(2);
23672726 } else
2368
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
23692728 {
23702729 //ungroup();
23712730 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,7 +2746,7 @@
23872746 } else
23882747 if (source == genNormalsMESHItem)
23892748 {
2390
- GenNormals(true); // TODO
2749
+ GenNormalsMESH();
23912750 } else
23922751 if (source == genNormalsORGANItem)
23932752 {
....@@ -2452,6 +2811,22 @@
24522811 if (source == unmarkleavesItem)
24532812 {
24542813 MarkLeaves(false);
2814
+ } else
2815
+ if (source == rewindleavesItem)
2816
+ {
2817
+ RewindLeaves(true);
2818
+ } else
2819
+ if (source == unrewindleavesItem)
2820
+ {
2821
+ RewindLeaves(false);
2822
+ } else
2823
+ if (source == randomleavesItem)
2824
+ {
2825
+ RandomLeaves(true);
2826
+ } else
2827
+ if (source == unrandomleavesItem)
2828
+ {
2829
+ RandomLeaves(false);
24552830 } else
24562831 if (source == flipVItem)
24572832 {
....@@ -2537,9 +2912,13 @@
25372912 {
25382913 SmoothMesh();
25392914 } else
2540
- if (source == transformgeometryItem)
2915
+ if (source == transformGeometryItem)
25412916 {
25422917 TransformGeometry();
2918
+ } else
2919
+ if (source == transformChildrenItem)
2920
+ {
2921
+ TransformChildren();
25432922 } else
25442923 if (source == resetTransformItem)
25452924 {
....@@ -2547,7 +2926,11 @@
25472926 } else
25482927 if (source == resetCentroidItem)
25492928 {
2550
- ResetCentroid();
2929
+ ResetCentroid(true);
2930
+ } else
2931
+ if (source == resetCentroidXZItem)
2932
+ {
2933
+ ResetCentroid(false);
25512934 } else
25522935 if (source == resetParentItem)
25532936 {
....@@ -2679,6 +3062,10 @@
26793062 if (source == twoButton)
26803063 {
26813064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
26823069 // bug
26833070 //gridPanel.setDividerLocation(1.0);
26843071 //bigPanel.setDividerLocation(0.0);
....@@ -2711,10 +3098,31 @@
27113098 bigThree.ClearUI();
27123099 bigThree.add(centralPanel);
27133100 bigThree.FlushUI();
3101
+
3102
+ cameraView.requestFocusInWindow();
3103
+
3104
+// refreshContents(true);
3105
+//
3106
+// try
3107
+// {
3108
+// java.awt.Robot bot = new java.awt.Robot();
3109
+// int mask = InputEvent.BUTTON1_MASK;
3110
+// bot.mouseMove(100, 100);
3111
+// bot.mousePress(mask);
3112
+// bot.mouseRelease(mask);
3113
+// }
3114
+// catch (Exception e)
3115
+// {
3116
+//
3117
+// }
3118
+
27143119 } else
27153120 if (source == threeButton)
27163121 {
27173122 radio.layout = threeButton;
3123
+
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
27183126
27193127 // bigThree.remove(scenePanel);
27203128 // bigThree.remove(centralPanel);
....@@ -2747,10 +3155,15 @@
27473155 bigThree.add(centralPanel);
27483156 bigThree.add(XYZPanel);
27493157 bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
27503160 } else
27513161 if (source == fourButton)
27523162 {
27533163 radio.layout = fourButton;
3164
+
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
27543167
27553168 // bigThree.remove(scenePanel);
27563169 // bigThree.remove(centralPanel);
....@@ -2782,10 +3195,15 @@
27823195 bigThree.ClearUI();
27833196 bigThree.add(scenePanel);
27843197 bigThree.FlushUI();
3198
+
3199
+ cameraView.requestFocusInWindow();
27853200 } else
27863201 if (source == sixButton)
27873202 {
27883203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
27893207
27903208 // bigThree.remove(scenePanel);
27913209 // bigThree.remove(centralPanel);
....@@ -2818,10 +3236,15 @@
28183236 bigThree.add(scenePanel);
28193237 bigThree.add(centralPanel);
28203238 bigThree.FlushUI();
3239
+
3240
+ cameraView.requestFocusInWindow();
28213241 } else
28223242 if (source == sevenButton)
28233243 {
28243244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
28253248
28263249 // bigThree.remove(scenePanel);
28273250 // bigThree.remove(centralPanel);
....@@ -2855,6 +3278,8 @@
28553278 bigThree.add(centralPanel);
28563279 bigThree.add(XYZPanel);
28573280 bigThree.FlushUI();
3281
+
3282
+ cameraView.requestFocusInWindow();
28583283 } else
28593284 if (source == rootButton)
28603285 {
....@@ -2866,6 +3291,7 @@
28663291 EditObject(obj);
28673292 }
28683293
3294
+ cameraView.requestFocusInWindow();
28693295 refreshContents(true);
28703296 } else
28713297 if (source == closeButton)
....@@ -2875,18 +3301,27 @@
28753301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28763302 {
28773303 ab = (cRadio)e.nextElement();
2878
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28793305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
28803312 buttonGroup.remove(ab);
28813313 radioPanel.remove(ab);
28823314
2883
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
28843317 // ab.GetObject().objectUI = null; // ?????????
28853318
28863319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28873320 break;
28883321 }
28893322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
28903325 refreshContents(true);
28913326 } else
28923327 if (source == editItem || source == editButton)
....@@ -2903,9 +3338,9 @@
29033338 child.CloseUI();
29043339 listUI.remove(child);
29053340
2906
- child.editWindow = null; // ???????????
3341
+ //child.editWindow = null; // ???????????
29073342 }
2908
- objEditor.ctrlPanel.validate();
3343
+ objEditor.ctrlPanel.FlushUI();
29093344 //objEditor.jTree.clearSelection();
29103345 //objEditor.ResetSliders();
29113346 refreshContents(true);
....@@ -2989,7 +3424,11 @@
29893424 frontView.object = group;
29903425 sideView.object = group;
29913426 }
2992
- group.editWindow = this;
3427
+
3428
+// fix "+" issue
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
3431
+
29933432 /*
29943433 currentLayout = radio.layout;
29953434 if (currentLayout == null)
....@@ -3001,8 +3440,23 @@
30013440 //group.parent = null; // ROOT
30023441 //group.attributes = -1;
30033442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
30043445 refreshContents(true);
3005
- }
3446
+ } else if (event.getSource() == editCameraItem)
3447
+ {
3448
+ cameraView.ProtectCamera();
3449
+ cameraView.repaint();
3450
+ return;
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3452
+ {
3453
+ cameraView.RevertCamera();
3454
+ cameraView.repaint();
3455
+ return;
3456
+ // } else if (event.getSource() == textureButton)
3457
+ // {
3458
+ // return; // true;
3459
+ }
30063460 else
30073461 {
30083462 //return super.action(event, arg);
....@@ -3011,7 +3465,6 @@
30113465 }
30123466
30133467 boolean useclient = false;
3014
- cRadio radio;
30153468
30163469 void ToggleRoot()
30173470 {
....@@ -3063,6 +3516,28 @@
30633516 refreshContents();
30643517 }
30653518
3519
+ void TransformChildren()
3520
+ {
3521
+ Object3D obj;
3522
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3523
+ {
3524
+ obj = (Object3D)e.nextElement();
3525
+ obj.KeepTextureMatrices();
3526
+ obj.TransformChildren();
3527
+ obj.RestoreTextureMatrices();
3528
+
3529
+// if (obj.parent == null)
3530
+// {
3531
+// System.out.println("NULL PARENT!");
3532
+// new Exception().printStackTrace();
3533
+// }
3534
+// else
3535
+// TouchTransform(obj);
3536
+// //obj.parent.Touch();
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
30663541
30673542 void ResetTransform()
30683543 {
....@@ -3175,7 +3650,7 @@
31753650 refreshContents();
31763651 }
31773652
3178
- void ResetCentroid()
3653
+ void ResetCentroid(boolean full)
31793654 {
31803655 Object3D obj;
31813656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3190,12 +3665,16 @@
31903665 LA.matIdentity(Object3D.mat);
31913666 obj.getBounds(minima, maxima, false);
31923667 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3193
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3668
+ if (full)
3669
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31943670 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31953671 obj.TransformMesh(Object3D.mat);
3672
+
31963673 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3197
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3674
+ if (full)
3675
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31983676 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3677
+
31993678 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32003679 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32013680 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3224,7 +3703,8 @@
32243703
32253704 int size = obj.MemorySize();
32263705
3227
- System.err.println((size/1024) + " KB is the size of " + obj);
3706
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3707
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32283708 }
32293709 }
32303710 catch (Exception e)
....@@ -3261,9 +3741,9 @@
32613741 obj = (Object3D)e.nextElement();
32623742
32633743 System.out.println("Object is: " + obj);
3264
- GrafreeD.AnalyzeObject(obj);
3744
+ Grafreed.AnalyzeObject(obj);
32653745 System.out.println("Boundary rep: " + obj.bRep);
3266
- GrafreeD.AnalyzeObject(obj.bRep);
3746
+ Grafreed.AnalyzeObject(obj.bRep);
32673747
32683748 // System.err.println((size/1024) + " KB is the size of " + obj);
32693749 }
....@@ -3305,6 +3785,13 @@
33053785 void GenNormals(boolean crease)
33063786 {
33073787 group.GenNormalsS(crease);
3788
+
3789
+ refreshContents();
3790
+ }
3791
+
3792
+ void GenNormalsMESH()
3793
+ {
3794
+ group.GenNormalsMeshS();
33083795
33093796 refreshContents();
33103797 }
....@@ -3477,8 +3964,8 @@
34773964
34783965 void ParseVertices()
34793966 {
3480
- boolean epsequal = GrafreeD.epsequal;
3481
- GrafreeD.epsequal = true;
3967
+ boolean epsequal = Grafreed.epsequal;
3968
+ Grafreed.epsequal = true;
34823969
34833970 for (int i=0; i<group.selection.size(); i++)
34843971 {
....@@ -3503,7 +3990,7 @@
35033990 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35043991 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35053992
3506
- g.add(GrafreeD.clipboard);
3993
+ g.add(Grafreed.clipboard);
35073994
35083995 buffer.add(g);
35093996 }
....@@ -3518,7 +4005,7 @@
35184005 makeSomething(buffer, i==group.selection.size()-1);
35194006 }
35204007
3521
- GrafreeD.epsequal = epsequal;
4008
+ Grafreed.epsequal = epsequal;
35224009
35234010 refreshContents();
35244011 }
....@@ -3536,7 +4023,16 @@
35364023 String pigment = Object3D.GetPigment(tex);
35374024 //String bump = Object3D.GetBump(tex);
35384025
3539
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4026
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4027
+
4028
+ try
4029
+ {
4030
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4031
+ }
4032
+ catch (Exception e)
4033
+ {
4034
+ System.err.println("FAIL: " + node);
4035
+ }
35404036
35414037 double s = v.s;
35424038
....@@ -3624,11 +4120,11 @@
36244120
36254121 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36264122
3627
- boolean random = CameraPane.RANDOM;
3628
- CameraPane.RANDOM = false; // parse all random nodes
4123
+ boolean random = CameraPane.SWITCH;
4124
+ CameraPane.SWITCH = false; // parse all random nodes
36294125 lowres.linkVerticesThis(null);
36304126 lowres.linkVerticesThis(sn);
3631
- CameraPane.RANDOM = random;
4127
+ CameraPane.SWITCH = random;
36324128
36334129 System.err.flush();
36344130
....@@ -3668,7 +4164,7 @@
36684164 return;
36694165
36704166 Object3D poses = group.selection.get(0);
3671
- Object3D ref = GrafreeD.clipboard.get(0);
4167
+ Object3D ref = Grafreed.clipboard.get(0);
36724168
36734169 Object3D newgroup = new Object3D("Po:" + poses.name);
36744170
....@@ -3862,9 +4358,9 @@
38624358
38634359 void ClipMesh()
38644360 {
3865
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4361
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38664362 {
3867
- Object3D content = GrafreeD.clipboard.get(0);
4363
+ Object3D content = Grafreed.clipboard.get(0);
38684364
38694365 if (content instanceof cGroup && ((cGroup)content).transientlink )
38704366 content = ((cGroup)content).get(0);
....@@ -3873,7 +4369,7 @@
38734369 // {
38744370 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38754371 // }
3876
- group.selection.ClipMesh(GrafreeD.clipboard);
4372
+ group.selection.ClipMesh(Grafreed.clipboard);
38774373 }
38784374 // group.selection.ClipMesh(GrafreeD.clipboard);
38794375 System.out.println("DONE.");
....@@ -3920,6 +4416,18 @@
39204416 void MarkLeaves(boolean hide)
39214417 {
39224418 group.selection.MarkLeaves(hide);
4419
+ refreshContents();
4420
+ }
4421
+
4422
+ void RewindLeaves(boolean hide)
4423
+ {
4424
+ group.selection.RewindLeaves(hide);
4425
+ refreshContents();
4426
+ }
4427
+
4428
+ void RandomLeaves(boolean hide)
4429
+ {
4430
+ group.selection.RandomLeaves(hide);
39234431 refreshContents();
39244432 }
39254433
....@@ -4005,10 +4513,10 @@
40054513 {
40064514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40074515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4008
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40094517
40104518 Object3D elem = (Object3D)group.selection.elementAt(i);
4011
- if(elem != group)
4519
+ if(elem != group || !newWindow)
40124520 {
40134521 // if (!(elem instanceof Composite))
40144522 // newWindow = false;
....@@ -4098,7 +4606,6 @@
40984606 //case 702: // Event.LIST_DESELECT
40994607 group.deselectAll();
41004608 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4101
- objEditor.ClearInfo(); // .GetMaterial());
41024609 if (tps != null)
41034610 {
41044611 for (int i=0; i < tps.length; i++)
....@@ -4107,29 +4614,28 @@
41074614
41084615 //if (child.parent != null)
41094616 //child.parent.addSelectee(child);
4617
+ objEditor.SetMaterial(child);
41104618 group.addSelectee(child);
4111
- objEditor.SetMaterial(child); // .GetMaterial());
4112
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4113
- System.err.println("info : " + child.GetPath());
41144619 }
41154620 }
4116
- else
4117
- {
4118
- objEditor.SetMaterial(group); // .GetMaterial());
4119
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4120
- System.err.println("info : " + group.GetPath());
4121
- }
4621
+// else
4622
+// {
4623
+// objEditor.SetMaterial(group); // .GetMaterial());
4624
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4625
+// System.err.println("info : " + group.GetPath());
4626
+// }
41224627
4123
- objEditor.SetText(); // jan 2014
4124
-
4125
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4628
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41264629 CameraPane.flash = true;
41274630
4128
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4631
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41294632 // a camera
41304633 {
4131
- CameraPane.camerachangeframe = 0; // don't refuse it
4132
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4634
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4635
+ {
4636
+ CameraPane.camerachangeframe = 0; // don't refuse it
4637
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4638
+ }
41334639 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41344640 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41354641 }
....@@ -4142,6 +4648,27 @@
41424648
41434649 freezemodel = false;
41444650 }
4651
+
4652
+ void refreshContents(boolean cp)
4653
+ {
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4656
+ {
4657
+ objEditor.ClearInfo(); // .GetMaterial());
4658
+
4659
+ for (int i=0; i < group.selection.Size(); i++)
4660
+ {
4661
+ Object3D child = (Object3D) group.selection.get(i);
4662
+
4663
+ objEditor.AddInfo(child, this, true);
4664
+ System.err.println("info : " + child.GetPath());
4665
+ }
4666
+
4667
+ objEditor.SetText(); // jan 2014
4668
+ }
4669
+
4670
+ super.refreshContents(cp);
4671
+ }
41454672
41464673 void linkSomething(Object3D thing)
41474674 {
....@@ -4213,16 +4740,19 @@
42134740 {
42144741 if (group.selection.isEmpty())
42154742 return;
4216
- GrafreeD.clipboardIsTempGroup = false;
4743
+
4744
+ Grafreed.clipboardIsTempGroup = false;
42174745 Composite tGroup = null;
42184746 if (group.selection.size() > 0) // 1)
42194747 {
42204748 tGroup = new cGroup();
4221
- GrafreeD.clipboardIsTempGroup = true;
4749
+ Grafreed.clipboardIsTempGroup = true;
42224750 }
42234751
42244752 if (cut)
42254753 {
4754
+ if (Globals.SAVEONMAKE)
4755
+ Save();
42264756 //int indices[] = jList.getSelectedIndices();
42274757 //for (int i = indices.length - 1; i >= 0; i--)
42284758 //jList.remove(indices[i]);
....@@ -4258,16 +4788,16 @@
42584788 //System.out.println("cut " + child);
42594789 //System.out.println("parent = " + child.parent);
42604790 // tmp.addChild(child);
4261
- if (GrafreeD.clipboardIsTempGroup)
4791
+ if (Grafreed.clipboardIsTempGroup)
42624792 tGroup.add/*Child*/(tmp);
42634793 else
4264
- GrafreeD.clipboard = tmp;
4794
+ Grafreed.clipboard = tmp;
42654795 }
42664796 else
4267
- if (GrafreeD.clipboardIsTempGroup)
4797
+ if (Grafreed.clipboardIsTempGroup)
42684798 tGroup.add/*Child*/(child);
42694799 else
4270
- GrafreeD.clipboard = child;
4800
+ Grafreed.clipboard = child;
42714801 }
42724802
42734803 //ResetModel();
....@@ -4299,21 +4829,23 @@
42994829 //System.out.println("cut " + elem);
43004830 //System.out.println("parent = " + elem.parent);
43014831 // tmp.addChild(elem);
4302
- if (GrafreeD.clipboardIsTempGroup)
4832
+ if (Grafreed.clipboardIsTempGroup)
43034833 tGroup.add/*Child*/(tmp);
43044834 else
4305
- GrafreeD.clipboard = tmp;
4835
+ Grafreed.clipboard = tmp;
43064836 }
43074837 else
4308
- if (GrafreeD.clipboardIsTempGroup)
4838
+ if (Grafreed.clipboardIsTempGroup)
43094839 tGroup.add/*Child*/(child);
43104840 else
4311
- GrafreeD.clipboard = child;
4841
+ Grafreed.clipboard = child;
43124842 }
43134843
43144844 }
4315
- if (GrafreeD.clipboardIsTempGroup)
4316
- GrafreeD.clipboard = tGroup;
4845
+
4846
+ if (Grafreed.clipboardIsTempGroup)
4847
+ Grafreed.clipboard = tGroup;
4848
+
43174849 if (cut)
43184850 {
43194851 ResetModel();
....@@ -4327,7 +4859,7 @@
43274859 // return;
43284860 boolean first = true;
43294861
4330
- if (GrafreeD.clipboardIsTempGroup)
4862
+ if (Grafreed.clipboardIsTempGroup)
43314863 {
43324864 Composite temp;
43334865
....@@ -4338,7 +4870,7 @@
43384870 temp = (Composite)Applet3D.clipboard.deepCopy();
43394871 */
43404872 Object3D elem;
4341
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4873
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43424874 {
43434875 Object3D child = (Object3D)e.nextElement();
43444876
....@@ -4372,21 +4904,21 @@
43724904 //Object3D cb = Applet3D.clipboard;
43734905 //temp.addChild(cb);
43744906 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4375
- assert(GrafreeD.clipboard.parent == null);
4376
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4377
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4378
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4379
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4907
+ assert(Grafreed.clipboard.parent == null);
4908
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4909
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4910
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4911
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43804912 else
4381
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4382
- GrafreeD.clipboard.get(0).parent = keepparent;
4913
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4914
+ Grafreed.clipboard.get(0).parent = keepparent;
43834915 }
43844916
43854917 ResetModel();
43864918 refreshContents();
43874919 }
43884920
4389
- void pasteInto(boolean copyit)
4921
+ void pasteInto(boolean copyit, boolean clone)
43904922 {
43914923 // if (GrafreeD.clipboard == null)
43924924 // return;
....@@ -4415,15 +4947,22 @@
44154947 if (copyit)
44164948 {
44174949 // paste(false);
4418
- CloneClipboard(false); // sept 2014
4950
+ if (clone)
4951
+ {
4952
+ CloneClipboard(false); // sept 2014
4953
+ }
4954
+ else
4955
+ {
4956
+ paste(false);
4957
+ }
44194958 }
44204959 else
44214960 {
44224961 boolean first = true;
44234962
4424
- if (GrafreeD.clipboardIsTempGroup)
4963
+ if (Grafreed.clipboardIsTempGroup)
44254964 {
4426
- Composite temp = (Composite)GrafreeD.clipboard;
4965
+ Composite temp = (Composite)Grafreed.clipboard;
44274966 Object3D copy;
44284967 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44294968 {
....@@ -4433,7 +4972,7 @@
44334972 }
44344973 } else
44354974 {
4436
- linkSomething(GrafreeD.clipboard); //.get(0));
4975
+ linkSomething(Grafreed.clipboard); //.get(0));
44374976 }
44384977 }
44394978 }
....@@ -4838,21 +5377,6 @@
48385377 }
48395378 */
48405379
4841
- void ImportGFD()
4842
- {
4843
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4844
- browser.show();
4845
- String filename = browser.getFile();
4846
- if (filename != null && filename.length() > 0)
4847
- {
4848
- String fullname = browser.getDirectory() + filename;
4849
-
4850
- //Object3D readobj =
4851
- objEditor.ReadGFD(fullname, objEditor);
4852
- //makeSomething(readobj);
4853
- }
4854
- }
4855
-
48565380 /*
48575381 public void Callback(Object obj)
48585382 {
....@@ -4876,26 +5400,9 @@
48765400 }
48775401 */
48785402
4879
- void ImportVRMLX3D()
4880
- {
4881
- if (GrafreeD.standAlone)
4882
- {
4883
- /**/
4884
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4885
- browser.show();
4886
- String filename = browser.getFile();
4887
- if (filename != null && filename.length() > 0)
4888
- {
4889
- String fullname = browser.getDirectory() + filename;
4890
- LoadVRMLX3D(fullname);
4891
- }
4892
- /**/
4893
- }
4894
- }
4895
-
48965403 String GetFile(String dialogName)
48975404 {
4898
- if (GrafreeD.standAlone)
5405
+ if (Grafreed.standAlone)
48995406 {
49005407 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49015408 browser.show();
....@@ -4959,10 +5466,38 @@
49595466 cButton flashSelectionButton;
49605467 cButton editButton;
49615468 cButton uneditButton;
5469
+ JCheckBox allParamsButton;
49625470 cButton clearpanelButton;
4963
- cButton allParamsButton;
49645471 cButton unselectButton;
49655472
5473
+ cButton restoreCameraButton;
5474
+
5475
+ cButton minButton;
5476
+ cButton maxButton;
5477
+ cButton fullButton;
5478
+ cButton undoButton;
5479
+ cButton redoButton;
5480
+ cButton saveButton;
5481
+ cButton oneStepButton;
5482
+
5483
+ cButton groupButton;
5484
+ cButton ungroupButton;
5485
+ cButton compositeButton;
5486
+ cButton switchButton;
5487
+ cButton loopButton;
5488
+ cButton textureButton;
5489
+
5490
+ cButton gridButton;
5491
+ cButton boxButton;
5492
+ cButton sphereButton;
5493
+ cButton coneButton;
5494
+ cButton torusButton;
5495
+ cButton superButton;
5496
+ cButton kleinButton;
5497
+ cButton particlesButton;
5498
+ cButton overlayButton;
5499
+ cButton lightButton;
5500
+
49665501 cButton screenfitButton;
49675502 cButton screenfitpointButton;
49685503 cButton snapobjectButton;
....@@ -4974,14 +5509,6 @@
49745509
49755510 cButton setsupportButton;
49765511
4977
- cButton twoButton;
4978
- cButton sixButton;
4979
- cButton threeButton;
4980
- cButton sevenButton;
4981
- cButton fourButton; // full panel
4982
- cButton oneButton; // full XYZ
4983
- //cButton currentLayout;
4984
-
49855512 //
49865513 //Composite
49875514 Object3D // to do !!
....@@ -4991,9 +5518,11 @@
49915518 //JTree jTree;
49925519 private MenuItem lookAtItem;
49935520 private MenuItem lookFromItem;
4994
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
49955522 private MenuItem cutItem;
4996
- private MenuItem duplicateItem;
5523
+ private MenuItem undoItem;
5524
+ private MenuItem redoItem;
5525
+ private JMenuItem duplicateItem;
49975526 private MenuItem cloneItem;
49985527 private MenuItem cloneSupportItem;
49995528 private MenuItem overwriteGeoItem;
....@@ -5006,7 +5535,7 @@
50065535 private MenuItem linkverticesItem;
50075536 private MenuItem relinkverticesItem;
50085537 private MenuItem setMasterItem;
5009
- private MenuItem resetMeshItem;
5538
+ private MenuItem resetAllItem;
50105539 private MenuItem stepAllItem;
50115540 private MenuItem revertMeshItem;
50125541 private MenuItem poseMeshItem;
....@@ -5017,6 +5546,7 @@
50175546 private MenuItem mergeGeometriesItem;
50185547 private MenuItem copyItem;
50195548 private MenuItem pasteItem;
5549
+ private MenuItem pasteIntoItem;
50205550 private MenuItem pasteLinkItem;
50215551 private MenuItem pasteCloneItem;
50225552 private MenuItem pasteExpandItem;
....@@ -5055,6 +5585,10 @@
50555585 private MenuItem showleavesItem;
50565586 private MenuItem markleavesItem;
50575587 private MenuItem unmarkleavesItem;
5588
+ private MenuItem rewindleavesItem;
5589
+ private MenuItem unrewindleavesItem;
5590
+ private MenuItem randomleavesItem;
5591
+ private MenuItem unrandomleavesItem;
50585592
50595593 private MenuItem flipVItem;
50605594 private MenuItem unflipVItem;
....@@ -5066,15 +5600,17 @@
50665600 private MenuItem panoTexturesItem;
50675601
50685602 private MenuItem resetCentroidItem;
5069
- private MenuItem transformgeometryItem;
5603
+ private MenuItem resetCentroidXZItem;
50705604 private MenuItem resetTransformItem;
5605
+ private MenuItem transformGeometryItem;
5606
+ private MenuItem transformChildrenItem;
50715607 private MenuItem hideItem;
50725608 private MenuItem grabItem;
50735609 private MenuItem backItem;
50745610 private MenuItem frontItem;
50755611 private MenuItem cameraItem;
50765612 private MenuItem compositeItem;
5077
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
50785614 private MenuItem physicsItem;
50795615 private MenuItem frameselectorItem;
50805616 private MenuItem scriptNodeItem;
....@@ -5114,7 +5650,7 @@
51145650 private MenuItem blobItem;
51155651 private MenuItem latheItem;
51165652 private MenuItem bezierItem;
5117
- private MenuItem checkerItem;
5653
+ private MenuItem overlayItem;
51185654 private MenuItem meshItem;
51195655 // private MenuItem meshGroupItem;
51205656 private MenuItem springItem;
....@@ -5136,11 +5672,6 @@
51365672 private MenuItem doubleItem;
51375673 private MenuItem tripleItem;
51385674
5139
- private MenuItem importGFDItem;
5140
- private MenuItem importVRMLX3DItem;
5141
- private MenuItem import3DSItem;
5142
- private MenuItem importOBJItem;
5143
-
51445675 private MenuItem computeAOItem;
51455676 private MenuItem recompileItem;
51465677 private MenuItem editScriptItem;
....@@ -5150,4 +5681,8 @@
51505681 private MenuItem analyzeItem;
51515682 private MenuItem dumpItem;
51525683 //boolean freezemodel = false;
5684
+
5685
+ Menu cameraMenu;
5686
+ MenuItem editCameraItem;
5687
+ MenuItem restoreCameraItem;
51535688 }