Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
GroupEditor.java
....@@ -12,9 +12,10 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
17
-class GroupEditor extends ObjEditor implements iParse, //iCallBack,
18
+class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
1819 ObjectUI,
1920 Runnable,
2021 ActionListener,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
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));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,131 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ oe.jTree = new cTree();
154
+
155
+ Menu menu;
156
+ oe.menuBar.add(menu = new Menu("Edit"));
157
+ //editItem = menu.add(new MenuItem("Edit"));
158
+ //editItem.addActionListener(this);
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
166
+ duplicateItem.addActionListener(this);
167
+ cloneItem = menu.add(new MenuItem("Clone"));
168
+ cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
171
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
172
+ cloneSupportItem.addActionListener(this);
173
+ }
174
+ menu.add("-");
175
+ cutItem = menu.add(new MenuItem("Cut"));
176
+ cutItem.addActionListener(this);
177
+ copyItem = menu.add(new MenuItem("Copy"));
178
+ copyItem.addActionListener(this);
179
+ pasteItem = menu.add(new MenuItem("Paste"));
180
+ pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
185
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
186
+ pasteLinkItem.addActionListener(this);
187
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
188
+ pasteCloneItem.addActionListener(this);
189
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190
+// pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
192
+ clearItem = menu.add(new MenuItem("Clear"));
193
+ clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
198
+ clearAllItem = menu.add(new MenuItem("Clear All"));
199
+ clearAllItem.addActionListener(this);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
+ revertCameraItem.addActionListener(this);
209
+
210
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+ toggleFullScreenItem.addItemListener(this);
212
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+ cameraMenu.add("-");
214
+
215
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+ toggleTextureItem.addItemListener(this);
217
+ toggleTextureItem.setState(CameraPane.textureon);
218
+
219
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+ toggleSwitchItem.addItemListener(this);
221
+ toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
237
+
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
152276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154278 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,44 +284,17 @@
160284 lookAtItem.addActionListener(this);
161285 //lookFromItem.addActinoListener(this);
162286 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
193
- resetMeshItem.addActionListener(this);
194
- stepAllItem = menu.add(new MenuItem("Step All"));
195
- stepAllItem.addActionListener(this);
287
+ }
288
+
289
+ oe.menuBar.add(menu = new Menu("Setting"));
290
+ if (Globals.ADVANCED)
291
+ {
196292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197293 revertMeshItem.addActionListener(this);
198294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199295 resetreferencesItem.addActionListener(this);
200296 menu.add("-");
297
+ }
201298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202299 overwriteGeoItem.addActionListener(this);
203300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +306,105 @@
209306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210307 overwriteUVItem.addActionListener(this);
211308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
212311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213312 generateMeshItem.addActionListener(this);
214313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215314 poseMeshItem.addActionListener(this);
216315 menu.add("-");
316
+ }
217317 resetsupportItem = menu.add(new MenuItem("Reset support"));
218318 resetsupportItem.addActionListener(this);
219319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220320 linkverticesItem.addActionListener(this);
321
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
322
+ relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
221326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222327 setMasterItem.addActionListener(this);
328
+ }
223329
224
- oe.menuBar.add(menu = new Menu("Object"));
330
+ oe.menuBar.add(menu = new Menu("Group"));
225331 grabItem = menu.add(new MenuItem("Grab"));
226332 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229333 backItem = menu.add(new MenuItem("Back"));
230334 backItem.addActionListener(this);
335
+ frontItem = menu.add(new MenuItem("Front"));
336
+ frontItem.addActionListener(this);
231337 compositeItem = menu.add(new MenuItem("Composite"));
232338 compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
343
+ hideItem.addActionListener(this);
344
+ }
345
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
346
+ ungroupItem.addActionListener(this);
347
+
233348 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
349
+
350
+ randomItem = menu.add(new MenuItem("Switch node"));
235351 randomItem.addActionListener(this);
236
- physicsItem = menu.add(new MenuItem("Physics"));
237
- physicsItem.addActionListener(this);
238
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
239
- frameselectorItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
240354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241355 switchGeoItem.addActionListener(this);
242356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243357 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
245359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
246366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247367 scriptNodeItem.addActionListener(this);
248368 cameraItem = menu.add(new MenuItem("Camera"));
249369 cameraItem.addActionListener(this);
250
- menu.add("-");
370
+ }
371
+
372
+ oe.menuBar.add(menu = new Menu("Object"));
251373 textureItem = menu.add(new MenuItem("Texture"));
252374 textureItem.addActionListener(this);
375
+ billboardItem = menu.add(new MenuItem("Billboard"));
376
+ billboardItem.addActionListener(this);
253377 csgItem = menu.add(new MenuItem("CSG"));
254378 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
379
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256380 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
381
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258382 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
383
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260384 shadowZItem.addActionListener(this);
385
+ if (Globals.ADVANCED)
386
+ {
387
+ menu.add("-");
261388 linkerItem = menu.add(new MenuItem("Linker"));
262389 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265390 attributeItem = menu.add(new MenuItem("Attribute"));
266391 attributeItem.addActionListener(this);
392
+ templateItem = menu.add(new MenuItem("Template"));
393
+ templateItem.addActionListener(this);
267394 pointflowItem = menu.add(new MenuItem("Point Flow"));
268395 pointflowItem.addActionListener(this);
396
+ }
269397 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272398 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273399 resetTransformItem.addActionListener(this);
274400 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275401 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
402
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
403
+ resetCentroidXZItem.addActionListener(this);
404
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
405
+ transformGeometryItem.addActionListener(this);
406
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
407
+ transformChildrenItem.addActionListener(this);
278408
279409 oe.menuBar.add(menu = new Menu("Geometry"));
280410 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +413,13 @@
283413 genNormalsORGANItem.addActionListener(this);
284414 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285415 genNormalsCADItem.addActionListener(this);
416
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
417
+ genNormalsMESHItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
420
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
421
+ genNormalsMINEItem.addActionListener(this);
422
+ }
286423 stripifyItem = menu.add(new MenuItem("Stripify"));
287424 stripifyItem.addActionListener(this);
288425 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +429,6 @@
292429 untrimItem = menu.add(new MenuItem("Untrim"));
293430 untrimItem.addActionListener(this);
294431 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297432 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298433 clearColorsItem.addActionListener(this);
299434 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +441,34 @@
306441 reduce34MeshItem.addActionListener(this);
307442 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308443 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311444 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312445 clipMeshItem.addActionListener(this);
446
+
447
+ if (Globals.ADVANCED)
448
+ {
449
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
450
+ smoothMeshItem.addActionListener(this);
451
+ }
452
+
453
+ oe.menuBar.add(menu = new Menu("Attributes"));
454
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
455
+ clearMaterialsItem.addActionListener(this);
456
+ resetAllItem = menu.add(new MenuItem("Reset All"));
457
+ resetAllItem.addActionListener(this);
458
+ stepAllItem = menu.add(new MenuItem("Step All"));
459
+ stepAllItem.addActionListener(this);
313460 menu.add("-");
314461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315462 liveleavesItem.addActionListener(this);
316463 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317464 unliveleavesItem.addActionListener(this);
465
+ if (Globals.ADVANCED)
466
+ {
318467 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319468 supportleavesItem.addActionListener(this);
320469 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321470 unsupportleavesItem.addActionListener(this);
471
+ }
322472 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323473 hideleavesItem.addActionListener(this);
324474 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +477,31 @@
327477 markleavesItem.addActionListener(this);
328478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329479 unmarkleavesItem.addActionListener(this);
480
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
481
+ rewindleavesItem.addActionListener(this);
482
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
483
+ unrewindleavesItem.addActionListener(this);
484
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
485
+ randomleavesItem.addActionListener(this);
486
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
487
+ unrandomleavesItem.addActionListener(this);
330488 menu.add("-");
331489 flipVItem = menu.add(new MenuItem("Flip V"));
332490 flipVItem.addActionListener(this);
333491 unflipVItem = menu.add(new MenuItem("Unflip V"));
334492 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
493
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336494 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
495
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338496 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
497
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340498 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
499
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342500 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
501
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344502 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
503
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346504 panoTexturesItem.addActionListener(this);
347
- menu.add("-");
348
- extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
349
- extractGeometriesItem.addActionListener(this);
350
- cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
351
- cloneGeometriesItem.addActionListener(this);
352
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
353
- shareGeometriesItem.addActionListener(this);
354
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
355
- mergeGeometriesItem.addActionListener(this);
356505
357506 oe.menuBar.add(menu = new Menu("Selection"));
358507 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,14 +519,41 @@
370519 sortbysizeItem.addActionListener(this);
371520 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372521 sortbynameItem.addActionListener(this);
522
+ menu.add("-");
523
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
524
+ shareGeometriesItem.addActionListener(this);
525
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
526
+ mergeGeometriesItem.addActionListener(this);
527
+ if (Globals.ADVANCED)
528
+ {
529
+ // Pretty much the same as duplicate and clone.
530
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
531
+ extractGeometriesItem.addActionListener(this);
532
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
533
+ cloneGeometriesItem.addActionListener(this);
534
+ }
535
+
373536 oe.menuBar.add(menu = new Menu("Insert"));
374537 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
538
+
539
+ oe.menuBar.add(menu = new Menu("Tools"));
376540 buildToolsMenu(menu);
377541 }
378542
379543 void SetupUI2(ObjEditor oe)
380544 {
545
+ // June 2019
546
+ if (oe == null)
547
+ {
548
+ //super.SetupUI2(this);
549
+ //return;
550
+ }
551
+
552
+ if (copy != group)
553
+ {
554
+ //super.SetupUI2(this);
555
+ }
556
+
381557 //new Exception().printStackTrace();
382558
383559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +582,171 @@
406582 oe.radioPanel.add(dummyButton);
407583 oe.buttonGroup.add(dummyButton);
408584 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
585
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412586
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ //minButton.setToolTipText("Minimize window");
589
+ //minButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ maxButton.setToolTipText("Maximize window");
593
+ maxButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ fullButton.setToolTipText("Full-screen window");
597
+ fullButton.addActionListener(this);
598
+
599
+ oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ undoButton.setToolTipText("Undo changes");
601
+ undoButton.addActionListener(this);
602
+
603
+ oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604
+ redoButton.setToolTipText("Redo changes");
605
+ redoButton.addActionListener(this);
606
+
607
+ oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ saveButton.setToolTipText("Save changes");
609
+ saveButton.addActionListener(this);
610
+
611
+ oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612
+ liveCB.setToolTipText("Enable animation");
414613 liveCB.addItemListener(this);
415614
416
- oe.aConstraints.gridx += 1;
417
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
418
- supportCB.addItemListener(this);
419
-
420
- // oe.aConstraints.gridx += 1;
421
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
422
- // localCB.addItemListener(this);
423
-
424
- oe.aConstraints.gridx += 1;
425
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
426
- crowdCB.addItemListener(this);
427
-
428
- oe.aConstraints.gridx += 1;
429
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
430
- smoothCB.addItemListener(this);
431
-
432
- oe.aConstraints.gridx += 1;
433
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ oneStepButton.setToolTipText("Animate one step forward");
617
+ oneStepButton.addActionListener(this);
618
+
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620
+ fastCB.setToolTipText("Fast mode");
434621 fastCB.addItemListener(this);
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
437
- slowCB.addItemListener(this);
438
- oe.aConstraints.gridx += 1;
439
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
440
- boxCB.addItemListener(this);
441
-
442
-// oe.aConstraints.gridx += 1;
443
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
444
-// speakerMocapCB.addItemListener(this);
445
-
446
- if (false)
447
- {
448
- // handled in scripts
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
451
- speakerCameraCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
455
- speakerFocusCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
459
- smoothfocusCB.addItemListener(this);
460
- }
461
-
462
-//oe.aConstraints.gridx += 1;
463
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
464
-// debugCB.addItemListener(this);
465
-
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
468
- oeilCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
472
- lookAtCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
622
+
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
626
+ trackCB.setToolTipText("Enable tracking");
476627 trackCB.addItemListener(this);
477628
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ screenfitButton.setToolTipText("Screen fit");
480631 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
632
+
482633 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483634 // screenfitpointButton.addActionListener(this);
484
-// oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
486
- snapobjectButton.addActionListener(this);
487
- oe.aConstraints.gridx += 1;
488635
489
- //aConstraints.gridx = 0;
490
- //aConstraints.gridy += 1;
491
- oe.aConstraints.weighty = 0;
492
- oe.aConstraints.gridwidth = 1;
493
-
494
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
636
+ if (Globals.ADVANCED)
637
+ {
638
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ snapobjectButton.addActionListener(this);
640
+ snapobjectButton.setToolTipText("Snap Object");
641
+ }
642
+
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ flashSelectionButton.setToolTipText("Highlight selection");
495645 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499646
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
648
+
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ twoButton.setToolTipText("Show center view only");
502651 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
652
+ this.fullscreenLayout = twoButton;
653
+
654
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504655 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
656
+ fourButton.setToolTipText("Show left panel only");
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ sixButton.setToolTipText("2-column layout left");
506659 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ threeButton.setToolTipText("2-column layout right");
508662 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ sevenButton.setToolTipText("3-column layout");
510665 sevenButton.addActionListener(this);
511666 //
512667
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ rootButton.setToolTipText("Edit selection in new tab");
514670 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
671
+
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ closeButton.setToolTipText("Close tab");
517674 closeButton.addActionListener(this);
518675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519676 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521
-
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
524
- editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528677
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
678
+ // INSERT
679
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
680
+ gridButton.setToolTipText("Create grid");
681
+ gridButton.addActionListener(this);
682
+
683
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ boxButton.setToolTipText("Create box");
685
+ boxButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ sphereButton.setToolTipText("Create sphere");
689
+ sphereButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.Return();
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
717
+ overlayButton.setToolTipText("Create overlay");
718
+ overlayButton.addActionListener(this);
719
+
720
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ lightButton.setToolTipText("Create light");
722
+ lightButton.addActionListener(this);
723
+
724
+ // EDIT panel
725
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
+ editButton.setToolTipText("Edit selection");
727
+ editButton.addActionListener(this);
728
+
729
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ uneditButton.setToolTipText("Unedit selection");
530731 uneditButton.addActionListener(this);
531732
532
- oe.aConstraints.gridx += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
537
- clearPanelButton.addActionListener(this);
538
-
539
- oe.aConstraints.gridx += 1;
540
- oe.aConstraints.weighty = 0;
541
- oe.aConstraints.gridwidth = 1;
542
-
543
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
733
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
+ allParamsButton.setToolTipText("Edit all params");
544735 allParamsButton.addActionListener(this);
545736
546
- oe.aConstraints.gridx += 1;
547
- oe.aConstraints.weighty = 0;
548
- oe.aConstraints.gridwidth = 1;
549
-
550
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
737
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ clearPanelButton.setToolTipText("Clear edit panel");
739
+ clearPanelButton.addActionListener(this);
740
+
741
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ unselectButton.setToolTipText("Unselect");
551743 unselectButton.addActionListener(this);
552744
745
+ editCommandsPanel.preferredHeight = 1;
746
+
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
749
+
553750 // oe.aConstraints.gridx += 1;
554751 // oe.aConstraints.weighty = 0;
555752 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +758,37 @@
561758 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562759 // gcButton.addActionListener(this);
563760
564
- oe.aConstraints.gridx = 0;
565
- oe.aConstraints.gridy += 1;
566
-
567
- //ctrlPanel.add(objList = new List(5, true));
568
- oe.aConstraints.gridwidth = 100;
569
- // oe.aConstraints.gridheight = 100;
570
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
571
- oe.aConstraints.gridheight = 1;
572
- oe.aConstraints.weighty = 0.5;
573
- oe.aConstraints.gridx = 0;
574
- JScrollPane jSP;
761
+ cGridBag jSPPanel = new cGridBag();
762
+
763
+ JScrollPane jSP;
575764 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
576
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
577766 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
767
+
768
+ oe.treePanel.add(jSPPanel);
769
+ oe.treePanel.Return();
582770
583
- oe.aConstraints.weighty = 0;
584
- oe.aConstraints.gridwidth = 2;
585
-
586
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
771
+ cGridBag copyOptionsPanel = new cGridBag();
772
+
773
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
774
+ colorCB.setToolTipText("Copy color when dropped");
587775 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
776
+
777
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
778
+ materialCB.setToolTipText("Copy material when dropped");
590779 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
780
+
781
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
782
+ textureCB.setToolTipText("Copy texture when dropped");
593783 textureCB.addItemListener(this);
594784
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
785
+ copyOptionsPanel.preferredHeight = 1;
786
+ oe.treePanel.add(copyOptionsPanel);
787
+ oe.treePanel.Return();
597788
789
+// mainPanel.setDividerLocation(0.5); //1.0);
790
+// mainPanel.setResizeWeight(0.5);
791
+
598792 //jList.addListSelectionListener(this);
599793 oe.jTree.addTreeSelectionListener(this);
600794 //jTree.setRootVisible(false);
....@@ -616,20 +810,115 @@
616810 radio.layout = sevenButton;
617811 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618812 }
813
+
814
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
815
+ {
816
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
817
+ boxCB.setToolTipText("Display bounding boxes");
818
+ boxCB.addItemListener(this);
819
+
820
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
821
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
822
+ zoomBoxCB.addItemListener(this);
823
+
824
+ if (true) // Globals.ADVANCED)
825
+ {
826
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
827
+ supportCB.setToolTipText("Enable rigging");
828
+ supportCB.addItemListener(this);
829
+
830
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
831
+ // localCB.addItemListener(this);
832
+
833
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
834
+ crowdCB.setToolTipText("Used for crowds");
835
+ crowdCB.addItemListener(this);
836
+
837
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
838
+ smoothCB.setToolTipText("Snapping delay");
839
+ smoothCB.addItemListener(this);
840
+
841
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
842
+ slowCB.setToolTipText("Smooth interpolation");
843
+ slowCB.addItemListener(this);
844
+
845
+// constraints.gridy += 1;
846
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
847
+// speakerMocapCB.addItemListener(this);
848
+
849
+ if (false)
850
+ {
851
+ // handled in scripts
852
+ //constraints.gridy += 1;
853
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
854
+ speakerCameraCB.addItemListener(this);
855
+
856
+ //constraints.gridy += 1;
857
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
858
+ speakerFocusCB.addItemListener(this);
859
+
860
+ //constraints.gridy += 1;
861
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
862
+ smoothfocusCB.addItemListener(this);
863
+ }
864
+
865
+//constraints.gridx += 1;
866
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
867
+// debugCB.addItemListener(this);
868
+
869
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
871
+ oeilCB.addItemListener(this);
872
+
873
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
+ shadowCB.setToolTipText("Compute shadows when live");
875
+ shadowCB.addItemListener(this);
876
+
877
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
+ autosaveCB.setToolTipText("Auto-save on structure change");
879
+ autosaveCB.addItemListener(this);
880
+
881
+ if (Globals.ADVANCED)
882
+ {
883
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
884
+ lookAtCB.setToolTipText("Look-at target");
885
+ lookAtCB.addItemListener(this);
886
+ }
887
+
888
+ }
889
+
890
+ cGridBag fill = new cGridBag();
891
+
892
+ fill.preferredHeight = 200;
893
+
894
+ panel.add(fill);
895
+
896
+ }
619897
620898 void EditObject(Object3D obj)
621899 {
622
- cRadio dummyButton = new cRadio(obj.name);
623
- dummyButton.SetObject(obj);
624
- dummyButton.layout = sevenButton;
625
- dummyButton.SetCamera(cameraView.renderCamera, false);
626
- dummyButton.addActionListener(this);
627
- radioPanel.add(dummyButton);
628
- buttonGroup.add(dummyButton);
629
- dummyButton.doClick();
900
+ cRadio radioButton = new cRadio(obj.name);
901
+
902
+ // Patch to avoid bug with transparency.
903
+ radioButton.hadMaterial = obj.material != null;
904
+ if (!radioButton.hadMaterial)
905
+ {
906
+ obj.material = new cMaterial();
907
+ }
908
+
909
+ radioButton.SetObject(obj);
910
+ radioButton.layout = sevenButton;
911
+ radioButton.SetCamera(cameraView.renderCamera, false);
912
+ radioButton.addActionListener(this);
913
+ radioPanel.add(radioButton);
914
+ buttonGroup.add(radioButton);
915
+ radioButton.doClick();
630916 }
917
+
631918 void SetupViews(ObjEditor oe)
632919 {
920
+ theFrame = this;
921
+
633922 oe.SetupViews();
634923
635924 System.out.println("SetupViews");
....@@ -638,22 +927,26 @@
638927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
639928 }
640929
641
- JCheckBox liveCB;
642
- JCheckBox supportCB;
643
- JCheckBox localCB;
644
- JCheckBox crowdCB;
645
- JCheckBox smoothCB;
646
- JCheckBox fastCB;
647
- JCheckBox slowCB;
648
- JCheckBox boxCB;
649
- JCheckBox trackCB;
650
- JCheckBox smoothfocusCB;
930
+ cToggleButton liveCB;
931
+ cCheckBox supportCB;
932
+ cCheckBox localCB;
933
+ cCheckBox crowdCB;
934
+ cCheckBox smoothCB;
935
+ cToggleButton fastCB;
936
+ cCheckBox slowCB;
937
+ cCheckBox boxCB;
938
+ cCheckBox zoomBoxCB;
939
+ cToggleButton trackCB;
940
+ cCheckBox smoothfocusCB;
651941 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
657950
658951 // static int COLOR = 1;
659952 // static int MATERIAL = 2;
....@@ -661,9 +954,9 @@
661954
662955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
663956
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
667960
668961 public void itemStateChanged(ItemEvent e)
669962 {
....@@ -688,10 +981,10 @@
688981 dropAttributes |= Object3D.TEXTURE;
689982 else
690983 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
984
+ } else if(e.getSource() == liveCB)
693985 {
694986 cameraView.ToggleLive();
987
+ refreshContents(false);
695988 }
696989 else if(e.getSource() == supportCB)
697990 {
....@@ -727,6 +1020,10 @@
7271020 cameraView.repaint();
7281021 // refreshContents();
7291022 }
1023
+ else if(e.getSource() == zoomBoxCB)
1024
+ {
1025
+ cameraView.ToggleZoomBoxMode();
1026
+ }
7301027 else if(e.getSource() == smoothfocusCB)
7311028 {
7321029 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1049,14 @@
7521049 {
7531050 cameraView.ToggleOeil();
7541051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
7551060 else if(e.getSource() == lookAtCB)
7561061 {
7571062 cameraView.ToggleLookAt();
....@@ -768,7 +1073,8 @@
7681073
7691074 /**/
7701075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
7721078 if ((path == null) || (path.getPathCount() <= 1)) {
7731079 // We can't move the root node or an empty selection
7741080 return;
....@@ -840,7 +1146,9 @@
8401146 // objEditor.DropFile((java.io.File[]) object, true);
8411147 // return;
8421148 // }
843
- if (string.charAt(0) == '/')
1149
+
1150
+ // File path for Mac and Windows
1151
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441152 {
8451153 // file(s)
8461154 String[] names = string.split("\n");
....@@ -867,7 +1175,7 @@
8671175
8681176 flashIt = false;
8691177 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1178
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711179 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721180
8731181 if (group.selection.size() == 1)
....@@ -890,16 +1198,16 @@
8901198 return;
8911199 }
8921200
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
894
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
8951203 loadClipboard(true);
8961204 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1205
+ pasteInto(false, false);
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
9031211 }
9041212 public void dropActionChanged(DropTargetDragEvent dtde)
9051213 // Called if the user has modified the current drop gesture
....@@ -1002,6 +1310,8 @@
10021310
10031311 void buildCreateMenu(Menu menu)
10041312 {
1313
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1314
+ //heightFieldItem.addActionListener(this);
10051315 gridItem = menu.add(new MenuItem("Grid"));
10061316 gridItem.addActionListener(this);
10071317 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1324,37 @@
10141324 torusItem.addActionListener(this);
10151325 superItem = menu.add(new MenuItem("Superellipsoid"));
10161326 superItem.addActionListener(this);
1327
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1328
+ kleinItem.addActionListener(this);
10171329 particleItem = menu.add(new MenuItem("Particle system"));
10181330 particleItem.addActionListener(this);
1331
+ if (Globals.ADVANCED)
1332
+ {
10191333 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201334 ragdollItem.addActionListener(this);
10211335 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221336 ragdoll2Item.addActionListener(this);
1337
+ }
10231338 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1339
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251340 meshItem.addActionListener(this);
10261341 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271342 // meshGroupItem.addActionListener(this);
1343
+ if (Globals.ADVANCED)
1344
+ {
10281345 springItem = menu.add(new MenuItem("Spring"));
10291346 springItem.addActionListener(this);
10301347 flagItem = menu.add(new MenuItem("Flag"));
10311348 flagItem.addActionListener(this);
1032
- bezierItem = menu.add(new MenuItem("Patch"));
1033
- bezierItem.addActionListener(this);
1034
- checkerItem = menu.add(new MenuItem("Checker"));
1035
- checkerItem.addActionListener(this);
10361349 blobItem = menu.add(new MenuItem("Blob"));
10371350 blobItem.addActionListener(this);
10381351 latheItem = menu.add(new MenuItem("Lathe"));
10391352 latheItem.addActionListener(this);
1353
+ }
1354
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1355
+ bezierItem.addActionListener(this);
1356
+ overlayItem = menu.add(new MenuItem("Overlay"));
1357
+ overlayItem.addActionListener(this);
10401358 lightItem = menu.add(new MenuItem("Light"));
10411359 lightItem.addActionListener(this);
10421360 menu.add("-");
....@@ -1046,46 +1364,44 @@
10461364 loopItem.addActionListener(this);
10471365 doubleItem = menu.add(new MenuItem("Fork"));
10481366 doubleItem.addActionListener(this);
1367
+ if (Globals.ADVANCED)
1368
+ {
10491369 tripleItem = menu.add(new MenuItem("Trident"));
10501370 tripleItem.addActionListener(this);
1051
- menu.add("-");
1052
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
1053
- importGFDItem.addActionListener(this);
1054
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
1055
- importVRMLX3DItem.addActionListener(this);
1056
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
1057
- importOBJItem.addActionListener(this);
1058
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
1059
- import3DSItem.addActionListener(this);
1371
+ }
10601372 }
10611373
10621374 void buildToolsMenu(Menu menu)
10631375 {
10641376 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651377 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1378
+ animationItem.setState(Globals.ANIMATION);
10671379
10681380 menu.add("-");
10691381 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701382 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1383
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1384
+ textureFieldItem.addActionListener(this);
1385
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721386 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751387 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761388 reduceMorphItem.addActionListener(this);
10771389 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781390 reduce34MorphItem.addActionListener(this);
1079
-
1391
+ menu.add("-");
10801392 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811393 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831394
1395
+ if (Globals.ADVANCED)
1396
+ {
1397
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1398
+ mirrorItem.addActionListener(this);
1399
+ menu.add("-");
10841400 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851401 memoryItem.addActionListener(this);
10861402 menu.add(analyzeItem = new MenuItem("Analyze"));
10871403 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
10891405 dumpItem.addActionListener(this);
10901406 // menu.add(pathItem = new MenuItem("From-to path"));
10911407 // pathItem.addActionListener(this);
....@@ -1094,6 +1410,8 @@
10941410 resetParentItem.addActionListener(this);
10951411 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961412 repairParentItem.addActionListener(this);
1413
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1414
+ repairShadowItem.addActionListener(this);
10971415 menu.add(invariantsItem = new MenuItem("Invariants"));
10981416 invariantsItem.addActionListener(this);
10991417 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1419,7 @@
11011419 menu.add("-");
11021420 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031421 editScriptItem.addActionListener(this);
1422
+ }
11041423 }
11051424
11061425 void ScreenFit()
....@@ -1223,6 +1542,7 @@
12231542 shadow.material = new cMaterial(obj.material);
12241543 shadow.material.diffuse = 0.0001f;
12251544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
12261546
12271547 makeSomething(shadow);
12281548 }
....@@ -1429,9 +1749,9 @@
14291749
14301750 void Overwrite(int mask)
14311751 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1752
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331753 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1754
+ Object3D content = Grafreed.clipboard.get(0);
14351755
14361756 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371757 content = ((cGroup)content).get(0);
....@@ -1454,6 +1774,7 @@
14541774 //
14551775 public void actionPerformed(ActionEvent event) // , Object arg)
14561776 {
1777
+ Object source = event.getSource();
14571778 /*
14581779 if (event.getSource() == nameField)
14591780 {
....@@ -1465,11 +1786,11 @@
14651786 }
14661787 else
14671788 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1789
+ if (source == lookAtItem || source == lookFromItem)
14691790 {
14701791 ScreenFit();
14711792 } else
1472
- if (event.getSource() == switchItem)
1793
+ if (source == switchItem)
14731794 {
14741795 cVector v1 = new cVector();
14751796 cVector v2 = new cVector();
....@@ -1478,11 +1799,11 @@
14781799 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791800 objEditor.cameraView.repaint();
14801801 } else
1481
- if (event.getSource() == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
14821803 {
14831804 makeSomething(new Box());
14841805 } else
1485
- if (event.getSource() == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
14861807 {
14871808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1824,9 @@
15031824 applyExample(particleGeom, "SMOKE");
15041825 makeSomething(particleGeom);
15051826 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1827
+ if (source == ragdollItem || source == ragdoll2Item)
15071828 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1829
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091830
15101831 ragdoll.toParent = LA.newMatrix();
15111832 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1842,71 @@
15211842 makeSomething(ragdoll);
15221843 //makeSomething(new VehicleDemo());
15231844 } else
1524
- if (event.getSource() == gridItem)
1845
+ /*
1846
+ */
1847
+ if (source == heightFieldItem)
1848
+ {
1849
+ Object3D obj = new Object3D();
1850
+
1851
+ obj.CreateMaterial();
1852
+ obj.bRep = new BoundaryRep();
1853
+
1854
+ obj.bRep.CreateMesh(new iHeightField()
1855
+ {
1856
+ public double f(double x, double y)
1857
+ {
1858
+ // The Mandelbrot set is represented by coloring
1859
+ // each point (x,y) according to the number of
1860
+ // iterations it takes before the while loop in
1861
+ // this method ends. For points that are actually
1862
+ // in the Mandelbrot set, or very close to it, the
1863
+ // count will reach the maximum value, 80. These
1864
+ // points will be colored purple. All other colors
1865
+ // represent points that are definitely NOT in the set.
1866
+ x -= 600;
1867
+ y -= 500;
1868
+ x /= 200;
1869
+ y /= 200;
1870
+ int count = 0;
1871
+ double zx = x;
1872
+ double zy = y;
1873
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1874
+ double new_zx = zx*zx - zy*zy + x;
1875
+ zy = 2*zx*zy + y;
1876
+ zx = new_zx;
1877
+ count++;
1878
+ }
1879
+ return count; // Math.sqrt(count);
1880
+ }
1881
+ }, 1000,1000);
1882
+
1883
+ makeSomething(obj);
1884
+ } else
1885
+ if (source == gridItem || source == gridButton)
15251886 {
15261887 makeSomething(new Grid());
15271888 } else
1528
- if (event.getSource() == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
15291890 {
15301891 makeSomething(new Sphere());
15311892 } else
1532
- if (event.getSource() == coneItem)
1893
+ if (source == coneItem || source == coneButton)
15331894 {
15341895 makeSomething(new Cone());
15351896 } else
1536
- if (event.getSource() == torusItem)
1897
+ if (source == torusItem || source == torusButton)
15371898 {
15381899 makeSomething(new Torus());
15391900 } else
1540
- if (event.getSource() == superItem)
1901
+ if (source == superItem || source == superButton)
15411902 {
15421903 makeSomething(new Superellipsoid());
15431904 } else
1544
- if (event.getSource() == blobItem)
1905
+ if (source == kleinItem || source == kleinButton)
1906
+ {
1907
+ makeSomething(new Klein());
1908
+ } else
1909
+ if (source == blobItem)
15451910 {
15461911 Blob blob = new Blob();
15471912 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1914,15 @@
15491914 //blob.retile();
15501915 makeSomething(blob);
15511916 } else
1552
- if (event.getSource() == latheItem)
1917
+ if (source == latheItem)
15531918 {
15541919 makeSomething(new Lathe());
15551920 } else
1556
- if (event.getSource() == bezierItem)
1921
+ if (source == bezierItem)
15571922 {
15581923 makeSomething(new BezierSurface());
15591924 } else
1560
- if (event.getSource() == checkerItem)
1925
+ if (source == overlayItem || source == overlayButton)
15611926 {
15621927 /*
15631928 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1935,9 @@
15701935 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711936 LA.matInvert(obj.toParent, obj.fromParent);
15721937 */
1573
- makeSomething(new CheckerIG());
1938
+ makeSomething(new Checker());
15741939 } else
1575
- if (event.getSource() == meshItem)
1940
+ if (source == meshItem)
15761941 {
15771942 Object3D itemtomake = new Object3D();
15781943 Object3D child;
....@@ -1593,35 +1958,35 @@
15931958 makeSomething(child);
15941959 }
15951960 } else
1596
- if (event.getSource() == springItem)
1961
+ if (source == springItem)
15971962 {
15981963 cSpring s = new cSpring();
15991964 s.setup();
16001965 makeSomething(s);
16011966 } else
1602
- if (event.getSource() == flagItem)
1967
+ if (source == flagItem)
16031968 {
16041969 cSpring s = new cFlag();
16051970 s.setup();
16061971 makeSomething(s);
16071972 } else
1608
- if (event.getSource() == lightItem)
1973
+ if (source == lightItem || source == lightButton)
16091974 {
16101975 makeSomething(new Light());
16111976 } else
1612
- if (event.getSource() == csgItem)
1977
+ if (source == csgItem)
16131978 {
16141979 group(new CSG());
16151980 } else
1616
- if (event.getSource() == templateItem)
1981
+ if (source == templateItem)
16171982 {
16181983 group(new cTemplate());
16191984 } else
1620
- if (event.getSource() == attributeItem)
1985
+ if (source == attributeItem)
16211986 {
16221987 makeSomething(new Attribute());
16231988 } else
1624
- if (event.getSource() == pointflowItem)
1989
+ if (source == pointflowItem)
16251990 {
16261991 makeSomething(new PointFlow());
16271992 } else
....@@ -1633,7 +1998,7 @@
16331998 } else
16341999 */
16352000
1636
- if (event.getSource() == superLoopItem)
2001
+ if (source == superLoopItem)
16372002 {
16382003 Composite g = new cGroup();
16392004 for (int i=0; i<15; i++)
....@@ -1655,7 +2020,7 @@
16552020
16562021 group(g);
16572022 } else
1658
- if (event.getSource() == loopItem)
2023
+ if (source == loopItem)
16592024 {
16602025 Composite csg = new GroupLeaf();
16612026 csg.count = 5;
....@@ -1664,7 +2029,7 @@
16642029 csg.addChild(child);
16652030 child.addChild(csg);
16662031 } else
1667
- if (event.getSource() == doubleItem)
2032
+ if (source == doubleItem)
16682033 {
16692034 Composite csg = new GroupLeaf();
16702035 csg.count = 5;
....@@ -1676,7 +2041,7 @@
16762041 csg.addChild(child);
16772042 child.addChild(csg);
16782043 } else
1679
- if (event.getSource() == tripleItem)
2044
+ if (source == tripleItem)
16802045 {
16812046 Composite csg = new GroupLeaf();
16822047 csg.count = 4;
....@@ -1691,71 +2056,83 @@
16912056 csg.addChild(child);
16922057 child.addChild(csg);
16932058 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2059
+ if (source == computeAOItem)
16962060 {
1697
- ImportGFD();
2061
+ Globals.drawMode = CameraPane.OCCLUSION;
2062
+ Globals.theRenderer.repaint();
16982063 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1700
- {
1701
- ImportVRMLX3D();
1702
- } else
1703
- if (event.getSource() == import3DSItem)
1704
- {
1705
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1706
- } else
1707
- if (event.getSource() == importOBJItem)
1708
- {
1709
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1710
- } else
1711
- if (event.getSource() == computeAOItem)
1712
- {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1715
- } else
1716
- if (event.getSource() == recompileItem)
2064
+ if (source == recompileItem)
17172065 {
17182066 Recompile();
17192067 refreshContents();
17202068 } else
1721
- if (event.getSource() == editScriptItem)
2069
+ if (source == editScriptItem)
17222070 {
17232071 OpenDialog();
17242072 refreshContents();
17252073 } else
1726
- if (event.getSource() == invariantsItem)
2074
+ if (source == invariantsItem)
17272075 {
17282076 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2077
+ Grafreed.grafreeD.universe.invariants();
17302078 } else
1731
- if (event.getSource() == memoryItem)
2079
+ if (source == memoryItem)
17322080 {
17332081 //System.out.println("Invariants:");
17342082 PrintMemory();
17352083 } else
1736
- if (event.getSource() == pathItem)
2084
+ if (source == pathItem)
17372085 {
17382086 PrintPath();
17392087 } else
1740
- if (event.getSource() == analyzeItem)
2088
+ if (source == analyzeItem)
17412089 {
17422090 AnalyzeObject();
17432091 } else
1744
- if (event.getSource() == dumpItem)
2092
+ if (source == dumpItem)
17452093 {
17462094 DumpObject();
17472095 } else
1748
- if (event.getSource() == screenfitButton)
2096
+ if (source == minButton)
2097
+ {
2098
+ Minimize();
2099
+ } else
2100
+ if (source == maxButton)
2101
+ {
2102
+ Maximize();
2103
+ } else
2104
+ if (source == fullButton)
2105
+ {
2106
+ ToggleFullScreen();
2107
+ } else
2108
+ if (source == undoButton)
2109
+ {
2110
+ Undo();
2111
+ } else
2112
+ if (source == redoButton)
2113
+ {
2114
+ Redo();
2115
+ } else
2116
+ if (source == saveButton)
2117
+ {
2118
+ Save();
2119
+ } else
2120
+ if (source == oneStepButton)
2121
+ {
2122
+ Globals.ONESTEP = true;
2123
+ cameraView.repaint();
2124
+ } else
2125
+ if (source == screenfitButton)
17492126 {
17502127 //Reload(lastConverter, lastFilename, true);
17512128 ScreenFit();
17522129 } else
1753
- if (event.getSource() == screenfitpointButton)
2130
+ if (source == screenfitpointButton)
17542131 {
17552132 //Reload(lastConverter, lastFilename, true);
17562133 ScreenFitPoint();
17572134 } else
1758
- if (event.getSource() == snapobjectButton)
2135
+ if (source == snapobjectButton)
17592136 {
17602137 //Reload(lastConverter, lastFilename, true);
17612138 SnapObject();
....@@ -1766,13 +2143,13 @@
17662143 // Recompile();
17672144 // refreshContents();
17682145 // } else
1769
- if (event.getSource() == gcButton)
2146
+ if (source == gcButton)
17702147 {
17712148 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722149 System.gc();
17732150 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742151 } else
1775
- if (event.getSource() == editLeafItem)
2152
+ if (source == editLeafItem)
17762153 {
17772154 Object3D obj;
17782155 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2163,78 @@
17862163 }
17872164 refreshContents(true);
17882165 } else
1789
- if (event.getSource() == openWindowItem)
2166
+ if (source == openWindowItem)
17902167 {
17912168 EditSelection(true);
17922169 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2170
+ if (source == cutItem || source == clearButton)
17942171 {
17952172 loadClipboard(true);
17962173 } else
1797
- if (event.getSource() == duplicateItem)
2174
+ if (source == undoItem)
17982175 {
1799
- Object3D keep = GraphreeD.clipboard;
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
2181
+ } else
2182
+ if (source == duplicateItem)
2183
+ {
2184
+ Object3D keep = Grafreed.clipboard;
18002185 loadClipboard(false);
18012186 paste(false);
1802
- GraphreeD.clipboard = keep;
2187
+ Grafreed.clipboard = keep;
18032188 } else
1804
- if (event.getSource() == cloneItem)
2189
+ if (source == cloneItem)
18052190 {
18062191 CloneSelection(false);
18072192 } else
1808
- if (event.getSource() == cloneSupportItem)
2193
+ if (source == cloneSupportItem)
18092194 {
18102195 CloneSelection(true);
18112196 } else
1812
- if (event.getSource() == copyItem)
2197
+ if (source == copyItem)
18132198 {
18142199 loadClipboard(false);
18152200 } else
1816
- if (event.getSource() == pasteItem)
2201
+ if (source == pasteItem)
18172202 {
18182203 paste(false);
18192204 } else
1820
- if (event.getSource() == pasteLinkItem)
2205
+ if (source == pasteIntoItem)
18212206 {
1822
- pasteInto(false);
2207
+ pasteInto(true, false);
18232208 } else
1824
- if (event.getSource() == pasteCloneItem)
2209
+ if (source == pasteLinkItem)
18252210 {
1826
- pasteInto(true);
2211
+ pasteInto(false, false);
18272212 } else
1828
- if (event.getSource() == pasteExpandItem)
2213
+ if (source == pasteCloneItem)
2214
+ {
2215
+ pasteInto(true, true);
2216
+ } else
2217
+ if (source == pasteExpandItem)
18292218 {
18302219 paste(true);
18312220 } else
1832
- if (event.getSource() == synchronizeItem)
2221
+ if (source == synchronizeItem)
18332222 {
18342223 Overwrite(Object3D.TRANSFORM);
18352224 } else
1836
- if (event.getSource() == overwriteNameItem)
2225
+ if (source == overwriteNameItem)
18372226 {
18382227 Overwrite(Object3D.NAME);
18392228 } else
1840
- if (event.getSource() == overwriteUVItem)
2229
+ if (source == overwriteUVItem)
18412230 {
18422231 Overwrite(Object3D.UV);
18432232 } else
1844
- if (event.getSource() == overwriteMatItem)
2233
+ if (source == overwriteMatItem)
18452234 {
2235
+ /* july 2015
18462236 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2237
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482238 else
18492239 {
18502240 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2246,16 @@
18562246 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572247 }
18582248 }
2249
+ */
2250
+
2251
+ Overwrite(dropAttributes);
18592252 }
1860
- if (event.getSource() == overwriteGeoItem)
2253
+ if (source == overwriteGeoItem)
18612254 {
18622255 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2256
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642257 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2258
+// Object3D content = GrafreeD.clipboard.get(0);
18662259 //
18672260 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682261 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2267,7 @@
18742267 // refreshContents();
18752268 // }
18762269 } else
1877
- if (event.getSource() == generateMeshItem)
2270
+ if (source == generateMeshItem)
18782271 {
18792272 //if (group.selection.size() == 1)
18802273 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2278,7 @@
18852278 ResetModel();
18862279 refreshContents();
18872280 } else
1888
- if (event.getSource() == extractGeometriesItem)
2281
+ if (source == extractGeometriesItem)
18892282 {
18902283 boolean one = false;
18912284
....@@ -1912,7 +2305,7 @@
19122305 ResetModel();
19132306 refreshContents();
19142307 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2308
+ if (source == cloneGeometriesItem)
19162309 {
19172310 boolean one = false;
19182311
....@@ -1938,32 +2331,37 @@
19382331 ResetModel();
19392332 refreshContents();
19402333 } else
1941
- if (event.getSource() == shareGeometriesItem)
2334
+ if (source == shareGeometriesItem)
19422335 {
19432336 boolean one = false;
19442337
19452338 if (group.selection.size() == 1)
19462339 one = true;
19472340
2341
+ Object3D merge = null;
2342
+
19482343 Object3D content = new cGroup();
19492344
19502345 for (int i=0; i<group.selection.size(); i++)
19512346 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2347
+ merge = new Merge(group.selection.get(i));
19532348
19542349 if (one)
1955
- makeSomething(sel, false);
2350
+ makeSomething(merge, false);
19562351 else
1957
- content.addChild(sel);
2352
+ content.addChild(merge);
19582353 }
19592354
19602355 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2356
+ makeSomething(content, true);
2357
+ else
2358
+ {
2359
+ ResetModel();
2360
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2361
+ refreshContents();
2362
+ }
19652363 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2364
+ if (source == mergeGeometriesItem)
19672365 {
19682366 boolean one = false;
19692367
....@@ -1993,11 +2391,11 @@
19932391 ResetModel();
19942392 refreshContents();
19952393 } else
1996
- if (event.getSource() == linkverticesItem)
2394
+ if (source == linkverticesItem)
19972395 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2396
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992397 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2398
+// Object3D content = GrafreeD.clipboard.get(0);
20012399 //
20022400 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032401 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2404,48 @@
20062404 // group.selection.get(0).setMasterThis(content); // should be identity
20072405 // refreshContents();
20082406 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2407
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102408 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2409
+ Object3D content = Grafreed.clipboard.get(0);
20122410
20132411 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142412 content = ((cGroup)content).get(0);
20152413
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2414
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172415 for (int i=0; i<group.selection.size(); i++)
20182416 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2417
+ boolean random = CameraPane.SWITCH;
2418
+ CameraPane.SWITCH = false; // parse all random nodes
20212419 group.selection.get(i).linkVerticesThis(content);
20222420 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2421
+ CameraPane.SWITCH = random;
20242422 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2423
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262424 refreshContents();
20272425 }
20282426 } else
2029
- if (event.getSource() == resetsupportItem)
2427
+ if (source == resetsupportItem)
20302428 {
20312429 for (int i=0; i<group.selection.size(); i++)
20322430 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2431
+ boolean random = CameraPane.SWITCH;
2432
+ CameraPane.SWITCH = false; // parse all random nodes
20352433 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2434
+ CameraPane.SWITCH = random;
20372435 }
20382436
20392437 refreshContents();
20402438 } else
2041
- if (event.getSource() == resetreferencesItem)
2439
+ if (source == relinkverticesItem)
2440
+ {
2441
+ boolean random = CameraPane.SWITCH;
2442
+ CameraPane.SWITCH = false; // parse all random nodes
2443
+ group.selection.RelinkToSupport();
2444
+ CameraPane.SWITCH = random;
2445
+
2446
+ refreshContents();
2447
+ } else
2448
+ if (source == resetreferencesItem)
20422449 {
20432450 for (int i=0; i<group.selection.size(); i++)
20442451 {
....@@ -2047,11 +2454,11 @@
20472454
20482455 refreshContents();
20492456 } else
2050
- if (event.getSource() == setMasterItem)
2457
+ if (source == setMasterItem)
20512458 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2459
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532460 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2461
+ Object3D content = Grafreed.clipboard.get(0);
20552462
20562463 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572464 content = ((cGroup)content).get(0);
....@@ -2060,13 +2467,13 @@
20602467 refreshContents();
20612468 }
20622469 } else
2063
- if (event.getSource() == poseMeshItem)
2470
+ if (source == poseMeshItem)
20642471 {
20652472 if (group.selection.size() == 1)
20662473 {
2067
- if (GraphreeD.clipboard.size() == 1)
2474
+ if (Grafreed.clipboard.size() == 1)
20682475 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2476
+ Object3D content = Grafreed.clipboard.get(0);
20702477
20712478 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722479 content = ((cGroup)content).get(0);
....@@ -2079,19 +2486,19 @@
20792486 }
20802487
20812488 } else
2082
- if (event.getSource() == revertMeshItem)
2489
+ if (source == revertMeshItem)
20832490 {
20842491 RevertMeshes();
20852492 } else
2086
- if (event.getSource() == resetMeshItem)
2493
+ if (source == resetAllItem)
20872494 {
20882495 ResetAll();
20892496 } else
2090
- if (event.getSource() == stepAllItem)
2497
+ if (source == stepAllItem)
20912498 {
20922499 StepAll();
20932500 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2501
+ if (source == clearItem) // || event.getSource() == clearButton)
20952502 {
20962503 //int indices[] = jList.getSelectedIndices();
20972504 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2506,46 @@
20992506
21002507 ClearSelection(false);
21012508 } else
2102
- if (event.getSource() == clearAllItem)
2509
+ if (source == clearAllItem)
21032510 {
21042511 ClearSelection(true);
21052512 } else
2106
- if (event.getSource() == grabItem)
2513
+ if (source == grabItem)
21072514 {
21082515 group(new cGroup(), true);
21092516 } else
2110
- if (event.getSource() == frontItem)
2517
+ if (source == hideItem)
2518
+ {
2519
+ group(new HiddenObject());
2520
+ } else
2521
+ if (source == frontItem)
21112522 {
21122523 front();
21132524 } else
2114
- if (event.getSource() == backItem)
2525
+ if (source == backItem)
21152526 {
21162527 back();
21172528 } else
2118
- if (event.getSource() == cameraItem)
2529
+ if (source == cameraItem)
21192530 {
21202531 makeSomething(new Camera());
21212532 } else
2122
- if (event.getSource() == compositeItem)
2533
+ if (source == compositeItem)
21232534 {
21242535 group(new Composite());
21252536 } else
2126
- if (event.getSource() == randomItem)
2537
+ if (source == randomItem)
21272538 {
21282539 RandomNode random = new RandomNode();
21292540 group(random);
21302541 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2542
+ random.name = random.get(0).name + "Switch";
21322543 } else
2133
- if (event.getSource() == physicsItem)
2544
+ if (source == physicsItem)
21342545 {
21352546 group(new PhysicsNode());
21362547 } else
2137
- if (event.getSource() == frameselectorItem)
2548
+ if (source == frameselectorItem)
21382549 {
21392550 for (int i=0; i<group.selection.size(); i++)
21402551 {
....@@ -2146,7 +2557,7 @@
21462557 ResetModel();
21472558 refreshContents();
21482559 } else
2149
- if (event.getSource() == switchGeoItem)
2560
+ if (source == switchGeoItem)
21502561 {
21512562 for (int i=0; i<group.selection.size(); i++)
21522563 {
....@@ -2158,7 +2569,7 @@
21582569 ResetModel();
21592570 refreshContents();
21602571 } else
2161
- if (event.getSource() == switchTransfoItem)
2572
+ if (source == switchTransfoItem)
21622573 {
21632574 for (int i=0; i<group.selection.size(); i++)
21642575 {
....@@ -2170,7 +2581,7 @@
21702581 ResetModel();
21712582 refreshContents();
21722583 } else
2173
- if (event.getSource() == morphItem)
2584
+ if (source == morphItem)
21742585 {
21752586 for (int i=0; i<group.selection.size(); i++)
21762587 {
....@@ -2182,7 +2593,7 @@
21822593 ResetModel();
21832594 refreshContents();
21842595 } else
2185
- if (event.getSource() == scriptNodeItem)
2596
+ if (source == scriptNodeItem)
21862597 {
21872598 boolean atleastone = false;
21882599
....@@ -2221,191 +2632,239 @@
22212632 }
22222633 }
22232634 } else
2224
- if (event.getSource() == linkerItem)
2635
+ if (source == linkerItem)
22252636 {
22262637 group(new cLinker());
22272638 } else
2228
- if (event.getSource() == textureItem)
2639
+ if (source == textureItem)
22292640 {
22302641 group(new TextureNode());
22312642 } else
2232
- if (event.getSource() == shadowXItem)
2643
+ if (source == billboardItem)
2644
+ {
2645
+ group(new BillboardNode());
2646
+ } else
2647
+ if (source == shadowXItem)
22332648 {
22342649 CastShadow(0);
22352650 } else
2236
- if (event.getSource() == shadowYItem)
2651
+ if (source == shadowYItem)
22372652 {
22382653 CastShadow(1);
22392654 } else
2240
- if (event.getSource() == shadowZItem)
2655
+ if (source == shadowZItem)
22412656 {
22422657 CastShadow(2);
22432658 } else
2244
- if (event.getSource() == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
22452660 {
2246
- ungroup();
2661
+ //ungroup();
2662
+ for (int i=0; i<group.selection.size(); i++)
2663
+ {
2664
+ Ungroup(group.selection.get(i));
2665
+ }
2666
+
2667
+ ClearSelection(false);
2668
+
2669
+ refreshContents();
22472670 } else
2248
- if (event.getSource() == genUVItem)
2671
+ if (source == genUVItem)
22492672 {
22502673 GenUV();
22512674 } else
2252
- if (event.getSource() == genNormalsCADItem)
2675
+ if (source == genNormalsCADItem)
22532676 {
22542677 GenNormals(true);
22552678 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2679
+ if (source == genNormalsMESHItem)
2680
+ {
2681
+ GenNormalsMESH();
2682
+ } else
2683
+ if (source == genNormalsORGANItem)
22572684 {
22582685 GenNormals(false);
22592686 } else
2260
- if (event.getSource() == stripifyItem)
2687
+ if (source == genNormalsMINEItem)
2688
+ {
2689
+ GenNormalsMINE();
2690
+ } else
2691
+ if (source == stripifyItem)
22612692 {
22622693 Stripify();
22632694 } else
2264
- if (event.getSource() == unstripifyItem)
2695
+ if (source == unstripifyItem)
22652696 {
22662697 Unstripify();
22672698 } else
2268
- if (event.getSource() == trimItem)
2699
+ if (source == trimItem)
22692700 {
22702701 Trim();
22712702 } else
2272
- if (event.getSource() == untrimItem)
2703
+ if (source == untrimItem)
22732704 {
22742705 Untrim();
22752706 } else
2276
- if (event.getSource() == clearColorsItem)
2707
+ if (source == clearColorsItem)
22772708 {
22782709 ClearColors();
22792710 } else
2280
- if (event.getSource() == clearMaterialsItem)
2711
+ if (source == clearMaterialsItem)
22812712 {
22822713 ClearMaterials();
22832714 } else
2284
- if (event.getSource() == liveleavesItem)
2715
+ if (source == liveleavesItem)
22852716 {
22862717 LiveLeaves(true);
22872718 } else
2288
- if (event.getSource() == unliveleavesItem)
2719
+ if (source == unliveleavesItem)
22892720 {
22902721 LiveLeaves(false);
22912722 } else
2292
- if (event.getSource() == supportleavesItem)
2723
+ if (source == supportleavesItem)
22932724 {
22942725 SupportLeaves(true);
22952726 } else
2296
- if (event.getSource() == unsupportleavesItem)
2727
+ if (source == unsupportleavesItem)
22972728 {
22982729 SupportLeaves(false);
22992730 } else
2300
- if (event.getSource() == hideleavesItem)
2731
+ if (source == hideleavesItem)
23012732 {
23022733 HideLeaves(true);
23032734 } else
2304
- if (event.getSource() == showleavesItem)
2735
+ if (source == showleavesItem)
23052736 {
23062737 HideLeaves(false);
23072738 } else
2308
- if (event.getSource() == markleavesItem)
2739
+ if (source == markleavesItem)
23092740 {
23102741 MarkLeaves(true);
23112742 } else
2312
- if (event.getSource() == unmarkleavesItem)
2743
+ if (source == unmarkleavesItem)
23132744 {
23142745 MarkLeaves(false);
23152746 } else
2316
- if (event.getSource() == flipVItem)
2747
+ if (source == rewindleavesItem)
2748
+ {
2749
+ RewindLeaves(true);
2750
+ } else
2751
+ if (source == unrewindleavesItem)
2752
+ {
2753
+ RewindLeaves(false);
2754
+ } else
2755
+ if (source == randomleavesItem)
2756
+ {
2757
+ RandomLeaves(true);
2758
+ } else
2759
+ if (source == unrandomleavesItem)
2760
+ {
2761
+ RandomLeaves(false);
2762
+ } else
2763
+ if (source == flipVItem)
23172764 {
23182765 FlipV(true);
23192766 } else
2320
- if (event.getSource() == unflipVItem)
2767
+ if (source == unflipVItem)
23212768 {
23222769 FlipV(false);
23232770 } else
2324
- if (event.getSource() == lowTexturesItem)
2771
+ if (source == lowTexturesItem)
23252772 {
23262773 SetTexRes(0);
23272774 } else
2328
- if (event.getSource() == normalTexturesItem)
2775
+ if (source == normalTexturesItem)
23292776 {
23302777 SetTexRes(1);
23312778 } else
2332
- if (event.getSource() == highTexturesItem)
2779
+ if (source == highTexturesItem)
23332780 {
23342781 SetTexRes(2);
23352782 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2783
+ if (source == veryhighTexturesItem)
23372784 {
23382785 SetTexRes(3);
23392786 } else
2340
- if (event.getSource() == maxTexturesItem)
2787
+ if (source == maxTexturesItem)
23412788 {
23422789 SetTexRes(4);
23432790 } else
2344
- if (event.getSource() == panoTexturesItem)
2791
+ if (source == panoTexturesItem)
23452792 {
23462793 SetTexRes(5);
23472794 } else
2348
- if (event.getSource() == reverseNormalsItem)
2795
+ if (source == reverseNormalsItem)
23492796 {
23502797 ReverseNormals();
23512798 } else
2352
- if (event.getSource() == parseverticesItem)
2799
+ if (source == parseverticesItem)
23532800 {
23542801 ParseVertices();
23552802 } else
2356
- if (event.getSource() == alignItem)
2803
+ if (source == textureFieldItem)
2804
+ {
2805
+ TextureVertices();
2806
+ } else
2807
+ if (source == alignItem)
23572808 {
23582809 Align();
23592810 } else
2360
- if (event.getSource() == mirrorItem)
2811
+ if (source == mirrorItem)
23612812 {
23622813 MirrorPoses();
23632814 } else
2364
- if (event.getSource() == reduceMorphItem)
2815
+ if (source == reduceMorphItem)
23652816 {
23662817 MeshReduction(false);
23672818 } else
2368
- if (event.getSource() == reduce34MorphItem)
2819
+ if (source == reduce34MorphItem)
23692820 {
23702821 MeshReduction(true);
23712822 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2823
+ if (source == reverseTrianglesItem)
23732824 {
23742825 ReverseTriangles();
23752826 } else
2376
- if (event.getSource() == reduceMeshItem)
2827
+ if (source == reduceMeshItem)
23772828 {
23782829 ReduceMesh(false);
23792830 } else
2380
- if (event.getSource() == reduce34MeshItem)
2831
+ if (source == reduce34MeshItem)
23812832 {
23822833 ReduceMesh(true);
23832834 } else
2384
- if (event.getSource() == increaseMeshItem)
2835
+ if (source == increaseMeshItem)
23852836 {
23862837 IncreaseMesh();
23872838 } else
2388
- if (event.getSource() == clipMeshItem)
2839
+ if (source == clipMeshItem)
23892840 {
23902841 ClipMesh();
23912842 } else
2392
- if (event.getSource() == smoothMeshItem)
2843
+ if (source == smoothMeshItem)
23932844 {
23942845 SmoothMesh();
23952846 } else
2396
- if (event.getSource() == transformgeometryItem)
2847
+ if (source == transformGeometryItem)
23972848 {
23982849 TransformGeometry();
23992850 } else
2400
- if (event.getSource() == resetTransformItem)
2851
+ if (source == transformChildrenItem)
2852
+ {
2853
+ TransformChildren();
2854
+ } else
2855
+ if (source == resetTransformItem)
24012856 {
24022857 ResetTransform();
24032858 } else
2404
- if (event.getSource() == resetCentroidItem)
2859
+ if (source == resetCentroidItem)
24052860 {
2406
- ResetCentroid();
2861
+ ResetCentroid(true);
24072862 } else
2408
- if (event.getSource() == resetParentItem)
2863
+ if (source == resetCentroidXZItem)
2864
+ {
2865
+ ResetCentroid(false);
2866
+ } else
2867
+ if (source == resetParentItem)
24092868 {
24102869 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112870 {
....@@ -2415,7 +2874,7 @@
24152874
24162875 refreshContents();
24172876 } else
2418
- if (event.getSource() == repairParentItem)
2877
+ if (source == repairParentItem)
24192878 {
24202879 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212880 {
....@@ -2429,7 +2888,21 @@
24292888
24302889 refreshContents();
24312890 } else
2432
- if (event.getSource() == sortbysizeItem)
2891
+ if (source == repairShadowItem)
2892
+ {
2893
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2894
+ {
2895
+ Object3D obj = (Object3D)e.nextElement();
2896
+ obj.RepairShadow();
2897
+// for (int i=0; i<obj.size(); i++)
2898
+// {
2899
+// obj.get(i).parent = obj;
2900
+// }
2901
+ }
2902
+
2903
+ refreshContents();
2904
+ } else
2905
+ if (source == sortbysizeItem)
24332906 {
24342907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352908 {
....@@ -2441,7 +2914,7 @@
24412914 ResetModel();
24422915 refreshContents();
24432916 } else
2444
- if (event.getSource() == sortbynameItem)
2917
+ if (source == sortbynameItem)
24452918 {
24462919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472920 {
....@@ -2453,7 +2926,7 @@
24532926 ResetModel();
24542927 refreshContents();
24552928 } else
2456
- if (event.getSource() == attachPigmentItem)
2929
+ if (source == attachPigmentItem)
24572930 {
24582931 String texture = GetFile("Attach pigment");
24592932 Object3D obj;
....@@ -2465,7 +2938,7 @@
24652938
24662939 refreshContents();
24672940 } else
2468
- if (event.getSource() == detachPigmentItem)
2941
+ if (source == detachPigmentItem)
24692942 {
24702943 Object3D obj;
24712944 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2949,7 @@
24762949
24772950 refreshContents();
24782951 } else
2479
- if (event.getSource() == attachBumpItem)
2952
+ if (source == attachBumpItem)
24802953 {
24812954 String texture = GetFile("Attach bump");
24822955 Object3D obj;
....@@ -2488,7 +2961,7 @@
24882961
24892962 refreshContents();
24902963 } else
2491
- if (event.getSource() == detachBumpItem)
2964
+ if (source == detachBumpItem)
24922965 {
24932966 Object3D obj;
24942967 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2972,7 @@
24992972
25002973 refreshContents();
25012974 } else
2502
- if (event.getSource() == pigmentBumpItem)
2975
+ if (source == pigmentBumpItem)
25032976 {
25042977 Object3D obj;
25052978 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2983,237 @@
25102983
25112984 refreshContents();
25122985 } else
2513
- if (event.getSource() == flashSelectionButton)
2986
+ if (source == flashSelectionButton)
25142987 {
25152988 CameraPane.flash = true;
25162989 refreshContents();
25172990 } else
2518
- if (event.getSource() == oneButton)
2991
+ if (source == oneButton)
25192992 {
25202993 } else
2521
- if (event.getSource() == twoButton)
2994
+ if (source == twoButton)
25222995 {
25232996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
25243001 // bug
25253002 //gridPanel.setDividerLocation(1.0);
25263003 //bigPanel.setDividerLocation(0.0);
2527
- bigThree.remove(jtp);
2528
- bigThree.remove(cameraPanel);
2529
- bigThree.remove(XYZPanel);
2530
- aWindowConstraints.gridx = 0;
2531
- aWindowConstraints.gridy = 0;
2532
- aWindowConstraints.gridwidth = 1;
2533
- // aConstraints.gridheight = 3;
2534
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2535
- aWindowConstraints.weightx = 0;
2536
- aWindowConstraints.weighty = 1;
2537
- //bigThree.add(jtp, aWindowConstraints);
2538
- aWindowConstraints.weightx = 1;
2539
- aWindowConstraints.gridwidth = 3;
2540
- // aConstraints.gridheight = 3;
2541
- aWindowConstraints.gridx = 1;
2542
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2543
- bigThree.add(cameraPanel, aWindowConstraints);
2544
- aWindowConstraints.weightx = 0;
2545
- aWindowConstraints.gridx = 4;
2546
- aWindowConstraints.gridwidth = 1;
2547
- // aConstraints.gridheight = 3;
2548
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2549
- //bigThree.add(XYZPanel, aWindowConstraints);
2550
- bigThree.revalidate();
3004
+// bigThree.remove(scenePanel);
3005
+// bigThree.remove(centralPanel);
3006
+// bigThree.remove(XYZPanel);
3007
+// aWindowConstraints.gridx = 0;
3008
+// aWindowConstraints.gridy = 0;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// aWindowConstraints.weightx = 0;
3013
+// aWindowConstraints.weighty = 1;
3014
+// //bigThree.add(jtp, aWindowConstraints);
3015
+// aWindowConstraints.weightx = 1;
3016
+// aWindowConstraints.gridwidth = 3;
3017
+// // aConstraints.gridheight = 3;
3018
+// aWindowConstraints.gridx = 1;
3019
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3020
+// bigThree.add(centralPanel, aWindowConstraints);
3021
+// aWindowConstraints.weightx = 0;
3022
+// aWindowConstraints.gridx = 4;
3023
+// aWindowConstraints.gridwidth = 1;
3024
+// // aConstraints.gridheight = 3;
3025
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3026
+// //bigThree.add(XYZPanel, aWindowConstraints);
3027
+// scenePanel.setVisible(false);
3028
+// centralPanel.setVisible(true);
3029
+// XYZPanel.setVisible(false);
3030
+ bigThree.ClearUI();
3031
+ bigThree.add(centralPanel);
3032
+ bigThree.FlushUI();
3033
+
3034
+ cameraView.requestFocusInWindow();
3035
+
3036
+// refreshContents(true);
3037
+//
3038
+// try
3039
+// {
3040
+// java.awt.Robot bot = new java.awt.Robot();
3041
+// int mask = InputEvent.BUTTON1_MASK;
3042
+// bot.mouseMove(100, 100);
3043
+// bot.mousePress(mask);
3044
+// bot.mouseRelease(mask);
3045
+// }
3046
+// catch (Exception e)
3047
+// {
3048
+//
3049
+// }
3050
+
25513051 } else
2552
- if (event.getSource() == threeButton)
3052
+ if (source == threeButton)
25533053 {
25543054 radio.layout = threeButton;
2555
- bigThree.remove(jtp);
2556
- bigThree.remove(cameraPanel);
2557
- bigThree.remove(XYZPanel);
2558
- aWindowConstraints.gridx = 0;
2559
- aWindowConstraints.gridy = 0;
2560
- aWindowConstraints.gridwidth = 1;
2561
- // aConstraints.gridheight = 3;
2562
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2563
- aWindowConstraints.weightx = 0;
2564
- aWindowConstraints.weighty = 1;
2565
- //bigThree.add(jtp, aWindowConstraints);
2566
- aWindowConstraints.weightx = 1;
2567
- aWindowConstraints.gridwidth = 3;
2568
- // aConstraints.gridheight = 3;
2569
- aWindowConstraints.gridx = 1;
2570
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2571
- bigThree.add(cameraPanel, aWindowConstraints);
2572
- aWindowConstraints.weightx = 0;
2573
- aWindowConstraints.gridx = 4;
2574
- aWindowConstraints.gridwidth = 1;
2575
- // aConstraints.gridheight = 3;
2576
- aConstraints.fill = GridBagConstraints.VERTICAL;
2577
- bigThree.add(XYZPanel, aWindowConstraints);
2578
- bigThree.revalidate();
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
3058
+
3059
+// bigThree.remove(scenePanel);
3060
+// bigThree.remove(centralPanel);
3061
+// bigThree.remove(XYZPanel);
3062
+// aWindowConstraints.gridx = 0;
3063
+// aWindowConstraints.gridy = 0;
3064
+// aWindowConstraints.gridwidth = 1;
3065
+// // aConstraints.gridheight = 3;
3066
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3067
+// aWindowConstraints.weightx = 0;
3068
+// aWindowConstraints.weighty = 1;
3069
+// //bigThree.add(jtp, aWindowConstraints);
3070
+// aWindowConstraints.weightx = 1;
3071
+// aWindowConstraints.gridwidth = 3;
3072
+// // aConstraints.gridheight = 3;
3073
+// aWindowConstraints.gridx = 1;
3074
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3075
+// bigThree.add(centralPanel, aWindowConstraints);
3076
+// aWindowConstraints.weightx = 0;
3077
+// aWindowConstraints.gridx = 4;
3078
+// aWindowConstraints.gridwidth = 1;
3079
+// // aConstraints.gridheight = 3;
3080
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3081
+// bigThree.add(XYZPanel, aWindowConstraints);
3082
+// bigThree.validate();
3083
+// scenePanel.setVisible(false);
3084
+// centralPanel.setVisible(true);
3085
+// XYZPanel.setVisible(true);
3086
+ bigThree.ClearUI();
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.add(XYZPanel);
3089
+ bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
25793092 } else
2580
- if (event.getSource() == fourButton)
3093
+ if (source == fourButton)
25813094 {
25823095 radio.layout = fourButton;
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
- // aWindowConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2591
- aWindowConstraints.weightx = 1;
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
- // aWindowConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
3099
+
3100
+// bigThree.remove(scenePanel);
3101
+// bigThree.remove(centralPanel);
3102
+// bigThree.remove(XYZPanel);
3103
+// aWindowConstraints.gridx = 0;
3104
+// aWindowConstraints.gridy = 0;
3105
+// aWindowConstraints.gridwidth = 1;
3106
+// // aWindowConstraints.gridheight = 3;
3107
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3108
+// aWindowConstraints.weightx = 1;
3109
+// aWindowConstraints.weighty = 1;
3110
+// bigThree.add(scenePanel, aWindowConstraints);
3111
+// aWindowConstraints.weightx = 1;
3112
+// aWindowConstraints.gridwidth = 3;
3113
+// // aConstraints.gridheight = 3;
3114
+// aWindowConstraints.gridx = 1;
3115
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3116
+// //bigThree.add(cameraPanel, aWindowConstraints);
3117
+// aWindowConstraints.weightx = 0;
3118
+// aWindowConstraints.gridx = 4;
3119
+// aWindowConstraints.gridwidth = 1;
3120
+// // aWindowConstraints.gridheight = 3;
3121
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3122
+// //bigThree.add(XYZPanel, aWindowConstraints);
3123
+// bigThree.validate();
3124
+// scenePanel.setVisible(true);
3125
+// centralPanel.setVisible(false);
3126
+// XYZPanel.setVisible(false);
3127
+ bigThree.ClearUI();
3128
+ bigThree.add(scenePanel);
3129
+ bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
26073132 } else
2608
- if (event.getSource() == sixButton)
3133
+ if (source == sixButton)
26093134 {
26103135 radio.layout = sixButton;
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
- // aWindowConstraints.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
- // aWindowConstraints.gridheight = 3;
2632
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2633
- //bigThree.add(XYZPanel, aConstraints);
2634
- bigThree.revalidate();
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
3139
+
3140
+// bigThree.remove(scenePanel);
3141
+// bigThree.remove(centralPanel);
3142
+// bigThree.remove(XYZPanel);
3143
+// aWindowConstraints.gridx = 0;
3144
+// aWindowConstraints.gridy = 0;
3145
+// aWindowConstraints.gridwidth = 1;
3146
+// // aConstraints.gridheight = 3;
3147
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3148
+// aWindowConstraints.weightx = 0;
3149
+// aWindowConstraints.weighty = 1;
3150
+// bigThree.add(scenePanel, aWindowConstraints);
3151
+// aWindowConstraints.weightx = 1;
3152
+// aWindowConstraints.gridwidth = 3;
3153
+// // aWindowConstraints.gridheight = 3;
3154
+// aWindowConstraints.gridx = 1;
3155
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3156
+// bigThree.add(centralPanel, aWindowConstraints);
3157
+// aWindowConstraints.weightx = 0;
3158
+// aWindowConstraints.gridx = 4;
3159
+// aWindowConstraints.gridwidth = 1;
3160
+// // aWindowConstraints.gridheight = 3;
3161
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3162
+// //bigThree.add(XYZPanel, aConstraints);
3163
+// bigThree.validate();
3164
+// scenePanel.setVisible(true);
3165
+// centralPanel.setVisible(true);
3166
+// XYZPanel.setVisible(false);
3167
+ bigThree.ClearUI();
3168
+ bigThree.add(scenePanel);
3169
+ bigThree.add(centralPanel);
3170
+ bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
26353173 } else
2636
- if (event.getSource() == sevenButton)
3174
+ if (source == sevenButton)
26373175 {
26383176 radio.layout = sevenButton;
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.VERTICAL;
2647
- aWindowConstraints.weightx = 0;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aWindowConstraints.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
- // aConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
3180
+
3181
+// bigThree.remove(scenePanel);
3182
+// bigThree.remove(centralPanel);
3183
+// bigThree.remove(XYZPanel);
3184
+// aWindowConstraints.gridx = 0;
3185
+// aWindowConstraints.gridy = 0;
3186
+// aWindowConstraints.gridwidth = 1;
3187
+// // aWindowConstraints.gridheight = 3;
3188
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3189
+// aWindowConstraints.weightx = 0;
3190
+// aWindowConstraints.weighty = 1;
3191
+// bigThree.add(scenePanel, aWindowConstraints);
3192
+// aWindowConstraints.weightx = 1;
3193
+// aWindowConstraints.gridwidth = 3;
3194
+// // aWindowConstraints.gridheight = 3;
3195
+// aWindowConstraints.gridx = 1;
3196
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3197
+// bigThree.add(centralPanel, aWindowConstraints);
3198
+// aWindowConstraints.weightx = 0;
3199
+// aWindowConstraints.gridx = 4;
3200
+// aWindowConstraints.gridwidth = 1;
3201
+// // aConstraints.gridheight = 3;
3202
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3203
+// bigThree.add(XYZPanel, aWindowConstraints);
3204
+// bigThree.validate();
3205
+// scenePanel.setVisible(true);
3206
+// centralPanel.setVisible(true);
3207
+// XYZPanel.setVisible(true);
3208
+ bigThree.ClearUI();
3209
+ bigThree.add(scenePanel);
3210
+ bigThree.add(centralPanel);
3211
+ bigThree.add(XYZPanel);
3212
+ bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
26633215 } else
2664
- if (event.getSource() == rootButton)
3216
+ if (source == rootButton)
26653217 {
26663218 Object3D obj;
26673219 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,34 +3223,44 @@
26713223 EditObject(obj);
26723224 }
26733225
3226
+ cameraView.requestFocusInWindow();
26743227 refreshContents(true);
26753228 } else
2676
- if (event.getSource() == closeButton)
3229
+ if (source == closeButton)
26773230 {
26783231 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793232 cRadio ab;
26803233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813234 {
26823235 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
26853244 buttonGroup.remove(ab);
26863245 radioPanel.remove(ab);
26873246
2688
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
26893249 // ab.GetObject().objectUI = null; // ?????????
26903250
26913251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923252 break;
26933253 }
26943254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
26953257 refreshContents(true);
26963258 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3259
+ if (source == editItem || source == editButton)
26983260 {
26993261 EditSelection(false);
27003262 } else
2701
- if (event.getSource() == uneditButton)
3263
+ if (source == uneditButton)
27023264 {
27033265 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043266 {
....@@ -2708,14 +3270,14 @@
27083270 child.CloseUI();
27093271 listUI.remove(child);
27103272
2711
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
27123274 }
2713
- objEditor.ctrlPanel.revalidate();
3275
+ objEditor.ctrlPanel.FlushUI();
27143276 //objEditor.jTree.clearSelection();
27153277 //objEditor.ResetSliders();
27163278 refreshContents(true);
27173279 } else
2718
- if (event.getSource() == clearPanelButton)
3280
+ if (source == clearPanelButton)
27193281 {
27203282 assert(copy == group);
27213283 //copy.ClearUI();
....@@ -2726,7 +3288,7 @@
27263288 listUI.clear();
27273289 refreshContents(true);
27283290 } else
2729
- if (event.getSource() == allParamsButton)
3291
+ if (source == allParamsButton)
27303292 {
27313293 assert(copy == group);
27323294
....@@ -2747,19 +3309,19 @@
27473309
27483310 refreshContents(true);
27493311 } else
2750
- if (event.getSource() == unselectButton)
3312
+ if (source == unselectButton)
27513313 {
27523314 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3315
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543316 objEditor.ResetSliders();
27553317 refreshContents(true);
27563318 } else
2757
- if(event.getSource() instanceof cRadio)
3319
+ if(source instanceof cRadio)
27583320 {
27593321 group.parent = keepparent;
27603322 group.attributes = 0;
27613323 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3324
+ /*cRadio*/ radio = (cRadio)source;
27633325 Object3D obj = radio.GetObject();
27643326 System.out.println("Edit " + obj);
27653327 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3341,7 @@
27793341 }
27803342
27813343 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3344
+ //Globals.theRenderer.object = group;
27833345 if(!useclient)
27843346 {
27853347 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3350,17 @@
27883350 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893351 cameraView.targetLookAt.set(radio.camera.lookAt);
27903352 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3353
+ //cameraView.lighttouched = true;
3354
+ Globals.lighttouched = true;
27923355 topView.object = group;
27933356 frontView.object = group;
27943357 sideView.object = group;
27953358 }
2796
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
27973364 /*
27983365 currentLayout = radio.layout;
27993366 if (currentLayout == null)
....@@ -2805,8 +3372,23 @@
28053372 //group.parent = null; // ROOT
28063373 //group.attributes = -1;
28073374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
28083377 refreshContents(true);
2809
- }
3378
+ } else if (event.getSource() == editCameraItem)
3379
+ {
3380
+ cameraView.ProtectCamera();
3381
+ cameraView.repaint();
3382
+ return;
3383
+ } else if (event.getSource() == revertCameraItem)
3384
+ {
3385
+ cameraView.RevertCamera();
3386
+ cameraView.repaint();
3387
+ return;
3388
+ // } else if (event.getSource() == textureButton)
3389
+ // {
3390
+ // return; // true;
3391
+ }
28103392 else
28113393 {
28123394 //return super.action(event, arg);
....@@ -2815,7 +3397,6 @@
28153397 }
28163398
28173399 boolean useclient = false;
2818
- cRadio radio;
28193400
28203401 void ToggleRoot()
28213402 {
....@@ -2824,7 +3405,7 @@
28243405 if (useclient)
28253406 {
28263407 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3408
+ Globals.lighttouched = true;
28283409 //topView.object = client;
28293410 //frontView.object = client;
28303411 //sideView.object = client;
....@@ -2832,7 +3413,7 @@
28323413 else
28333414 {
28343415 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3416
+ Globals.lighttouched = true;
28363417 //topView.object = group;
28373418 //frontView.object = group;
28383419 //sideView.object = group;
....@@ -2867,6 +3448,28 @@
28673448 refreshContents();
28683449 }
28693450
3451
+ void TransformChildren()
3452
+ {
3453
+ Object3D obj;
3454
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3455
+ {
3456
+ obj = (Object3D)e.nextElement();
3457
+ obj.KeepTextureMatrices();
3458
+ obj.TransformChildren();
3459
+ obj.RestoreTextureMatrices();
3460
+
3461
+// if (obj.parent == null)
3462
+// {
3463
+// System.out.println("NULL PARENT!");
3464
+// new Exception().printStackTrace();
3465
+// }
3466
+// else
3467
+// TouchTransform(obj);
3468
+// //obj.parent.Touch();
3469
+ }
3470
+
3471
+ refreshContents();
3472
+ }
28703473
28713474 void ResetTransform()
28723475 {
....@@ -2979,7 +3582,7 @@
29793582 refreshContents();
29803583 }
29813584
2982
- void ResetCentroid()
3585
+ void ResetCentroid(boolean full)
29833586 {
29843587 Object3D obj;
29853588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3597,16 @@
29943597 LA.matIdentity(Object3D.mat);
29953598 obj.getBounds(minima, maxima, false);
29963599 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3600
+ if (full)
3601
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983602 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993603 obj.TransformMesh(Object3D.mat);
3604
+
30003605 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3606
+ if (full)
3607
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023608 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3609
+
30033610 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043611 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053612 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3635,8 @@
30283635
30293636 int size = obj.MemorySize();
30303637
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3638
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3639
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323640 }
30333641 }
30343642 catch (Exception e)
....@@ -3065,9 +3673,9 @@
30653673 obj = (Object3D)e.nextElement();
30663674
30673675 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3676
+ Grafreed.AnalyzeObject(obj);
30693677 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3678
+ Grafreed.AnalyzeObject(obj.bRep);
30713679
30723680 // System.err.println((size/1024) + " KB is the size of " + obj);
30733681 }
....@@ -3109,6 +3717,20 @@
31093717 void GenNormals(boolean crease)
31103718 {
31113719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
3727
+
3728
+ refreshContents();
3729
+ }
3730
+
3731
+ void GenNormalsMINE()
3732
+ {
3733
+ group.selection.GenNormalsMINE();
31123734
31133735 refreshContents();
31143736 }
....@@ -3157,104 +3779,259 @@
31573779
31583780 //Object3D buffer;
31593781 cVector temp = new cVector();
3160
- BoundaryRep temprep;
3161
- Object3D nodes;
3162
- Vector<Vertex> vertices;
3163
-
3164
- public void Vertex(Object3D node, Vertex v)
3165
- {
3166
- vertices.add(v);
3167
- nodes.addElement(node);
3168
-
3169
- if (temprep.GetCache(v) != null)
3170
- {
3171
- temprep.Remove(v);
3172
- }
3173
- else
3174
- {
3175
- temprep.Remember(v);
3176
- }
3177
- }
3178
-
3179
- public void Face(Object3D node, Face f)
3180
- {
3181
-
3182
- }
3183
-
3782
+// BoundaryRep temprep;
3783
+// Object3D nodes;
3784
+// Vector<Vertex> vertices;
3785
+//
3786
+// cGroup buffer;
3787
+//
3788
+// public void Vertex(Object3D node, Vertex v)
3789
+// {
3790
+//// vertices.add(v);
3791
+//// nodes.addElement(node);
3792
+////
3793
+//// if (temprep.GetCache(v) != null)
3794
+//// {
3795
+//// temprep.Remove(v);
3796
+//// } else
3797
+//// {
3798
+//// temprep.Remember(v);
3799
+//// }
3800
+//
3801
+// //Object3D node = nodes.get(index);
3802
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3803
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3804
+//
3805
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3806
+//
3807
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3808
+//
3809
+// cGroup g = new cGroup();
3810
+//
3811
+// if (g.toParent == null)
3812
+// {
3813
+// g.toParent = LA.newMatrix();
3814
+// g.fromParent = LA.newMatrix();
3815
+// }
3816
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3817
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3818
+//
3819
+// g.add(GrafreeD.clipboard);
3820
+//
3821
+// buffer.add(g);
3822
+// }
3823
+//
3824
+// public void Face(Object3D node, Face f)
3825
+// {
3826
+//
3827
+// }
3828
+//
3829
+// void ParseVerticesOld() // ??
3830
+// {
3831
+// //if (group.selection.size() != 1)
3832
+// // return;
3833
+//
3834
+// temprep = new BoundaryRep();
3835
+// nodes = new Object3D();
3836
+// vertices = new Vector<Vertex>();
3837
+//
3838
+// boolean epsequal = GrafreeD.epsequal;
3839
+// GrafreeD.epsequal = true;
3840
+//
3841
+// for (int i=0; i<group.selection.size(); i++)
3842
+// {
3843
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3844
+//
3845
+// group.selection.get(i).Parse(
3846
+//this );
3847
+//
3848
+// int repsize = temprep.VertexCount();
3849
+// int tablesize = temprep.vertextable.size();
3850
+// int nodesize = nodes.size();
3851
+//
3852
+// assert(vertices.size() == nodes.size());
3853
+//
3854
+// temprep.vertextable.elements();
3855
+//
3856
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3857
+//
3858
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3859
+// {
3860
+// cGroup g = new cGroup();
3861
+//
3862
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3863
+//
3864
+// Object3D node = nodes.get(index);
3865
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3866
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3867
+//
3868
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3869
+//
3870
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3871
+//
3872
+// if (g.toParent == null)
3873
+// {
3874
+// g.toParent = LA.newMatrix();
3875
+// g.fromParent = LA.newMatrix();
3876
+// }
3877
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3878
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3879
+//
3880
+// g.add(GrafreeD.clipboard);
3881
+//
3882
+// buffer.add(g);
3883
+// }
3884
+//
3885
+// makeSomething(buffer, i==group.selection.size()-1);
3886
+// }
3887
+//
3888
+// GrafreeD.epsequal = epsequal;
3889
+//
3890
+// //buffer = null;
3891
+// temprep = null;
3892
+// nodes = null;
3893
+//
3894
+// refreshContents();
3895
+// }
3896
+
31843897 void ParseVertices()
31853898 {
3186
- //if (group.selection.size() != 1)
3187
- // return;
3188
-
3189
- temprep = new BoundaryRep();
3190
- nodes = new Object3D();
3191
- vertices = new Vector<Vertex>();
3192
-
3193
- boolean epsequal = GraphreeD.epsequal;
3194
- GraphreeD.epsequal = true;
3899
+ boolean epsequal = Grafreed.epsequal;
3900
+ Grafreed.epsequal = true;
31953901
31963902 for (int i=0; i<group.selection.size(); i++)
31973903 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3904
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993905
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3906
+ group.selection.get(i).Parse(
3907
+
3908
+ new iParse()
3909
+ {
3910
+ public void Vertex(Object3D node, Vertex v)
3911
+ {
3912
+ temp.set(v);
3913
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053914
3206
- assert(vertices.size() == nodes.size());
3207
-
3208
- temprep.vertextable.elements();
3209
-
3210
- java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3915
+ cGroup g = new cGroup();
32113916
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3917
+ if (g.toParent == null)
3918
+ {
3919
+ g.toParent = LA.newMatrix();
3920
+ g.fromParent = LA.newMatrix();
3921
+ }
3922
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3923
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153924
3216
- int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3217
- Object3D node = nodes.get(index);
3218
- temp.set(vertices.get(index)); // temprep.GetVertex(k));
3219
- // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3925
+ g.add(Grafreed.clipboard);
32203926
3221
- LA.xformPos(temp, node.GlobalTransformInv(), temp);
3222
-
3223
- // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3224
-
3225
- if (g.toParent == null)
3226
- {
3227
- g.toParent = LA.newMatrix();
3228
- g.fromParent = LA.newMatrix();
3229
- }
3230
- LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3231
- LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3927
+ buffer.add(g);
3928
+ }
32323929
3233
- g.add(GraphreeD.clipboard);
3930
+ public void Face(Object3D node, Face f)
3931
+ {
32343932
3235
- buffer.add(g);
3236
- }
3933
+ }
3934
+ }
3935
+ );
32373936
32383937 makeSomething(buffer, i==group.selection.size()-1);
32393938 }
32403939
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3940
+ Grafreed.epsequal = epsequal;
32463941
32473942 refreshContents();
32483943 }
3249
-
3944
+
3945
+ void TextureVertices()
3946
+ {
3947
+ for (int i=0; i<group.selection.size(); i++)
3948
+ {
3949
+ group.selection.get(i).Parse(
3950
+ new iParse()
3951
+ {
3952
+ public void Vertex(Object3D node, Vertex v)
3953
+ {
3954
+ cTexture tex = node.GetTextures();
3955
+ String pigment = Object3D.GetPigment(tex);
3956
+ //String bump = Object3D.GetBump(tex);
3957
+
3958
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3959
+
3960
+ try
3961
+ {
3962
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3963
+ }
3964
+ catch (Exception e)
3965
+ {
3966
+ System.err.println("FAIL: " + node);
3967
+ }
3968
+
3969
+ double s = v.s;
3970
+
3971
+ if (s == 1)
3972
+ s = 0;
3973
+
3974
+ double t = v.t;
3975
+
3976
+ if (t == 1)
3977
+ t = 0;
3978
+
3979
+ int indexs = (int) (texturedata.getWidth() * s);
3980
+ int indext = (int) (texturedata.getHeight() * t);
3981
+
3982
+ int index = indext * texturedata.getWidth() + indexs;
3983
+
3984
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3985
+
3986
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3987
+
3988
+ float scale = bytebuf.get(index*slide) & 0xFF;
3989
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3990
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3991
+ scale /= 3;
3992
+
3993
+ scale /= 0xFF;
3994
+ // c'est quoi ca? scale /= 4;
3995
+
3996
+ //v.AO = scale;
3997
+
3998
+ v.x += v.norm.x * scale;
3999
+ v.y += v.norm.y * scale;
4000
+ v.z += v.norm.z * scale;
4001
+ }
4002
+
4003
+ public void Face(Object3D node, Face f)
4004
+ {
4005
+ }
4006
+ }
4007
+ );
4008
+ }
4009
+
4010
+ refreshContents();
4011
+ }
4012
+
32504013 void Align()
32514014 {
4015
+ if (group.selection.size() == 0)
4016
+ return;
4017
+
4018
+ cVector bbmin = new cVector();
4019
+ cVector bbmax = new cVector();
4020
+
4021
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4022
+
4023
+ double dx = bbmax.x - bbmin.x;
4024
+ double dy = bbmax.y - bbmin.y;
4025
+ double dz = bbmax.z - bbmin.z;
4026
+
4027
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4028
+
32524029 for (int i=0; i<group.selection.size(); i++)
32534030 {
32544031 Object3D obj = group.selection.get(i);
32554032
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4033
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4034
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584035 }
32594036
32604037 refreshContents();
....@@ -3267,7 +4044,7 @@
32674044 // ref.SaveSupports();
32684045 // Object3D par = ref.parent;
32694046 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4047
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714048 // ref.parent = par;
32724049 // ref.RestoreSupports();
32734050
....@@ -3275,11 +4052,11 @@
32754052
32764053 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774054
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4055
+ boolean random = CameraPane.SWITCH;
4056
+ CameraPane.SWITCH = false; // parse all random nodes
32804057 lowres.linkVerticesThis(null);
32814058 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4059
+ CameraPane.SWITCH = random;
32834060
32844061 System.err.flush();
32854062
....@@ -3297,7 +4074,7 @@
32974074 // lowres.SaveSupports();
32984075 // par = lowres.parent;
32994076 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4077
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014078 Object3D newlow = CloneObject(lowres, false);
33024079 newlow.name = sn.switchobject.get(i).name;
33034080 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4096,7 @@
33194096 return;
33204097
33214098 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4099
+ Object3D ref = Grafreed.clipboard.get(0);
33234100
33244101 Object3D newgroup = new Object3D("Po:" + poses.name);
33254102
....@@ -3488,7 +4265,7 @@
34884265 group.selection.RelinkToSupport(); // july 2014
34894266 System.out.println("DONE.");
34904267 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4268
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924269 }
34934270
34944271 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4290,20 @@
35134290
35144291 void ClipMesh()
35154292 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4293
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174294 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4295
+ Object3D content = Grafreed.clipboard.get(0);
35194296
35204297 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214298 content = ((cGroup)content).get(0);
35224299
35234300 // for (int i=0; i<group.selection.size(); i++)
35244301 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4302
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264303 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4304
+ group.selection.ClipMesh(Grafreed.clipboard);
35284305 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4306
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304307 System.out.println("DONE.");
35314308 refreshContents();
35324309 }
....@@ -3571,6 +4348,18 @@
35714348 void MarkLeaves(boolean hide)
35724349 {
35734350 group.selection.MarkLeaves(hide);
4351
+ refreshContents();
4352
+ }
4353
+
4354
+ void RewindLeaves(boolean hide)
4355
+ {
4356
+ group.selection.RewindLeaves(hide);
4357
+ refreshContents();
4358
+ }
4359
+
4360
+ void RandomLeaves(boolean hide)
4361
+ {
4362
+ group.selection.RandomLeaves(hide);
35744363 refreshContents();
35754364 }
35764365
....@@ -3656,10 +4445,10 @@
36564445 {
36574446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604449
36614450 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4451
+ if(elem != group || !newWindow)
36634452 {
36644453 // if (!(elem instanceof Composite))
36654454 // newWindow = false;
....@@ -3749,7 +4538,6 @@
37494538 //case 702: // Event.LIST_DESELECT
37504539 group.deselectAll();
37514540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534541 if (tps != null)
37544542 {
37554543 for (int i=0; i < tps.length; i++)
....@@ -3758,31 +4546,30 @@
37584546
37594547 //if (child.parent != null)
37604548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
37614550 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654551 }
37664552 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4553
+// else
4554
+// {
4555
+// objEditor.SetMaterial(group); // .GetMaterial());
4556
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4557
+// System.err.println("info : " + group.GetPath());
4558
+// }
37734559
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4560
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774561 CameraPane.flash = true;
37784562
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804564 // a camera
37814565 {
3782
- CameraPane.camerachangeframe = 0; // don't refuse it
3783
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3784
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3785
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4566
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4567
+ {
4568
+ CameraPane.camerachangeframe = 0; // don't refuse it
4569
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4570
+ }
4571
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4572
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864573 }
37874574
37884575 refreshContents();
....@@ -3793,6 +4580,26 @@
37934580
37944581 freezemodel = false;
37954582 }
4583
+
4584
+ void refreshContents(boolean cp)
4585
+ {
4586
+ if (!Globals.MOUSEDRAGGED)
4587
+ {
4588
+ objEditor.ClearInfo(); // .GetMaterial());
4589
+
4590
+ for (int i=0; i < group.selection.Size(); i++)
4591
+ {
4592
+ Object3D child = (Object3D) group.selection.get(i);
4593
+
4594
+ objEditor.AddInfo(child, this, true);
4595
+ System.err.println("info : " + child.GetPath());
4596
+ }
4597
+
4598
+ objEditor.SetText(); // jan 2014
4599
+ }
4600
+
4601
+ super.refreshContents(cp);
4602
+ }
37964603
37974604 void linkSomething(Object3D thing)
37984605 {
....@@ -3864,16 +4671,19 @@
38644671 {
38654672 if (group.selection.isEmpty())
38664673 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4674
+
4675
+ Grafreed.clipboardIsTempGroup = false;
38684676 Composite tGroup = null;
38694677 if (group.selection.size() > 0) // 1)
38704678 {
38714679 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4680
+ Grafreed.clipboardIsTempGroup = true;
38734681 }
38744682
38754683 if (cut)
38764684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
38774687 //int indices[] = jList.getSelectedIndices();
38784688 //for (int i = indices.length - 1; i >= 0; i--)
38794689 //jList.remove(indices[i]);
....@@ -3909,16 +4719,16 @@
39094719 //System.out.println("cut " + child);
39104720 //System.out.println("parent = " + child.parent);
39114721 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4722
+ if (Grafreed.clipboardIsTempGroup)
39134723 tGroup.add/*Child*/(tmp);
39144724 else
3915
- GraphreeD.clipboard = tmp;
4725
+ Grafreed.clipboard = tmp;
39164726 }
39174727 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4728
+ if (Grafreed.clipboardIsTempGroup)
39194729 tGroup.add/*Child*/(child);
39204730 else
3921
- GraphreeD.clipboard = child;
4731
+ Grafreed.clipboard = child;
39224732 }
39234733
39244734 //ResetModel();
....@@ -3950,21 +4760,23 @@
39504760 //System.out.println("cut " + elem);
39514761 //System.out.println("parent = " + elem.parent);
39524762 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4763
+ if (Grafreed.clipboardIsTempGroup)
39544764 tGroup.add/*Child*/(tmp);
39554765 else
3956
- GraphreeD.clipboard = tmp;
4766
+ Grafreed.clipboard = tmp;
39574767 }
39584768 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4769
+ if (Grafreed.clipboardIsTempGroup)
39604770 tGroup.add/*Child*/(child);
39614771 else
3962
- GraphreeD.clipboard = child;
4772
+ Grafreed.clipboard = child;
39634773 }
39644774
39654775 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4776
+
4777
+ if (Grafreed.clipboardIsTempGroup)
4778
+ Grafreed.clipboard = tGroup;
4779
+
39684780 if (cut)
39694781 {
39704782 ResetModel();
....@@ -3974,11 +4786,11 @@
39744786
39754787 void paste(boolean expand)
39764788 {
3977
- // if (GraphreeD.clipboard == null)
4789
+ // if (GrafreeD.clipboard == null)
39784790 // return;
39794791 boolean first = true;
39804792
3981
- if (GraphreeD.clipboardIsTempGroup)
4793
+ if (Grafreed.clipboardIsTempGroup)
39824794 {
39834795 Composite temp;
39844796
....@@ -3989,7 +4801,7 @@
39894801 temp = (Composite)Applet3D.clipboard.deepCopy();
39904802 */
39914803 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4804
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934805 {
39944806 Object3D child = (Object3D)e.nextElement();
39954807
....@@ -4003,7 +4815,7 @@
40034815 else
40044816 elem = child.deepCopy(); // ?
40054817 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4818
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074819 // elem = elem.get(0);
40084820 makeSomething(elem, true); // ?? first);
40094821 //group.addChild(elem);
....@@ -4023,23 +4835,23 @@
40234835 //Object3D cb = Applet3D.clipboard;
40244836 //temp.addChild(cb);
40254837 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4026
- assert(GraphreeD.clipboard.parent == null);
4027
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4028
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4029
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4030
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4838
+ assert(Grafreed.clipboard.parent == null);
4839
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4840
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4841
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4842
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314843 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4844
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4845
+ Grafreed.clipboard.get(0).parent = keepparent;
40344846 }
40354847
40364848 ResetModel();
40374849 refreshContents();
40384850 }
40394851
4040
- void pasteInto(boolean copyit)
4852
+ void pasteInto(boolean copyit, boolean clone)
40414853 {
4042
-// if (GraphreeD.clipboard == null)
4854
+// if (GrafreeD.clipboard == null)
40434855 // return;
40444856
40454857 if (group.selection.size() != 1)
....@@ -4066,15 +4878,22 @@
40664878 if (copyit)
40674879 {
40684880 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4881
+ if (clone)
4882
+ {
4883
+ CloneClipboard(false); // sept 2014
4884
+ }
4885
+ else
4886
+ {
4887
+ paste(false);
4888
+ }
40704889 }
40714890 else
40724891 {
40734892 boolean first = true;
40744893
4075
- if (GraphreeD.clipboardIsTempGroup)
4894
+ if (Grafreed.clipboardIsTempGroup)
40764895 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4896
+ Composite temp = (Composite)Grafreed.clipboard;
40784897 Object3D copy;
40794898 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804899 {
....@@ -4084,7 +4903,7 @@
40844903 }
40854904 } else
40864905 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4906
+ linkSomething(Grafreed.clipboard); //.get(0));
40884907 }
40894908 }
40904909 }
....@@ -4276,6 +5095,26 @@
42765095 makeSomething(csg);
42775096 }
42785097
5098
+ void Ungroup(Object3D g)
5099
+ {
5100
+ if (g instanceof HiddenObject)
5101
+ {
5102
+ HiddenObject h = (HiddenObject) g;
5103
+
5104
+ for (int i=0; i<h.ActualSize(); i++)
5105
+ {
5106
+ objEditor.makeSomething(h.get(i), false);
5107
+ }
5108
+ }
5109
+ else
5110
+ {
5111
+ for (int i=0; i<g.Size(); i++)
5112
+ {
5113
+ objEditor.makeSomething(g.get(i), false);
5114
+ }
5115
+ }
5116
+ }
5117
+
42795118 void ungroup()
42805119 {
42815120 /*
....@@ -4469,21 +5308,6 @@
44695308 }
44705309 */
44715310
4472
- void ImportGFD()
4473
- {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4475
- browser.show();
4476
- String filename = browser.getFile();
4477
- if (filename != null && filename.length() > 0)
4478
- {
4479
- String fullname = browser.getDirectory() + filename;
4480
-
4481
- //Object3D readobj =
4482
- objEditor.ReadGFD(fullname, objEditor);
4483
- //makeSomething(readobj);
4484
- }
4485
- }
4486
-
44875311 /*
44885312 public void Callback(Object obj)
44895313 {
....@@ -4507,26 +5331,9 @@
45075331 }
45085332 */
45095333
4510
- void ImportVRMLX3D()
4511
- {
4512
- if (GraphreeD.standAlone)
4513
- {
4514
- /**/
4515
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4516
- browser.show();
4517
- String filename = browser.getFile();
4518
- if (filename != null && filename.length() > 0)
4519
- {
4520
- String fullname = browser.getDirectory() + filename;
4521
- LoadVRMLX3D(fullname);
4522
- }
4523
- /**/
4524
- }
4525
- }
4526
-
45275334 String GetFile(String dialogName)
45285335 {
4529
- if (GraphreeD.standAlone)
5336
+ if (Grafreed.standAlone)
45305337 {
45315338 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325339 browser.show();
....@@ -4590,10 +5397,33 @@
45905397 cButton flashSelectionButton;
45915398 cButton editButton;
45925399 cButton uneditButton;
5400
+ JCheckBox allParamsButton;
45935401 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955402 cButton unselectButton;
45965403
5404
+ cButton minButton;
5405
+ cButton maxButton;
5406
+ cButton fullButton;
5407
+ cButton undoButton;
5408
+ cButton redoButton;
5409
+ cButton saveButton;
5410
+ cButton oneStepButton;
5411
+
5412
+ cButton groupButton;
5413
+ cButton ungroupButton;
5414
+ cButton compositeButton;
5415
+
5416
+ cButton gridButton;
5417
+ cButton boxButton;
5418
+ cButton sphereButton;
5419
+ cButton coneButton;
5420
+ cButton torusButton;
5421
+ cButton superButton;
5422
+ cButton kleinButton;
5423
+ cButton particlesButton;
5424
+ cButton overlayButton;
5425
+ cButton lightButton;
5426
+
45975427 cButton screenfitButton;
45985428 cButton screenfitpointButton;
45995429 cButton snapobjectButton;
....@@ -4604,14 +5434,6 @@
46045434 cButton closeButton;
46055435
46065436 cButton setsupportButton;
4607
-
4608
- cButton twoButton;
4609
- cButton sixButton;
4610
- cButton threeButton;
4611
- cButton sevenButton;
4612
- cButton fourButton; // full panel
4613
- cButton oneButton; // full XYZ
4614
- //cButton currentLayout;
46155437
46165438 //
46175439 //Composite
....@@ -4624,7 +5446,9 @@
46245446 private MenuItem lookFromItem;
46255447 private MenuItem switchItem;
46265448 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
46285452 private MenuItem cloneItem;
46295453 private MenuItem cloneSupportItem;
46305454 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5459,9 @@
46355459 private MenuItem resetsupportItem;
46365460 private MenuItem resetreferencesItem;
46375461 private MenuItem linkverticesItem;
5462
+ private MenuItem relinkverticesItem;
46385463 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
46405465 private MenuItem stepAllItem;
46415466 private MenuItem revertMeshItem;
46425467 private MenuItem poseMeshItem;
....@@ -4647,14 +5472,17 @@
46475472 private MenuItem mergeGeometriesItem;
46485473 private MenuItem copyItem;
46495474 private MenuItem pasteItem;
5475
+ private MenuItem pasteIntoItem;
46505476 private MenuItem pasteLinkItem;
46515477 private MenuItem pasteCloneItem;
46525478 private MenuItem pasteExpandItem;
46535479 private MenuItem clearItem;
46545480 private MenuItem clearAllItem;
46555481 private MenuItem genUVItem;
5482
+ private MenuItem genNormalsMESHItem;
46565483 private MenuItem genNormalsCADItem;
46575484 private MenuItem genNormalsORGANItem;
5485
+ private MenuItem genNormalsMINEItem;
46585486 private MenuItem stripifyItem;
46595487 private MenuItem unstripifyItem;
46605488 private MenuItem trimItem;
....@@ -4683,6 +5511,10 @@
46835511 private MenuItem showleavesItem;
46845512 private MenuItem markleavesItem;
46855513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
46865518
46875519 private MenuItem flipVItem;
46885520 private MenuItem unflipVItem;
....@@ -4694,8 +5526,11 @@
46945526 private MenuItem panoTexturesItem;
46955527
46965528 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5529
+ private MenuItem resetCentroidXZItem;
46985530 private MenuItem resetTransformItem;
5531
+ private MenuItem transformGeometryItem;
5532
+ private MenuItem transformChildrenItem;
5533
+ private MenuItem hideItem;
46995534 private MenuItem grabItem;
47005535 private MenuItem backItem;
47015536 private MenuItem frontItem;
....@@ -4716,6 +5551,7 @@
47165551
47175552 private MenuItem resetParentItem;
47185553 private MenuItem repairParentItem;
5554
+ private MenuItem repairShadowItem;
47195555 private MenuItem sortbysizeItem;
47205556 private MenuItem sortbynameItem;
47215557
....@@ -4728,16 +5564,19 @@
47285564 private MenuItem particleItem;
47295565 private MenuItem ragdollItem;
47305566 private MenuItem ragdoll2Item;
5567
+ private MenuItem heightFieldItem;
5568
+ private MenuItem textureFieldItem;
47315569 private MenuItem gridItem;
47325570 private MenuItem rectoidItem;
47335571 private MenuItem ellipsoidItem;
47345572 private MenuItem coneItem;
47355573 private MenuItem torusItem;
47365574 private MenuItem superItem;
5575
+ private MenuItem kleinItem;
47375576 private MenuItem blobItem;
47385577 private MenuItem latheItem;
47395578 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5579
+ private MenuItem overlayItem;
47415580 private MenuItem meshItem;
47425581 // private MenuItem meshGroupItem;
47435582 private MenuItem springItem;
....@@ -4746,6 +5585,7 @@
47465585 private MenuItem csgItem;
47475586 private MenuItem templateItem;
47485587 private MenuItem textureItem;
5588
+ private MenuItem billboardItem;
47495589 private MenuItem shadowXItem;
47505590 private MenuItem shadowYItem;
47515591 private MenuItem shadowZItem;
....@@ -4758,11 +5598,6 @@
47585598 private MenuItem doubleItem;
47595599 private MenuItem tripleItem;
47605600
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665601 private MenuItem computeAOItem;
47675602 private MenuItem recompileItem;
47685603 private MenuItem editScriptItem;
....@@ -4772,4 +5607,8 @@
47725607 private MenuItem analyzeItem;
47735608 private MenuItem dumpItem;
47745609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
47755614 }