Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -59,6 +60,12 @@
5960 this.copy = this.group = group;
6061 //selectees = this.group.selectees;
6162
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6269 if(ui)
6370 SetupUI(objEditor);
6471 }
....@@ -73,16 +80,28 @@
7380 this.copy = this.group = copy;
7481 //selectees = this.group.selectees;
7582
76
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7784 SetupUI2(objEditor);
7885 objEditor.SetupUI(true);
7986 SetupViews(objEditor);
8087
8188 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
8297 }
8398
8499 void CloneSelection(boolean supports)
85100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
86105 // Object3D keep = GrafreeD.clipboard;
87106 //Object3D obj;
88107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +112,19 @@
93112
94113 makeSomething(clone, i==group.selection.size()-1);
95114 }
115
+ Globals.REPLACEONMAKE = keep;
96116 }
97117
98118 void CloneClipboard(boolean supports)
99119 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
120
+ assert(Grafreed.clipboard.parent == null);
121
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
122
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
123
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
124
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105125 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
126
+ makeSomething(CloneObject(Grafreed.clipboard, false));
127
+ Grafreed.clipboard.get(0).parent = keepparent;
108128 }
109129
110130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +138,7 @@
118138 // obj.support = null;
119139 if (!supports)
120140 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122142 obj.parent = parent;
123143 // obj.support = support;
124144 // clone.support = support; // aout 2013
....@@ -147,30 +167,29 @@
147167
148168 //JTextField nameField;
149169
150
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
151171 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
172
+ oe.jTree = new cTree();
173
+
163174 Menu menu;
164175 oe.menuBar.add(menu = new Menu("Edit"));
165176 //editItem = menu.add(new MenuItem("Edit"));
166177 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
178
+
179
+// undoItem = menu.add(new MenuItem("Undo"));
180
+// undoItem.addActionListener(this);
181
+// redoItem = menu.add(new MenuItem("Redo"));
182
+// redoItem.addActionListener(this);
183
+// menu.add("-");
184
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168185 duplicateItem.addActionListener(this);
169
- menu.add("-");
170186 cloneItem = menu.add(new MenuItem("Clone"));
171187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
172190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173191 cloneSupportItem.addActionListener(this);
192
+ }
174193 menu.add("-");
175194 cutItem = menu.add(new MenuItem("Cut"));
176195 cutItem.addActionListener(this);
....@@ -178,27 +197,123 @@
178197 copyItem.addActionListener(this);
179198 pasteItem = menu.add(new MenuItem("Paste"));
180199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
181204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182205 pasteLinkItem.addActionListener(this);
183206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184207 pasteCloneItem.addActionListener(this);
185208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186209 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
210
+ menu.add("-");
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
213
+
214
+ if (Globals.ADVANCED)
215
+ {
216
+ // Deletes the cameras...
189217 clearAllItem = menu.add(new MenuItem("Clear All"));
190218 clearAllItem.addActionListener(this);
219
+ }
220
+
221
+ menuBar.add(cameraMenu = new Menu("View"));
222
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
223
+ //zBufferItem.addActionListener(this);
224
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
225
+ //normalLensItem.addActionListener(this);
226
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
227
+ restoreCameraItem.addActionListener(this);
228
+
229
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
230
+// toggleFullScreenItem.addItemListener(this);
231
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
232
+// cameraMenu.add("-");
233
+//
234
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
235
+// toggleTextureItem.addItemListener(this);
236
+// toggleTextureItem.setState(CameraPane.textureon);
237
+//
238
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
239
+// toggleSwitchItem.addItemListener(this);
240
+// toggleSwitchItem.setState(CameraPane.SWITCH);
241
+
242
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
243
+ toggleHandleItem.addItemListener(this);
244
+ toggleHandleItem.setState(CameraPane.HANDLES);
245
+
246
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
247
+ togglePaintItem.addItemListener(this);
248
+ togglePaintItem.setState(CameraPane.PAINTMODE);
249
+
250
+ if (Globals.ADVANCED)
251
+ {
252
+ cameraMenu.add("-");
253
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
254
+ toggleLiveItem.addItemListener(this);
255
+ toggleLiveItem.setState(Globals.isLIVE());
191256
257
+ cameraMenu.add(stepItem = new MenuItem("Step"));
258
+ stepItem.addActionListener(this);
259
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
260
+ // toggleDLItem.addItemListener(this);
261
+ // toggleDLItem.setState(false);
262
+
263
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
264
+ toggleRenderItem.addItemListener(this);
265
+ toggleRenderItem.setState(!CameraPane.frozen);
266
+
267
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
268
+ toggleDebugItem.addItemListener(this);
269
+ toggleDebugItem.setState(Globals.DEBUG);
270
+
271
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
272
+ toggleFrustumItem.addItemListener(this);
273
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
274
+
275
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
276
+ toggleFootContactItem.addItemListener(this);
277
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
278
+
279
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
280
+ toggleTimelineItem.addItemListener(this);
281
+ }
282
+
283
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
284
+// toggleRootItem.addItemListener(this);
285
+// toggleRootItem.setState(false);
286
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
287
+// animationItem.addItemListener(this);
288
+// animationItem.setState(CameraPane.ANIMATION);
289
+ cameraMenu.add("-");
290
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
291
+ editCameraItem.addActionListener(this);
292
+
293
+ if (Globals.ADVANCED)
294
+ {
295
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
296
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
297
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
298
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
299
+ oe.cameraMenu.add("-");
300
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
301
+ openWindowItem.addActionListener(this);
302
+ editLeafItem.addActionListener(this);
303
+ lookAtItem.addActionListener(this);
304
+ //lookFromItem.addActinoListener(this);
305
+ //switchViewItem.addActionListener(this);
306
+ }
307
+
192308 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
309
+ if (Globals.ADVANCED)
310
+ {
197311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198312 revertMeshItem.addActionListener(this);
199313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200314 resetreferencesItem.addActionListener(this);
201315 menu.add("-");
316
+ }
202317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203318 overwriteGeoItem.addActionListener(this);
204319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +325,104 @@
210325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211326 overwriteUVItem.addActionListener(this);
212327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
213330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214331 generateMeshItem.addActionListener(this);
215332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216333 poseMeshItem.addActionListener(this);
217334 menu.add("-");
335
+ }
218336 resetsupportItem = menu.add(new MenuItem("Reset support"));
219337 resetsupportItem.addActionListener(this);
220338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221339 linkverticesItem.addActionListener(this);
222340 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223341 relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
224345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225346 setMasterItem.addActionListener(this);
347
+ }
226348
227349 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
230352 backItem = menu.add(new MenuItem("Back"));
231353 backItem.addActionListener(this);
232354 frontItem = menu.add(new MenuItem("Front"));
233355 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
361
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237362 hideItem.addActionListener(this);
363
+ }
238364 ungroupItem = menu.add(new MenuItem("Ungroup"));
239365 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
247373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248374 switchGeoItem.addActionListener(this);
249375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250376 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
252378 morphItem.addActionListener(this);
379
+
380
+ menu.add("-");
381
+ physicsItem = menu.add(new MenuItem("Physics"));
382
+ physicsItem.addActionListener(this);
383
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
384
+ frameselectorItem.addActionListener(this);
253385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254386 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
387
+ }
257388
258389 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
261392 billboardItem = menu.add(new MenuItem("Billboard"));
262393 billboardItem.addActionListener(this);
263394 csgItem = menu.add(new MenuItem("CSG"));
264395 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266397 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268399 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
271408 linkerItem = menu.add(new MenuItem("Linker"));
272409 linkerItem.addActionListener(this);
273410 templateItem = menu.add(new MenuItem("Template"));
274411 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277412 pointflowItem = menu.add(new MenuItem("Point Flow"));
278413 pointflowItem.addActionListener(this);
414
+ }
279415 menu.add("-");
280416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281417 resetTransformItem.addActionListener(this);
282418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283419 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
420
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
421
+ resetCentroidXZItem.addActionListener(this);
422
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
423
+ transformGeometryItem.addActionListener(this);
424
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
425
+ transformChildrenItem.addActionListener(this);
286426
287427 oe.menuBar.add(menu = new Menu("Geometry"));
288428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +433,11 @@
293433 genNormalsCADItem.addActionListener(this);
294434 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295435 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297439 genNormalsMINEItem.addActionListener(this);
440
+ }
298441 stripifyItem = menu.add(new MenuItem("Stripify"));
299442 stripifyItem.addActionListener(this);
300443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +459,34 @@
316459 reduce34MeshItem.addActionListener(this);
317460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318461 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
323470
324471 oe.menuBar.add(menu = new Menu("Attributes"));
325472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326473 clearMaterialsItem.addActionListener(this);
474
+ resetAllItem = menu.add(new MenuItem("Reset All"));
475
+ resetAllItem.addActionListener(this);
476
+ stepAllItem = menu.add(new MenuItem("Step All"));
477
+ stepAllItem.addActionListener(this);
327478 menu.add("-");
328479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329480 liveleavesItem.addActionListener(this);
330481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
332485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333486 supportleavesItem.addActionListener(this);
334487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335488 unsupportleavesItem.addActionListener(this);
489
+ }
336490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337491 hideleavesItem.addActionListener(this);
338492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +495,14 @@
341495 markleavesItem.addActionListener(this);
342496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343497 unmarkleavesItem.addActionListener(this);
498
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
499
+ rewindleavesItem.addActionListener(this);
500
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
501
+ unrewindleavesItem.addActionListener(this);
502
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
503
+ randomleavesItem.addActionListener(this);
504
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
505
+ unrandomleavesItem.addActionListener(this);
344506 menu.add("-");
345507 flipVItem = menu.add(new MenuItem("Flip V"));
346508 flipVItem.addActionListener(this);
....@@ -366,45 +528,56 @@
366528 attachBumpItem.addActionListener(this);
367529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
369532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370533 detachPigmentItem.addActionListener(this);
371534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372535 detachBumpItem.addActionListener(this);
536
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
537
+ embedTexturesItem.addActionListener(this);
538
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
539
+ deEmbedTexturesItem.addActionListener(this);
373540 menu.add("-");
374541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375542 sortbysizeItem.addActionListener(this);
376543 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377544 sortbynameItem.addActionListener(this);
378545 menu.add("-");
546
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
547
+ shareGeometriesItem.addActionListener(this);
548
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
549
+ mergeGeometriesItem.addActionListener(this);
550
+ if (Globals.ADVANCED)
551
+ {
552
+ // Pretty much the same as duplicate and clone.
379553 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380554 extractGeometriesItem.addActionListener(this);
381555 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382556 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
557
+ }
387558
388559 oe.menuBar.add(menu = new Menu("Insert"));
389560 buildCreateMenu(menu);
390561
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402562 oe.menuBar.add(menu = new Menu("Tools"));
403563 buildToolsMenu(menu);
404564 }
405565
566
+
406567 void SetupUI2(ObjEditor oe)
407568 {
569
+ // June 2019
570
+ if (oe == null)
571
+ {
572
+ //super.SetupUI2(this);
573
+ //return;
574
+ }
575
+
576
+ if (copy != group)
577
+ {
578
+ //super.SetupUI2(this);
579
+ }
580
+
408581 //new Exception().printStackTrace();
409582
410583 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +606,231 @@
433606 oe.radioPanel.add(dummyButton);
434607 oe.buttonGroup.add(dummyButton);
435608 */
436
- aConstraints.gridy += 1;
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
437612
438613 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439614
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
615
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ //minButton.setToolTipText("Minimize window");
617
+ //minButton.addActionListener(this);
442618
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
445
- liveCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ if (Globals.ADVANCED)
620
+ {
621
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ maxButton.setToolTipText("Maximize window");
623
+ maxButton.addActionListener(this);
624
+ }
625
+
626
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
627
+ fullButton.setToolTipText("Full-screen window");
628
+ fullButton.addActionListener(this);
629
+
630
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454631 screenfitButton.setToolTipText("Screen fit");
455632 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
633
+
634
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ restoreCameraButton.setToolTipText("Restore viewpoint");
636
+ restoreCameraButton.addActionListener(this);
637
+
638
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ saveButton.setToolTipText("New version");
640
+ saveButton.addActionListener(this);
641
+
642
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
+ undoButton.setToolTipText("Previous version");
644
+ undoButton.addActionListener(this);
645
+ undoButton.setEnabled(false);
646
+
647
+ cGridBag updown = new cGridBag().setVertical(true);
648
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ restoreButton.setToolTipText("Restore current");
650
+ restoreButton.addActionListener(this);
651
+ restoreButton.setEnabled(false);
652
+
653
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ replaceButton.setToolTipText("Replace current");
655
+ replaceButton.addActionListener(this);
656
+ replaceButton.setEnabled(false);
657
+
658
+ copyOptionsPanel.add(updown);
659
+
660
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ redoButton.setToolTipText("Next version");
662
+ redoButton.addActionListener(this);
663
+ redoButton.setEnabled(false);
664
+
665
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
666
+ liveCB.setToolTipText("Enable animation");
667
+ liveCB.addItemListener(this);
668
+
669
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oneStepButton.setToolTipText("Animate one step forward");
671
+ oneStepButton.addActionListener(this);
672
+
673
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
674
+ fastCB.setToolTipText("Fast mode");
675
+ fastCB.addItemListener(this);
676
+
677
+ //oe.toolboxPanel.Return();
678
+
679
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
680
+// trackCB.setToolTipText("Enable tracking");
681
+// trackCB.addItemListener(this);
682
+
457683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458684 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464685
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- flashSelectionButton.addActionListener(this);
473
-
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
482
- twoButton.setToolTipText("Show center view only");
483
- twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
686
+ if (Globals.ADVANCED)
687
+ {
688
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
+ snapobjectButton.addActionListener(this);
690
+ snapobjectButton.setToolTipText("Snap Object");
691
+
692
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485693 fourButton.addActionListener(this);
486
- fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
488
- sixButton.setToolTipText("2-column layout left");
489
- sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
491
- threeButton.setToolTipText("2-column layout right");
694
+ fourButton.setToolTipText("Show control panel only");
695
+ }
696
+
697
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
698
+
699
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ twoButton.setToolTipText("Show 3D view only");
701
+ twoButton.addActionListener(this);
702
+ this.fullscreenLayout = twoButton;
703
+
704
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ threeButton.setToolTipText("Show controls and 3D view");
492706 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
494
- sevenButton.setToolTipText("3-column layout");
495
- sevenButton.addActionListener(this);
707
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ sixButton.setToolTipText("Show 3D view and controls");
709
+ sixButton.addActionListener(this);
710
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+// sevenButton.setToolTipText("3-column layout");
712
+// sevenButton.addActionListener(this);
496713 //
497714
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
500717 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
718
+
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503720 closeButton.setToolTipText("Close tab");
504721 closeButton.addActionListener(this);
505722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506723 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515724
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
725
+ // INSERT
726
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ gridButton.setToolTipText("Create grid");
728
+ gridButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ boxButton.setToolTipText("Create box");
732
+ boxButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ sphereButton.setToolTipText("Create sphere");
736
+ sphereButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ coneButton.setToolTipText("Create cone");
740
+ coneButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ torusButton.setToolTipText("Create torus");
744
+ torusButton.addActionListener(this);
745
+
746
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
747
+ superButton.setToolTipText("Create superellipsoid");
748
+ superButton.addActionListener(this);
749
+
750
+ if (Globals.ADVANCED)
751
+ {
752
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ kleinButton.setToolTipText("Create Klein bottle");
754
+ kleinButton.addActionListener(this);
755
+ }
756
+
757
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ particlesButton.setToolTipText("Create particle system");
759
+ particlesButton.addActionListener(this);
760
+
761
+ oe.toolboxPanel.Return();
762
+
763
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ groupButton.setToolTipText("Create group");
765
+ groupButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ compositeButton.setToolTipText("Create composite");
769
+ compositeButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ switchButton.setToolTipText("Create item switcher");
773
+ switchButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ loopButton.setToolTipText("Create loop");
777
+ loopButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ textureButton.setToolTipText("Create texture");
781
+ textureButton.addActionListener(this);
782
+
783
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
784
+ overlayButton.setToolTipText("Create overlay");
785
+ overlayButton.addActionListener(this);
786
+
787
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
788
+ lightButton.setToolTipText("Create light");
789
+ lightButton.addActionListener(this);
790
+
791
+ for (int i=6; --i>=0;)
792
+ {
793
+ oe.toolboxPanel.Return();
794
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ oe.toolboxPanel.add(new cGridBag());
797
+ oe.toolboxPanel.add(new cGridBag());
798
+ oe.toolboxPanel.add(new cGridBag());
799
+ oe.toolboxPanel.add(new cGridBag());
800
+ oe.toolboxPanel.add(new cGridBag());
801
+ }
802
+
803
+ // EDIT panel
804
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ editButton.setToolTipText("Pin selection controls");
806
+ editButton.addActionListener(this);
807
+
808
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ uneditButton.setToolTipText("Remove selection controls");
517810 uneditButton.addActionListener(this);
518811
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
812
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
813
+ allParamsButton.setToolTipText("Show all controle");
531814 allParamsButton.addActionListener(this);
532815
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
816
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ clearPanelButton.setToolTipText("Clear edit panel");
818
+ clearPanelButton.addActionListener(this);
819
+
820
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
821
+ unselectButton.setToolTipText("Unselect");
538822 unselectButton.addActionListener(this);
539823
824
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
825
+ flashSelectionButton.setToolTipText("Highlight selection");
826
+ flashSelectionButton.addActionListener(this);
827
+
828
+ editCommandsPanel.preferredHeight = 1;
829
+
830
+ SetPinStates(false);
831
+// oe.treePanel.add(commandsPanel);
832
+// oe.treePanel.Return();
833
+
540834 // oe.aConstraints.gridx += 1;
541835 // oe.aConstraints.weighty = 0;
542836 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +842,25 @@
548842 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549843 // gcButton.addActionListener(this);
550844
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
845
+ cGridBag jSPPanel = new cGridBag();
846
+
847
+ JScrollPane jSP;
562848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564850 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
584851
852
+ oe.treePanel.add(jSPPanel);
853
+ oe.treePanel.Return();
854
+
855
+ oe.treePanel.add(copyOptionsPanel);
856
+ oe.treePanel.Return();
857
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
858
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
859
+ sliderPane.preferredHeight = 1;
860
+
861
+// mainPanel.setDividerLocation(0.5); //1.0);
862
+// mainPanel.setResizeWeight(0.5);
863
+
585864 //jList.addListSelectionListener(this);
586865 oe.jTree.addTreeSelectionListener(this);
587866 //jTree.setRootVisible(false);
....@@ -600,97 +879,160 @@
600879 dgr.addDragGestureListener(this);
601880 }catch(Exception e) {}
602881 */
603
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
604883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605884 }
606885
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
886
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608887 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
888
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
889
+ colorCB.setToolTipText("Copy color when dropped");
890
+ colorCB.addItemListener(this);
618891
619
- // constraints.gridy += 1;
892
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
893
+ materialCB.setToolTipText("Copy material when dropped");
894
+ materialCB.addItemListener(this);
895
+
896
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
897
+ textureCB.setToolTipText("Copy texture when dropped");
898
+ textureCB.addItemListener(this);
899
+
900
+ panel.Return();
901
+
902
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
903
+ boxCB.setToolTipText("Display bounding boxes");
904
+ boxCB.addItemListener(this);
905
+
906
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
907
+ zoomBoxCB.setToolTipText("Display only for wheel");
908
+ zoomBoxCB.addItemListener(this);
909
+
910
+ if (true) // Globals.ADVANCED)
911
+ {
912
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
913
+// supportCB.setToolTipText("Enable rigging");
914
+// supportCB.addItemListener(this);
915
+
916
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
917
+ freezeCB.setToolTipText("Fast moving camera");
918
+ freezeCB.addItemListener(this);
919
+
620920 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621921 // localCB.addItemListener(this);
622922
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
923
+ panel.Return();
924
+
925
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625926 crowdCB.setToolTipText("Used for crowds");
626927 crowdCB.addItemListener(this);
627928
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
929
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630930 smoothCB.setToolTipText("Snapping delay");
631931 smoothCB.addItemListener(this);
632932
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
933
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635934 slowCB.setToolTipText("Smooth interpolation");
636935 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
639
- boxCB.setToolTipText("Display bounding boxes");
640
- boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
- zoomBoxCB.addItemListener(this);
645
-
936
+
646937 // constraints.gridy += 1;
647938 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648939 // speakerMocapCB.addItemListener(this);
649940
941
+ panel.Return();
942
+
650943 if (false)
651944 {
652945 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
946
+ //constraints.gridy += 1;
947
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655948 speakerCameraCB.addItemListener(this);
656949
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
950
+ //constraints.gridy += 1;
951
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659952 speakerFocusCB.addItemListener(this);
660953
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
954
+ //constraints.gridy += 1;
955
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663956 smoothfocusCB.addItemListener(this);
957
+ panel.Return();
664958 }
665959
666960 //constraints.gridx += 1;
667961 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668962 // debugCB.addItemListener(this);
669963
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
964
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
965
+ trackCB.setToolTipText("Enable tracking target");
966
+ trackCB.addItemListener(this);
967
+
968
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
672970 oeilCB.addItemListener(this);
673971
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
972
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
973
+ shadowCB.setToolTipText("When live compute shadows");
974
+ shadowCB.addItemListener(this);
975
+
976
+ panel.Return();
977
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
978
+ toggleTextureCB.setToolTipText("Load textures");
979
+ toggleTextureCB.addItemListener(this);
980
+
981
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
982
+ toggleSwitchCB.setToolTipText("Choose a single item");
983
+ toggleSwitchCB.addItemListener(this);
984
+
985
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
986
+ autokeepCB.setToolTipText("On structure change");
987
+ autokeepCB.addItemListener(this);
988
+
989
+ panel.Return();
990
+ if (Globals.ADVANCED)
991
+ {
992
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676993 lookAtCB.setToolTipText("Look-at target");
677994 lookAtCB.addItemListener(this);
995
+ }
996
+
997
+ }
998
+
999
+ cGridBag fill = new cGridBag();
1000
+ fill.preferredHeight = 200;
1001
+ cGridBag fill2 = new cGridBag();
1002
+ fill2.preferredHeight = 200;
1003
+ cGridBag fill3 = new cGridBag();
1004
+ fill3.preferredHeight = 200;
1005
+
1006
+ panel.add(fill);
1007
+ panel.add(fill2);
1008
+ panel.add(fill3);
6781009
6791010 }
6801011
6811012 void EditObject(Object3D obj)
6821013 {
6831014 cRadio radioButton = new cRadio(obj.name);
1015
+
1016
+ // June 2019. Patch to avoid bug with transparency.
1017
+ radioButton.hadMaterial = obj.material != null;
1018
+ if (!radioButton.hadMaterial)
1019
+ {
1020
+ obj.material = new cMaterial();
1021
+ }
1022
+
6841023 radioButton.SetObject(obj);
685
- radioButton.layout = sevenButton;
1024
+ radioButton.layout = sixButton; // sevenButton;
6861025 radioButton.SetCamera(cameraView.renderCamera, false);
6871026 radioButton.addActionListener(this);
6881027 radioPanel.add(radioButton);
6891028 buttonGroup.add(radioButton);
6901029 radioButton.doClick();
6911030 }
1031
+
6921032 void SetupViews(ObjEditor oe)
6931033 {
1034
+ theFrame = this;
1035
+
6941036 oe.SetupViews();
6951037
6961038 System.out.println("SetupViews");
....@@ -699,23 +1041,28 @@
6991041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7001042 }
7011043
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- JCheckBox smoothfocusCB;
1044
+ cToggleButton liveCB;
1045
+ cCheckBox supportCB;
1046
+ cCheckBox localCB;
1047
+ cCheckBox crowdCB;
1048
+ cCheckBox smoothCB;
1049
+ cToggleButton fastCB;
1050
+ cCheckBox slowCB;
1051
+ cCheckBox boxCB;
1052
+ cCheckBox zoomBoxCB;
1053
+ cCheckBox freezeCB;
1054
+ //cToggleButton trackCB;
1055
+ cCheckBox trackCB;
1056
+ cCheckBox smoothfocusCB;
7131057 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
7191066
7201067 // static int COLOR = 1;
7211068 // static int MATERIAL = 2;
....@@ -723,9 +1070,9 @@
7231070
7241071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251072
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
7291076
7301077 public void itemStateChanged(ItemEvent e)
7311078 {
....@@ -753,6 +1100,7 @@
7531100 } else if(e.getSource() == liveCB)
7541101 {
7551102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7561104 }
7571105 else if(e.getSource() == supportCB)
7581106 {
....@@ -817,6 +1165,18 @@
8171165 {
8181166 cameraView.ToggleOeil();
8191167 }
1168
+ else if(e.getSource() == shadowCB)
1169
+ {
1170
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1171
+ }
1172
+ else if(e.getSource() == freezeCB)
1173
+ {
1174
+ Globals.FREEZEONMOVE ^= true;
1175
+ }
1176
+ else if(e.getSource() == autokeepCB)
1177
+ {
1178
+ Globals.REPLACEONMAKE ^= true;
1179
+ }
8201180 else if(e.getSource() == lookAtCB)
8211181 {
8221182 cameraView.ToggleLookAt();
....@@ -833,7 +1193,8 @@
8331193
8341194 /**/
8351195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
8371198 if ((path == null) || (path.getPathCount() <= 1)) {
8381199 // We can't move the root node or an empty selection
8391200 return;
....@@ -896,8 +1257,6 @@
8961257 }
8971258 }
8981259
899
- String string = (String) object;
900
-
9011260 System.out.println("Transfer = " + object + "; drop : " + target);
9021261 // if( object instanceof java.io.File[])
9031262 // {
....@@ -905,7 +1264,11 @@
9051264 // objEditor.DropFile((java.io.File[]) object, true);
9061265 // return;
9071266 // }
908
- if (string.charAt(0) == '/')
1267
+
1268
+ String string = object.toString();
1269
+
1270
+ // File path for Mac and Windows
1271
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091272 {
9101273 // file(s)
9111274 String[] names = string.split("\n");
....@@ -932,7 +1295,7 @@
9321295
9331296 flashIt = false;
9341297 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371300
9381301 if (group.selection.size() == 1)
....@@ -948,23 +1311,33 @@
9481311
9491312 assert target == objEditor.jTree;
9501313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9511315 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531317 } catch (Exception e) {
9541318 System.out.println("destinationPath : " + destinationPath);
9551319 return;
9561320 }
9571321
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9591323 {
1324
+ Object3D child = (Object3D)group.selection.elementAt(i);
1325
+
1326
+ // Cannot move into itself
1327
+ if (child == destinationLeaf)
1328
+ return;
1329
+ }
1330
+
1331
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1332
+// {
9601333 loadClipboard(true);
9611334 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9681341 }
9691342 public void dropActionChanged(DropTargetDragEvent dtde)
9701343 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1442,107 @@
10691442 {
10701443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711444 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.addActionListener(this);
1445
+// gridItem = menu.add(new MenuItem("Grid"));
1446
+// gridItem.addActionListener(this);
1447
+// rectoidItem = menu.add(new MenuItem("Box"));
1448
+// rectoidItem.addActionListener(this);
1449
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1450
+// ellipsoidItem.addActionListener(this);
1451
+// coneItem = menu.add(new MenuItem("Cone"));
1452
+// coneItem.addActionListener(this);
1453
+// torusItem = menu.add(new MenuItem("Torus"));
1454
+// torusItem.addActionListener(this);
1455
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1456
+// superItem.addActionListener(this);
1457
+
1458
+ cameraItem = menu.add(new MenuItem("Camera"));
1459
+ cameraItem.addActionListener(this);
1460
+
1461
+ if (!Globals.ADVANCED)
1462
+ {
10841463 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851464 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10881471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891472 ragdollItem.addActionListener(this);
10901473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911474 ragdoll2Item.addActionListener(this);
1475
+ }
10921476 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941478 meshItem.addActionListener(this);
10951479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10971483 springItem = menu.add(new MenuItem("Spring"));
10981484 springItem.addActionListener(this);
10991485 flagItem = menu.add(new MenuItem("Flag"));
11001486 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051487 blobItem = menu.add(new MenuItem("Blob"));
11061488 blobItem.addActionListener(this);
11071489 latheItem = menu.add(new MenuItem("Lathe"));
11081490 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- lightItem.addActionListener(this);
1491
+ }
1492
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1493
+ bezierItem.addActionListener(this);
1494
+// overlayItem = menu.add(new MenuItem("Overlay"));
1495
+// overlayItem.addActionListener(this);
1496
+// lightItem = menu.add(new MenuItem("Light"));
1497
+// lightItem.addActionListener(this);
11111498 menu.add("-");
11121499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131500 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
11161503 doubleItem = menu.add(new MenuItem("Fork"));
11171504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
11181507 tripleItem = menu.add(new MenuItem("Trident"));
11191508 tripleItem.addActionListener(this);
1509
+ }
11201510 }
11211511
11221512 void buildToolsMenu(Menu menu)
11231513 {
11241514 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251515 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1516
+ animationItem.setState(Globals.ANIMATION);
1517
+
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
11271520
11281521 menu.add("-");
11291522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301523 parseverticesItem.addActionListener(this);
11311524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321525 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341527 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381529 reduceMorphItem.addActionListener(this);
11391530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401531 reduce34MorphItem.addActionListener(this);
1141
-
1142
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1143
- computeAOItem.addActionListener(this);
11441532 menu.add("-");
1145
-
11461533 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471534 memoryItem.addActionListener(this);
1535
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1536
+ computeAOItem.addActionListener(this);
1537
+
1538
+ if (Globals.ADVANCED)
1539
+ {
1540
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1541
+ mirrorItem.addActionListener(this);
1542
+ menu.add("-");
11481543 menu.add(analyzeItem = new MenuItem("Analyze"));
11491544 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11511546 dumpItem.addActionListener(this);
11521547 // menu.add(pathItem = new MenuItem("From-to path"));
11531548 // pathItem.addActionListener(this);
....@@ -1165,6 +1560,7 @@
11651560 menu.add("-");
11661561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671562 editScriptItem.addActionListener(this);
1563
+ }
11681564 }
11691565
11701566 void ScreenFit()
....@@ -1287,9 +1683,34 @@
12871683 shadow.material = new cMaterial(obj.material);
12881684 shadow.material.diffuse = 0.0001f;
12891685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12901687
12911688 makeSomething(shadow);
12921689 }
1690
+
1691
+ private void ClearUnpinned()
1692
+ {
1693
+ //for (Object3D obj : listUI)
1694
+ for (int i=listUI.size(); --i>=0;)
1695
+ {
1696
+ Object3D obj = listUI.elementAt(i);
1697
+ if (!obj.pinned)
1698
+ {
1699
+ obj.CloseUI();
1700
+ listUI.remove(i);
1701
+ }
1702
+ }
1703
+ }
1704
+
1705
+ private void EditElement(Object3D elem, boolean newWindow)
1706
+ {
1707
+ // if (!(elem instanceof Composite))
1708
+ // newWindow = false;
1709
+ listUI.add(elem);
1710
+ elem.openEditWindow(this, newWindow); //, false);
1711
+ System.out.println("edit : " + elem);
1712
+ elem.editWindow.refreshContents(true); // ? new
1713
+ }
12931714
12941715 /**
12951716 * applyExample
....@@ -1493,9 +1914,9 @@
14931914
14941915 void Overwrite(int mask)
14951916 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971918 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
14991920
15001921 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011922 content = ((cGroup)content).get(0);
....@@ -1534,7 +1955,7 @@
15341955 {
15351956 ScreenFit();
15361957 } else
1537
- if (source == switchItem)
1958
+ if (source == switchViewItem)
15381959 {
15391960 cVector v1 = new cVector();
15401961 cVector v2 = new cVector();
....@@ -1543,11 +1964,11 @@
15431964 objEditor.cameraView.renderCamera.setAim(v2, v1);
15441965 objEditor.cameraView.repaint();
15451966 } else
1546
- if (source == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
15471968 {
15481969 makeSomething(new Box());
15491970 } else
1550
- if (source == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
15511972 {
15521973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15531974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1626,27 +2047,27 @@
16262047
16272048 makeSomething(obj);
16282049 } else
1629
- if (source == gridItem)
2050
+ if (source == gridItem || source == gridButton)
16302051 {
16312052 makeSomething(new Grid());
16322053 } else
1633
- if (source == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
16342055 {
16352056 makeSomething(new Sphere());
16362057 } else
1637
- if (source == coneItem)
2058
+ if (source == coneItem || source == coneButton)
16382059 {
16392060 makeSomething(new Cone());
16402061 } else
1641
- if (source == torusItem)
2062
+ if (source == torusItem || source == torusButton)
16422063 {
16432064 makeSomething(new Torus());
16442065 } else
1645
- if (source == superItem)
2066
+ if (source == superItem || source == superButton)
16462067 {
16472068 makeSomething(new Superellipsoid());
16482069 } else
1649
- if (source == kleinItem)
2070
+ if (source == kleinItem || source == kleinButton)
16502071 {
16512072 makeSomething(new Klein());
16522073 } else
....@@ -1666,7 +2087,7 @@
16662087 {
16672088 makeSomething(new BezierSurface());
16682089 } else
1669
- if (source == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16702091 {
16712092 /*
16722093 Object3D obj = new BezierSurface(5,8);
....@@ -1714,7 +2135,7 @@
17142135 s.setup();
17152136 makeSomething(s);
17162137 } else
1717
- if (source == lightItem)
2138
+ if (source == lightItem || source == lightButton)
17182139 {
17192140 makeSomething(new Light());
17202141 } else
....@@ -1764,30 +2185,30 @@
17642185
17652186 group(g);
17662187 } else
1767
- if (source == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17682189 {
17692190 Composite csg = new GroupLeaf();
17702191 csg.count = 5;
17712192 group(csg);
1772
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17732194 csg.addChild(child);
17742195 child.addChild(csg);
17752196 } else
17762197 if (source == doubleItem)
17772198 {
1778
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17792200 csg.count = 5;
17802201 group(csg);
1781
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17822203 csg.addChild(child);
17832204 child.addChild(csg);
1784
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17852206 csg.addChild(child);
17862207 child.addChild(csg);
17872208 } else
17882209 if (source == tripleItem)
17892210 {
1790
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17912212 csg.count = 4;
17922213 group(csg);
17932214 Composite child = new cGroup();
....@@ -1799,23 +2220,6 @@
17992220 child = new cGroup();
18002221 csg.addChild(child);
18012222 child.addChild(csg);
1802
- } else
1803
-
1804
- if (source == importGFDItem)
1805
- {
1806
- ImportGFD();
1807
- } else
1808
- if (source == importVRMLX3DItem)
1809
- {
1810
- ImportVRMLX3D();
1811
- } else
1812
- if (source == import3DSItem)
1813
- {
1814
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1815
- } else
1816
- if (source == importOBJItem)
1817
- {
1818
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18192223 } else
18202224 if (source == computeAOItem)
18212225 {
....@@ -1835,7 +2239,7 @@
18352239 if (source == invariantsItem)
18362240 {
18372241 System.out.println("Invariants:");
1838
- GrafreeD.grafreeD.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
18392243 } else
18402244 if (source == memoryItem)
18412245 {
....@@ -1854,19 +2258,61 @@
18542258 {
18552259 DumpObject();
18562260 } else
2261
+ if (source == minButton)
2262
+ {
2263
+ Minimize();
2264
+ } else
2265
+ if (source == maxButton)
2266
+ {
2267
+ Maximize();
2268
+ } else
2269
+ if (source == fullButton)
2270
+ {
2271
+ ToggleFullScreen();
2272
+ } else
2273
+ if (source == undoButton)
2274
+ {
2275
+ // Go to previous version
2276
+ //if (!Undo())
2277
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2278
+ Undo();
2279
+ } else
2280
+ if (source == restoreButton)
2281
+ {
2282
+ // Restore current version
2283
+ Restore();
2284
+ } else
2285
+ if (source == replaceButton)
2286
+ {
2287
+ // Overwrite current version
2288
+ Replace();
2289
+ } else
2290
+ if (source == redoButton)
2291
+ {
2292
+ // Go to next version
2293
+ Redo();
2294
+ } else
2295
+ if (source == saveButton)
2296
+ {
2297
+ // Save a new version
2298
+ if (!Save(true))
2299
+ java.awt.Toolkit.getDefaultToolkit().beep();
2300
+ } else
2301
+ if (source == oneStepButton)
2302
+ {
2303
+ Globals.ONESTEP = true;
2304
+ cameraView.repaint();
2305
+ } else
18572306 if (source == screenfitButton)
18582307 {
1859
- //Reload(lastConverter, lastFilename, true);
18602308 ScreenFit();
18612309 } else
18622310 if (source == screenfitpointButton)
18632311 {
1864
- //Reload(lastConverter, lastFilename, true);
18652312 ScreenFitPoint();
18662313 } else
18672314 if (source == snapobjectButton)
18682315 {
1869
- //Reload(lastConverter, lastFilename, true);
18702316 SnapObject();
18712317 } else
18722318 // if (event.getSource() == recompileButton)
....@@ -1903,12 +2349,20 @@
19032349 {
19042350 loadClipboard(true);
19052351 } else
2352
+ if (source == undoItem)
2353
+ {
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
19062360 if (source == duplicateItem)
19072361 {
1908
- Object3D keep = GrafreeD.clipboard;
2362
+ Object3D keep = Grafreed.clipboard;
19092363 loadClipboard(false);
19102364 paste(false);
1911
- GrafreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
19122366 } else
19132367 if (source == cloneItem)
19142368 {
....@@ -1926,13 +2380,17 @@
19262380 {
19272381 paste(false);
19282382 } else
2383
+ if (source == pasteIntoItem)
2384
+ {
2385
+ pasteInto(true, false);
2386
+ } else
19292387 if (source == pasteLinkItem)
19302388 {
1931
- pasteInto(false);
2389
+ pasteInto(false, false);
19322390 } else
19332391 if (source == pasteCloneItem)
19342392 {
1935
- pasteInto(true);
2393
+ pasteInto(true, true);
19362394 } else
19372395 if (source == pasteExpandItem)
19382396 {
....@@ -2124,9 +2582,9 @@
21242582 // group.selection.get(0).setMasterThis(content); // should be identity
21252583 // refreshContents();
21262584 // }
2127
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21282586 {
2129
- Object3D content = GrafreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
21302588
21312589 if (content instanceof cGroup && ((cGroup)content).transientlink )
21322590 content = ((cGroup)content).get(0);
....@@ -2134,11 +2592,11 @@
21342592 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352593 for (int i=0; i<group.selection.size(); i++)
21362594 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
21392597 group.selection.get(i).linkVerticesThis(content);
21402598 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
21422600 }
21432601 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442602 refreshContents();
....@@ -2148,20 +2606,20 @@
21482606 {
21492607 for (int i=0; i<group.selection.size(); i++)
21502608 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
21532611 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
21552613 }
21562614
21572615 refreshContents();
21582616 } else
21592617 if (source == relinkverticesItem)
21602618 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
21632621 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2622
+ CameraPane.SWITCH = random;
21652623
21662624 refreshContents();
21672625 } else
....@@ -2176,9 +2634,9 @@
21762634 } else
21772635 if (source == setMasterItem)
21782636 {
2179
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21802638 {
2181
- Object3D content = GrafreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21822640
21832641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21842642 content = ((cGroup)content).get(0);
....@@ -2191,9 +2649,9 @@
21912649 {
21922650 if (group.selection.size() == 1)
21932651 {
2194
- if (GrafreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21952653 {
2196
- Object3D content = GrafreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21972655
21982656 if (content instanceof cGroup && ((cGroup)content).transientlink )
21992657 content = ((cGroup)content).get(0);
....@@ -2210,7 +2668,7 @@
22102668 {
22112669 RevertMeshes();
22122670 } else
2213
- if (source == resetMeshItem)
2671
+ if (source == resetAllItem)
22142672 {
22152673 ResetAll();
22162674 } else
....@@ -2218,7 +2676,7 @@
22182676 {
22192677 StepAll();
22202678 } else
2221
- if (source == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
22222680 {
22232681 //int indices[] = jList.getSelectedIndices();
22242682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2230,9 +2688,9 @@
22302688 {
22312689 ClearSelection(true);
22322690 } else
2233
- if (source == grabItem)
2691
+ if (source == grabItem || source == groupButton)
22342692 {
2235
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
22362694 } else
22372695 if (source == hideItem)
22382696 {
....@@ -2250,16 +2708,16 @@
22502708 {
22512709 makeSomething(new Camera());
22522710 } else
2253
- if (source == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
22542712 {
22552713 group(new Composite());
22562714 } else
2257
- if (source == randomItem)
2715
+ if (source == switchItem || source == switchButton)
22582716 {
22592717 RandomNode random = new RandomNode();
22602718 group(random);
22612719 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
22632721 } else
22642722 if (source == physicsItem)
22652723 {
....@@ -2356,7 +2814,7 @@
23562814 {
23572815 group(new cLinker());
23582816 } else
2359
- if (source == textureItem)
2817
+ if (source == textureItem || source == textureButton)
23602818 {
23612819 group(new TextureNode());
23622820 } else
....@@ -2376,17 +2834,30 @@
23762834 {
23772835 CastShadow(2);
23782836 } else
2379
- if (source == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
23802838 {
2381
- //ungroup();
2839
+ boolean hasRoot = false;
2840
+
23822841 for (int i=0; i<group.selection.size(); i++)
23832842 {
2384
- Ungroup(group.selection.get(i));
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
23852848 }
23862849
2387
- ClearSelection(false);
2388
-
2389
- refreshContents();
2850
+ if (!hasRoot)
2851
+ {
2852
+ for (int i=0; i<group.selection.size(); i++)
2853
+ {
2854
+ Ungroup(group.selection.get(i));
2855
+ }
2856
+
2857
+ ClearSelection(false);
2858
+
2859
+ refreshContents();
2860
+ }
23902861 } else
23912862 if (source == genUVItem)
23922863 {
....@@ -2398,7 +2869,7 @@
23982869 } else
23992870 if (source == genNormalsMESHItem)
24002871 {
2401
- GenNormals(true); // TODO
2872
+ GenNormalsMESH();
24022873 } else
24032874 if (source == genNormalsORGANItem)
24042875 {
....@@ -2463,6 +2934,22 @@
24632934 if (source == unmarkleavesItem)
24642935 {
24652936 MarkLeaves(false);
2937
+ } else
2938
+ if (source == rewindleavesItem)
2939
+ {
2940
+ RewindLeaves(true);
2941
+ } else
2942
+ if (source == unrewindleavesItem)
2943
+ {
2944
+ RewindLeaves(false);
2945
+ } else
2946
+ if (source == randomleavesItem)
2947
+ {
2948
+ RandomLeaves(true);
2949
+ } else
2950
+ if (source == unrandomleavesItem)
2951
+ {
2952
+ RandomLeaves(false);
24662953 } else
24672954 if (source == flipVItem)
24682955 {
....@@ -2548,9 +3035,13 @@
25483035 {
25493036 SmoothMesh();
25503037 } else
2551
- if (source == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
25523039 {
25533040 TransformGeometry();
3041
+ } else
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
25543045 } else
25553046 if (source == resetTransformItem)
25563047 {
....@@ -2558,7 +3049,11 @@
25583049 } else
25593050 if (source == resetCentroidItem)
25603051 {
2561
- ResetCentroid();
3052
+ ResetCentroid(true);
3053
+ } else
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
25623057 } else
25633058 if (source == resetParentItem)
25643059 {
....@@ -2663,7 +3158,7 @@
26633158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26643159 {
26653160 obj = (Object3D)e.nextElement();
2666
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
26673162 }
26683163
26693164 refreshContents();
....@@ -2679,6 +3174,31 @@
26793174
26803175 refreshContents();
26813176 } else
3177
+ if (source == embedTexturesItem)
3178
+ {
3179
+ Object3D obj;
3180
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3181
+ {
3182
+ obj = (Object3D)e.nextElement();
3183
+ obj.EmbedTextures(true);
3184
+ }
3185
+
3186
+ refreshContents();
3187
+ } else
3188
+ if (source == deEmbedTexturesItem)
3189
+ {
3190
+ Object3D obj;
3191
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3192
+ {
3193
+ obj = (Object3D)e.nextElement();
3194
+ obj.EmbedTextures(false);
3195
+ }
3196
+
3197
+ CameraPane.texturepigment.clear();
3198
+ CameraPane.texturebump.clear();
3199
+
3200
+ refreshContents();
3201
+ } else
26823202 if (source == flashSelectionButton)
26833203 {
26843204 CameraPane.flash = true;
....@@ -2690,6 +3210,10 @@
26903210 if (source == twoButton)
26913211 {
26923212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
26933217 // bug
26943218 //gridPanel.setDividerLocation(1.0);
26953219 //bigPanel.setDividerLocation(0.0);
....@@ -2720,12 +3244,33 @@
27203244 // centralPanel.setVisible(true);
27213245 // XYZPanel.setVisible(false);
27223246 bigThree.ClearUI();
2723
- bigThree.addComponent(centralPanel);
3247
+ bigThree.add(centralPanel);
27243248 bigThree.FlushUI();
3249
+
3250
+ cameraView.requestFocusInWindow();
3251
+
3252
+// refreshContents(true);
3253
+//
3254
+// try
3255
+// {
3256
+// java.awt.Robot bot = new java.awt.Robot();
3257
+// int mask = InputEvent.BUTTON1_MASK;
3258
+// bot.mouseMove(100, 100);
3259
+// bot.mousePress(mask);
3260
+// bot.mouseRelease(mask);
3261
+// }
3262
+// catch (Exception e)
3263
+// {
3264
+//
3265
+// }
3266
+
27253267 } else
27263268 if (source == threeButton)
27273269 {
27283270 radio.layout = threeButton;
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
27293274
27303275 // bigThree.remove(scenePanel);
27313276 // bigThree.remove(centralPanel);
....@@ -2755,13 +3300,18 @@
27553300 // centralPanel.setVisible(true);
27563301 // XYZPanel.setVisible(true);
27573302 bigThree.ClearUI();
2758
- bigThree.addComponent(centralPanel);
2759
- bigThree.addComponent(XYZPanel);
3303
+ bigThree.add(scenePanel);
3304
+ bigThree.add(centralPanel);
27603305 bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
27613308 } else
27623309 if (source == fourButton)
27633310 {
27643311 radio.layout = fourButton;
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
27653315
27663316 // bigThree.remove(scenePanel);
27673317 // bigThree.remove(centralPanel);
....@@ -2791,12 +3341,17 @@
27913341 // centralPanel.setVisible(false);
27923342 // XYZPanel.setVisible(false);
27933343 bigThree.ClearUI();
2794
- bigThree.addComponent(scenePanel);
3344
+ bigThree.add(scenePanel);
27953345 bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
27963348 } else
27973349 if (source == sixButton)
27983350 {
27993351 radio.layout = sixButton;
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
28003355
28013356 // bigThree.remove(scenePanel);
28023357 // bigThree.remove(centralPanel);
....@@ -2826,13 +3381,18 @@
28263381 // centralPanel.setVisible(true);
28273382 // XYZPanel.setVisible(false);
28283383 bigThree.ClearUI();
2829
- bigThree.addComponent(scenePanel);
2830
- bigThree.addComponent(centralPanel);
3384
+ bigThree.add(centralPanel);
3385
+ bigThree.add(scenePanel);
28313386 bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
28323389 } else
28333390 if (source == sevenButton)
28343391 {
28353392 radio.layout = sevenButton;
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
28363396
28373397 // bigThree.remove(scenePanel);
28383398 // bigThree.remove(centralPanel);
....@@ -2862,10 +3422,12 @@
28623422 // centralPanel.setVisible(true);
28633423 // XYZPanel.setVisible(true);
28643424 bigThree.ClearUI();
2865
- bigThree.addComponent(scenePanel);
2866
- bigThree.addComponent(centralPanel);
2867
- bigThree.addComponent(XYZPanel);
3425
+ bigThree.add(scenePanel);
3426
+ bigThree.add(centralPanel);
3427
+ bigThree.add(XYZPanel);
28683428 bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
28693431 } else
28703432 if (source == rootButton)
28713433 {
....@@ -2877,6 +3439,7 @@
28773439 EditObject(obj);
28783440 }
28793441
3442
+ cameraView.requestFocusInWindow();
28803443 refreshContents(true);
28813444 } else
28823445 if (source == closeButton)
....@@ -2886,22 +3449,37 @@
28863449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28873450 {
28883451 ab = (cRadio)e.nextElement();
2889
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28903453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
28913460 buttonGroup.remove(ab);
28923461 radioPanel.remove(ab);
28933462
2894
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
28953465 // ab.GetObject().objectUI = null; // ?????????
28963466
28973467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28983468 break;
28993469 }
29003470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
29013473 refreshContents(true);
29023474 } else
29033475 if (source == editItem || source == editButton)
29043476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
29053483 EditSelection(false);
29063484 } else
29073485 if (source == uneditButton)
....@@ -2911,12 +3489,13 @@
29113489 Object3D child = (Object3D)e.nextElement();
29123490 if(child.editWindow != null)
29133491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
29143493 child.CloseUI();
29153494 listUI.remove(child);
29163495
2917
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
29183497 }
2919
- objEditor.ctrlPanel.revalidate();
3498
+ objEditor.ctrlPanel.FlushUI();
29203499 //objEditor.jTree.clearSelection();
29213500 //objEditor.ResetSliders();
29223501 refreshContents(true);
....@@ -2927,6 +3506,7 @@
29273506 //copy.ClearUI();
29283507 for (Object3D obj : listUI)
29293508 {
3509
+ obj.pinned = false;
29303510 obj.CloseUI();
29313511 }
29323512 listUI.clear();
....@@ -2936,7 +3516,7 @@
29363516 {
29373517 assert(copy == group);
29383518
2939
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29403520
29413521 for (Object3D obj : listUI)
29423522 {
....@@ -2985,6 +3565,9 @@
29853565 }
29863566
29873567 copy = group;
3568
+
3569
+ SetUndoStates();
3570
+
29883571 //Globals.theRenderer.object = group;
29893572 if(!useclient)
29903573 {
....@@ -3000,20 +3583,46 @@
30003583 frontView.object = group;
30013584 sideView.object = group;
30023585 }
3003
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
30043591 /*
30053592 currentLayout = radio.layout;
30063593 if (currentLayout == null)
30073594 currentLayout = sevenButton;
30083595 */
30093596 radio.layout.doClick();
3597
+
3598
+ ClearUnpinned();
3599
+ //Grafreed.Assert(group != null);
3600
+ //Grafreed.Assert(group.selection != null);
3601
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3602
+ if (group.selection == null || group.selection.size() == 1)
3603
+ EditSelection(false);
30103604 keepparent = group.parent;
30113605 // PARENT = NULL or not???
30123606 //group.parent = null; // ROOT
30133607 //group.attributes = -1;
30143608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
30153611 refreshContents(true);
3016
- }
3612
+ } else if (event.getSource() == editCameraItem)
3613
+ {
3614
+ cameraView.ProtectCamera();
3615
+ cameraView.repaint();
3616
+ return;
3617
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3618
+ {
3619
+ cameraView.RevertCamera();
3620
+ cameraView.repaint();
3621
+ return;
3622
+ // } else if (event.getSource() == textureButton)
3623
+ // {
3624
+ // return; // true;
3625
+ }
30173626 else
30183627 {
30193628 //return super.action(event, arg);
....@@ -3022,7 +3631,6 @@
30223631 }
30233632
30243633 boolean useclient = false;
3025
- cRadio radio;
30263634
30273635 void ToggleRoot()
30283636 {
....@@ -3074,6 +3682,28 @@
30743682 refreshContents();
30753683 }
30763684
3685
+ void TransformChildren()
3686
+ {
3687
+ Object3D obj;
3688
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3689
+ {
3690
+ obj = (Object3D)e.nextElement();
3691
+ obj.KeepTextureMatrices();
3692
+ obj.TransformChildren();
3693
+ obj.RestoreTextureMatrices();
3694
+
3695
+// if (obj.parent == null)
3696
+// {
3697
+// System.out.println("NULL PARENT!");
3698
+// new Exception().printStackTrace();
3699
+// }
3700
+// else
3701
+// TouchTransform(obj);
3702
+// //obj.parent.Touch();
3703
+ }
3704
+
3705
+ refreshContents();
3706
+ }
30773707
30783708 void ResetTransform()
30793709 {
....@@ -3186,7 +3816,7 @@
31863816 refreshContents();
31873817 }
31883818
3189
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
31903820 {
31913821 Object3D obj;
31923822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3201,12 +3831,16 @@
32013831 LA.matIdentity(Object3D.mat);
32023832 obj.getBounds(minima, maxima, false);
32033833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3204
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32053836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32063837 obj.TransformMesh(Object3D.mat);
3838
+
32073839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3208
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32093842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
32103844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32113845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32123846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3235,7 +3869,8 @@
32353869
32363870 int size = obj.MemorySize();
32373871
3238
- System.err.println((size/1024) + " KB is the size of " + obj);
3872
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3873
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32393874 }
32403875 }
32413876 catch (Exception e)
....@@ -3272,9 +3907,9 @@
32723907 obj = (Object3D)e.nextElement();
32733908
32743909 System.out.println("Object is: " + obj);
3275
- GrafreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
32763911 System.out.println("Boundary rep: " + obj.bRep);
3277
- GrafreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
32783913
32793914 // System.err.println((size/1024) + " KB is the size of " + obj);
32803915 }
....@@ -3316,6 +3951,13 @@
33163951 void GenNormals(boolean crease)
33173952 {
33183953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
33193961
33203962 refreshContents();
33213963 }
....@@ -3488,8 +4130,8 @@
34884130
34894131 void ParseVertices()
34904132 {
3491
- boolean epsequal = GrafreeD.epsequal;
3492
- GrafreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
34934135
34944136 for (int i=0; i<group.selection.size(); i++)
34954137 {
....@@ -3514,7 +4156,7 @@
35144156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35154157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35164158
3517
- g.add(GrafreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
35184160
35194161 buffer.add(g);
35204162 }
....@@ -3529,7 +4171,7 @@
35294171 makeSomething(buffer, i==group.selection.size()-1);
35304172 }
35314173
3532
- GrafreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
35334175
35344176 refreshContents();
35354177 }
....@@ -3547,7 +4189,16 @@
35474189 String pigment = Object3D.GetPigment(tex);
35484190 //String bump = Object3D.GetBump(tex);
35494191
3550
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4192
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4193
+
4194
+ try
4195
+ {
4196
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4197
+ }
4198
+ catch (Exception e)
4199
+ {
4200
+ System.err.println("FAIL: " + node);
4201
+ }
35514202
35524203 double s = v.s;
35534204
....@@ -3635,11 +4286,11 @@
36354286
36364287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36374288
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
36404291 lowres.linkVerticesThis(null);
36414292 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
36434294
36444295 System.err.flush();
36454296
....@@ -3679,7 +4330,7 @@
36794330 return;
36804331
36814332 Object3D poses = group.selection.get(0);
3682
- Object3D ref = GrafreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
36834334
36844335 Object3D newgroup = new Object3D("Po:" + poses.name);
36854336
....@@ -3873,9 +4524,9 @@
38734524
38744525 void ClipMesh()
38754526 {
3876
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38774528 {
3878
- Object3D content = GrafreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
38794530
38804531 if (content instanceof cGroup && ((cGroup)content).transientlink )
38814532 content = ((cGroup)content).get(0);
....@@ -3884,7 +4535,7 @@
38844535 // {
38854536 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38864537 // }
3887
- group.selection.ClipMesh(GrafreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
38884539 }
38894540 // group.selection.ClipMesh(GrafreeD.clipboard);
38904541 System.out.println("DONE.");
....@@ -3931,6 +4582,18 @@
39314582 void MarkLeaves(boolean hide)
39324583 {
39334584 group.selection.MarkLeaves(hide);
4585
+ refreshContents();
4586
+ }
4587
+
4588
+ void RewindLeaves(boolean hide)
4589
+ {
4590
+ group.selection.RewindLeaves(hide);
4591
+ refreshContents();
4592
+ }
4593
+
4594
+ void RandomLeaves(boolean hide)
4595
+ {
4596
+ group.selection.RandomLeaves(hide);
39344597 refreshContents();
39354598 }
39364599
....@@ -4005,28 +4668,25 @@
40054668 // }
40064669 // }
40074670
4008
- static boolean allparams = true;
4009
-
4010
- static Vector<Object3D> listUI = new Vector<Object3D>();
4011
-
40124671 void EditSelection(boolean newWindow)
40134672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
40144679 // aConstraints.gridy = 0;
40154680 for (int i=0; i<group.selection.size(); i++)
40164681 {
40174682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40184683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4019
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40204685
40214686 Object3D elem = (Object3D)group.selection.elementAt(i);
4022
- if(elem != group)
4687
+ if(elem != group || !newWindow)
40234688 {
4024
- // if (!(elem instanceof Composite))
4025
- // newWindow = false;
4026
- listUI.add(elem);
4027
- elem.openEditWindow(this, newWindow); //, false);
4028
- System.out.println("edit : " + elem);
4029
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
40304690 }
40314691 }
40324692 }
....@@ -4101,7 +4761,8 @@
41014761 //new Exception().printStackTrace();
41024762
41034763 freezemodel = true;
4104
-
4764
+ ClearUnpinned();
4765
+
41054766 /**/
41064767 //switch (event.id)
41074768 {
....@@ -4109,7 +4770,6 @@
41094770 //case 702: // Event.LIST_DESELECT
41104771 group.deselectAll();
41114772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4112
- objEditor.ClearInfo(); // .GetMaterial());
41134773 if (tps != null)
41144774 {
41154775 for (int i=0; i < tps.length; i++)
....@@ -4118,33 +4778,39 @@
41184778
41194779 //if (child.parent != null)
41204780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
41214782 group.addSelectee(child);
4122
- objEditor.SetMaterial(child); // .GetMaterial());
4123
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4124
- System.err.println("info : " + child.GetPath());
41254783 }
41264784 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4785
+// else
4786
+// {
4787
+// objEditor.SetMaterial(group); // .GetMaterial());
4788
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4789
+// System.err.println("info : " + group.GetPath());
4790
+// }
41334791
4134
- objEditor.SetText(); // jan 2014
4135
-
4136
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4792
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41374793 CameraPane.flash = true;
41384794
4139
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41404796 // a camera
41414797 {
4142
- CameraPane.camerachangeframe = 0; // don't refuse it
4143
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4798
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4799
+ {
4800
+ CameraPane.camerachangeframe = 0; // don't refuse it
4801
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4802
+ }
41444803 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41454804 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41464805 }
41474806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
41484814 refreshContents();
41494815 //return true;
41504816 }
....@@ -4153,6 +4819,35 @@
41534819
41544820 freezemodel = false;
41554821 }
4822
+
4823
+ void SetPinStates(boolean enabled)
4824
+ {
4825
+ editButton.setEnabled(enabled);
4826
+ uneditButton.setEnabled(enabled);
4827
+ unselectButton.setEnabled(enabled);
4828
+ flashSelectionButton.setEnabled(enabled);
4829
+ }
4830
+
4831
+ void refreshContents(boolean cp)
4832
+ {
4833
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4834
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4835
+ {
4836
+ objEditor.ClearInfo(); // .GetMaterial());
4837
+
4838
+ for (int i=0; i < group.selection.Size(); i++)
4839
+ {
4840
+ Object3D child = (Object3D) group.selection.get(i);
4841
+
4842
+ objEditor.AddInfo(child, this, true);
4843
+ System.err.println("info : " + child.GetPath());
4844
+ }
4845
+
4846
+ objEditor.SetText(); // jan 2014
4847
+ }
4848
+
4849
+ super.refreshContents(cp);
4850
+ }
41564851
41574852 void linkSomething(Object3D thing)
41584853 {
....@@ -4224,16 +4919,19 @@
42244919 {
42254920 if (group.selection.isEmpty())
42264921 return;
4227
- GrafreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
42284924 Composite tGroup = null;
42294925 if (group.selection.size() > 0) // 1)
42304926 {
42314927 tGroup = new cGroup();
4232
- GrafreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
42334929 }
42344930
42354931 if (cut)
42364932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
42374935 //int indices[] = jList.getSelectedIndices();
42384936 //for (int i = indices.length - 1; i >= 0; i--)
42394937 //jList.remove(indices[i]);
....@@ -4269,16 +4967,16 @@
42694967 //System.out.println("cut " + child);
42704968 //System.out.println("parent = " + child.parent);
42714969 // tmp.addChild(child);
4272
- if (GrafreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
42734971 tGroup.add/*Child*/(tmp);
42744972 else
4275
- GrafreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
42764974 }
42774975 else
4278
- if (GrafreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
42794977 tGroup.add/*Child*/(child);
42804978 else
4281
- GrafreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
42824980 }
42834981
42844982 //ResetModel();
....@@ -4310,21 +5008,23 @@
43105008 //System.out.println("cut " + elem);
43115009 //System.out.println("parent = " + elem.parent);
43125010 // tmp.addChild(elem);
4313
- if (GrafreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
43145012 tGroup.add/*Child*/(tmp);
43155013 else
4316
- GrafreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
43175015 }
43185016 else
4319
- if (GrafreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
43205018 tGroup.add/*Child*/(child);
43215019 else
4322
- GrafreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
43235021 }
43245022
43255023 }
4326
- if (GrafreeD.clipboardIsTempGroup)
4327
- GrafreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
43285028 if (cut)
43295029 {
43305030 ResetModel();
....@@ -4334,11 +5034,15 @@
43345034
43355035 void paste(boolean expand)
43365036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
43375041 // if (GrafreeD.clipboard == null)
43385042 // return;
43395043 boolean first = true;
43405044
4341
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
43425046 {
43435047 Composite temp;
43445048
....@@ -4349,7 +5053,7 @@
43495053 temp = (Composite)Applet3D.clipboard.deepCopy();
43505054 */
43515055 Object3D elem;
4352
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5056
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43535057 {
43545058 Object3D child = (Object3D)e.nextElement();
43555059
....@@ -4383,21 +5087,22 @@
43835087 //Object3D cb = Applet3D.clipboard;
43845088 //temp.addChild(cb);
43855089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4386
- assert(GrafreeD.clipboard.parent == null);
4387
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4388
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4389
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4390
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5090
+ assert(Grafreed.clipboard.parent == null);
5091
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5092
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5093
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5094
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43915095 else
4392
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4393
- GrafreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
43945098 }
43955099
5100
+ Globals.REPLACEONMAKE = keep;
43965101 ResetModel();
43975102 refreshContents();
43985103 }
43995104
4400
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
44015106 {
44025107 // if (GrafreeD.clipboard == null)
44035108 // return;
....@@ -4426,15 +5131,22 @@
44265131 if (copyit)
44275132 {
44285133 // paste(false);
4429
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
44305142 }
44315143 else
44325144 {
44335145 boolean first = true;
44345146
4435
- if (GrafreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
44365148 {
4437
- Composite temp = (Composite)GrafreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
44385150 Object3D copy;
44395151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44405152 {
....@@ -4444,7 +5156,7 @@
44445156 }
44455157 } else
44465158 {
4447
- linkSomething(GrafreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
44485160 }
44495161 }
44505162 }
....@@ -4521,6 +5233,10 @@
45215233
45225234 void group(Object3D csg, boolean grab)
45235235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
45245240 if (//false) // why??
45255241 !group.selection.isEmpty())
45265242 {
....@@ -4634,10 +5350,15 @@
46345350 //node.add(csg);
46355351 //makeSomething(node);
46365352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
46375354 }
46385355
46395356 void Ungroup(Object3D g)
46405357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
46415362 if (g instanceof HiddenObject)
46425363 {
46435364 HiddenObject h = (HiddenObject) g;
....@@ -4654,6 +5375,7 @@
46545375 objEditor.makeSomething(g.get(i), false);
46555376 }
46565377 }
5378
+ Globals.REPLACEONMAKE = keep;
46575379 }
46585380
46595381 void ungroup()
....@@ -4849,21 +5571,6 @@
48495571 }
48505572 */
48515573
4852
- void ImportGFD()
4853
- {
4854
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4855
- browser.show();
4856
- String filename = browser.getFile();
4857
- if (filename != null && filename.length() > 0)
4858
- {
4859
- String fullname = browser.getDirectory() + filename;
4860
-
4861
- //Object3D readobj =
4862
- objEditor.ReadGFD(fullname, objEditor);
4863
- //makeSomething(readobj);
4864
- }
4865
- }
4866
-
48675574 /*
48685575 public void Callback(Object obj)
48695576 {
....@@ -4887,26 +5594,9 @@
48875594 }
48885595 */
48895596
4890
- void ImportVRMLX3D()
4891
- {
4892
- if (GrafreeD.standAlone)
4893
- {
4894
- /**/
4895
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4896
- browser.show();
4897
- String filename = browser.getFile();
4898
- if (filename != null && filename.length() > 0)
4899
- {
4900
- String fullname = browser.getDirectory() + filename;
4901
- LoadVRMLX3D(fullname);
4902
- }
4903
- /**/
4904
- }
4905
- }
4906
-
49075597 String GetFile(String dialogName)
49085598 {
4909
- if (GrafreeD.standAlone)
5599
+ if (Grafreed.standAlone)
49105600 {
49115601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49125602 browser.show();
....@@ -4970,10 +5660,33 @@
49705660 cButton flashSelectionButton;
49715661 cButton editButton;
49725662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
49735664 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755665 cButton unselectButton;
49765666
5667
+ cButton restoreCameraButton;
5668
+
5669
+ cButton saveButton;
5670
+ cButton oneStepButton;
5671
+
5672
+ cButton groupButton;
5673
+ cButton ungroupButton;
5674
+ cButton compositeButton;
5675
+ cButton switchButton;
5676
+ cButton loopButton;
5677
+ cButton textureButton;
5678
+
5679
+ cButton gridButton;
5680
+ cButton boxButton;
5681
+ cButton sphereButton;
5682
+ cButton coneButton;
5683
+ cButton torusButton;
5684
+ cButton superButton;
5685
+ cButton kleinButton;
5686
+ cButton particlesButton;
5687
+ cButton overlayButton;
5688
+ cButton lightButton;
5689
+
49775690 cButton screenfitButton;
49785691 cButton screenfitpointButton;
49795692 cButton snapobjectButton;
....@@ -4985,14 +5698,6 @@
49855698
49865699 cButton setsupportButton;
49875700
4988
- cButton twoButton;
4989
- cButton sixButton;
4990
- cButton threeButton;
4991
- cButton sevenButton;
4992
- cButton fourButton; // full panel
4993
- cButton oneButton; // full XYZ
4994
- //cButton currentLayout;
4995
-
49965701 //
49975702 //Composite
49985703 Object3D // to do !!
....@@ -5002,9 +5707,11 @@
50025707 //JTree jTree;
50035708 private MenuItem lookAtItem;
50045709 private MenuItem lookFromItem;
5005
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
50065711 private MenuItem cutItem;
5007
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
50085715 private MenuItem cloneItem;
50095716 private MenuItem cloneSupportItem;
50105717 private MenuItem overwriteGeoItem;
....@@ -5017,7 +5724,7 @@
50175724 private MenuItem linkverticesItem;
50185725 private MenuItem relinkverticesItem;
50195726 private MenuItem setMasterItem;
5020
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
50215728 private MenuItem stepAllItem;
50225729 private MenuItem revertMeshItem;
50235730 private MenuItem poseMeshItem;
....@@ -5028,10 +5735,11 @@
50285735 private MenuItem mergeGeometriesItem;
50295736 private MenuItem copyItem;
50305737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
50315739 private MenuItem pasteLinkItem;
50325740 private MenuItem pasteCloneItem;
50335741 private MenuItem pasteExpandItem;
5034
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
50355743 private MenuItem clearAllItem;
50365744 private MenuItem genUVItem;
50375745 private MenuItem genNormalsMESHItem;
....@@ -5066,6 +5774,10 @@
50665774 private MenuItem showleavesItem;
50675775 private MenuItem markleavesItem;
50685776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
50695781
50705782 private MenuItem flipVItem;
50715783 private MenuItem unflipVItem;
....@@ -5077,15 +5789,17 @@
50775789 private MenuItem panoTexturesItem;
50785790
50795791 private MenuItem resetCentroidItem;
5080
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
50815793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
50825796 private MenuItem hideItem;
50835797 private MenuItem grabItem;
50845798 private MenuItem backItem;
50855799 private MenuItem frontItem;
50865800 private MenuItem cameraItem;
50875801 private MenuItem compositeItem;
5088
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
50895803 private MenuItem physicsItem;
50905804 private MenuItem frameselectorItem;
50915805 private MenuItem scriptNodeItem;
....@@ -5109,6 +5823,8 @@
51095823 private MenuItem attachBumpItem;
51105824 private MenuItem detachBumpItem;
51115825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
51125828
51135829 private MenuItem particleItem;
51145830 private MenuItem ragdollItem;
....@@ -5125,7 +5841,7 @@
51255841 private MenuItem blobItem;
51265842 private MenuItem latheItem;
51275843 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
51295845 private MenuItem meshItem;
51305846 // private MenuItem meshGroupItem;
51315847 private MenuItem springItem;
....@@ -5147,11 +5863,6 @@
51475863 private MenuItem doubleItem;
51485864 private MenuItem tripleItem;
51495865
5150
- private MenuItem importGFDItem;
5151
- private MenuItem importVRMLX3DItem;
5152
- private MenuItem import3DSItem;
5153
- private MenuItem importOBJItem;
5154
-
51555866 private MenuItem computeAOItem;
51565867 private MenuItem recompileItem;
51575868 private MenuItem editScriptItem;
....@@ -5161,4 +5872,8 @@
51615872 private MenuItem analyzeItem;
51625873 private MenuItem dumpItem;
51635874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
51645879 }