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,17 +80,29 @@
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 {
86
- // Object3D keep = GraphreeD.clipboard;
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
105
+ // Object3D keep = GrafreeD.clipboard;
87106 //Object3D obj;
88107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89108 {
....@@ -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(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.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(GraphreeD.clipboard, false));
107
- GraphreeD.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)GraphreeD.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,73 +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);
340
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
341
+ relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
222345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223346 setMasterItem.addActionListener(this);
347
+ }
224348
225349 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
230352 backItem = menu.add(new MenuItem("Back"));
231353 backItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
354
+ frontItem = menu.add(new MenuItem("Front"));
355
+ frontItem.addActionListener(this);
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"));
362
+ hideItem.addActionListener(this);
363
+ }
364
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
365
+ ungroupItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
241373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242374 switchGeoItem.addActionListener(this);
243375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244376 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
246378 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);
247385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248386 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
387
+ }
251388
252389 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
392
+ billboardItem = menu.add(new MenuItem("Billboard"));
393
+ billboardItem.addActionListener(this);
255394 csgItem = menu.add(new MenuItem("CSG"));
256395 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258397 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260399 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
263408 linkerItem = menu.add(new MenuItem("Linker"));
264409 linkerItem.addActionListener(this);
265410 templateItem = menu.add(new MenuItem("Template"));
266411 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269412 pointflowItem = menu.add(new MenuItem("Point Flow"));
270413 pointflowItem.addActionListener(this);
414
+ }
271415 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275417 resetTransformItem.addActionListener(this);
276418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277419 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.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);
280426
281427 oe.menuBar.add(menu = new Menu("Geometry"));
282428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +431,13 @@
285431 genNormalsORGANItem.addActionListener(this);
286432 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287433 genNormalsCADItem.addActionListener(this);
434
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
435
+ genNormalsMESHItem.addActionListener(this);
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
439
+ genNormalsMINEItem.addActionListener(this);
440
+ }
288441 stripifyItem = menu.add(new MenuItem("Stripify"));
289442 stripifyItem.addActionListener(this);
290443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +459,34 @@
306459 reduce34MeshItem.addActionListener(this);
307460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308461 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
313470
314471 oe.menuBar.add(menu = new Menu("Attributes"));
315472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316473 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);
317478 menu.add("-");
318479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319480 liveleavesItem.addActionListener(this);
320481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
322485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323486 supportleavesItem.addActionListener(this);
324487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325488 unsupportleavesItem.addActionListener(this);
489
+ }
326490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327491 hideleavesItem.addActionListener(this);
328492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +495,14 @@
331495 markleavesItem.addActionListener(this);
332496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333497 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);
334506 menu.add("-");
335507 flipVItem = menu.add(new MenuItem("Flip V"));
336508 flipVItem.addActionListener(this);
....@@ -356,45 +528,56 @@
356528 attachBumpItem.addActionListener(this);
357529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
358530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
359532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
360533 detachPigmentItem.addActionListener(this);
361534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
362535 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);
363540 menu.add("-");
364541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
365542 sortbysizeItem.addActionListener(this);
366543 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367544 sortbynameItem.addActionListener(this);
368545 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.
369553 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370554 extractGeometriesItem.addActionListener(this);
371555 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372556 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
557
+ }
377558
378559 oe.menuBar.add(menu = new Menu("Insert"));
379560 buildCreateMenu(menu);
380561
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392562 oe.menuBar.add(menu = new Menu("Tools"));
393563 buildToolsMenu(menu);
394564 }
395565
566
+
396567 void SetupUI2(ObjEditor oe)
397568 {
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
+
398581 //new Exception().printStackTrace();
399582
400583 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +606,231 @@
423606 oe.radioPanel.add(dummyButton);
424607 oe.buttonGroup.add(dummyButton);
425608 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
429612
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
613
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
614
+
615
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ //minButton.setToolTipText("Minimize window");
617
+ //minButton.addActionListener(this);
618
+
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);
631
+ screenfitButton.setToolTipText("Screen fit");
632
+ screenfitButton.addActionListener(this);
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");
431667 liveCB.addItemListener(this);
432668
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
451675 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.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);
458682
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
493
- trackCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
497
- screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
499683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500684 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505685
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
512
- flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516
-
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
519
- twoButton.addActionListener(this);
520
- 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);
521693 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
523
- sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
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");
525706 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
527
- 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);
528713 //
529714
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
531717 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
718
+
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
720
+ closeButton.setToolTipText("Close tab");
534721 closeButton.addActionListener(this);
535722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536723 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538
-
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
541
- editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545724
546
- 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");
547810 uneditButton.addActionListener(this);
548811
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- 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");
561814 allParamsButton.addActionListener(this);
562815
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- 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");
568822 unselectButton.addActionListener(this);
569823
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
+
570834 // oe.aConstraints.gridx += 1;
571835 // oe.aConstraints.weighty = 0;
572836 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +842,25 @@
578842 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579843 // gcButton.addActionListener(this);
580844
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
845
+ cGridBag jSPPanel = new cGridBag();
846
+
847
+ JScrollPane jSP;
592848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594850 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
599
-
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
604
- colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
607
- materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
- textureCB.addItemListener(this);
611
-
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
614851
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
+
615864 //jList.addListSelectionListener(this);
616865 oe.jTree.addTreeSelectionListener(this);
617866 //jTree.setRootVisible(false);
....@@ -630,23 +879,160 @@
630879 dgr.addDragGestureListener(this);
631880 }catch(Exception e) {}
632881 */
633
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
634883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635884 }
885
+
886
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
887
+ {
888
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
889
+ colorCB.setToolTipText("Copy color when dropped");
890
+ colorCB.addItemListener(this);
891
+
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
+
920
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
921
+ // localCB.addItemListener(this);
922
+
923
+ panel.Return();
924
+
925
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
926
+ crowdCB.setToolTipText("Used for crowds");
927
+ crowdCB.addItemListener(this);
928
+
929
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
930
+ smoothCB.setToolTipText("Snapping delay");
931
+ smoothCB.addItemListener(this);
932
+
933
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
934
+ slowCB.setToolTipText("Smooth interpolation");
935
+ slowCB.addItemListener(this);
936
+
937
+// constraints.gridy += 1;
938
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
939
+// speakerMocapCB.addItemListener(this);
940
+
941
+ panel.Return();
942
+
943
+ if (false)
944
+ {
945
+ // handled in scripts
946
+ //constraints.gridy += 1;
947
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
948
+ speakerCameraCB.addItemListener(this);
949
+
950
+ //constraints.gridy += 1;
951
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
952
+ speakerFocusCB.addItemListener(this);
953
+
954
+ //constraints.gridy += 1;
955
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
956
+ smoothfocusCB.addItemListener(this);
957
+ panel.Return();
958
+ }
959
+
960
+//constraints.gridx += 1;
961
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
962
+// debugCB.addItemListener(this);
963
+
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");
970
+ oeilCB.addItemListener(this);
971
+
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);
993
+ lookAtCB.setToolTipText("Look-at target");
994
+ 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);
1009
+
1010
+ }
6361011
6371012 void EditObject(Object3D obj)
6381013 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
1014
+ 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
+
1023
+ radioButton.SetObject(obj);
1024
+ radioButton.layout = sixButton; // sevenButton;
1025
+ radioButton.SetCamera(cameraView.renderCamera, false);
1026
+ radioButton.addActionListener(this);
1027
+ radioPanel.add(radioButton);
1028
+ buttonGroup.add(radioButton);
1029
+ radioButton.doClick();
6471030 }
1031
+
6481032 void SetupViews(ObjEditor oe)
6491033 {
1034
+ theFrame = this;
1035
+
6501036 oe.SetupViews();
6511037
6521038 System.out.println("SetupViews");
....@@ -655,22 +1041,28 @@
6551041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561042 }
6571043
658
- JCheckBox liveCB;
659
- JCheckBox supportCB;
660
- JCheckBox localCB;
661
- JCheckBox crowdCB;
662
- JCheckBox smoothCB;
663
- JCheckBox fastCB;
664
- JCheckBox slowCB;
665
- JCheckBox boxCB;
666
- JCheckBox trackCB;
667
- 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;
6681057 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
6741066
6751067 // static int COLOR = 1;
6761068 // static int MATERIAL = 2;
....@@ -678,9 +1070,9 @@
6781070
6791071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801072
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
6841076
6851077 public void itemStateChanged(ItemEvent e)
6861078 {
....@@ -705,10 +1097,10 @@
7051097 dropAttributes |= Object3D.TEXTURE;
7061098 else
7071099 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1100
+ } else if(e.getSource() == liveCB)
7101101 {
7111102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7121104 }
7131105 else if(e.getSource() == supportCB)
7141106 {
....@@ -744,6 +1136,10 @@
7441136 cameraView.repaint();
7451137 // refreshContents();
7461138 }
1139
+ else if(e.getSource() == zoomBoxCB)
1140
+ {
1141
+ cameraView.ToggleZoomBoxMode();
1142
+ }
7471143 else if(e.getSource() == smoothfocusCB)
7481144 {
7491145 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1165,18 @@
7691165 {
7701166 cameraView.ToggleOeil();
7711167 }
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
+ }
7721180 else if(e.getSource() == lookAtCB)
7731181 {
7741182 cameraView.ToggleLookAt();
....@@ -785,7 +1193,8 @@
7851193
7861194 /**/
7871195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
7891198 if ((path == null) || (path.getPathCount() <= 1)) {
7901199 // We can't move the root node or an empty selection
7911200 return;
....@@ -848,8 +1257,6 @@
8481257 }
8491258 }
8501259
851
- String string = (String) object;
852
-
8531260 System.out.println("Transfer = " + object + "; drop : " + target);
8541261 // if( object instanceof java.io.File[])
8551262 // {
....@@ -857,7 +1264,11 @@
8571264 // objEditor.DropFile((java.io.File[]) object, true);
8581265 // return;
8591266 // }
860
- 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) == ':')
8611272 {
8621273 // file(s)
8631274 String[] names = string.split("\n");
....@@ -884,7 +1295,7 @@
8841295
8851296 flashIt = false;
8861297 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891300
8901301 if (group.selection.size() == 1)
....@@ -900,23 +1311,33 @@
9001311
9011312 assert target == objEditor.jTree;
9021313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9031315 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051317 } catch (Exception e) {
9061318 System.out.println("destinationPath : " + destinationPath);
9071319 return;
9081320 }
9091321
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9111323 {
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
+// {
9121333 loadClipboard(true);
9131334 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9201341 }
9211342 public void dropActionChanged(DropTargetDragEvent dtde)
9221343 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1442,107 @@
10211442 {
10221443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231444 //heightFieldItem.addActionListener(this);
1024
- gridItem = menu.add(new MenuItem("Grid"));
1025
- gridItem.addActionListener(this);
1026
- rectoidItem = menu.add(new MenuItem("Box"));
1027
- rectoidItem.addActionListener(this);
1028
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1029
- ellipsoidItem.addActionListener(this);
1030
- coneItem = menu.add(new MenuItem("Cone"));
1031
- coneItem.addActionListener(this);
1032
- torusItem = menu.add(new MenuItem("Torus"));
1033
- torusItem.addActionListener(this);
1034
- superItem = menu.add(new MenuItem("Superellipsoid"));
1035
- superItem.addActionListener(this);
1036
- particleItem = menu.add(new MenuItem("Particle system"));
1037
- particleItem.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
+ {
1463
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1464
+ kleinItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10381471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391472 ragdollItem.addActionListener(this);
10401473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411474 ragdoll2Item.addActionListener(this);
1475
+ }
10421476 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441478 meshItem.addActionListener(this);
10451479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10471483 springItem = menu.add(new MenuItem("Spring"));
10481484 springItem.addActionListener(this);
10491485 flagItem = menu.add(new MenuItem("Flag"));
10501486 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551487 blobItem = menu.add(new MenuItem("Blob"));
10561488 blobItem.addActionListener(this);
10571489 latheItem = menu.add(new MenuItem("Lathe"));
10581490 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- 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);
10611498 menu.add("-");
10621499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631500 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
10661503 doubleItem = menu.add(new MenuItem("Fork"));
10671504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
10681507 tripleItem = menu.add(new MenuItem("Trident"));
10691508 tripleItem.addActionListener(this);
1509
+ }
10701510 }
10711511
10721512 void buildToolsMenu(Menu menu)
10731513 {
10741514 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751515 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1516
+ animationItem.setState(Globals.ANIMATION);
1517
+
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
10771520
10781521 menu.add("-");
10791522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801523 parseverticesItem.addActionListener(this);
10811524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821525 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841527 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881529 reduceMorphItem.addActionListener(this);
10891530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901531 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941532 menu.add("-");
1095
-
10961533 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971534 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("-");
10981543 menu.add(analyzeItem = new MenuItem("Analyze"));
10991544 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11011546 dumpItem.addActionListener(this);
11021547 // menu.add(pathItem = new MenuItem("From-to path"));
11031548 // pathItem.addActionListener(this);
....@@ -1106,6 +1551,8 @@
11061551 resetParentItem.addActionListener(this);
11071552 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081553 repairParentItem.addActionListener(this);
1554
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1555
+ repairShadowItem.addActionListener(this);
11091556 menu.add(invariantsItem = new MenuItem("Invariants"));
11101557 invariantsItem.addActionListener(this);
11111558 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1560,7 @@
11131560 menu.add("-");
11141561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151562 editScriptItem.addActionListener(this);
1563
+ }
11161564 }
11171565
11181566 void ScreenFit()
....@@ -1235,9 +1683,34 @@
12351683 shadow.material = new cMaterial(obj.material);
12361684 shadow.material.diffuse = 0.0001f;
12371685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12381687
12391688 makeSomething(shadow);
12401689 }
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
+ }
12411714
12421715 /**
12431716 * applyExample
....@@ -1441,9 +1914,9 @@
14411914
14421915 void Overwrite(int mask)
14431916 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451918 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
14471920
14481921 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491922 content = ((cGroup)content).get(0);
....@@ -1466,6 +1939,7 @@
14661939 //
14671940 public void actionPerformed(ActionEvent event) // , Object arg)
14681941 {
1942
+ Object source = event.getSource();
14691943 /*
14701944 if (event.getSource() == nameField)
14711945 {
....@@ -1477,11 +1951,11 @@
14771951 }
14781952 else
14791953 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1954
+ if (source == lookAtItem || source == lookFromItem)
14811955 {
14821956 ScreenFit();
14831957 } else
1484
- if (event.getSource() == switchItem)
1958
+ if (source == switchViewItem)
14851959 {
14861960 cVector v1 = new cVector();
14871961 cVector v2 = new cVector();
....@@ -1490,11 +1964,11 @@
14901964 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911965 objEditor.cameraView.repaint();
14921966 } else
1493
- if (event.getSource() == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
14941968 {
14951969 makeSomething(new Box());
14961970 } else
1497
- if (event.getSource() == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
14981972 {
14991973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1989,9 @@
15151989 applyExample(particleGeom, "SMOKE");
15161990 makeSomething(particleGeom);
15171991 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1992
+ if (source == ragdollItem || source == ragdoll2Item)
15191993 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1994
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211995
15221996 ragdoll.toParent = LA.newMatrix();
15231997 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +2009,7 @@
15352009 } else
15362010 /*
15372011 */
1538
- if (event.getSource() == heightFieldItem)
2012
+ if (source == heightFieldItem)
15392013 {
15402014 Object3D obj = new Object3D();
15412015
....@@ -1573,27 +2047,31 @@
15732047
15742048 makeSomething(obj);
15752049 } else
1576
- if (event.getSource() == gridItem)
2050
+ if (source == gridItem || source == gridButton)
15772051 {
15782052 makeSomething(new Grid());
15792053 } else
1580
- if (event.getSource() == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
15812055 {
15822056 makeSomething(new Sphere());
15832057 } else
1584
- if (event.getSource() == coneItem)
2058
+ if (source == coneItem || source == coneButton)
15852059 {
15862060 makeSomething(new Cone());
15872061 } else
1588
- if (event.getSource() == torusItem)
2062
+ if (source == torusItem || source == torusButton)
15892063 {
15902064 makeSomething(new Torus());
15912065 } else
1592
- if (event.getSource() == superItem)
2066
+ if (source == superItem || source == superButton)
15932067 {
15942068 makeSomething(new Superellipsoid());
15952069 } else
1596
- if (event.getSource() == blobItem)
2070
+ if (source == kleinItem || source == kleinButton)
2071
+ {
2072
+ makeSomething(new Klein());
2073
+ } else
2074
+ if (source == blobItem)
15972075 {
15982076 Blob blob = new Blob();
15992077 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2079,15 @@
16012079 //blob.retile();
16022080 makeSomething(blob);
16032081 } else
1604
- if (event.getSource() == latheItem)
2082
+ if (source == latheItem)
16052083 {
16062084 makeSomething(new Lathe());
16072085 } else
1608
- if (event.getSource() == bezierItem)
2086
+ if (source == bezierItem)
16092087 {
16102088 makeSomething(new BezierSurface());
16112089 } else
1612
- if (event.getSource() == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16132091 {
16142092 /*
16152093 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2102,7 @@
16242102 */
16252103 makeSomething(new Checker());
16262104 } else
1627
- if (event.getSource() == meshItem)
2105
+ if (source == meshItem)
16282106 {
16292107 Object3D itemtomake = new Object3D();
16302108 Object3D child;
....@@ -1645,35 +2123,35 @@
16452123 makeSomething(child);
16462124 }
16472125 } else
1648
- if (event.getSource() == springItem)
2126
+ if (source == springItem)
16492127 {
16502128 cSpring s = new cSpring();
16512129 s.setup();
16522130 makeSomething(s);
16532131 } else
1654
- if (event.getSource() == flagItem)
2132
+ if (source == flagItem)
16552133 {
16562134 cSpring s = new cFlag();
16572135 s.setup();
16582136 makeSomething(s);
16592137 } else
1660
- if (event.getSource() == lightItem)
2138
+ if (source == lightItem || source == lightButton)
16612139 {
16622140 makeSomething(new Light());
16632141 } else
1664
- if (event.getSource() == csgItem)
2142
+ if (source == csgItem)
16652143 {
16662144 group(new CSG());
16672145 } else
1668
- if (event.getSource() == templateItem)
2146
+ if (source == templateItem)
16692147 {
16702148 group(new cTemplate());
16712149 } else
1672
- if (event.getSource() == attributeItem)
2150
+ if (source == attributeItem)
16732151 {
16742152 makeSomething(new Attribute());
16752153 } else
1676
- if (event.getSource() == pointflowItem)
2154
+ if (source == pointflowItem)
16772155 {
16782156 makeSomething(new PointFlow());
16792157 } else
....@@ -1685,7 +2163,7 @@
16852163 } else
16862164 */
16872165
1688
- if (event.getSource() == superLoopItem)
2166
+ if (source == superLoopItem)
16892167 {
16902168 Composite g = new cGroup();
16912169 for (int i=0; i<15; i++)
....@@ -1707,30 +2185,30 @@
17072185
17082186 group(g);
17092187 } else
1710
- if (event.getSource() == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17112189 {
17122190 Composite csg = new GroupLeaf();
17132191 csg.count = 5;
17142192 group(csg);
1715
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17162194 csg.addChild(child);
17172195 child.addChild(csg);
17182196 } else
1719
- if (event.getSource() == doubleItem)
2197
+ if (source == doubleItem)
17202198 {
1721
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17222200 csg.count = 5;
17232201 group(csg);
1724
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17252203 csg.addChild(child);
17262204 child.addChild(csg);
1727
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17282206 csg.addChild(child);
17292207 child.addChild(csg);
17302208 } else
1731
- if (event.getSource() == tripleItem)
2209
+ if (source == tripleItem)
17322210 {
1733
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17342212 csg.count = 4;
17352213 group(csg);
17362214 Composite child = new cGroup();
....@@ -1743,73 +2221,98 @@
17432221 csg.addChild(child);
17442222 child.addChild(csg);
17452223 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2224
+ if (source == computeAOItem)
17482225 {
1749
- ImportGFD();
2226
+ Globals.drawMode = CameraPane.OCCLUSION;
2227
+ Globals.theRenderer.repaint();
17502228 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
2229
+ if (source == recompileItem)
17692230 {
17702231 Recompile();
17712232 refreshContents();
17722233 } else
1773
- if (event.getSource() == editScriptItem)
2234
+ if (source == editScriptItem)
17742235 {
17752236 OpenDialog();
17762237 refreshContents();
17772238 } else
1778
- if (event.getSource() == invariantsItem)
2239
+ if (source == invariantsItem)
17792240 {
17802241 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
17822243 } else
1783
- if (event.getSource() == memoryItem)
2244
+ if (source == memoryItem)
17842245 {
17852246 //System.out.println("Invariants:");
17862247 PrintMemory();
17872248 } else
1788
- if (event.getSource() == pathItem)
2249
+ if (source == pathItem)
17892250 {
17902251 PrintPath();
17912252 } else
1792
- if (event.getSource() == analyzeItem)
2253
+ if (source == analyzeItem)
17932254 {
17942255 AnalyzeObject();
17952256 } else
1796
- if (event.getSource() == dumpItem)
2257
+ if (source == dumpItem)
17972258 {
17982259 DumpObject();
17992260 } else
1800
- if (event.getSource() == screenfitButton)
2261
+ if (source == minButton)
18012262 {
1802
- //Reload(lastConverter, lastFilename, true);
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
2306
+ if (source == screenfitButton)
2307
+ {
18032308 ScreenFit();
18042309 } else
1805
- if (event.getSource() == screenfitpointButton)
2310
+ if (source == screenfitpointButton)
18062311 {
1807
- //Reload(lastConverter, lastFilename, true);
18082312 ScreenFitPoint();
18092313 } else
1810
- if (event.getSource() == snapobjectButton)
2314
+ if (source == snapobjectButton)
18112315 {
1812
- //Reload(lastConverter, lastFilename, true);
18132316 SnapObject();
18142317 } else
18152318 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2321,13 @@
18182321 // Recompile();
18192322 // refreshContents();
18202323 // } else
1821
- if (event.getSource() == gcButton)
2324
+ if (source == gcButton)
18222325 {
18232326 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242327 System.gc();
18252328 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262329 } else
1827
- if (event.getSource() == editLeafItem)
2330
+ if (source == editLeafItem)
18282331 {
18292332 Object3D obj;
18302333 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2341,78 @@
18382341 }
18392342 refreshContents(true);
18402343 } else
1841
- if (event.getSource() == openWindowItem)
2344
+ if (source == openWindowItem)
18422345 {
18432346 EditSelection(true);
18442347 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2348
+ if (source == cutItem || source == clearButton)
18462349 {
18472350 loadClipboard(true);
18482351 } else
1849
- if (event.getSource() == duplicateItem)
2352
+ if (source == undoItem)
18502353 {
1851
- Object3D keep = GraphreeD.clipboard;
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
2360
+ if (source == duplicateItem)
2361
+ {
2362
+ Object3D keep = Grafreed.clipboard;
18522363 loadClipboard(false);
18532364 paste(false);
1854
- GraphreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
18552366 } else
1856
- if (event.getSource() == cloneItem)
2367
+ if (source == cloneItem)
18572368 {
18582369 CloneSelection(false);
18592370 } else
1860
- if (event.getSource() == cloneSupportItem)
2371
+ if (source == cloneSupportItem)
18612372 {
18622373 CloneSelection(true);
18632374 } else
1864
- if (event.getSource() == copyItem)
2375
+ if (source == copyItem)
18652376 {
18662377 loadClipboard(false);
18672378 } else
1868
- if (event.getSource() == pasteItem)
2379
+ if (source == pasteItem)
18692380 {
18702381 paste(false);
18712382 } else
1872
- if (event.getSource() == pasteLinkItem)
2383
+ if (source == pasteIntoItem)
18732384 {
1874
- pasteInto(false);
2385
+ pasteInto(true, false);
18752386 } else
1876
- if (event.getSource() == pasteCloneItem)
2387
+ if (source == pasteLinkItem)
18772388 {
1878
- pasteInto(true);
2389
+ pasteInto(false, false);
18792390 } else
1880
- if (event.getSource() == pasteExpandItem)
2391
+ if (source == pasteCloneItem)
2392
+ {
2393
+ pasteInto(true, true);
2394
+ } else
2395
+ if (source == pasteExpandItem)
18812396 {
18822397 paste(true);
18832398 } else
1884
- if (event.getSource() == synchronizeItem)
2399
+ if (source == synchronizeItem)
18852400 {
18862401 Overwrite(Object3D.TRANSFORM);
18872402 } else
1888
- if (event.getSource() == overwriteNameItem)
2403
+ if (source == overwriteNameItem)
18892404 {
18902405 Overwrite(Object3D.NAME);
18912406 } else
1892
- if (event.getSource() == overwriteUVItem)
2407
+ if (source == overwriteUVItem)
18932408 {
18942409 Overwrite(Object3D.UV);
18952410 } else
1896
- if (event.getSource() == overwriteMatItem)
2411
+ if (source == overwriteMatItem)
18972412 {
2413
+ /* july 2015
18982414 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2415
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002416 else
19012417 {
19022418 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2424,16 @@
19082424 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092425 }
19102426 }
2427
+ */
2428
+
2429
+ Overwrite(dropAttributes);
19112430 }
1912
- if (event.getSource() == overwriteGeoItem)
2431
+ if (source == overwriteGeoItem)
19132432 {
19142433 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2434
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162435 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2436
+// Object3D content = GrafreeD.clipboard.get(0);
19182437 //
19192438 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202439 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2445,7 @@
19262445 // refreshContents();
19272446 // }
19282447 } else
1929
- if (event.getSource() == generateMeshItem)
2448
+ if (source == generateMeshItem)
19302449 {
19312450 //if (group.selection.size() == 1)
19322451 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2456,7 @@
19372456 ResetModel();
19382457 refreshContents();
19392458 } else
1940
- if (event.getSource() == extractGeometriesItem)
2459
+ if (source == extractGeometriesItem)
19412460 {
19422461 boolean one = false;
19432462
....@@ -1964,7 +2483,7 @@
19642483 ResetModel();
19652484 refreshContents();
19662485 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2486
+ if (source == cloneGeometriesItem)
19682487 {
19692488 boolean one = false;
19702489
....@@ -1990,32 +2509,37 @@
19902509 ResetModel();
19912510 refreshContents();
19922511 } else
1993
- if (event.getSource() == shareGeometriesItem)
2512
+ if (source == shareGeometriesItem)
19942513 {
19952514 boolean one = false;
19962515
19972516 if (group.selection.size() == 1)
19982517 one = true;
19992518
2519
+ Object3D merge = null;
2520
+
20002521 Object3D content = new cGroup();
20012522
20022523 for (int i=0; i<group.selection.size(); i++)
20032524 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2525
+ merge = new Merge(group.selection.get(i));
20052526
20062527 if (one)
2007
- makeSomething(sel, false);
2528
+ makeSomething(merge, false);
20082529 else
2009
- content.addChild(sel);
2530
+ content.addChild(merge);
20102531 }
20112532
20122533 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2534
+ makeSomething(content, true);
2535
+ else
2536
+ {
2537
+ ResetModel();
2538
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2539
+ refreshContents();
2540
+ }
20172541 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2542
+ if (source == mergeGeometriesItem)
20192543 {
20202544 boolean one = false;
20212545
....@@ -2045,11 +2569,11 @@
20452569 ResetModel();
20462570 refreshContents();
20472571 } else
2048
- if (event.getSource() == linkverticesItem)
2572
+ if (source == linkverticesItem)
20492573 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2574
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512575 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2576
+// Object3D content = GrafreeD.clipboard.get(0);
20532577 //
20542578 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552579 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2582,48 @@
20582582 // group.selection.get(0).setMasterThis(content); // should be identity
20592583 // refreshContents();
20602584 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622586 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
20642588
20652589 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662590 content = ((cGroup)content).get(0);
20672591
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2592
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692593 for (int i=0; i<group.selection.size(); i++)
20702594 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
20732597 group.selection.get(i).linkVerticesThis(content);
20742598 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
20762600 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2601
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782602 refreshContents();
20792603 }
20802604 } else
2081
- if (event.getSource() == resetsupportItem)
2605
+ if (source == resetsupportItem)
20822606 {
20832607 for (int i=0; i<group.selection.size(); i++)
20842608 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
20872611 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
20892613 }
20902614
20912615 refreshContents();
20922616 } else
2093
- if (event.getSource() == resetreferencesItem)
2617
+ if (source == relinkverticesItem)
2618
+ {
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
2621
+ group.selection.RelinkToSupport();
2622
+ CameraPane.SWITCH = random;
2623
+
2624
+ refreshContents();
2625
+ } else
2626
+ if (source == resetreferencesItem)
20942627 {
20952628 for (int i=0; i<group.selection.size(); i++)
20962629 {
....@@ -2099,11 +2632,11 @@
20992632
21002633 refreshContents();
21012634 } else
2102
- if (event.getSource() == setMasterItem)
2635
+ if (source == setMasterItem)
21032636 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052638 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21072640
21082641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092642 content = ((cGroup)content).get(0);
....@@ -2112,13 +2645,13 @@
21122645 refreshContents();
21132646 }
21142647 } else
2115
- if (event.getSource() == poseMeshItem)
2648
+ if (source == poseMeshItem)
21162649 {
21172650 if (group.selection.size() == 1)
21182651 {
2119
- if (GraphreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21202653 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21222655
21232656 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242657 content = ((cGroup)content).get(0);
....@@ -2131,19 +2664,19 @@
21312664 }
21322665
21332666 } else
2134
- if (event.getSource() == revertMeshItem)
2667
+ if (source == revertMeshItem)
21352668 {
21362669 RevertMeshes();
21372670 } else
2138
- if (event.getSource() == resetMeshItem)
2671
+ if (source == resetAllItem)
21392672 {
21402673 ResetAll();
21412674 } else
2142
- if (event.getSource() == stepAllItem)
2675
+ if (source == stepAllItem)
21432676 {
21442677 StepAll();
21452678 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
21472680 {
21482681 //int indices[] = jList.getSelectedIndices();
21492682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2684,46 @@
21512684
21522685 ClearSelection(false);
21532686 } else
2154
- if (event.getSource() == clearAllItem)
2687
+ if (source == clearAllItem)
21552688 {
21562689 ClearSelection(true);
21572690 } else
2158
- if (event.getSource() == grabItem)
2691
+ if (source == grabItem || source == groupButton)
21592692 {
2160
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
21612694 } else
2162
- if (event.getSource() == frontItem)
2695
+ if (source == hideItem)
2696
+ {
2697
+ group(new HiddenObject());
2698
+ } else
2699
+ if (source == frontItem)
21632700 {
21642701 front();
21652702 } else
2166
- if (event.getSource() == backItem)
2703
+ if (source == backItem)
21672704 {
21682705 back();
21692706 } else
2170
- if (event.getSource() == cameraItem)
2707
+ if (source == cameraItem)
21712708 {
21722709 makeSomething(new Camera());
21732710 } else
2174
- if (event.getSource() == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
21752712 {
21762713 group(new Composite());
21772714 } else
2178
- if (event.getSource() == randomItem)
2715
+ if (source == switchItem || source == switchButton)
21792716 {
21802717 RandomNode random = new RandomNode();
21812718 group(random);
21822719 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
21842721 } else
2185
- if (event.getSource() == physicsItem)
2722
+ if (source == physicsItem)
21862723 {
21872724 group(new PhysicsNode());
21882725 } else
2189
- if (event.getSource() == frameselectorItem)
2726
+ if (source == frameselectorItem)
21902727 {
21912728 for (int i=0; i<group.selection.size(); i++)
21922729 {
....@@ -2198,7 +2735,7 @@
21982735 ResetModel();
21992736 refreshContents();
22002737 } else
2201
- if (event.getSource() == switchGeoItem)
2738
+ if (source == switchGeoItem)
22022739 {
22032740 for (int i=0; i<group.selection.size(); i++)
22042741 {
....@@ -2210,7 +2747,7 @@
22102747 ResetModel();
22112748 refreshContents();
22122749 } else
2213
- if (event.getSource() == switchTransfoItem)
2750
+ if (source == switchTransfoItem)
22142751 {
22152752 for (int i=0; i<group.selection.size(); i++)
22162753 {
....@@ -2222,7 +2759,7 @@
22222759 ResetModel();
22232760 refreshContents();
22242761 } else
2225
- if (event.getSource() == morphItem)
2762
+ if (source == morphItem)
22262763 {
22272764 for (int i=0; i<group.selection.size(); i++)
22282765 {
....@@ -2234,7 +2771,7 @@
22342771 ResetModel();
22352772 refreshContents();
22362773 } else
2237
- if (event.getSource() == scriptNodeItem)
2774
+ if (source == scriptNodeItem)
22382775 {
22392776 boolean atleastone = false;
22402777
....@@ -2273,195 +2810,252 @@
22732810 }
22742811 }
22752812 } else
2276
- if (event.getSource() == linkerItem)
2813
+ if (source == linkerItem)
22772814 {
22782815 group(new cLinker());
22792816 } else
2280
- if (event.getSource() == textureItem)
2817
+ if (source == textureItem || source == textureButton)
22812818 {
22822819 group(new TextureNode());
22832820 } else
2284
- if (event.getSource() == shadowXItem)
2821
+ if (source == billboardItem)
2822
+ {
2823
+ group(new BillboardNode());
2824
+ } else
2825
+ if (source == shadowXItem)
22852826 {
22862827 CastShadow(0);
22872828 } else
2288
- if (event.getSource() == shadowYItem)
2829
+ if (source == shadowYItem)
22892830 {
22902831 CastShadow(1);
22912832 } else
2292
- if (event.getSource() == shadowZItem)
2833
+ if (source == shadowZItem)
22932834 {
22942835 CastShadow(2);
22952836 } else
2296
- if (event.getSource() == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
22972838 {
2298
- ungroup();
2839
+ boolean hasRoot = false;
2840
+
2841
+ for (int i=0; i<group.selection.size(); i++)
2842
+ {
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
2848
+ }
2849
+
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
+ }
22992861 } else
2300
- if (event.getSource() == genUVItem)
2862
+ if (source == genUVItem)
23012863 {
23022864 GenUV();
23032865 } else
2304
- if (event.getSource() == genNormalsCADItem)
2866
+ if (source == genNormalsCADItem)
23052867 {
23062868 GenNormals(true);
23072869 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2870
+ if (source == genNormalsMESHItem)
2871
+ {
2872
+ GenNormalsMESH();
2873
+ } else
2874
+ if (source == genNormalsORGANItem)
23092875 {
23102876 GenNormals(false);
23112877 } else
2312
- if (event.getSource() == stripifyItem)
2878
+ if (source == genNormalsMINEItem)
2879
+ {
2880
+ GenNormalsMINE();
2881
+ } else
2882
+ if (source == stripifyItem)
23132883 {
23142884 Stripify();
23152885 } else
2316
- if (event.getSource() == unstripifyItem)
2886
+ if (source == unstripifyItem)
23172887 {
23182888 Unstripify();
23192889 } else
2320
- if (event.getSource() == trimItem)
2890
+ if (source == trimItem)
23212891 {
23222892 Trim();
23232893 } else
2324
- if (event.getSource() == untrimItem)
2894
+ if (source == untrimItem)
23252895 {
23262896 Untrim();
23272897 } else
2328
- if (event.getSource() == clearColorsItem)
2898
+ if (source == clearColorsItem)
23292899 {
23302900 ClearColors();
23312901 } else
2332
- if (event.getSource() == clearMaterialsItem)
2902
+ if (source == clearMaterialsItem)
23332903 {
23342904 ClearMaterials();
23352905 } else
2336
- if (event.getSource() == liveleavesItem)
2906
+ if (source == liveleavesItem)
23372907 {
23382908 LiveLeaves(true);
23392909 } else
2340
- if (event.getSource() == unliveleavesItem)
2910
+ if (source == unliveleavesItem)
23412911 {
23422912 LiveLeaves(false);
23432913 } else
2344
- if (event.getSource() == supportleavesItem)
2914
+ if (source == supportleavesItem)
23452915 {
23462916 SupportLeaves(true);
23472917 } else
2348
- if (event.getSource() == unsupportleavesItem)
2918
+ if (source == unsupportleavesItem)
23492919 {
23502920 SupportLeaves(false);
23512921 } else
2352
- if (event.getSource() == hideleavesItem)
2922
+ if (source == hideleavesItem)
23532923 {
23542924 HideLeaves(true);
23552925 } else
2356
- if (event.getSource() == showleavesItem)
2926
+ if (source == showleavesItem)
23572927 {
23582928 HideLeaves(false);
23592929 } else
2360
- if (event.getSource() == markleavesItem)
2930
+ if (source == markleavesItem)
23612931 {
23622932 MarkLeaves(true);
23632933 } else
2364
- if (event.getSource() == unmarkleavesItem)
2934
+ if (source == unmarkleavesItem)
23652935 {
23662936 MarkLeaves(false);
23672937 } else
2368
- if (event.getSource() == flipVItem)
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);
2953
+ } else
2954
+ if (source == flipVItem)
23692955 {
23702956 FlipV(true);
23712957 } else
2372
- if (event.getSource() == unflipVItem)
2958
+ if (source == unflipVItem)
23732959 {
23742960 FlipV(false);
23752961 } else
2376
- if (event.getSource() == lowTexturesItem)
2962
+ if (source == lowTexturesItem)
23772963 {
23782964 SetTexRes(0);
23792965 } else
2380
- if (event.getSource() == normalTexturesItem)
2966
+ if (source == normalTexturesItem)
23812967 {
23822968 SetTexRes(1);
23832969 } else
2384
- if (event.getSource() == highTexturesItem)
2970
+ if (source == highTexturesItem)
23852971 {
23862972 SetTexRes(2);
23872973 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2974
+ if (source == veryhighTexturesItem)
23892975 {
23902976 SetTexRes(3);
23912977 } else
2392
- if (event.getSource() == maxTexturesItem)
2978
+ if (source == maxTexturesItem)
23932979 {
23942980 SetTexRes(4);
23952981 } else
2396
- if (event.getSource() == panoTexturesItem)
2982
+ if (source == panoTexturesItem)
23972983 {
23982984 SetTexRes(5);
23992985 } else
2400
- if (event.getSource() == reverseNormalsItem)
2986
+ if (source == reverseNormalsItem)
24012987 {
24022988 ReverseNormals();
24032989 } else
2404
- if (event.getSource() == parseverticesItem)
2990
+ if (source == parseverticesItem)
24052991 {
24062992 ParseVertices();
24072993 } else
2408
- if (event.getSource() == textureFieldItem)
2994
+ if (source == textureFieldItem)
24092995 {
24102996 TextureVertices();
24112997 } else
2412
- if (event.getSource() == alignItem)
2998
+ if (source == alignItem)
24132999 {
24143000 Align();
24153001 } else
2416
- if (event.getSource() == mirrorItem)
3002
+ if (source == mirrorItem)
24173003 {
24183004 MirrorPoses();
24193005 } else
2420
- if (event.getSource() == reduceMorphItem)
3006
+ if (source == reduceMorphItem)
24213007 {
24223008 MeshReduction(false);
24233009 } else
2424
- if (event.getSource() == reduce34MorphItem)
3010
+ if (source == reduce34MorphItem)
24253011 {
24263012 MeshReduction(true);
24273013 } else
2428
- if (event.getSource() == reverseTrianglesItem)
3014
+ if (source == reverseTrianglesItem)
24293015 {
24303016 ReverseTriangles();
24313017 } else
2432
- if (event.getSource() == reduceMeshItem)
3018
+ if (source == reduceMeshItem)
24333019 {
24343020 ReduceMesh(false);
24353021 } else
2436
- if (event.getSource() == reduce34MeshItem)
3022
+ if (source == reduce34MeshItem)
24373023 {
24383024 ReduceMesh(true);
24393025 } else
2440
- if (event.getSource() == increaseMeshItem)
3026
+ if (source == increaseMeshItem)
24413027 {
24423028 IncreaseMesh();
24433029 } else
2444
- if (event.getSource() == clipMeshItem)
3030
+ if (source == clipMeshItem)
24453031 {
24463032 ClipMesh();
24473033 } else
2448
- if (event.getSource() == smoothMeshItem)
3034
+ if (source == smoothMeshItem)
24493035 {
24503036 SmoothMesh();
24513037 } else
2452
- if (event.getSource() == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
24533039 {
24543040 TransformGeometry();
24553041 } else
2456
- if (event.getSource() == resetTransformItem)
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
3045
+ } else
3046
+ if (source == resetTransformItem)
24573047 {
24583048 ResetTransform();
24593049 } else
2460
- if (event.getSource() == resetCentroidItem)
3050
+ if (source == resetCentroidItem)
24613051 {
2462
- ResetCentroid();
3052
+ ResetCentroid(true);
24633053 } else
2464
- if (event.getSource() == resetParentItem)
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
3057
+ } else
3058
+ if (source == resetParentItem)
24653059 {
24663060 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673061 {
....@@ -2471,7 +3065,7 @@
24713065
24723066 refreshContents();
24733067 } else
2474
- if (event.getSource() == repairParentItem)
3068
+ if (source == repairParentItem)
24753069 {
24763070 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773071 {
....@@ -2485,7 +3079,21 @@
24853079
24863080 refreshContents();
24873081 } else
2488
- if (event.getSource() == sortbysizeItem)
3082
+ if (source == repairShadowItem)
3083
+ {
3084
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3085
+ {
3086
+ Object3D obj = (Object3D)e.nextElement();
3087
+ obj.RepairShadow();
3088
+// for (int i=0; i<obj.size(); i++)
3089
+// {
3090
+// obj.get(i).parent = obj;
3091
+// }
3092
+ }
3093
+
3094
+ refreshContents();
3095
+ } else
3096
+ if (source == sortbysizeItem)
24893097 {
24903098 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913099 {
....@@ -2497,7 +3105,7 @@
24973105 ResetModel();
24983106 refreshContents();
24993107 } else
2500
- if (event.getSource() == sortbynameItem)
3108
+ if (source == sortbynameItem)
25013109 {
25023110 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033111 {
....@@ -2509,7 +3117,7 @@
25093117 ResetModel();
25103118 refreshContents();
25113119 } else
2512
- if (event.getSource() == attachPigmentItem)
3120
+ if (source == attachPigmentItem)
25133121 {
25143122 String texture = GetFile("Attach pigment");
25153123 Object3D obj;
....@@ -2521,7 +3129,7 @@
25213129
25223130 refreshContents();
25233131 } else
2524
- if (event.getSource() == detachPigmentItem)
3132
+ if (source == detachPigmentItem)
25253133 {
25263134 Object3D obj;
25273135 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3140,7 @@
25323140
25333141 refreshContents();
25343142 } else
2535
- if (event.getSource() == attachBumpItem)
3143
+ if (source == attachBumpItem)
25363144 {
25373145 String texture = GetFile("Attach bump");
25383146 Object3D obj;
....@@ -2544,18 +3152,18 @@
25443152
25453153 refreshContents();
25463154 } else
2547
- if (event.getSource() == detachBumpItem)
3155
+ if (source == detachBumpItem)
25483156 {
25493157 Object3D obj;
25503158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25513159 {
25523160 obj = (Object3D)e.nextElement();
2553
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
25543162 }
25553163
25563164 refreshContents();
25573165 } else
2558
- if (event.getSource() == pigmentBumpItem)
3166
+ if (source == pigmentBumpItem)
25593167 {
25603168 Object3D obj;
25613169 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3174,262 @@
25663174
25673175 refreshContents();
25683176 } else
2569
- if (event.getSource() == flashSelectionButton)
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
3202
+ if (source == flashSelectionButton)
25703203 {
25713204 CameraPane.flash = true;
25723205 refreshContents();
25733206 } else
2574
- if (event.getSource() == oneButton)
3207
+ if (source == oneButton)
25753208 {
25763209 } else
2577
- if (event.getSource() == twoButton)
3210
+ if (source == twoButton)
25783211 {
25793212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
25803217 // bug
25813218 //gridPanel.setDividerLocation(1.0);
25823219 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3220
+// bigThree.remove(scenePanel);
3221
+// bigThree.remove(centralPanel);
3222
+// bigThree.remove(XYZPanel);
3223
+// aWindowConstraints.gridx = 0;
3224
+// aWindowConstraints.gridy = 0;
3225
+// aWindowConstraints.gridwidth = 1;
3226
+// // aConstraints.gridheight = 3;
3227
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3228
+// aWindowConstraints.weightx = 0;
3229
+// aWindowConstraints.weighty = 1;
3230
+// //bigThree.add(jtp, aWindowConstraints);
3231
+// aWindowConstraints.weightx = 1;
3232
+// aWindowConstraints.gridwidth = 3;
3233
+// // aConstraints.gridheight = 3;
3234
+// aWindowConstraints.gridx = 1;
3235
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3236
+// bigThree.add(centralPanel, aWindowConstraints);
3237
+// aWindowConstraints.weightx = 0;
3238
+// aWindowConstraints.gridx = 4;
3239
+// aWindowConstraints.gridwidth = 1;
3240
+// // aConstraints.gridheight = 3;
3241
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3242
+// //bigThree.add(XYZPanel, aWindowConstraints);
3243
+// scenePanel.setVisible(false);
3244
+// centralPanel.setVisible(true);
3245
+// XYZPanel.setVisible(false);
3246
+ bigThree.ClearUI();
3247
+ bigThree.add(centralPanel);
3248
+ 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
+
26073267 } else
2608
- if (event.getSource() == threeButton)
3268
+ if (source == threeButton)
26093269 {
26103270 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
3274
+
3275
+// bigThree.remove(scenePanel);
3276
+// bigThree.remove(centralPanel);
3277
+// bigThree.remove(XYZPanel);
3278
+// aWindowConstraints.gridx = 0;
3279
+// aWindowConstraints.gridy = 0;
3280
+// aWindowConstraints.gridwidth = 1;
3281
+// // aConstraints.gridheight = 3;
3282
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3283
+// aWindowConstraints.weightx = 0;
3284
+// aWindowConstraints.weighty = 1;
3285
+// //bigThree.add(jtp, aWindowConstraints);
3286
+// aWindowConstraints.weightx = 1;
3287
+// aWindowConstraints.gridwidth = 3;
3288
+// // aConstraints.gridheight = 3;
3289
+// aWindowConstraints.gridx = 1;
3290
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3291
+// bigThree.add(centralPanel, aWindowConstraints);
3292
+// aWindowConstraints.weightx = 0;
3293
+// aWindowConstraints.gridx = 4;
3294
+// aWindowConstraints.gridwidth = 1;
3295
+// // aConstraints.gridheight = 3;
3296
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3297
+// bigThree.add(XYZPanel, aWindowConstraints);
3298
+// bigThree.validate();
3299
+// scenePanel.setVisible(false);
3300
+// centralPanel.setVisible(true);
3301
+// XYZPanel.setVisible(true);
3302
+ bigThree.ClearUI();
3303
+ bigThree.add(scenePanel);
3304
+ bigThree.add(centralPanel);
3305
+ bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
26353308 } else
2636
- if (event.getSource() == fourButton)
3309
+ if (source == fourButton)
26373310 {
26383311 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
3315
+
3316
+// bigThree.remove(scenePanel);
3317
+// bigThree.remove(centralPanel);
3318
+// bigThree.remove(XYZPanel);
3319
+// aWindowConstraints.gridx = 0;
3320
+// aWindowConstraints.gridy = 0;
3321
+// aWindowConstraints.gridwidth = 1;
3322
+// // aWindowConstraints.gridheight = 3;
3323
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3324
+// aWindowConstraints.weightx = 1;
3325
+// aWindowConstraints.weighty = 1;
3326
+// bigThree.add(scenePanel, aWindowConstraints);
3327
+// aWindowConstraints.weightx = 1;
3328
+// aWindowConstraints.gridwidth = 3;
3329
+// // aConstraints.gridheight = 3;
3330
+// aWindowConstraints.gridx = 1;
3331
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3332
+// //bigThree.add(cameraPanel, aWindowConstraints);
3333
+// aWindowConstraints.weightx = 0;
3334
+// aWindowConstraints.gridx = 4;
3335
+// aWindowConstraints.gridwidth = 1;
3336
+// // aWindowConstraints.gridheight = 3;
3337
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3338
+// //bigThree.add(XYZPanel, aWindowConstraints);
3339
+// bigThree.validate();
3340
+// scenePanel.setVisible(true);
3341
+// centralPanel.setVisible(false);
3342
+// XYZPanel.setVisible(false);
3343
+ bigThree.ClearUI();
3344
+ bigThree.add(scenePanel);
3345
+ bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
26633348 } else
2664
- if (event.getSource() == sixButton)
3349
+ if (source == sixButton)
26653350 {
26663351 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
3355
+
3356
+// bigThree.remove(scenePanel);
3357
+// bigThree.remove(centralPanel);
3358
+// bigThree.remove(XYZPanel);
3359
+// aWindowConstraints.gridx = 0;
3360
+// aWindowConstraints.gridy = 0;
3361
+// aWindowConstraints.gridwidth = 1;
3362
+// // aConstraints.gridheight = 3;
3363
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3364
+// aWindowConstraints.weightx = 0;
3365
+// aWindowConstraints.weighty = 1;
3366
+// bigThree.add(scenePanel, aWindowConstraints);
3367
+// aWindowConstraints.weightx = 1;
3368
+// aWindowConstraints.gridwidth = 3;
3369
+// // aWindowConstraints.gridheight = 3;
3370
+// aWindowConstraints.gridx = 1;
3371
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3372
+// bigThree.add(centralPanel, aWindowConstraints);
3373
+// aWindowConstraints.weightx = 0;
3374
+// aWindowConstraints.gridx = 4;
3375
+// aWindowConstraints.gridwidth = 1;
3376
+// // aWindowConstraints.gridheight = 3;
3377
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3378
+// //bigThree.add(XYZPanel, aConstraints);
3379
+// bigThree.validate();
3380
+// scenePanel.setVisible(true);
3381
+// centralPanel.setVisible(true);
3382
+// XYZPanel.setVisible(false);
3383
+ bigThree.ClearUI();
3384
+ bigThree.add(centralPanel);
3385
+ bigThree.add(scenePanel);
3386
+ bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
26913389 } else
2692
- if (event.getSource() == sevenButton)
3390
+ if (source == sevenButton)
26933391 {
26943392 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
3396
+
3397
+// bigThree.remove(scenePanel);
3398
+// bigThree.remove(centralPanel);
3399
+// bigThree.remove(XYZPanel);
3400
+// aWindowConstraints.gridx = 0;
3401
+// aWindowConstraints.gridy = 0;
3402
+// aWindowConstraints.gridwidth = 1;
3403
+// // aWindowConstraints.gridheight = 3;
3404
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3405
+// aWindowConstraints.weightx = 0;
3406
+// aWindowConstraints.weighty = 1;
3407
+// bigThree.add(scenePanel, aWindowConstraints);
3408
+// aWindowConstraints.weightx = 1;
3409
+// aWindowConstraints.gridwidth = 3;
3410
+// // aWindowConstraints.gridheight = 3;
3411
+// aWindowConstraints.gridx = 1;
3412
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3413
+// bigThree.add(centralPanel, aWindowConstraints);
3414
+// aWindowConstraints.weightx = 0;
3415
+// aWindowConstraints.gridx = 4;
3416
+// aWindowConstraints.gridwidth = 1;
3417
+// // aConstraints.gridheight = 3;
3418
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3419
+// bigThree.add(XYZPanel, aWindowConstraints);
3420
+// bigThree.validate();
3421
+// scenePanel.setVisible(true);
3422
+// centralPanel.setVisible(true);
3423
+// XYZPanel.setVisible(true);
3424
+ bigThree.ClearUI();
3425
+ bigThree.add(scenePanel);
3426
+ bigThree.add(centralPanel);
3427
+ bigThree.add(XYZPanel);
3428
+ bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
27193431 } else
2720
- if (event.getSource() == rootButton)
3432
+ if (source == rootButton)
27213433 {
27223434 Object3D obj;
27233435 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3439,84 @@
27273439 EditObject(obj);
27283440 }
27293441
3442
+ cameraView.requestFocusInWindow();
27303443 refreshContents(true);
27313444 } else
2732
- if (event.getSource() == closeButton)
3445
+ if (source == closeButton)
27333446 {
27343447 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353448 cRadio ab;
27363449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373450 {
27383451 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
27413460 buttonGroup.remove(ab);
27423461 radioPanel.remove(ab);
27433462
2744
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
27453465 // ab.GetObject().objectUI = null; // ?????????
27463466
27473467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483468 break;
27493469 }
27503470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
27513473 refreshContents(true);
27523474 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3475
+ if (source == editItem || source == editButton)
27543476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
27553483 EditSelection(false);
27563484 } else
2757
- if (event.getSource() == uneditButton)
3485
+ if (source == uneditButton)
27583486 {
27593487 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603488 {
27613489 Object3D child = (Object3D)e.nextElement();
27623490 if(child.editWindow != null)
27633491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
27643493 child.CloseUI();
27653494 listUI.remove(child);
27663495
2767
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
27683497 }
2769
- objEditor.ctrlPanel.revalidate();
3498
+ objEditor.ctrlPanel.FlushUI();
27703499 //objEditor.jTree.clearSelection();
27713500 //objEditor.ResetSliders();
27723501 refreshContents(true);
27733502 } else
2774
- if (event.getSource() == clearPanelButton)
3503
+ if (source == clearPanelButton)
27753504 {
27763505 assert(copy == group);
27773506 //copy.ClearUI();
27783507 for (Object3D obj : listUI)
27793508 {
3509
+ obj.pinned = false;
27803510 obj.CloseUI();
27813511 }
27823512 listUI.clear();
27833513 refreshContents(true);
27843514 } else
2785
- if (event.getSource() == allParamsButton)
3515
+ if (source == allParamsButton)
27863516 {
27873517 assert(copy == group);
27883518
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903520
27913521 for (Object3D obj : listUI)
27923522 {
....@@ -2803,19 +3533,19 @@
28033533
28043534 refreshContents(true);
28053535 } else
2806
- if (event.getSource() == unselectButton)
3536
+ if (source == unselectButton)
28073537 {
28083538 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3539
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103540 objEditor.ResetSliders();
28113541 refreshContents(true);
28123542 } else
2813
- if(event.getSource() instanceof cRadio)
3543
+ if(source instanceof cRadio)
28143544 {
28153545 group.parent = keepparent;
28163546 group.attributes = 0;
28173547 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3548
+ /*cRadio*/ radio = (cRadio)source;
28193549 Object3D obj = radio.GetObject();
28203550 System.out.println("Edit " + obj);
28213551 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3565,10 @@
28353565 }
28363566
28373567 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3568
+
3569
+ SetUndoStates();
3570
+
3571
+ //Globals.theRenderer.object = group;
28393572 if(!useclient)
28403573 {
28413574 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3577,52 @@
28443577 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453578 cameraView.targetLookAt.set(radio.camera.lookAt);
28463579 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3580
+ //cameraView.lighttouched = true;
3581
+ Globals.lighttouched = true;
28483582 topView.object = group;
28493583 frontView.object = group;
28503584 sideView.object = group;
28513585 }
2852
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
28533591 /*
28543592 currentLayout = radio.layout;
28553593 if (currentLayout == null)
28563594 currentLayout = sevenButton;
28573595 */
28583596 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);
28593604 keepparent = group.parent;
28603605 // PARENT = NULL or not???
28613606 //group.parent = null; // ROOT
28623607 //group.attributes = -1;
28633608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
28643611 refreshContents(true);
2865
- }
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
+ }
28663626 else
28673627 {
28683628 //return super.action(event, arg);
....@@ -2871,7 +3631,6 @@
28713631 }
28723632
28733633 boolean useclient = false;
2874
- cRadio radio;
28753634
28763635 void ToggleRoot()
28773636 {
....@@ -2880,7 +3639,7 @@
28803639 if (useclient)
28813640 {
28823641 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3642
+ Globals.lighttouched = true;
28843643 //topView.object = client;
28853644 //frontView.object = client;
28863645 //sideView.object = client;
....@@ -2888,7 +3647,7 @@
28883647 else
28893648 {
28903649 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3650
+ Globals.lighttouched = true;
28923651 //topView.object = group;
28933652 //frontView.object = group;
28943653 //sideView.object = group;
....@@ -2923,6 +3682,28 @@
29233682 refreshContents();
29243683 }
29253684
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
+ }
29263707
29273708 void ResetTransform()
29283709 {
....@@ -3035,7 +3816,7 @@
30353816 refreshContents();
30363817 }
30373818
3038
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
30393820 {
30403821 Object3D obj;
30413822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3831,16 @@
30503831 LA.matIdentity(Object3D.mat);
30513832 obj.getBounds(minima, maxima, false);
30523833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553837 obj.TransformMesh(Object3D.mat);
3838
+
30563839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
30593844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3869,8 @@
30843869
30853870 int size = obj.MemorySize();
30863871
3087
- 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)");
30883874 }
30893875 }
30903876 catch (Exception e)
....@@ -3121,9 +3907,9 @@
31213907 obj = (Object3D)e.nextElement();
31223908
31233909 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
31253911 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
31273913
31283914 // System.err.println((size/1024) + " KB is the size of " + obj);
31293915 }
....@@ -3165,6 +3951,20 @@
31653951 void GenNormals(boolean crease)
31663952 {
31673953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
3961
+
3962
+ refreshContents();
3963
+ }
3964
+
3965
+ void GenNormalsMINE()
3966
+ {
3967
+ group.selection.GenNormalsMINE();
31683968
31693969 refreshContents();
31703970 }
....@@ -3250,7 +4050,7 @@
32504050 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32514051 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32524052 //
3253
-// g.add(GraphreeD.clipboard);
4053
+// g.add(GrafreeD.clipboard);
32544054 //
32554055 // buffer.add(g);
32564056 // }
....@@ -3269,8 +4069,8 @@
32694069 // nodes = new Object3D();
32704070 // vertices = new Vector<Vertex>();
32714071 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
4072
+// boolean epsequal = GrafreeD.epsequal;
4073
+// GrafreeD.epsequal = true;
32744074 //
32754075 // for (int i=0; i<group.selection.size(); i++)
32764076 // {
....@@ -3311,7 +4111,7 @@
33114111 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124112 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134113 //
3314
-// g.add(GraphreeD.clipboard);
4114
+// g.add(GrafreeD.clipboard);
33154115 //
33164116 // buffer.add(g);
33174117 // }
....@@ -3319,7 +4119,7 @@
33194119 // makeSomething(buffer, i==group.selection.size()-1);
33204120 // }
33214121 //
3322
-// GraphreeD.epsequal = epsequal;
4122
+// GrafreeD.epsequal = epsequal;
33234123 //
33244124 // //buffer = null;
33254125 // temprep = null;
....@@ -3330,8 +4130,8 @@
33304130
33314131 void ParseVertices()
33324132 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
33354135
33364136 for (int i=0; i<group.selection.size(); i++)
33374137 {
....@@ -3356,7 +4156,7 @@
33564156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584158
3359
- g.add(GraphreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
33604160
33614161 buffer.add(g);
33624162 }
....@@ -3371,7 +4171,7 @@
33714171 makeSomething(buffer, i==group.selection.size()-1);
33724172 }
33734173
3374
- GraphreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
33754175
33764176 refreshContents();
33774177 }
....@@ -3389,7 +4189,16 @@
33894189 String pigment = Object3D.GetPigment(tex);
33904190 //String bump = Object3D.GetBump(tex);
33914191
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.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
+ }
33934202
33944203 double s = v.s;
33954204
....@@ -3416,7 +4225,7 @@
34164225 scale /= 3;
34174226
34184227 scale /= 0xFF;
3419
- scale /= 4;
4228
+ // c'est quoi ca? scale /= 4;
34204229
34214230 //v.AO = scale;
34224231
....@@ -3437,12 +4246,26 @@
34374246
34384247 void Align()
34394248 {
4249
+ if (group.selection.size() == 0)
4250
+ return;
4251
+
4252
+ cVector bbmin = new cVector();
4253
+ cVector bbmax = new cVector();
4254
+
4255
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4256
+
4257
+ double dx = bbmax.x - bbmin.x;
4258
+ double dy = bbmax.y - bbmin.y;
4259
+ double dz = bbmax.z - bbmin.z;
4260
+
4261
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4262
+
34404263 for (int i=0; i<group.selection.size(); i++)
34414264 {
34424265 Object3D obj = group.selection.get(i);
34434266
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4267
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4268
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464269 }
34474270
34484271 refreshContents();
....@@ -3455,7 +4278,7 @@
34554278 // ref.SaveSupports();
34564279 // Object3D par = ref.parent;
34574280 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4281
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594282 // ref.parent = par;
34604283 // ref.RestoreSupports();
34614284
....@@ -3463,11 +4286,11 @@
34634286
34644287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654288
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
34684291 lowres.linkVerticesThis(null);
34694292 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
34714294
34724295 System.err.flush();
34734296
....@@ -3485,7 +4308,7 @@
34854308 // lowres.SaveSupports();
34864309 // par = lowres.parent;
34874310 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4311
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894312 Object3D newlow = CloneObject(lowres, false);
34904313 newlow.name = sn.switchobject.get(i).name;
34914314 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4330,7 @@
35074330 return;
35084331
35094332 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
35114334
35124335 Object3D newgroup = new Object3D("Po:" + poses.name);
35134336
....@@ -3676,7 +4499,7 @@
36764499 group.selection.RelinkToSupport(); // july 2014
36774500 System.out.println("DONE.");
36784501 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4502
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804503 }
36814504
36824505 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4524,20 @@
37014524
37024525 void ClipMesh()
37034526 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054528 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
37074530
37084531 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094532 content = ((cGroup)content).get(0);
37104533
37114534 // for (int i=0; i<group.selection.size(); i++)
37124535 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4536
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144537 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
37164539 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4540
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184541 System.out.println("DONE.");
37194542 refreshContents();
37204543 }
....@@ -3759,6 +4582,18 @@
37594582 void MarkLeaves(boolean hide)
37604583 {
37614584 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);
37624597 refreshContents();
37634598 }
37644599
....@@ -3833,28 +4668,25 @@
38334668 // }
38344669 // }
38354670
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38404671 void EditSelection(boolean newWindow)
38414672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
38424679 // aConstraints.gridy = 0;
38434680 for (int i=0; i<group.selection.size(); i++)
38444681 {
38454682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484685
38494686 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4687
+ if(elem != group || !newWindow)
38514688 {
3852
- // if (!(elem instanceof Composite))
3853
- // newWindow = false;
3854
- listUI.add(elem);
3855
- elem.openEditWindow(this, newWindow); //, false);
3856
- System.out.println("edit : " + elem);
3857
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
38584690 }
38594691 }
38604692 }
....@@ -3929,7 +4761,8 @@
39294761 //new Exception().printStackTrace();
39304762
39314763 freezemodel = true;
3932
-
4764
+ ClearUnpinned();
4765
+
39334766 /**/
39344767 //switch (event.id)
39354768 {
....@@ -3937,7 +4770,6 @@
39374770 //case 702: // Event.LIST_DESELECT
39384771 group.deselectAll();
39394772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414773 if (tps != null)
39424774 {
39434775 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +4778,39 @@
39464778
39474779 //if (child.parent != null)
39484780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
39494782 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534783 }
39544784 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4785
+// else
4786
+// {
4787
+// objEditor.SetMaterial(group); // .GetMaterial());
4788
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4789
+// System.err.println("info : " + group.GetPath());
4790
+// }
39614791
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.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))
39654793 CameraPane.flash = true;
39664794
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684796 // a camera
39694797 {
3970
- CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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
+ }
4803
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4804
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744805 }
39754806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
39764814 refreshContents();
39774815 //return true;
39784816 }
....@@ -3981,6 +4819,35 @@
39814819
39824820 freezemodel = false;
39834821 }
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
+ }
39844851
39854852 void linkSomething(Object3D thing)
39864853 {
....@@ -4052,16 +4919,19 @@
40524919 {
40534920 if (group.selection.isEmpty())
40544921 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
40564924 Composite tGroup = null;
40574925 if (group.selection.size() > 0) // 1)
40584926 {
40594927 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
40614929 }
40624930
40634931 if (cut)
40644932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
40654935 //int indices[] = jList.getSelectedIndices();
40664936 //for (int i = indices.length - 1; i >= 0; i--)
40674937 //jList.remove(indices[i]);
....@@ -4097,16 +4967,16 @@
40974967 //System.out.println("cut " + child);
40984968 //System.out.println("parent = " + child.parent);
40994969 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
41014971 tGroup.add/*Child*/(tmp);
41024972 else
4103
- GraphreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
41044974 }
41054975 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
41074977 tGroup.add/*Child*/(child);
41084978 else
4109
- GraphreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
41104980 }
41114981
41124982 //ResetModel();
....@@ -4138,21 +5008,23 @@
41385008 //System.out.println("cut " + elem);
41395009 //System.out.println("parent = " + elem.parent);
41405010 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
41425012 tGroup.add/*Child*/(tmp);
41435013 else
4144
- GraphreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
41455015 }
41465016 else
4147
- if (GraphreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
41485018 tGroup.add/*Child*/(child);
41495019 else
4150
- GraphreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
41515021 }
41525022
41535023 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
41565028 if (cut)
41575029 {
41585030 ResetModel();
....@@ -4162,11 +5034,15 @@
41625034
41635035 void paste(boolean expand)
41645036 {
4165
- // if (GraphreeD.clipboard == null)
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
5041
+ // if (GrafreeD.clipboard == null)
41665042 // return;
41675043 boolean first = true;
41685044
4169
- if (GraphreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
41705046 {
41715047 Composite temp;
41725048
....@@ -4177,7 +5053,7 @@
41775053 temp = (Composite)Applet3D.clipboard.deepCopy();
41785054 */
41795055 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5056
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41815057 {
41825058 Object3D child = (Object3D)e.nextElement();
41835059
....@@ -4191,7 +5067,7 @@
41915067 else
41925068 elem = child.deepCopy(); // ?
41935069 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5070
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41955071 // elem = elem.get(0);
41965072 makeSomething(elem, true); // ?? first);
41975073 //group.addChild(elem);
....@@ -4211,23 +5087,24 @@
42115087 //Object3D cb = Applet3D.clipboard;
42125088 //temp.addChild(cb);
42135089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.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());
42195095 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
42225098 }
42235099
5100
+ Globals.REPLACEONMAKE = keep;
42245101 ResetModel();
42255102 refreshContents();
42265103 }
42275104
4228
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
42295106 {
4230
-// if (GraphreeD.clipboard == null)
5107
+// if (GrafreeD.clipboard == null)
42315108 // return;
42325109
42335110 if (group.selection.size() != 1)
....@@ -4254,15 +5131,22 @@
42545131 if (copyit)
42555132 {
42565133 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
42585142 }
42595143 else
42605144 {
42615145 boolean first = true;
42625146
4263
- if (GraphreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
42645148 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
42665150 Object3D copy;
42675151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685152 {
....@@ -4272,7 +5156,7 @@
42725156 }
42735157 } else
42745158 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
42765160 }
42775161 }
42785162 }
....@@ -4349,6 +5233,10 @@
43495233
43505234 void group(Object3D csg, boolean grab)
43515235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
43525240 if (//false) // why??
43535241 !group.selection.isEmpty())
43545242 {
....@@ -4462,8 +5350,34 @@
44625350 //node.add(csg);
44635351 //makeSomething(node);
44645352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
44655354 }
44665355
5356
+ void Ungroup(Object3D g)
5357
+ {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
5362
+ if (g instanceof HiddenObject)
5363
+ {
5364
+ HiddenObject h = (HiddenObject) g;
5365
+
5366
+ for (int i=0; i<h.ActualSize(); i++)
5367
+ {
5368
+ objEditor.makeSomething(h.get(i), false);
5369
+ }
5370
+ }
5371
+ else
5372
+ {
5373
+ for (int i=0; i<g.Size(); i++)
5374
+ {
5375
+ objEditor.makeSomething(g.get(i), false);
5376
+ }
5377
+ }
5378
+ Globals.REPLACEONMAKE = keep;
5379
+ }
5380
+
44675381 void ungroup()
44685382 {
44695383 /*
....@@ -4657,21 +5571,6 @@
46575571 }
46585572 */
46595573
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755574 /*
46765575 public void Callback(Object obj)
46775576 {
....@@ -4695,26 +5594,9 @@
46955594 }
46965595 */
46975596
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155597 String GetFile(String dialogName)
47165598 {
4717
- if (GraphreeD.standAlone)
5599
+ if (Grafreed.standAlone)
47185600 {
47195601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205602 browser.show();
....@@ -4778,10 +5660,33 @@
47785660 cButton flashSelectionButton;
47795661 cButton editButton;
47805662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
47815664 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835665 cButton unselectButton;
47845666
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
+
47855690 cButton screenfitButton;
47865691 cButton screenfitpointButton;
47875692 cButton snapobjectButton;
....@@ -4793,14 +5698,6 @@
47935698
47945699 cButton setsupportButton;
47955700
4796
- cButton twoButton;
4797
- cButton sixButton;
4798
- cButton threeButton;
4799
- cButton sevenButton;
4800
- cButton fourButton; // full panel
4801
- cButton oneButton; // full XYZ
4802
- //cButton currentLayout;
4803
-
48045701 //
48055702 //Composite
48065703 Object3D // to do !!
....@@ -4810,9 +5707,11 @@
48105707 //JTree jTree;
48115708 private MenuItem lookAtItem;
48125709 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
48145711 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
48165715 private MenuItem cloneItem;
48175716 private MenuItem cloneSupportItem;
48185717 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5722,9 @@
48235722 private MenuItem resetsupportItem;
48245723 private MenuItem resetreferencesItem;
48255724 private MenuItem linkverticesItem;
5725
+ private MenuItem relinkverticesItem;
48265726 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
48285728 private MenuItem stepAllItem;
48295729 private MenuItem revertMeshItem;
48305730 private MenuItem poseMeshItem;
....@@ -4835,14 +5735,17 @@
48355735 private MenuItem mergeGeometriesItem;
48365736 private MenuItem copyItem;
48375737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
48385739 private MenuItem pasteLinkItem;
48395740 private MenuItem pasteCloneItem;
48405741 private MenuItem pasteExpandItem;
4841
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
48425743 private MenuItem clearAllItem;
48435744 private MenuItem genUVItem;
5745
+ private MenuItem genNormalsMESHItem;
48445746 private MenuItem genNormalsCADItem;
48455747 private MenuItem genNormalsORGANItem;
5748
+ private MenuItem genNormalsMINEItem;
48465749 private MenuItem stripifyItem;
48475750 private MenuItem unstripifyItem;
48485751 private MenuItem trimItem;
....@@ -4871,6 +5774,10 @@
48715774 private MenuItem showleavesItem;
48725775 private MenuItem markleavesItem;
48735776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
48745781
48755782 private MenuItem flipVItem;
48765783 private MenuItem unflipVItem;
....@@ -4882,14 +5789,17 @@
48825789 private MenuItem panoTexturesItem;
48835790
48845791 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
48865793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
5796
+ private MenuItem hideItem;
48875797 private MenuItem grabItem;
48885798 private MenuItem backItem;
48895799 private MenuItem frontItem;
48905800 private MenuItem cameraItem;
48915801 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
48935803 private MenuItem physicsItem;
48945804 private MenuItem frameselectorItem;
48955805 private MenuItem scriptNodeItem;
....@@ -4904,6 +5814,7 @@
49045814
49055815 private MenuItem resetParentItem;
49065816 private MenuItem repairParentItem;
5817
+ private MenuItem repairShadowItem;
49075818 private MenuItem sortbysizeItem;
49085819 private MenuItem sortbynameItem;
49095820
....@@ -4912,6 +5823,8 @@
49125823 private MenuItem attachBumpItem;
49135824 private MenuItem detachBumpItem;
49145825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
49155828
49165829 private MenuItem particleItem;
49175830 private MenuItem ragdollItem;
....@@ -4924,10 +5837,11 @@
49245837 private MenuItem coneItem;
49255838 private MenuItem torusItem;
49265839 private MenuItem superItem;
5840
+ private MenuItem kleinItem;
49275841 private MenuItem blobItem;
49285842 private MenuItem latheItem;
49295843 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
49315845 private MenuItem meshItem;
49325846 // private MenuItem meshGroupItem;
49335847 private MenuItem springItem;
....@@ -4936,6 +5850,7 @@
49365850 private MenuItem csgItem;
49375851 private MenuItem templateItem;
49385852 private MenuItem textureItem;
5853
+ private MenuItem billboardItem;
49395854 private MenuItem shadowXItem;
49405855 private MenuItem shadowYItem;
49415856 private MenuItem shadowZItem;
....@@ -4948,11 +5863,6 @@
49485863 private MenuItem doubleItem;
49495864 private MenuItem tripleItem;
49505865
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565866 private MenuItem computeAOItem;
49575867 private MenuItem recompileItem;
49585868 private MenuItem editScriptItem;
....@@ -4962,4 +5872,8 @@
49625872 private MenuItem analyzeItem;
49635873 private MenuItem dumpItem;
49645874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
49655879 }