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,58 +552,63 @@
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
+
562
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
563
+ fastCB.setToolTipText("Fast mode");
564
+ fastCB.addItemListener(this);
565
+
443566 oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444567 trackCB.setToolTipText("Enable tracking");
445568 trackCB.addItemListener(this);
446569
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448571 screenfitButton.setToolTipText("Screen fit");
449572 screenfitButton.addActionListener(this);
450573
451574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452575 // 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;
458576
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);
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);
465585 flashSelectionButton.setToolTipText("Show selection");
466586 flashSelectionButton.addActionListener(this);
467587
468588 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469589
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
590
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471591 twoButton.setToolTipText("Show center view only");
472592 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474594 fourButton.addActionListener(this);
475595 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477597 sixButton.setToolTipText("2-column layout left");
478598 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480600 threeButton.setToolTipText("2-column layout right");
481601 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
602
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483603 sevenButton.setToolTipText("3-column layout");
484604 sevenButton.addActionListener(this);
485605 //
486606
487
- 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);
488608 rootButton.setToolTipText("Edit selection in new tab");
489609 rootButton.addActionListener(this);
490610
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492612 closeButton.setToolTipText("Close tab");
493613 closeButton.addActionListener(this);
494614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -496,23 +616,23 @@
496616
497617 cGridBag commandsPanel = new cGridBag();
498618
499
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
619
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500620 editButton.setToolTipText("Edit selection");
501621 editButton.addActionListener(this);
502622
503
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504624 uneditButton.setToolTipText("Unedit selection");
505625 uneditButton.addActionListener(this);
506626
507
- 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);
508632 clearPanelButton.setToolTipText("Clear edit panel");
509633 clearPanelButton.addActionListener(this);
510634
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);
635
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516636 unselectButton.setToolTipText("Unselect");
517637 unselectButton.addActionListener(this);
518638
....@@ -587,43 +707,35 @@
587707
588708 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589709 {
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;
619710 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620711 boxCB.setToolTipText("Display bounding boxes");
621712 boxCB.addItemListener(this);
622
- //constraints.gridy += 1;
713
+
623714 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624715 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625716 zoomBoxCB.addItemListener(this);
626717
718
+ if (true) // Globals.ADVANCED)
719
+ {
720
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
+ supportCB.setToolTipText("Enable rigging");
722
+ supportCB.addItemListener(this);
723
+
724
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
725
+ // localCB.addItemListener(this);
726
+
727
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
728
+ crowdCB.setToolTipText("Used for crowds");
729
+ crowdCB.addItemListener(this);
730
+
731
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
732
+ smoothCB.setToolTipText("Snapping delay");
733
+ smoothCB.addItemListener(this);
734
+
735
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
736
+ slowCB.setToolTipText("Smooth interpolation");
737
+ slowCB.addItemListener(this);
738
+
627739 // constraints.gridy += 1;
628740 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629741 // speakerMocapCB.addItemListener(this);
....@@ -648,14 +760,14 @@
648760 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649761 // debugCB.addItemListener(this);
650762
651
- //constraints.gridy += 1;
652763 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653764 oeilCB.addItemListener(this);
654765
655
- //constraints.gridy += 1;
656766 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657767 lookAtCB.setToolTipText("Look-at target");
658768 lookAtCB.addItemListener(this);
769
+
770
+ }
659771
660772 cGridBag fill = new cGridBag();
661773
....@@ -676,6 +788,7 @@
676788 buttonGroup.add(radioButton);
677789 radioButton.doClick();
678790 }
791
+
679792 void SetupViews(ObjEditor oe)
680793 {
681794 oe.SetupViews();
....@@ -892,7 +1005,9 @@
8921005 // objEditor.DropFile((java.io.File[]) object, true);
8931006 // return;
8941007 // }
895
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8961011 {
8971012 // file(s)
8981013 String[] names = string.split("\n");
....@@ -919,7 +1034,7 @@
9191034
9201035 flashIt = false;
9211036 CameraPane pane = (CameraPane) target;
922
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9231038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9241039
9251040 if (group.selection.size() == 1)
....@@ -946,11 +1061,11 @@
9461061 {
9471062 loadClipboard(true);
9481063 objEditor.jTree.setSelectionPath(destinationPath);
949
- pasteInto(false);
1064
+ pasteInto(false, false);
9501065 } else {
9511066 loadClipboard(false);
9521067 objEditor.jTree.setSelectionPath(destinationPath);
953
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9541069 }
9551070 }
9561071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1072,27 +1187,33 @@
10721187 kleinItem.addActionListener(this);
10731188 particleItem = menu.add(new MenuItem("Particle system"));
10741189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10751192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10761193 ragdollItem.addActionListener(this);
10771194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10781195 ragdoll2Item.addActionListener(this);
1196
+ }
10791197 menu.add("-");
1080
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10811199 meshItem.addActionListener(this);
10821200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10831201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10841204 springItem = menu.add(new MenuItem("Spring"));
10851205 springItem.addActionListener(this);
10861206 flagItem = menu.add(new MenuItem("Flag"));
10871207 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);
10921208 blobItem = menu.add(new MenuItem("Blob"));
10931209 blobItem.addActionListener(this);
10941210 latheItem = menu.add(new MenuItem("Lathe"));
10951211 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);
10961217 lightItem = menu.add(new MenuItem("Light"));
10971218 lightItem.addActionListener(this);
10981219 menu.add("-");
....@@ -1102,34 +1223,39 @@
11021223 loopItem.addActionListener(this);
11031224 doubleItem = menu.add(new MenuItem("Fork"));
11041225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
11051228 tripleItem = menu.add(new MenuItem("Trident"));
11061229 tripleItem.addActionListener(this);
1230
+ }
11071231 }
11081232
11091233 void buildToolsMenu(Menu menu)
11101234 {
11111235 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11121236 animationItem.addItemListener(this);
1113
- animationItem.setState(CameraPane.ANIMATION);
1237
+ animationItem.setState(Globals.ANIMATION);
11141238
11151239 menu.add("-");
11161240 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11171241 parseverticesItem.addActionListener(this);
11181242 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11191243 textureFieldItem.addActionListener(this);
1120
- alignItem = menu.add(new MenuItem("Align"));
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
11211245 alignItem.addActionListener(this);
1122
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1123
- mirrorItem.addActionListener(this);
11241246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11251247 reduceMorphItem.addActionListener(this);
11261248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11271249 reduce34MorphItem.addActionListener(this);
1128
-
1250
+ menu.add("-");
11291251 menu.add(computeAOItem = new MenuItem("Compute AO"));
11301252 computeAOItem.addActionListener(this);
1131
- menu.add("-");
11321253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
11331259 menu.add(memoryItem = new MenuItem("Memory Usage"));
11341260 memoryItem.addActionListener(this);
11351261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1152,6 +1278,7 @@
11521278 menu.add("-");
11531279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11541280 editScriptItem.addActionListener(this);
1281
+ }
11551282 }
11561283
11571284 void ScreenFit()
....@@ -1480,9 +1607,9 @@
14801607
14811608 void Overwrite(int mask)
14821609 {
1483
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14841611 {
1485
- Object3D content = GrafreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14861613
14871614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14881615 content = ((cGroup)content).get(0);
....@@ -1653,7 +1780,7 @@
16531780 {
16541781 makeSomething(new BezierSurface());
16551782 } else
1656
- if (source == checkerItem)
1783
+ if (source == overlayItem)
16571784 {
16581785 /*
16591786 Object3D obj = new BezierSurface(5,8);
....@@ -1787,23 +1914,6 @@
17871914 csg.addChild(child);
17881915 child.addChild(csg);
17891916 } 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
18071917 if (source == computeAOItem)
18081918 {
18091919 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1822,7 +1932,7 @@
18221932 if (source == invariantsItem)
18231933 {
18241934 System.out.println("Invariants:");
1825
- GrafreeD.grafreeD.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
18261936 } else
18271937 if (source == memoryItem)
18281938 {
....@@ -1840,6 +1950,11 @@
18401950 if (source == dumpItem)
18411951 {
18421952 DumpObject();
1953
+ } else
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
18431958 } else
18441959 if (source == screenfitButton)
18451960 {
....@@ -1892,10 +2007,10 @@
18922007 } else
18932008 if (source == duplicateItem)
18942009 {
1895
- Object3D keep = GrafreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18962011 loadClipboard(false);
18972012 paste(false);
1898
- GrafreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18992014 } else
19002015 if (source == cloneItem)
19012016 {
....@@ -1913,13 +2028,17 @@
19132028 {
19142029 paste(false);
19152030 } else
2031
+ if (source == pasteIntoItem)
2032
+ {
2033
+ pasteInto(true, false);
2034
+ } else
19162035 if (source == pasteLinkItem)
19172036 {
1918
- pasteInto(false);
2037
+ pasteInto(false, false);
19192038 } else
19202039 if (source == pasteCloneItem)
19212040 {
1922
- pasteInto(true);
2041
+ pasteInto(true, true);
19232042 } else
19242043 if (source == pasteExpandItem)
19252044 {
....@@ -2111,9 +2230,9 @@
21112230 // group.selection.get(0).setMasterThis(content); // should be identity
21122231 // refreshContents();
21132232 // }
2114
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21152234 {
2116
- Object3D content = GrafreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
21172236
21182237 if (content instanceof cGroup && ((cGroup)content).transientlink )
21192238 content = ((cGroup)content).get(0);
....@@ -2121,11 +2240,11 @@
21212240 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21222241 for (int i=0; i<group.selection.size(); i++)
21232242 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
21262245 group.selection.get(i).linkVerticesThis(content);
21272246 // group.selection.get(i).setMasterThis(content); // should be identity
2128
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
21292248 }
21302249 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21312250 refreshContents();
....@@ -2135,20 +2254,20 @@
21352254 {
21362255 for (int i=0; i<group.selection.size(); i++)
21372256 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
21402259 group.selection.get(i).linkVerticesThis(null);
2141
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
21422261 }
21432262
21442263 refreshContents();
21452264 } else
21462265 if (source == relinkverticesItem)
21472266 {
2148
- boolean random = CameraPane.RANDOM;
2149
- CameraPane.RANDOM = false; // parse all random nodes
2267
+ boolean random = CameraPane.SWITCH;
2268
+ CameraPane.SWITCH = false; // parse all random nodes
21502269 group.selection.RelinkToSupport();
2151
- CameraPane.RANDOM = random;
2270
+ CameraPane.SWITCH = random;
21522271
21532272 refreshContents();
21542273 } else
....@@ -2163,9 +2282,9 @@
21632282 } else
21642283 if (source == setMasterItem)
21652284 {
2166
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21672286 {
2168
- Object3D content = GrafreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
21692288
21702289 if (content instanceof cGroup && ((cGroup)content).transientlink )
21712290 content = ((cGroup)content).get(0);
....@@ -2178,9 +2297,9 @@
21782297 {
21792298 if (group.selection.size() == 1)
21802299 {
2181
- if (GrafreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
21822301 {
2183
- Object3D content = GrafreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
21842303
21852304 if (content instanceof cGroup && ((cGroup)content).transientlink )
21862305 content = ((cGroup)content).get(0);
....@@ -2197,7 +2316,7 @@
21972316 {
21982317 RevertMeshes();
21992318 } else
2200
- if (source == resetMeshItem)
2319
+ if (source == resetAllItem)
22012320 {
22022321 ResetAll();
22032322 } else
....@@ -2246,7 +2365,7 @@
22462365 RandomNode random = new RandomNode();
22472366 group(random);
22482367 if (random.size() > 0)
2249
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
22502369 } else
22512370 if (source == physicsItem)
22522371 {
....@@ -2535,9 +2654,13 @@
25352654 {
25362655 SmoothMesh();
25372656 } else
2538
- if (source == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
25392658 {
25402659 TransformGeometry();
2660
+ } else
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
25412664 } else
25422665 if (source == resetTransformItem)
25432666 {
....@@ -2545,7 +2668,11 @@
25452668 } else
25462669 if (source == resetCentroidItem)
25472670 {
2548
- ResetCentroid();
2671
+ ResetCentroid(true);
2672
+ } else
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
25492676 } else
25502677 if (source == resetParentItem)
25512678 {
....@@ -2903,7 +3030,7 @@
29033030
29043031 child.editWindow = null; // ???????????
29053032 }
2906
- objEditor.ctrlPanel.validate();
3033
+ objEditor.ctrlPanel.FlushUI();
29073034 //objEditor.jTree.clearSelection();
29083035 //objEditor.ResetSliders();
29093036 refreshContents(true);
....@@ -2987,7 +3114,9 @@
29873114 frontView.object = group;
29883115 sideView.object = group;
29893116 }
2990
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
29913120 /*
29923121 currentLayout = radio.layout;
29933122 if (currentLayout == null)
....@@ -3000,7 +3129,20 @@
30003129 //group.attributes = -1;
30013130 ResetModel();
30023131 refreshContents(true);
3003
- }
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
+ }
30043146 else
30053147 {
30063148 //return super.action(event, arg);
....@@ -3061,6 +3203,28 @@
30613203 refreshContents();
30623204 }
30633205
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
+ }
30643228
30653229 void ResetTransform()
30663230 {
....@@ -3173,7 +3337,7 @@
31733337 refreshContents();
31743338 }
31753339
3176
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
31773341 {
31783342 Object3D obj;
31793343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3188,12 +3352,16 @@
31883352 LA.matIdentity(Object3D.mat);
31893353 obj.getBounds(minima, maxima, false);
31903354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3191
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31923357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31933358 obj.TransformMesh(Object3D.mat);
3359
+
31943360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3195
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31963363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
31973365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31983366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31993367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3259,9 +3427,9 @@
32593427 obj = (Object3D)e.nextElement();
32603428
32613429 System.out.println("Object is: " + obj);
3262
- GrafreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
32633431 System.out.println("Boundary rep: " + obj.bRep);
3264
- GrafreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
32653433
32663434 // System.err.println((size/1024) + " KB is the size of " + obj);
32673435 }
....@@ -3475,8 +3643,8 @@
34753643
34763644 void ParseVertices()
34773645 {
3478
- boolean epsequal = GrafreeD.epsequal;
3479
- GrafreeD.epsequal = true;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
34803648
34813649 for (int i=0; i<group.selection.size(); i++)
34823650 {
....@@ -3501,7 +3669,7 @@
35013669 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35023670 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35033671
3504
- g.add(GrafreeD.clipboard);
3672
+ g.add(Grafreed.clipboard);
35053673
35063674 buffer.add(g);
35073675 }
....@@ -3516,7 +3684,7 @@
35163684 makeSomething(buffer, i==group.selection.size()-1);
35173685 }
35183686
3519
- GrafreeD.epsequal = epsequal;
3687
+ Grafreed.epsequal = epsequal;
35203688
35213689 refreshContents();
35223690 }
....@@ -3534,7 +3702,16 @@
35343702 String pigment = Object3D.GetPigment(tex);
35353703 //String bump = Object3D.GetBump(tex);
35363704
3537
- 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
+ }
35383715
35393716 double s = v.s;
35403717
....@@ -3622,11 +3799,11 @@
36223799
36233800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36243801
3625
- boolean random = CameraPane.RANDOM;
3626
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
36273804 lowres.linkVerticesThis(null);
36283805 lowres.linkVerticesThis(sn);
3629
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
36303807
36313808 System.err.flush();
36323809
....@@ -3666,7 +3843,7 @@
36663843 return;
36673844
36683845 Object3D poses = group.selection.get(0);
3669
- Object3D ref = GrafreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
36703847
36713848 Object3D newgroup = new Object3D("Po:" + poses.name);
36723849
....@@ -3860,9 +4037,9 @@
38604037
38614038 void ClipMesh()
38624039 {
3863
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38644041 {
3865
- Object3D content = GrafreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
38664043
38674044 if (content instanceof cGroup && ((cGroup)content).transientlink )
38684045 content = ((cGroup)content).get(0);
....@@ -3871,7 +4048,7 @@
38714048 // {
38724049 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38734050 // }
3874
- group.selection.ClipMesh(GrafreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
38754052 }
38764053 // group.selection.ClipMesh(GrafreeD.clipboard);
38774054 System.out.println("DONE.");
....@@ -4006,7 +4183,7 @@
40064183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40074184
40084185 Object3D elem = (Object3D)group.selection.elementAt(i);
4009
- if(elem != group)
4186
+ if(elem != group || !newWindow)
40104187 {
40114188 // if (!(elem instanceof Composite))
40124189 // newWindow = false;
....@@ -4211,12 +4388,12 @@
42114388 {
42124389 if (group.selection.isEmpty())
42134390 return;
4214
- GrafreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
42154392 Composite tGroup = null;
42164393 if (group.selection.size() > 0) // 1)
42174394 {
42184395 tGroup = new cGroup();
4219
- GrafreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
42204397 }
42214398
42224399 if (cut)
....@@ -4256,16 +4433,16 @@
42564433 //System.out.println("cut " + child);
42574434 //System.out.println("parent = " + child.parent);
42584435 // tmp.addChild(child);
4259
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
42604437 tGroup.add/*Child*/(tmp);
42614438 else
4262
- GrafreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
42634440 }
42644441 else
4265
- if (GrafreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
42664443 tGroup.add/*Child*/(child);
42674444 else
4268
- GrafreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
42694446 }
42704447
42714448 //ResetModel();
....@@ -4297,21 +4474,21 @@
42974474 //System.out.println("cut " + elem);
42984475 //System.out.println("parent = " + elem.parent);
42994476 // tmp.addChild(elem);
4300
- if (GrafreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
43014478 tGroup.add/*Child*/(tmp);
43024479 else
4303
- GrafreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
43044481 }
43054482 else
4306
- if (GrafreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
43074484 tGroup.add/*Child*/(child);
43084485 else
4309
- GrafreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
43104487 }
43114488
43124489 }
4313
- if (GrafreeD.clipboardIsTempGroup)
4314
- GrafreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
43154492 if (cut)
43164493 {
43174494 ResetModel();
....@@ -4325,7 +4502,7 @@
43254502 // return;
43264503 boolean first = true;
43274504
4328
- if (GrafreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
43294506 {
43304507 Composite temp;
43314508
....@@ -4336,7 +4513,7 @@
43364513 temp = (Composite)Applet3D.clipboard.deepCopy();
43374514 */
43384515 Object3D elem;
4339
- 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))
43404517 {
43414518 Object3D child = (Object3D)e.nextElement();
43424519
....@@ -4370,21 +4547,21 @@
43704547 //Object3D cb = Applet3D.clipboard;
43714548 //temp.addChild(cb);
43724549 //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());
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());
43784555 else
4379
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4380
- GrafreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
43814558 }
43824559
43834560 ResetModel();
43844561 refreshContents();
43854562 }
43864563
4387
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
43884565 {
43894566 // if (GrafreeD.clipboard == null)
43904567 // return;
....@@ -4413,15 +4590,22 @@
44134590 if (copyit)
44144591 {
44154592 // paste(false);
4416
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
44174601 }
44184602 else
44194603 {
44204604 boolean first = true;
44214605
4422
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
44234607 {
4424
- Composite temp = (Composite)GrafreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
44254609 Object3D copy;
44264610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44274611 {
....@@ -4431,7 +4615,7 @@
44314615 }
44324616 } else
44334617 {
4434
- linkSomething(GrafreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
44354619 }
44364620 }
44374621 }
....@@ -4836,21 +5020,6 @@
48365020 }
48375021 */
48385022
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
-
48545023 /*
48555024 public void Callback(Object obj)
48565025 {
....@@ -4874,26 +5043,9 @@
48745043 }
48755044 */
48765045
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
-
48945046 String GetFile(String dialogName)
48955047 {
4896
- if (GrafreeD.standAlone)
5048
+ if (Grafreed.standAlone)
48975049 {
48985050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48995051 browser.show();
....@@ -4957,10 +5109,12 @@
49575109 cButton flashSelectionButton;
49585110 cButton editButton;
49595111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
49605113 cButton clearpanelButton;
4961
- cButton allParamsButton;
49625114 cButton unselectButton;
49635115
5116
+ cButton oneStepButton;
5117
+
49645118 cButton screenfitButton;
49655119 cButton screenfitpointButton;
49665120 cButton snapobjectButton;
....@@ -5004,7 +5158,7 @@
50045158 private MenuItem linkverticesItem;
50055159 private MenuItem relinkverticesItem;
50065160 private MenuItem setMasterItem;
5007
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
50085162 private MenuItem stepAllItem;
50095163 private MenuItem revertMeshItem;
50105164 private MenuItem poseMeshItem;
....@@ -5015,6 +5169,7 @@
50155169 private MenuItem mergeGeometriesItem;
50165170 private MenuItem copyItem;
50175171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
50185173 private MenuItem pasteLinkItem;
50195174 private MenuItem pasteCloneItem;
50205175 private MenuItem pasteExpandItem;
....@@ -5064,8 +5219,10 @@
50645219 private MenuItem panoTexturesItem;
50655220
50665221 private MenuItem resetCentroidItem;
5067
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
50685223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
50695226 private MenuItem hideItem;
50705227 private MenuItem grabItem;
50715228 private MenuItem backItem;
....@@ -5112,7 +5269,7 @@
51125269 private MenuItem blobItem;
51135270 private MenuItem latheItem;
51145271 private MenuItem bezierItem;
5115
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
51165273 private MenuItem meshItem;
51175274 // private MenuItem meshGroupItem;
51185275 private MenuItem springItem;
....@@ -5134,11 +5291,6 @@
51345291 private MenuItem doubleItem;
51355292 private MenuItem tripleItem;
51365293
5137
- private MenuItem importGFDItem;
5138
- private MenuItem importVRMLX3DItem;
5139
- private MenuItem import3DSItem;
5140
- private MenuItem importOBJItem;
5141
-
51425294 private MenuItem computeAOItem;
51435295 private MenuItem recompileItem;
51445296 private MenuItem editScriptItem;
....@@ -5148,4 +5300,8 @@
51485300 private MenuItem analyzeItem;
51495301 private MenuItem dumpItem;
51505302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
51515307 }