Normand Briere
2019-06-16 372b7fd481a476cd659713a4a01bf28bf6760cbe
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,96 +557,108 @@
436557 */
437558 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438559
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
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
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
441574 liveCB.addItemListener(this);
442575
443
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
582
+ fastCB.addItemListener(this);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444585 trackCB.setToolTipText("Enable tracking");
445586 trackCB.addItemListener(this);
446587
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448589 screenfitButton.setToolTipText("Screen fit");
449590 screenfitButton.addActionListener(this);
450591
451592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452593 // 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;
458594
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);
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);
465603 flashSelectionButton.setToolTipText("Show selection");
466604 flashSelectionButton.addActionListener(this);
467605
468606 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469607
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471609 twoButton.setToolTipText("Show center view only");
472610 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474612 fourButton.addActionListener(this);
475613 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477615 sixButton.setToolTipText("2-column layout left");
478616 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480618 threeButton.setToolTipText("2-column layout right");
481619 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483621 sevenButton.setToolTipText("3-column layout");
484622 sevenButton.addActionListener(this);
485623 //
486624
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- rootButton.setToolTipText("Edit object in new tab");
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
489627 rootButton.addActionListener(this);
490
- oe.aConstraints.gridx += 1;
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492630 closeButton.setToolTipText("Close tab");
493631 closeButton.addActionListener(this);
494632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495633 //clearButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497634
498
- oe.aConstraints.gridx = 1; //
499
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
500639 editButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.aConstraints.weighty = 0;
503
- oe.aConstraints.gridwidth = 1;
504640
505
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
506643 uneditButton.addActionListener(this);
507644
508
- oe.aConstraints.gridx += 1;
509
- oe.aConstraints.weighty = 0;
510
- oe.aConstraints.gridwidth = 1;
511
-
512
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
513
- clearPanelButton.addActionListener(this);
514
-
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518
-
519
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
520647 allParamsButton.addActionListener(this);
521648
522
- oe.aConstraints.gridx += 1;
523
- oe.aConstraints.weighty = 0;
524
- oe.aConstraints.gridwidth = 1;
525
-
526
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
527655 unselectButton.addActionListener(this);
528656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
529662 // oe.aConstraints.gridx += 1;
530663 // oe.aConstraints.weighty = 0;
531664 // oe.aConstraints.gridwidth = 1;
....@@ -537,40 +670,37 @@
537670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
538671 // gcButton.addActionListener(this);
539672
540
- oe.aConstraints.gridx = 0;
541
- oe.aConstraints.gridy += 1;
542
-
543
- //ctrlPanel.add(objList = new List(5, true));
544
- oe.aConstraints.gridwidth = 100;
545
- // oe.aConstraints.gridheight = 100;
546
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
547
- oe.aConstraints.gridheight = 1;
548
- oe.aConstraints.weighty = 0.5;
549
- oe.aConstraints.gridx = 0;
550
- JScrollPane jSP;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
551676 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
552
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
553678 ResetModel();
554
- oe.aConstraints.weighty = 0.5;
555
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
556
- oe.aConstraints.gridy += 1;
557
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
558682
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 2;
561
-
562
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
563687 colorCB.addItemListener(this);
564
- oe.aConstraints.gridx += 2;
565
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
566691 materialCB.addItemListener(this);
567
- oe.aConstraints.gridx += 2;
568
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
569695 textureCB.addItemListener(this);
570696
571
- oe.aConstraints.gridx = 0;
572
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
573700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
574704 //jList.addListSelectionListener(this);
575705 oe.jTree.addTreeSelectionListener(this);
576706 //jTree.setRootVisible(false);
....@@ -595,43 +725,35 @@
595725
596726 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
597727 {
598
- //constraints.gridx = 0;
599
- //constraints.gridy = 0;
600
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
- fastCB.setToolTipText("Fast mode");
602
- fastCB.addItemListener(this);
603
- //constraints.gridy += 1;
604
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
- supportCB.setToolTipText("Enabled rigging");
606
- supportCB.addItemListener(this);
607
-
608
- // constraints.gridy += 1;
609
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
610
- // localCB.addItemListener(this);
611
-
612
- //constraints.gridy += 1;
613
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
614
- crowdCB.setToolTipText("Used for crowds");
615
- crowdCB.addItemListener(this);
616
-
617
- //constraints.gridy += 1;
618
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
619
- smoothCB.setToolTipText("Snapping delay");
620
- smoothCB.addItemListener(this);
621
-
622
- //constraints.gridy += 1;
623
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624
- slowCB.setToolTipText("Smooth interpolation");
625
- slowCB.addItemListener(this);
626
- //constraints.gridy += 1;
627728 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628729 boxCB.setToolTipText("Display bounding boxes");
629730 boxCB.addItemListener(this);
630
- //constraints.gridy += 1;
731
+
631732 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632733 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633734 zoomBoxCB.addItemListener(this);
634735
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
635757 // constraints.gridy += 1;
636758 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
637759 // speakerMocapCB.addItemListener(this);
....@@ -656,14 +778,20 @@
656778 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
657779 // debugCB.addItemListener(this);
658780
659
- //constraints.gridy += 1;
660781 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
661782 oeilCB.addItemListener(this);
662783
663
- //constraints.gridy += 1;
664784 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665785 lookAtCB.setToolTipText("Look-at target");
666786 lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
667795
668796 }
669797
....@@ -678,6 +806,7 @@
678806 buttonGroup.add(radioButton);
679807 radioButton.doClick();
680808 }
809
+
681810 void SetupViews(ObjEditor oe)
682811 {
683812 oe.SetupViews();
....@@ -742,6 +871,7 @@
742871 } else if(e.getSource() == liveCB)
743872 {
744873 cameraView.ToggleLive();
874
+ refreshContents(false);
745875 }
746876 else if(e.getSource() == supportCB)
747877 {
....@@ -894,7 +1024,9 @@
8941024 // objEditor.DropFile((java.io.File[]) object, true);
8951025 // return;
8961026 // }
897
- if (string.charAt(0) == '/')
1027
+
1028
+ // File path for Mac and Windows
1029
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8981030 {
8991031 // file(s)
9001032 String[] names = string.split("\n");
....@@ -921,7 +1053,7 @@
9211053
9221054 flashIt = false;
9231055 CameraPane pane = (CameraPane) target;
924
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1056
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9251057 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9261058
9271059 if (group.selection.size() == 1)
....@@ -948,11 +1080,11 @@
9481080 {
9491081 loadClipboard(true);
9501082 objEditor.jTree.setSelectionPath(destinationPath);
951
- pasteInto(false);
1083
+ pasteInto(false, false);
9521084 } else {
9531085 loadClipboard(false);
9541086 objEditor.jTree.setSelectionPath(destinationPath);
955
- pasteInto(false); // true); // ???
1087
+ pasteInto(false, false); // true); // ???
9561088 }
9571089 }
9581090 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1074,27 +1206,33 @@
10741206 kleinItem.addActionListener(this);
10751207 particleItem = menu.add(new MenuItem("Particle system"));
10761208 particleItem.addActionListener(this);
1209
+ if (Globals.ADVANCED)
1210
+ {
10771211 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10781212 ragdollItem.addActionListener(this);
10791213 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10801214 ragdoll2Item.addActionListener(this);
1215
+ }
10811216 menu.add("-");
1082
- meshItem = menu.add(new MenuItem("Mesh"));
1217
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10831218 meshItem.addActionListener(this);
10841219 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10851220 // meshGroupItem.addActionListener(this);
1221
+ if (Globals.ADVANCED)
1222
+ {
10861223 springItem = menu.add(new MenuItem("Spring"));
10871224 springItem.addActionListener(this);
10881225 flagItem = menu.add(new MenuItem("Flag"));
10891226 flagItem.addActionListener(this);
1090
- bezierItem = menu.add(new MenuItem("Patch"));
1091
- bezierItem.addActionListener(this);
1092
- checkerItem = menu.add(new MenuItem("Checker"));
1093
- checkerItem.addActionListener(this);
10941227 blobItem = menu.add(new MenuItem("Blob"));
10951228 blobItem.addActionListener(this);
10961229 latheItem = menu.add(new MenuItem("Lathe"));
10971230 latheItem.addActionListener(this);
1231
+ }
1232
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1233
+ bezierItem.addActionListener(this);
1234
+ overlayItem = menu.add(new MenuItem("Overlay"));
1235
+ overlayItem.addActionListener(this);
10981236 lightItem = menu.add(new MenuItem("Light"));
10991237 lightItem.addActionListener(this);
11001238 menu.add("-");
....@@ -1104,39 +1242,44 @@
11041242 loopItem.addActionListener(this);
11051243 doubleItem = menu.add(new MenuItem("Fork"));
11061244 doubleItem.addActionListener(this);
1245
+ if (Globals.ADVANCED)
1246
+ {
11071247 tripleItem = menu.add(new MenuItem("Trident"));
11081248 tripleItem.addActionListener(this);
1249
+ }
11091250 }
11101251
11111252 void buildToolsMenu(Menu menu)
11121253 {
11131254 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11141255 animationItem.addItemListener(this);
1115
- animationItem.setState(CameraPane.ANIMATION);
1256
+ animationItem.setState(Globals.ANIMATION);
11161257
11171258 menu.add("-");
11181259 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11191260 parseverticesItem.addActionListener(this);
11201261 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11211262 textureFieldItem.addActionListener(this);
1122
- alignItem = menu.add(new MenuItem("Align"));
1263
+ alignItem = menu.add(new MenuItem("Align Objects"));
11231264 alignItem.addActionListener(this);
1124
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1125
- mirrorItem.addActionListener(this);
11261265 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11271266 reduceMorphItem.addActionListener(this);
11281267 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11291268 reduce34MorphItem.addActionListener(this);
1130
-
1269
+ menu.add("-");
11311270 menu.add(computeAOItem = new MenuItem("Compute AO"));
11321271 computeAOItem.addActionListener(this);
1133
- menu.add("-");
11341272
1273
+ if (Globals.ADVANCED)
1274
+ {
1275
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1276
+ mirrorItem.addActionListener(this);
1277
+ menu.add("-");
11351278 menu.add(memoryItem = new MenuItem("Memory Usage"));
11361279 memoryItem.addActionListener(this);
11371280 menu.add(analyzeItem = new MenuItem("Analyze"));
11381281 analyzeItem.addActionListener(this);
1139
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
11401283 dumpItem.addActionListener(this);
11411284 // menu.add(pathItem = new MenuItem("From-to path"));
11421285 // pathItem.addActionListener(this);
....@@ -1154,6 +1297,7 @@
11541297 menu.add("-");
11551298 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11561299 editScriptItem.addActionListener(this);
1300
+ }
11571301 }
11581302
11591303 void ScreenFit()
....@@ -1482,9 +1626,9 @@
14821626
14831627 void Overwrite(int mask)
14841628 {
1485
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1629
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14861630 {
1487
- Object3D content = GrafreeD.clipboard.get(0);
1631
+ Object3D content = Grafreed.clipboard.get(0);
14881632
14891633 if (content instanceof cGroup && ((cGroup)content).transientlink )
14901634 content = ((cGroup)content).get(0);
....@@ -1655,7 +1799,7 @@
16551799 {
16561800 makeSomething(new BezierSurface());
16571801 } else
1658
- if (source == checkerItem)
1802
+ if (source == overlayItem)
16591803 {
16601804 /*
16611805 Object3D obj = new BezierSurface(5,8);
....@@ -1789,23 +1933,6 @@
17891933 csg.addChild(child);
17901934 child.addChild(csg);
17911935 } else
1792
-
1793
- if (source == importGFDItem)
1794
- {
1795
- ImportGFD();
1796
- } else
1797
- if (source == importVRMLX3DItem)
1798
- {
1799
- ImportVRMLX3D();
1800
- } else
1801
- if (source == import3DSItem)
1802
- {
1803
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1804
- } else
1805
- if (source == importOBJItem)
1806
- {
1807
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1808
- } else
18091936 if (source == computeAOItem)
18101937 {
18111938 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1824,7 +1951,7 @@
18241951 if (source == invariantsItem)
18251952 {
18261953 System.out.println("Invariants:");
1827
- GrafreeD.grafreeD.universe.invariants();
1954
+ Grafreed.grafreeD.universe.invariants();
18281955 } else
18291956 if (source == memoryItem)
18301957 {
....@@ -1842,6 +1969,23 @@
18421969 if (source == dumpItem)
18431970 {
18441971 DumpObject();
1972
+ } else
1973
+ if (source == undoButton)
1974
+ {
1975
+ Undo();
1976
+ } else
1977
+ if (source == redoButton)
1978
+ {
1979
+ Redo();
1980
+ } else
1981
+ if (source == saveButton)
1982
+ {
1983
+ Save();
1984
+ } else
1985
+ if (source == oneStepButton)
1986
+ {
1987
+ Globals.ONESTEP = true;
1988
+ cameraView.repaint();
18451989 } else
18461990 if (source == screenfitButton)
18471991 {
....@@ -1892,12 +2036,20 @@
18922036 {
18932037 loadClipboard(true);
18942038 } else
2039
+ if (source == undoItem)
2040
+ {
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoItem)
2044
+ {
2045
+ Redo();
2046
+ } else
18952047 if (source == duplicateItem)
18962048 {
1897
- Object3D keep = GrafreeD.clipboard;
2049
+ Object3D keep = Grafreed.clipboard;
18982050 loadClipboard(false);
18992051 paste(false);
1900
- GrafreeD.clipboard = keep;
2052
+ Grafreed.clipboard = keep;
19012053 } else
19022054 if (source == cloneItem)
19032055 {
....@@ -1915,13 +2067,17 @@
19152067 {
19162068 paste(false);
19172069 } else
2070
+ if (source == pasteIntoItem)
2071
+ {
2072
+ pasteInto(true, false);
2073
+ } else
19182074 if (source == pasteLinkItem)
19192075 {
1920
- pasteInto(false);
2076
+ pasteInto(false, false);
19212077 } else
19222078 if (source == pasteCloneItem)
19232079 {
1924
- pasteInto(true);
2080
+ pasteInto(true, true);
19252081 } else
19262082 if (source == pasteExpandItem)
19272083 {
....@@ -2113,9 +2269,9 @@
21132269 // group.selection.get(0).setMasterThis(content); // should be identity
21142270 // refreshContents();
21152271 // }
2116
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2272
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21172273 {
2118
- Object3D content = GrafreeD.clipboard.get(0);
2274
+ Object3D content = Grafreed.clipboard.get(0);
21192275
21202276 if (content instanceof cGroup && ((cGroup)content).transientlink )
21212277 content = ((cGroup)content).get(0);
....@@ -2123,11 +2279,11 @@
21232279 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21242280 for (int i=0; i<group.selection.size(); i++)
21252281 {
2126
- boolean random = CameraPane.RANDOM;
2127
- CameraPane.RANDOM = false; // parse all random nodes
2282
+ boolean random = CameraPane.SWITCH;
2283
+ CameraPane.SWITCH = false; // parse all random nodes
21282284 group.selection.get(i).linkVerticesThis(content);
21292285 // group.selection.get(i).setMasterThis(content); // should be identity
2130
- CameraPane.RANDOM = random;
2286
+ CameraPane.SWITCH = random;
21312287 }
21322288 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21332289 refreshContents();
....@@ -2137,20 +2293,20 @@
21372293 {
21382294 for (int i=0; i<group.selection.size(); i++)
21392295 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2296
+ boolean random = CameraPane.SWITCH;
2297
+ CameraPane.SWITCH = false; // parse all random nodes
21422298 group.selection.get(i).linkVerticesThis(null);
2143
- CameraPane.RANDOM = random;
2299
+ CameraPane.SWITCH = random;
21442300 }
21452301
21462302 refreshContents();
21472303 } else
21482304 if (source == relinkverticesItem)
21492305 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2306
+ boolean random = CameraPane.SWITCH;
2307
+ CameraPane.SWITCH = false; // parse all random nodes
21522308 group.selection.RelinkToSupport();
2153
- CameraPane.RANDOM = random;
2309
+ CameraPane.SWITCH = random;
21542310
21552311 refreshContents();
21562312 } else
....@@ -2165,9 +2321,9 @@
21652321 } else
21662322 if (source == setMasterItem)
21672323 {
2168
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2324
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21692325 {
2170
- Object3D content = GrafreeD.clipboard.get(0);
2326
+ Object3D content = Grafreed.clipboard.get(0);
21712327
21722328 if (content instanceof cGroup && ((cGroup)content).transientlink )
21732329 content = ((cGroup)content).get(0);
....@@ -2180,9 +2336,9 @@
21802336 {
21812337 if (group.selection.size() == 1)
21822338 {
2183
- if (GrafreeD.clipboard.size() == 1)
2339
+ if (Grafreed.clipboard.size() == 1)
21842340 {
2185
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
21862342
21872343 if (content instanceof cGroup && ((cGroup)content).transientlink )
21882344 content = ((cGroup)content).get(0);
....@@ -2199,7 +2355,7 @@
21992355 {
22002356 RevertMeshes();
22012357 } else
2202
- if (source == resetMeshItem)
2358
+ if (source == resetAllItem)
22032359 {
22042360 ResetAll();
22052361 } else
....@@ -2248,7 +2404,7 @@
22482404 RandomNode random = new RandomNode();
22492405 group(random);
22502406 if (random.size() > 0)
2251
- random.name = random.get(0).name + "Rnd";
2407
+ random.name = random.get(0).name + "Switch";
22522408 } else
22532409 if (source == physicsItem)
22542410 {
....@@ -2387,7 +2543,7 @@
23872543 } else
23882544 if (source == genNormalsMESHItem)
23892545 {
2390
- GenNormals(true); // TODO
2546
+ GenNormalsMESH();
23912547 } else
23922548 if (source == genNormalsORGANItem)
23932549 {
....@@ -2537,9 +2693,13 @@
25372693 {
25382694 SmoothMesh();
25392695 } else
2540
- if (source == transformgeometryItem)
2696
+ if (source == transformGeometryItem)
25412697 {
25422698 TransformGeometry();
2699
+ } else
2700
+ if (source == transformChildrenItem)
2701
+ {
2702
+ TransformChildren();
25432703 } else
25442704 if (source == resetTransformItem)
25452705 {
....@@ -2547,7 +2707,11 @@
25472707 } else
25482708 if (source == resetCentroidItem)
25492709 {
2550
- ResetCentroid();
2710
+ ResetCentroid(true);
2711
+ } else
2712
+ if (source == resetCentroidXZItem)
2713
+ {
2714
+ ResetCentroid(false);
25512715 } else
25522716 if (source == resetParentItem)
25532717 {
....@@ -2903,9 +3067,9 @@
29033067 child.CloseUI();
29043068 listUI.remove(child);
29053069
2906
- child.editWindow = null; // ???????????
3070
+ //child.editWindow = null; // ???????????
29073071 }
2908
- objEditor.ctrlPanel.validate();
3072
+ objEditor.ctrlPanel.FlushUI();
29093073 //objEditor.jTree.clearSelection();
29103074 //objEditor.ResetSliders();
29113075 refreshContents(true);
....@@ -2989,7 +3153,10 @@
29893153 frontView.object = group;
29903154 sideView.object = group;
29913155 }
3156
+
3157
+// fix "+" issue
29923158 group.editWindow = this;
3159
+
29933160 /*
29943161 currentLayout = radio.layout;
29953162 if (currentLayout == null)
....@@ -3002,7 +3169,20 @@
30023169 //group.attributes = -1;
30033170 ResetModel();
30043171 refreshContents(true);
3005
- }
3172
+ } else if (event.getSource() == editCameraItem)
3173
+ {
3174
+ cameraView.ProtectCamera();
3175
+ cameraView.repaint();
3176
+ return;
3177
+ } else if (event.getSource() == revertCameraItem)
3178
+ {
3179
+ cameraView.RevertCamera();
3180
+ cameraView.repaint();
3181
+ return;
3182
+ // } else if (event.getSource() == textureButton)
3183
+ // {
3184
+ // return; // true;
3185
+ }
30063186 else
30073187 {
30083188 //return super.action(event, arg);
....@@ -3063,6 +3243,28 @@
30633243 refreshContents();
30643244 }
30653245
3246
+ void TransformChildren()
3247
+ {
3248
+ Object3D obj;
3249
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3250
+ {
3251
+ obj = (Object3D)e.nextElement();
3252
+ obj.KeepTextureMatrices();
3253
+ obj.TransformChildren();
3254
+ obj.RestoreTextureMatrices();
3255
+
3256
+// if (obj.parent == null)
3257
+// {
3258
+// System.out.println("NULL PARENT!");
3259
+// new Exception().printStackTrace();
3260
+// }
3261
+// else
3262
+// TouchTransform(obj);
3263
+// //obj.parent.Touch();
3264
+ }
3265
+
3266
+ refreshContents();
3267
+ }
30663268
30673269 void ResetTransform()
30683270 {
....@@ -3175,7 +3377,7 @@
31753377 refreshContents();
31763378 }
31773379
3178
- void ResetCentroid()
3380
+ void ResetCentroid(boolean full)
31793381 {
31803382 Object3D obj;
31813383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3190,12 +3392,16 @@
31903392 LA.matIdentity(Object3D.mat);
31913393 obj.getBounds(minima, maxima, false);
31923394 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3193
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3395
+ if (full)
3396
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31943397 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31953398 obj.TransformMesh(Object3D.mat);
3399
+
31963400 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3197
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3401
+ if (full)
3402
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31983403 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3404
+
31993405 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32003406 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32013407 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3224,7 +3430,8 @@
32243430
32253431 int size = obj.MemorySize();
32263432
3227
- System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3434
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32283435 }
32293436 }
32303437 catch (Exception e)
....@@ -3261,9 +3468,9 @@
32613468 obj = (Object3D)e.nextElement();
32623469
32633470 System.out.println("Object is: " + obj);
3264
- GrafreeD.AnalyzeObject(obj);
3471
+ Grafreed.AnalyzeObject(obj);
32653472 System.out.println("Boundary rep: " + obj.bRep);
3266
- GrafreeD.AnalyzeObject(obj.bRep);
3473
+ Grafreed.AnalyzeObject(obj.bRep);
32673474
32683475 // System.err.println((size/1024) + " KB is the size of " + obj);
32693476 }
....@@ -3305,6 +3512,13 @@
33053512 void GenNormals(boolean crease)
33063513 {
33073514 group.GenNormalsS(crease);
3515
+
3516
+ refreshContents();
3517
+ }
3518
+
3519
+ void GenNormalsMESH()
3520
+ {
3521
+ group.GenNormalsMeshS();
33083522
33093523 refreshContents();
33103524 }
....@@ -3477,8 +3691,8 @@
34773691
34783692 void ParseVertices()
34793693 {
3480
- boolean epsequal = GrafreeD.epsequal;
3481
- GrafreeD.epsequal = true;
3694
+ boolean epsequal = Grafreed.epsequal;
3695
+ Grafreed.epsequal = true;
34823696
34833697 for (int i=0; i<group.selection.size(); i++)
34843698 {
....@@ -3503,7 +3717,7 @@
35033717 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35043718 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35053719
3506
- g.add(GrafreeD.clipboard);
3720
+ g.add(Grafreed.clipboard);
35073721
35083722 buffer.add(g);
35093723 }
....@@ -3518,7 +3732,7 @@
35183732 makeSomething(buffer, i==group.selection.size()-1);
35193733 }
35203734
3521
- GrafreeD.epsequal = epsequal;
3735
+ Grafreed.epsequal = epsequal;
35223736
35233737 refreshContents();
35243738 }
....@@ -3536,7 +3750,16 @@
35363750 String pigment = Object3D.GetPigment(tex);
35373751 //String bump = Object3D.GetBump(tex);
35383752
3539
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3753
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3754
+
3755
+ try
3756
+ {
3757
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3758
+ }
3759
+ catch (Exception e)
3760
+ {
3761
+ System.err.println("FAIL: " + node);
3762
+ }
35403763
35413764 double s = v.s;
35423765
....@@ -3624,11 +3847,11 @@
36243847
36253848 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36263849
3627
- boolean random = CameraPane.RANDOM;
3628
- CameraPane.RANDOM = false; // parse all random nodes
3850
+ boolean random = CameraPane.SWITCH;
3851
+ CameraPane.SWITCH = false; // parse all random nodes
36293852 lowres.linkVerticesThis(null);
36303853 lowres.linkVerticesThis(sn);
3631
- CameraPane.RANDOM = random;
3854
+ CameraPane.SWITCH = random;
36323855
36333856 System.err.flush();
36343857
....@@ -3668,7 +3891,7 @@
36683891 return;
36693892
36703893 Object3D poses = group.selection.get(0);
3671
- Object3D ref = GrafreeD.clipboard.get(0);
3894
+ Object3D ref = Grafreed.clipboard.get(0);
36723895
36733896 Object3D newgroup = new Object3D("Po:" + poses.name);
36743897
....@@ -3862,9 +4085,9 @@
38624085
38634086 void ClipMesh()
38644087 {
3865
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4088
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38664089 {
3867
- Object3D content = GrafreeD.clipboard.get(0);
4090
+ Object3D content = Grafreed.clipboard.get(0);
38684091
38694092 if (content instanceof cGroup && ((cGroup)content).transientlink )
38704093 content = ((cGroup)content).get(0);
....@@ -3873,7 +4096,7 @@
38734096 // {
38744097 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38754098 // }
3876
- group.selection.ClipMesh(GrafreeD.clipboard);
4099
+ group.selection.ClipMesh(Grafreed.clipboard);
38774100 }
38784101 // group.selection.ClipMesh(GrafreeD.clipboard);
38794102 System.out.println("DONE.");
....@@ -4008,7 +4231,7 @@
40084231 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40094232
40104233 Object3D elem = (Object3D)group.selection.elementAt(i);
4011
- if(elem != group)
4234
+ if(elem != group || !newWindow)
40124235 {
40134236 // if (!(elem instanceof Composite))
40144237 // newWindow = false;
....@@ -4098,7 +4321,6 @@
40984321 //case 702: // Event.LIST_DESELECT
40994322 group.deselectAll();
41004323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4101
- objEditor.ClearInfo(); // .GetMaterial());
41024324 if (tps != null)
41034325 {
41044326 for (int i=0; i < tps.length; i++)
....@@ -4108,28 +4330,26 @@
41084330 //if (child.parent != null)
41094331 //child.parent.addSelectee(child);
41104332 group.addSelectee(child);
4111
- objEditor.SetMaterial(child); // .GetMaterial());
4112
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4113
- System.err.println("info : " + child.GetPath());
41144333 }
41154334 }
4116
- else
4117
- {
4118
- objEditor.SetMaterial(group); // .GetMaterial());
4119
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4120
- System.err.println("info : " + group.GetPath());
4121
- }
4335
+// else
4336
+// {
4337
+// objEditor.SetMaterial(group); // .GetMaterial());
4338
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4339
+// System.err.println("info : " + group.GetPath());
4340
+// }
41224341
4123
- objEditor.SetText(); // jan 2014
4124
-
4125
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4342
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41264343 CameraPane.flash = true;
41274344
4128
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4345
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41294346 // a camera
41304347 {
4131
- CameraPane.camerachangeframe = 0; // don't refuse it
4132
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4348
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4349
+ {
4350
+ CameraPane.camerachangeframe = 0; // don't refuse it
4351
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4352
+ }
41334353 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41344354 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41354355 }
....@@ -4142,6 +4362,29 @@
41424362
41434363 freezemodel = false;
41444364 }
4365
+
4366
+ void refreshContents(boolean cp)
4367
+ {
4368
+ if (!Globals.MOUSEDRAGGED)
4369
+ {
4370
+ objEditor.ClearInfo(); // .GetMaterial());
4371
+
4372
+ for (int i=0; i < group.selection.size(); i++)
4373
+ {
4374
+ Object3D child = (Object3D) group.selection.reserve(i);
4375
+
4376
+ objEditor.SetMaterial(child);
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+
4380
+ group.selection.release(i);
4381
+ }
4382
+
4383
+ objEditor.SetText(); // jan 2014
4384
+ }
4385
+
4386
+ super.refreshContents(cp);
4387
+ }
41454388
41464389 void linkSomething(Object3D thing)
41474390 {
....@@ -4213,16 +4456,18 @@
42134456 {
42144457 if (group.selection.isEmpty())
42154458 return;
4216
- GrafreeD.clipboardIsTempGroup = false;
4459
+
4460
+ Grafreed.clipboardIsTempGroup = false;
42174461 Composite tGroup = null;
42184462 if (group.selection.size() > 0) // 1)
42194463 {
42204464 tGroup = new cGroup();
4221
- GrafreeD.clipboardIsTempGroup = true;
4465
+ Grafreed.clipboardIsTempGroup = true;
42224466 }
42234467
42244468 if (cut)
42254469 {
4470
+ Save();
42264471 //int indices[] = jList.getSelectedIndices();
42274472 //for (int i = indices.length - 1; i >= 0; i--)
42284473 //jList.remove(indices[i]);
....@@ -4258,16 +4503,16 @@
42584503 //System.out.println("cut " + child);
42594504 //System.out.println("parent = " + child.parent);
42604505 // tmp.addChild(child);
4261
- if (GrafreeD.clipboardIsTempGroup)
4506
+ if (Grafreed.clipboardIsTempGroup)
42624507 tGroup.add/*Child*/(tmp);
42634508 else
4264
- GrafreeD.clipboard = tmp;
4509
+ Grafreed.clipboard = tmp;
42654510 }
42664511 else
4267
- if (GrafreeD.clipboardIsTempGroup)
4512
+ if (Grafreed.clipboardIsTempGroup)
42684513 tGroup.add/*Child*/(child);
42694514 else
4270
- GrafreeD.clipboard = child;
4515
+ Grafreed.clipboard = child;
42714516 }
42724517
42734518 //ResetModel();
....@@ -4299,21 +4544,23 @@
42994544 //System.out.println("cut " + elem);
43004545 //System.out.println("parent = " + elem.parent);
43014546 // tmp.addChild(elem);
4302
- if (GrafreeD.clipboardIsTempGroup)
4547
+ if (Grafreed.clipboardIsTempGroup)
43034548 tGroup.add/*Child*/(tmp);
43044549 else
4305
- GrafreeD.clipboard = tmp;
4550
+ Grafreed.clipboard = tmp;
43064551 }
43074552 else
4308
- if (GrafreeD.clipboardIsTempGroup)
4553
+ if (Grafreed.clipboardIsTempGroup)
43094554 tGroup.add/*Child*/(child);
43104555 else
4311
- GrafreeD.clipboard = child;
4556
+ Grafreed.clipboard = child;
43124557 }
43134558
43144559 }
4315
- if (GrafreeD.clipboardIsTempGroup)
4316
- GrafreeD.clipboard = tGroup;
4560
+
4561
+ if (Grafreed.clipboardIsTempGroup)
4562
+ Grafreed.clipboard = tGroup;
4563
+
43174564 if (cut)
43184565 {
43194566 ResetModel();
....@@ -4327,7 +4574,7 @@
43274574 // return;
43284575 boolean first = true;
43294576
4330
- if (GrafreeD.clipboardIsTempGroup)
4577
+ if (Grafreed.clipboardIsTempGroup)
43314578 {
43324579 Composite temp;
43334580
....@@ -4338,7 +4585,7 @@
43384585 temp = (Composite)Applet3D.clipboard.deepCopy();
43394586 */
43404587 Object3D elem;
4341
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4588
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43424589 {
43434590 Object3D child = (Object3D)e.nextElement();
43444591
....@@ -4372,21 +4619,21 @@
43724619 //Object3D cb = Applet3D.clipboard;
43734620 //temp.addChild(cb);
43744621 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4375
- assert(GrafreeD.clipboard.parent == null);
4376
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4377
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4378
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4379
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4622
+ assert(Grafreed.clipboard.parent == null);
4623
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4624
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4625
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4626
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43804627 else
4381
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4382
- GrafreeD.clipboard.get(0).parent = keepparent;
4628
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4629
+ Grafreed.clipboard.get(0).parent = keepparent;
43834630 }
43844631
43854632 ResetModel();
43864633 refreshContents();
43874634 }
43884635
4389
- void pasteInto(boolean copyit)
4636
+ void pasteInto(boolean copyit, boolean clone)
43904637 {
43914638 // if (GrafreeD.clipboard == null)
43924639 // return;
....@@ -4415,15 +4662,22 @@
44154662 if (copyit)
44164663 {
44174664 // paste(false);
4418
- CloneClipboard(false); // sept 2014
4665
+ if (clone)
4666
+ {
4667
+ CloneClipboard(false); // sept 2014
4668
+ }
4669
+ else
4670
+ {
4671
+ paste(false);
4672
+ }
44194673 }
44204674 else
44214675 {
44224676 boolean first = true;
44234677
4424
- if (GrafreeD.clipboardIsTempGroup)
4678
+ if (Grafreed.clipboardIsTempGroup)
44254679 {
4426
- Composite temp = (Composite)GrafreeD.clipboard;
4680
+ Composite temp = (Composite)Grafreed.clipboard;
44274681 Object3D copy;
44284682 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44294683 {
....@@ -4433,7 +4687,7 @@
44334687 }
44344688 } else
44354689 {
4436
- linkSomething(GrafreeD.clipboard); //.get(0));
4690
+ linkSomething(Grafreed.clipboard); //.get(0));
44374691 }
44384692 }
44394693 }
....@@ -4838,21 +5092,6 @@
48385092 }
48395093 */
48405094
4841
- void ImportGFD()
4842
- {
4843
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4844
- browser.show();
4845
- String filename = browser.getFile();
4846
- if (filename != null && filename.length() > 0)
4847
- {
4848
- String fullname = browser.getDirectory() + filename;
4849
-
4850
- //Object3D readobj =
4851
- objEditor.ReadGFD(fullname, objEditor);
4852
- //makeSomething(readobj);
4853
- }
4854
- }
4855
-
48565095 /*
48575096 public void Callback(Object obj)
48585097 {
....@@ -4876,26 +5115,9 @@
48765115 }
48775116 */
48785117
4879
- void ImportVRMLX3D()
4880
- {
4881
- if (GrafreeD.standAlone)
4882
- {
4883
- /**/
4884
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4885
- browser.show();
4886
- String filename = browser.getFile();
4887
- if (filename != null && filename.length() > 0)
4888
- {
4889
- String fullname = browser.getDirectory() + filename;
4890
- LoadVRMLX3D(fullname);
4891
- }
4892
- /**/
4893
- }
4894
- }
4895
-
48965118 String GetFile(String dialogName)
48975119 {
4898
- if (GrafreeD.standAlone)
5120
+ if (Grafreed.standAlone)
48995121 {
49005122 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49015123 browser.show();
....@@ -4959,10 +5181,15 @@
49595181 cButton flashSelectionButton;
49605182 cButton editButton;
49615183 cButton uneditButton;
5184
+ JCheckBox allParamsButton;
49625185 cButton clearpanelButton;
4963
- cButton allParamsButton;
49645186 cButton unselectButton;
49655187
5188
+ cButton saveButton;
5189
+ cButton undoButton;
5190
+ cButton redoButton;
5191
+ cButton oneStepButton;
5192
+
49665193 cButton screenfitButton;
49675194 cButton screenfitpointButton;
49685195 cButton snapobjectButton;
....@@ -4993,6 +5220,8 @@
49935220 private MenuItem lookFromItem;
49945221 private MenuItem switchItem;
49955222 private MenuItem cutItem;
5223
+ private MenuItem undoItem;
5224
+ private MenuItem redoItem;
49965225 private MenuItem duplicateItem;
49975226 private MenuItem cloneItem;
49985227 private MenuItem cloneSupportItem;
....@@ -5006,7 +5235,7 @@
50065235 private MenuItem linkverticesItem;
50075236 private MenuItem relinkverticesItem;
50085237 private MenuItem setMasterItem;
5009
- private MenuItem resetMeshItem;
5238
+ private MenuItem resetAllItem;
50105239 private MenuItem stepAllItem;
50115240 private MenuItem revertMeshItem;
50125241 private MenuItem poseMeshItem;
....@@ -5017,6 +5246,7 @@
50175246 private MenuItem mergeGeometriesItem;
50185247 private MenuItem copyItem;
50195248 private MenuItem pasteItem;
5249
+ private MenuItem pasteIntoItem;
50205250 private MenuItem pasteLinkItem;
50215251 private MenuItem pasteCloneItem;
50225252 private MenuItem pasteExpandItem;
....@@ -5066,8 +5296,10 @@
50665296 private MenuItem panoTexturesItem;
50675297
50685298 private MenuItem resetCentroidItem;
5069
- private MenuItem transformgeometryItem;
5299
+ private MenuItem resetCentroidXZItem;
50705300 private MenuItem resetTransformItem;
5301
+ private MenuItem transformGeometryItem;
5302
+ private MenuItem transformChildrenItem;
50715303 private MenuItem hideItem;
50725304 private MenuItem grabItem;
50735305 private MenuItem backItem;
....@@ -5114,7 +5346,7 @@
51145346 private MenuItem blobItem;
51155347 private MenuItem latheItem;
51165348 private MenuItem bezierItem;
5117
- private MenuItem checkerItem;
5349
+ private MenuItem overlayItem;
51185350 private MenuItem meshItem;
51195351 // private MenuItem meshGroupItem;
51205352 private MenuItem springItem;
....@@ -5136,11 +5368,6 @@
51365368 private MenuItem doubleItem;
51375369 private MenuItem tripleItem;
51385370
5139
- private MenuItem importGFDItem;
5140
- private MenuItem importVRMLX3DItem;
5141
- private MenuItem import3DSItem;
5142
- private MenuItem importOBJItem;
5143
-
51445371 private MenuItem computeAOItem;
51455372 private MenuItem recompileItem;
51465373 private MenuItem editScriptItem;
....@@ -5150,4 +5377,8 @@
51505377 private MenuItem analyzeItem;
51515378 private MenuItem dumpItem;
51525379 //boolean freezemodel = false;
5380
+
5381
+ Menu cameraMenu;
5382
+ MenuItem editCameraItem;
5383
+ MenuItem revertCameraItem;
51535384 }