Normand Briere
2019-06-11 98896326eb94666451b7e419becfb5d721840313
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
+ undoItem = menu.add(new MenuItem("Undo"));
158
+ undoItem.addActionListener(this);
159
+ redoItem = menu.add(new MenuItem("Redo"));
160
+ redoItem.addActionListener(this);
161
+ menu.add("-");
162
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
163
+ duplicateItem.addActionListener(this);
164
+ cloneItem = menu.add(new MenuItem("Clone"));
165
+ cloneItem.addActionListener(this);
166
+ if (Globals.ADVANCED)
167
+ {
168
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
169
+ cloneSupportItem.addActionListener(this);
170
+ }
171
+ menu.add("-");
172
+ cutItem = menu.add(new MenuItem("Cut"));
173
+ cutItem.addActionListener(this);
174
+ copyItem = menu.add(new MenuItem("Copy"));
175
+ copyItem.addActionListener(this);
176
+ pasteItem = menu.add(new MenuItem("Paste"));
177
+ pasteItem.addActionListener(this);
178
+ menu.add("-");
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 Camera"));
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(CameraPane.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 Camera"));
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"));
....@@ -269,21 +374,29 @@
269374 shadowYItem.addActionListener(this);
270375 shadowZItem = menu.add(new MenuItem("Shadow Z"));
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"));
....@@ -377,29 +504,22 @@
377504 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378505 sortbynameItem.addActionListener(this);
379506 menu.add("-");
507
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
508
+ shareGeometriesItem.addActionListener(this);
509
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
510
+ mergeGeometriesItem.addActionListener(this);
511
+ if (Globals.ADVANCED)
512
+ {
513
+ // Pretty much the same as duplicate and clone.
380514 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381515 extractGeometriesItem.addActionListener(this);
382516 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383517 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);
518
+ }
388519
389520 oe.menuBar.add(menu = new Menu("Insert"));
390521 buildCreateMenu(menu);
391522
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
-
403523 oe.menuBar.add(menu = new Menu("Tools"));
404524 buildToolsMenu(menu);
405525 }
....@@ -437,58 +557,63 @@
437557 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438558
439559 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
560
+ liveCB.setToolTipText("Enable animation");
441561 liveCB.addItemListener(this);
442562
563
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564
+ oneStepButton.setToolTipText("Animate one step forward");
565
+ oneStepButton.addActionListener(this);
566
+
567
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
568
+ fastCB.setToolTipText("Fast mode");
569
+ fastCB.addItemListener(this);
570
+
443571 oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444572 trackCB.setToolTipText("Enable tracking");
445573 trackCB.addItemListener(this);
446574
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
575
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448576 screenfitButton.setToolTipText("Screen fit");
449577 screenfitButton.addActionListener(this);
450578
451579 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452580 // 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;
458581
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);
582
+ if (Globals.ADVANCED)
583
+ {
584
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ snapobjectButton.addActionListener(this);
586
+ snapobjectButton.setToolTipText("Snap Object");
587
+ }
588
+
589
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
465590 flashSelectionButton.setToolTipText("Show selection");
466591 flashSelectionButton.addActionListener(this);
467592
468593 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469594
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
595
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471596 twoButton.setToolTipText("Show center view only");
472597 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
598
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474599 fourButton.addActionListener(this);
475600 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
601
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477602 sixButton.setToolTipText("2-column layout left");
478603 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
604
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480605 threeButton.setToolTipText("2-column layout right");
481606 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483608 sevenButton.setToolTipText("3-column layout");
484609 sevenButton.addActionListener(this);
485610 //
486611
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
612
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488613 rootButton.setToolTipText("Edit selection in new tab");
489614 rootButton.addActionListener(this);
490615
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492617 closeButton.setToolTipText("Close tab");
493618 closeButton.addActionListener(this);
494619 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -496,23 +621,23 @@
496621
497622 cGridBag commandsPanel = new cGridBag();
498623
499
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
624
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500625 editButton.setToolTipText("Edit selection");
501626 editButton.addActionListener(this);
502627
503
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
628
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504629 uneditButton.setToolTipText("Unedit selection");
505630 uneditButton.addActionListener(this);
506631
507
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
632
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
+ allParamsButton.setToolTipText("Edit all params");
634
+ allParamsButton.addActionListener(this);
635
+
636
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508637 clearPanelButton.setToolTipText("Clear edit panel");
509638 clearPanelButton.addActionListener(this);
510639
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);
640
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516641 unselectButton.setToolTipText("Unselect");
517642 unselectButton.addActionListener(this);
518643
....@@ -587,43 +712,35 @@
587712
588713 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589714 {
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;
619715 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620716 boxCB.setToolTipText("Display bounding boxes");
621717 boxCB.addItemListener(this);
622
- //constraints.gridy += 1;
718
+
623719 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624720 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625721 zoomBoxCB.addItemListener(this);
626722
723
+ if (true) // Globals.ADVANCED)
724
+ {
725
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
+ supportCB.setToolTipText("Enable rigging");
727
+ supportCB.addItemListener(this);
728
+
729
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730
+ // localCB.addItemListener(this);
731
+
732
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733
+ crowdCB.setToolTipText("Used for crowds");
734
+ crowdCB.addItemListener(this);
735
+
736
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
737
+ smoothCB.setToolTipText("Snapping delay");
738
+ smoothCB.addItemListener(this);
739
+
740
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
741
+ slowCB.setToolTipText("Smooth interpolation");
742
+ slowCB.addItemListener(this);
743
+
627744 // constraints.gridy += 1;
628745 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629746 // speakerMocapCB.addItemListener(this);
....@@ -648,14 +765,14 @@
648765 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649766 // debugCB.addItemListener(this);
650767
651
- //constraints.gridy += 1;
652768 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653769 oeilCB.addItemListener(this);
654770
655
- //constraints.gridy += 1;
656771 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657772 lookAtCB.setToolTipText("Look-at target");
658773 lookAtCB.addItemListener(this);
774
+
775
+ }
659776
660777 cGridBag fill = new cGridBag();
661778
....@@ -676,6 +793,7 @@
676793 buttonGroup.add(radioButton);
677794 radioButton.doClick();
678795 }
796
+
679797 void SetupViews(ObjEditor oe)
680798 {
681799 oe.SetupViews();
....@@ -892,7 +1010,9 @@
8921010 // objEditor.DropFile((java.io.File[]) object, true);
8931011 // return;
8941012 // }
895
- if (string.charAt(0) == '/')
1013
+
1014
+ // File path for Mac and Windows
1015
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8961016 {
8971017 // file(s)
8981018 String[] names = string.split("\n");
....@@ -919,7 +1039,7 @@
9191039
9201040 flashIt = false;
9211041 CameraPane pane = (CameraPane) target;
922
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1042
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9231043 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9241044
9251045 if (group.selection.size() == 1)
....@@ -946,11 +1066,11 @@
9461066 {
9471067 loadClipboard(true);
9481068 objEditor.jTree.setSelectionPath(destinationPath);
949
- pasteInto(false);
1069
+ pasteInto(false, false);
9501070 } else {
9511071 loadClipboard(false);
9521072 objEditor.jTree.setSelectionPath(destinationPath);
953
- pasteInto(false); // true); // ???
1073
+ pasteInto(false, false); // true); // ???
9541074 }
9551075 }
9561076 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1072,27 +1192,33 @@
10721192 kleinItem.addActionListener(this);
10731193 particleItem = menu.add(new MenuItem("Particle system"));
10741194 particleItem.addActionListener(this);
1195
+ if (Globals.ADVANCED)
1196
+ {
10751197 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10761198 ragdollItem.addActionListener(this);
10771199 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10781200 ragdoll2Item.addActionListener(this);
1201
+ }
10791202 menu.add("-");
1080
- meshItem = menu.add(new MenuItem("Mesh"));
1203
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10811204 meshItem.addActionListener(this);
10821205 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10831206 // meshGroupItem.addActionListener(this);
1207
+ if (Globals.ADVANCED)
1208
+ {
10841209 springItem = menu.add(new MenuItem("Spring"));
10851210 springItem.addActionListener(this);
10861211 flagItem = menu.add(new MenuItem("Flag"));
10871212 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);
10921213 blobItem = menu.add(new MenuItem("Blob"));
10931214 blobItem.addActionListener(this);
10941215 latheItem = menu.add(new MenuItem("Lathe"));
10951216 latheItem.addActionListener(this);
1217
+ }
1218
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1219
+ bezierItem.addActionListener(this);
1220
+ overlayItem = menu.add(new MenuItem("Overlay"));
1221
+ overlayItem.addActionListener(this);
10961222 lightItem = menu.add(new MenuItem("Light"));
10971223 lightItem.addActionListener(this);
10981224 menu.add("-");
....@@ -1102,34 +1228,39 @@
11021228 loopItem.addActionListener(this);
11031229 doubleItem = menu.add(new MenuItem("Fork"));
11041230 doubleItem.addActionListener(this);
1231
+ if (Globals.ADVANCED)
1232
+ {
11051233 tripleItem = menu.add(new MenuItem("Trident"));
11061234 tripleItem.addActionListener(this);
1235
+ }
11071236 }
11081237
11091238 void buildToolsMenu(Menu menu)
11101239 {
11111240 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11121241 animationItem.addItemListener(this);
1113
- animationItem.setState(CameraPane.ANIMATION);
1242
+ animationItem.setState(Globals.ANIMATION);
11141243
11151244 menu.add("-");
11161245 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11171246 parseverticesItem.addActionListener(this);
11181247 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11191248 textureFieldItem.addActionListener(this);
1120
- alignItem = menu.add(new MenuItem("Align"));
1249
+ alignItem = menu.add(new MenuItem("Align Objects"));
11211250 alignItem.addActionListener(this);
1122
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1123
- mirrorItem.addActionListener(this);
11241251 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11251252 reduceMorphItem.addActionListener(this);
11261253 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11271254 reduce34MorphItem.addActionListener(this);
1128
-
1255
+ menu.add("-");
11291256 menu.add(computeAOItem = new MenuItem("Compute AO"));
11301257 computeAOItem.addActionListener(this);
1131
- menu.add("-");
11321258
1259
+ if (Globals.ADVANCED)
1260
+ {
1261
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1262
+ mirrorItem.addActionListener(this);
1263
+ menu.add("-");
11331264 menu.add(memoryItem = new MenuItem("Memory Usage"));
11341265 memoryItem.addActionListener(this);
11351266 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1152,6 +1283,7 @@
11521283 menu.add("-");
11531284 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11541285 editScriptItem.addActionListener(this);
1286
+ }
11551287 }
11561288
11571289 void ScreenFit()
....@@ -1480,9 +1612,9 @@
14801612
14811613 void Overwrite(int mask)
14821614 {
1483
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1615
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14841616 {
1485
- Object3D content = GrafreeD.clipboard.get(0);
1617
+ Object3D content = Grafreed.clipboard.get(0);
14861618
14871619 if (content instanceof cGroup && ((cGroup)content).transientlink )
14881620 content = ((cGroup)content).get(0);
....@@ -1653,7 +1785,7 @@
16531785 {
16541786 makeSomething(new BezierSurface());
16551787 } else
1656
- if (source == checkerItem)
1788
+ if (source == overlayItem)
16571789 {
16581790 /*
16591791 Object3D obj = new BezierSurface(5,8);
....@@ -1787,23 +1919,6 @@
17871919 csg.addChild(child);
17881920 child.addChild(csg);
17891921 } 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
18071922 if (source == computeAOItem)
18081923 {
18091924 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1822,7 +1937,7 @@
18221937 if (source == invariantsItem)
18231938 {
18241939 System.out.println("Invariants:");
1825
- GrafreeD.grafreeD.universe.invariants();
1940
+ Grafreed.grafreeD.universe.invariants();
18261941 } else
18271942 if (source == memoryItem)
18281943 {
....@@ -1840,6 +1955,11 @@
18401955 if (source == dumpItem)
18411956 {
18421957 DumpObject();
1958
+ } else
1959
+ if (source == oneStepButton)
1960
+ {
1961
+ Globals.ONESTEP = true;
1962
+ cameraView.repaint();
18431963 } else
18441964 if (source == screenfitButton)
18451965 {
....@@ -1890,12 +2010,20 @@
18902010 {
18912011 loadClipboard(true);
18922012 } else
2013
+ if (source == undoItem)
2014
+ {
2015
+ Undo();
2016
+ } else
2017
+ if (source == redoItem)
2018
+ {
2019
+ Redo();
2020
+ } else
18932021 if (source == duplicateItem)
18942022 {
1895
- Object3D keep = GrafreeD.clipboard;
2023
+ Object3D keep = Grafreed.clipboard;
18962024 loadClipboard(false);
18972025 paste(false);
1898
- GrafreeD.clipboard = keep;
2026
+ Grafreed.clipboard = keep;
18992027 } else
19002028 if (source == cloneItem)
19012029 {
....@@ -1913,13 +2041,17 @@
19132041 {
19142042 paste(false);
19152043 } else
2044
+ if (source == pasteIntoItem)
2045
+ {
2046
+ pasteInto(true, false);
2047
+ } else
19162048 if (source == pasteLinkItem)
19172049 {
1918
- pasteInto(false);
2050
+ pasteInto(false, false);
19192051 } else
19202052 if (source == pasteCloneItem)
19212053 {
1922
- pasteInto(true);
2054
+ pasteInto(true, true);
19232055 } else
19242056 if (source == pasteExpandItem)
19252057 {
....@@ -2111,9 +2243,9 @@
21112243 // group.selection.get(0).setMasterThis(content); // should be identity
21122244 // refreshContents();
21132245 // }
2114
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2246
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21152247 {
2116
- Object3D content = GrafreeD.clipboard.get(0);
2248
+ Object3D content = Grafreed.clipboard.get(0);
21172249
21182250 if (content instanceof cGroup && ((cGroup)content).transientlink )
21192251 content = ((cGroup)content).get(0);
....@@ -2121,11 +2253,11 @@
21212253 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21222254 for (int i=0; i<group.selection.size(); i++)
21232255 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2256
+ boolean random = CameraPane.SWITCH;
2257
+ CameraPane.SWITCH = false; // parse all random nodes
21262258 group.selection.get(i).linkVerticesThis(content);
21272259 // group.selection.get(i).setMasterThis(content); // should be identity
2128
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
21292261 }
21302262 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21312263 refreshContents();
....@@ -2135,20 +2267,20 @@
21352267 {
21362268 for (int i=0; i<group.selection.size(); i++)
21372269 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2270
+ boolean random = CameraPane.SWITCH;
2271
+ CameraPane.SWITCH = false; // parse all random nodes
21402272 group.selection.get(i).linkVerticesThis(null);
2141
- CameraPane.RANDOM = random;
2273
+ CameraPane.SWITCH = random;
21422274 }
21432275
21442276 refreshContents();
21452277 } else
21462278 if (source == relinkverticesItem)
21472279 {
2148
- boolean random = CameraPane.RANDOM;
2149
- CameraPane.RANDOM = false; // parse all random nodes
2280
+ boolean random = CameraPane.SWITCH;
2281
+ CameraPane.SWITCH = false; // parse all random nodes
21502282 group.selection.RelinkToSupport();
2151
- CameraPane.RANDOM = random;
2283
+ CameraPane.SWITCH = random;
21522284
21532285 refreshContents();
21542286 } else
....@@ -2163,9 +2295,9 @@
21632295 } else
21642296 if (source == setMasterItem)
21652297 {
2166
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2298
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21672299 {
2168
- Object3D content = GrafreeD.clipboard.get(0);
2300
+ Object3D content = Grafreed.clipboard.get(0);
21692301
21702302 if (content instanceof cGroup && ((cGroup)content).transientlink )
21712303 content = ((cGroup)content).get(0);
....@@ -2178,9 +2310,9 @@
21782310 {
21792311 if (group.selection.size() == 1)
21802312 {
2181
- if (GrafreeD.clipboard.size() == 1)
2313
+ if (Grafreed.clipboard.size() == 1)
21822314 {
2183
- Object3D content = GrafreeD.clipboard.get(0);
2315
+ Object3D content = Grafreed.clipboard.get(0);
21842316
21852317 if (content instanceof cGroup && ((cGroup)content).transientlink )
21862318 content = ((cGroup)content).get(0);
....@@ -2197,7 +2329,7 @@
21972329 {
21982330 RevertMeshes();
21992331 } else
2200
- if (source == resetMeshItem)
2332
+ if (source == resetAllItem)
22012333 {
22022334 ResetAll();
22032335 } else
....@@ -2246,7 +2378,7 @@
22462378 RandomNode random = new RandomNode();
22472379 group(random);
22482380 if (random.size() > 0)
2249
- random.name = random.get(0).name + "Rnd";
2381
+ random.name = random.get(0).name + "Switch";
22502382 } else
22512383 if (source == physicsItem)
22522384 {
....@@ -2535,9 +2667,13 @@
25352667 {
25362668 SmoothMesh();
25372669 } else
2538
- if (source == transformgeometryItem)
2670
+ if (source == transformGeometryItem)
25392671 {
25402672 TransformGeometry();
2673
+ } else
2674
+ if (source == transformChildrenItem)
2675
+ {
2676
+ TransformChildren();
25412677 } else
25422678 if (source == resetTransformItem)
25432679 {
....@@ -2545,7 +2681,11 @@
25452681 } else
25462682 if (source == resetCentroidItem)
25472683 {
2548
- ResetCentroid();
2684
+ ResetCentroid(true);
2685
+ } else
2686
+ if (source == resetCentroidXZItem)
2687
+ {
2688
+ ResetCentroid(false);
25492689 } else
25502690 if (source == resetParentItem)
25512691 {
....@@ -2901,9 +3041,9 @@
29013041 child.CloseUI();
29023042 listUI.remove(child);
29033043
2904
- child.editWindow = null; // ???????????
3044
+ //child.editWindow = null; // ???????????
29053045 }
2906
- objEditor.ctrlPanel.validate();
3046
+ objEditor.ctrlPanel.FlushUI();
29073047 //objEditor.jTree.clearSelection();
29083048 //objEditor.ResetSliders();
29093049 refreshContents(true);
....@@ -2987,7 +3127,9 @@
29873127 frontView.object = group;
29883128 sideView.object = group;
29893129 }
2990
- group.editWindow = this;
3130
+
3131
+// fix "+" issue group.editWindow = this;
3132
+
29913133 /*
29923134 currentLayout = radio.layout;
29933135 if (currentLayout == null)
....@@ -3000,7 +3142,20 @@
30003142 //group.attributes = -1;
30013143 ResetModel();
30023144 refreshContents(true);
3003
- }
3145
+ } else if (event.getSource() == editCameraItem)
3146
+ {
3147
+ cameraView.ProtectCamera();
3148
+ cameraView.repaint();
3149
+ return;
3150
+ } else if (event.getSource() == revertCameraItem)
3151
+ {
3152
+ cameraView.RevertCamera();
3153
+ cameraView.repaint();
3154
+ return;
3155
+ // } else if (event.getSource() == textureButton)
3156
+ // {
3157
+ // return; // true;
3158
+ }
30043159 else
30053160 {
30063161 //return super.action(event, arg);
....@@ -3061,6 +3216,28 @@
30613216 refreshContents();
30623217 }
30633218
3219
+ void TransformChildren()
3220
+ {
3221
+ Object3D obj;
3222
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3223
+ {
3224
+ obj = (Object3D)e.nextElement();
3225
+ obj.KeepTextureMatrices();
3226
+ obj.TransformChildren();
3227
+ obj.RestoreTextureMatrices();
3228
+
3229
+// if (obj.parent == null)
3230
+// {
3231
+// System.out.println("NULL PARENT!");
3232
+// new Exception().printStackTrace();
3233
+// }
3234
+// else
3235
+// TouchTransform(obj);
3236
+// //obj.parent.Touch();
3237
+ }
3238
+
3239
+ refreshContents();
3240
+ }
30643241
30653242 void ResetTransform()
30663243 {
....@@ -3173,7 +3350,7 @@
31733350 refreshContents();
31743351 }
31753352
3176
- void ResetCentroid()
3353
+ void ResetCentroid(boolean full)
31773354 {
31783355 Object3D obj;
31793356 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3188,12 +3365,16 @@
31883365 LA.matIdentity(Object3D.mat);
31893366 obj.getBounds(minima, maxima, false);
31903367 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3191
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3368
+ if (full)
3369
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31923370 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31933371 obj.TransformMesh(Object3D.mat);
3372
+
31943373 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3195
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3374
+ if (full)
3375
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31963376 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3377
+
31973378 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31983379 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31993380 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3259,9 +3440,9 @@
32593440 obj = (Object3D)e.nextElement();
32603441
32613442 System.out.println("Object is: " + obj);
3262
- GrafreeD.AnalyzeObject(obj);
3443
+ Grafreed.AnalyzeObject(obj);
32633444 System.out.println("Boundary rep: " + obj.bRep);
3264
- GrafreeD.AnalyzeObject(obj.bRep);
3445
+ Grafreed.AnalyzeObject(obj.bRep);
32653446
32663447 // System.err.println((size/1024) + " KB is the size of " + obj);
32673448 }
....@@ -3475,8 +3656,8 @@
34753656
34763657 void ParseVertices()
34773658 {
3478
- boolean epsequal = GrafreeD.epsequal;
3479
- GrafreeD.epsequal = true;
3659
+ boolean epsequal = Grafreed.epsequal;
3660
+ Grafreed.epsequal = true;
34803661
34813662 for (int i=0; i<group.selection.size(); i++)
34823663 {
....@@ -3501,7 +3682,7 @@
35013682 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35023683 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35033684
3504
- g.add(GrafreeD.clipboard);
3685
+ g.add(Grafreed.clipboard);
35053686
35063687 buffer.add(g);
35073688 }
....@@ -3516,7 +3697,7 @@
35163697 makeSomething(buffer, i==group.selection.size()-1);
35173698 }
35183699
3519
- GrafreeD.epsequal = epsequal;
3700
+ Grafreed.epsequal = epsequal;
35203701
35213702 refreshContents();
35223703 }
....@@ -3534,7 +3715,16 @@
35343715 String pigment = Object3D.GetPigment(tex);
35353716 //String bump = Object3D.GetBump(tex);
35363717
3537
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3718
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3719
+
3720
+ try
3721
+ {
3722
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3723
+ }
3724
+ catch (Exception e)
3725
+ {
3726
+ System.err.println("FAIL: " + node);
3727
+ }
35383728
35393729 double s = v.s;
35403730
....@@ -3622,11 +3812,11 @@
36223812
36233813 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36243814
3625
- boolean random = CameraPane.RANDOM;
3626
- CameraPane.RANDOM = false; // parse all random nodes
3815
+ boolean random = CameraPane.SWITCH;
3816
+ CameraPane.SWITCH = false; // parse all random nodes
36273817 lowres.linkVerticesThis(null);
36283818 lowres.linkVerticesThis(sn);
3629
- CameraPane.RANDOM = random;
3819
+ CameraPane.SWITCH = random;
36303820
36313821 System.err.flush();
36323822
....@@ -3666,7 +3856,7 @@
36663856 return;
36673857
36683858 Object3D poses = group.selection.get(0);
3669
- Object3D ref = GrafreeD.clipboard.get(0);
3859
+ Object3D ref = Grafreed.clipboard.get(0);
36703860
36713861 Object3D newgroup = new Object3D("Po:" + poses.name);
36723862
....@@ -3860,9 +4050,9 @@
38604050
38614051 void ClipMesh()
38624052 {
3863
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4053
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38644054 {
3865
- Object3D content = GrafreeD.clipboard.get(0);
4055
+ Object3D content = Grafreed.clipboard.get(0);
38664056
38674057 if (content instanceof cGroup && ((cGroup)content).transientlink )
38684058 content = ((cGroup)content).get(0);
....@@ -3871,7 +4061,7 @@
38714061 // {
38724062 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38734063 // }
3874
- group.selection.ClipMesh(GrafreeD.clipboard);
4064
+ group.selection.ClipMesh(Grafreed.clipboard);
38754065 }
38764066 // group.selection.ClipMesh(GrafreeD.clipboard);
38774067 System.out.println("DONE.");
....@@ -4006,7 +4196,7 @@
40064196 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40074197
40084198 Object3D elem = (Object3D)group.selection.elementAt(i);
4009
- if(elem != group)
4199
+ if(elem != group || !newWindow)
40104200 {
40114201 // if (!(elem instanceof Composite))
40124202 // newWindow = false;
....@@ -4120,14 +4310,17 @@
41204310
41214311 objEditor.SetText(); // jan 2014
41224312
4123
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4313
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41244314 CameraPane.flash = true;
41254315
4126
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4316
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41274317 // a camera
41284318 {
4129
- CameraPane.camerachangeframe = 0; // don't refuse it
4130
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4319
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4320
+ {
4321
+ CameraPane.camerachangeframe = 0; // don't refuse it
4322
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4323
+ }
41314324 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41324325 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41334326 }
....@@ -4211,12 +4404,12 @@
42114404 {
42124405 if (group.selection.isEmpty())
42134406 return;
4214
- GrafreeD.clipboardIsTempGroup = false;
4407
+ Grafreed.clipboardIsTempGroup = false;
42154408 Composite tGroup = null;
42164409 if (group.selection.size() > 0) // 1)
42174410 {
42184411 tGroup = new cGroup();
4219
- GrafreeD.clipboardIsTempGroup = true;
4412
+ Grafreed.clipboardIsTempGroup = true;
42204413 }
42214414
42224415 if (cut)
....@@ -4256,16 +4449,16 @@
42564449 //System.out.println("cut " + child);
42574450 //System.out.println("parent = " + child.parent);
42584451 // tmp.addChild(child);
4259
- if (GrafreeD.clipboardIsTempGroup)
4452
+ if (Grafreed.clipboardIsTempGroup)
42604453 tGroup.add/*Child*/(tmp);
42614454 else
4262
- GrafreeD.clipboard = tmp;
4455
+ Grafreed.clipboard = tmp;
42634456 }
42644457 else
4265
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
42664459 tGroup.add/*Child*/(child);
42674460 else
4268
- GrafreeD.clipboard = child;
4461
+ Grafreed.clipboard = child;
42694462 }
42704463
42714464 //ResetModel();
....@@ -4297,21 +4490,21 @@
42974490 //System.out.println("cut " + elem);
42984491 //System.out.println("parent = " + elem.parent);
42994492 // tmp.addChild(elem);
4300
- if (GrafreeD.clipboardIsTempGroup)
4493
+ if (Grafreed.clipboardIsTempGroup)
43014494 tGroup.add/*Child*/(tmp);
43024495 else
4303
- GrafreeD.clipboard = tmp;
4496
+ Grafreed.clipboard = tmp;
43044497 }
43054498 else
4306
- if (GrafreeD.clipboardIsTempGroup)
4499
+ if (Grafreed.clipboardIsTempGroup)
43074500 tGroup.add/*Child*/(child);
43084501 else
4309
- GrafreeD.clipboard = child;
4502
+ Grafreed.clipboard = child;
43104503 }
43114504
43124505 }
4313
- if (GrafreeD.clipboardIsTempGroup)
4314
- GrafreeD.clipboard = tGroup;
4506
+ if (Grafreed.clipboardIsTempGroup)
4507
+ Grafreed.clipboard = tGroup;
43154508 if (cut)
43164509 {
43174510 ResetModel();
....@@ -4325,7 +4518,7 @@
43254518 // return;
43264519 boolean first = true;
43274520
4328
- if (GrafreeD.clipboardIsTempGroup)
4521
+ if (Grafreed.clipboardIsTempGroup)
43294522 {
43304523 Composite temp;
43314524
....@@ -4336,7 +4529,7 @@
43364529 temp = (Composite)Applet3D.clipboard.deepCopy();
43374530 */
43384531 Object3D elem;
4339
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4532
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43404533 {
43414534 Object3D child = (Object3D)e.nextElement();
43424535
....@@ -4370,21 +4563,21 @@
43704563 //Object3D cb = Applet3D.clipboard;
43714564 //temp.addChild(cb);
43724565 //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());
4566
+ assert(Grafreed.clipboard.parent == null);
4567
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4568
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4569
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4570
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43784571 else
4379
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4380
- GrafreeD.clipboard.get(0).parent = keepparent;
4572
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4573
+ Grafreed.clipboard.get(0).parent = keepparent;
43814574 }
43824575
43834576 ResetModel();
43844577 refreshContents();
43854578 }
43864579
4387
- void pasteInto(boolean copyit)
4580
+ void pasteInto(boolean copyit, boolean clone)
43884581 {
43894582 // if (GrafreeD.clipboard == null)
43904583 // return;
....@@ -4413,15 +4606,22 @@
44134606 if (copyit)
44144607 {
44154608 // paste(false);
4416
- CloneClipboard(false); // sept 2014
4609
+ if (clone)
4610
+ {
4611
+ CloneClipboard(false); // sept 2014
4612
+ }
4613
+ else
4614
+ {
4615
+ paste(false);
4616
+ }
44174617 }
44184618 else
44194619 {
44204620 boolean first = true;
44214621
4422
- if (GrafreeD.clipboardIsTempGroup)
4622
+ if (Grafreed.clipboardIsTempGroup)
44234623 {
4424
- Composite temp = (Composite)GrafreeD.clipboard;
4624
+ Composite temp = (Composite)Grafreed.clipboard;
44254625 Object3D copy;
44264626 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44274627 {
....@@ -4431,7 +4631,7 @@
44314631 }
44324632 } else
44334633 {
4434
- linkSomething(GrafreeD.clipboard); //.get(0));
4634
+ linkSomething(Grafreed.clipboard); //.get(0));
44354635 }
44364636 }
44374637 }
....@@ -4836,21 +5036,6 @@
48365036 }
48375037 */
48385038
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
-
48545039 /*
48555040 public void Callback(Object obj)
48565041 {
....@@ -4874,26 +5059,9 @@
48745059 }
48755060 */
48765061
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
-
48945062 String GetFile(String dialogName)
48955063 {
4896
- if (GrafreeD.standAlone)
5064
+ if (Grafreed.standAlone)
48975065 {
48985066 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48995067 browser.show();
....@@ -4957,10 +5125,12 @@
49575125 cButton flashSelectionButton;
49585126 cButton editButton;
49595127 cButton uneditButton;
5128
+ JCheckBox allParamsButton;
49605129 cButton clearpanelButton;
4961
- cButton allParamsButton;
49625130 cButton unselectButton;
49635131
5132
+ cButton oneStepButton;
5133
+
49645134 cButton screenfitButton;
49655135 cButton screenfitpointButton;
49665136 cButton snapobjectButton;
....@@ -4991,6 +5161,8 @@
49915161 private MenuItem lookFromItem;
49925162 private MenuItem switchItem;
49935163 private MenuItem cutItem;
5164
+ private MenuItem undoItem;
5165
+ private MenuItem redoItem;
49945166 private MenuItem duplicateItem;
49955167 private MenuItem cloneItem;
49965168 private MenuItem cloneSupportItem;
....@@ -5004,7 +5176,7 @@
50045176 private MenuItem linkverticesItem;
50055177 private MenuItem relinkverticesItem;
50065178 private MenuItem setMasterItem;
5007
- private MenuItem resetMeshItem;
5179
+ private MenuItem resetAllItem;
50085180 private MenuItem stepAllItem;
50095181 private MenuItem revertMeshItem;
50105182 private MenuItem poseMeshItem;
....@@ -5015,6 +5187,7 @@
50155187 private MenuItem mergeGeometriesItem;
50165188 private MenuItem copyItem;
50175189 private MenuItem pasteItem;
5190
+ private MenuItem pasteIntoItem;
50185191 private MenuItem pasteLinkItem;
50195192 private MenuItem pasteCloneItem;
50205193 private MenuItem pasteExpandItem;
....@@ -5064,8 +5237,10 @@
50645237 private MenuItem panoTexturesItem;
50655238
50665239 private MenuItem resetCentroidItem;
5067
- private MenuItem transformgeometryItem;
5240
+ private MenuItem resetCentroidXZItem;
50685241 private MenuItem resetTransformItem;
5242
+ private MenuItem transformGeometryItem;
5243
+ private MenuItem transformChildrenItem;
50695244 private MenuItem hideItem;
50705245 private MenuItem grabItem;
50715246 private MenuItem backItem;
....@@ -5112,7 +5287,7 @@
51125287 private MenuItem blobItem;
51135288 private MenuItem latheItem;
51145289 private MenuItem bezierItem;
5115
- private MenuItem checkerItem;
5290
+ private MenuItem overlayItem;
51165291 private MenuItem meshItem;
51175292 // private MenuItem meshGroupItem;
51185293 private MenuItem springItem;
....@@ -5134,11 +5309,6 @@
51345309 private MenuItem doubleItem;
51355310 private MenuItem tripleItem;
51365311
5137
- private MenuItem importGFDItem;
5138
- private MenuItem importVRMLX3DItem;
5139
- private MenuItem import3DSItem;
5140
- private MenuItem importOBJItem;
5141
-
51425312 private MenuItem computeAOItem;
51435313 private MenuItem recompileItem;
51445314 private MenuItem editScriptItem;
....@@ -5148,4 +5318,8 @@
51485318 private MenuItem analyzeItem;
51495319 private MenuItem dumpItem;
51505320 //boolean freezemodel = false;
5321
+
5322
+ Menu cameraMenu;
5323
+ MenuItem editCameraItem;
5324
+ MenuItem revertCameraItem;
51515325 }