Normand Briere
2019-06-13 4629090fafbef256abd0686a85ee12042d658868
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -148,8 +148,130 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
153275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,45 +283,17 @@
161283 lookAtItem.addActionListener(this);
162284 //lookFromItem.addActinoListener(this);
163285 //switchItem.addActionListener(this);
164
- Menu menu;
165
- oe.menuBar.add(menu = new Menu("Edit"));
166
- //editItem = menu.add(new MenuItem("Edit"));
167
- //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
169
- duplicateItem.addActionListener(this);
170
- menu.add("-");
171
- cloneItem = menu.add(new MenuItem("Clone"));
172
- cloneItem.addActionListener(this);
173
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174
- cloneSupportItem.addActionListener(this);
175
- menu.add("-");
176
- cutItem = menu.add(new MenuItem("Cut"));
177
- cutItem.addActionListener(this);
178
- copyItem = menu.add(new MenuItem("Copy"));
179
- copyItem.addActionListener(this);
180
- pasteItem = menu.add(new MenuItem("Paste"));
181
- pasteItem.addActionListener(this);
182
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
183
- pasteLinkItem.addActionListener(this);
184
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185
- pasteCloneItem.addActionListener(this);
186
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187
-// pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
190
- clearAllItem = menu.add(new MenuItem("Clear All"));
191
- clearAllItem.addActionListener(this);
192
-
286
+ }
287
+
193288 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
289
+ if (Globals.ADVANCED)
290
+ {
198291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199292 revertMeshItem.addActionListener(this);
200293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201294 resetreferencesItem.addActionListener(this);
202295 menu.add("-");
296
+ }
203297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204298 overwriteGeoItem.addActionListener(this);
205299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +305,26 @@
211305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212306 overwriteUVItem.addActionListener(this);
213307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
214310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215311 generateMeshItem.addActionListener(this);
216312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217313 poseMeshItem.addActionListener(this);
218314 menu.add("-");
315
+ }
219316 resetsupportItem = menu.add(new MenuItem("Reset support"));
220317 resetsupportItem.addActionListener(this);
221318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222319 linkverticesItem.addActionListener(this);
223320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
225325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226326 setMasterItem.addActionListener(this);
327
+ }
227328
228329 oe.menuBar.add(menu = new Menu("Group"));
229330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,27 +335,32 @@
234335 frontItem.addActionListener(this);
235336 compositeItem = menu.add(new MenuItem("Composite"));
236337 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238339 hideItem.addActionListener(this);
239340 ungroupItem = menu.add(new MenuItem("Ungroup"));
240341 ungroupItem.addActionListener(this);
241342 menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
243344 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);
248345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249346 switchGeoItem.addActionListener(this);
250347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251348 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
253350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
254359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255360 scriptNodeItem.addActionListener(this);
256361 cameraItem = menu.add(new MenuItem("Camera"));
257362 cameraItem.addActionListener(this);
363
+ }
258364
259365 oe.menuBar.add(menu = new Menu("Object"));
260366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -269,21 +375,29 @@
269375 shadowYItem.addActionListener(this);
270376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
271377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
272381 linkerItem = menu.add(new MenuItem("Linker"));
273382 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276383 attributeItem = menu.add(new MenuItem("Attribute"));
277384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
278387 pointflowItem = menu.add(new MenuItem("Point Flow"));
279388 pointflowItem.addActionListener(this);
389
+ }
280390 menu.add("-");
281391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282392 resetTransformItem.addActionListener(this);
283393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284394 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
287401
288402 oe.menuBar.add(menu = new Menu("Geometry"));
289403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +408,11 @@
294408 genNormalsCADItem.addActionListener(this);
295409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
297413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298414 genNormalsMINEItem.addActionListener(this);
415
+ }
299416 stripifyItem = menu.add(new MenuItem("Stripify"));
300417 stripifyItem.addActionListener(this);
301418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +434,34 @@
317434 reduce34MeshItem.addActionListener(this);
318435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319436 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
324445
325446 oe.menuBar.add(menu = new Menu("Attributes"));
326447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
328453 menu.add("-");
329454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330455 liveleavesItem.addActionListener(this);
331456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
333460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334461 supportleavesItem.addActionListener(this);
335462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336463 unsupportleavesItem.addActionListener(this);
464
+ }
337465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338466 hideleavesItem.addActionListener(this);
339467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -377,29 +505,22 @@
377505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378506 sortbynameItem.addActionListener(this);
379507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
380515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381516 extractGeometriesItem.addActionListener(this);
382517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383518 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);
519
+ }
388520
389521 oe.menuBar.add(menu = new Menu("Insert"));
390522 buildCreateMenu(menu);
391523
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
-
403524 oe.menuBar.add(menu = new Menu("Tools"));
404525 buildToolsMenu(menu);
405526 }
....@@ -436,10 +557,26 @@
436557 */
437558 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438559
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
439572 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
573
+ liveCB.setToolTipText("Enable animation");
441574 liveCB.addItemListener(this);
442575
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
443580 oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444581 fastCB.setToolTipText("Fast mode");
445582 fastCB.addItemListener(this);
....@@ -448,51 +585,48 @@
448585 trackCB.setToolTipText("Enable tracking");
449586 trackCB.addItemListener(this);
450587
451
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
452589 screenfitButton.setToolTipText("Screen fit");
453590 screenfitButton.addActionListener(this);
454591
455592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
456593 // 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;
462594
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);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
469603 flashSelectionButton.setToolTipText("Show selection");
470604 flashSelectionButton.addActionListener(this);
471605
472606 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473607
474
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
475609 twoButton.setToolTipText("Show center view only");
476610 twoButton.addActionListener(this);
477
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
478612 fourButton.addActionListener(this);
479613 fourButton.setToolTipText("Show left panel only");
480
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
481615 sixButton.setToolTipText("2-column layout left");
482616 sixButton.addActionListener(this);
483
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
484618 threeButton.setToolTipText("2-column layout right");
485619 threeButton.addActionListener(this);
486
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
487621 sevenButton.setToolTipText("3-column layout");
488622 sevenButton.addActionListener(this);
489623 //
490624
491
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492626 rootButton.setToolTipText("Edit selection in new tab");
493627 rootButton.addActionListener(this);
494628
495
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
496630 closeButton.setToolTipText("Close tab");
497631 closeButton.addActionListener(this);
498632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -500,23 +634,23 @@
500634
501635 cGridBag commandsPanel = new cGridBag();
502636
503
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504638 editButton.setToolTipText("Edit selection");
505639 editButton.addActionListener(this);
506640
507
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508642 uneditButton.setToolTipText("Unedit selection");
509643 uneditButton.addActionListener(this);
510644
511
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
647
+ allParamsButton.addActionListener(this);
648
+
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512650 clearPanelButton.setToolTipText("Clear edit panel");
513651 clearPanelButton.addActionListener(this);
514652
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);
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520654 unselectButton.setToolTipText("Unselect");
521655 unselectButton.addActionListener(this);
522656
....@@ -591,8 +725,18 @@
591725
592726 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593727 {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
594738 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
- supportCB.setToolTipText("Enabled rigging");
739
+ supportCB.setToolTipText("Enable rigging");
596740 supportCB.addItemListener(this);
597741
598742 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
....@@ -610,14 +754,6 @@
610754 slowCB.setToolTipText("Smooth interpolation");
611755 slowCB.addItemListener(this);
612756
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
-
621757 // constraints.gridy += 1;
622758 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623759 // speakerMocapCB.addItemListener(this);
....@@ -648,6 +784,8 @@
648784 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649785 lookAtCB.setToolTipText("Look-at target");
650786 lookAtCB.addItemListener(this);
787
+
788
+ }
651789
652790 cGridBag fill = new cGridBag();
653791
....@@ -668,6 +806,7 @@
668806 buttonGroup.add(radioButton);
669807 radioButton.doClick();
670808 }
809
+
671810 void SetupViews(ObjEditor oe)
672811 {
673812 oe.SetupViews();
....@@ -884,7 +1023,9 @@
8841023 // objEditor.DropFile((java.io.File[]) object, true);
8851024 // return;
8861025 // }
887
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8881029 {
8891030 // file(s)
8901031 String[] names = string.split("\n");
....@@ -911,7 +1052,7 @@
9111052
9121053 flashIt = false;
9131054 CameraPane pane = (CameraPane) target;
914
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9151056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9161057
9171058 if (group.selection.size() == 1)
....@@ -938,11 +1079,11 @@
9381079 {
9391080 loadClipboard(true);
9401081 objEditor.jTree.setSelectionPath(destinationPath);
941
- pasteInto(false);
1082
+ pasteInto(false, false);
9421083 } else {
9431084 loadClipboard(false);
9441085 objEditor.jTree.setSelectionPath(destinationPath);
945
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9461087 }
9471088 }
9481089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1064,27 +1205,33 @@
10641205 kleinItem.addActionListener(this);
10651206 particleItem = menu.add(new MenuItem("Particle system"));
10661207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10671210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10681211 ragdollItem.addActionListener(this);
10691212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10701213 ragdoll2Item.addActionListener(this);
1214
+ }
10711215 menu.add("-");
1072
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10731217 meshItem.addActionListener(this);
10741218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10751219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10761222 springItem = menu.add(new MenuItem("Spring"));
10771223 springItem.addActionListener(this);
10781224 flagItem = menu.add(new MenuItem("Flag"));
10791225 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);
10841226 blobItem = menu.add(new MenuItem("Blob"));
10851227 blobItem.addActionListener(this);
10861228 latheItem = menu.add(new MenuItem("Lathe"));
10871229 latheItem.addActionListener(this);
1230
+ }
1231
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1232
+ bezierItem.addActionListener(this);
1233
+ overlayItem = menu.add(new MenuItem("Overlay"));
1234
+ overlayItem.addActionListener(this);
10881235 lightItem = menu.add(new MenuItem("Light"));
10891236 lightItem.addActionListener(this);
10901237 menu.add("-");
....@@ -1094,8 +1241,11 @@
10941241 loopItem.addActionListener(this);
10951242 doubleItem = menu.add(new MenuItem("Fork"));
10961243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
10971246 tripleItem = menu.add(new MenuItem("Trident"));
10981247 tripleItem.addActionListener(this);
1248
+ }
10991249 }
11001250
11011251 void buildToolsMenu(Menu menu)
....@@ -1109,19 +1259,21 @@
11091259 parseverticesItem.addActionListener(this);
11101260 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11111261 textureFieldItem.addActionListener(this);
1112
- alignItem = menu.add(new MenuItem("Align"));
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
11131263 alignItem.addActionListener(this);
1114
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1115
- mirrorItem.addActionListener(this);
11161264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11171265 reduceMorphItem.addActionListener(this);
11181266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11191267 reduce34MorphItem.addActionListener(this);
1120
-
1268
+ menu.add("-");
11211269 menu.add(computeAOItem = new MenuItem("Compute AO"));
11221270 computeAOItem.addActionListener(this);
1123
- menu.add("-");
11241271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
11251277 menu.add(memoryItem = new MenuItem("Memory Usage"));
11261278 memoryItem.addActionListener(this);
11271279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1144,6 +1296,7 @@
11441296 menu.add("-");
11451297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11461298 editScriptItem.addActionListener(this);
1299
+ }
11471300 }
11481301
11491302 void ScreenFit()
....@@ -1472,9 +1625,9 @@
14721625
14731626 void Overwrite(int mask)
14741627 {
1475
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14761629 {
1477
- Object3D content = GrafreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14781631
14791632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14801633 content = ((cGroup)content).get(0);
....@@ -1645,7 +1798,7 @@
16451798 {
16461799 makeSomething(new BezierSurface());
16471800 } else
1648
- if (source == checkerItem)
1801
+ if (source == overlayItem)
16491802 {
16501803 /*
16511804 Object3D obj = new BezierSurface(5,8);
....@@ -1779,23 +1932,6 @@
17791932 csg.addChild(child);
17801933 child.addChild(csg);
17811934 } 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
17991935 if (source == computeAOItem)
18001936 {
18011937 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1814,7 +1950,7 @@
18141950 if (source == invariantsItem)
18151951 {
18161952 System.out.println("Invariants:");
1817
- GrafreeD.grafreeD.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
18181954 } else
18191955 if (source == memoryItem)
18201956 {
....@@ -1832,6 +1968,23 @@
18321968 if (source == dumpItem)
18331969 {
18341970 DumpObject();
1971
+ } else
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
1984
+ if (source == oneStepButton)
1985
+ {
1986
+ Globals.ONESTEP = true;
1987
+ cameraView.repaint();
18351988 } else
18361989 if (source == screenfitButton)
18371990 {
....@@ -1882,12 +2035,20 @@
18822035 {
18832036 loadClipboard(true);
18842037 } else
2038
+ if (source == undoItem)
2039
+ {
2040
+ Undo();
2041
+ } else
2042
+ if (source == redoItem)
2043
+ {
2044
+ Redo();
2045
+ } else
18852046 if (source == duplicateItem)
18862047 {
1887
- Object3D keep = GrafreeD.clipboard;
2048
+ Object3D keep = Grafreed.clipboard;
18882049 loadClipboard(false);
18892050 paste(false);
1890
- GrafreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
18912052 } else
18922053 if (source == cloneItem)
18932054 {
....@@ -1905,13 +2066,17 @@
19052066 {
19062067 paste(false);
19072068 } else
2069
+ if (source == pasteIntoItem)
2070
+ {
2071
+ pasteInto(true, false);
2072
+ } else
19082073 if (source == pasteLinkItem)
19092074 {
1910
- pasteInto(false);
2075
+ pasteInto(false, false);
19112076 } else
19122077 if (source == pasteCloneItem)
19132078 {
1914
- pasteInto(true);
2079
+ pasteInto(true, true);
19152080 } else
19162081 if (source == pasteExpandItem)
19172082 {
....@@ -2103,9 +2268,9 @@
21032268 // group.selection.get(0).setMasterThis(content); // should be identity
21042269 // refreshContents();
21052270 // }
2106
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21072272 {
2108
- Object3D content = GrafreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
21092274
21102275 if (content instanceof cGroup && ((cGroup)content).transientlink )
21112276 content = ((cGroup)content).get(0);
....@@ -2113,11 +2278,11 @@
21132278 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21142279 for (int i=0; i<group.selection.size(); i++)
21152280 {
2116
- boolean random = CameraPane.RANDOM;
2117
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
21182283 group.selection.get(i).linkVerticesThis(content);
21192284 // group.selection.get(i).setMasterThis(content); // should be identity
2120
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
21212286 }
21222287 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21232288 refreshContents();
....@@ -2127,20 +2292,20 @@
21272292 {
21282293 for (int i=0; i<group.selection.size(); i++)
21292294 {
2130
- boolean random = CameraPane.RANDOM;
2131
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
21322297 group.selection.get(i).linkVerticesThis(null);
2133
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
21342299 }
21352300
21362301 refreshContents();
21372302 } else
21382303 if (source == relinkverticesItem)
21392304 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2305
+ boolean random = CameraPane.SWITCH;
2306
+ CameraPane.SWITCH = false; // parse all random nodes
21422307 group.selection.RelinkToSupport();
2143
- CameraPane.RANDOM = random;
2308
+ CameraPane.SWITCH = random;
21442309
21452310 refreshContents();
21462311 } else
....@@ -2155,9 +2320,9 @@
21552320 } else
21562321 if (source == setMasterItem)
21572322 {
2158
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21592324 {
2160
- Object3D content = GrafreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
21612326
21622327 if (content instanceof cGroup && ((cGroup)content).transientlink )
21632328 content = ((cGroup)content).get(0);
....@@ -2170,9 +2335,9 @@
21702335 {
21712336 if (group.selection.size() == 1)
21722337 {
2173
- if (GrafreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
21742339 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21762341
21772342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782343 content = ((cGroup)content).get(0);
....@@ -2189,7 +2354,7 @@
21892354 {
21902355 RevertMeshes();
21912356 } else
2192
- if (source == resetMeshItem)
2357
+ if (source == resetAllItem)
21932358 {
21942359 ResetAll();
21952360 } else
....@@ -2238,7 +2403,7 @@
22382403 RandomNode random = new RandomNode();
22392404 group(random);
22402405 if (random.size() > 0)
2241
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
22422407 } else
22432408 if (source == physicsItem)
22442409 {
....@@ -2377,7 +2542,7 @@
23772542 } else
23782543 if (source == genNormalsMESHItem)
23792544 {
2380
- GenNormals(true); // TODO
2545
+ GenNormalsMESH();
23812546 } else
23822547 if (source == genNormalsORGANItem)
23832548 {
....@@ -2527,9 +2692,13 @@
25272692 {
25282693 SmoothMesh();
25292694 } else
2530
- if (source == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
25312696 {
25322697 TransformGeometry();
2698
+ } else
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
25332702 } else
25342703 if (source == resetTransformItem)
25352704 {
....@@ -2537,7 +2706,11 @@
25372706 } else
25382707 if (source == resetCentroidItem)
25392708 {
2540
- ResetCentroid();
2709
+ ResetCentroid(true);
2710
+ } else
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
25412714 } else
25422715 if (source == resetParentItem)
25432716 {
....@@ -2893,9 +3066,9 @@
28933066 child.CloseUI();
28943067 listUI.remove(child);
28953068
2896
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
28973070 }
2898
- objEditor.ctrlPanel.validate();
3071
+ objEditor.ctrlPanel.FlushUI();
28993072 //objEditor.jTree.clearSelection();
29003073 //objEditor.ResetSliders();
29013074 refreshContents(true);
....@@ -2979,7 +3152,10 @@
29793152 frontView.object = group;
29803153 sideView.object = group;
29813154 }
3155
+
3156
+// fix "+" issue
29823157 group.editWindow = this;
3158
+
29833159 /*
29843160 currentLayout = radio.layout;
29853161 if (currentLayout == null)
....@@ -2992,7 +3168,20 @@
29923168 //group.attributes = -1;
29933169 ResetModel();
29943170 refreshContents(true);
2995
- }
3171
+ } else if (event.getSource() == editCameraItem)
3172
+ {
3173
+ cameraView.ProtectCamera();
3174
+ cameraView.repaint();
3175
+ return;
3176
+ } else if (event.getSource() == revertCameraItem)
3177
+ {
3178
+ cameraView.RevertCamera();
3179
+ cameraView.repaint();
3180
+ return;
3181
+ // } else if (event.getSource() == textureButton)
3182
+ // {
3183
+ // return; // true;
3184
+ }
29963185 else
29973186 {
29983187 //return super.action(event, arg);
....@@ -3053,6 +3242,28 @@
30533242 refreshContents();
30543243 }
30553244
3245
+ void TransformChildren()
3246
+ {
3247
+ Object3D obj;
3248
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3249
+ {
3250
+ obj = (Object3D)e.nextElement();
3251
+ obj.KeepTextureMatrices();
3252
+ obj.TransformChildren();
3253
+ obj.RestoreTextureMatrices();
3254
+
3255
+// if (obj.parent == null)
3256
+// {
3257
+// System.out.println("NULL PARENT!");
3258
+// new Exception().printStackTrace();
3259
+// }
3260
+// else
3261
+// TouchTransform(obj);
3262
+// //obj.parent.Touch();
3263
+ }
3264
+
3265
+ refreshContents();
3266
+ }
30563267
30573268 void ResetTransform()
30583269 {
....@@ -3165,7 +3376,7 @@
31653376 refreshContents();
31663377 }
31673378
3168
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
31693380 {
31703381 Object3D obj;
31713382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3180,12 +3391,16 @@
31803391 LA.matIdentity(Object3D.mat);
31813392 obj.getBounds(minima, maxima, false);
31823393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3183
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31843396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31853397 obj.TransformMesh(Object3D.mat);
3398
+
31863399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3187
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31883402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
31893404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31903405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31913406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3214,7 +3429,8 @@
32143429
32153430 int size = obj.MemorySize();
32163431
3217
- System.err.println((size/1024) + " KB is the size of " + obj);
3432
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32183434 }
32193435 }
32203436 catch (Exception e)
....@@ -3251,9 +3467,9 @@
32513467 obj = (Object3D)e.nextElement();
32523468
32533469 System.out.println("Object is: " + obj);
3254
- GrafreeD.AnalyzeObject(obj);
3470
+ Grafreed.AnalyzeObject(obj);
32553471 System.out.println("Boundary rep: " + obj.bRep);
3256
- GrafreeD.AnalyzeObject(obj.bRep);
3472
+ Grafreed.AnalyzeObject(obj.bRep);
32573473
32583474 // System.err.println((size/1024) + " KB is the size of " + obj);
32593475 }
....@@ -3295,6 +3511,13 @@
32953511 void GenNormals(boolean crease)
32963512 {
32973513 group.GenNormalsS(crease);
3514
+
3515
+ refreshContents();
3516
+ }
3517
+
3518
+ void GenNormalsMESH()
3519
+ {
3520
+ group.GenNormalsMeshS();
32983521
32993522 refreshContents();
33003523 }
....@@ -3467,8 +3690,8 @@
34673690
34683691 void ParseVertices()
34693692 {
3470
- boolean epsequal = GrafreeD.epsequal;
3471
- GrafreeD.epsequal = true;
3693
+ boolean epsequal = Grafreed.epsequal;
3694
+ Grafreed.epsequal = true;
34723695
34733696 for (int i=0; i<group.selection.size(); i++)
34743697 {
....@@ -3493,7 +3716,7 @@
34933716 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34943717 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34953718
3496
- g.add(GrafreeD.clipboard);
3719
+ g.add(Grafreed.clipboard);
34973720
34983721 buffer.add(g);
34993722 }
....@@ -3508,7 +3731,7 @@
35083731 makeSomething(buffer, i==group.selection.size()-1);
35093732 }
35103733
3511
- GrafreeD.epsequal = epsequal;
3734
+ Grafreed.epsequal = epsequal;
35123735
35133736 refreshContents();
35143737 }
....@@ -3526,7 +3749,16 @@
35263749 String pigment = Object3D.GetPigment(tex);
35273750 //String bump = Object3D.GetBump(tex);
35283751
3529
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3752
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3753
+
3754
+ try
3755
+ {
3756
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3757
+ }
3758
+ catch (Exception e)
3759
+ {
3760
+ System.err.println("FAIL: " + node);
3761
+ }
35303762
35313763 double s = v.s;
35323764
....@@ -3614,11 +3846,11 @@
36143846
36153847 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36163848
3617
- boolean random = CameraPane.RANDOM;
3618
- CameraPane.RANDOM = false; // parse all random nodes
3849
+ boolean random = CameraPane.SWITCH;
3850
+ CameraPane.SWITCH = false; // parse all random nodes
36193851 lowres.linkVerticesThis(null);
36203852 lowres.linkVerticesThis(sn);
3621
- CameraPane.RANDOM = random;
3853
+ CameraPane.SWITCH = random;
36223854
36233855 System.err.flush();
36243856
....@@ -3658,7 +3890,7 @@
36583890 return;
36593891
36603892 Object3D poses = group.selection.get(0);
3661
- Object3D ref = GrafreeD.clipboard.get(0);
3893
+ Object3D ref = Grafreed.clipboard.get(0);
36623894
36633895 Object3D newgroup = new Object3D("Po:" + poses.name);
36643896
....@@ -3852,9 +4084,9 @@
38524084
38534085 void ClipMesh()
38544086 {
3855
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4087
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38564088 {
3857
- Object3D content = GrafreeD.clipboard.get(0);
4089
+ Object3D content = Grafreed.clipboard.get(0);
38584090
38594091 if (content instanceof cGroup && ((cGroup)content).transientlink )
38604092 content = ((cGroup)content).get(0);
....@@ -3863,7 +4095,7 @@
38634095 // {
38644096 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38654097 // }
3866
- group.selection.ClipMesh(GrafreeD.clipboard);
4098
+ group.selection.ClipMesh(Grafreed.clipboard);
38674099 }
38684100 // group.selection.ClipMesh(GrafreeD.clipboard);
38694101 System.out.println("DONE.");
....@@ -3998,7 +4230,7 @@
39984230 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39994231
40004232 Object3D elem = (Object3D)group.selection.elementAt(i);
4001
- if(elem != group)
4233
+ if(elem != group || !newWindow)
40024234 {
40034235 // if (!(elem instanceof Composite))
40044236 // newWindow = false;
....@@ -4112,14 +4344,17 @@
41124344
41134345 objEditor.SetText(); // jan 2014
41144346
4115
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4347
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41164348 CameraPane.flash = true;
41174349
4118
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4350
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41194351 // a camera
41204352 {
4121
- CameraPane.camerachangeframe = 0; // don't refuse it
4122
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4353
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4354
+ {
4355
+ CameraPane.camerachangeframe = 0; // don't refuse it
4356
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4357
+ }
41234358 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41244359 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41254360 }
....@@ -4203,16 +4438,18 @@
42034438 {
42044439 if (group.selection.isEmpty())
42054440 return;
4206
- GrafreeD.clipboardIsTempGroup = false;
4441
+
4442
+ Grafreed.clipboardIsTempGroup = false;
42074443 Composite tGroup = null;
42084444 if (group.selection.size() > 0) // 1)
42094445 {
42104446 tGroup = new cGroup();
4211
- GrafreeD.clipboardIsTempGroup = true;
4447
+ Grafreed.clipboardIsTempGroup = true;
42124448 }
42134449
42144450 if (cut)
42154451 {
4452
+ Save();
42164453 //int indices[] = jList.getSelectedIndices();
42174454 //for (int i = indices.length - 1; i >= 0; i--)
42184455 //jList.remove(indices[i]);
....@@ -4248,16 +4485,16 @@
42484485 //System.out.println("cut " + child);
42494486 //System.out.println("parent = " + child.parent);
42504487 // tmp.addChild(child);
4251
- if (GrafreeD.clipboardIsTempGroup)
4488
+ if (Grafreed.clipboardIsTempGroup)
42524489 tGroup.add/*Child*/(tmp);
42534490 else
4254
- GrafreeD.clipboard = tmp;
4491
+ Grafreed.clipboard = tmp;
42554492 }
42564493 else
4257
- if (GrafreeD.clipboardIsTempGroup)
4494
+ if (Grafreed.clipboardIsTempGroup)
42584495 tGroup.add/*Child*/(child);
42594496 else
4260
- GrafreeD.clipboard = child;
4497
+ Grafreed.clipboard = child;
42614498 }
42624499
42634500 //ResetModel();
....@@ -4289,21 +4526,23 @@
42894526 //System.out.println("cut " + elem);
42904527 //System.out.println("parent = " + elem.parent);
42914528 // tmp.addChild(elem);
4292
- if (GrafreeD.clipboardIsTempGroup)
4529
+ if (Grafreed.clipboardIsTempGroup)
42934530 tGroup.add/*Child*/(tmp);
42944531 else
4295
- GrafreeD.clipboard = tmp;
4532
+ Grafreed.clipboard = tmp;
42964533 }
42974534 else
4298
- if (GrafreeD.clipboardIsTempGroup)
4535
+ if (Grafreed.clipboardIsTempGroup)
42994536 tGroup.add/*Child*/(child);
43004537 else
4301
- GrafreeD.clipboard = child;
4538
+ Grafreed.clipboard = child;
43024539 }
43034540
43044541 }
4305
- if (GrafreeD.clipboardIsTempGroup)
4306
- GrafreeD.clipboard = tGroup;
4542
+
4543
+ if (Grafreed.clipboardIsTempGroup)
4544
+ Grafreed.clipboard = tGroup;
4545
+
43074546 if (cut)
43084547 {
43094548 ResetModel();
....@@ -4317,7 +4556,7 @@
43174556 // return;
43184557 boolean first = true;
43194558
4320
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
43214560 {
43224561 Composite temp;
43234562
....@@ -4328,7 +4567,7 @@
43284567 temp = (Composite)Applet3D.clipboard.deepCopy();
43294568 */
43304569 Object3D elem;
4331
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4570
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43324571 {
43334572 Object3D child = (Object3D)e.nextElement();
43344573
....@@ -4362,21 +4601,21 @@
43624601 //Object3D cb = Applet3D.clipboard;
43634602 //temp.addChild(cb);
43644603 //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());
4604
+ assert(Grafreed.clipboard.parent == null);
4605
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4606
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4607
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4608
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43704609 else
4371
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4372
- GrafreeD.clipboard.get(0).parent = keepparent;
4610
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4611
+ Grafreed.clipboard.get(0).parent = keepparent;
43734612 }
43744613
43754614 ResetModel();
43764615 refreshContents();
43774616 }
43784617
4379
- void pasteInto(boolean copyit)
4618
+ void pasteInto(boolean copyit, boolean clone)
43804619 {
43814620 // if (GrafreeD.clipboard == null)
43824621 // return;
....@@ -4405,15 +4644,22 @@
44054644 if (copyit)
44064645 {
44074646 // paste(false);
4408
- CloneClipboard(false); // sept 2014
4647
+ if (clone)
4648
+ {
4649
+ CloneClipboard(false); // sept 2014
4650
+ }
4651
+ else
4652
+ {
4653
+ paste(false);
4654
+ }
44094655 }
44104656 else
44114657 {
44124658 boolean first = true;
44134659
4414
- if (GrafreeD.clipboardIsTempGroup)
4660
+ if (Grafreed.clipboardIsTempGroup)
44154661 {
4416
- Composite temp = (Composite)GrafreeD.clipboard;
4662
+ Composite temp = (Composite)Grafreed.clipboard;
44174663 Object3D copy;
44184664 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44194665 {
....@@ -4423,7 +4669,7 @@
44234669 }
44244670 } else
44254671 {
4426
- linkSomething(GrafreeD.clipboard); //.get(0));
4672
+ linkSomething(Grafreed.clipboard); //.get(0));
44274673 }
44284674 }
44294675 }
....@@ -4828,21 +5074,6 @@
48285074 }
48295075 */
48305076
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
-
48465077 /*
48475078 public void Callback(Object obj)
48485079 {
....@@ -4866,26 +5097,9 @@
48665097 }
48675098 */
48685099
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
-
48865100 String GetFile(String dialogName)
48875101 {
4888
- if (GrafreeD.standAlone)
5102
+ if (Grafreed.standAlone)
48895103 {
48905104 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48915105 browser.show();
....@@ -4949,10 +5163,15 @@
49495163 cButton flashSelectionButton;
49505164 cButton editButton;
49515165 cButton uneditButton;
5166
+ JCheckBox allParamsButton;
49525167 cButton clearpanelButton;
4953
- cButton allParamsButton;
49545168 cButton unselectButton;
49555169
5170
+ cButton saveButton;
5171
+ cButton undoButton;
5172
+ cButton redoButton;
5173
+ cButton oneStepButton;
5174
+
49565175 cButton screenfitButton;
49575176 cButton screenfitpointButton;
49585177 cButton snapobjectButton;
....@@ -4983,6 +5202,8 @@
49835202 private MenuItem lookFromItem;
49845203 private MenuItem switchItem;
49855204 private MenuItem cutItem;
5205
+ private MenuItem undoItem;
5206
+ private MenuItem redoItem;
49865207 private MenuItem duplicateItem;
49875208 private MenuItem cloneItem;
49885209 private MenuItem cloneSupportItem;
....@@ -4996,7 +5217,7 @@
49965217 private MenuItem linkverticesItem;
49975218 private MenuItem relinkverticesItem;
49985219 private MenuItem setMasterItem;
4999
- private MenuItem resetMeshItem;
5220
+ private MenuItem resetAllItem;
50005221 private MenuItem stepAllItem;
50015222 private MenuItem revertMeshItem;
50025223 private MenuItem poseMeshItem;
....@@ -5007,6 +5228,7 @@
50075228 private MenuItem mergeGeometriesItem;
50085229 private MenuItem copyItem;
50095230 private MenuItem pasteItem;
5231
+ private MenuItem pasteIntoItem;
50105232 private MenuItem pasteLinkItem;
50115233 private MenuItem pasteCloneItem;
50125234 private MenuItem pasteExpandItem;
....@@ -5056,8 +5278,10 @@
50565278 private MenuItem panoTexturesItem;
50575279
50585280 private MenuItem resetCentroidItem;
5059
- private MenuItem transformgeometryItem;
5281
+ private MenuItem resetCentroidXZItem;
50605282 private MenuItem resetTransformItem;
5283
+ private MenuItem transformGeometryItem;
5284
+ private MenuItem transformChildrenItem;
50615285 private MenuItem hideItem;
50625286 private MenuItem grabItem;
50635287 private MenuItem backItem;
....@@ -5104,7 +5328,7 @@
51045328 private MenuItem blobItem;
51055329 private MenuItem latheItem;
51065330 private MenuItem bezierItem;
5107
- private MenuItem checkerItem;
5331
+ private MenuItem overlayItem;
51085332 private MenuItem meshItem;
51095333 // private MenuItem meshGroupItem;
51105334 private MenuItem springItem;
....@@ -5126,11 +5350,6 @@
51265350 private MenuItem doubleItem;
51275351 private MenuItem tripleItem;
51285352
5129
- private MenuItem importGFDItem;
5130
- private MenuItem importVRMLX3DItem;
5131
- private MenuItem import3DSItem;
5132
- private MenuItem importOBJItem;
5133
-
51345353 private MenuItem computeAOItem;
51355354 private MenuItem recompileItem;
51365355 private MenuItem editScriptItem;
....@@ -5140,4 +5359,8 @@
51405359 private MenuItem analyzeItem;
51415360 private MenuItem dumpItem;
51425361 //boolean freezemodel = false;
5362
+
5363
+ Menu cameraMenu;
5364
+ MenuItem editCameraItem;
5365
+ MenuItem revertCameraItem;
51435366 }