Normand Briere
2019-06-09 c5b599b48b333b34e554b464aefbca0b9bc66275
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,124 @@
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
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
158
+ duplicateItem.addActionListener(this);
159
+ cloneItem = menu.add(new MenuItem("Clone"));
160
+ cloneItem.addActionListener(this);
161
+ if (Globals.ADVANCED)
162
+ {
163
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
164
+ cloneSupportItem.addActionListener(this);
165
+ }
166
+ menu.add("-");
167
+ cutItem = menu.add(new MenuItem("Cut"));
168
+ cutItem.addActionListener(this);
169
+ copyItem = menu.add(new MenuItem("Copy"));
170
+ copyItem.addActionListener(this);
171
+ pasteItem = menu.add(new MenuItem("Paste"));
172
+ pasteItem.addActionListener(this);
173
+ menu.add("-");
174
+
175
+ menu.add("-");
176
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
177
+ pasteIntoItem.addActionListener(this);
178
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
179
+ pasteLinkItem.addActionListener(this);
180
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
181
+ pasteCloneItem.addActionListener(this);
182
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
183
+// pasteExpandItem.addActionListener(this);
184
+ menu.add("-");
185
+ clearItem = menu.add(new MenuItem("Clear"));
186
+ clearItem.addActionListener(this);
187
+
188
+ if (Globals.ADVANCED)
189
+ {
190
+ // Deletes the cameras...
191
+ clearAllItem = menu.add(new MenuItem("Clear All"));
192
+ clearAllItem.addActionListener(this);
193
+ }
194
+
195
+ menuBar.add(cameraMenu = new Menu("View"));
196
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
197
+ //zBufferItem.addActionListener(this);
198
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199
+ //normalLensItem.addActionListener(this);
200
+ cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
+ revertCameraItem.addActionListener(this);
202
+
203
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
+ toggleFullScreenItem.addItemListener(this);
205
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
+ cameraMenu.add("-");
207
+
208
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
+ toggleTextureItem.addItemListener(this);
210
+ toggleTextureItem.setState(CameraPane.textureon);
211
+
212
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
+ toggleSwitchItem.addItemListener(this);
214
+ toggleSwitchItem.setState(CameraPane.SWITCH);
215
+
216
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
217
+ toggleHandleItem.addItemListener(this);
218
+ toggleHandleItem.setState(CameraPane.HANDLES);
219
+
220
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
221
+ togglePaintItem.addItemListener(this);
222
+ togglePaintItem.setState(CameraPane.PAINTMODE);
223
+
224
+ if (Globals.ADVANCED)
225
+ {
226
+ cameraMenu.add("-");
227
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
228
+ toggleLiveItem.addItemListener(this);
229
+ toggleLiveItem.setState(Globals.isLIVE());
230
+
231
+ cameraMenu.add(stepItem = new MenuItem("Step"));
232
+ stepItem.addActionListener(this);
233
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
234
+ // toggleDLItem.addItemListener(this);
235
+ // toggleDLItem.setState(false);
236
+
237
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
238
+ toggleRenderItem.addItemListener(this);
239
+ toggleRenderItem.setState(!CameraPane.frozen);
240
+
241
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242
+ toggleDebugItem.addItemListener(this);
243
+ toggleDebugItem.setState(CameraPane.DEBUG);
244
+
245
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246
+ toggleFrustumItem.addItemListener(this);
247
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
248
+
249
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
250
+ toggleFootContactItem.addItemListener(this);
251
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
252
+
253
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
254
+ toggleTimelineItem.addItemListener(this);
255
+ }
256
+
257
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
258
+// toggleRootItem.addItemListener(this);
259
+// toggleRootItem.setState(false);
260
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
261
+// animationItem.addItemListener(this);
262
+// animationItem.setState(CameraPane.ANIMATION);
263
+ cameraMenu.add("-");
264
+ cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
265
+ editCameraItem.addActionListener(this);
266
+
267
+ if (Globals.ADVANCED)
268
+ {
153269 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154270 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155271 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,45 +277,17 @@
161277 lookAtItem.addActionListener(this);
162278 //lookFromItem.addActinoListener(this);
163279 //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
-
280
+ }
281
+
193282 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);
283
+ if (Globals.ADVANCED)
284
+ {
198285 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199286 revertMeshItem.addActionListener(this);
200287 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201288 resetreferencesItem.addActionListener(this);
202289 menu.add("-");
290
+ }
203291 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204292 overwriteGeoItem.addActionListener(this);
205293 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +299,26 @@
211299 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212300 overwriteUVItem.addActionListener(this);
213301 menu.add("-");
302
+ if (Globals.ADVANCED)
303
+ {
214304 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215305 generateMeshItem.addActionListener(this);
216306 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217307 poseMeshItem.addActionListener(this);
218308 menu.add("-");
309
+ }
219310 resetsupportItem = menu.add(new MenuItem("Reset support"));
220311 resetsupportItem.addActionListener(this);
221312 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222313 linkverticesItem.addActionListener(this);
223314 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224315 relinkverticesItem.addActionListener(this);
316
+
317
+ if (Globals.ADVANCED)
318
+ {
225319 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226320 setMasterItem.addActionListener(this);
321
+ }
227322
228323 oe.menuBar.add(menu = new Menu("Group"));
229324 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,27 +329,32 @@
234329 frontItem.addActionListener(this);
235330 compositeItem = menu.add(new MenuItem("Composite"));
236331 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
332
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238333 hideItem.addActionListener(this);
239334 ungroupItem = menu.add(new MenuItem("Ungroup"));
240335 ungroupItem.addActionListener(this);
241336 menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
337
+ randomItem = menu.add(new MenuItem("Switch node"));
243338 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);
248339 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249340 switchGeoItem.addActionListener(this);
250341 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251342 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
343
+ morphItem = menu.add(new MenuItem("Morph Group"));
253344 morphItem.addActionListener(this);
345
+
346
+ if (Globals.ADVANCED)
347
+ {
348
+ menu.add("-");
349
+ physicsItem = menu.add(new MenuItem("Physics"));
350
+ physicsItem.addActionListener(this);
351
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
352
+ frameselectorItem.addActionListener(this);
254353 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255354 scriptNodeItem.addActionListener(this);
256355 cameraItem = menu.add(new MenuItem("Camera"));
257356 cameraItem.addActionListener(this);
357
+ }
258358
259359 oe.menuBar.add(menu = new Menu("Object"));
260360 textureItem = menu.add(new MenuItem("Texture"));
....@@ -269,21 +369,29 @@
269369 shadowYItem.addActionListener(this);
270370 shadowZItem = menu.add(new MenuItem("Shadow Z"));
271371 shadowZItem.addActionListener(this);
372
+ if (Globals.ADVANCED)
373
+ {
374
+ menu.add("-");
272375 linkerItem = menu.add(new MenuItem("Linker"));
273376 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276377 attributeItem = menu.add(new MenuItem("Attribute"));
277378 attributeItem.addActionListener(this);
379
+ templateItem = menu.add(new MenuItem("Template"));
380
+ templateItem.addActionListener(this);
278381 pointflowItem = menu.add(new MenuItem("Point Flow"));
279382 pointflowItem.addActionListener(this);
383
+ }
280384 menu.add("-");
281385 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282386 resetTransformItem.addActionListener(this);
283387 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284388 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
389
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
390
+ resetCentroidXZItem.addActionListener(this);
391
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
392
+ transformGeometryItem.addActionListener(this);
393
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
394
+ transformChildrenItem.addActionListener(this);
287395
288396 oe.menuBar.add(menu = new Menu("Geometry"));
289397 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +402,11 @@
294402 genNormalsCADItem.addActionListener(this);
295403 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296404 genNormalsMESHItem.addActionListener(this);
405
+ if (Globals.ADVANCED)
406
+ {
297407 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298408 genNormalsMINEItem.addActionListener(this);
409
+ }
299410 stripifyItem = menu.add(new MenuItem("Stripify"));
300411 stripifyItem.addActionListener(this);
301412 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +428,34 @@
317428 reduce34MeshItem.addActionListener(this);
318429 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319430 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322431 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323432 clipMeshItem.addActionListener(this);
433
+
434
+ if (Globals.ADVANCED)
435
+ {
436
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
437
+ smoothMeshItem.addActionListener(this);
438
+ }
324439
325440 oe.menuBar.add(menu = new Menu("Attributes"));
326441 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327442 clearMaterialsItem.addActionListener(this);
443
+ resetAllItem = menu.add(new MenuItem("Reset All"));
444
+ resetAllItem.addActionListener(this);
445
+ stepAllItem = menu.add(new MenuItem("Step All"));
446
+ stepAllItem.addActionListener(this);
328447 menu.add("-");
329448 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330449 liveleavesItem.addActionListener(this);
331450 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332451 unliveleavesItem.addActionListener(this);
452
+ if (Globals.ADVANCED)
453
+ {
333454 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334455 supportleavesItem.addActionListener(this);
335456 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336457 unsupportleavesItem.addActionListener(this);
458
+ }
337459 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338460 hideleavesItem.addActionListener(this);
339461 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -377,29 +499,22 @@
377499 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378500 sortbynameItem.addActionListener(this);
379501 menu.add("-");
502
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
503
+ shareGeometriesItem.addActionListener(this);
504
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
505
+ mergeGeometriesItem.addActionListener(this);
506
+ if (Globals.ADVANCED)
507
+ {
508
+ // Pretty much the same as duplicate and clone.
380509 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381510 extractGeometriesItem.addActionListener(this);
382511 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383512 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);
513
+ }
388514
389515 oe.menuBar.add(menu = new Menu("Insert"));
390516 buildCreateMenu(menu);
391517
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
-
403518 oe.menuBar.add(menu = new Menu("Tools"));
404519 buildToolsMenu(menu);
405520 }
....@@ -437,9 +552,13 @@
437552 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438553
439554 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
555
+ liveCB.setToolTipText("Enable animation");
441556 liveCB.addItemListener(this);
442557
558
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559
+ oneStepButton.setToolTipText("Animate one step forward");
560
+ oneStepButton.addActionListener(this);
561
+
443562 oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444563 fastCB.setToolTipText("Fast mode");
445564 fastCB.addItemListener(this);
....@@ -448,51 +567,48 @@
448567 trackCB.setToolTipText("Enable tracking");
449568 trackCB.addItemListener(this);
450569
451
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
452571 screenfitButton.setToolTipText("Screen fit");
453572 screenfitButton.addActionListener(this);
454573
455574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
456575 // screenfitpointButton.addActionListener(this);
457
-// oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
459
- snapobjectButton.addActionListener(this);
460
- snapobjectButton.setToolTipText("Snap Object");
461
- oe.aConstraints.gridx += 1;
462576
463
- //aConstraints.gridx = 0;
464
- //aConstraints.gridy += 1;
465
- oe.aConstraints.weighty = 0;
466
- oe.aConstraints.gridwidth = 1;
467
-
468
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
577
+ if (Globals.ADVANCED)
578
+ {
579
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ snapobjectButton.addActionListener(this);
581
+ snapobjectButton.setToolTipText("Snap Object");
582
+ }
583
+
584
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
469585 flashSelectionButton.setToolTipText("Show selection");
470586 flashSelectionButton.addActionListener(this);
471587
472588 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473589
474
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
590
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
475591 twoButton.setToolTipText("Show center view only");
476592 twoButton.addActionListener(this);
477
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
478594 fourButton.addActionListener(this);
479595 fourButton.setToolTipText("Show left panel only");
480
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
481597 sixButton.setToolTipText("2-column layout left");
482598 sixButton.addActionListener(this);
483
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
484600 threeButton.setToolTipText("2-column layout right");
485601 threeButton.addActionListener(this);
486
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
602
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
487603 sevenButton.setToolTipText("3-column layout");
488604 sevenButton.addActionListener(this);
489605 //
490606
491
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492608 rootButton.setToolTipText("Edit selection in new tab");
493609 rootButton.addActionListener(this);
494610
495
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
496612 closeButton.setToolTipText("Close tab");
497613 closeButton.addActionListener(this);
498614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -500,23 +616,23 @@
500616
501617 cGridBag commandsPanel = new cGridBag();
502618
503
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
619
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504620 editButton.setToolTipText("Edit selection");
505621 editButton.addActionListener(this);
506622
507
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508624 uneditButton.setToolTipText("Unedit selection");
509625 uneditButton.addActionListener(this);
510626
511
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
627
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
+ allParamsButton.setToolTipText("Edit all params");
629
+ allParamsButton.addActionListener(this);
630
+
631
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512632 clearPanelButton.setToolTipText("Clear edit panel");
513633 clearPanelButton.addActionListener(this);
514634
515
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
- allParamsButton.setToolTipText("All params??");
517
- allParamsButton.addActionListener(this);
518
-
519
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
635
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520636 unselectButton.setToolTipText("Unselect");
521637 unselectButton.addActionListener(this);
522638
....@@ -591,8 +707,18 @@
591707
592708 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593709 {
710
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
711
+ boxCB.setToolTipText("Display bounding boxes");
712
+ boxCB.addItemListener(this);
713
+
714
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
716
+ zoomBoxCB.addItemListener(this);
717
+
718
+ if (true) // Globals.ADVANCED)
719
+ {
594720 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
- supportCB.setToolTipText("Enabled rigging");
721
+ supportCB.setToolTipText("Enable rigging");
596722 supportCB.addItemListener(this);
597723
598724 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
....@@ -610,14 +736,6 @@
610736 slowCB.setToolTipText("Smooth interpolation");
611737 slowCB.addItemListener(this);
612738
613
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
614
- boxCB.setToolTipText("Display bounding boxes");
615
- boxCB.addItemListener(this);
616
-
617
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
618
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
619
- zoomBoxCB.addItemListener(this);
620
-
621739 // constraints.gridy += 1;
622740 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623741 // speakerMocapCB.addItemListener(this);
....@@ -648,6 +766,8 @@
648766 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649767 lookAtCB.setToolTipText("Look-at target");
650768 lookAtCB.addItemListener(this);
769
+
770
+ }
651771
652772 cGridBag fill = new cGridBag();
653773
....@@ -668,6 +788,7 @@
668788 buttonGroup.add(radioButton);
669789 radioButton.doClick();
670790 }
791
+
671792 void SetupViews(ObjEditor oe)
672793 {
673794 oe.SetupViews();
....@@ -884,7 +1005,9 @@
8841005 // objEditor.DropFile((java.io.File[]) object, true);
8851006 // return;
8861007 // }
887
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8881011 {
8891012 // file(s)
8901013 String[] names = string.split("\n");
....@@ -911,7 +1034,7 @@
9111034
9121035 flashIt = false;
9131036 CameraPane pane = (CameraPane) target;
914
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9151038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9161039
9171040 if (group.selection.size() == 1)
....@@ -938,11 +1061,11 @@
9381061 {
9391062 loadClipboard(true);
9401063 objEditor.jTree.setSelectionPath(destinationPath);
941
- pasteInto(false);
1064
+ pasteInto(false, false);
9421065 } else {
9431066 loadClipboard(false);
9441067 objEditor.jTree.setSelectionPath(destinationPath);
945
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9461069 }
9471070 }
9481071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1064,27 +1187,33 @@
10641187 kleinItem.addActionListener(this);
10651188 particleItem = menu.add(new MenuItem("Particle system"));
10661189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10671192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10681193 ragdollItem.addActionListener(this);
10691194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10701195 ragdoll2Item.addActionListener(this);
1196
+ }
10711197 menu.add("-");
1072
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10731199 meshItem.addActionListener(this);
10741200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10751201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10761204 springItem = menu.add(new MenuItem("Spring"));
10771205 springItem.addActionListener(this);
10781206 flagItem = menu.add(new MenuItem("Flag"));
10791207 flagItem.addActionListener(this);
1080
- bezierItem = menu.add(new MenuItem("Patch"));
1081
- bezierItem.addActionListener(this);
1082
- checkerItem = menu.add(new MenuItem("Checker"));
1083
- checkerItem.addActionListener(this);
10841208 blobItem = menu.add(new MenuItem("Blob"));
10851209 blobItem.addActionListener(this);
10861210 latheItem = menu.add(new MenuItem("Lathe"));
10871211 latheItem.addActionListener(this);
1212
+ }
1213
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1214
+ bezierItem.addActionListener(this);
1215
+ overlayItem = menu.add(new MenuItem("Overlay"));
1216
+ overlayItem.addActionListener(this);
10881217 lightItem = menu.add(new MenuItem("Light"));
10891218 lightItem.addActionListener(this);
10901219 menu.add("-");
....@@ -1094,8 +1223,11 @@
10941223 loopItem.addActionListener(this);
10951224 doubleItem = menu.add(new MenuItem("Fork"));
10961225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
10971228 tripleItem = menu.add(new MenuItem("Trident"));
10981229 tripleItem.addActionListener(this);
1230
+ }
10991231 }
11001232
11011233 void buildToolsMenu(Menu menu)
....@@ -1109,19 +1241,21 @@
11091241 parseverticesItem.addActionListener(this);
11101242 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11111243 textureFieldItem.addActionListener(this);
1112
- alignItem = menu.add(new MenuItem("Align"));
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
11131245 alignItem.addActionListener(this);
1114
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1115
- mirrorItem.addActionListener(this);
11161246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11171247 reduceMorphItem.addActionListener(this);
11181248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11191249 reduce34MorphItem.addActionListener(this);
1120
-
1250
+ menu.add("-");
11211251 menu.add(computeAOItem = new MenuItem("Compute AO"));
11221252 computeAOItem.addActionListener(this);
1123
- menu.add("-");
11241253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
11251259 menu.add(memoryItem = new MenuItem("Memory Usage"));
11261260 memoryItem.addActionListener(this);
11271261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1144,6 +1278,7 @@
11441278 menu.add("-");
11451279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11461280 editScriptItem.addActionListener(this);
1281
+ }
11471282 }
11481283
11491284 void ScreenFit()
....@@ -1472,9 +1607,9 @@
14721607
14731608 void Overwrite(int mask)
14741609 {
1475
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14761611 {
1477
- Object3D content = GrafreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14781613
14791614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14801615 content = ((cGroup)content).get(0);
....@@ -1645,7 +1780,7 @@
16451780 {
16461781 makeSomething(new BezierSurface());
16471782 } else
1648
- if (source == checkerItem)
1783
+ if (source == overlayItem)
16491784 {
16501785 /*
16511786 Object3D obj = new BezierSurface(5,8);
....@@ -1779,23 +1914,6 @@
17791914 csg.addChild(child);
17801915 child.addChild(csg);
17811916 } else
1782
-
1783
- if (source == importGFDItem)
1784
- {
1785
- ImportGFD();
1786
- } else
1787
- if (source == importVRMLX3DItem)
1788
- {
1789
- ImportVRMLX3D();
1790
- } else
1791
- if (source == import3DSItem)
1792
- {
1793
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1794
- } else
1795
- if (source == importOBJItem)
1796
- {
1797
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1798
- } else
17991917 if (source == computeAOItem)
18001918 {
18011919 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1814,7 +1932,7 @@
18141932 if (source == invariantsItem)
18151933 {
18161934 System.out.println("Invariants:");
1817
- GrafreeD.grafreeD.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
18181936 } else
18191937 if (source == memoryItem)
18201938 {
....@@ -1832,6 +1950,11 @@
18321950 if (source == dumpItem)
18331951 {
18341952 DumpObject();
1953
+ } else
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
18351958 } else
18361959 if (source == screenfitButton)
18371960 {
....@@ -1884,10 +2007,10 @@
18842007 } else
18852008 if (source == duplicateItem)
18862009 {
1887
- Object3D keep = GrafreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18882011 loadClipboard(false);
18892012 paste(false);
1890
- GrafreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18912014 } else
18922015 if (source == cloneItem)
18932016 {
....@@ -1905,13 +2028,17 @@
19052028 {
19062029 paste(false);
19072030 } else
2031
+ if (source == pasteIntoItem)
2032
+ {
2033
+ pasteInto(true, false);
2034
+ } else
19082035 if (source == pasteLinkItem)
19092036 {
1910
- pasteInto(false);
2037
+ pasteInto(false, false);
19112038 } else
19122039 if (source == pasteCloneItem)
19132040 {
1914
- pasteInto(true);
2041
+ pasteInto(true, true);
19152042 } else
19162043 if (source == pasteExpandItem)
19172044 {
....@@ -2103,9 +2230,9 @@
21032230 // group.selection.get(0).setMasterThis(content); // should be identity
21042231 // refreshContents();
21052232 // }
2106
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21072234 {
2108
- Object3D content = GrafreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
21092236
21102237 if (content instanceof cGroup && ((cGroup)content).transientlink )
21112238 content = ((cGroup)content).get(0);
....@@ -2113,11 +2240,11 @@
21132240 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21142241 for (int i=0; i<group.selection.size(); i++)
21152242 {
2116
- boolean random = CameraPane.RANDOM;
2117
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
21182245 group.selection.get(i).linkVerticesThis(content);
21192246 // group.selection.get(i).setMasterThis(content); // should be identity
2120
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
21212248 }
21222249 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21232250 refreshContents();
....@@ -2127,20 +2254,20 @@
21272254 {
21282255 for (int i=0; i<group.selection.size(); i++)
21292256 {
2130
- boolean random = CameraPane.RANDOM;
2131
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
21322259 group.selection.get(i).linkVerticesThis(null);
2133
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
21342261 }
21352262
21362263 refreshContents();
21372264 } else
21382265 if (source == relinkverticesItem)
21392266 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2267
+ boolean random = CameraPane.SWITCH;
2268
+ CameraPane.SWITCH = false; // parse all random nodes
21422269 group.selection.RelinkToSupport();
2143
- CameraPane.RANDOM = random;
2270
+ CameraPane.SWITCH = random;
21442271
21452272 refreshContents();
21462273 } else
....@@ -2155,9 +2282,9 @@
21552282 } else
21562283 if (source == setMasterItem)
21572284 {
2158
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21592286 {
2160
- Object3D content = GrafreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
21612288
21622289 if (content instanceof cGroup && ((cGroup)content).transientlink )
21632290 content = ((cGroup)content).get(0);
....@@ -2170,9 +2297,9 @@
21702297 {
21712298 if (group.selection.size() == 1)
21722299 {
2173
- if (GrafreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
21742301 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
21762303
21772304 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782305 content = ((cGroup)content).get(0);
....@@ -2189,7 +2316,7 @@
21892316 {
21902317 RevertMeshes();
21912318 } else
2192
- if (source == resetMeshItem)
2319
+ if (source == resetAllItem)
21932320 {
21942321 ResetAll();
21952322 } else
....@@ -2238,7 +2365,7 @@
22382365 RandomNode random = new RandomNode();
22392366 group(random);
22402367 if (random.size() > 0)
2241
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
22422369 } else
22432370 if (source == physicsItem)
22442371 {
....@@ -2527,9 +2654,13 @@
25272654 {
25282655 SmoothMesh();
25292656 } else
2530
- if (source == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
25312658 {
25322659 TransformGeometry();
2660
+ } else
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
25332664 } else
25342665 if (source == resetTransformItem)
25352666 {
....@@ -2537,7 +2668,11 @@
25372668 } else
25382669 if (source == resetCentroidItem)
25392670 {
2540
- ResetCentroid();
2671
+ ResetCentroid(true);
2672
+ } else
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
25412676 } else
25422677 if (source == resetParentItem)
25432678 {
....@@ -2895,7 +3030,7 @@
28953030
28963031 child.editWindow = null; // ???????????
28973032 }
2898
- objEditor.ctrlPanel.validate();
3033
+ objEditor.ctrlPanel.FlushUI();
28993034 //objEditor.jTree.clearSelection();
29003035 //objEditor.ResetSliders();
29013036 refreshContents(true);
....@@ -2979,7 +3114,9 @@
29793114 frontView.object = group;
29803115 sideView.object = group;
29813116 }
2982
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
29833120 /*
29843121 currentLayout = radio.layout;
29853122 if (currentLayout == null)
....@@ -2992,7 +3129,20 @@
29923129 //group.attributes = -1;
29933130 ResetModel();
29943131 refreshContents(true);
2995
- }
3132
+ } else if (event.getSource() == editCameraItem)
3133
+ {
3134
+ cameraView.ProtectCamera();
3135
+ cameraView.repaint();
3136
+ return;
3137
+ } else if (event.getSource() == revertCameraItem)
3138
+ {
3139
+ cameraView.RevertCamera();
3140
+ cameraView.repaint();
3141
+ return;
3142
+ // } else if (event.getSource() == textureButton)
3143
+ // {
3144
+ // return; // true;
3145
+ }
29963146 else
29973147 {
29983148 //return super.action(event, arg);
....@@ -3053,6 +3203,28 @@
30533203 refreshContents();
30543204 }
30553205
3206
+ void TransformChildren()
3207
+ {
3208
+ Object3D obj;
3209
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3210
+ {
3211
+ obj = (Object3D)e.nextElement();
3212
+ obj.KeepTextureMatrices();
3213
+ obj.TransformChildren();
3214
+ obj.RestoreTextureMatrices();
3215
+
3216
+// if (obj.parent == null)
3217
+// {
3218
+// System.out.println("NULL PARENT!");
3219
+// new Exception().printStackTrace();
3220
+// }
3221
+// else
3222
+// TouchTransform(obj);
3223
+// //obj.parent.Touch();
3224
+ }
3225
+
3226
+ refreshContents();
3227
+ }
30563228
30573229 void ResetTransform()
30583230 {
....@@ -3165,7 +3337,7 @@
31653337 refreshContents();
31663338 }
31673339
3168
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
31693341 {
31703342 Object3D obj;
31713343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3180,12 +3352,16 @@
31803352 LA.matIdentity(Object3D.mat);
31813353 obj.getBounds(minima, maxima, false);
31823354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3183
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31843357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31853358 obj.TransformMesh(Object3D.mat);
3359
+
31863360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3187
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31883363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
31893365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31903366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31913367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3251,9 +3427,9 @@
32513427 obj = (Object3D)e.nextElement();
32523428
32533429 System.out.println("Object is: " + obj);
3254
- GrafreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
32553431 System.out.println("Boundary rep: " + obj.bRep);
3256
- GrafreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
32573433
32583434 // System.err.println((size/1024) + " KB is the size of " + obj);
32593435 }
....@@ -3467,8 +3643,8 @@
34673643
34683644 void ParseVertices()
34693645 {
3470
- boolean epsequal = GrafreeD.epsequal;
3471
- GrafreeD.epsequal = true;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
34723648
34733649 for (int i=0; i<group.selection.size(); i++)
34743650 {
....@@ -3493,7 +3669,7 @@
34933669 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34943670 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34953671
3496
- g.add(GrafreeD.clipboard);
3672
+ g.add(Grafreed.clipboard);
34973673
34983674 buffer.add(g);
34993675 }
....@@ -3508,7 +3684,7 @@
35083684 makeSomething(buffer, i==group.selection.size()-1);
35093685 }
35103686
3511
- GrafreeD.epsequal = epsequal;
3687
+ Grafreed.epsequal = epsequal;
35123688
35133689 refreshContents();
35143690 }
....@@ -3526,7 +3702,16 @@
35263702 String pigment = Object3D.GetPigment(tex);
35273703 //String bump = Object3D.GetBump(tex);
35283704
3529
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3705
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3706
+
3707
+ try
3708
+ {
3709
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3710
+ }
3711
+ catch (Exception e)
3712
+ {
3713
+ System.err.println("FAIL: " + node);
3714
+ }
35303715
35313716 double s = v.s;
35323717
....@@ -3614,11 +3799,11 @@
36143799
36153800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36163801
3617
- boolean random = CameraPane.RANDOM;
3618
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
36193804 lowres.linkVerticesThis(null);
36203805 lowres.linkVerticesThis(sn);
3621
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
36223807
36233808 System.err.flush();
36243809
....@@ -3658,7 +3843,7 @@
36583843 return;
36593844
36603845 Object3D poses = group.selection.get(0);
3661
- Object3D ref = GrafreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
36623847
36633848 Object3D newgroup = new Object3D("Po:" + poses.name);
36643849
....@@ -3852,9 +4037,9 @@
38524037
38534038 void ClipMesh()
38544039 {
3855
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38564041 {
3857
- Object3D content = GrafreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
38584043
38594044 if (content instanceof cGroup && ((cGroup)content).transientlink )
38604045 content = ((cGroup)content).get(0);
....@@ -3863,7 +4048,7 @@
38634048 // {
38644049 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38654050 // }
3866
- group.selection.ClipMesh(GrafreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
38674052 }
38684053 // group.selection.ClipMesh(GrafreeD.clipboard);
38694054 System.out.println("DONE.");
....@@ -3998,7 +4183,7 @@
39984183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39994184
40004185 Object3D elem = (Object3D)group.selection.elementAt(i);
4001
- if(elem != group)
4186
+ if(elem != group || !newWindow)
40024187 {
40034188 // if (!(elem instanceof Composite))
40044189 // newWindow = false;
....@@ -4203,12 +4388,12 @@
42034388 {
42044389 if (group.selection.isEmpty())
42054390 return;
4206
- GrafreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
42074392 Composite tGroup = null;
42084393 if (group.selection.size() > 0) // 1)
42094394 {
42104395 tGroup = new cGroup();
4211
- GrafreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
42124397 }
42134398
42144399 if (cut)
....@@ -4248,16 +4433,16 @@
42484433 //System.out.println("cut " + child);
42494434 //System.out.println("parent = " + child.parent);
42504435 // tmp.addChild(child);
4251
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
42524437 tGroup.add/*Child*/(tmp);
42534438 else
4254
- GrafreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
42554440 }
42564441 else
4257
- if (GrafreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
42584443 tGroup.add/*Child*/(child);
42594444 else
4260
- GrafreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
42614446 }
42624447
42634448 //ResetModel();
....@@ -4289,21 +4474,21 @@
42894474 //System.out.println("cut " + elem);
42904475 //System.out.println("parent = " + elem.parent);
42914476 // tmp.addChild(elem);
4292
- if (GrafreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
42934478 tGroup.add/*Child*/(tmp);
42944479 else
4295
- GrafreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
42964481 }
42974482 else
4298
- if (GrafreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
42994484 tGroup.add/*Child*/(child);
43004485 else
4301
- GrafreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
43024487 }
43034488
43044489 }
4305
- if (GrafreeD.clipboardIsTempGroup)
4306
- GrafreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
43074492 if (cut)
43084493 {
43094494 ResetModel();
....@@ -4317,7 +4502,7 @@
43174502 // return;
43184503 boolean first = true;
43194504
4320
- if (GrafreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
43214506 {
43224507 Composite temp;
43234508
....@@ -4328,7 +4513,7 @@
43284513 temp = (Composite)Applet3D.clipboard.deepCopy();
43294514 */
43304515 Object3D elem;
4331
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4516
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43324517 {
43334518 Object3D child = (Object3D)e.nextElement();
43344519
....@@ -4362,21 +4547,21 @@
43624547 //Object3D cb = Applet3D.clipboard;
43634548 //temp.addChild(cb);
43644549 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4365
- assert(GrafreeD.clipboard.parent == null);
4366
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4367
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4368
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4369
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4550
+ assert(Grafreed.clipboard.parent == null);
4551
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4552
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4553
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4554
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43704555 else
4371
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4372
- GrafreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
43734558 }
43744559
43754560 ResetModel();
43764561 refreshContents();
43774562 }
43784563
4379
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
43804565 {
43814566 // if (GrafreeD.clipboard == null)
43824567 // return;
....@@ -4405,15 +4590,22 @@
44054590 if (copyit)
44064591 {
44074592 // paste(false);
4408
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
44094601 }
44104602 else
44114603 {
44124604 boolean first = true;
44134605
4414
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
44154607 {
4416
- Composite temp = (Composite)GrafreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
44174609 Object3D copy;
44184610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44194611 {
....@@ -4423,7 +4615,7 @@
44234615 }
44244616 } else
44254617 {
4426
- linkSomething(GrafreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
44274619 }
44284620 }
44294621 }
....@@ -4828,21 +5020,6 @@
48285020 }
48295021 */
48305022
4831
- void ImportGFD()
4832
- {
4833
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4834
- browser.show();
4835
- String filename = browser.getFile();
4836
- if (filename != null && filename.length() > 0)
4837
- {
4838
- String fullname = browser.getDirectory() + filename;
4839
-
4840
- //Object3D readobj =
4841
- objEditor.ReadGFD(fullname, objEditor);
4842
- //makeSomething(readobj);
4843
- }
4844
- }
4845
-
48465023 /*
48475024 public void Callback(Object obj)
48485025 {
....@@ -4866,26 +5043,9 @@
48665043 }
48675044 */
48685045
4869
- void ImportVRMLX3D()
4870
- {
4871
- if (GrafreeD.standAlone)
4872
- {
4873
- /**/
4874
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4875
- browser.show();
4876
- String filename = browser.getFile();
4877
- if (filename != null && filename.length() > 0)
4878
- {
4879
- String fullname = browser.getDirectory() + filename;
4880
- LoadVRMLX3D(fullname);
4881
- }
4882
- /**/
4883
- }
4884
- }
4885
-
48865046 String GetFile(String dialogName)
48875047 {
4888
- if (GrafreeD.standAlone)
5048
+ if (Grafreed.standAlone)
48895049 {
48905050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48915051 browser.show();
....@@ -4949,10 +5109,12 @@
49495109 cButton flashSelectionButton;
49505110 cButton editButton;
49515111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
49525113 cButton clearpanelButton;
4953
- cButton allParamsButton;
49545114 cButton unselectButton;
49555115
5116
+ cButton oneStepButton;
5117
+
49565118 cButton screenfitButton;
49575119 cButton screenfitpointButton;
49585120 cButton snapobjectButton;
....@@ -4996,7 +5158,7 @@
49965158 private MenuItem linkverticesItem;
49975159 private MenuItem relinkverticesItem;
49985160 private MenuItem setMasterItem;
4999
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
50005162 private MenuItem stepAllItem;
50015163 private MenuItem revertMeshItem;
50025164 private MenuItem poseMeshItem;
....@@ -5007,6 +5169,7 @@
50075169 private MenuItem mergeGeometriesItem;
50085170 private MenuItem copyItem;
50095171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
50105173 private MenuItem pasteLinkItem;
50115174 private MenuItem pasteCloneItem;
50125175 private MenuItem pasteExpandItem;
....@@ -5056,8 +5219,10 @@
50565219 private MenuItem panoTexturesItem;
50575220
50585221 private MenuItem resetCentroidItem;
5059
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
50605223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
50615226 private MenuItem hideItem;
50625227 private MenuItem grabItem;
50635228 private MenuItem backItem;
....@@ -5104,7 +5269,7 @@
51045269 private MenuItem blobItem;
51055270 private MenuItem latheItem;
51065271 private MenuItem bezierItem;
5107
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
51085273 private MenuItem meshItem;
51095274 // private MenuItem meshGroupItem;
51105275 private MenuItem springItem;
....@@ -5126,11 +5291,6 @@
51265291 private MenuItem doubleItem;
51275292 private MenuItem tripleItem;
51285293
5129
- private MenuItem importGFDItem;
5130
- private MenuItem importVRMLX3DItem;
5131
- private MenuItem import3DSItem;
5132
- private MenuItem importOBJItem;
5133
-
51345294 private MenuItem computeAOItem;
51355295 private MenuItem recompileItem;
51365296 private MenuItem editScriptItem;
....@@ -5140,4 +5300,8 @@
51405300 private MenuItem analyzeItem;
51415301 private MenuItem dumpItem;
51425302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
51435307 }