Normand Briere
2019-06-24 c67da2e5d8655704601d6d06e8bc60aabe212253
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,8 +148,129 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
153274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,45 +282,17 @@
161282 lookAtItem.addActionListener(this);
162283 //lookFromItem.addActinoListener(this);
163284 //switchItem.addActionListener(this);
164
- Menu menu;
165
- oe.menuBar.add(menu = new Menu("Edit"));
166
- //editItem = menu.add(new MenuItem("Edit"));
167
- //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
169
- duplicateItem.addActionListener(this);
170
- menu.add("-");
171
- cloneItem = menu.add(new MenuItem("Clone"));
172
- cloneItem.addActionListener(this);
173
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174
- cloneSupportItem.addActionListener(this);
175
- menu.add("-");
176
- cutItem = menu.add(new MenuItem("Cut"));
177
- cutItem.addActionListener(this);
178
- copyItem = menu.add(new MenuItem("Copy"));
179
- copyItem.addActionListener(this);
180
- pasteItem = menu.add(new MenuItem("Paste"));
181
- pasteItem.addActionListener(this);
182
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
183
- pasteLinkItem.addActionListener(this);
184
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185
- pasteCloneItem.addActionListener(this);
186
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187
-// pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
190
- clearAllItem = menu.add(new MenuItem("Clear All"));
191
- clearAllItem.addActionListener(this);
192
-
285
+ }
286
+
193287 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);
288
+ if (Globals.ADVANCED)
289
+ {
198290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199291 revertMeshItem.addActionListener(this);
200292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201293 resetreferencesItem.addActionListener(this);
202294 menu.add("-");
295
+ }
203296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204297 overwriteGeoItem.addActionListener(this);
205298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +304,26 @@
211304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212305 overwriteUVItem.addActionListener(this);
213306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
214309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215310 generateMeshItem.addActionListener(this);
216311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217312 poseMeshItem.addActionListener(this);
218313 menu.add("-");
314
+ }
219315 resetsupportItem = menu.add(new MenuItem("Reset support"));
220316 resetsupportItem.addActionListener(this);
221317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222318 linkverticesItem.addActionListener(this);
223319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
225324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226325 setMasterItem.addActionListener(this);
326
+ }
227327
228328 oe.menuBar.add(menu = new Menu("Group"));
229329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,27 +334,32 @@
234334 frontItem.addActionListener(this);
235335 compositeItem = menu.add(new MenuItem("Composite"));
236336 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238338 hideItem.addActionListener(this);
239339 ungroupItem = menu.add(new MenuItem("Ungroup"));
240340 ungroupItem.addActionListener(this);
241341 menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
243343 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);
248344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249345 switchGeoItem.addActionListener(this);
250346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251347 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
253349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
254358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255359 scriptNodeItem.addActionListener(this);
256360 cameraItem = menu.add(new MenuItem("Camera"));
257361 cameraItem.addActionListener(this);
362
+ }
258363
259364 oe.menuBar.add(menu = new Menu("Object"));
260365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -263,27 +368,35 @@
263368 billboardItem.addActionListener(this);
264369 csgItem = menu.add(new MenuItem("CSG"));
265370 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267372 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269374 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
272380 linkerItem = menu.add(new MenuItem("Linker"));
273381 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276382 attributeItem = menu.add(new MenuItem("Attribute"));
277383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
278386 pointflowItem = menu.add(new MenuItem("Point Flow"));
279387 pointflowItem.addActionListener(this);
388
+ }
280389 menu.add("-");
281390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282391 resetTransformItem.addActionListener(this);
283392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284393 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
287400
288401 oe.menuBar.add(menu = new Menu("Geometry"));
289402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +407,11 @@
294407 genNormalsCADItem.addActionListener(this);
295408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
297412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298413 genNormalsMINEItem.addActionListener(this);
414
+ }
299415 stripifyItem = menu.add(new MenuItem("Stripify"));
300416 stripifyItem.addActionListener(this);
301417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +433,34 @@
317433 reduce34MeshItem.addActionListener(this);
318434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319435 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
324444
325445 oe.menuBar.add(menu = new Menu("Attributes"));
326446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
328452 menu.add("-");
329453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330454 liveleavesItem.addActionListener(this);
331455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
333459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334460 supportleavesItem.addActionListener(this);
335461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336462 unsupportleavesItem.addActionListener(this);
463
+ }
337464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338465 hideleavesItem.addActionListener(this);
339466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +469,14 @@
342469 markleavesItem.addActionListener(this);
343470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
345480 menu.add("-");
346481 flipVItem = menu.add(new MenuItem("Flip V"));
347482 flipVItem.addActionListener(this);
....@@ -377,35 +512,40 @@
377512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378513 sortbynameItem.addActionListener(this);
379514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
380522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381523 extractGeometriesItem.addActionListener(this);
382524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383525 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);
526
+ }
388527
389528 oe.menuBar.add(menu = new Menu("Insert"));
390529 buildCreateMenu(menu);
391530
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
-
403531 oe.menuBar.add(menu = new Menu("Tools"));
404532 buildToolsMenu(menu);
405533 }
406534
407535 void SetupUI2(ObjEditor oe)
408536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
409549 //new Exception().printStackTrace();
410550
411551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -436,90 +576,117 @@
436576 */
437577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438578
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
439603 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
604
+ liveCB.setToolTipText("Enable animation");
441605 liveCB.addItemListener(this);
442606
443
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
613
+ fastCB.addItemListener(this);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
444616 trackCB.setToolTipText("Enable tracking");
445617 trackCB.addItemListener(this);
446618
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448620 screenfitButton.setToolTipText("Screen fit");
449621 screenfitButton.addActionListener(this);
450622
451623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452624 // 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;
458625
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);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
465634 flashSelectionButton.setToolTipText("Show selection");
466635 flashSelectionButton.addActionListener(this);
467636
468637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469638
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471640 twoButton.setToolTipText("Show center view only");
472641 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474643 fourButton.addActionListener(this);
475644 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477646 sixButton.setToolTipText("2-column layout left");
478647 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480649 threeButton.setToolTipText("2-column layout right");
481650 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483652 sevenButton.setToolTipText("3-column layout");
484653 sevenButton.addActionListener(this);
485654 //
486655
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488657 rootButton.setToolTipText("Edit selection in new tab");
489658 rootButton.addActionListener(this);
490659
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492661 closeButton.setToolTipText("Close tab");
493662 closeButton.addActionListener(this);
494663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495664 //clearButton.addActionListener(this);
496665
497
- cGridBag commandsPanel = new cGridBag();
498
-
499
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500667 editButton.setToolTipText("Edit selection");
501668 editButton.addActionListener(this);
502669
503
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504671 uneditButton.setToolTipText("Unedit selection");
505672 uneditButton.addActionListener(this);
506673
507
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
676
+ allParamsButton.addActionListener(this);
677
+
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508679 clearPanelButton.setToolTipText("Clear edit panel");
509680 clearPanelButton.addActionListener(this);
510681
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);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516683 unselectButton.setToolTipText("Unselect");
517684 unselectButton.addActionListener(this);
518685
519
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
520687
521
- oe.treePanel.add(commandsPanel);
522
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
523690
524691 // oe.aConstraints.gridx += 1;
525692 // oe.aConstraints.weighty = 0;
....@@ -587,43 +754,35 @@
587754
588755 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589756 {
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);
599
-
600
- // constraints.gridy += 1;
601
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602
- // localCB.addItemListener(this);
603
-
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;
619757 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620758 boxCB.setToolTipText("Display bounding boxes");
621759 boxCB.addItemListener(this);
622
- //constraints.gridy += 1;
760
+
623761 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624762 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625763 zoomBoxCB.addItemListener(this);
626764
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
627786 // constraints.gridy += 1;
628787 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629788 // speakerMocapCB.addItemListener(this);
....@@ -648,14 +807,22 @@
648807 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649808 // debugCB.addItemListener(this);
650809
651
- //constraints.gridy += 1;
652810 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
653812 oeilCB.addItemListener(this);
654813
655
- //constraints.gridy += 1;
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ if (Globals.ADVANCED)
819
+ {
656820 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657821 lookAtCB.setToolTipText("Look-at target");
658822 lookAtCB.addItemListener(this);
823
+ }
824
+
825
+ }
659826
660827 cGridBag fill = new cGridBag();
661828
....@@ -668,6 +835,14 @@
668835 void EditObject(Object3D obj)
669836 {
670837 cRadio radioButton = new cRadio(obj.name);
838
+
839
+ // Patch to avoid bug with transparency.
840
+ radioButton.hadMaterial = obj.material != null;
841
+ if (!radioButton.hadMaterial)
842
+ {
843
+ obj.material = new cMaterial();
844
+ }
845
+
671846 radioButton.SetObject(obj);
672847 radioButton.layout = sevenButton;
673848 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -676,8 +851,11 @@
676851 buttonGroup.add(radioButton);
677852 radioButton.doClick();
678853 }
854
+
679855 void SetupViews(ObjEditor oe)
680856 {
857
+ theFrame = this;
858
+
681859 oe.SetupViews();
682860
683861 System.out.println("SetupViews");
....@@ -701,7 +879,9 @@
701879 JCheckBox speakerCameraCB;
702880 JCheckBox speakerFocusCB;
703881 JCheckBox debugCB;
882
+
704883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
705885 JCheckBox lookAtCB;
706886
707887 // static int COLOR = 1;
....@@ -740,6 +920,7 @@
740920 } else if(e.getSource() == liveCB)
741921 {
742922 cameraView.ToggleLive();
923
+ refreshContents(false);
743924 }
744925 else if(e.getSource() == supportCB)
745926 {
....@@ -803,6 +984,10 @@
803984 else if(e.getSource() == oeilCB)
804985 {
805986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
806991 }
807992 else if(e.getSource() == lookAtCB)
808993 {
....@@ -892,7 +1077,9 @@
8921077 // objEditor.DropFile((java.io.File[]) object, true);
8931078 // return;
8941079 // }
895
- if (string.charAt(0) == '/')
1080
+
1081
+ // File path for Mac and Windows
1082
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8961083 {
8971084 // file(s)
8981085 String[] names = string.split("\n");
....@@ -919,7 +1106,7 @@
9191106
9201107 flashIt = false;
9211108 CameraPane pane = (CameraPane) target;
922
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1109
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9231110 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9241111
9251112 if (group.selection.size() == 1)
....@@ -946,11 +1133,11 @@
9461133 {
9471134 loadClipboard(true);
9481135 objEditor.jTree.setSelectionPath(destinationPath);
949
- pasteInto(false);
1136
+ pasteInto(false, false);
9501137 } else {
9511138 loadClipboard(false);
9521139 objEditor.jTree.setSelectionPath(destinationPath);
953
- pasteInto(false); // true); // ???
1140
+ pasteInto(false, false); // true); // ???
9541141 }
9551142 }
9561143 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1072,27 +1259,33 @@
10721259 kleinItem.addActionListener(this);
10731260 particleItem = menu.add(new MenuItem("Particle system"));
10741261 particleItem.addActionListener(this);
1262
+ if (Globals.ADVANCED)
1263
+ {
10751264 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10761265 ragdollItem.addActionListener(this);
10771266 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10781267 ragdoll2Item.addActionListener(this);
1268
+ }
10791269 menu.add("-");
1080
- meshItem = menu.add(new MenuItem("Mesh"));
1270
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10811271 meshItem.addActionListener(this);
10821272 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10831273 // meshGroupItem.addActionListener(this);
1274
+ if (Globals.ADVANCED)
1275
+ {
10841276 springItem = menu.add(new MenuItem("Spring"));
10851277 springItem.addActionListener(this);
10861278 flagItem = menu.add(new MenuItem("Flag"));
10871279 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);
10921280 blobItem = menu.add(new MenuItem("Blob"));
10931281 blobItem.addActionListener(this);
10941282 latheItem = menu.add(new MenuItem("Lathe"));
10951283 latheItem.addActionListener(this);
1284
+ }
1285
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1286
+ bezierItem.addActionListener(this);
1287
+ overlayItem = menu.add(new MenuItem("Overlay"));
1288
+ overlayItem.addActionListener(this);
10961289 lightItem = menu.add(new MenuItem("Light"));
10971290 lightItem.addActionListener(this);
10981291 menu.add("-");
....@@ -1102,39 +1295,44 @@
11021295 loopItem.addActionListener(this);
11031296 doubleItem = menu.add(new MenuItem("Fork"));
11041297 doubleItem.addActionListener(this);
1298
+ if (Globals.ADVANCED)
1299
+ {
11051300 tripleItem = menu.add(new MenuItem("Trident"));
11061301 tripleItem.addActionListener(this);
1302
+ }
11071303 }
11081304
11091305 void buildToolsMenu(Menu menu)
11101306 {
11111307 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11121308 animationItem.addItemListener(this);
1113
- animationItem.setState(CameraPane.ANIMATION);
1309
+ animationItem.setState(Globals.ANIMATION);
11141310
11151311 menu.add("-");
11161312 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11171313 parseverticesItem.addActionListener(this);
11181314 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11191315 textureFieldItem.addActionListener(this);
1120
- alignItem = menu.add(new MenuItem("Align"));
1316
+ alignItem = menu.add(new MenuItem("Align Objects"));
11211317 alignItem.addActionListener(this);
1122
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1123
- mirrorItem.addActionListener(this);
11241318 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11251319 reduceMorphItem.addActionListener(this);
11261320 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11271321 reduce34MorphItem.addActionListener(this);
1128
-
1322
+ menu.add("-");
11291323 menu.add(computeAOItem = new MenuItem("Compute AO"));
11301324 computeAOItem.addActionListener(this);
1131
- menu.add("-");
11321325
1326
+ if (Globals.ADVANCED)
1327
+ {
1328
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1329
+ mirrorItem.addActionListener(this);
1330
+ menu.add("-");
11331331 menu.add(memoryItem = new MenuItem("Memory Usage"));
11341332 memoryItem.addActionListener(this);
11351333 menu.add(analyzeItem = new MenuItem("Analyze"));
11361334 analyzeItem.addActionListener(this);
1137
- menu.add(dumpItem = new MenuItem("Dump"));
1335
+ menu.add(dumpItem = new MenuItem("Print"));
11381336 dumpItem.addActionListener(this);
11391337 // menu.add(pathItem = new MenuItem("From-to path"));
11401338 // pathItem.addActionListener(this);
....@@ -1152,6 +1350,7 @@
11521350 menu.add("-");
11531351 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11541352 editScriptItem.addActionListener(this);
1353
+ }
11551354 }
11561355
11571356 void ScreenFit()
....@@ -1274,6 +1473,7 @@
12741473 shadow.material = new cMaterial(obj.material);
12751474 shadow.material.diffuse = 0.0001f;
12761475 shadow.material.specular = 0.0001f;
1476
+ //shadow.projectedVertices[1].x = 300;
12771477
12781478 makeSomething(shadow);
12791479 }
....@@ -1480,9 +1680,9 @@
14801680
14811681 void Overwrite(int mask)
14821682 {
1483
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1683
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14841684 {
1485
- Object3D content = GrafreeD.clipboard.get(0);
1685
+ Object3D content = Grafreed.clipboard.get(0);
14861686
14871687 if (content instanceof cGroup && ((cGroup)content).transientlink )
14881688 content = ((cGroup)content).get(0);
....@@ -1653,7 +1853,7 @@
16531853 {
16541854 makeSomething(new BezierSurface());
16551855 } else
1656
- if (source == checkerItem)
1856
+ if (source == overlayItem)
16571857 {
16581858 /*
16591859 Object3D obj = new BezierSurface(5,8);
....@@ -1787,23 +1987,6 @@
17871987 csg.addChild(child);
17881988 child.addChild(csg);
17891989 } 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
18071990 if (source == computeAOItem)
18081991 {
18091992 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1822,7 +2005,7 @@
18222005 if (source == invariantsItem)
18232006 {
18242007 System.out.println("Invariants:");
1825
- GrafreeD.grafreeD.universe.invariants();
2008
+ Grafreed.grafreeD.universe.invariants();
18262009 } else
18272010 if (source == memoryItem)
18282011 {
....@@ -1840,6 +2023,35 @@
18402023 if (source == dumpItem)
18412024 {
18422025 DumpObject();
2026
+ } else
2027
+ if (source == minButton)
2028
+ {
2029
+ Minimize();
2030
+ } else
2031
+ if (source == maxButton)
2032
+ {
2033
+ Maximize();
2034
+ } else
2035
+ if (source == fullButton)
2036
+ {
2037
+ ToggleFullScreen();
2038
+ } else
2039
+ if (source == undoButton)
2040
+ {
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoButton)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == saveButton)
2048
+ {
2049
+ Save();
2050
+ } else
2051
+ if (source == oneStepButton)
2052
+ {
2053
+ Globals.ONESTEP = true;
2054
+ cameraView.repaint();
18432055 } else
18442056 if (source == screenfitButton)
18452057 {
....@@ -1890,12 +2102,20 @@
18902102 {
18912103 loadClipboard(true);
18922104 } else
2105
+ if (source == undoItem)
2106
+ {
2107
+ Undo();
2108
+ } else
2109
+ if (source == redoItem)
2110
+ {
2111
+ Redo();
2112
+ } else
18932113 if (source == duplicateItem)
18942114 {
1895
- Object3D keep = GrafreeD.clipboard;
2115
+ Object3D keep = Grafreed.clipboard;
18962116 loadClipboard(false);
18972117 paste(false);
1898
- GrafreeD.clipboard = keep;
2118
+ Grafreed.clipboard = keep;
18992119 } else
19002120 if (source == cloneItem)
19012121 {
....@@ -1913,13 +2133,17 @@
19132133 {
19142134 paste(false);
19152135 } else
2136
+ if (source == pasteIntoItem)
2137
+ {
2138
+ pasteInto(true, false);
2139
+ } else
19162140 if (source == pasteLinkItem)
19172141 {
1918
- pasteInto(false);
2142
+ pasteInto(false, false);
19192143 } else
19202144 if (source == pasteCloneItem)
19212145 {
1922
- pasteInto(true);
2146
+ pasteInto(true, true);
19232147 } else
19242148 if (source == pasteExpandItem)
19252149 {
....@@ -2111,9 +2335,9 @@
21112335 // group.selection.get(0).setMasterThis(content); // should be identity
21122336 // refreshContents();
21132337 // }
2114
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2338
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21152339 {
2116
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21172341
21182342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21192343 content = ((cGroup)content).get(0);
....@@ -2121,11 +2345,11 @@
21212345 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21222346 for (int i=0; i<group.selection.size(); i++)
21232347 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2348
+ boolean random = CameraPane.SWITCH;
2349
+ CameraPane.SWITCH = false; // parse all random nodes
21262350 group.selection.get(i).linkVerticesThis(content);
21272351 // group.selection.get(i).setMasterThis(content); // should be identity
2128
- CameraPane.RANDOM = random;
2352
+ CameraPane.SWITCH = random;
21292353 }
21302354 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21312355 refreshContents();
....@@ -2135,20 +2359,20 @@
21352359 {
21362360 for (int i=0; i<group.selection.size(); i++)
21372361 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2362
+ boolean random = CameraPane.SWITCH;
2363
+ CameraPane.SWITCH = false; // parse all random nodes
21402364 group.selection.get(i).linkVerticesThis(null);
2141
- CameraPane.RANDOM = random;
2365
+ CameraPane.SWITCH = random;
21422366 }
21432367
21442368 refreshContents();
21452369 } else
21462370 if (source == relinkverticesItem)
21472371 {
2148
- boolean random = CameraPane.RANDOM;
2149
- CameraPane.RANDOM = false; // parse all random nodes
2372
+ boolean random = CameraPane.SWITCH;
2373
+ CameraPane.SWITCH = false; // parse all random nodes
21502374 group.selection.RelinkToSupport();
2151
- CameraPane.RANDOM = random;
2375
+ CameraPane.SWITCH = random;
21522376
21532377 refreshContents();
21542378 } else
....@@ -2163,9 +2387,9 @@
21632387 } else
21642388 if (source == setMasterItem)
21652389 {
2166
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2390
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21672391 {
2168
- Object3D content = GrafreeD.clipboard.get(0);
2392
+ Object3D content = Grafreed.clipboard.get(0);
21692393
21702394 if (content instanceof cGroup && ((cGroup)content).transientlink )
21712395 content = ((cGroup)content).get(0);
....@@ -2178,9 +2402,9 @@
21782402 {
21792403 if (group.selection.size() == 1)
21802404 {
2181
- if (GrafreeD.clipboard.size() == 1)
2405
+ if (Grafreed.clipboard.size() == 1)
21822406 {
2183
- Object3D content = GrafreeD.clipboard.get(0);
2407
+ Object3D content = Grafreed.clipboard.get(0);
21842408
21852409 if (content instanceof cGroup && ((cGroup)content).transientlink )
21862410 content = ((cGroup)content).get(0);
....@@ -2197,7 +2421,7 @@
21972421 {
21982422 RevertMeshes();
21992423 } else
2200
- if (source == resetMeshItem)
2424
+ if (source == resetAllItem)
22012425 {
22022426 ResetAll();
22032427 } else
....@@ -2246,7 +2470,7 @@
22462470 RandomNode random = new RandomNode();
22472471 group(random);
22482472 if (random.size() > 0)
2249
- random.name = random.get(0).name + "Rnd";
2473
+ random.name = random.get(0).name + "Switch";
22502474 } else
22512475 if (source == physicsItem)
22522476 {
....@@ -2385,7 +2609,7 @@
23852609 } else
23862610 if (source == genNormalsMESHItem)
23872611 {
2388
- GenNormals(true); // TODO
2612
+ GenNormalsMESH();
23892613 } else
23902614 if (source == genNormalsORGANItem)
23912615 {
....@@ -2450,6 +2674,22 @@
24502674 if (source == unmarkleavesItem)
24512675 {
24522676 MarkLeaves(false);
2677
+ } else
2678
+ if (source == rewindleavesItem)
2679
+ {
2680
+ RewindLeaves(true);
2681
+ } else
2682
+ if (source == unrewindleavesItem)
2683
+ {
2684
+ RewindLeaves(false);
2685
+ } else
2686
+ if (source == randomleavesItem)
2687
+ {
2688
+ RandomLeaves(true);
2689
+ } else
2690
+ if (source == unrandomleavesItem)
2691
+ {
2692
+ RandomLeaves(false);
24532693 } else
24542694 if (source == flipVItem)
24552695 {
....@@ -2535,9 +2775,13 @@
25352775 {
25362776 SmoothMesh();
25372777 } else
2538
- if (source == transformgeometryItem)
2778
+ if (source == transformGeometryItem)
25392779 {
25402780 TransformGeometry();
2781
+ } else
2782
+ if (source == transformChildrenItem)
2783
+ {
2784
+ TransformChildren();
25412785 } else
25422786 if (source == resetTransformItem)
25432787 {
....@@ -2545,7 +2789,11 @@
25452789 } else
25462790 if (source == resetCentroidItem)
25472791 {
2548
- ResetCentroid();
2792
+ ResetCentroid(true);
2793
+ } else
2794
+ if (source == resetCentroidXZItem)
2795
+ {
2796
+ ResetCentroid(false);
25492797 } else
25502798 if (source == resetParentItem)
25512799 {
....@@ -2709,6 +2957,24 @@
27092957 bigThree.ClearUI();
27102958 bigThree.add(centralPanel);
27112959 bigThree.FlushUI();
2960
+
2961
+ cameraView.requestFocusInWindow();
2962
+
2963
+// refreshContents(true);
2964
+//
2965
+// try
2966
+// {
2967
+// java.awt.Robot bot = new java.awt.Robot();
2968
+// int mask = InputEvent.BUTTON1_MASK;
2969
+// bot.mouseMove(100, 100);
2970
+// bot.mousePress(mask);
2971
+// bot.mouseRelease(mask);
2972
+// }
2973
+// catch (Exception e)
2974
+// {
2975
+//
2976
+// }
2977
+
27122978 } else
27132979 if (source == threeButton)
27142980 {
....@@ -2745,6 +3011,8 @@
27453011 bigThree.add(centralPanel);
27463012 bigThree.add(XYZPanel);
27473013 bigThree.FlushUI();
3014
+
3015
+ cameraView.requestFocusInWindow();
27483016 } else
27493017 if (source == fourButton)
27503018 {
....@@ -2780,6 +3048,8 @@
27803048 bigThree.ClearUI();
27813049 bigThree.add(scenePanel);
27823050 bigThree.FlushUI();
3051
+
3052
+ cameraView.requestFocusInWindow();
27833053 } else
27843054 if (source == sixButton)
27853055 {
....@@ -2816,6 +3086,8 @@
28163086 bigThree.add(scenePanel);
28173087 bigThree.add(centralPanel);
28183088 bigThree.FlushUI();
3089
+
3090
+ cameraView.requestFocusInWindow();
28193091 } else
28203092 if (source == sevenButton)
28213093 {
....@@ -2853,6 +3125,8 @@
28533125 bigThree.add(centralPanel);
28543126 bigThree.add(XYZPanel);
28553127 bigThree.FlushUI();
3128
+
3129
+ cameraView.requestFocusInWindow();
28563130 } else
28573131 if (source == rootButton)
28583132 {
....@@ -2864,6 +3138,7 @@
28643138 EditObject(obj);
28653139 }
28663140
3141
+ cameraView.requestFocusInWindow();
28673142 refreshContents(true);
28683143 } else
28693144 if (source == closeButton)
....@@ -2873,8 +3148,14 @@
28733148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28743149 {
28753150 ab = (cRadio)e.nextElement();
2876
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28773152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
28783159 buttonGroup.remove(ab);
28793160 radioPanel.remove(ab);
28803161
....@@ -2885,6 +3166,8 @@
28853166 break;
28863167 }
28873168 }
3169
+
3170
+ cameraView.requestFocusInWindow();
28883171 refreshContents(true);
28893172 } else
28903173 if (source == editItem || source == editButton)
....@@ -2901,9 +3184,9 @@
29013184 child.CloseUI();
29023185 listUI.remove(child);
29033186
2904
- child.editWindow = null; // ???????????
3187
+ //child.editWindow = null; // ???????????
29053188 }
2906
- objEditor.ctrlPanel.validate();
3189
+ objEditor.ctrlPanel.FlushUI();
29073190 //objEditor.jTree.clearSelection();
29083191 //objEditor.ResetSliders();
29093192 refreshContents(true);
....@@ -2987,7 +3270,10 @@
29873270 frontView.object = group;
29883271 sideView.object = group;
29893272 }
2990
- group.editWindow = this;
3273
+
3274
+// fix "+" issue
3275
+ //group.editWindow = this;
3276
+
29913277 /*
29923278 currentLayout = radio.layout;
29933279 if (currentLayout == null)
....@@ -2999,8 +3285,23 @@
29993285 //group.parent = null; // ROOT
30003286 //group.attributes = -1;
30013287 ResetModel();
3288
+
3289
+ cameraView.requestFocusInWindow();
30023290 refreshContents(true);
3003
- }
3291
+ } else if (event.getSource() == editCameraItem)
3292
+ {
3293
+ cameraView.ProtectCamera();
3294
+ cameraView.repaint();
3295
+ return;
3296
+ } else if (event.getSource() == revertCameraItem)
3297
+ {
3298
+ cameraView.RevertCamera();
3299
+ cameraView.repaint();
3300
+ return;
3301
+ // } else if (event.getSource() == textureButton)
3302
+ // {
3303
+ // return; // true;
3304
+ }
30043305 else
30053306 {
30063307 //return super.action(event, arg);
....@@ -3009,7 +3310,6 @@
30093310 }
30103311
30113312 boolean useclient = false;
3012
- cRadio radio;
30133313
30143314 void ToggleRoot()
30153315 {
....@@ -3061,6 +3361,28 @@
30613361 refreshContents();
30623362 }
30633363
3364
+ void TransformChildren()
3365
+ {
3366
+ Object3D obj;
3367
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3368
+ {
3369
+ obj = (Object3D)e.nextElement();
3370
+ obj.KeepTextureMatrices();
3371
+ obj.TransformChildren();
3372
+ obj.RestoreTextureMatrices();
3373
+
3374
+// if (obj.parent == null)
3375
+// {
3376
+// System.out.println("NULL PARENT!");
3377
+// new Exception().printStackTrace();
3378
+// }
3379
+// else
3380
+// TouchTransform(obj);
3381
+// //obj.parent.Touch();
3382
+ }
3383
+
3384
+ refreshContents();
3385
+ }
30643386
30653387 void ResetTransform()
30663388 {
....@@ -3173,7 +3495,7 @@
31733495 refreshContents();
31743496 }
31753497
3176
- void ResetCentroid()
3498
+ void ResetCentroid(boolean full)
31773499 {
31783500 Object3D obj;
31793501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3188,12 +3510,16 @@
31883510 LA.matIdentity(Object3D.mat);
31893511 obj.getBounds(minima, maxima, false);
31903512 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3191
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3513
+ if (full)
3514
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31923515 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31933516 obj.TransformMesh(Object3D.mat);
3517
+
31943518 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3195
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3519
+ if (full)
3520
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31963521 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3522
+
31973523 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31983524 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31993525 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3222,7 +3548,8 @@
32223548
32233549 int size = obj.MemorySize();
32243550
3225
- System.err.println((size/1024) + " KB is the size of " + obj);
3551
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3552
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32263553 }
32273554 }
32283555 catch (Exception e)
....@@ -3259,9 +3586,9 @@
32593586 obj = (Object3D)e.nextElement();
32603587
32613588 System.out.println("Object is: " + obj);
3262
- GrafreeD.AnalyzeObject(obj);
3589
+ Grafreed.AnalyzeObject(obj);
32633590 System.out.println("Boundary rep: " + obj.bRep);
3264
- GrafreeD.AnalyzeObject(obj.bRep);
3591
+ Grafreed.AnalyzeObject(obj.bRep);
32653592
32663593 // System.err.println((size/1024) + " KB is the size of " + obj);
32673594 }
....@@ -3303,6 +3630,13 @@
33033630 void GenNormals(boolean crease)
33043631 {
33053632 group.GenNormalsS(crease);
3633
+
3634
+ refreshContents();
3635
+ }
3636
+
3637
+ void GenNormalsMESH()
3638
+ {
3639
+ group.GenNormalsMeshS();
33063640
33073641 refreshContents();
33083642 }
....@@ -3475,8 +3809,8 @@
34753809
34763810 void ParseVertices()
34773811 {
3478
- boolean epsequal = GrafreeD.epsequal;
3479
- GrafreeD.epsequal = true;
3812
+ boolean epsequal = Grafreed.epsequal;
3813
+ Grafreed.epsequal = true;
34803814
34813815 for (int i=0; i<group.selection.size(); i++)
34823816 {
....@@ -3501,7 +3835,7 @@
35013835 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35023836 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35033837
3504
- g.add(GrafreeD.clipboard);
3838
+ g.add(Grafreed.clipboard);
35053839
35063840 buffer.add(g);
35073841 }
....@@ -3516,7 +3850,7 @@
35163850 makeSomething(buffer, i==group.selection.size()-1);
35173851 }
35183852
3519
- GrafreeD.epsequal = epsequal;
3853
+ Grafreed.epsequal = epsequal;
35203854
35213855 refreshContents();
35223856 }
....@@ -3534,7 +3868,16 @@
35343868 String pigment = Object3D.GetPigment(tex);
35353869 //String bump = Object3D.GetBump(tex);
35363870
3537
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3871
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3872
+
3873
+ try
3874
+ {
3875
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3876
+ }
3877
+ catch (Exception e)
3878
+ {
3879
+ System.err.println("FAIL: " + node);
3880
+ }
35383881
35393882 double s = v.s;
35403883
....@@ -3622,11 +3965,11 @@
36223965
36233966 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36243967
3625
- boolean random = CameraPane.RANDOM;
3626
- CameraPane.RANDOM = false; // parse all random nodes
3968
+ boolean random = CameraPane.SWITCH;
3969
+ CameraPane.SWITCH = false; // parse all random nodes
36273970 lowres.linkVerticesThis(null);
36283971 lowres.linkVerticesThis(sn);
3629
- CameraPane.RANDOM = random;
3972
+ CameraPane.SWITCH = random;
36303973
36313974 System.err.flush();
36323975
....@@ -3666,7 +4009,7 @@
36664009 return;
36674010
36684011 Object3D poses = group.selection.get(0);
3669
- Object3D ref = GrafreeD.clipboard.get(0);
4012
+ Object3D ref = Grafreed.clipboard.get(0);
36704013
36714014 Object3D newgroup = new Object3D("Po:" + poses.name);
36724015
....@@ -3860,9 +4203,9 @@
38604203
38614204 void ClipMesh()
38624205 {
3863
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4206
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38644207 {
3865
- Object3D content = GrafreeD.clipboard.get(0);
4208
+ Object3D content = Grafreed.clipboard.get(0);
38664209
38674210 if (content instanceof cGroup && ((cGroup)content).transientlink )
38684211 content = ((cGroup)content).get(0);
....@@ -3871,7 +4214,7 @@
38714214 // {
38724215 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38734216 // }
3874
- group.selection.ClipMesh(GrafreeD.clipboard);
4217
+ group.selection.ClipMesh(Grafreed.clipboard);
38754218 }
38764219 // group.selection.ClipMesh(GrafreeD.clipboard);
38774220 System.out.println("DONE.");
....@@ -3918,6 +4261,18 @@
39184261 void MarkLeaves(boolean hide)
39194262 {
39204263 group.selection.MarkLeaves(hide);
4264
+ refreshContents();
4265
+ }
4266
+
4267
+ void RewindLeaves(boolean hide)
4268
+ {
4269
+ group.selection.RewindLeaves(hide);
4270
+ refreshContents();
4271
+ }
4272
+
4273
+ void RandomLeaves(boolean hide)
4274
+ {
4275
+ group.selection.RandomLeaves(hide);
39214276 refreshContents();
39224277 }
39234278
....@@ -4006,7 +4361,7 @@
40064361 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40074362
40084363 Object3D elem = (Object3D)group.selection.elementAt(i);
4009
- if(elem != group)
4364
+ if(elem != group || !newWindow)
40104365 {
40114366 // if (!(elem instanceof Composite))
40124367 // newWindow = false;
....@@ -4096,7 +4451,6 @@
40964451 //case 702: // Event.LIST_DESELECT
40974452 group.deselectAll();
40984453 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4099
- objEditor.ClearInfo(); // .GetMaterial());
41004454 if (tps != null)
41014455 {
41024456 for (int i=0; i < tps.length; i++)
....@@ -4105,10 +4459,8 @@
41054459
41064460 //if (child.parent != null)
41074461 //child.parent.addSelectee(child);
4462
+ objEditor.SetMaterial(child);
41084463 group.addSelectee(child);
4109
- objEditor.SetMaterial(child); // .GetMaterial());
4110
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4111
- System.err.println("info : " + child.GetPath());
41124464 }
41134465 }
41144466 // else
....@@ -4118,16 +4470,17 @@
41184470 // System.err.println("info : " + group.GetPath());
41194471 // }
41204472
4121
- objEditor.SetText(); // jan 2014
4122
-
4123
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4473
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41244474 CameraPane.flash = true;
41254475
4126
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4476
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41274477 // a camera
41284478 {
4129
- CameraPane.camerachangeframe = 0; // don't refuse it
4130
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4479
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4480
+ {
4481
+ CameraPane.camerachangeframe = 0; // don't refuse it
4482
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4483
+ }
41314484 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41324485 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41334486 }
....@@ -4140,6 +4493,26 @@
41404493
41414494 freezemodel = false;
41424495 }
4496
+
4497
+ void refreshContents(boolean cp)
4498
+ {
4499
+ if (!Globals.MOUSEDRAGGED)
4500
+ {
4501
+ objEditor.ClearInfo(); // .GetMaterial());
4502
+
4503
+ for (int i=0; i < group.selection.Size(); i++)
4504
+ {
4505
+ Object3D child = (Object3D) group.selection.get(i);
4506
+
4507
+ objEditor.AddInfo(child, this, true);
4508
+ System.err.println("info : " + child.GetPath());
4509
+ }
4510
+
4511
+ objEditor.SetText(); // jan 2014
4512
+ }
4513
+
4514
+ super.refreshContents(cp);
4515
+ }
41434516
41444517 void linkSomething(Object3D thing)
41454518 {
....@@ -4211,16 +4584,18 @@
42114584 {
42124585 if (group.selection.isEmpty())
42134586 return;
4214
- GrafreeD.clipboardIsTempGroup = false;
4587
+
4588
+ Grafreed.clipboardIsTempGroup = false;
42154589 Composite tGroup = null;
42164590 if (group.selection.size() > 0) // 1)
42174591 {
42184592 tGroup = new cGroup();
4219
- GrafreeD.clipboardIsTempGroup = true;
4593
+ Grafreed.clipboardIsTempGroup = true;
42204594 }
42214595
42224596 if (cut)
42234597 {
4598
+ Save();
42244599 //int indices[] = jList.getSelectedIndices();
42254600 //for (int i = indices.length - 1; i >= 0; i--)
42264601 //jList.remove(indices[i]);
....@@ -4256,16 +4631,16 @@
42564631 //System.out.println("cut " + child);
42574632 //System.out.println("parent = " + child.parent);
42584633 // tmp.addChild(child);
4259
- if (GrafreeD.clipboardIsTempGroup)
4634
+ if (Grafreed.clipboardIsTempGroup)
42604635 tGroup.add/*Child*/(tmp);
42614636 else
4262
- GrafreeD.clipboard = tmp;
4637
+ Grafreed.clipboard = tmp;
42634638 }
42644639 else
4265
- if (GrafreeD.clipboardIsTempGroup)
4640
+ if (Grafreed.clipboardIsTempGroup)
42664641 tGroup.add/*Child*/(child);
42674642 else
4268
- GrafreeD.clipboard = child;
4643
+ Grafreed.clipboard = child;
42694644 }
42704645
42714646 //ResetModel();
....@@ -4297,21 +4672,23 @@
42974672 //System.out.println("cut " + elem);
42984673 //System.out.println("parent = " + elem.parent);
42994674 // tmp.addChild(elem);
4300
- if (GrafreeD.clipboardIsTempGroup)
4675
+ if (Grafreed.clipboardIsTempGroup)
43014676 tGroup.add/*Child*/(tmp);
43024677 else
4303
- GrafreeD.clipboard = tmp;
4678
+ Grafreed.clipboard = tmp;
43044679 }
43054680 else
4306
- if (GrafreeD.clipboardIsTempGroup)
4681
+ if (Grafreed.clipboardIsTempGroup)
43074682 tGroup.add/*Child*/(child);
43084683 else
4309
- GrafreeD.clipboard = child;
4684
+ Grafreed.clipboard = child;
43104685 }
43114686
43124687 }
4313
- if (GrafreeD.clipboardIsTempGroup)
4314
- GrafreeD.clipboard = tGroup;
4688
+
4689
+ if (Grafreed.clipboardIsTempGroup)
4690
+ Grafreed.clipboard = tGroup;
4691
+
43154692 if (cut)
43164693 {
43174694 ResetModel();
....@@ -4325,7 +4702,7 @@
43254702 // return;
43264703 boolean first = true;
43274704
4328
- if (GrafreeD.clipboardIsTempGroup)
4705
+ if (Grafreed.clipboardIsTempGroup)
43294706 {
43304707 Composite temp;
43314708
....@@ -4336,7 +4713,7 @@
43364713 temp = (Composite)Applet3D.clipboard.deepCopy();
43374714 */
43384715 Object3D elem;
4339
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4716
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43404717 {
43414718 Object3D child = (Object3D)e.nextElement();
43424719
....@@ -4370,21 +4747,21 @@
43704747 //Object3D cb = Applet3D.clipboard;
43714748 //temp.addChild(cb);
43724749 //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());
4750
+ assert(Grafreed.clipboard.parent == null);
4751
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4752
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4753
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4754
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43784755 else
4379
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4380
- GrafreeD.clipboard.get(0).parent = keepparent;
4756
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4757
+ Grafreed.clipboard.get(0).parent = keepparent;
43814758 }
43824759
43834760 ResetModel();
43844761 refreshContents();
43854762 }
43864763
4387
- void pasteInto(boolean copyit)
4764
+ void pasteInto(boolean copyit, boolean clone)
43884765 {
43894766 // if (GrafreeD.clipboard == null)
43904767 // return;
....@@ -4413,15 +4790,22 @@
44134790 if (copyit)
44144791 {
44154792 // paste(false);
4416
- CloneClipboard(false); // sept 2014
4793
+ if (clone)
4794
+ {
4795
+ CloneClipboard(false); // sept 2014
4796
+ }
4797
+ else
4798
+ {
4799
+ paste(false);
4800
+ }
44174801 }
44184802 else
44194803 {
44204804 boolean first = true;
44214805
4422
- if (GrafreeD.clipboardIsTempGroup)
4806
+ if (Grafreed.clipboardIsTempGroup)
44234807 {
4424
- Composite temp = (Composite)GrafreeD.clipboard;
4808
+ Composite temp = (Composite)Grafreed.clipboard;
44254809 Object3D copy;
44264810 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44274811 {
....@@ -4431,7 +4815,7 @@
44314815 }
44324816 } else
44334817 {
4434
- linkSomething(GrafreeD.clipboard); //.get(0));
4818
+ linkSomething(Grafreed.clipboard); //.get(0));
44354819 }
44364820 }
44374821 }
....@@ -4836,21 +5220,6 @@
48365220 }
48375221 */
48385222
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
-
48545223 /*
48555224 public void Callback(Object obj)
48565225 {
....@@ -4874,26 +5243,9 @@
48745243 }
48755244 */
48765245
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
-
48945246 String GetFile(String dialogName)
48955247 {
4896
- if (GrafreeD.standAlone)
5248
+ if (Grafreed.standAlone)
48975249 {
48985250 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48995251 browser.show();
....@@ -4957,10 +5309,18 @@
49575309 cButton flashSelectionButton;
49585310 cButton editButton;
49595311 cButton uneditButton;
5312
+ JCheckBox allParamsButton;
49605313 cButton clearpanelButton;
4961
- cButton allParamsButton;
49625314 cButton unselectButton;
49635315
5316
+ cButton minButton;
5317
+ cButton maxButton;
5318
+ cButton fullButton;
5319
+ cButton undoButton;
5320
+ cButton redoButton;
5321
+ cButton saveButton;
5322
+ cButton oneStepButton;
5323
+
49645324 cButton screenfitButton;
49655325 cButton screenfitpointButton;
49665326 cButton snapobjectButton;
....@@ -4971,14 +5331,6 @@
49715331 cButton closeButton;
49725332
49735333 cButton setsupportButton;
4974
-
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;
49825334
49835335 //
49845336 //Composite
....@@ -4991,6 +5343,8 @@
49915343 private MenuItem lookFromItem;
49925344 private MenuItem switchItem;
49935345 private MenuItem cutItem;
5346
+ private MenuItem undoItem;
5347
+ private MenuItem redoItem;
49945348 private MenuItem duplicateItem;
49955349 private MenuItem cloneItem;
49965350 private MenuItem cloneSupportItem;
....@@ -5004,7 +5358,7 @@
50045358 private MenuItem linkverticesItem;
50055359 private MenuItem relinkverticesItem;
50065360 private MenuItem setMasterItem;
5007
- private MenuItem resetMeshItem;
5361
+ private MenuItem resetAllItem;
50085362 private MenuItem stepAllItem;
50095363 private MenuItem revertMeshItem;
50105364 private MenuItem poseMeshItem;
....@@ -5015,6 +5369,7 @@
50155369 private MenuItem mergeGeometriesItem;
50165370 private MenuItem copyItem;
50175371 private MenuItem pasteItem;
5372
+ private MenuItem pasteIntoItem;
50185373 private MenuItem pasteLinkItem;
50195374 private MenuItem pasteCloneItem;
50205375 private MenuItem pasteExpandItem;
....@@ -5053,6 +5408,10 @@
50535408 private MenuItem showleavesItem;
50545409 private MenuItem markleavesItem;
50555410 private MenuItem unmarkleavesItem;
5411
+ private MenuItem rewindleavesItem;
5412
+ private MenuItem unrewindleavesItem;
5413
+ private MenuItem randomleavesItem;
5414
+ private MenuItem unrandomleavesItem;
50565415
50575416 private MenuItem flipVItem;
50585417 private MenuItem unflipVItem;
....@@ -5064,8 +5423,10 @@
50645423 private MenuItem panoTexturesItem;
50655424
50665425 private MenuItem resetCentroidItem;
5067
- private MenuItem transformgeometryItem;
5426
+ private MenuItem resetCentroidXZItem;
50685427 private MenuItem resetTransformItem;
5428
+ private MenuItem transformGeometryItem;
5429
+ private MenuItem transformChildrenItem;
50695430 private MenuItem hideItem;
50705431 private MenuItem grabItem;
50715432 private MenuItem backItem;
....@@ -5112,7 +5473,7 @@
51125473 private MenuItem blobItem;
51135474 private MenuItem latheItem;
51145475 private MenuItem bezierItem;
5115
- private MenuItem checkerItem;
5476
+ private MenuItem overlayItem;
51165477 private MenuItem meshItem;
51175478 // private MenuItem meshGroupItem;
51185479 private MenuItem springItem;
....@@ -5134,11 +5495,6 @@
51345495 private MenuItem doubleItem;
51355496 private MenuItem tripleItem;
51365497
5137
- private MenuItem importGFDItem;
5138
- private MenuItem importVRMLX3DItem;
5139
- private MenuItem import3DSItem;
5140
- private MenuItem importOBJItem;
5141
-
51425498 private MenuItem computeAOItem;
51435499 private MenuItem recompileItem;
51445500 private MenuItem editScriptItem;
....@@ -5148,4 +5504,8 @@
51485504 private MenuItem analyzeItem;
51495505 private MenuItem dumpItem;
51505506 //boolean freezemodel = false;
5507
+
5508
+ Menu cameraMenu;
5509
+ MenuItem editCameraItem;
5510
+ MenuItem revertCameraItem;
51515511 }