Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
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,130 @@
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
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
153275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,45 +283,17 @@
161283 lookAtItem.addActionListener(this);
162284 //lookFromItem.addActinoListener(this);
163285 //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
-
286
+ }
287
+
193288 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);
289
+ if (Globals.ADVANCED)
290
+ {
198291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199292 revertMeshItem.addActionListener(this);
200293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201294 resetreferencesItem.addActionListener(this);
202295 menu.add("-");
296
+ }
203297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204298 overwriteGeoItem.addActionListener(this);
205299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +305,26 @@
211305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212306 overwriteUVItem.addActionListener(this);
213307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
214310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215311 generateMeshItem.addActionListener(this);
216312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217313 poseMeshItem.addActionListener(this);
218314 menu.add("-");
315
+ }
219316 resetsupportItem = menu.add(new MenuItem("Reset support"));
220317 resetsupportItem.addActionListener(this);
221318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222319 linkverticesItem.addActionListener(this);
223320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
225325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226326 setMasterItem.addActionListener(this);
327
+ }
227328
228329 oe.menuBar.add(menu = new Menu("Group"));
229330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,7 +335,7 @@
234335 frontItem.addActionListener(this);
235336 compositeItem = menu.add(new MenuItem("Composite"));
236337 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238339 hideItem.addActionListener(this);
239340 ungroupItem = menu.add(new MenuItem("Ungroup"));
240341 ungroupItem.addActionListener(this);
....@@ -245,16 +346,21 @@
245346 switchGeoItem.addActionListener(this);
246347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
247348 switchTransfoItem.addActionListener(this);
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
350
+ morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
248355 physicsItem = menu.add(new MenuItem("Physics"));
249356 physicsItem.addActionListener(this);
250357 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251358 frameselectorItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
253
- morphItem.addActionListener(this);
254359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255360 scriptNodeItem.addActionListener(this);
256361 cameraItem = menu.add(new MenuItem("Camera"));
257362 cameraItem.addActionListener(this);
363
+ }
258364
259365 oe.menuBar.add(menu = new Menu("Object"));
260366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -269,21 +375,29 @@
269375 shadowYItem.addActionListener(this);
270376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
271377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
272381 linkerItem = menu.add(new MenuItem("Linker"));
273382 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276383 attributeItem = menu.add(new MenuItem("Attribute"));
277384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
278387 pointflowItem = menu.add(new MenuItem("Point Flow"));
279388 pointflowItem.addActionListener(this);
389
+ }
280390 menu.add("-");
281391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282392 resetTransformItem.addActionListener(this);
283393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284394 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
287401
288402 oe.menuBar.add(menu = new Menu("Geometry"));
289403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +408,11 @@
294408 genNormalsCADItem.addActionListener(this);
295409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
297413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298414 genNormalsMINEItem.addActionListener(this);
415
+ }
299416 stripifyItem = menu.add(new MenuItem("Stripify"));
300417 stripifyItem.addActionListener(this);
301418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +434,34 @@
317434 reduce34MeshItem.addActionListener(this);
318435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319436 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
324445
325446 oe.menuBar.add(menu = new Menu("Attributes"));
326447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
328453 menu.add("-");
329454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330455 liveleavesItem.addActionListener(this);
331456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
333460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334461 supportleavesItem.addActionListener(this);
335462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336463 unsupportleavesItem.addActionListener(this);
464
+ }
337465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338466 hideleavesItem.addActionListener(this);
339467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +470,14 @@
342470 markleavesItem.addActionListener(this);
343471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
345481 menu.add("-");
346482 flipVItem = menu.add(new MenuItem("Flip V"));
347483 flipVItem.addActionListener(this);
....@@ -377,29 +513,22 @@
377513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378514 sortbynameItem.addActionListener(this);
379515 menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
520
+ if (Globals.ADVANCED)
521
+ {
522
+ // Pretty much the same as duplicate and clone.
380523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381524 extractGeometriesItem.addActionListener(this);
382525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383526 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);
527
+ }
388528
389529 oe.menuBar.add(menu = new Menu("Insert"));
390530 buildCreateMenu(menu);
391531
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
-
403532 oe.menuBar.add(menu = new Menu("Tools"));
404533 buildToolsMenu(menu);
405534 }
....@@ -436,10 +565,26 @@
436565 */
437566 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438567
568
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ undoButton.setToolTipText("Undo changes");
570
+ undoButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ redoButton.setToolTipText("Redo changes");
574
+ redoButton.addActionListener(this);
575
+
576
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ saveButton.setToolTipText("Save changes");
578
+ saveButton.addActionListener(this);
579
+
439580 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
581
+ liveCB.setToolTipText("Enable animation");
441582 liveCB.addItemListener(this);
442583
584
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ oneStepButton.setToolTipText("Animate one step forward");
586
+ oneStepButton.addActionListener(this);
587
+
443588 oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444589 fastCB.setToolTipText("Fast mode");
445590 fastCB.addItemListener(this);
....@@ -448,7 +593,7 @@
448593 trackCB.setToolTipText("Enable tracking");
449594 trackCB.addItemListener(this);
450595
451
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
452597 screenfitButton.setToolTipText("Screen fit");
453598 screenfitButton.addActionListener(this);
454599
....@@ -457,39 +602,39 @@
457602
458603 if (Globals.ADVANCED)
459604 {
460
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
605
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
461606 snapobjectButton.addActionListener(this);
462607 snapobjectButton.setToolTipText("Snap Object");
463608 }
464609
465
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
610
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
466611 flashSelectionButton.setToolTipText("Show selection");
467612 flashSelectionButton.addActionListener(this);
468613
469614 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
470615
471
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
472617 twoButton.setToolTipText("Show center view only");
473618 twoButton.addActionListener(this);
474
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
475620 fourButton.addActionListener(this);
476621 fourButton.setToolTipText("Show left panel only");
477
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
622
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
478623 sixButton.setToolTipText("2-column layout left");
479624 sixButton.addActionListener(this);
480
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
481626 threeButton.setToolTipText("2-column layout right");
482627 threeButton.addActionListener(this);
483
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
484629 sevenButton.setToolTipText("3-column layout");
485630 sevenButton.addActionListener(this);
486631 //
487632
488
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
633
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
489634 rootButton.setToolTipText("Edit selection in new tab");
490635 rootButton.addActionListener(this);
491636
492
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
637
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
493638 closeButton.setToolTipText("Close tab");
494639 closeButton.addActionListener(this);
495640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -497,23 +642,23 @@
497642
498643 cGridBag commandsPanel = new cGridBag();
499644
500
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
645
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
501646 editButton.setToolTipText("Edit selection");
502647 editButton.addActionListener(this);
503648
504
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
505650 uneditButton.setToolTipText("Unedit selection");
506651 uneditButton.addActionListener(this);
507652
508
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
653
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654
+ allParamsButton.setToolTipText("Edit all params");
655
+ allParamsButton.addActionListener(this);
656
+
657
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
509658 clearPanelButton.setToolTipText("Clear edit panel");
510659 clearPanelButton.addActionListener(this);
511660
512
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
- allParamsButton.setToolTipText("All params??");
514
- allParamsButton.addActionListener(this);
515
-
516
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517662 unselectButton.setToolTipText("Unselect");
518663 unselectButton.addActionListener(this);
519664
....@@ -588,8 +733,18 @@
588733
589734 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
590735 {
736
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
737
+ boxCB.setToolTipText("Display bounding boxes");
738
+ boxCB.addItemListener(this);
739
+
740
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
741
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
742
+ zoomBoxCB.addItemListener(this);
743
+
744
+ if (true) // Globals.ADVANCED)
745
+ {
591746 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
592
- supportCB.setToolTipText("Enabled rigging");
747
+ supportCB.setToolTipText("Enable rigging");
593748 supportCB.addItemListener(this);
594749
595750 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
....@@ -607,14 +762,6 @@
607762 slowCB.setToolTipText("Smooth interpolation");
608763 slowCB.addItemListener(this);
609764
610
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
611
- boxCB.setToolTipText("Display bounding boxes");
612
- boxCB.addItemListener(this);
613
-
614
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
615
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
616
- zoomBoxCB.addItemListener(this);
617
-
618765 // constraints.gridy += 1;
619766 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
620767 // speakerMocapCB.addItemListener(this);
....@@ -645,6 +792,8 @@
645792 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
646793 lookAtCB.setToolTipText("Look-at target");
647794 lookAtCB.addItemListener(this);
795
+
796
+ }
648797
649798 cGridBag fill = new cGridBag();
650799
....@@ -665,6 +814,7 @@
665814 buttonGroup.add(radioButton);
666815 radioButton.doClick();
667816 }
817
+
668818 void SetupViews(ObjEditor oe)
669819 {
670820 oe.SetupViews();
....@@ -729,6 +879,7 @@
729879 } else if(e.getSource() == liveCB)
730880 {
731881 cameraView.ToggleLive();
882
+ refreshContents(false);
732883 }
733884 else if(e.getSource() == supportCB)
734885 {
....@@ -881,7 +1032,9 @@
8811032 // objEditor.DropFile((java.io.File[]) object, true);
8821033 // return;
8831034 // }
884
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8851038 {
8861039 // file(s)
8871040 String[] names = string.split("\n");
....@@ -908,7 +1061,7 @@
9081061
9091062 flashIt = false;
9101063 CameraPane pane = (CameraPane) target;
911
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9121065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9131066
9141067 if (group.selection.size() == 1)
....@@ -935,11 +1088,11 @@
9351088 {
9361089 loadClipboard(true);
9371090 objEditor.jTree.setSelectionPath(destinationPath);
938
- pasteInto(false);
1091
+ pasteInto(false, false);
9391092 } else {
9401093 loadClipboard(false);
9411094 objEditor.jTree.setSelectionPath(destinationPath);
942
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9431096 }
9441097 }
9451098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1061,27 +1214,33 @@
10611214 kleinItem.addActionListener(this);
10621215 particleItem = menu.add(new MenuItem("Particle system"));
10631216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10641219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10651220 ragdollItem.addActionListener(this);
10661221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10671222 ragdoll2Item.addActionListener(this);
1223
+ }
10681224 menu.add("-");
1069
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10701226 meshItem.addActionListener(this);
10711227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10721228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10731231 springItem = menu.add(new MenuItem("Spring"));
10741232 springItem.addActionListener(this);
10751233 flagItem = menu.add(new MenuItem("Flag"));
10761234 flagItem.addActionListener(this);
1077
- bezierItem = menu.add(new MenuItem("Patch"));
1078
- bezierItem.addActionListener(this);
1079
- checkerItem = menu.add(new MenuItem("Checker"));
1080
- checkerItem.addActionListener(this);
10811235 blobItem = menu.add(new MenuItem("Blob"));
10821236 blobItem.addActionListener(this);
10831237 latheItem = menu.add(new MenuItem("Lathe"));
10841238 latheItem.addActionListener(this);
1239
+ }
1240
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1241
+ bezierItem.addActionListener(this);
1242
+ overlayItem = menu.add(new MenuItem("Overlay"));
1243
+ overlayItem.addActionListener(this);
10851244 lightItem = menu.add(new MenuItem("Light"));
10861245 lightItem.addActionListener(this);
10871246 menu.add("-");
....@@ -1091,8 +1250,11 @@
10911250 loopItem.addActionListener(this);
10921251 doubleItem = menu.add(new MenuItem("Fork"));
10931252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
10941255 tripleItem = menu.add(new MenuItem("Trident"));
10951256 tripleItem.addActionListener(this);
1257
+ }
10961258 }
10971259
10981260 void buildToolsMenu(Menu menu)
....@@ -1106,24 +1268,26 @@
11061268 parseverticesItem.addActionListener(this);
11071269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11081270 textureFieldItem.addActionListener(this);
1109
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
11101272 alignItem.addActionListener(this);
1111
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1112
- mirrorItem.addActionListener(this);
11131273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11141274 reduceMorphItem.addActionListener(this);
11151275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11161276 reduce34MorphItem.addActionListener(this);
1117
-
1277
+ menu.add("-");
11181278 menu.add(computeAOItem = new MenuItem("Compute AO"));
11191279 computeAOItem.addActionListener(this);
1120
- menu.add("-");
11211280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
11221286 menu.add(memoryItem = new MenuItem("Memory Usage"));
11231287 memoryItem.addActionListener(this);
11241288 menu.add(analyzeItem = new MenuItem("Analyze"));
11251289 analyzeItem.addActionListener(this);
1126
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11271291 dumpItem.addActionListener(this);
11281292 // menu.add(pathItem = new MenuItem("From-to path"));
11291293 // pathItem.addActionListener(this);
....@@ -1141,6 +1305,7 @@
11411305 menu.add("-");
11421306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11431307 editScriptItem.addActionListener(this);
1308
+ }
11441309 }
11451310
11461311 void ScreenFit()
....@@ -1469,9 +1634,9 @@
14691634
14701635 void Overwrite(int mask)
14711636 {
1472
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14731638 {
1474
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14751640
14761641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14771642 content = ((cGroup)content).get(0);
....@@ -1642,7 +1807,7 @@
16421807 {
16431808 makeSomething(new BezierSurface());
16441809 } else
1645
- if (source == checkerItem)
1810
+ if (source == overlayItem)
16461811 {
16471812 /*
16481813 Object3D obj = new BezierSurface(5,8);
....@@ -1776,23 +1941,6 @@
17761941 csg.addChild(child);
17771942 child.addChild(csg);
17781943 } else
1779
-
1780
- if (source == importGFDItem)
1781
- {
1782
- ImportGFD();
1783
- } else
1784
- if (source == importVRMLX3DItem)
1785
- {
1786
- ImportVRMLX3D();
1787
- } else
1788
- if (source == import3DSItem)
1789
- {
1790
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1791
- } else
1792
- if (source == importOBJItem)
1793
- {
1794
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1795
- } else
17961944 if (source == computeAOItem)
17971945 {
17981946 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1811,7 +1959,7 @@
18111959 if (source == invariantsItem)
18121960 {
18131961 System.out.println("Invariants:");
1814
- GrafreeD.grafreeD.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
18151963 } else
18161964 if (source == memoryItem)
18171965 {
....@@ -1829,6 +1977,23 @@
18291977 if (source == dumpItem)
18301978 {
18311979 DumpObject();
1980
+ } else
1981
+ if (source == undoButton)
1982
+ {
1983
+ Undo();
1984
+ } else
1985
+ if (source == redoButton)
1986
+ {
1987
+ Redo();
1988
+ } else
1989
+ if (source == saveButton)
1990
+ {
1991
+ Save();
1992
+ } else
1993
+ if (source == oneStepButton)
1994
+ {
1995
+ Globals.ONESTEP = true;
1996
+ cameraView.repaint();
18321997 } else
18331998 if (source == screenfitButton)
18341999 {
....@@ -1879,12 +2044,20 @@
18792044 {
18802045 loadClipboard(true);
18812046 } else
2047
+ if (source == undoItem)
2048
+ {
2049
+ Undo();
2050
+ } else
2051
+ if (source == redoItem)
2052
+ {
2053
+ Redo();
2054
+ } else
18822055 if (source == duplicateItem)
18832056 {
1884
- Object3D keep = GrafreeD.clipboard;
2057
+ Object3D keep = Grafreed.clipboard;
18852058 loadClipboard(false);
18862059 paste(false);
1887
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
18882061 } else
18892062 if (source == cloneItem)
18902063 {
....@@ -1902,13 +2075,17 @@
19022075 {
19032076 paste(false);
19042077 } else
2078
+ if (source == pasteIntoItem)
2079
+ {
2080
+ pasteInto(true, false);
2081
+ } else
19052082 if (source == pasteLinkItem)
19062083 {
1907
- pasteInto(false);
2084
+ pasteInto(false, false);
19082085 } else
19092086 if (source == pasteCloneItem)
19102087 {
1911
- pasteInto(true);
2088
+ pasteInto(true, true);
19122089 } else
19132090 if (source == pasteExpandItem)
19142091 {
....@@ -2100,9 +2277,9 @@
21002277 // group.selection.get(0).setMasterThis(content); // should be identity
21012278 // refreshContents();
21022279 // }
2103
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21042281 {
2105
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
21062283
21072284 if (content instanceof cGroup && ((cGroup)content).transientlink )
21082285 content = ((cGroup)content).get(0);
....@@ -2110,11 +2287,11 @@
21102287 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21112288 for (int i=0; i<group.selection.size(); i++)
21122289 {
2113
- boolean random = CameraPane.RANDOM;
2114
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
21152292 group.selection.get(i).linkVerticesThis(content);
21162293 // group.selection.get(i).setMasterThis(content); // should be identity
2117
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
21182295 }
21192296 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21202297 refreshContents();
....@@ -2124,20 +2301,20 @@
21242301 {
21252302 for (int i=0; i<group.selection.size(); i++)
21262303 {
2127
- boolean random = CameraPane.RANDOM;
2128
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
21292306 group.selection.get(i).linkVerticesThis(null);
2130
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
21312308 }
21322309
21332310 refreshContents();
21342311 } else
21352312 if (source == relinkverticesItem)
21362313 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
21392316 group.selection.RelinkToSupport();
2140
- CameraPane.RANDOM = random;
2317
+ CameraPane.SWITCH = random;
21412318
21422319 refreshContents();
21432320 } else
....@@ -2152,9 +2329,9 @@
21522329 } else
21532330 if (source == setMasterItem)
21542331 {
2155
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21562333 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21582335
21592336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602337 content = ((cGroup)content).get(0);
....@@ -2167,9 +2344,9 @@
21672344 {
21682345 if (group.selection.size() == 1)
21692346 {
2170
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21712348 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21732350
21742351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752352 content = ((cGroup)content).get(0);
....@@ -2186,7 +2363,7 @@
21862363 {
21872364 RevertMeshes();
21882365 } else
2189
- if (source == resetMeshItem)
2366
+ if (source == resetAllItem)
21902367 {
21912368 ResetAll();
21922369 } else
....@@ -2374,7 +2551,7 @@
23742551 } else
23752552 if (source == genNormalsMESHItem)
23762553 {
2377
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
23782555 } else
23792556 if (source == genNormalsORGANItem)
23802557 {
....@@ -2439,6 +2616,22 @@
24392616 if (source == unmarkleavesItem)
24402617 {
24412618 MarkLeaves(false);
2619
+ } else
2620
+ if (source == rewindleavesItem)
2621
+ {
2622
+ RewindLeaves(true);
2623
+ } else
2624
+ if (source == unrewindleavesItem)
2625
+ {
2626
+ RewindLeaves(false);
2627
+ } else
2628
+ if (source == randomleavesItem)
2629
+ {
2630
+ RandomLeaves(true);
2631
+ } else
2632
+ if (source == unrandomleavesItem)
2633
+ {
2634
+ RandomLeaves(false);
24422635 } else
24432636 if (source == flipVItem)
24442637 {
....@@ -2524,9 +2717,13 @@
25242717 {
25252718 SmoothMesh();
25262719 } else
2527
- if (source == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
25282721 {
25292722 TransformGeometry();
2723
+ } else
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
25302727 } else
25312728 if (source == resetTransformItem)
25322729 {
....@@ -2534,7 +2731,11 @@
25342731 } else
25352732 if (source == resetCentroidItem)
25362733 {
2537
- ResetCentroid();
2734
+ ResetCentroid(true);
2735
+ } else
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
25382739 } else
25392740 if (source == resetParentItem)
25402741 {
....@@ -2890,9 +3091,9 @@
28903091 child.CloseUI();
28913092 listUI.remove(child);
28923093
2893
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
28943095 }
2895
- objEditor.ctrlPanel.validate();
3096
+ objEditor.ctrlPanel.FlushUI();
28963097 //objEditor.jTree.clearSelection();
28973098 //objEditor.ResetSliders();
28983099 refreshContents(true);
....@@ -2976,7 +3177,10 @@
29763177 frontView.object = group;
29773178 sideView.object = group;
29783179 }
3180
+
3181
+// fix "+" issue
29793182 group.editWindow = this;
3183
+
29803184 /*
29813185 currentLayout = radio.layout;
29823186 if (currentLayout == null)
....@@ -2989,7 +3193,20 @@
29893193 //group.attributes = -1;
29903194 ResetModel();
29913195 refreshContents(true);
2992
- }
3196
+ } else if (event.getSource() == editCameraItem)
3197
+ {
3198
+ cameraView.ProtectCamera();
3199
+ cameraView.repaint();
3200
+ return;
3201
+ } else if (event.getSource() == revertCameraItem)
3202
+ {
3203
+ cameraView.RevertCamera();
3204
+ cameraView.repaint();
3205
+ return;
3206
+ // } else if (event.getSource() == textureButton)
3207
+ // {
3208
+ // return; // true;
3209
+ }
29933210 else
29943211 {
29953212 //return super.action(event, arg);
....@@ -3050,6 +3267,28 @@
30503267 refreshContents();
30513268 }
30523269
3270
+ void TransformChildren()
3271
+ {
3272
+ Object3D obj;
3273
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3274
+ {
3275
+ obj = (Object3D)e.nextElement();
3276
+ obj.KeepTextureMatrices();
3277
+ obj.TransformChildren();
3278
+ obj.RestoreTextureMatrices();
3279
+
3280
+// if (obj.parent == null)
3281
+// {
3282
+// System.out.println("NULL PARENT!");
3283
+// new Exception().printStackTrace();
3284
+// }
3285
+// else
3286
+// TouchTransform(obj);
3287
+// //obj.parent.Touch();
3288
+ }
3289
+
3290
+ refreshContents();
3291
+ }
30533292
30543293 void ResetTransform()
30553294 {
....@@ -3162,7 +3401,7 @@
31623401 refreshContents();
31633402 }
31643403
3165
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
31663405 {
31673406 Object3D obj;
31683407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3177,12 +3416,16 @@
31773416 LA.matIdentity(Object3D.mat);
31783417 obj.getBounds(minima, maxima, false);
31793418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3180
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31813421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31823422 obj.TransformMesh(Object3D.mat);
3423
+
31833424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3184
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31853427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
31863429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31873430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31883431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3211,7 +3454,8 @@
32113454
32123455 int size = obj.MemorySize();
32133456
3214
- System.err.println((size/1024) + " KB is the size of " + obj);
3457
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3458
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32153459 }
32163460 }
32173461 catch (Exception e)
....@@ -3248,9 +3492,9 @@
32483492 obj = (Object3D)e.nextElement();
32493493
32503494 System.out.println("Object is: " + obj);
3251
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
32523496 System.out.println("Boundary rep: " + obj.bRep);
3253
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
32543498
32553499 // System.err.println((size/1024) + " KB is the size of " + obj);
32563500 }
....@@ -3292,6 +3536,13 @@
32923536 void GenNormals(boolean crease)
32933537 {
32943538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
32953546
32963547 refreshContents();
32973548 }
....@@ -3464,8 +3715,8 @@
34643715
34653716 void ParseVertices()
34663717 {
3467
- boolean epsequal = GrafreeD.epsequal;
3468
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
34693720
34703721 for (int i=0; i<group.selection.size(); i++)
34713722 {
....@@ -3490,7 +3741,7 @@
34903741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34913742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34923743
3493
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
34943745
34953746 buffer.add(g);
34963747 }
....@@ -3505,7 +3756,7 @@
35053756 makeSomething(buffer, i==group.selection.size()-1);
35063757 }
35073758
3508
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
35093760
35103761 refreshContents();
35113762 }
....@@ -3523,7 +3774,16 @@
35233774 String pigment = Object3D.GetPigment(tex);
35243775 //String bump = Object3D.GetBump(tex);
35253776
3526
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3777
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3778
+
3779
+ try
3780
+ {
3781
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3782
+ }
3783
+ catch (Exception e)
3784
+ {
3785
+ System.err.println("FAIL: " + node);
3786
+ }
35273787
35283788 double s = v.s;
35293789
....@@ -3611,11 +3871,11 @@
36113871
36123872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36133873
3614
- boolean random = CameraPane.RANDOM;
3615
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
36163876 lowres.linkVerticesThis(null);
36173877 lowres.linkVerticesThis(sn);
3618
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
36193879
36203880 System.err.flush();
36213881
....@@ -3655,7 +3915,7 @@
36553915 return;
36563916
36573917 Object3D poses = group.selection.get(0);
3658
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
36593919
36603920 Object3D newgroup = new Object3D("Po:" + poses.name);
36613921
....@@ -3849,9 +4109,9 @@
38494109
38504110 void ClipMesh()
38514111 {
3852
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38534113 {
3854
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
38554115
38564116 if (content instanceof cGroup && ((cGroup)content).transientlink )
38574117 content = ((cGroup)content).get(0);
....@@ -3860,7 +4120,7 @@
38604120 // {
38614121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38624122 // }
3863
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
38644124 }
38654125 // group.selection.ClipMesh(GrafreeD.clipboard);
38664126 System.out.println("DONE.");
....@@ -3907,6 +4167,18 @@
39074167 void MarkLeaves(boolean hide)
39084168 {
39094169 group.selection.MarkLeaves(hide);
4170
+ refreshContents();
4171
+ }
4172
+
4173
+ void RewindLeaves(boolean hide)
4174
+ {
4175
+ group.selection.RewindLeaves(hide);
4176
+ refreshContents();
4177
+ }
4178
+
4179
+ void RandomLeaves(boolean hide)
4180
+ {
4181
+ group.selection.RandomLeaves(hide);
39104182 refreshContents();
39114183 }
39124184
....@@ -3995,7 +4267,7 @@
39954267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39964268
39974269 Object3D elem = (Object3D)group.selection.elementAt(i);
3998
- if(elem != group)
4270
+ if(elem != group || !newWindow)
39994271 {
40004272 // if (!(elem instanceof Composite))
40014273 // newWindow = false;
....@@ -4085,7 +4357,6 @@
40854357 //case 702: // Event.LIST_DESELECT
40864358 group.deselectAll();
40874359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4088
- objEditor.ClearInfo(); // .GetMaterial());
40894360 if (tps != null)
40904361 {
40914362 for (int i=0; i < tps.length; i++)
....@@ -4094,10 +4365,8 @@
40944365
40954366 //if (child.parent != null)
40964367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
40974369 group.addSelectee(child);
4098
- objEditor.SetMaterial(child); // .GetMaterial());
4099
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4100
- System.err.println("info : " + child.GetPath());
41014370 }
41024371 }
41034372 // else
....@@ -4107,16 +4376,17 @@
41074376 // System.err.println("info : " + group.GetPath());
41084377 // }
41094378
4110
- objEditor.SetText(); // jan 2014
4111
-
4112
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4379
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41134380 CameraPane.flash = true;
41144381
4115
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41164383 // a camera
41174384 {
4118
- CameraPane.camerachangeframe = 0; // don't refuse it
4119
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4385
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4386
+ {
4387
+ CameraPane.camerachangeframe = 0; // don't refuse it
4388
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4389
+ }
41204390 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41214391 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41224392 }
....@@ -4129,6 +4399,26 @@
41294399
41304400 freezemodel = false;
41314401 }
4402
+
4403
+ void refreshContents(boolean cp)
4404
+ {
4405
+ if (!Globals.MOUSEDRAGGED)
4406
+ {
4407
+ objEditor.ClearInfo(); // .GetMaterial());
4408
+
4409
+ for (int i=0; i < group.selection.Size(); i++)
4410
+ {
4411
+ Object3D child = (Object3D) group.selection.get(i);
4412
+
4413
+ objEditor.AddInfo(child, this, true);
4414
+ System.err.println("info : " + child.GetPath());
4415
+ }
4416
+
4417
+ objEditor.SetText(); // jan 2014
4418
+ }
4419
+
4420
+ super.refreshContents(cp);
4421
+ }
41324422
41334423 void linkSomething(Object3D thing)
41344424 {
....@@ -4200,16 +4490,18 @@
42004490 {
42014491 if (group.selection.isEmpty())
42024492 return;
4203
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
42044495 Composite tGroup = null;
42054496 if (group.selection.size() > 0) // 1)
42064497 {
42074498 tGroup = new cGroup();
4208
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
42094500 }
42104501
42114502 if (cut)
42124503 {
4504
+ Save();
42134505 //int indices[] = jList.getSelectedIndices();
42144506 //for (int i = indices.length - 1; i >= 0; i--)
42154507 //jList.remove(indices[i]);
....@@ -4245,16 +4537,16 @@
42454537 //System.out.println("cut " + child);
42464538 //System.out.println("parent = " + child.parent);
42474539 // tmp.addChild(child);
4248
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
42494541 tGroup.add/*Child*/(tmp);
42504542 else
4251
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
42524544 }
42534545 else
4254
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
42554547 tGroup.add/*Child*/(child);
42564548 else
4257
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
42584550 }
42594551
42604552 //ResetModel();
....@@ -4286,21 +4578,23 @@
42864578 //System.out.println("cut " + elem);
42874579 //System.out.println("parent = " + elem.parent);
42884580 // tmp.addChild(elem);
4289
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
42904582 tGroup.add/*Child*/(tmp);
42914583 else
4292
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
42934585 }
42944586 else
4295
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
42964588 tGroup.add/*Child*/(child);
42974589 else
4298
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
42994591 }
43004592
43014593 }
4302
- if (GrafreeD.clipboardIsTempGroup)
4303
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
43044598 if (cut)
43054599 {
43064600 ResetModel();
....@@ -4314,7 +4608,7 @@
43144608 // return;
43154609 boolean first = true;
43164610
4317
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
43184612 {
43194613 Composite temp;
43204614
....@@ -4325,7 +4619,7 @@
43254619 temp = (Composite)Applet3D.clipboard.deepCopy();
43264620 */
43274621 Object3D elem;
4328
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4622
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43294623 {
43304624 Object3D child = (Object3D)e.nextElement();
43314625
....@@ -4359,21 +4653,21 @@
43594653 //Object3D cb = Applet3D.clipboard;
43604654 //temp.addChild(cb);
43614655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4362
- assert(GrafreeD.clipboard.parent == null);
4363
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4364
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4365
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4366
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4656
+ assert(Grafreed.clipboard.parent == null);
4657
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4658
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4659
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4660
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43674661 else
4368
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4369
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
43704664 }
43714665
43724666 ResetModel();
43734667 refreshContents();
43744668 }
43754669
4376
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
43774671 {
43784672 // if (GrafreeD.clipboard == null)
43794673 // return;
....@@ -4402,15 +4696,22 @@
44024696 if (copyit)
44034697 {
44044698 // paste(false);
4405
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
44064707 }
44074708 else
44084709 {
44094710 boolean first = true;
44104711
4411
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
44124713 {
4413
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
44144715 Object3D copy;
44154716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44164717 {
....@@ -4420,7 +4721,7 @@
44204721 }
44214722 } else
44224723 {
4423
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
44244725 }
44254726 }
44264727 }
....@@ -4825,21 +5126,6 @@
48255126 }
48265127 */
48275128
4828
- void ImportGFD()
4829
- {
4830
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4831
- browser.show();
4832
- String filename = browser.getFile();
4833
- if (filename != null && filename.length() > 0)
4834
- {
4835
- String fullname = browser.getDirectory() + filename;
4836
-
4837
- //Object3D readobj =
4838
- objEditor.ReadGFD(fullname, objEditor);
4839
- //makeSomething(readobj);
4840
- }
4841
- }
4842
-
48435129 /*
48445130 public void Callback(Object obj)
48455131 {
....@@ -4863,26 +5149,9 @@
48635149 }
48645150 */
48655151
4866
- void ImportVRMLX3D()
4867
- {
4868
- if (GrafreeD.standAlone)
4869
- {
4870
- /**/
4871
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4872
- browser.show();
4873
- String filename = browser.getFile();
4874
- if (filename != null && filename.length() > 0)
4875
- {
4876
- String fullname = browser.getDirectory() + filename;
4877
- LoadVRMLX3D(fullname);
4878
- }
4879
- /**/
4880
- }
4881
- }
4882
-
48835152 String GetFile(String dialogName)
48845153 {
4885
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
48865155 {
48875156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48885157 browser.show();
....@@ -4946,10 +5215,15 @@
49465215 cButton flashSelectionButton;
49475216 cButton editButton;
49485217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
49495219 cButton clearpanelButton;
4950
- cButton allParamsButton;
49515220 cButton unselectButton;
49525221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
49535227 cButton screenfitButton;
49545228 cButton screenfitpointButton;
49555229 cButton snapobjectButton;
....@@ -4980,6 +5254,8 @@
49805254 private MenuItem lookFromItem;
49815255 private MenuItem switchItem;
49825256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
49835259 private MenuItem duplicateItem;
49845260 private MenuItem cloneItem;
49855261 private MenuItem cloneSupportItem;
....@@ -4993,7 +5269,7 @@
49935269 private MenuItem linkverticesItem;
49945270 private MenuItem relinkverticesItem;
49955271 private MenuItem setMasterItem;
4996
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
49975273 private MenuItem stepAllItem;
49985274 private MenuItem revertMeshItem;
49995275 private MenuItem poseMeshItem;
....@@ -5004,6 +5280,7 @@
50045280 private MenuItem mergeGeometriesItem;
50055281 private MenuItem copyItem;
50065282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
50075284 private MenuItem pasteLinkItem;
50085285 private MenuItem pasteCloneItem;
50095286 private MenuItem pasteExpandItem;
....@@ -5042,6 +5319,10 @@
50425319 private MenuItem showleavesItem;
50435320 private MenuItem markleavesItem;
50445321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
50455326
50465327 private MenuItem flipVItem;
50475328 private MenuItem unflipVItem;
....@@ -5053,8 +5334,10 @@
50535334 private MenuItem panoTexturesItem;
50545335
50555336 private MenuItem resetCentroidItem;
5056
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
50575338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
50585341 private MenuItem hideItem;
50595342 private MenuItem grabItem;
50605343 private MenuItem backItem;
....@@ -5101,7 +5384,7 @@
51015384 private MenuItem blobItem;
51025385 private MenuItem latheItem;
51035386 private MenuItem bezierItem;
5104
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
51055388 private MenuItem meshItem;
51065389 // private MenuItem meshGroupItem;
51075390 private MenuItem springItem;
....@@ -5123,11 +5406,6 @@
51235406 private MenuItem doubleItem;
51245407 private MenuItem tripleItem;
51255408
5126
- private MenuItem importGFDItem;
5127
- private MenuItem importVRMLX3DItem;
5128
- private MenuItem import3DSItem;
5129
- private MenuItem importOBJItem;
5130
-
51315409 private MenuItem computeAOItem;
51325410 private MenuItem recompileItem;
51335411 private MenuItem editScriptItem;
....@@ -5137,4 +5415,8 @@
51375415 private MenuItem analyzeItem;
51385416 private MenuItem dumpItem;
51395417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
51405422 }