Normand Briere
2019-06-24 c67da2e5d8655704601d6d06e8bc60aabe212253
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -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,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //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
-
285
+ }
286
+
192287 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +304,99 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
319
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
320
+ relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
222324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223325 setMasterItem.addActionListener(this);
326
+ }
224327
225328 oe.menuBar.add(menu = new Menu("Group"));
226329 grabItem = menu.add(new MenuItem("Grab"));
227330 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230331 backItem = menu.add(new MenuItem("Back"));
231332 backItem.addActionListener(this);
333
+ frontItem = menu.add(new MenuItem("Front"));
334
+ frontItem.addActionListener(this);
232335 compositeItem = menu.add(new MenuItem("Composite"));
233336 compositeItem.addActionListener(this);
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
338
+ hideItem.addActionListener(this);
339
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
340
+ ungroupItem.addActionListener(this);
234341 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
236343 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242345 switchGeoItem.addActionListener(this);
243346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244347 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
246349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
247358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248359 scriptNodeItem.addActionListener(this);
249360 cameraItem = menu.add(new MenuItem("Camera"));
250361 cameraItem.addActionListener(this);
362
+ }
251363
252364 oe.menuBar.add(menu = new Menu("Object"));
253365 textureItem = menu.add(new MenuItem("Texture"));
254366 textureItem.addActionListener(this);
367
+ billboardItem = menu.add(new MenuItem("Billboard"));
368
+ billboardItem.addActionListener(this);
255369 csgItem = menu.add(new MenuItem("CSG"));
256370 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258372 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260374 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
263380 linkerItem = menu.add(new MenuItem("Linker"));
264381 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267382 attributeItem = menu.add(new MenuItem("Attribute"));
268383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
269386 pointflowItem = menu.add(new MenuItem("Point Flow"));
270387 pointflowItem.addActionListener(this);
388
+ }
271389 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275391 resetTransformItem.addActionListener(this);
276392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277393 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
280400
281401 oe.menuBar.add(menu = new Menu("Geometry"));
282402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +405,13 @@
285405 genNormalsORGANItem.addActionListener(this);
286406 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287407 genNormalsCADItem.addActionListener(this);
408
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
409
+ genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
412
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
413
+ genNormalsMINEItem.addActionListener(this);
414
+ }
288415 stripifyItem = menu.add(new MenuItem("Stripify"));
289416 stripifyItem.addActionListener(this);
290417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +433,34 @@
306433 reduce34MeshItem.addActionListener(this);
307434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308435 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
313444
314445 oe.menuBar.add(menu = new Menu("Attributes"));
315446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
317452 menu.add("-");
318453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319454 liveleavesItem.addActionListener(this);
320455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
322459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323460 supportleavesItem.addActionListener(this);
324461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325462 unsupportleavesItem.addActionListener(this);
463
+ }
326464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327465 hideleavesItem.addActionListener(this);
328466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +469,14 @@
331469 markleavesItem.addActionListener(this);
332470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
334480 menu.add("-");
335481 flipVItem = menu.add(new MenuItem("Flip V"));
336482 flipVItem.addActionListener(this);
....@@ -366,35 +512,40 @@
366512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367513 sortbynameItem.addActionListener(this);
368514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
369522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370523 extractGeometriesItem.addActionListener(this);
371524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372525 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
526
+ }
377527
378528 oe.menuBar.add(menu = new Menu("Insert"));
379529 buildCreateMenu(menu);
380530
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392531 oe.menuBar.add(menu = new Menu("Tools"));
393532 buildToolsMenu(menu);
394533 }
395534
396535 void SetupUI2(ObjEditor oe)
397536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
398549 //new Exception().printStackTrace();
399550
400551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +574,120 @@
423574 oe.radioPanel.add(dummyButton);
424575 oe.buttonGroup.add(dummyButton);
425576 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429578
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
431605 liveCB.addItemListener(this);
432606
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
451613 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
493617 trackCB.addItemListener(this);
494618
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
497621 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
622
+
499623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500624 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505625
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Show selection");
512635 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516636
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638
+
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
519641 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521643 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
523647 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
525650 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
527653 sevenButton.addActionListener(this);
528654 //
529655
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
531658 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
534662 closeButton.addActionListener(this);
535663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536664 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538665
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
541668 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545669
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
547672 uneditButton.addActionListener(this);
548673
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
561676 allParamsButton.addActionListener(this);
562677
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
568684 unselectButton.addActionListener(this);
569685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
570691 // oe.aConstraints.gridx += 1;
571692 // oe.aConstraints.weighty = 0;
572693 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +699,37 @@
578699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579700 // gcButton.addActionListener(this);
580701
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
592705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594707 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
599711
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
604716 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
607720 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
610724 textureCB.addItemListener(this);
611725
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
614729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
615733 //jList.addListSelectionListener(this);
616734 oe.jTree.addTreeSelectionListener(this);
617735 //jTree.setRootVisible(false);
....@@ -633,20 +751,111 @@
633751 radio.layout = sevenButton;
634752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
812
+ oeilCB.addItemListener(this);
813
+
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ if (Globals.ADVANCED)
819
+ {
820
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
821
+ lookAtCB.setToolTipText("Look-at target");
822
+ lookAtCB.addItemListener(this);
823
+ }
824
+
825
+ }
826
+
827
+ cGridBag fill = new cGridBag();
828
+
829
+ fill.preferredHeight = 200;
830
+
831
+ panel.add(fill);
832
+
833
+ }
636834
637835 void EditObject(Object3D obj)
638836 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
837
+ cRadio radioButton = new cRadio(obj.name);
838
+
839
+ // Patch to avoid bug with transparency.
840
+ radioButton.hadMaterial = obj.material != null;
841
+ if (!radioButton.hadMaterial)
842
+ {
843
+ obj.material = new cMaterial();
844
+ }
845
+
846
+ radioButton.SetObject(obj);
847
+ radioButton.layout = sevenButton;
848
+ radioButton.SetCamera(cameraView.renderCamera, false);
849
+ radioButton.addActionListener(this);
850
+ radioPanel.add(radioButton);
851
+ buttonGroup.add(radioButton);
852
+ radioButton.doClick();
647853 }
854
+
648855 void SetupViews(ObjEditor oe)
649856 {
857
+ theFrame = this;
858
+
650859 oe.SetupViews();
651860
652861 System.out.println("SetupViews");
....@@ -663,13 +872,16 @@
663872 JCheckBox fastCB;
664873 JCheckBox slowCB;
665874 JCheckBox boxCB;
875
+ JCheckBox zoomBoxCB;
666876 JCheckBox trackCB;
667877 JCheckBox smoothfocusCB;
668878 // JCheckBox speakerMocapCB;
669879 JCheckBox speakerCameraCB;
670880 JCheckBox speakerFocusCB;
671881 JCheckBox debugCB;
882
+
672883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
673885 JCheckBox lookAtCB;
674886
675887 // static int COLOR = 1;
....@@ -705,10 +917,10 @@
705917 dropAttributes |= Object3D.TEXTURE;
706918 else
707919 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
920
+ } else if(e.getSource() == liveCB)
710921 {
711922 cameraView.ToggleLive();
923
+ refreshContents(false);
712924 }
713925 else if(e.getSource() == supportCB)
714926 {
....@@ -744,6 +956,10 @@
744956 cameraView.repaint();
745957 // refreshContents();
746958 }
959
+ else if(e.getSource() == zoomBoxCB)
960
+ {
961
+ cameraView.ToggleZoomBoxMode();
962
+ }
747963 else if(e.getSource() == smoothfocusCB)
748964 {
749965 cameraView.ToggleSmoothFocus();
....@@ -768,6 +984,10 @@
768984 else if(e.getSource() == oeilCB)
769985 {
770986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
771991 }
772992 else if(e.getSource() == lookAtCB)
773993 {
....@@ -857,7 +1077,9 @@
8571077 // objEditor.DropFile((java.io.File[]) object, true);
8581078 // return;
8591079 // }
860
- if (string.charAt(0) == '/')
1080
+
1081
+ // File path for Mac and Windows
1082
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611083 {
8621084 // file(s)
8631085 String[] names = string.split("\n");
....@@ -884,7 +1106,7 @@
8841106
8851107 flashIt = false;
8861108 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1109
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881110 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891111
8901112 if (group.selection.size() == 1)
....@@ -911,11 +1133,11 @@
9111133 {
9121134 loadClipboard(true);
9131135 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1136
+ pasteInto(false, false);
9151137 } else {
9161138 loadClipboard(false);
9171139 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1140
+ pasteInto(false, false); // true); // ???
9191141 }
9201142 }
9211143 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1255,37 @@
10331255 torusItem.addActionListener(this);
10341256 superItem = menu.add(new MenuItem("Superellipsoid"));
10351257 superItem.addActionListener(this);
1258
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1259
+ kleinItem.addActionListener(this);
10361260 particleItem = menu.add(new MenuItem("Particle system"));
10371261 particleItem.addActionListener(this);
1262
+ if (Globals.ADVANCED)
1263
+ {
10381264 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391265 ragdollItem.addActionListener(this);
10401266 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411267 ragdoll2Item.addActionListener(this);
1268
+ }
10421269 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1270
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441271 meshItem.addActionListener(this);
10451272 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461273 // meshGroupItem.addActionListener(this);
1274
+ if (Globals.ADVANCED)
1275
+ {
10471276 springItem = menu.add(new MenuItem("Spring"));
10481277 springItem.addActionListener(this);
10491278 flagItem = menu.add(new MenuItem("Flag"));
10501279 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551280 blobItem = menu.add(new MenuItem("Blob"));
10561281 blobItem.addActionListener(this);
10571282 latheItem = menu.add(new MenuItem("Lathe"));
10581283 latheItem.addActionListener(this);
1284
+ }
1285
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1286
+ bezierItem.addActionListener(this);
1287
+ overlayItem = menu.add(new MenuItem("Overlay"));
1288
+ overlayItem.addActionListener(this);
10591289 lightItem = menu.add(new MenuItem("Light"));
10601290 lightItem.addActionListener(this);
10611291 menu.add("-");
....@@ -1065,39 +1295,44 @@
10651295 loopItem.addActionListener(this);
10661296 doubleItem = menu.add(new MenuItem("Fork"));
10671297 doubleItem.addActionListener(this);
1298
+ if (Globals.ADVANCED)
1299
+ {
10681300 tripleItem = menu.add(new MenuItem("Trident"));
10691301 tripleItem.addActionListener(this);
1302
+ }
10701303 }
10711304
10721305 void buildToolsMenu(Menu menu)
10731306 {
10741307 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751308 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1309
+ animationItem.setState(Globals.ANIMATION);
10771310
10781311 menu.add("-");
10791312 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801313 parseverticesItem.addActionListener(this);
10811314 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821315 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1316
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841317 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871318 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881319 reduceMorphItem.addActionListener(this);
10891320 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901321 reduce34MorphItem.addActionListener(this);
1091
-
1322
+ menu.add("-");
10921323 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931324 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951325
1326
+ if (Globals.ADVANCED)
1327
+ {
1328
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1329
+ mirrorItem.addActionListener(this);
1330
+ menu.add("-");
10961331 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971332 memoryItem.addActionListener(this);
10981333 menu.add(analyzeItem = new MenuItem("Analyze"));
10991334 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1335
+ menu.add(dumpItem = new MenuItem("Print"));
11011336 dumpItem.addActionListener(this);
11021337 // menu.add(pathItem = new MenuItem("From-to path"));
11031338 // pathItem.addActionListener(this);
....@@ -1106,6 +1341,8 @@
11061341 resetParentItem.addActionListener(this);
11071342 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081343 repairParentItem.addActionListener(this);
1344
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1345
+ repairShadowItem.addActionListener(this);
11091346 menu.add(invariantsItem = new MenuItem("Invariants"));
11101347 invariantsItem.addActionListener(this);
11111348 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1350,7 @@
11131350 menu.add("-");
11141351 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151352 editScriptItem.addActionListener(this);
1353
+ }
11161354 }
11171355
11181356 void ScreenFit()
....@@ -1235,6 +1473,7 @@
12351473 shadow.material = new cMaterial(obj.material);
12361474 shadow.material.diffuse = 0.0001f;
12371475 shadow.material.specular = 0.0001f;
1476
+ //shadow.projectedVertices[1].x = 300;
12381477
12391478 makeSomething(shadow);
12401479 }
....@@ -1441,9 +1680,9 @@
14411680
14421681 void Overwrite(int mask)
14431682 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1683
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451684 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1685
+ Object3D content = Grafreed.clipboard.get(0);
14471686
14481687 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491688 content = ((cGroup)content).get(0);
....@@ -1466,6 +1705,7 @@
14661705 //
14671706 public void actionPerformed(ActionEvent event) // , Object arg)
14681707 {
1708
+ Object source = event.getSource();
14691709 /*
14701710 if (event.getSource() == nameField)
14711711 {
....@@ -1477,11 +1717,11 @@
14771717 }
14781718 else
14791719 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1720
+ if (source == lookAtItem || source == lookFromItem)
14811721 {
14821722 ScreenFit();
14831723 } else
1484
- if (event.getSource() == switchItem)
1724
+ if (source == switchItem)
14851725 {
14861726 cVector v1 = new cVector();
14871727 cVector v2 = new cVector();
....@@ -1490,11 +1730,11 @@
14901730 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911731 objEditor.cameraView.repaint();
14921732 } else
1493
- if (event.getSource() == rectoidItem)
1733
+ if (source == rectoidItem)
14941734 {
14951735 makeSomething(new Box());
14961736 } else
1497
- if (event.getSource() == particleItem)
1737
+ if (source == particleItem)
14981738 {
14991739 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001740 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1755,9 @@
15151755 applyExample(particleGeom, "SMOKE");
15161756 makeSomething(particleGeom);
15171757 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1758
+ if (source == ragdollItem || source == ragdoll2Item)
15191759 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1760
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211761
15221762 ragdoll.toParent = LA.newMatrix();
15231763 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1775,7 @@
15351775 } else
15361776 /*
15371777 */
1538
- if (event.getSource() == heightFieldItem)
1778
+ if (source == heightFieldItem)
15391779 {
15401780 Object3D obj = new Object3D();
15411781
....@@ -1573,27 +1813,31 @@
15731813
15741814 makeSomething(obj);
15751815 } else
1576
- if (event.getSource() == gridItem)
1816
+ if (source == gridItem)
15771817 {
15781818 makeSomething(new Grid());
15791819 } else
1580
- if (event.getSource() == ellipsoidItem)
1820
+ if (source == ellipsoidItem)
15811821 {
15821822 makeSomething(new Sphere());
15831823 } else
1584
- if (event.getSource() == coneItem)
1824
+ if (source == coneItem)
15851825 {
15861826 makeSomething(new Cone());
15871827 } else
1588
- if (event.getSource() == torusItem)
1828
+ if (source == torusItem)
15891829 {
15901830 makeSomething(new Torus());
15911831 } else
1592
- if (event.getSource() == superItem)
1832
+ if (source == superItem)
15931833 {
15941834 makeSomething(new Superellipsoid());
15951835 } else
1596
- if (event.getSource() == blobItem)
1836
+ if (source == kleinItem)
1837
+ {
1838
+ makeSomething(new Klein());
1839
+ } else
1840
+ if (source == blobItem)
15971841 {
15981842 Blob blob = new Blob();
15991843 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1845,15 @@
16011845 //blob.retile();
16021846 makeSomething(blob);
16031847 } else
1604
- if (event.getSource() == latheItem)
1848
+ if (source == latheItem)
16051849 {
16061850 makeSomething(new Lathe());
16071851 } else
1608
- if (event.getSource() == bezierItem)
1852
+ if (source == bezierItem)
16091853 {
16101854 makeSomething(new BezierSurface());
16111855 } else
1612
- if (event.getSource() == checkerItem)
1856
+ if (source == overlayItem)
16131857 {
16141858 /*
16151859 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1868,7 @@
16241868 */
16251869 makeSomething(new Checker());
16261870 } else
1627
- if (event.getSource() == meshItem)
1871
+ if (source == meshItem)
16281872 {
16291873 Object3D itemtomake = new Object3D();
16301874 Object3D child;
....@@ -1645,35 +1889,35 @@
16451889 makeSomething(child);
16461890 }
16471891 } else
1648
- if (event.getSource() == springItem)
1892
+ if (source == springItem)
16491893 {
16501894 cSpring s = new cSpring();
16511895 s.setup();
16521896 makeSomething(s);
16531897 } else
1654
- if (event.getSource() == flagItem)
1898
+ if (source == flagItem)
16551899 {
16561900 cSpring s = new cFlag();
16571901 s.setup();
16581902 makeSomething(s);
16591903 } else
1660
- if (event.getSource() == lightItem)
1904
+ if (source == lightItem)
16611905 {
16621906 makeSomething(new Light());
16631907 } else
1664
- if (event.getSource() == csgItem)
1908
+ if (source == csgItem)
16651909 {
16661910 group(new CSG());
16671911 } else
1668
- if (event.getSource() == templateItem)
1912
+ if (source == templateItem)
16691913 {
16701914 group(new cTemplate());
16711915 } else
1672
- if (event.getSource() == attributeItem)
1916
+ if (source == attributeItem)
16731917 {
16741918 makeSomething(new Attribute());
16751919 } else
1676
- if (event.getSource() == pointflowItem)
1920
+ if (source == pointflowItem)
16771921 {
16781922 makeSomething(new PointFlow());
16791923 } else
....@@ -1685,7 +1929,7 @@
16851929 } else
16861930 */
16871931
1688
- if (event.getSource() == superLoopItem)
1932
+ if (source == superLoopItem)
16891933 {
16901934 Composite g = new cGroup();
16911935 for (int i=0; i<15; i++)
....@@ -1707,7 +1951,7 @@
17071951
17081952 group(g);
17091953 } else
1710
- if (event.getSource() == loopItem)
1954
+ if (source == loopItem)
17111955 {
17121956 Composite csg = new GroupLeaf();
17131957 csg.count = 5;
....@@ -1716,7 +1960,7 @@
17161960 csg.addChild(child);
17171961 child.addChild(csg);
17181962 } else
1719
- if (event.getSource() == doubleItem)
1963
+ if (source == doubleItem)
17201964 {
17211965 Composite csg = new GroupLeaf();
17221966 csg.count = 5;
....@@ -1728,7 +1972,7 @@
17281972 csg.addChild(child);
17291973 child.addChild(csg);
17301974 } else
1731
- if (event.getSource() == tripleItem)
1975
+ if (source == tripleItem)
17321976 {
17331977 Composite csg = new GroupLeaf();
17341978 csg.count = 4;
....@@ -1743,71 +1987,83 @@
17431987 csg.addChild(child);
17441988 child.addChild(csg);
17451989 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1990
+ if (source == computeAOItem)
17481991 {
1749
- ImportGFD();
1992
+ Globals.drawMode = CameraPane.OCCLUSION;
1993
+ Globals.theRenderer.repaint();
17501994 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
1995
+ if (source == recompileItem)
17691996 {
17701997 Recompile();
17711998 refreshContents();
17721999 } else
1773
- if (event.getSource() == editScriptItem)
2000
+ if (source == editScriptItem)
17742001 {
17752002 OpenDialog();
17762003 refreshContents();
17772004 } else
1778
- if (event.getSource() == invariantsItem)
2005
+ if (source == invariantsItem)
17792006 {
17802007 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2008
+ Grafreed.grafreeD.universe.invariants();
17822009 } else
1783
- if (event.getSource() == memoryItem)
2010
+ if (source == memoryItem)
17842011 {
17852012 //System.out.println("Invariants:");
17862013 PrintMemory();
17872014 } else
1788
- if (event.getSource() == pathItem)
2015
+ if (source == pathItem)
17892016 {
17902017 PrintPath();
17912018 } else
1792
- if (event.getSource() == analyzeItem)
2019
+ if (source == analyzeItem)
17932020 {
17942021 AnalyzeObject();
17952022 } else
1796
- if (event.getSource() == dumpItem)
2023
+ if (source == dumpItem)
17972024 {
17982025 DumpObject();
17992026 } else
1800
- if (event.getSource() == screenfitButton)
2027
+ if (source == minButton)
2028
+ {
2029
+ Minimize();
2030
+ } else
2031
+ if (source == maxButton)
2032
+ {
2033
+ Maximize();
2034
+ } else
2035
+ if (source == fullButton)
2036
+ {
2037
+ ToggleFullScreen();
2038
+ } else
2039
+ if (source == undoButton)
2040
+ {
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoButton)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == saveButton)
2048
+ {
2049
+ Save();
2050
+ } else
2051
+ if (source == oneStepButton)
2052
+ {
2053
+ Globals.ONESTEP = true;
2054
+ cameraView.repaint();
2055
+ } else
2056
+ if (source == screenfitButton)
18012057 {
18022058 //Reload(lastConverter, lastFilename, true);
18032059 ScreenFit();
18042060 } else
1805
- if (event.getSource() == screenfitpointButton)
2061
+ if (source == screenfitpointButton)
18062062 {
18072063 //Reload(lastConverter, lastFilename, true);
18082064 ScreenFitPoint();
18092065 } else
1810
- if (event.getSource() == snapobjectButton)
2066
+ if (source == snapobjectButton)
18112067 {
18122068 //Reload(lastConverter, lastFilename, true);
18132069 SnapObject();
....@@ -1818,13 +2074,13 @@
18182074 // Recompile();
18192075 // refreshContents();
18202076 // } else
1821
- if (event.getSource() == gcButton)
2077
+ if (source == gcButton)
18222078 {
18232079 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242080 System.gc();
18252081 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262082 } else
1827
- if (event.getSource() == editLeafItem)
2083
+ if (source == editLeafItem)
18282084 {
18292085 Object3D obj;
18302086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2094,78 @@
18382094 }
18392095 refreshContents(true);
18402096 } else
1841
- if (event.getSource() == openWindowItem)
2097
+ if (source == openWindowItem)
18422098 {
18432099 EditSelection(true);
18442100 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2101
+ if (source == cutItem || source == clearButton)
18462102 {
18472103 loadClipboard(true);
18482104 } else
1849
- if (event.getSource() == duplicateItem)
2105
+ if (source == undoItem)
18502106 {
1851
- Object3D keep = GraphreeD.clipboard;
2107
+ Undo();
2108
+ } else
2109
+ if (source == redoItem)
2110
+ {
2111
+ Redo();
2112
+ } else
2113
+ if (source == duplicateItem)
2114
+ {
2115
+ Object3D keep = Grafreed.clipboard;
18522116 loadClipboard(false);
18532117 paste(false);
1854
- GraphreeD.clipboard = keep;
2118
+ Grafreed.clipboard = keep;
18552119 } else
1856
- if (event.getSource() == cloneItem)
2120
+ if (source == cloneItem)
18572121 {
18582122 CloneSelection(false);
18592123 } else
1860
- if (event.getSource() == cloneSupportItem)
2124
+ if (source == cloneSupportItem)
18612125 {
18622126 CloneSelection(true);
18632127 } else
1864
- if (event.getSource() == copyItem)
2128
+ if (source == copyItem)
18652129 {
18662130 loadClipboard(false);
18672131 } else
1868
- if (event.getSource() == pasteItem)
2132
+ if (source == pasteItem)
18692133 {
18702134 paste(false);
18712135 } else
1872
- if (event.getSource() == pasteLinkItem)
2136
+ if (source == pasteIntoItem)
18732137 {
1874
- pasteInto(false);
2138
+ pasteInto(true, false);
18752139 } else
1876
- if (event.getSource() == pasteCloneItem)
2140
+ if (source == pasteLinkItem)
18772141 {
1878
- pasteInto(true);
2142
+ pasteInto(false, false);
18792143 } else
1880
- if (event.getSource() == pasteExpandItem)
2144
+ if (source == pasteCloneItem)
2145
+ {
2146
+ pasteInto(true, true);
2147
+ } else
2148
+ if (source == pasteExpandItem)
18812149 {
18822150 paste(true);
18832151 } else
1884
- if (event.getSource() == synchronizeItem)
2152
+ if (source == synchronizeItem)
18852153 {
18862154 Overwrite(Object3D.TRANSFORM);
18872155 } else
1888
- if (event.getSource() == overwriteNameItem)
2156
+ if (source == overwriteNameItem)
18892157 {
18902158 Overwrite(Object3D.NAME);
18912159 } else
1892
- if (event.getSource() == overwriteUVItem)
2160
+ if (source == overwriteUVItem)
18932161 {
18942162 Overwrite(Object3D.UV);
18952163 } else
1896
- if (event.getSource() == overwriteMatItem)
2164
+ if (source == overwriteMatItem)
18972165 {
2166
+ /* july 2015
18982167 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2168
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002169 else
19012170 {
19022171 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2177,16 @@
19082177 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092178 }
19102179 }
2180
+ */
2181
+
2182
+ Overwrite(dropAttributes);
19112183 }
1912
- if (event.getSource() == overwriteGeoItem)
2184
+ if (source == overwriteGeoItem)
19132185 {
19142186 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2187
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162188 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2189
+// Object3D content = GrafreeD.clipboard.get(0);
19182190 //
19192191 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202192 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2198,7 @@
19262198 // refreshContents();
19272199 // }
19282200 } else
1929
- if (event.getSource() == generateMeshItem)
2201
+ if (source == generateMeshItem)
19302202 {
19312203 //if (group.selection.size() == 1)
19322204 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2209,7 @@
19372209 ResetModel();
19382210 refreshContents();
19392211 } else
1940
- if (event.getSource() == extractGeometriesItem)
2212
+ if (source == extractGeometriesItem)
19412213 {
19422214 boolean one = false;
19432215
....@@ -1964,7 +2236,7 @@
19642236 ResetModel();
19652237 refreshContents();
19662238 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2239
+ if (source == cloneGeometriesItem)
19682240 {
19692241 boolean one = false;
19702242
....@@ -1990,32 +2262,37 @@
19902262 ResetModel();
19912263 refreshContents();
19922264 } else
1993
- if (event.getSource() == shareGeometriesItem)
2265
+ if (source == shareGeometriesItem)
19942266 {
19952267 boolean one = false;
19962268
19972269 if (group.selection.size() == 1)
19982270 one = true;
19992271
2272
+ Object3D merge = null;
2273
+
20002274 Object3D content = new cGroup();
20012275
20022276 for (int i=0; i<group.selection.size(); i++)
20032277 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2278
+ merge = new Merge(group.selection.get(i));
20052279
20062280 if (one)
2007
- makeSomething(sel, false);
2281
+ makeSomething(merge, false);
20082282 else
2009
- content.addChild(sel);
2283
+ content.addChild(merge);
20102284 }
20112285
20122286 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2287
+ makeSomething(content, true);
2288
+ else
2289
+ {
2290
+ ResetModel();
2291
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2292
+ refreshContents();
2293
+ }
20172294 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2295
+ if (source == mergeGeometriesItem)
20192296 {
20202297 boolean one = false;
20212298
....@@ -2045,11 +2322,11 @@
20452322 ResetModel();
20462323 refreshContents();
20472324 } else
2048
- if (event.getSource() == linkverticesItem)
2325
+ if (source == linkverticesItem)
20492326 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2327
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512328 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2329
+// Object3D content = GrafreeD.clipboard.get(0);
20532330 //
20542331 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552332 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2335,48 @@
20582335 // group.selection.get(0).setMasterThis(content); // should be identity
20592336 // refreshContents();
20602337 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2338
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622339 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
20642341
20652342 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662343 content = ((cGroup)content).get(0);
20672344
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2345
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692346 for (int i=0; i<group.selection.size(); i++)
20702347 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2348
+ boolean random = CameraPane.SWITCH;
2349
+ CameraPane.SWITCH = false; // parse all random nodes
20732350 group.selection.get(i).linkVerticesThis(content);
20742351 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2352
+ CameraPane.SWITCH = random;
20762353 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2354
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782355 refreshContents();
20792356 }
20802357 } else
2081
- if (event.getSource() == resetsupportItem)
2358
+ if (source == resetsupportItem)
20822359 {
20832360 for (int i=0; i<group.selection.size(); i++)
20842361 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2362
+ boolean random = CameraPane.SWITCH;
2363
+ CameraPane.SWITCH = false; // parse all random nodes
20872364 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2365
+ CameraPane.SWITCH = random;
20892366 }
20902367
20912368 refreshContents();
20922369 } else
2093
- if (event.getSource() == resetreferencesItem)
2370
+ if (source == relinkverticesItem)
2371
+ {
2372
+ boolean random = CameraPane.SWITCH;
2373
+ CameraPane.SWITCH = false; // parse all random nodes
2374
+ group.selection.RelinkToSupport();
2375
+ CameraPane.SWITCH = random;
2376
+
2377
+ refreshContents();
2378
+ } else
2379
+ if (source == resetreferencesItem)
20942380 {
20952381 for (int i=0; i<group.selection.size(); i++)
20962382 {
....@@ -2099,11 +2385,11 @@
20992385
21002386 refreshContents();
21012387 } else
2102
- if (event.getSource() == setMasterItem)
2388
+ if (source == setMasterItem)
21032389 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2390
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052391 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2392
+ Object3D content = Grafreed.clipboard.get(0);
21072393
21082394 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092395 content = ((cGroup)content).get(0);
....@@ -2112,13 +2398,13 @@
21122398 refreshContents();
21132399 }
21142400 } else
2115
- if (event.getSource() == poseMeshItem)
2401
+ if (source == poseMeshItem)
21162402 {
21172403 if (group.selection.size() == 1)
21182404 {
2119
- if (GraphreeD.clipboard.size() == 1)
2405
+ if (Grafreed.clipboard.size() == 1)
21202406 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2407
+ Object3D content = Grafreed.clipboard.get(0);
21222408
21232409 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242410 content = ((cGroup)content).get(0);
....@@ -2131,19 +2417,19 @@
21312417 }
21322418
21332419 } else
2134
- if (event.getSource() == revertMeshItem)
2420
+ if (source == revertMeshItem)
21352421 {
21362422 RevertMeshes();
21372423 } else
2138
- if (event.getSource() == resetMeshItem)
2424
+ if (source == resetAllItem)
21392425 {
21402426 ResetAll();
21412427 } else
2142
- if (event.getSource() == stepAllItem)
2428
+ if (source == stepAllItem)
21432429 {
21442430 StepAll();
21452431 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2432
+ if (source == clearItem) // || event.getSource() == clearButton)
21472433 {
21482434 //int indices[] = jList.getSelectedIndices();
21492435 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2437,46 @@
21512437
21522438 ClearSelection(false);
21532439 } else
2154
- if (event.getSource() == clearAllItem)
2440
+ if (source == clearAllItem)
21552441 {
21562442 ClearSelection(true);
21572443 } else
2158
- if (event.getSource() == grabItem)
2444
+ if (source == grabItem)
21592445 {
21602446 group(new cGroup(), true);
21612447 } else
2162
- if (event.getSource() == frontItem)
2448
+ if (source == hideItem)
2449
+ {
2450
+ group(new HiddenObject());
2451
+ } else
2452
+ if (source == frontItem)
21632453 {
21642454 front();
21652455 } else
2166
- if (event.getSource() == backItem)
2456
+ if (source == backItem)
21672457 {
21682458 back();
21692459 } else
2170
- if (event.getSource() == cameraItem)
2460
+ if (source == cameraItem)
21712461 {
21722462 makeSomething(new Camera());
21732463 } else
2174
- if (event.getSource() == compositeItem)
2464
+ if (source == compositeItem)
21752465 {
21762466 group(new Composite());
21772467 } else
2178
- if (event.getSource() == randomItem)
2468
+ if (source == randomItem)
21792469 {
21802470 RandomNode random = new RandomNode();
21812471 group(random);
21822472 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2473
+ random.name = random.get(0).name + "Switch";
21842474 } else
2185
- if (event.getSource() == physicsItem)
2475
+ if (source == physicsItem)
21862476 {
21872477 group(new PhysicsNode());
21882478 } else
2189
- if (event.getSource() == frameselectorItem)
2479
+ if (source == frameselectorItem)
21902480 {
21912481 for (int i=0; i<group.selection.size(); i++)
21922482 {
....@@ -2198,7 +2488,7 @@
21982488 ResetModel();
21992489 refreshContents();
22002490 } else
2201
- if (event.getSource() == switchGeoItem)
2491
+ if (source == switchGeoItem)
22022492 {
22032493 for (int i=0; i<group.selection.size(); i++)
22042494 {
....@@ -2210,7 +2500,7 @@
22102500 ResetModel();
22112501 refreshContents();
22122502 } else
2213
- if (event.getSource() == switchTransfoItem)
2503
+ if (source == switchTransfoItem)
22142504 {
22152505 for (int i=0; i<group.selection.size(); i++)
22162506 {
....@@ -2222,7 +2512,7 @@
22222512 ResetModel();
22232513 refreshContents();
22242514 } else
2225
- if (event.getSource() == morphItem)
2515
+ if (source == morphItem)
22262516 {
22272517 for (int i=0; i<group.selection.size(); i++)
22282518 {
....@@ -2234,7 +2524,7 @@
22342524 ResetModel();
22352525 refreshContents();
22362526 } else
2237
- if (event.getSource() == scriptNodeItem)
2527
+ if (source == scriptNodeItem)
22382528 {
22392529 boolean atleastone = false;
22402530
....@@ -2273,195 +2563,239 @@
22732563 }
22742564 }
22752565 } else
2276
- if (event.getSource() == linkerItem)
2566
+ if (source == linkerItem)
22772567 {
22782568 group(new cLinker());
22792569 } else
2280
- if (event.getSource() == textureItem)
2570
+ if (source == textureItem)
22812571 {
22822572 group(new TextureNode());
22832573 } else
2284
- if (event.getSource() == shadowXItem)
2574
+ if (source == billboardItem)
2575
+ {
2576
+ group(new BillboardNode());
2577
+ } else
2578
+ if (source == shadowXItem)
22852579 {
22862580 CastShadow(0);
22872581 } else
2288
- if (event.getSource() == shadowYItem)
2582
+ if (source == shadowYItem)
22892583 {
22902584 CastShadow(1);
22912585 } else
2292
- if (event.getSource() == shadowZItem)
2586
+ if (source == shadowZItem)
22932587 {
22942588 CastShadow(2);
22952589 } else
2296
- if (event.getSource() == ungroupItem)
2590
+ if (source == ungroupItem)
22972591 {
2298
- ungroup();
2592
+ //ungroup();
2593
+ for (int i=0; i<group.selection.size(); i++)
2594
+ {
2595
+ Ungroup(group.selection.get(i));
2596
+ }
2597
+
2598
+ ClearSelection(false);
2599
+
2600
+ refreshContents();
22992601 } else
2300
- if (event.getSource() == genUVItem)
2602
+ if (source == genUVItem)
23012603 {
23022604 GenUV();
23032605 } else
2304
- if (event.getSource() == genNormalsCADItem)
2606
+ if (source == genNormalsCADItem)
23052607 {
23062608 GenNormals(true);
23072609 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2610
+ if (source == genNormalsMESHItem)
2611
+ {
2612
+ GenNormalsMESH();
2613
+ } else
2614
+ if (source == genNormalsORGANItem)
23092615 {
23102616 GenNormals(false);
23112617 } else
2312
- if (event.getSource() == stripifyItem)
2618
+ if (source == genNormalsMINEItem)
2619
+ {
2620
+ GenNormalsMINE();
2621
+ } else
2622
+ if (source == stripifyItem)
23132623 {
23142624 Stripify();
23152625 } else
2316
- if (event.getSource() == unstripifyItem)
2626
+ if (source == unstripifyItem)
23172627 {
23182628 Unstripify();
23192629 } else
2320
- if (event.getSource() == trimItem)
2630
+ if (source == trimItem)
23212631 {
23222632 Trim();
23232633 } else
2324
- if (event.getSource() == untrimItem)
2634
+ if (source == untrimItem)
23252635 {
23262636 Untrim();
23272637 } else
2328
- if (event.getSource() == clearColorsItem)
2638
+ if (source == clearColorsItem)
23292639 {
23302640 ClearColors();
23312641 } else
2332
- if (event.getSource() == clearMaterialsItem)
2642
+ if (source == clearMaterialsItem)
23332643 {
23342644 ClearMaterials();
23352645 } else
2336
- if (event.getSource() == liveleavesItem)
2646
+ if (source == liveleavesItem)
23372647 {
23382648 LiveLeaves(true);
23392649 } else
2340
- if (event.getSource() == unliveleavesItem)
2650
+ if (source == unliveleavesItem)
23412651 {
23422652 LiveLeaves(false);
23432653 } else
2344
- if (event.getSource() == supportleavesItem)
2654
+ if (source == supportleavesItem)
23452655 {
23462656 SupportLeaves(true);
23472657 } else
2348
- if (event.getSource() == unsupportleavesItem)
2658
+ if (source == unsupportleavesItem)
23492659 {
23502660 SupportLeaves(false);
23512661 } else
2352
- if (event.getSource() == hideleavesItem)
2662
+ if (source == hideleavesItem)
23532663 {
23542664 HideLeaves(true);
23552665 } else
2356
- if (event.getSource() == showleavesItem)
2666
+ if (source == showleavesItem)
23572667 {
23582668 HideLeaves(false);
23592669 } else
2360
- if (event.getSource() == markleavesItem)
2670
+ if (source == markleavesItem)
23612671 {
23622672 MarkLeaves(true);
23632673 } else
2364
- if (event.getSource() == unmarkleavesItem)
2674
+ if (source == unmarkleavesItem)
23652675 {
23662676 MarkLeaves(false);
23672677 } else
2368
- if (event.getSource() == flipVItem)
2678
+ if (source == rewindleavesItem)
2679
+ {
2680
+ RewindLeaves(true);
2681
+ } else
2682
+ if (source == unrewindleavesItem)
2683
+ {
2684
+ RewindLeaves(false);
2685
+ } else
2686
+ if (source == randomleavesItem)
2687
+ {
2688
+ RandomLeaves(true);
2689
+ } else
2690
+ if (source == unrandomleavesItem)
2691
+ {
2692
+ RandomLeaves(false);
2693
+ } else
2694
+ if (source == flipVItem)
23692695 {
23702696 FlipV(true);
23712697 } else
2372
- if (event.getSource() == unflipVItem)
2698
+ if (source == unflipVItem)
23732699 {
23742700 FlipV(false);
23752701 } else
2376
- if (event.getSource() == lowTexturesItem)
2702
+ if (source == lowTexturesItem)
23772703 {
23782704 SetTexRes(0);
23792705 } else
2380
- if (event.getSource() == normalTexturesItem)
2706
+ if (source == normalTexturesItem)
23812707 {
23822708 SetTexRes(1);
23832709 } else
2384
- if (event.getSource() == highTexturesItem)
2710
+ if (source == highTexturesItem)
23852711 {
23862712 SetTexRes(2);
23872713 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2714
+ if (source == veryhighTexturesItem)
23892715 {
23902716 SetTexRes(3);
23912717 } else
2392
- if (event.getSource() == maxTexturesItem)
2718
+ if (source == maxTexturesItem)
23932719 {
23942720 SetTexRes(4);
23952721 } else
2396
- if (event.getSource() == panoTexturesItem)
2722
+ if (source == panoTexturesItem)
23972723 {
23982724 SetTexRes(5);
23992725 } else
2400
- if (event.getSource() == reverseNormalsItem)
2726
+ if (source == reverseNormalsItem)
24012727 {
24022728 ReverseNormals();
24032729 } else
2404
- if (event.getSource() == parseverticesItem)
2730
+ if (source == parseverticesItem)
24052731 {
24062732 ParseVertices();
24072733 } else
2408
- if (event.getSource() == textureFieldItem)
2734
+ if (source == textureFieldItem)
24092735 {
24102736 TextureVertices();
24112737 } else
2412
- if (event.getSource() == alignItem)
2738
+ if (source == alignItem)
24132739 {
24142740 Align();
24152741 } else
2416
- if (event.getSource() == mirrorItem)
2742
+ if (source == mirrorItem)
24172743 {
24182744 MirrorPoses();
24192745 } else
2420
- if (event.getSource() == reduceMorphItem)
2746
+ if (source == reduceMorphItem)
24212747 {
24222748 MeshReduction(false);
24232749 } else
2424
- if (event.getSource() == reduce34MorphItem)
2750
+ if (source == reduce34MorphItem)
24252751 {
24262752 MeshReduction(true);
24272753 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2754
+ if (source == reverseTrianglesItem)
24292755 {
24302756 ReverseTriangles();
24312757 } else
2432
- if (event.getSource() == reduceMeshItem)
2758
+ if (source == reduceMeshItem)
24332759 {
24342760 ReduceMesh(false);
24352761 } else
2436
- if (event.getSource() == reduce34MeshItem)
2762
+ if (source == reduce34MeshItem)
24372763 {
24382764 ReduceMesh(true);
24392765 } else
2440
- if (event.getSource() == increaseMeshItem)
2766
+ if (source == increaseMeshItem)
24412767 {
24422768 IncreaseMesh();
24432769 } else
2444
- if (event.getSource() == clipMeshItem)
2770
+ if (source == clipMeshItem)
24452771 {
24462772 ClipMesh();
24472773 } else
2448
- if (event.getSource() == smoothMeshItem)
2774
+ if (source == smoothMeshItem)
24492775 {
24502776 SmoothMesh();
24512777 } else
2452
- if (event.getSource() == transformgeometryItem)
2778
+ if (source == transformGeometryItem)
24532779 {
24542780 TransformGeometry();
24552781 } else
2456
- if (event.getSource() == resetTransformItem)
2782
+ if (source == transformChildrenItem)
2783
+ {
2784
+ TransformChildren();
2785
+ } else
2786
+ if (source == resetTransformItem)
24572787 {
24582788 ResetTransform();
24592789 } else
2460
- if (event.getSource() == resetCentroidItem)
2790
+ if (source == resetCentroidItem)
24612791 {
2462
- ResetCentroid();
2792
+ ResetCentroid(true);
24632793 } else
2464
- if (event.getSource() == resetParentItem)
2794
+ if (source == resetCentroidXZItem)
2795
+ {
2796
+ ResetCentroid(false);
2797
+ } else
2798
+ if (source == resetParentItem)
24652799 {
24662800 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672801 {
....@@ -2471,7 +2805,7 @@
24712805
24722806 refreshContents();
24732807 } else
2474
- if (event.getSource() == repairParentItem)
2808
+ if (source == repairParentItem)
24752809 {
24762810 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772811 {
....@@ -2485,7 +2819,21 @@
24852819
24862820 refreshContents();
24872821 } else
2488
- if (event.getSource() == sortbysizeItem)
2822
+ if (source == repairShadowItem)
2823
+ {
2824
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2825
+ {
2826
+ Object3D obj = (Object3D)e.nextElement();
2827
+ obj.RepairShadow();
2828
+// for (int i=0; i<obj.size(); i++)
2829
+// {
2830
+// obj.get(i).parent = obj;
2831
+// }
2832
+ }
2833
+
2834
+ refreshContents();
2835
+ } else
2836
+ if (source == sortbysizeItem)
24892837 {
24902838 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912839 {
....@@ -2497,7 +2845,7 @@
24972845 ResetModel();
24982846 refreshContents();
24992847 } else
2500
- if (event.getSource() == sortbynameItem)
2848
+ if (source == sortbynameItem)
25012849 {
25022850 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032851 {
....@@ -2509,7 +2857,7 @@
25092857 ResetModel();
25102858 refreshContents();
25112859 } else
2512
- if (event.getSource() == attachPigmentItem)
2860
+ if (source == attachPigmentItem)
25132861 {
25142862 String texture = GetFile("Attach pigment");
25152863 Object3D obj;
....@@ -2521,7 +2869,7 @@
25212869
25222870 refreshContents();
25232871 } else
2524
- if (event.getSource() == detachPigmentItem)
2872
+ if (source == detachPigmentItem)
25252873 {
25262874 Object3D obj;
25272875 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2880,7 @@
25322880
25332881 refreshContents();
25342882 } else
2535
- if (event.getSource() == attachBumpItem)
2883
+ if (source == attachBumpItem)
25362884 {
25372885 String texture = GetFile("Attach bump");
25382886 Object3D obj;
....@@ -2544,7 +2892,7 @@
25442892
25452893 refreshContents();
25462894 } else
2547
- if (event.getSource() == detachBumpItem)
2895
+ if (source == detachBumpItem)
25482896 {
25492897 Object3D obj;
25502898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2903,7 @@
25552903
25562904 refreshContents();
25572905 } else
2558
- if (event.getSource() == pigmentBumpItem)
2906
+ if (source == pigmentBumpItem)
25592907 {
25602908 Object3D obj;
25612909 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2914,221 @@
25662914
25672915 refreshContents();
25682916 } else
2569
- if (event.getSource() == flashSelectionButton)
2917
+ if (source == flashSelectionButton)
25702918 {
25712919 CameraPane.flash = true;
25722920 refreshContents();
25732921 } else
2574
- if (event.getSource() == oneButton)
2922
+ if (source == oneButton)
25752923 {
25762924 } else
2577
- if (event.getSource() == twoButton)
2925
+ if (source == twoButton)
25782926 {
25792927 radio.layout = twoButton;
25802928 // bug
25812929 //gridPanel.setDividerLocation(1.0);
25822930 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
2931
+// bigThree.remove(scenePanel);
2932
+// bigThree.remove(centralPanel);
2933
+// bigThree.remove(XYZPanel);
2934
+// aWindowConstraints.gridx = 0;
2935
+// aWindowConstraints.gridy = 0;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// aWindowConstraints.weightx = 0;
2940
+// aWindowConstraints.weighty = 1;
2941
+// //bigThree.add(jtp, aWindowConstraints);
2942
+// aWindowConstraints.weightx = 1;
2943
+// aWindowConstraints.gridwidth = 3;
2944
+// // aConstraints.gridheight = 3;
2945
+// aWindowConstraints.gridx = 1;
2946
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2947
+// bigThree.add(centralPanel, aWindowConstraints);
2948
+// aWindowConstraints.weightx = 0;
2949
+// aWindowConstraints.gridx = 4;
2950
+// aWindowConstraints.gridwidth = 1;
2951
+// // aConstraints.gridheight = 3;
2952
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2953
+// //bigThree.add(XYZPanel, aWindowConstraints);
2954
+// scenePanel.setVisible(false);
2955
+// centralPanel.setVisible(true);
2956
+// XYZPanel.setVisible(false);
2957
+ bigThree.ClearUI();
2958
+ bigThree.add(centralPanel);
2959
+ bigThree.FlushUI();
2960
+
2961
+ cameraView.requestFocusInWindow();
2962
+
2963
+// refreshContents(true);
2964
+//
2965
+// try
2966
+// {
2967
+// java.awt.Robot bot = new java.awt.Robot();
2968
+// int mask = InputEvent.BUTTON1_MASK;
2969
+// bot.mouseMove(100, 100);
2970
+// bot.mousePress(mask);
2971
+// bot.mouseRelease(mask);
2972
+// }
2973
+// catch (Exception e)
2974
+// {
2975
+//
2976
+// }
2977
+
26072978 } else
2608
- if (event.getSource() == threeButton)
2979
+ if (source == threeButton)
26092980 {
26102981 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
2982
+
2983
+// bigThree.remove(scenePanel);
2984
+// bigThree.remove(centralPanel);
2985
+// bigThree.remove(XYZPanel);
2986
+// aWindowConstraints.gridx = 0;
2987
+// aWindowConstraints.gridy = 0;
2988
+// aWindowConstraints.gridwidth = 1;
2989
+// // aConstraints.gridheight = 3;
2990
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2991
+// aWindowConstraints.weightx = 0;
2992
+// aWindowConstraints.weighty = 1;
2993
+// //bigThree.add(jtp, aWindowConstraints);
2994
+// aWindowConstraints.weightx = 1;
2995
+// aWindowConstraints.gridwidth = 3;
2996
+// // aConstraints.gridheight = 3;
2997
+// aWindowConstraints.gridx = 1;
2998
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2999
+// bigThree.add(centralPanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 0;
3001
+// aWindowConstraints.gridx = 4;
3002
+// aWindowConstraints.gridwidth = 1;
3003
+// // aConstraints.gridheight = 3;
3004
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3005
+// bigThree.add(XYZPanel, aWindowConstraints);
3006
+// bigThree.validate();
3007
+// scenePanel.setVisible(false);
3008
+// centralPanel.setVisible(true);
3009
+// XYZPanel.setVisible(true);
3010
+ bigThree.ClearUI();
3011
+ bigThree.add(centralPanel);
3012
+ bigThree.add(XYZPanel);
3013
+ bigThree.FlushUI();
3014
+
3015
+ cameraView.requestFocusInWindow();
26353016 } else
2636
- if (event.getSource() == fourButton)
3017
+ if (source == fourButton)
26373018 {
26383019 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3020
+
3021
+// bigThree.remove(scenePanel);
3022
+// bigThree.remove(centralPanel);
3023
+// bigThree.remove(XYZPanel);
3024
+// aWindowConstraints.gridx = 0;
3025
+// aWindowConstraints.gridy = 0;
3026
+// aWindowConstraints.gridwidth = 1;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3029
+// aWindowConstraints.weightx = 1;
3030
+// aWindowConstraints.weighty = 1;
3031
+// bigThree.add(scenePanel, aWindowConstraints);
3032
+// aWindowConstraints.weightx = 1;
3033
+// aWindowConstraints.gridwidth = 3;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.gridx = 1;
3036
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3037
+// //bigThree.add(cameraPanel, aWindowConstraints);
3038
+// aWindowConstraints.weightx = 0;
3039
+// aWindowConstraints.gridx = 4;
3040
+// aWindowConstraints.gridwidth = 1;
3041
+// // aWindowConstraints.gridheight = 3;
3042
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3043
+// //bigThree.add(XYZPanel, aWindowConstraints);
3044
+// bigThree.validate();
3045
+// scenePanel.setVisible(true);
3046
+// centralPanel.setVisible(false);
3047
+// XYZPanel.setVisible(false);
3048
+ bigThree.ClearUI();
3049
+ bigThree.add(scenePanel);
3050
+ bigThree.FlushUI();
3051
+
3052
+ cameraView.requestFocusInWindow();
26633053 } else
2664
- if (event.getSource() == sixButton)
3054
+ if (source == sixButton)
26653055 {
26663056 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
3057
+
3058
+// bigThree.remove(scenePanel);
3059
+// bigThree.remove(centralPanel);
3060
+// bigThree.remove(XYZPanel);
3061
+// aWindowConstraints.gridx = 0;
3062
+// aWindowConstraints.gridy = 0;
3063
+// aWindowConstraints.gridwidth = 1;
3064
+// // aConstraints.gridheight = 3;
3065
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3066
+// aWindowConstraints.weightx = 0;
3067
+// aWindowConstraints.weighty = 1;
3068
+// bigThree.add(scenePanel, aWindowConstraints);
3069
+// aWindowConstraints.weightx = 1;
3070
+// aWindowConstraints.gridwidth = 3;
3071
+// // aWindowConstraints.gridheight = 3;
3072
+// aWindowConstraints.gridx = 1;
3073
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3074
+// bigThree.add(centralPanel, aWindowConstraints);
3075
+// aWindowConstraints.weightx = 0;
3076
+// aWindowConstraints.gridx = 4;
3077
+// aWindowConstraints.gridwidth = 1;
3078
+// // aWindowConstraints.gridheight = 3;
3079
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3080
+// //bigThree.add(XYZPanel, aConstraints);
3081
+// bigThree.validate();
3082
+// scenePanel.setVisible(true);
3083
+// centralPanel.setVisible(true);
3084
+// XYZPanel.setVisible(false);
3085
+ bigThree.ClearUI();
3086
+ bigThree.add(scenePanel);
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.FlushUI();
3089
+
3090
+ cameraView.requestFocusInWindow();
26913091 } else
2692
- if (event.getSource() == sevenButton)
3092
+ if (source == sevenButton)
26933093 {
26943094 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3095
+
3096
+// bigThree.remove(scenePanel);
3097
+// bigThree.remove(centralPanel);
3098
+// bigThree.remove(XYZPanel);
3099
+// aWindowConstraints.gridx = 0;
3100
+// aWindowConstraints.gridy = 0;
3101
+// aWindowConstraints.gridwidth = 1;
3102
+// // aWindowConstraints.gridheight = 3;
3103
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3104
+// aWindowConstraints.weightx = 0;
3105
+// aWindowConstraints.weighty = 1;
3106
+// bigThree.add(scenePanel, aWindowConstraints);
3107
+// aWindowConstraints.weightx = 1;
3108
+// aWindowConstraints.gridwidth = 3;
3109
+// // aWindowConstraints.gridheight = 3;
3110
+// aWindowConstraints.gridx = 1;
3111
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3112
+// bigThree.add(centralPanel, aWindowConstraints);
3113
+// aWindowConstraints.weightx = 0;
3114
+// aWindowConstraints.gridx = 4;
3115
+// aWindowConstraints.gridwidth = 1;
3116
+// // aConstraints.gridheight = 3;
3117
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3118
+// bigThree.add(XYZPanel, aWindowConstraints);
3119
+// bigThree.validate();
3120
+// scenePanel.setVisible(true);
3121
+// centralPanel.setVisible(true);
3122
+// XYZPanel.setVisible(true);
3123
+ bigThree.ClearUI();
3124
+ bigThree.add(scenePanel);
3125
+ bigThree.add(centralPanel);
3126
+ bigThree.add(XYZPanel);
3127
+ bigThree.FlushUI();
3128
+
3129
+ cameraView.requestFocusInWindow();
27193130 } else
2720
- if (event.getSource() == rootButton)
3131
+ if (source == rootButton)
27213132 {
27223133 Object3D obj;
27233134 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,17 +3138,24 @@
27273138 EditObject(obj);
27283139 }
27293140
3141
+ cameraView.requestFocusInWindow();
27303142 refreshContents(true);
27313143 } else
2732
- if (event.getSource() == closeButton)
3144
+ if (source == closeButton)
27333145 {
27343146 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353147 cRadio ab;
27363148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373149 {
27383150 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
27413159 buttonGroup.remove(ab);
27423160 radioPanel.remove(ab);
27433161
....@@ -2748,13 +3166,15 @@
27483166 break;
27493167 }
27503168 }
3169
+
3170
+ cameraView.requestFocusInWindow();
27513171 refreshContents(true);
27523172 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3173
+ if (source == editItem || source == editButton)
27543174 {
27553175 EditSelection(false);
27563176 } else
2757
- if (event.getSource() == uneditButton)
3177
+ if (source == uneditButton)
27583178 {
27593179 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603180 {
....@@ -2764,14 +3184,14 @@
27643184 child.CloseUI();
27653185 listUI.remove(child);
27663186
2767
- child.editWindow = null; // ???????????
3187
+ //child.editWindow = null; // ???????????
27683188 }
2769
- objEditor.ctrlPanel.revalidate();
3189
+ objEditor.ctrlPanel.FlushUI();
27703190 //objEditor.jTree.clearSelection();
27713191 //objEditor.ResetSliders();
27723192 refreshContents(true);
27733193 } else
2774
- if (event.getSource() == clearPanelButton)
3194
+ if (source == clearPanelButton)
27753195 {
27763196 assert(copy == group);
27773197 //copy.ClearUI();
....@@ -2782,7 +3202,7 @@
27823202 listUI.clear();
27833203 refreshContents(true);
27843204 } else
2785
- if (event.getSource() == allParamsButton)
3205
+ if (source == allParamsButton)
27863206 {
27873207 assert(copy == group);
27883208
....@@ -2803,19 +3223,19 @@
28033223
28043224 refreshContents(true);
28053225 } else
2806
- if (event.getSource() == unselectButton)
3226
+ if (source == unselectButton)
28073227 {
28083228 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3229
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103230 objEditor.ResetSliders();
28113231 refreshContents(true);
28123232 } else
2813
- if(event.getSource() instanceof cRadio)
3233
+ if(source instanceof cRadio)
28143234 {
28153235 group.parent = keepparent;
28163236 group.attributes = 0;
28173237 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3238
+ /*cRadio*/ radio = (cRadio)source;
28193239 Object3D obj = radio.GetObject();
28203240 System.out.println("Edit " + obj);
28213241 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3255,7 @@
28353255 }
28363256
28373257 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3258
+ //Globals.theRenderer.object = group;
28393259 if(!useclient)
28403260 {
28413261 cameraView.renderCamera = radio.camera;
....@@ -2844,12 +3264,16 @@
28443264 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453265 cameraView.targetLookAt.set(radio.camera.lookAt);
28463266 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3267
+ //cameraView.lighttouched = true;
3268
+ Globals.lighttouched = true;
28483269 topView.object = group;
28493270 frontView.object = group;
28503271 sideView.object = group;
28513272 }
2852
- group.editWindow = this;
3273
+
3274
+// fix "+" issue
3275
+ //group.editWindow = this;
3276
+
28533277 /*
28543278 currentLayout = radio.layout;
28553279 if (currentLayout == null)
....@@ -2861,8 +3285,23 @@
28613285 //group.parent = null; // ROOT
28623286 //group.attributes = -1;
28633287 ResetModel();
3288
+
3289
+ cameraView.requestFocusInWindow();
28643290 refreshContents(true);
2865
- }
3291
+ } else if (event.getSource() == editCameraItem)
3292
+ {
3293
+ cameraView.ProtectCamera();
3294
+ cameraView.repaint();
3295
+ return;
3296
+ } else if (event.getSource() == revertCameraItem)
3297
+ {
3298
+ cameraView.RevertCamera();
3299
+ cameraView.repaint();
3300
+ return;
3301
+ // } else if (event.getSource() == textureButton)
3302
+ // {
3303
+ // return; // true;
3304
+ }
28663305 else
28673306 {
28683307 //return super.action(event, arg);
....@@ -2871,7 +3310,6 @@
28713310 }
28723311
28733312 boolean useclient = false;
2874
- cRadio radio;
28753313
28763314 void ToggleRoot()
28773315 {
....@@ -2880,7 +3318,7 @@
28803318 if (useclient)
28813319 {
28823320 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3321
+ Globals.lighttouched = true;
28843322 //topView.object = client;
28853323 //frontView.object = client;
28863324 //sideView.object = client;
....@@ -2888,7 +3326,7 @@
28883326 else
28893327 {
28903328 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3329
+ Globals.lighttouched = true;
28923330 //topView.object = group;
28933331 //frontView.object = group;
28943332 //sideView.object = group;
....@@ -2923,6 +3361,28 @@
29233361 refreshContents();
29243362 }
29253363
3364
+ void TransformChildren()
3365
+ {
3366
+ Object3D obj;
3367
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3368
+ {
3369
+ obj = (Object3D)e.nextElement();
3370
+ obj.KeepTextureMatrices();
3371
+ obj.TransformChildren();
3372
+ obj.RestoreTextureMatrices();
3373
+
3374
+// if (obj.parent == null)
3375
+// {
3376
+// System.out.println("NULL PARENT!");
3377
+// new Exception().printStackTrace();
3378
+// }
3379
+// else
3380
+// TouchTransform(obj);
3381
+// //obj.parent.Touch();
3382
+ }
3383
+
3384
+ refreshContents();
3385
+ }
29263386
29273387 void ResetTransform()
29283388 {
....@@ -3035,7 +3495,7 @@
30353495 refreshContents();
30363496 }
30373497
3038
- void ResetCentroid()
3498
+ void ResetCentroid(boolean full)
30393499 {
30403500 Object3D obj;
30413501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3510,16 @@
30503510 LA.matIdentity(Object3D.mat);
30513511 obj.getBounds(minima, maxima, false);
30523512 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3513
+ if (full)
3514
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543515 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553516 obj.TransformMesh(Object3D.mat);
3517
+
30563518 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3519
+ if (full)
3520
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583521 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3522
+
30593523 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603524 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613525 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3548,8 @@
30843548
30853549 int size = obj.MemorySize();
30863550
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3551
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3552
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883553 }
30893554 }
30903555 catch (Exception e)
....@@ -3121,9 +3586,9 @@
31213586 obj = (Object3D)e.nextElement();
31223587
31233588 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3589
+ Grafreed.AnalyzeObject(obj);
31253590 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3591
+ Grafreed.AnalyzeObject(obj.bRep);
31273592
31283593 // System.err.println((size/1024) + " KB is the size of " + obj);
31293594 }
....@@ -3165,6 +3630,20 @@
31653630 void GenNormals(boolean crease)
31663631 {
31673632 group.GenNormalsS(crease);
3633
+
3634
+ refreshContents();
3635
+ }
3636
+
3637
+ void GenNormalsMESH()
3638
+ {
3639
+ group.GenNormalsMeshS();
3640
+
3641
+ refreshContents();
3642
+ }
3643
+
3644
+ void GenNormalsMINE()
3645
+ {
3646
+ group.selection.GenNormalsMINE();
31683647
31693648 refreshContents();
31703649 }
....@@ -3250,7 +3729,7 @@
32503729 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513730 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523731 //
3253
-// g.add(GraphreeD.clipboard);
3732
+// g.add(GrafreeD.clipboard);
32543733 //
32553734 // buffer.add(g);
32563735 // }
....@@ -3269,8 +3748,8 @@
32693748 // nodes = new Object3D();
32703749 // vertices = new Vector<Vertex>();
32713750 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3751
+// boolean epsequal = GrafreeD.epsequal;
3752
+// GrafreeD.epsequal = true;
32743753 //
32753754 // for (int i=0; i<group.selection.size(); i++)
32763755 // {
....@@ -3311,7 +3790,7 @@
33113790 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123791 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133792 //
3314
-// g.add(GraphreeD.clipboard);
3793
+// g.add(GrafreeD.clipboard);
33153794 //
33163795 // buffer.add(g);
33173796 // }
....@@ -3319,7 +3798,7 @@
33193798 // makeSomething(buffer, i==group.selection.size()-1);
33203799 // }
33213800 //
3322
-// GraphreeD.epsequal = epsequal;
3801
+// GrafreeD.epsequal = epsequal;
33233802 //
33243803 // //buffer = null;
33253804 // temprep = null;
....@@ -3330,8 +3809,8 @@
33303809
33313810 void ParseVertices()
33323811 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3812
+ boolean epsequal = Grafreed.epsequal;
3813
+ Grafreed.epsequal = true;
33353814
33363815 for (int i=0; i<group.selection.size(); i++)
33373816 {
....@@ -3356,7 +3835,7 @@
33563835 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573836 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583837
3359
- g.add(GraphreeD.clipboard);
3838
+ g.add(Grafreed.clipboard);
33603839
33613840 buffer.add(g);
33623841 }
....@@ -3371,7 +3850,7 @@
33713850 makeSomething(buffer, i==group.selection.size()-1);
33723851 }
33733852
3374
- GraphreeD.epsequal = epsequal;
3853
+ Grafreed.epsequal = epsequal;
33753854
33763855 refreshContents();
33773856 }
....@@ -3389,7 +3868,16 @@
33893868 String pigment = Object3D.GetPigment(tex);
33903869 //String bump = Object3D.GetBump(tex);
33913870
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3871
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3872
+
3873
+ try
3874
+ {
3875
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3876
+ }
3877
+ catch (Exception e)
3878
+ {
3879
+ System.err.println("FAIL: " + node);
3880
+ }
33933881
33943882 double s = v.s;
33953883
....@@ -3416,7 +3904,7 @@
34163904 scale /= 3;
34173905
34183906 scale /= 0xFF;
3419
- scale /= 4;
3907
+ // c'est quoi ca? scale /= 4;
34203908
34213909 //v.AO = scale;
34223910
....@@ -3437,12 +3925,26 @@
34373925
34383926 void Align()
34393927 {
3928
+ if (group.selection.size() == 0)
3929
+ return;
3930
+
3931
+ cVector bbmin = new cVector();
3932
+ cVector bbmax = new cVector();
3933
+
3934
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3935
+
3936
+ double dx = bbmax.x - bbmin.x;
3937
+ double dy = bbmax.y - bbmin.y;
3938
+ double dz = bbmax.z - bbmin.z;
3939
+
3940
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3941
+
34403942 for (int i=0; i<group.selection.size(); i++)
34413943 {
34423944 Object3D obj = group.selection.get(i);
34433945
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3946
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3947
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463948 }
34473949
34483950 refreshContents();
....@@ -3455,7 +3957,7 @@
34553957 // ref.SaveSupports();
34563958 // Object3D par = ref.parent;
34573959 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3960
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593961 // ref.parent = par;
34603962 // ref.RestoreSupports();
34613963
....@@ -3463,11 +3965,11 @@
34633965
34643966 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34653967
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
3968
+ boolean random = CameraPane.SWITCH;
3969
+ CameraPane.SWITCH = false; // parse all random nodes
34683970 lowres.linkVerticesThis(null);
34693971 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
3972
+ CameraPane.SWITCH = random;
34713973
34723974 System.err.flush();
34733975
....@@ -3485,7 +3987,7 @@
34853987 // lowres.SaveSupports();
34863988 // par = lowres.parent;
34873989 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3990
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893991 Object3D newlow = CloneObject(lowres, false);
34903992 newlow.name = sn.switchobject.get(i).name;
34913993 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4009,7 @@
35074009 return;
35084010
35094011 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4012
+ Object3D ref = Grafreed.clipboard.get(0);
35114013
35124014 Object3D newgroup = new Object3D("Po:" + poses.name);
35134015
....@@ -3676,7 +4178,7 @@
36764178 group.selection.RelinkToSupport(); // july 2014
36774179 System.out.println("DONE.");
36784180 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4181
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804182 }
36814183
36824184 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4203,20 @@
37014203
37024204 void ClipMesh()
37034205 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4206
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054207 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4208
+ Object3D content = Grafreed.clipboard.get(0);
37074209
37084210 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094211 content = ((cGroup)content).get(0);
37104212
37114213 // for (int i=0; i<group.selection.size(); i++)
37124214 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4215
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144216 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4217
+ group.selection.ClipMesh(Grafreed.clipboard);
37164218 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4219
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184220 System.out.println("DONE.");
37194221 refreshContents();
37204222 }
....@@ -3759,6 +4261,18 @@
37594261 void MarkLeaves(boolean hide)
37604262 {
37614263 group.selection.MarkLeaves(hide);
4264
+ refreshContents();
4265
+ }
4266
+
4267
+ void RewindLeaves(boolean hide)
4268
+ {
4269
+ group.selection.RewindLeaves(hide);
4270
+ refreshContents();
4271
+ }
4272
+
4273
+ void RandomLeaves(boolean hide)
4274
+ {
4275
+ group.selection.RandomLeaves(hide);
37624276 refreshContents();
37634277 }
37644278
....@@ -3847,7 +4361,7 @@
38474361 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484362
38494363 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4364
+ if(elem != group || !newWindow)
38514365 {
38524366 // if (!(elem instanceof Composite))
38534367 // newWindow = false;
....@@ -3937,7 +4451,6 @@
39374451 //case 702: // Event.LIST_DESELECT
39384452 group.deselectAll();
39394453 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414454 if (tps != null)
39424455 {
39434456 for (int i=0; i < tps.length; i++)
....@@ -3946,31 +4459,30 @@
39464459
39474460 //if (child.parent != null)
39484461 //child.parent.addSelectee(child);
4462
+ objEditor.SetMaterial(child);
39494463 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534464 }
39544465 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4466
+// else
4467
+// {
4468
+// objEditor.SetMaterial(group); // .GetMaterial());
4469
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4470
+// System.err.println("info : " + group.GetPath());
4471
+// }
39614472
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4473
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654474 CameraPane.flash = true;
39664475
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4476
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684477 // a camera
39694478 {
3970
- CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4479
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4480
+ {
4481
+ CameraPane.camerachangeframe = 0; // don't refuse it
4482
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4483
+ }
4484
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4485
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744486 }
39754487
39764488 refreshContents();
....@@ -3981,6 +4493,26 @@
39814493
39824494 freezemodel = false;
39834495 }
4496
+
4497
+ void refreshContents(boolean cp)
4498
+ {
4499
+ if (!Globals.MOUSEDRAGGED)
4500
+ {
4501
+ objEditor.ClearInfo(); // .GetMaterial());
4502
+
4503
+ for (int i=0; i < group.selection.Size(); i++)
4504
+ {
4505
+ Object3D child = (Object3D) group.selection.get(i);
4506
+
4507
+ objEditor.AddInfo(child, this, true);
4508
+ System.err.println("info : " + child.GetPath());
4509
+ }
4510
+
4511
+ objEditor.SetText(); // jan 2014
4512
+ }
4513
+
4514
+ super.refreshContents(cp);
4515
+ }
39844516
39854517 void linkSomething(Object3D thing)
39864518 {
....@@ -4052,16 +4584,18 @@
40524584 {
40534585 if (group.selection.isEmpty())
40544586 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4587
+
4588
+ Grafreed.clipboardIsTempGroup = false;
40564589 Composite tGroup = null;
40574590 if (group.selection.size() > 0) // 1)
40584591 {
40594592 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4593
+ Grafreed.clipboardIsTempGroup = true;
40614594 }
40624595
40634596 if (cut)
40644597 {
4598
+ Save();
40654599 //int indices[] = jList.getSelectedIndices();
40664600 //for (int i = indices.length - 1; i >= 0; i--)
40674601 //jList.remove(indices[i]);
....@@ -4097,16 +4631,16 @@
40974631 //System.out.println("cut " + child);
40984632 //System.out.println("parent = " + child.parent);
40994633 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4634
+ if (Grafreed.clipboardIsTempGroup)
41014635 tGroup.add/*Child*/(tmp);
41024636 else
4103
- GraphreeD.clipboard = tmp;
4637
+ Grafreed.clipboard = tmp;
41044638 }
41054639 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4640
+ if (Grafreed.clipboardIsTempGroup)
41074641 tGroup.add/*Child*/(child);
41084642 else
4109
- GraphreeD.clipboard = child;
4643
+ Grafreed.clipboard = child;
41104644 }
41114645
41124646 //ResetModel();
....@@ -4138,21 +4672,23 @@
41384672 //System.out.println("cut " + elem);
41394673 //System.out.println("parent = " + elem.parent);
41404674 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4675
+ if (Grafreed.clipboardIsTempGroup)
41424676 tGroup.add/*Child*/(tmp);
41434677 else
4144
- GraphreeD.clipboard = tmp;
4678
+ Grafreed.clipboard = tmp;
41454679 }
41464680 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4681
+ if (Grafreed.clipboardIsTempGroup)
41484682 tGroup.add/*Child*/(child);
41494683 else
4150
- GraphreeD.clipboard = child;
4684
+ Grafreed.clipboard = child;
41514685 }
41524686
41534687 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4688
+
4689
+ if (Grafreed.clipboardIsTempGroup)
4690
+ Grafreed.clipboard = tGroup;
4691
+
41564692 if (cut)
41574693 {
41584694 ResetModel();
....@@ -4162,11 +4698,11 @@
41624698
41634699 void paste(boolean expand)
41644700 {
4165
- // if (GraphreeD.clipboard == null)
4701
+ // if (GrafreeD.clipboard == null)
41664702 // return;
41674703 boolean first = true;
41684704
4169
- if (GraphreeD.clipboardIsTempGroup)
4705
+ if (Grafreed.clipboardIsTempGroup)
41704706 {
41714707 Composite temp;
41724708
....@@ -4177,7 +4713,7 @@
41774713 temp = (Composite)Applet3D.clipboard.deepCopy();
41784714 */
41794715 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4716
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814717 {
41824718 Object3D child = (Object3D)e.nextElement();
41834719
....@@ -4191,7 +4727,7 @@
41914727 else
41924728 elem = child.deepCopy(); // ?
41934729 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4730
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954731 // elem = elem.get(0);
41964732 makeSomething(elem, true); // ?? first);
41974733 //group.addChild(elem);
....@@ -4211,23 +4747,23 @@
42114747 //Object3D cb = Applet3D.clipboard;
42124748 //temp.addChild(cb);
42134749 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4750
+ assert(Grafreed.clipboard.parent == null);
4751
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4752
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4753
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4754
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194755 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4756
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4757
+ Grafreed.clipboard.get(0).parent = keepparent;
42224758 }
42234759
42244760 ResetModel();
42254761 refreshContents();
42264762 }
42274763
4228
- void pasteInto(boolean copyit)
4764
+ void pasteInto(boolean copyit, boolean clone)
42294765 {
4230
-// if (GraphreeD.clipboard == null)
4766
+// if (GrafreeD.clipboard == null)
42314767 // return;
42324768
42334769 if (group.selection.size() != 1)
....@@ -4254,15 +4790,22 @@
42544790 if (copyit)
42554791 {
42564792 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4793
+ if (clone)
4794
+ {
4795
+ CloneClipboard(false); // sept 2014
4796
+ }
4797
+ else
4798
+ {
4799
+ paste(false);
4800
+ }
42584801 }
42594802 else
42604803 {
42614804 boolean first = true;
42624805
4263
- if (GraphreeD.clipboardIsTempGroup)
4806
+ if (Grafreed.clipboardIsTempGroup)
42644807 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4808
+ Composite temp = (Composite)Grafreed.clipboard;
42664809 Object3D copy;
42674810 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684811 {
....@@ -4272,7 +4815,7 @@
42724815 }
42734816 } else
42744817 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4818
+ linkSomething(Grafreed.clipboard); //.get(0));
42764819 }
42774820 }
42784821 }
....@@ -4464,6 +5007,26 @@
44645007 makeSomething(csg);
44655008 }
44665009
5010
+ void Ungroup(Object3D g)
5011
+ {
5012
+ if (g instanceof HiddenObject)
5013
+ {
5014
+ HiddenObject h = (HiddenObject) g;
5015
+
5016
+ for (int i=0; i<h.ActualSize(); i++)
5017
+ {
5018
+ objEditor.makeSomething(h.get(i), false);
5019
+ }
5020
+ }
5021
+ else
5022
+ {
5023
+ for (int i=0; i<g.Size(); i++)
5024
+ {
5025
+ objEditor.makeSomething(g.get(i), false);
5026
+ }
5027
+ }
5028
+ }
5029
+
44675030 void ungroup()
44685031 {
44695032 /*
....@@ -4657,21 +5220,6 @@
46575220 }
46585221 */
46595222
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755223 /*
46765224 public void Callback(Object obj)
46775225 {
....@@ -4695,26 +5243,9 @@
46955243 }
46965244 */
46975245
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155246 String GetFile(String dialogName)
47165247 {
4717
- if (GraphreeD.standAlone)
5248
+ if (Grafreed.standAlone)
47185249 {
47195250 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205251 browser.show();
....@@ -4778,10 +5309,18 @@
47785309 cButton flashSelectionButton;
47795310 cButton editButton;
47805311 cButton uneditButton;
5312
+ JCheckBox allParamsButton;
47815313 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835314 cButton unselectButton;
47845315
5316
+ cButton minButton;
5317
+ cButton maxButton;
5318
+ cButton fullButton;
5319
+ cButton undoButton;
5320
+ cButton redoButton;
5321
+ cButton saveButton;
5322
+ cButton oneStepButton;
5323
+
47855324 cButton screenfitButton;
47865325 cButton screenfitpointButton;
47875326 cButton snapobjectButton;
....@@ -4792,14 +5331,6 @@
47925331 cButton closeButton;
47935332
47945333 cButton setsupportButton;
4795
-
4796
- cButton twoButton;
4797
- cButton sixButton;
4798
- cButton threeButton;
4799
- cButton sevenButton;
4800
- cButton fourButton; // full panel
4801
- cButton oneButton; // full XYZ
4802
- //cButton currentLayout;
48035334
48045335 //
48055336 //Composite
....@@ -4812,6 +5343,8 @@
48125343 private MenuItem lookFromItem;
48135344 private MenuItem switchItem;
48145345 private MenuItem cutItem;
5346
+ private MenuItem undoItem;
5347
+ private MenuItem redoItem;
48155348 private MenuItem duplicateItem;
48165349 private MenuItem cloneItem;
48175350 private MenuItem cloneSupportItem;
....@@ -4823,8 +5356,9 @@
48235356 private MenuItem resetsupportItem;
48245357 private MenuItem resetreferencesItem;
48255358 private MenuItem linkverticesItem;
5359
+ private MenuItem relinkverticesItem;
48265360 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5361
+ private MenuItem resetAllItem;
48285362 private MenuItem stepAllItem;
48295363 private MenuItem revertMeshItem;
48305364 private MenuItem poseMeshItem;
....@@ -4835,14 +5369,17 @@
48355369 private MenuItem mergeGeometriesItem;
48365370 private MenuItem copyItem;
48375371 private MenuItem pasteItem;
5372
+ private MenuItem pasteIntoItem;
48385373 private MenuItem pasteLinkItem;
48395374 private MenuItem pasteCloneItem;
48405375 private MenuItem pasteExpandItem;
48415376 private MenuItem clearItem;
48425377 private MenuItem clearAllItem;
48435378 private MenuItem genUVItem;
5379
+ private MenuItem genNormalsMESHItem;
48445380 private MenuItem genNormalsCADItem;
48455381 private MenuItem genNormalsORGANItem;
5382
+ private MenuItem genNormalsMINEItem;
48465383 private MenuItem stripifyItem;
48475384 private MenuItem unstripifyItem;
48485385 private MenuItem trimItem;
....@@ -4871,6 +5408,10 @@
48715408 private MenuItem showleavesItem;
48725409 private MenuItem markleavesItem;
48735410 private MenuItem unmarkleavesItem;
5411
+ private MenuItem rewindleavesItem;
5412
+ private MenuItem unrewindleavesItem;
5413
+ private MenuItem randomleavesItem;
5414
+ private MenuItem unrandomleavesItem;
48745415
48755416 private MenuItem flipVItem;
48765417 private MenuItem unflipVItem;
....@@ -4882,8 +5423,11 @@
48825423 private MenuItem panoTexturesItem;
48835424
48845425 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5426
+ private MenuItem resetCentroidXZItem;
48865427 private MenuItem resetTransformItem;
5428
+ private MenuItem transformGeometryItem;
5429
+ private MenuItem transformChildrenItem;
5430
+ private MenuItem hideItem;
48875431 private MenuItem grabItem;
48885432 private MenuItem backItem;
48895433 private MenuItem frontItem;
....@@ -4904,6 +5448,7 @@
49045448
49055449 private MenuItem resetParentItem;
49065450 private MenuItem repairParentItem;
5451
+ private MenuItem repairShadowItem;
49075452 private MenuItem sortbysizeItem;
49085453 private MenuItem sortbynameItem;
49095454
....@@ -4924,10 +5469,11 @@
49245469 private MenuItem coneItem;
49255470 private MenuItem torusItem;
49265471 private MenuItem superItem;
5472
+ private MenuItem kleinItem;
49275473 private MenuItem blobItem;
49285474 private MenuItem latheItem;
49295475 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5476
+ private MenuItem overlayItem;
49315477 private MenuItem meshItem;
49325478 // private MenuItem meshGroupItem;
49335479 private MenuItem springItem;
....@@ -4936,6 +5482,7 @@
49365482 private MenuItem csgItem;
49375483 private MenuItem templateItem;
49385484 private MenuItem textureItem;
5485
+ private MenuItem billboardItem;
49395486 private MenuItem shadowXItem;
49405487 private MenuItem shadowYItem;
49415488 private MenuItem shadowZItem;
....@@ -4948,11 +5495,6 @@
49485495 private MenuItem doubleItem;
49495496 private MenuItem tripleItem;
49505497
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565498 private MenuItem computeAOItem;
49575499 private MenuItem recompileItem;
49585500 private MenuItem editScriptItem;
....@@ -4962,4 +5504,8 @@
49625504 private MenuItem analyzeItem;
49635505 private MenuItem dumpItem;
49645506 //boolean freezemodel = false;
5507
+
5508
+ Menu cameraMenu;
5509
+ MenuItem editCameraItem;
5510
+ MenuItem revertCameraItem;
49655511 }