Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -148,8 +148,129 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
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
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
153274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,45 +282,17 @@
161282 lookAtItem.addActionListener(this);
162283 //lookFromItem.addActinoListener(this);
163284 //switchItem.addActionListener(this);
164
- Menu menu;
165
- oe.menuBar.add(menu = new Menu("Edit"));
166
- //editItem = menu.add(new MenuItem("Edit"));
167
- //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
169
- duplicateItem.addActionListener(this);
170
- menu.add("-");
171
- cloneItem = menu.add(new MenuItem("Clone"));
172
- cloneItem.addActionListener(this);
173
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174
- cloneSupportItem.addActionListener(this);
175
- menu.add("-");
176
- cutItem = menu.add(new MenuItem("Cut"));
177
- cutItem.addActionListener(this);
178
- copyItem = menu.add(new MenuItem("Copy"));
179
- copyItem.addActionListener(this);
180
- pasteItem = menu.add(new MenuItem("Paste"));
181
- pasteItem.addActionListener(this);
182
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
183
- pasteLinkItem.addActionListener(this);
184
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185
- pasteCloneItem.addActionListener(this);
186
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187
-// pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
190
- clearAllItem = menu.add(new MenuItem("Clear All"));
191
- clearAllItem.addActionListener(this);
192
-
285
+ }
286
+
193287 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
288
+ if (Globals.ADVANCED)
289
+ {
198290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199291 revertMeshItem.addActionListener(this);
200292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201293 resetreferencesItem.addActionListener(this);
202294 menu.add("-");
295
+ }
203296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204297 overwriteGeoItem.addActionListener(this);
205298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +304,26 @@
211304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212305 overwriteUVItem.addActionListener(this);
213306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
214309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215310 generateMeshItem.addActionListener(this);
216311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217312 poseMeshItem.addActionListener(this);
218313 menu.add("-");
314
+ }
219315 resetsupportItem = menu.add(new MenuItem("Reset support"));
220316 resetsupportItem.addActionListener(this);
221317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222318 linkverticesItem.addActionListener(this);
223319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
225324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226325 setMasterItem.addActionListener(this);
326
+ }
227327
228328 oe.menuBar.add(menu = new Menu("Group"));
229329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,27 +334,32 @@
234334 frontItem.addActionListener(this);
235335 compositeItem = menu.add(new MenuItem("Composite"));
236336 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238338 hideItem.addActionListener(this);
239339 ungroupItem = menu.add(new MenuItem("Ungroup"));
240340 ungroupItem.addActionListener(this);
241341 menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
243343 randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
248344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249345 switchGeoItem.addActionListener(this);
250346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251347 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
253349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
254358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255359 scriptNodeItem.addActionListener(this);
256360 cameraItem = menu.add(new MenuItem("Camera"));
257361 cameraItem.addActionListener(this);
362
+ }
258363
259364 oe.menuBar.add(menu = new Menu("Object"));
260365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -263,27 +368,35 @@
263368 billboardItem.addActionListener(this);
264369 csgItem = menu.add(new MenuItem("CSG"));
265370 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267372 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269374 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
272380 linkerItem = menu.add(new MenuItem("Linker"));
273381 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276382 attributeItem = menu.add(new MenuItem("Attribute"));
277383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
278386 pointflowItem = menu.add(new MenuItem("Point Flow"));
279387 pointflowItem.addActionListener(this);
388
+ }
280389 menu.add("-");
281390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282391 resetTransformItem.addActionListener(this);
283392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284393 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
287400
288401 oe.menuBar.add(menu = new Menu("Geometry"));
289402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +407,11 @@
294407 genNormalsCADItem.addActionListener(this);
295408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
297412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298413 genNormalsMINEItem.addActionListener(this);
414
+ }
299415 stripifyItem = menu.add(new MenuItem("Stripify"));
300416 stripifyItem.addActionListener(this);
301417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +433,34 @@
317433 reduce34MeshItem.addActionListener(this);
318434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319435 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
324444
325445 oe.menuBar.add(menu = new Menu("Attributes"));
326446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
328452 menu.add("-");
329453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330454 liveleavesItem.addActionListener(this);
331455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
333459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334460 supportleavesItem.addActionListener(this);
335461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336462 unsupportleavesItem.addActionListener(this);
463
+ }
337464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338465 hideleavesItem.addActionListener(this);
339466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +469,14 @@
342469 markleavesItem.addActionListener(this);
343470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
345480 menu.add("-");
346481 flipVItem = menu.add(new MenuItem("Flip V"));
347482 flipVItem.addActionListener(this);
....@@ -377,35 +512,40 @@
377512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378513 sortbynameItem.addActionListener(this);
379514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
380522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381523 extractGeometriesItem.addActionListener(this);
382524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383525 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);
526
+ }
388527
389528 oe.menuBar.add(menu = new Menu("Insert"));
390529 buildCreateMenu(menu);
391530
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
-
403531 oe.menuBar.add(menu = new Menu("Tools"));
404532 buildToolsMenu(menu);
405533 }
406534
407535 void SetupUI2(ObjEditor oe)
408536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
409549 //new Exception().printStackTrace();
410550
411551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -436,94 +576,117 @@
436576 */
437577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438578
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
439603 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
604
+ liveCB.setToolTipText("Enable animation");
441605 liveCB.addItemListener(this);
442606
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
443611 oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444612 fastCB.setToolTipText("Fast mode");
445613 fastCB.addItemListener(this);
446614
447
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
448616 trackCB.setToolTipText("Enable tracking");
449617 trackCB.addItemListener(this);
450618
451
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
452620 screenfitButton.setToolTipText("Screen fit");
453621 screenfitButton.addActionListener(this);
454622
455623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
456624 // 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;
462625
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);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
469634 flashSelectionButton.setToolTipText("Show selection");
470635 flashSelectionButton.addActionListener(this);
471636
472637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473638
474
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
475640 twoButton.setToolTipText("Show center view only");
476641 twoButton.addActionListener(this);
477
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
478643 fourButton.addActionListener(this);
479644 fourButton.setToolTipText("Show left panel only");
480
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
481646 sixButton.setToolTipText("2-column layout left");
482647 sixButton.addActionListener(this);
483
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
484649 threeButton.setToolTipText("2-column layout right");
485650 threeButton.addActionListener(this);
486
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
487652 sevenButton.setToolTipText("3-column layout");
488653 sevenButton.addActionListener(this);
489654 //
490655
491
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492657 rootButton.setToolTipText("Edit selection in new tab");
493658 rootButton.addActionListener(this);
494659
495
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
496661 closeButton.setToolTipText("Close tab");
497662 closeButton.addActionListener(this);
498663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
499664 //clearButton.addActionListener(this);
500665
501
- cGridBag commandsPanel = new cGridBag();
502
-
503
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504667 editButton.setToolTipText("Edit selection");
505668 editButton.addActionListener(this);
506669
507
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508671 uneditButton.setToolTipText("Unedit selection");
509672 uneditButton.addActionListener(this);
510673
511
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
676
+ allParamsButton.addActionListener(this);
677
+
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512679 clearPanelButton.setToolTipText("Clear edit panel");
513680 clearPanelButton.addActionListener(this);
514681
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);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520683 unselectButton.setToolTipText("Unselect");
521684 unselectButton.addActionListener(this);
522685
523
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
524687
525
- oe.treePanel.add(commandsPanel);
526
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
527690
528691 // oe.aConstraints.gridx += 1;
529692 // oe.aConstraints.weighty = 0;
....@@ -591,8 +754,18 @@
591754
592755 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593756 {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
594767 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
- supportCB.setToolTipText("Enabled rigging");
768
+ supportCB.setToolTipText("Enable rigging");
596769 supportCB.addItemListener(this);
597770
598771 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
....@@ -610,14 +783,6 @@
610783 slowCB.setToolTipText("Smooth interpolation");
611784 slowCB.addItemListener(this);
612785
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
-
621786 // constraints.gridy += 1;
622787 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623788 // speakerMocapCB.addItemListener(this);
....@@ -648,6 +813,8 @@
648813 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649814 lookAtCB.setToolTipText("Look-at target");
650815 lookAtCB.addItemListener(this);
816
+
817
+ }
651818
652819 cGridBag fill = new cGridBag();
653820
....@@ -668,8 +835,11 @@
668835 buttonGroup.add(radioButton);
669836 radioButton.doClick();
670837 }
838
+
671839 void SetupViews(ObjEditor oe)
672840 {
841
+ theFrame = this;
842
+
673843 oe.SetupViews();
674844
675845 System.out.println("SetupViews");
....@@ -732,6 +902,7 @@
732902 } else if(e.getSource() == liveCB)
733903 {
734904 cameraView.ToggleLive();
905
+ refreshContents(false);
735906 }
736907 else if(e.getSource() == supportCB)
737908 {
....@@ -884,7 +1055,9 @@
8841055 // objEditor.DropFile((java.io.File[]) object, true);
8851056 // return;
8861057 // }
887
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8881061 {
8891062 // file(s)
8901063 String[] names = string.split("\n");
....@@ -911,7 +1084,7 @@
9111084
9121085 flashIt = false;
9131086 CameraPane pane = (CameraPane) target;
914
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9151088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9161089
9171090 if (group.selection.size() == 1)
....@@ -938,11 +1111,11 @@
9381111 {
9391112 loadClipboard(true);
9401113 objEditor.jTree.setSelectionPath(destinationPath);
941
- pasteInto(false);
1114
+ pasteInto(false, false);
9421115 } else {
9431116 loadClipboard(false);
9441117 objEditor.jTree.setSelectionPath(destinationPath);
945
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9461119 }
9471120 }
9481121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1064,27 +1237,33 @@
10641237 kleinItem.addActionListener(this);
10651238 particleItem = menu.add(new MenuItem("Particle system"));
10661239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10671242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10681243 ragdollItem.addActionListener(this);
10691244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10701245 ragdoll2Item.addActionListener(this);
1246
+ }
10711247 menu.add("-");
1072
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10731249 meshItem.addActionListener(this);
10741250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10751251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10761254 springItem = menu.add(new MenuItem("Spring"));
10771255 springItem.addActionListener(this);
10781256 flagItem = menu.add(new MenuItem("Flag"));
10791257 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);
10841258 blobItem = menu.add(new MenuItem("Blob"));
10851259 blobItem.addActionListener(this);
10861260 latheItem = menu.add(new MenuItem("Lathe"));
10871261 latheItem.addActionListener(this);
1262
+ }
1263
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1264
+ bezierItem.addActionListener(this);
1265
+ overlayItem = menu.add(new MenuItem("Overlay"));
1266
+ overlayItem.addActionListener(this);
10881267 lightItem = menu.add(new MenuItem("Light"));
10891268 lightItem.addActionListener(this);
10901269 menu.add("-");
....@@ -1094,8 +1273,11 @@
10941273 loopItem.addActionListener(this);
10951274 doubleItem = menu.add(new MenuItem("Fork"));
10961275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
10971278 tripleItem = menu.add(new MenuItem("Trident"));
10981279 tripleItem.addActionListener(this);
1280
+ }
10991281 }
11001282
11011283 void buildToolsMenu(Menu menu)
....@@ -1109,24 +1291,26 @@
11091291 parseverticesItem.addActionListener(this);
11101292 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11111293 textureFieldItem.addActionListener(this);
1112
- alignItem = menu.add(new MenuItem("Align"));
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
11131295 alignItem.addActionListener(this);
1114
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1115
- mirrorItem.addActionListener(this);
11161296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11171297 reduceMorphItem.addActionListener(this);
11181298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11191299 reduce34MorphItem.addActionListener(this);
1120
-
1300
+ menu.add("-");
11211301 menu.add(computeAOItem = new MenuItem("Compute AO"));
11221302 computeAOItem.addActionListener(this);
1123
- menu.add("-");
11241303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
11251309 menu.add(memoryItem = new MenuItem("Memory Usage"));
11261310 memoryItem.addActionListener(this);
11271311 menu.add(analyzeItem = new MenuItem("Analyze"));
11281312 analyzeItem.addActionListener(this);
1129
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11301314 dumpItem.addActionListener(this);
11311315 // menu.add(pathItem = new MenuItem("From-to path"));
11321316 // pathItem.addActionListener(this);
....@@ -1144,6 +1328,7 @@
11441328 menu.add("-");
11451329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11461330 editScriptItem.addActionListener(this);
1331
+ }
11471332 }
11481333
11491334 void ScreenFit()
....@@ -1266,6 +1451,7 @@
12661451 shadow.material = new cMaterial(obj.material);
12671452 shadow.material.diffuse = 0.0001f;
12681453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12691455
12701456 makeSomething(shadow);
12711457 }
....@@ -1472,9 +1658,9 @@
14721658
14731659 void Overwrite(int mask)
14741660 {
1475
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14761662 {
1477
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14781664
14791665 if (content instanceof cGroup && ((cGroup)content).transientlink )
14801666 content = ((cGroup)content).get(0);
....@@ -1645,7 +1831,7 @@
16451831 {
16461832 makeSomething(new BezierSurface());
16471833 } else
1648
- if (source == checkerItem)
1834
+ if (source == overlayItem)
16491835 {
16501836 /*
16511837 Object3D obj = new BezierSurface(5,8);
....@@ -1779,23 +1965,6 @@
17791965 csg.addChild(child);
17801966 child.addChild(csg);
17811967 } 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
17991968 if (source == computeAOItem)
18001969 {
18011970 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1814,7 +1983,7 @@
18141983 if (source == invariantsItem)
18151984 {
18161985 System.out.println("Invariants:");
1817
- GrafreeD.grafreeD.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
18181987 } else
18191988 if (source == memoryItem)
18201989 {
....@@ -1832,6 +2001,35 @@
18322001 if (source == dumpItem)
18332002 {
18342003 DumpObject();
2004
+ } else
2005
+ if (source == minButton)
2006
+ {
2007
+ Minimize();
2008
+ } else
2009
+ if (source == maxButton)
2010
+ {
2011
+ Maximize();
2012
+ } else
2013
+ if (source == fullButton)
2014
+ {
2015
+ ToggleFullScreen();
2016
+ } else
2017
+ if (source == undoButton)
2018
+ {
2019
+ Undo();
2020
+ } else
2021
+ if (source == redoButton)
2022
+ {
2023
+ Redo();
2024
+ } else
2025
+ if (source == saveButton)
2026
+ {
2027
+ Save();
2028
+ } else
2029
+ if (source == oneStepButton)
2030
+ {
2031
+ Globals.ONESTEP = true;
2032
+ cameraView.repaint();
18352033 } else
18362034 if (source == screenfitButton)
18372035 {
....@@ -1882,12 +2080,20 @@
18822080 {
18832081 loadClipboard(true);
18842082 } else
2083
+ if (source == undoItem)
2084
+ {
2085
+ Undo();
2086
+ } else
2087
+ if (source == redoItem)
2088
+ {
2089
+ Redo();
2090
+ } else
18852091 if (source == duplicateItem)
18862092 {
1887
- Object3D keep = GrafreeD.clipboard;
2093
+ Object3D keep = Grafreed.clipboard;
18882094 loadClipboard(false);
18892095 paste(false);
1890
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
18912097 } else
18922098 if (source == cloneItem)
18932099 {
....@@ -1905,13 +2111,17 @@
19052111 {
19062112 paste(false);
19072113 } else
2114
+ if (source == pasteIntoItem)
2115
+ {
2116
+ pasteInto(true, false);
2117
+ } else
19082118 if (source == pasteLinkItem)
19092119 {
1910
- pasteInto(false);
2120
+ pasteInto(false, false);
19112121 } else
19122122 if (source == pasteCloneItem)
19132123 {
1914
- pasteInto(true);
2124
+ pasteInto(true, true);
19152125 } else
19162126 if (source == pasteExpandItem)
19172127 {
....@@ -2103,9 +2313,9 @@
21032313 // group.selection.get(0).setMasterThis(content); // should be identity
21042314 // refreshContents();
21052315 // }
2106
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21072317 {
2108
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
21092319
21102320 if (content instanceof cGroup && ((cGroup)content).transientlink )
21112321 content = ((cGroup)content).get(0);
....@@ -2113,11 +2323,11 @@
21132323 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21142324 for (int i=0; i<group.selection.size(); i++)
21152325 {
2116
- boolean random = CameraPane.RANDOM;
2117
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
21182328 group.selection.get(i).linkVerticesThis(content);
21192329 // group.selection.get(i).setMasterThis(content); // should be identity
2120
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
21212331 }
21222332 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21232333 refreshContents();
....@@ -2127,20 +2337,20 @@
21272337 {
21282338 for (int i=0; i<group.selection.size(); i++)
21292339 {
2130
- boolean random = CameraPane.RANDOM;
2131
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
21322342 group.selection.get(i).linkVerticesThis(null);
2133
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
21342344 }
21352345
21362346 refreshContents();
21372347 } else
21382348 if (source == relinkverticesItem)
21392349 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
21422352 group.selection.RelinkToSupport();
2143
- CameraPane.RANDOM = random;
2353
+ CameraPane.SWITCH = random;
21442354
21452355 refreshContents();
21462356 } else
....@@ -2155,9 +2365,9 @@
21552365 } else
21562366 if (source == setMasterItem)
21572367 {
2158
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21592369 {
2160
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
21612371
21622372 if (content instanceof cGroup && ((cGroup)content).transientlink )
21632373 content = ((cGroup)content).get(0);
....@@ -2170,9 +2380,9 @@
21702380 {
21712381 if (group.selection.size() == 1)
21722382 {
2173
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
21742384 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
21762386
21772387 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782388 content = ((cGroup)content).get(0);
....@@ -2189,7 +2399,7 @@
21892399 {
21902400 RevertMeshes();
21912401 } else
2192
- if (source == resetMeshItem)
2402
+ if (source == resetAllItem)
21932403 {
21942404 ResetAll();
21952405 } else
....@@ -2238,7 +2448,7 @@
22382448 RandomNode random = new RandomNode();
22392449 group(random);
22402450 if (random.size() > 0)
2241
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
22422452 } else
22432453 if (source == physicsItem)
22442454 {
....@@ -2377,7 +2587,7 @@
23772587 } else
23782588 if (source == genNormalsMESHItem)
23792589 {
2380
- GenNormals(true); // TODO
2590
+ GenNormalsMESH();
23812591 } else
23822592 if (source == genNormalsORGANItem)
23832593 {
....@@ -2442,6 +2652,22 @@
24422652 if (source == unmarkleavesItem)
24432653 {
24442654 MarkLeaves(false);
2655
+ } else
2656
+ if (source == rewindleavesItem)
2657
+ {
2658
+ RewindLeaves(true);
2659
+ } else
2660
+ if (source == unrewindleavesItem)
2661
+ {
2662
+ RewindLeaves(false);
2663
+ } else
2664
+ if (source == randomleavesItem)
2665
+ {
2666
+ RandomLeaves(true);
2667
+ } else
2668
+ if (source == unrandomleavesItem)
2669
+ {
2670
+ RandomLeaves(false);
24452671 } else
24462672 if (source == flipVItem)
24472673 {
....@@ -2527,9 +2753,13 @@
25272753 {
25282754 SmoothMesh();
25292755 } else
2530
- if (source == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
25312757 {
25322758 TransformGeometry();
2759
+ } else
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
25332763 } else
25342764 if (source == resetTransformItem)
25352765 {
....@@ -2537,7 +2767,11 @@
25372767 } else
25382768 if (source == resetCentroidItem)
25392769 {
2540
- ResetCentroid();
2770
+ ResetCentroid(true);
2771
+ } else
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
25412775 } else
25422776 if (source == resetParentItem)
25432777 {
....@@ -2701,6 +2935,24 @@
27012935 bigThree.ClearUI();
27022936 bigThree.add(centralPanel);
27032937 bigThree.FlushUI();
2938
+
2939
+ cameraView.requestFocusInWindow();
2940
+
2941
+// refreshContents(true);
2942
+//
2943
+// try
2944
+// {
2945
+// java.awt.Robot bot = new java.awt.Robot();
2946
+// int mask = InputEvent.BUTTON1_MASK;
2947
+// bot.mouseMove(100, 100);
2948
+// bot.mousePress(mask);
2949
+// bot.mouseRelease(mask);
2950
+// }
2951
+// catch (Exception e)
2952
+// {
2953
+//
2954
+// }
2955
+
27042956 } else
27052957 if (source == threeButton)
27062958 {
....@@ -2737,6 +2989,8 @@
27372989 bigThree.add(centralPanel);
27382990 bigThree.add(XYZPanel);
27392991 bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
27402994 } else
27412995 if (source == fourButton)
27422996 {
....@@ -2772,6 +3026,8 @@
27723026 bigThree.ClearUI();
27733027 bigThree.add(scenePanel);
27743028 bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
27753031 } else
27763032 if (source == sixButton)
27773033 {
....@@ -2808,6 +3064,8 @@
28083064 bigThree.add(scenePanel);
28093065 bigThree.add(centralPanel);
28103066 bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
28113069 } else
28123070 if (source == sevenButton)
28133071 {
....@@ -2845,6 +3103,8 @@
28453103 bigThree.add(centralPanel);
28463104 bigThree.add(XYZPanel);
28473105 bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
28483108 } else
28493109 if (source == rootButton)
28503110 {
....@@ -2856,6 +3116,7 @@
28563116 EditObject(obj);
28573117 }
28583118
3119
+ cameraView.requestFocusInWindow();
28593120 refreshContents(true);
28603121 } else
28613122 if (source == closeButton)
....@@ -2877,6 +3138,8 @@
28773138 break;
28783139 }
28793140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
28803143 refreshContents(true);
28813144 } else
28823145 if (source == editItem || source == editButton)
....@@ -2893,9 +3156,9 @@
28933156 child.CloseUI();
28943157 listUI.remove(child);
28953158
2896
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
28973160 }
2898
- objEditor.ctrlPanel.validate();
3161
+ objEditor.ctrlPanel.FlushUI();
28993162 //objEditor.jTree.clearSelection();
29003163 //objEditor.ResetSliders();
29013164 refreshContents(true);
....@@ -2979,7 +3242,10 @@
29793242 frontView.object = group;
29803243 sideView.object = group;
29813244 }
2982
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
29833249 /*
29843250 currentLayout = radio.layout;
29853251 if (currentLayout == null)
....@@ -2991,8 +3257,23 @@
29913257 //group.parent = null; // ROOT
29923258 //group.attributes = -1;
29933259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
29943262 refreshContents(true);
2995
- }
3263
+ } else if (event.getSource() == editCameraItem)
3264
+ {
3265
+ cameraView.ProtectCamera();
3266
+ cameraView.repaint();
3267
+ return;
3268
+ } else if (event.getSource() == revertCameraItem)
3269
+ {
3270
+ cameraView.RevertCamera();
3271
+ cameraView.repaint();
3272
+ return;
3273
+ // } else if (event.getSource() == textureButton)
3274
+ // {
3275
+ // return; // true;
3276
+ }
29963277 else
29973278 {
29983279 //return super.action(event, arg);
....@@ -3001,7 +3282,6 @@
30013282 }
30023283
30033284 boolean useclient = false;
3004
- cRadio radio;
30053285
30063286 void ToggleRoot()
30073287 {
....@@ -3053,6 +3333,28 @@
30533333 refreshContents();
30543334 }
30553335
3336
+ void TransformChildren()
3337
+ {
3338
+ Object3D obj;
3339
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3340
+ {
3341
+ obj = (Object3D)e.nextElement();
3342
+ obj.KeepTextureMatrices();
3343
+ obj.TransformChildren();
3344
+ obj.RestoreTextureMatrices();
3345
+
3346
+// if (obj.parent == null)
3347
+// {
3348
+// System.out.println("NULL PARENT!");
3349
+// new Exception().printStackTrace();
3350
+// }
3351
+// else
3352
+// TouchTransform(obj);
3353
+// //obj.parent.Touch();
3354
+ }
3355
+
3356
+ refreshContents();
3357
+ }
30563358
30573359 void ResetTransform()
30583360 {
....@@ -3165,7 +3467,7 @@
31653467 refreshContents();
31663468 }
31673469
3168
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
31693471 {
31703472 Object3D obj;
31713473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3180,12 +3482,16 @@
31803482 LA.matIdentity(Object3D.mat);
31813483 obj.getBounds(minima, maxima, false);
31823484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3183
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31843487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31853488 obj.TransformMesh(Object3D.mat);
3489
+
31863490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3187
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31883493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
31893495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31903496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31913497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3214,7 +3520,8 @@
32143520
32153521 int size = obj.MemorySize();
32163522
3217
- System.err.println((size/1024) + " KB is the size of " + obj);
3523
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3524
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32183525 }
32193526 }
32203527 catch (Exception e)
....@@ -3251,9 +3558,9 @@
32513558 obj = (Object3D)e.nextElement();
32523559
32533560 System.out.println("Object is: " + obj);
3254
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
32553562 System.out.println("Boundary rep: " + obj.bRep);
3256
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
32573564
32583565 // System.err.println((size/1024) + " KB is the size of " + obj);
32593566 }
....@@ -3295,6 +3602,13 @@
32953602 void GenNormals(boolean crease)
32963603 {
32973604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
32983612
32993613 refreshContents();
33003614 }
....@@ -3467,8 +3781,8 @@
34673781
34683782 void ParseVertices()
34693783 {
3470
- boolean epsequal = GrafreeD.epsequal;
3471
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
34723786
34733787 for (int i=0; i<group.selection.size(); i++)
34743788 {
....@@ -3493,7 +3807,7 @@
34933807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34943808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34953809
3496
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
34973811
34983812 buffer.add(g);
34993813 }
....@@ -3508,7 +3822,7 @@
35083822 makeSomething(buffer, i==group.selection.size()-1);
35093823 }
35103824
3511
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
35123826
35133827 refreshContents();
35143828 }
....@@ -3526,7 +3840,16 @@
35263840 String pigment = Object3D.GetPigment(tex);
35273841 //String bump = Object3D.GetBump(tex);
35283842
3529
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3843
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3844
+
3845
+ try
3846
+ {
3847
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3848
+ }
3849
+ catch (Exception e)
3850
+ {
3851
+ System.err.println("FAIL: " + node);
3852
+ }
35303853
35313854 double s = v.s;
35323855
....@@ -3614,11 +3937,11 @@
36143937
36153938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36163939
3617
- boolean random = CameraPane.RANDOM;
3618
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
36193942 lowres.linkVerticesThis(null);
36203943 lowres.linkVerticesThis(sn);
3621
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
36223945
36233946 System.err.flush();
36243947
....@@ -3658,7 +3981,7 @@
36583981 return;
36593982
36603983 Object3D poses = group.selection.get(0);
3661
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
36623985
36633986 Object3D newgroup = new Object3D("Po:" + poses.name);
36643987
....@@ -3852,9 +4175,9 @@
38524175
38534176 void ClipMesh()
38544177 {
3855
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38564179 {
3857
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
38584181
38594182 if (content instanceof cGroup && ((cGroup)content).transientlink )
38604183 content = ((cGroup)content).get(0);
....@@ -3863,7 +4186,7 @@
38634186 // {
38644187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38654188 // }
3866
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
38674190 }
38684191 // group.selection.ClipMesh(GrafreeD.clipboard);
38694192 System.out.println("DONE.");
....@@ -3910,6 +4233,18 @@
39104233 void MarkLeaves(boolean hide)
39114234 {
39124235 group.selection.MarkLeaves(hide);
4236
+ refreshContents();
4237
+ }
4238
+
4239
+ void RewindLeaves(boolean hide)
4240
+ {
4241
+ group.selection.RewindLeaves(hide);
4242
+ refreshContents();
4243
+ }
4244
+
4245
+ void RandomLeaves(boolean hide)
4246
+ {
4247
+ group.selection.RandomLeaves(hide);
39134248 refreshContents();
39144249 }
39154250
....@@ -3998,7 +4333,7 @@
39984333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39994334
40004335 Object3D elem = (Object3D)group.selection.elementAt(i);
4001
- if(elem != group)
4336
+ if(elem != group || !newWindow)
40024337 {
40034338 // if (!(elem instanceof Composite))
40044339 // newWindow = false;
....@@ -4088,7 +4423,6 @@
40884423 //case 702: // Event.LIST_DESELECT
40894424 group.deselectAll();
40904425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4091
- objEditor.ClearInfo(); // .GetMaterial());
40924426 if (tps != null)
40934427 {
40944428 for (int i=0; i < tps.length; i++)
....@@ -4097,10 +4431,8 @@
40974431
40984432 //if (child.parent != null)
40994433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
41004435 group.addSelectee(child);
4101
- objEditor.SetMaterial(child); // .GetMaterial());
4102
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4103
- System.err.println("info : " + child.GetPath());
41044436 }
41054437 }
41064438 // else
....@@ -4110,16 +4442,17 @@
41104442 // System.err.println("info : " + group.GetPath());
41114443 // }
41124444
4113
- objEditor.SetText(); // jan 2014
4114
-
4115
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4445
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41164446 CameraPane.flash = true;
41174447
4118
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41194449 // a camera
41204450 {
4121
- CameraPane.camerachangeframe = 0; // don't refuse it
4122
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4451
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4452
+ {
4453
+ CameraPane.camerachangeframe = 0; // don't refuse it
4454
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4455
+ }
41234456 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41244457 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41254458 }
....@@ -4132,6 +4465,26 @@
41324465
41334466 freezemodel = false;
41344467 }
4468
+
4469
+ void refreshContents(boolean cp)
4470
+ {
4471
+ if (!Globals.MOUSEDRAGGED)
4472
+ {
4473
+ objEditor.ClearInfo(); // .GetMaterial());
4474
+
4475
+ for (int i=0; i < group.selection.Size(); i++)
4476
+ {
4477
+ Object3D child = (Object3D) group.selection.get(i);
4478
+
4479
+ objEditor.AddInfo(child, this, true);
4480
+ System.err.println("info : " + child.GetPath());
4481
+ }
4482
+
4483
+ objEditor.SetText(); // jan 2014
4484
+ }
4485
+
4486
+ super.refreshContents(cp);
4487
+ }
41354488
41364489 void linkSomething(Object3D thing)
41374490 {
....@@ -4203,16 +4556,18 @@
42034556 {
42044557 if (group.selection.isEmpty())
42054558 return;
4206
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
42074561 Composite tGroup = null;
42084562 if (group.selection.size() > 0) // 1)
42094563 {
42104564 tGroup = new cGroup();
4211
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
42124566 }
42134567
42144568 if (cut)
42154569 {
4570
+ Save();
42164571 //int indices[] = jList.getSelectedIndices();
42174572 //for (int i = indices.length - 1; i >= 0; i--)
42184573 //jList.remove(indices[i]);
....@@ -4248,16 +4603,16 @@
42484603 //System.out.println("cut " + child);
42494604 //System.out.println("parent = " + child.parent);
42504605 // tmp.addChild(child);
4251
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
42524607 tGroup.add/*Child*/(tmp);
42534608 else
4254
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
42554610 }
42564611 else
4257
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
42584613 tGroup.add/*Child*/(child);
42594614 else
4260
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
42614616 }
42624617
42634618 //ResetModel();
....@@ -4289,21 +4644,23 @@
42894644 //System.out.println("cut " + elem);
42904645 //System.out.println("parent = " + elem.parent);
42914646 // tmp.addChild(elem);
4292
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
42934648 tGroup.add/*Child*/(tmp);
42944649 else
4295
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
42964651 }
42974652 else
4298
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42994654 tGroup.add/*Child*/(child);
43004655 else
4301
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
43024657 }
43034658
43044659 }
4305
- if (GrafreeD.clipboardIsTempGroup)
4306
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
43074664 if (cut)
43084665 {
43094666 ResetModel();
....@@ -4317,7 +4674,7 @@
43174674 // return;
43184675 boolean first = true;
43194676
4320
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
43214678 {
43224679 Composite temp;
43234680
....@@ -4328,7 +4685,7 @@
43284685 temp = (Composite)Applet3D.clipboard.deepCopy();
43294686 */
43304687 Object3D elem;
4331
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4688
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43324689 {
43334690 Object3D child = (Object3D)e.nextElement();
43344691
....@@ -4362,21 +4719,21 @@
43624719 //Object3D cb = Applet3D.clipboard;
43634720 //temp.addChild(cb);
43644721 //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());
4722
+ assert(Grafreed.clipboard.parent == null);
4723
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4724
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4725
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4726
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43704727 else
4371
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4372
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
43734730 }
43744731
43754732 ResetModel();
43764733 refreshContents();
43774734 }
43784735
4379
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
43804737 {
43814738 // if (GrafreeD.clipboard == null)
43824739 // return;
....@@ -4405,15 +4762,22 @@
44054762 if (copyit)
44064763 {
44074764 // paste(false);
4408
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
44094773 }
44104774 else
44114775 {
44124776 boolean first = true;
44134777
4414
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
44154779 {
4416
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
44174781 Object3D copy;
44184782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44194783 {
....@@ -4423,7 +4787,7 @@
44234787 }
44244788 } else
44254789 {
4426
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
44274791 }
44284792 }
44294793 }
....@@ -4828,21 +5192,6 @@
48285192 }
48295193 */
48305194
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
-
48465195 /*
48475196 public void Callback(Object obj)
48485197 {
....@@ -4866,26 +5215,9 @@
48665215 }
48675216 */
48685217
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
-
48865218 String GetFile(String dialogName)
48875219 {
4888
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
48895221 {
48905222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48915223 browser.show();
....@@ -4949,10 +5281,18 @@
49495281 cButton flashSelectionButton;
49505282 cButton editButton;
49515283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
49525285 cButton clearpanelButton;
4953
- cButton allParamsButton;
49545286 cButton unselectButton;
49555287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
49565296 cButton screenfitButton;
49575297 cButton screenfitpointButton;
49585298 cButton snapobjectButton;
....@@ -4963,14 +5303,6 @@
49635303 cButton closeButton;
49645304
49655305 cButton setsupportButton;
4966
-
4967
- cButton twoButton;
4968
- cButton sixButton;
4969
- cButton threeButton;
4970
- cButton sevenButton;
4971
- cButton fourButton; // full panel
4972
- cButton oneButton; // full XYZ
4973
- //cButton currentLayout;
49745306
49755307 //
49765308 //Composite
....@@ -4983,6 +5315,8 @@
49835315 private MenuItem lookFromItem;
49845316 private MenuItem switchItem;
49855317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
49865320 private MenuItem duplicateItem;
49875321 private MenuItem cloneItem;
49885322 private MenuItem cloneSupportItem;
....@@ -4996,7 +5330,7 @@
49965330 private MenuItem linkverticesItem;
49975331 private MenuItem relinkverticesItem;
49985332 private MenuItem setMasterItem;
4999
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
50005334 private MenuItem stepAllItem;
50015335 private MenuItem revertMeshItem;
50025336 private MenuItem poseMeshItem;
....@@ -5007,6 +5341,7 @@
50075341 private MenuItem mergeGeometriesItem;
50085342 private MenuItem copyItem;
50095343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
50105345 private MenuItem pasteLinkItem;
50115346 private MenuItem pasteCloneItem;
50125347 private MenuItem pasteExpandItem;
....@@ -5045,6 +5380,10 @@
50455380 private MenuItem showleavesItem;
50465381 private MenuItem markleavesItem;
50475382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
50485387
50495388 private MenuItem flipVItem;
50505389 private MenuItem unflipVItem;
....@@ -5056,8 +5395,10 @@
50565395 private MenuItem panoTexturesItem;
50575396
50585397 private MenuItem resetCentroidItem;
5059
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
50605399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
50615402 private MenuItem hideItem;
50625403 private MenuItem grabItem;
50635404 private MenuItem backItem;
....@@ -5104,7 +5445,7 @@
51045445 private MenuItem blobItem;
51055446 private MenuItem latheItem;
51065447 private MenuItem bezierItem;
5107
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
51085449 private MenuItem meshItem;
51095450 // private MenuItem meshGroupItem;
51105451 private MenuItem springItem;
....@@ -5126,11 +5467,6 @@
51265467 private MenuItem doubleItem;
51275468 private MenuItem tripleItem;
51285469
5129
- private MenuItem importGFDItem;
5130
- private MenuItem importVRMLX3DItem;
5131
- private MenuItem import3DSItem;
5132
- private MenuItem importOBJItem;
5133
-
51345470 private MenuItem computeAOItem;
51355471 private MenuItem recompileItem;
51365472 private MenuItem editScriptItem;
....@@ -5140,4 +5476,8 @@
51405476 private MenuItem analyzeItem;
51415477 private MenuItem dumpItem;
51425478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
51435483 }