Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
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 = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", 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(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
608
+ fastCB.setToolTipText("Fast mode");
451609 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);
610
+
611
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ oneStepButton.setToolTipText("Animate one step forward");
613
+ oneStepButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", 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 = GetButton("icons/fit.png", !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 = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Highlight 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,115 @@
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
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
+ autosaveCB.setToolTipText("Auto-save on structure change");
820
+ autosaveCB.addItemListener(this);
821
+
822
+ if (Globals.ADVANCED)
823
+ {
824
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
825
+ lookAtCB.setToolTipText("Look-at target");
826
+ lookAtCB.addItemListener(this);
827
+ }
828
+
829
+ }
830
+
831
+ cGridBag fill = new cGridBag();
832
+
833
+ fill.preferredHeight = 200;
834
+
835
+ panel.add(fill);
836
+
837
+ }
636838
637839 void EditObject(Object3D obj)
638840 {
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();
841
+ cRadio radioButton = new cRadio(obj.name);
842
+
843
+ // Patch to avoid bug with transparency.
844
+ radioButton.hadMaterial = obj.material != null;
845
+ if (!radioButton.hadMaterial)
846
+ {
847
+ obj.material = new cMaterial();
848
+ }
849
+
850
+ radioButton.SetObject(obj);
851
+ radioButton.layout = sevenButton;
852
+ radioButton.SetCamera(cameraView.renderCamera, false);
853
+ radioButton.addActionListener(this);
854
+ radioPanel.add(radioButton);
855
+ buttonGroup.add(radioButton);
856
+ radioButton.doClick();
647857 }
858
+
648859 void SetupViews(ObjEditor oe)
649860 {
861
+ theFrame = this;
862
+
650863 oe.SetupViews();
651864
652865 System.out.println("SetupViews");
....@@ -655,22 +868,26 @@
655868 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
656869 }
657870
658
- JCheckBox liveCB;
659
- JCheckBox supportCB;
660
- JCheckBox localCB;
661
- JCheckBox crowdCB;
662
- JCheckBox smoothCB;
663
- JCheckBox fastCB;
664
- JCheckBox slowCB;
665
- JCheckBox boxCB;
666
- JCheckBox trackCB;
667
- JCheckBox smoothfocusCB;
871
+ cCheckBox liveCB;
872
+ cCheckBox supportCB;
873
+ cCheckBox localCB;
874
+ cCheckBox crowdCB;
875
+ cCheckBox smoothCB;
876
+ cCheckBox fastCB;
877
+ cCheckBox slowCB;
878
+ cCheckBox boxCB;
879
+ cCheckBox zoomBoxCB;
880
+ cCheckBox trackCB;
881
+ cCheckBox smoothfocusCB;
668882 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
883
+ cCheckBox speakerCameraCB;
884
+ cCheckBox speakerFocusCB;
885
+ cCheckBox debugCB;
886
+
887
+ cCheckBox oeilCB;
888
+ cCheckBox shadowCB;
889
+ cCheckBox autosaveCB;
890
+ cCheckBox lookAtCB;
674891
675892 // static int COLOR = 1;
676893 // static int MATERIAL = 2;
....@@ -678,9 +895,9 @@
678895
679896 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
680897
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
898
+ cCheckBox colorCB;
899
+ cCheckBox materialCB;
900
+ cCheckBox textureCB;
684901
685902 public void itemStateChanged(ItemEvent e)
686903 {
....@@ -705,10 +922,10 @@
705922 dropAttributes |= Object3D.TEXTURE;
706923 else
707924 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
925
+ } else if(e.getSource() == liveCB)
710926 {
711927 cameraView.ToggleLive();
928
+ refreshContents(false);
712929 }
713930 else if(e.getSource() == supportCB)
714931 {
....@@ -744,6 +961,10 @@
744961 cameraView.repaint();
745962 // refreshContents();
746963 }
964
+ else if(e.getSource() == zoomBoxCB)
965
+ {
966
+ cameraView.ToggleZoomBoxMode();
967
+ }
747968 else if(e.getSource() == smoothfocusCB)
748969 {
749970 cameraView.ToggleSmoothFocus();
....@@ -768,6 +989,14 @@
768989 else if(e.getSource() == oeilCB)
769990 {
770991 cameraView.ToggleOeil();
992
+ }
993
+ else if(e.getSource() == shadowCB)
994
+ {
995
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
996
+ }
997
+ else if(e.getSource() == autosaveCB)
998
+ {
999
+ Globals.SAVEONMAKE ^= true;
7711000 }
7721001 else if(e.getSource() == lookAtCB)
7731002 {
....@@ -857,7 +1086,9 @@
8571086 // objEditor.DropFile((java.io.File[]) object, true);
8581087 // return;
8591088 // }
860
- if (string.charAt(0) == '/')
1089
+
1090
+ // File path for Mac and Windows
1091
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611092 {
8621093 // file(s)
8631094 String[] names = string.split("\n");
....@@ -884,7 +1115,7 @@
8841115
8851116 flashIt = false;
8861117 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1118
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881119 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891120
8901121 if (group.selection.size() == 1)
....@@ -911,11 +1142,11 @@
9111142 {
9121143 loadClipboard(true);
9131144 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1145
+ pasteInto(false, false);
9151146 } else {
9161147 loadClipboard(false);
9171148 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1149
+ pasteInto(false, false); // true); // ???
9191150 }
9201151 }
9211152 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1264,37 @@
10331264 torusItem.addActionListener(this);
10341265 superItem = menu.add(new MenuItem("Superellipsoid"));
10351266 superItem.addActionListener(this);
1267
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1268
+ kleinItem.addActionListener(this);
10361269 particleItem = menu.add(new MenuItem("Particle system"));
10371270 particleItem.addActionListener(this);
1271
+ if (Globals.ADVANCED)
1272
+ {
10381273 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391274 ragdollItem.addActionListener(this);
10401275 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411276 ragdoll2Item.addActionListener(this);
1277
+ }
10421278 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1279
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441280 meshItem.addActionListener(this);
10451281 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461282 // meshGroupItem.addActionListener(this);
1283
+ if (Globals.ADVANCED)
1284
+ {
10471285 springItem = menu.add(new MenuItem("Spring"));
10481286 springItem.addActionListener(this);
10491287 flagItem = menu.add(new MenuItem("Flag"));
10501288 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);
10551289 blobItem = menu.add(new MenuItem("Blob"));
10561290 blobItem.addActionListener(this);
10571291 latheItem = menu.add(new MenuItem("Lathe"));
10581292 latheItem.addActionListener(this);
1293
+ }
1294
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1295
+ bezierItem.addActionListener(this);
1296
+ overlayItem = menu.add(new MenuItem("Overlay"));
1297
+ overlayItem.addActionListener(this);
10591298 lightItem = menu.add(new MenuItem("Light"));
10601299 lightItem.addActionListener(this);
10611300 menu.add("-");
....@@ -1065,39 +1304,44 @@
10651304 loopItem.addActionListener(this);
10661305 doubleItem = menu.add(new MenuItem("Fork"));
10671306 doubleItem.addActionListener(this);
1307
+ if (Globals.ADVANCED)
1308
+ {
10681309 tripleItem = menu.add(new MenuItem("Trident"));
10691310 tripleItem.addActionListener(this);
1311
+ }
10701312 }
10711313
10721314 void buildToolsMenu(Menu menu)
10731315 {
10741316 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751317 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1318
+ animationItem.setState(Globals.ANIMATION);
10771319
10781320 menu.add("-");
10791321 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801322 parseverticesItem.addActionListener(this);
10811323 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821324 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1325
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841326 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871327 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881328 reduceMorphItem.addActionListener(this);
10891329 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901330 reduce34MorphItem.addActionListener(this);
1091
-
1331
+ menu.add("-");
10921332 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931333 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951334
1335
+ if (Globals.ADVANCED)
1336
+ {
1337
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1338
+ mirrorItem.addActionListener(this);
1339
+ menu.add("-");
10961340 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971341 memoryItem.addActionListener(this);
10981342 menu.add(analyzeItem = new MenuItem("Analyze"));
10991343 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1344
+ menu.add(dumpItem = new MenuItem("Print"));
11011345 dumpItem.addActionListener(this);
11021346 // menu.add(pathItem = new MenuItem("From-to path"));
11031347 // pathItem.addActionListener(this);
....@@ -1106,6 +1350,8 @@
11061350 resetParentItem.addActionListener(this);
11071351 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081352 repairParentItem.addActionListener(this);
1353
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1354
+ repairShadowItem.addActionListener(this);
11091355 menu.add(invariantsItem = new MenuItem("Invariants"));
11101356 invariantsItem.addActionListener(this);
11111357 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1359,7 @@
11131359 menu.add("-");
11141360 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151361 editScriptItem.addActionListener(this);
1362
+ }
11161363 }
11171364
11181365 void ScreenFit()
....@@ -1235,6 +1482,7 @@
12351482 shadow.material = new cMaterial(obj.material);
12361483 shadow.material.diffuse = 0.0001f;
12371484 shadow.material.specular = 0.0001f;
1485
+ //shadow.projectedVertices[1].x = 300;
12381486
12391487 makeSomething(shadow);
12401488 }
....@@ -1441,9 +1689,9 @@
14411689
14421690 void Overwrite(int mask)
14431691 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1692
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451693 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1694
+ Object3D content = Grafreed.clipboard.get(0);
14471695
14481696 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491697 content = ((cGroup)content).get(0);
....@@ -1466,6 +1714,7 @@
14661714 //
14671715 public void actionPerformed(ActionEvent event) // , Object arg)
14681716 {
1717
+ Object source = event.getSource();
14691718 /*
14701719 if (event.getSource() == nameField)
14711720 {
....@@ -1477,11 +1726,11 @@
14771726 }
14781727 else
14791728 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1729
+ if (source == lookAtItem || source == lookFromItem)
14811730 {
14821731 ScreenFit();
14831732 } else
1484
- if (event.getSource() == switchItem)
1733
+ if (source == switchItem)
14851734 {
14861735 cVector v1 = new cVector();
14871736 cVector v2 = new cVector();
....@@ -1490,11 +1739,11 @@
14901739 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911740 objEditor.cameraView.repaint();
14921741 } else
1493
- if (event.getSource() == rectoidItem)
1742
+ if (source == rectoidItem)
14941743 {
14951744 makeSomething(new Box());
14961745 } else
1497
- if (event.getSource() == particleItem)
1746
+ if (source == particleItem)
14981747 {
14991748 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001749 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1764,9 @@
15151764 applyExample(particleGeom, "SMOKE");
15161765 makeSomething(particleGeom);
15171766 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1767
+ if (source == ragdollItem || source == ragdoll2Item)
15191768 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1769
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211770
15221771 ragdoll.toParent = LA.newMatrix();
15231772 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1784,7 @@
15351784 } else
15361785 /*
15371786 */
1538
- if (event.getSource() == heightFieldItem)
1787
+ if (source == heightFieldItem)
15391788 {
15401789 Object3D obj = new Object3D();
15411790
....@@ -1573,27 +1822,31 @@
15731822
15741823 makeSomething(obj);
15751824 } else
1576
- if (event.getSource() == gridItem)
1825
+ if (source == gridItem)
15771826 {
15781827 makeSomething(new Grid());
15791828 } else
1580
- if (event.getSource() == ellipsoidItem)
1829
+ if (source == ellipsoidItem)
15811830 {
15821831 makeSomething(new Sphere());
15831832 } else
1584
- if (event.getSource() == coneItem)
1833
+ if (source == coneItem)
15851834 {
15861835 makeSomething(new Cone());
15871836 } else
1588
- if (event.getSource() == torusItem)
1837
+ if (source == torusItem)
15891838 {
15901839 makeSomething(new Torus());
15911840 } else
1592
- if (event.getSource() == superItem)
1841
+ if (source == superItem)
15931842 {
15941843 makeSomething(new Superellipsoid());
15951844 } else
1596
- if (event.getSource() == blobItem)
1845
+ if (source == kleinItem)
1846
+ {
1847
+ makeSomething(new Klein());
1848
+ } else
1849
+ if (source == blobItem)
15971850 {
15981851 Blob blob = new Blob();
15991852 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1854,15 @@
16011854 //blob.retile();
16021855 makeSomething(blob);
16031856 } else
1604
- if (event.getSource() == latheItem)
1857
+ if (source == latheItem)
16051858 {
16061859 makeSomething(new Lathe());
16071860 } else
1608
- if (event.getSource() == bezierItem)
1861
+ if (source == bezierItem)
16091862 {
16101863 makeSomething(new BezierSurface());
16111864 } else
1612
- if (event.getSource() == checkerItem)
1865
+ if (source == overlayItem)
16131866 {
16141867 /*
16151868 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1877,7 @@
16241877 */
16251878 makeSomething(new Checker());
16261879 } else
1627
- if (event.getSource() == meshItem)
1880
+ if (source == meshItem)
16281881 {
16291882 Object3D itemtomake = new Object3D();
16301883 Object3D child;
....@@ -1645,35 +1898,35 @@
16451898 makeSomething(child);
16461899 }
16471900 } else
1648
- if (event.getSource() == springItem)
1901
+ if (source == springItem)
16491902 {
16501903 cSpring s = new cSpring();
16511904 s.setup();
16521905 makeSomething(s);
16531906 } else
1654
- if (event.getSource() == flagItem)
1907
+ if (source == flagItem)
16551908 {
16561909 cSpring s = new cFlag();
16571910 s.setup();
16581911 makeSomething(s);
16591912 } else
1660
- if (event.getSource() == lightItem)
1913
+ if (source == lightItem)
16611914 {
16621915 makeSomething(new Light());
16631916 } else
1664
- if (event.getSource() == csgItem)
1917
+ if (source == csgItem)
16651918 {
16661919 group(new CSG());
16671920 } else
1668
- if (event.getSource() == templateItem)
1921
+ if (source == templateItem)
16691922 {
16701923 group(new cTemplate());
16711924 } else
1672
- if (event.getSource() == attributeItem)
1925
+ if (source == attributeItem)
16731926 {
16741927 makeSomething(new Attribute());
16751928 } else
1676
- if (event.getSource() == pointflowItem)
1929
+ if (source == pointflowItem)
16771930 {
16781931 makeSomething(new PointFlow());
16791932 } else
....@@ -1685,7 +1938,7 @@
16851938 } else
16861939 */
16871940
1688
- if (event.getSource() == superLoopItem)
1941
+ if (source == superLoopItem)
16891942 {
16901943 Composite g = new cGroup();
16911944 for (int i=0; i<15; i++)
....@@ -1707,7 +1960,7 @@
17071960
17081961 group(g);
17091962 } else
1710
- if (event.getSource() == loopItem)
1963
+ if (source == loopItem)
17111964 {
17121965 Composite csg = new GroupLeaf();
17131966 csg.count = 5;
....@@ -1716,7 +1969,7 @@
17161969 csg.addChild(child);
17171970 child.addChild(csg);
17181971 } else
1719
- if (event.getSource() == doubleItem)
1972
+ if (source == doubleItem)
17201973 {
17211974 Composite csg = new GroupLeaf();
17221975 csg.count = 5;
....@@ -1728,7 +1981,7 @@
17281981 csg.addChild(child);
17291982 child.addChild(csg);
17301983 } else
1731
- if (event.getSource() == tripleItem)
1984
+ if (source == tripleItem)
17321985 {
17331986 Composite csg = new GroupLeaf();
17341987 csg.count = 4;
....@@ -1743,71 +1996,83 @@
17431996 csg.addChild(child);
17441997 child.addChild(csg);
17451998 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1999
+ if (source == computeAOItem)
17482000 {
1749
- ImportGFD();
2001
+ Globals.drawMode = CameraPane.OCCLUSION;
2002
+ Globals.theRenderer.repaint();
17502003 } 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)
2004
+ if (source == recompileItem)
17692005 {
17702006 Recompile();
17712007 refreshContents();
17722008 } else
1773
- if (event.getSource() == editScriptItem)
2009
+ if (source == editScriptItem)
17742010 {
17752011 OpenDialog();
17762012 refreshContents();
17772013 } else
1778
- if (event.getSource() == invariantsItem)
2014
+ if (source == invariantsItem)
17792015 {
17802016 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2017
+ Grafreed.grafreeD.universe.invariants();
17822018 } else
1783
- if (event.getSource() == memoryItem)
2019
+ if (source == memoryItem)
17842020 {
17852021 //System.out.println("Invariants:");
17862022 PrintMemory();
17872023 } else
1788
- if (event.getSource() == pathItem)
2024
+ if (source == pathItem)
17892025 {
17902026 PrintPath();
17912027 } else
1792
- if (event.getSource() == analyzeItem)
2028
+ if (source == analyzeItem)
17932029 {
17942030 AnalyzeObject();
17952031 } else
1796
- if (event.getSource() == dumpItem)
2032
+ if (source == dumpItem)
17972033 {
17982034 DumpObject();
17992035 } else
1800
- if (event.getSource() == screenfitButton)
2036
+ if (source == minButton)
2037
+ {
2038
+ Minimize();
2039
+ } else
2040
+ if (source == maxButton)
2041
+ {
2042
+ Maximize();
2043
+ } else
2044
+ if (source == fullButton)
2045
+ {
2046
+ ToggleFullScreen();
2047
+ } else
2048
+ if (source == undoButton)
2049
+ {
2050
+ Undo();
2051
+ } else
2052
+ if (source == redoButton)
2053
+ {
2054
+ Redo();
2055
+ } else
2056
+ if (source == saveButton)
2057
+ {
2058
+ Save();
2059
+ } else
2060
+ if (source == oneStepButton)
2061
+ {
2062
+ Globals.ONESTEP = true;
2063
+ cameraView.repaint();
2064
+ } else
2065
+ if (source == screenfitButton)
18012066 {
18022067 //Reload(lastConverter, lastFilename, true);
18032068 ScreenFit();
18042069 } else
1805
- if (event.getSource() == screenfitpointButton)
2070
+ if (source == screenfitpointButton)
18062071 {
18072072 //Reload(lastConverter, lastFilename, true);
18082073 ScreenFitPoint();
18092074 } else
1810
- if (event.getSource() == snapobjectButton)
2075
+ if (source == snapobjectButton)
18112076 {
18122077 //Reload(lastConverter, lastFilename, true);
18132078 SnapObject();
....@@ -1818,13 +2083,13 @@
18182083 // Recompile();
18192084 // refreshContents();
18202085 // } else
1821
- if (event.getSource() == gcButton)
2086
+ if (source == gcButton)
18222087 {
18232088 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242089 System.gc();
18252090 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262091 } else
1827
- if (event.getSource() == editLeafItem)
2092
+ if (source == editLeafItem)
18282093 {
18292094 Object3D obj;
18302095 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2103,78 @@
18382103 }
18392104 refreshContents(true);
18402105 } else
1841
- if (event.getSource() == openWindowItem)
2106
+ if (source == openWindowItem)
18422107 {
18432108 EditSelection(true);
18442109 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2110
+ if (source == cutItem || source == clearButton)
18462111 {
18472112 loadClipboard(true);
18482113 } else
1849
- if (event.getSource() == duplicateItem)
2114
+ if (source == undoItem)
18502115 {
1851
- Object3D keep = GraphreeD.clipboard;
2116
+ Undo();
2117
+ } else
2118
+ if (source == redoItem)
2119
+ {
2120
+ Redo();
2121
+ } else
2122
+ if (source == duplicateItem)
2123
+ {
2124
+ Object3D keep = Grafreed.clipboard;
18522125 loadClipboard(false);
18532126 paste(false);
1854
- GraphreeD.clipboard = keep;
2127
+ Grafreed.clipboard = keep;
18552128 } else
1856
- if (event.getSource() == cloneItem)
2129
+ if (source == cloneItem)
18572130 {
18582131 CloneSelection(false);
18592132 } else
1860
- if (event.getSource() == cloneSupportItem)
2133
+ if (source == cloneSupportItem)
18612134 {
18622135 CloneSelection(true);
18632136 } else
1864
- if (event.getSource() == copyItem)
2137
+ if (source == copyItem)
18652138 {
18662139 loadClipboard(false);
18672140 } else
1868
- if (event.getSource() == pasteItem)
2141
+ if (source == pasteItem)
18692142 {
18702143 paste(false);
18712144 } else
1872
- if (event.getSource() == pasteLinkItem)
2145
+ if (source == pasteIntoItem)
18732146 {
1874
- pasteInto(false);
2147
+ pasteInto(true, false);
18752148 } else
1876
- if (event.getSource() == pasteCloneItem)
2149
+ if (source == pasteLinkItem)
18772150 {
1878
- pasteInto(true);
2151
+ pasteInto(false, false);
18792152 } else
1880
- if (event.getSource() == pasteExpandItem)
2153
+ if (source == pasteCloneItem)
2154
+ {
2155
+ pasteInto(true, true);
2156
+ } else
2157
+ if (source == pasteExpandItem)
18812158 {
18822159 paste(true);
18832160 } else
1884
- if (event.getSource() == synchronizeItem)
2161
+ if (source == synchronizeItem)
18852162 {
18862163 Overwrite(Object3D.TRANSFORM);
18872164 } else
1888
- if (event.getSource() == overwriteNameItem)
2165
+ if (source == overwriteNameItem)
18892166 {
18902167 Overwrite(Object3D.NAME);
18912168 } else
1892
- if (event.getSource() == overwriteUVItem)
2169
+ if (source == overwriteUVItem)
18932170 {
18942171 Overwrite(Object3D.UV);
18952172 } else
1896
- if (event.getSource() == overwriteMatItem)
2173
+ if (source == overwriteMatItem)
18972174 {
2175
+ /* july 2015
18982176 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2177
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002178 else
19012179 {
19022180 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2186,16 @@
19082186 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092187 }
19102188 }
2189
+ */
2190
+
2191
+ Overwrite(dropAttributes);
19112192 }
1912
- if (event.getSource() == overwriteGeoItem)
2193
+ if (source == overwriteGeoItem)
19132194 {
19142195 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2196
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162197 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2198
+// Object3D content = GrafreeD.clipboard.get(0);
19182199 //
19192200 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202201 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2207,7 @@
19262207 // refreshContents();
19272208 // }
19282209 } else
1929
- if (event.getSource() == generateMeshItem)
2210
+ if (source == generateMeshItem)
19302211 {
19312212 //if (group.selection.size() == 1)
19322213 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2218,7 @@
19372218 ResetModel();
19382219 refreshContents();
19392220 } else
1940
- if (event.getSource() == extractGeometriesItem)
2221
+ if (source == extractGeometriesItem)
19412222 {
19422223 boolean one = false;
19432224
....@@ -1964,7 +2245,7 @@
19642245 ResetModel();
19652246 refreshContents();
19662247 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2248
+ if (source == cloneGeometriesItem)
19682249 {
19692250 boolean one = false;
19702251
....@@ -1990,32 +2271,37 @@
19902271 ResetModel();
19912272 refreshContents();
19922273 } else
1993
- if (event.getSource() == shareGeometriesItem)
2274
+ if (source == shareGeometriesItem)
19942275 {
19952276 boolean one = false;
19962277
19972278 if (group.selection.size() == 1)
19982279 one = true;
19992280
2281
+ Object3D merge = null;
2282
+
20002283 Object3D content = new cGroup();
20012284
20022285 for (int i=0; i<group.selection.size(); i++)
20032286 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2287
+ merge = new Merge(group.selection.get(i));
20052288
20062289 if (one)
2007
- makeSomething(sel, false);
2290
+ makeSomething(merge, false);
20082291 else
2009
- content.addChild(sel);
2292
+ content.addChild(merge);
20102293 }
20112294
20122295 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2296
+ makeSomething(content, true);
2297
+ else
2298
+ {
2299
+ ResetModel();
2300
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2301
+ refreshContents();
2302
+ }
20172303 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2304
+ if (source == mergeGeometriesItem)
20192305 {
20202306 boolean one = false;
20212307
....@@ -2045,11 +2331,11 @@
20452331 ResetModel();
20462332 refreshContents();
20472333 } else
2048
- if (event.getSource() == linkverticesItem)
2334
+ if (source == linkverticesItem)
20492335 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2336
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512337 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2338
+// Object3D content = GrafreeD.clipboard.get(0);
20532339 //
20542340 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552341 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2344,48 @@
20582344 // group.selection.get(0).setMasterThis(content); // should be identity
20592345 // refreshContents();
20602346 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2347
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622348 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
20642350
20652351 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662352 content = ((cGroup)content).get(0);
20672353
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2354
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692355 for (int i=0; i<group.selection.size(); i++)
20702356 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2357
+ boolean random = CameraPane.SWITCH;
2358
+ CameraPane.SWITCH = false; // parse all random nodes
20732359 group.selection.get(i).linkVerticesThis(content);
20742360 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2361
+ CameraPane.SWITCH = random;
20762362 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2363
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782364 refreshContents();
20792365 }
20802366 } else
2081
- if (event.getSource() == resetsupportItem)
2367
+ if (source == resetsupportItem)
20822368 {
20832369 for (int i=0; i<group.selection.size(); i++)
20842370 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2371
+ boolean random = CameraPane.SWITCH;
2372
+ CameraPane.SWITCH = false; // parse all random nodes
20872373 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2374
+ CameraPane.SWITCH = random;
20892375 }
20902376
20912377 refreshContents();
20922378 } else
2093
- if (event.getSource() == resetreferencesItem)
2379
+ if (source == relinkverticesItem)
2380
+ {
2381
+ boolean random = CameraPane.SWITCH;
2382
+ CameraPane.SWITCH = false; // parse all random nodes
2383
+ group.selection.RelinkToSupport();
2384
+ CameraPane.SWITCH = random;
2385
+
2386
+ refreshContents();
2387
+ } else
2388
+ if (source == resetreferencesItem)
20942389 {
20952390 for (int i=0; i<group.selection.size(); i++)
20962391 {
....@@ -2099,11 +2394,11 @@
20992394
21002395 refreshContents();
21012396 } else
2102
- if (event.getSource() == setMasterItem)
2397
+ if (source == setMasterItem)
21032398 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2399
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052400 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2401
+ Object3D content = Grafreed.clipboard.get(0);
21072402
21082403 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092404 content = ((cGroup)content).get(0);
....@@ -2112,13 +2407,13 @@
21122407 refreshContents();
21132408 }
21142409 } else
2115
- if (event.getSource() == poseMeshItem)
2410
+ if (source == poseMeshItem)
21162411 {
21172412 if (group.selection.size() == 1)
21182413 {
2119
- if (GraphreeD.clipboard.size() == 1)
2414
+ if (Grafreed.clipboard.size() == 1)
21202415 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2416
+ Object3D content = Grafreed.clipboard.get(0);
21222417
21232418 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242419 content = ((cGroup)content).get(0);
....@@ -2131,19 +2426,19 @@
21312426 }
21322427
21332428 } else
2134
- if (event.getSource() == revertMeshItem)
2429
+ if (source == revertMeshItem)
21352430 {
21362431 RevertMeshes();
21372432 } else
2138
- if (event.getSource() == resetMeshItem)
2433
+ if (source == resetAllItem)
21392434 {
21402435 ResetAll();
21412436 } else
2142
- if (event.getSource() == stepAllItem)
2437
+ if (source == stepAllItem)
21432438 {
21442439 StepAll();
21452440 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2441
+ if (source == clearItem) // || event.getSource() == clearButton)
21472442 {
21482443 //int indices[] = jList.getSelectedIndices();
21492444 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2446,46 @@
21512446
21522447 ClearSelection(false);
21532448 } else
2154
- if (event.getSource() == clearAllItem)
2449
+ if (source == clearAllItem)
21552450 {
21562451 ClearSelection(true);
21572452 } else
2158
- if (event.getSource() == grabItem)
2453
+ if (source == grabItem)
21592454 {
21602455 group(new cGroup(), true);
21612456 } else
2162
- if (event.getSource() == frontItem)
2457
+ if (source == hideItem)
2458
+ {
2459
+ group(new HiddenObject());
2460
+ } else
2461
+ if (source == frontItem)
21632462 {
21642463 front();
21652464 } else
2166
- if (event.getSource() == backItem)
2465
+ if (source == backItem)
21672466 {
21682467 back();
21692468 } else
2170
- if (event.getSource() == cameraItem)
2469
+ if (source == cameraItem)
21712470 {
21722471 makeSomething(new Camera());
21732472 } else
2174
- if (event.getSource() == compositeItem)
2473
+ if (source == compositeItem)
21752474 {
21762475 group(new Composite());
21772476 } else
2178
- if (event.getSource() == randomItem)
2477
+ if (source == randomItem)
21792478 {
21802479 RandomNode random = new RandomNode();
21812480 group(random);
21822481 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2482
+ random.name = random.get(0).name + "Switch";
21842483 } else
2185
- if (event.getSource() == physicsItem)
2484
+ if (source == physicsItem)
21862485 {
21872486 group(new PhysicsNode());
21882487 } else
2189
- if (event.getSource() == frameselectorItem)
2488
+ if (source == frameselectorItem)
21902489 {
21912490 for (int i=0; i<group.selection.size(); i++)
21922491 {
....@@ -2198,7 +2497,7 @@
21982497 ResetModel();
21992498 refreshContents();
22002499 } else
2201
- if (event.getSource() == switchGeoItem)
2500
+ if (source == switchGeoItem)
22022501 {
22032502 for (int i=0; i<group.selection.size(); i++)
22042503 {
....@@ -2210,7 +2509,7 @@
22102509 ResetModel();
22112510 refreshContents();
22122511 } else
2213
- if (event.getSource() == switchTransfoItem)
2512
+ if (source == switchTransfoItem)
22142513 {
22152514 for (int i=0; i<group.selection.size(); i++)
22162515 {
....@@ -2222,7 +2521,7 @@
22222521 ResetModel();
22232522 refreshContents();
22242523 } else
2225
- if (event.getSource() == morphItem)
2524
+ if (source == morphItem)
22262525 {
22272526 for (int i=0; i<group.selection.size(); i++)
22282527 {
....@@ -2234,7 +2533,7 @@
22342533 ResetModel();
22352534 refreshContents();
22362535 } else
2237
- if (event.getSource() == scriptNodeItem)
2536
+ if (source == scriptNodeItem)
22382537 {
22392538 boolean atleastone = false;
22402539
....@@ -2273,195 +2572,239 @@
22732572 }
22742573 }
22752574 } else
2276
- if (event.getSource() == linkerItem)
2575
+ if (source == linkerItem)
22772576 {
22782577 group(new cLinker());
22792578 } else
2280
- if (event.getSource() == textureItem)
2579
+ if (source == textureItem)
22812580 {
22822581 group(new TextureNode());
22832582 } else
2284
- if (event.getSource() == shadowXItem)
2583
+ if (source == billboardItem)
2584
+ {
2585
+ group(new BillboardNode());
2586
+ } else
2587
+ if (source == shadowXItem)
22852588 {
22862589 CastShadow(0);
22872590 } else
2288
- if (event.getSource() == shadowYItem)
2591
+ if (source == shadowYItem)
22892592 {
22902593 CastShadow(1);
22912594 } else
2292
- if (event.getSource() == shadowZItem)
2595
+ if (source == shadowZItem)
22932596 {
22942597 CastShadow(2);
22952598 } else
2296
- if (event.getSource() == ungroupItem)
2599
+ if (source == ungroupItem)
22972600 {
2298
- ungroup();
2601
+ //ungroup();
2602
+ for (int i=0; i<group.selection.size(); i++)
2603
+ {
2604
+ Ungroup(group.selection.get(i));
2605
+ }
2606
+
2607
+ ClearSelection(false);
2608
+
2609
+ refreshContents();
22992610 } else
2300
- if (event.getSource() == genUVItem)
2611
+ if (source == genUVItem)
23012612 {
23022613 GenUV();
23032614 } else
2304
- if (event.getSource() == genNormalsCADItem)
2615
+ if (source == genNormalsCADItem)
23052616 {
23062617 GenNormals(true);
23072618 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2619
+ if (source == genNormalsMESHItem)
2620
+ {
2621
+ GenNormalsMESH();
2622
+ } else
2623
+ if (source == genNormalsORGANItem)
23092624 {
23102625 GenNormals(false);
23112626 } else
2312
- if (event.getSource() == stripifyItem)
2627
+ if (source == genNormalsMINEItem)
2628
+ {
2629
+ GenNormalsMINE();
2630
+ } else
2631
+ if (source == stripifyItem)
23132632 {
23142633 Stripify();
23152634 } else
2316
- if (event.getSource() == unstripifyItem)
2635
+ if (source == unstripifyItem)
23172636 {
23182637 Unstripify();
23192638 } else
2320
- if (event.getSource() == trimItem)
2639
+ if (source == trimItem)
23212640 {
23222641 Trim();
23232642 } else
2324
- if (event.getSource() == untrimItem)
2643
+ if (source == untrimItem)
23252644 {
23262645 Untrim();
23272646 } else
2328
- if (event.getSource() == clearColorsItem)
2647
+ if (source == clearColorsItem)
23292648 {
23302649 ClearColors();
23312650 } else
2332
- if (event.getSource() == clearMaterialsItem)
2651
+ if (source == clearMaterialsItem)
23332652 {
23342653 ClearMaterials();
23352654 } else
2336
- if (event.getSource() == liveleavesItem)
2655
+ if (source == liveleavesItem)
23372656 {
23382657 LiveLeaves(true);
23392658 } else
2340
- if (event.getSource() == unliveleavesItem)
2659
+ if (source == unliveleavesItem)
23412660 {
23422661 LiveLeaves(false);
23432662 } else
2344
- if (event.getSource() == supportleavesItem)
2663
+ if (source == supportleavesItem)
23452664 {
23462665 SupportLeaves(true);
23472666 } else
2348
- if (event.getSource() == unsupportleavesItem)
2667
+ if (source == unsupportleavesItem)
23492668 {
23502669 SupportLeaves(false);
23512670 } else
2352
- if (event.getSource() == hideleavesItem)
2671
+ if (source == hideleavesItem)
23532672 {
23542673 HideLeaves(true);
23552674 } else
2356
- if (event.getSource() == showleavesItem)
2675
+ if (source == showleavesItem)
23572676 {
23582677 HideLeaves(false);
23592678 } else
2360
- if (event.getSource() == markleavesItem)
2679
+ if (source == markleavesItem)
23612680 {
23622681 MarkLeaves(true);
23632682 } else
2364
- if (event.getSource() == unmarkleavesItem)
2683
+ if (source == unmarkleavesItem)
23652684 {
23662685 MarkLeaves(false);
23672686 } else
2368
- if (event.getSource() == flipVItem)
2687
+ if (source == rewindleavesItem)
2688
+ {
2689
+ RewindLeaves(true);
2690
+ } else
2691
+ if (source == unrewindleavesItem)
2692
+ {
2693
+ RewindLeaves(false);
2694
+ } else
2695
+ if (source == randomleavesItem)
2696
+ {
2697
+ RandomLeaves(true);
2698
+ } else
2699
+ if (source == unrandomleavesItem)
2700
+ {
2701
+ RandomLeaves(false);
2702
+ } else
2703
+ if (source == flipVItem)
23692704 {
23702705 FlipV(true);
23712706 } else
2372
- if (event.getSource() == unflipVItem)
2707
+ if (source == unflipVItem)
23732708 {
23742709 FlipV(false);
23752710 } else
2376
- if (event.getSource() == lowTexturesItem)
2711
+ if (source == lowTexturesItem)
23772712 {
23782713 SetTexRes(0);
23792714 } else
2380
- if (event.getSource() == normalTexturesItem)
2715
+ if (source == normalTexturesItem)
23812716 {
23822717 SetTexRes(1);
23832718 } else
2384
- if (event.getSource() == highTexturesItem)
2719
+ if (source == highTexturesItem)
23852720 {
23862721 SetTexRes(2);
23872722 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2723
+ if (source == veryhighTexturesItem)
23892724 {
23902725 SetTexRes(3);
23912726 } else
2392
- if (event.getSource() == maxTexturesItem)
2727
+ if (source == maxTexturesItem)
23932728 {
23942729 SetTexRes(4);
23952730 } else
2396
- if (event.getSource() == panoTexturesItem)
2731
+ if (source == panoTexturesItem)
23972732 {
23982733 SetTexRes(5);
23992734 } else
2400
- if (event.getSource() == reverseNormalsItem)
2735
+ if (source == reverseNormalsItem)
24012736 {
24022737 ReverseNormals();
24032738 } else
2404
- if (event.getSource() == parseverticesItem)
2739
+ if (source == parseverticesItem)
24052740 {
24062741 ParseVertices();
24072742 } else
2408
- if (event.getSource() == textureFieldItem)
2743
+ if (source == textureFieldItem)
24092744 {
24102745 TextureVertices();
24112746 } else
2412
- if (event.getSource() == alignItem)
2747
+ if (source == alignItem)
24132748 {
24142749 Align();
24152750 } else
2416
- if (event.getSource() == mirrorItem)
2751
+ if (source == mirrorItem)
24172752 {
24182753 MirrorPoses();
24192754 } else
2420
- if (event.getSource() == reduceMorphItem)
2755
+ if (source == reduceMorphItem)
24212756 {
24222757 MeshReduction(false);
24232758 } else
2424
- if (event.getSource() == reduce34MorphItem)
2759
+ if (source == reduce34MorphItem)
24252760 {
24262761 MeshReduction(true);
24272762 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2763
+ if (source == reverseTrianglesItem)
24292764 {
24302765 ReverseTriangles();
24312766 } else
2432
- if (event.getSource() == reduceMeshItem)
2767
+ if (source == reduceMeshItem)
24332768 {
24342769 ReduceMesh(false);
24352770 } else
2436
- if (event.getSource() == reduce34MeshItem)
2771
+ if (source == reduce34MeshItem)
24372772 {
24382773 ReduceMesh(true);
24392774 } else
2440
- if (event.getSource() == increaseMeshItem)
2775
+ if (source == increaseMeshItem)
24412776 {
24422777 IncreaseMesh();
24432778 } else
2444
- if (event.getSource() == clipMeshItem)
2779
+ if (source == clipMeshItem)
24452780 {
24462781 ClipMesh();
24472782 } else
2448
- if (event.getSource() == smoothMeshItem)
2783
+ if (source == smoothMeshItem)
24492784 {
24502785 SmoothMesh();
24512786 } else
2452
- if (event.getSource() == transformgeometryItem)
2787
+ if (source == transformGeometryItem)
24532788 {
24542789 TransformGeometry();
24552790 } else
2456
- if (event.getSource() == resetTransformItem)
2791
+ if (source == transformChildrenItem)
2792
+ {
2793
+ TransformChildren();
2794
+ } else
2795
+ if (source == resetTransformItem)
24572796 {
24582797 ResetTransform();
24592798 } else
2460
- if (event.getSource() == resetCentroidItem)
2799
+ if (source == resetCentroidItem)
24612800 {
2462
- ResetCentroid();
2801
+ ResetCentroid(true);
24632802 } else
2464
- if (event.getSource() == resetParentItem)
2803
+ if (source == resetCentroidXZItem)
2804
+ {
2805
+ ResetCentroid(false);
2806
+ } else
2807
+ if (source == resetParentItem)
24652808 {
24662809 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672810 {
....@@ -2471,7 +2814,7 @@
24712814
24722815 refreshContents();
24732816 } else
2474
- if (event.getSource() == repairParentItem)
2817
+ if (source == repairParentItem)
24752818 {
24762819 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772820 {
....@@ -2485,7 +2828,21 @@
24852828
24862829 refreshContents();
24872830 } else
2488
- if (event.getSource() == sortbysizeItem)
2831
+ if (source == repairShadowItem)
2832
+ {
2833
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2834
+ {
2835
+ Object3D obj = (Object3D)e.nextElement();
2836
+ obj.RepairShadow();
2837
+// for (int i=0; i<obj.size(); i++)
2838
+// {
2839
+// obj.get(i).parent = obj;
2840
+// }
2841
+ }
2842
+
2843
+ refreshContents();
2844
+ } else
2845
+ if (source == sortbysizeItem)
24892846 {
24902847 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912848 {
....@@ -2497,7 +2854,7 @@
24972854 ResetModel();
24982855 refreshContents();
24992856 } else
2500
- if (event.getSource() == sortbynameItem)
2857
+ if (source == sortbynameItem)
25012858 {
25022859 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032860 {
....@@ -2509,7 +2866,7 @@
25092866 ResetModel();
25102867 refreshContents();
25112868 } else
2512
- if (event.getSource() == attachPigmentItem)
2869
+ if (source == attachPigmentItem)
25132870 {
25142871 String texture = GetFile("Attach pigment");
25152872 Object3D obj;
....@@ -2521,7 +2878,7 @@
25212878
25222879 refreshContents();
25232880 } else
2524
- if (event.getSource() == detachPigmentItem)
2881
+ if (source == detachPigmentItem)
25252882 {
25262883 Object3D obj;
25272884 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2889,7 @@
25322889
25332890 refreshContents();
25342891 } else
2535
- if (event.getSource() == attachBumpItem)
2892
+ if (source == attachBumpItem)
25362893 {
25372894 String texture = GetFile("Attach bump");
25382895 Object3D obj;
....@@ -2544,7 +2901,7 @@
25442901
25452902 refreshContents();
25462903 } else
2547
- if (event.getSource() == detachBumpItem)
2904
+ if (source == detachBumpItem)
25482905 {
25492906 Object3D obj;
25502907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2912,7 @@
25552912
25562913 refreshContents();
25572914 } else
2558
- if (event.getSource() == pigmentBumpItem)
2915
+ if (source == pigmentBumpItem)
25592916 {
25602917 Object3D obj;
25612918 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2923,221 @@
25662923
25672924 refreshContents();
25682925 } else
2569
- if (event.getSource() == flashSelectionButton)
2926
+ if (source == flashSelectionButton)
25702927 {
25712928 CameraPane.flash = true;
25722929 refreshContents();
25732930 } else
2574
- if (event.getSource() == oneButton)
2931
+ if (source == oneButton)
25752932 {
25762933 } else
2577
- if (event.getSource() == twoButton)
2934
+ if (source == twoButton)
25782935 {
25792936 radio.layout = twoButton;
25802937 // bug
25812938 //gridPanel.setDividerLocation(1.0);
25822939 //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();
2940
+// bigThree.remove(scenePanel);
2941
+// bigThree.remove(centralPanel);
2942
+// bigThree.remove(XYZPanel);
2943
+// aWindowConstraints.gridx = 0;
2944
+// aWindowConstraints.gridy = 0;
2945
+// aWindowConstraints.gridwidth = 1;
2946
+// // aConstraints.gridheight = 3;
2947
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2948
+// aWindowConstraints.weightx = 0;
2949
+// aWindowConstraints.weighty = 1;
2950
+// //bigThree.add(jtp, aWindowConstraints);
2951
+// aWindowConstraints.weightx = 1;
2952
+// aWindowConstraints.gridwidth = 3;
2953
+// // aConstraints.gridheight = 3;
2954
+// aWindowConstraints.gridx = 1;
2955
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2956
+// bigThree.add(centralPanel, aWindowConstraints);
2957
+// aWindowConstraints.weightx = 0;
2958
+// aWindowConstraints.gridx = 4;
2959
+// aWindowConstraints.gridwidth = 1;
2960
+// // aConstraints.gridheight = 3;
2961
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2962
+// //bigThree.add(XYZPanel, aWindowConstraints);
2963
+// scenePanel.setVisible(false);
2964
+// centralPanel.setVisible(true);
2965
+// XYZPanel.setVisible(false);
2966
+ bigThree.ClearUI();
2967
+ bigThree.add(centralPanel);
2968
+ bigThree.FlushUI();
2969
+
2970
+ cameraView.requestFocusInWindow();
2971
+
2972
+// refreshContents(true);
2973
+//
2974
+// try
2975
+// {
2976
+// java.awt.Robot bot = new java.awt.Robot();
2977
+// int mask = InputEvent.BUTTON1_MASK;
2978
+// bot.mouseMove(100, 100);
2979
+// bot.mousePress(mask);
2980
+// bot.mouseRelease(mask);
2981
+// }
2982
+// catch (Exception e)
2983
+// {
2984
+//
2985
+// }
2986
+
26072987 } else
2608
- if (event.getSource() == threeButton)
2988
+ if (source == threeButton)
26092989 {
26102990 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();
2991
+
2992
+// bigThree.remove(scenePanel);
2993
+// bigThree.remove(centralPanel);
2994
+// bigThree.remove(XYZPanel);
2995
+// aWindowConstraints.gridx = 0;
2996
+// aWindowConstraints.gridy = 0;
2997
+// aWindowConstraints.gridwidth = 1;
2998
+// // aConstraints.gridheight = 3;
2999
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3000
+// aWindowConstraints.weightx = 0;
3001
+// aWindowConstraints.weighty = 1;
3002
+// //bigThree.add(jtp, aWindowConstraints);
3003
+// aWindowConstraints.weightx = 1;
3004
+// aWindowConstraints.gridwidth = 3;
3005
+// // aConstraints.gridheight = 3;
3006
+// aWindowConstraints.gridx = 1;
3007
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3008
+// bigThree.add(centralPanel, aWindowConstraints);
3009
+// aWindowConstraints.weightx = 0;
3010
+// aWindowConstraints.gridx = 4;
3011
+// aWindowConstraints.gridwidth = 1;
3012
+// // aConstraints.gridheight = 3;
3013
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3014
+// bigThree.add(XYZPanel, aWindowConstraints);
3015
+// bigThree.validate();
3016
+// scenePanel.setVisible(false);
3017
+// centralPanel.setVisible(true);
3018
+// XYZPanel.setVisible(true);
3019
+ bigThree.ClearUI();
3020
+ bigThree.add(centralPanel);
3021
+ bigThree.add(XYZPanel);
3022
+ bigThree.FlushUI();
3023
+
3024
+ cameraView.requestFocusInWindow();
26353025 } else
2636
- if (event.getSource() == fourButton)
3026
+ if (source == fourButton)
26373027 {
26383028 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();
3029
+
3030
+// bigThree.remove(scenePanel);
3031
+// bigThree.remove(centralPanel);
3032
+// bigThree.remove(XYZPanel);
3033
+// aWindowConstraints.gridx = 0;
3034
+// aWindowConstraints.gridy = 0;
3035
+// aWindowConstraints.gridwidth = 1;
3036
+// // aWindowConstraints.gridheight = 3;
3037
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3038
+// aWindowConstraints.weightx = 1;
3039
+// aWindowConstraints.weighty = 1;
3040
+// bigThree.add(scenePanel, aWindowConstraints);
3041
+// aWindowConstraints.weightx = 1;
3042
+// aWindowConstraints.gridwidth = 3;
3043
+// // aConstraints.gridheight = 3;
3044
+// aWindowConstraints.gridx = 1;
3045
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3046
+// //bigThree.add(cameraPanel, aWindowConstraints);
3047
+// aWindowConstraints.weightx = 0;
3048
+// aWindowConstraints.gridx = 4;
3049
+// aWindowConstraints.gridwidth = 1;
3050
+// // aWindowConstraints.gridheight = 3;
3051
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3052
+// //bigThree.add(XYZPanel, aWindowConstraints);
3053
+// bigThree.validate();
3054
+// scenePanel.setVisible(true);
3055
+// centralPanel.setVisible(false);
3056
+// XYZPanel.setVisible(false);
3057
+ bigThree.ClearUI();
3058
+ bigThree.add(scenePanel);
3059
+ bigThree.FlushUI();
3060
+
3061
+ cameraView.requestFocusInWindow();
26633062 } else
2664
- if (event.getSource() == sixButton)
3063
+ if (source == sixButton)
26653064 {
26663065 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();
3066
+
3067
+// bigThree.remove(scenePanel);
3068
+// bigThree.remove(centralPanel);
3069
+// bigThree.remove(XYZPanel);
3070
+// aWindowConstraints.gridx = 0;
3071
+// aWindowConstraints.gridy = 0;
3072
+// aWindowConstraints.gridwidth = 1;
3073
+// // aConstraints.gridheight = 3;
3074
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3075
+// aWindowConstraints.weightx = 0;
3076
+// aWindowConstraints.weighty = 1;
3077
+// bigThree.add(scenePanel, aWindowConstraints);
3078
+// aWindowConstraints.weightx = 1;
3079
+// aWindowConstraints.gridwidth = 3;
3080
+// // aWindowConstraints.gridheight = 3;
3081
+// aWindowConstraints.gridx = 1;
3082
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3083
+// bigThree.add(centralPanel, aWindowConstraints);
3084
+// aWindowConstraints.weightx = 0;
3085
+// aWindowConstraints.gridx = 4;
3086
+// aWindowConstraints.gridwidth = 1;
3087
+// // aWindowConstraints.gridheight = 3;
3088
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3089
+// //bigThree.add(XYZPanel, aConstraints);
3090
+// bigThree.validate();
3091
+// scenePanel.setVisible(true);
3092
+// centralPanel.setVisible(true);
3093
+// XYZPanel.setVisible(false);
3094
+ bigThree.ClearUI();
3095
+ bigThree.add(scenePanel);
3096
+ bigThree.add(centralPanel);
3097
+ bigThree.FlushUI();
3098
+
3099
+ cameraView.requestFocusInWindow();
26913100 } else
2692
- if (event.getSource() == sevenButton)
3101
+ if (source == sevenButton)
26933102 {
26943103 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();
3104
+
3105
+// bigThree.remove(scenePanel);
3106
+// bigThree.remove(centralPanel);
3107
+// bigThree.remove(XYZPanel);
3108
+// aWindowConstraints.gridx = 0;
3109
+// aWindowConstraints.gridy = 0;
3110
+// aWindowConstraints.gridwidth = 1;
3111
+// // aWindowConstraints.gridheight = 3;
3112
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3113
+// aWindowConstraints.weightx = 0;
3114
+// aWindowConstraints.weighty = 1;
3115
+// bigThree.add(scenePanel, aWindowConstraints);
3116
+// aWindowConstraints.weightx = 1;
3117
+// aWindowConstraints.gridwidth = 3;
3118
+// // aWindowConstraints.gridheight = 3;
3119
+// aWindowConstraints.gridx = 1;
3120
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3121
+// bigThree.add(centralPanel, aWindowConstraints);
3122
+// aWindowConstraints.weightx = 0;
3123
+// aWindowConstraints.gridx = 4;
3124
+// aWindowConstraints.gridwidth = 1;
3125
+// // aConstraints.gridheight = 3;
3126
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3127
+// bigThree.add(XYZPanel, aWindowConstraints);
3128
+// bigThree.validate();
3129
+// scenePanel.setVisible(true);
3130
+// centralPanel.setVisible(true);
3131
+// XYZPanel.setVisible(true);
3132
+ bigThree.ClearUI();
3133
+ bigThree.add(scenePanel);
3134
+ bigThree.add(centralPanel);
3135
+ bigThree.add(XYZPanel);
3136
+ bigThree.FlushUI();
3137
+
3138
+ cameraView.requestFocusInWindow();
27193139 } else
2720
- if (event.getSource() == rootButton)
3140
+ if (source == rootButton)
27213141 {
27223142 Object3D obj;
27233143 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,34 +3147,44 @@
27273147 EditObject(obj);
27283148 }
27293149
3150
+ cameraView.requestFocusInWindow();
27303151 refreshContents(true);
27313152 } else
2732
- if (event.getSource() == closeButton)
3153
+ if (source == closeButton)
27333154 {
27343155 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353156 cRadio ab;
27363157 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373158 {
27383159 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3160
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403161 {
3162
+ // Patch to avoid bug with transparency.
3163
+ if (!ab.hadMaterial)
3164
+ {
3165
+ ab.object.material = null;
3166
+ }
3167
+
27413168 buttonGroup.remove(ab);
27423169 radioPanel.remove(ab);
27433170
2744
- ab.GetObject().editWindow = null;
3171
+ //ab.GetObject().editWindow = null;
3172
+ ab.GetObject().manipWindow = null;
27453173 // ab.GetObject().objectUI = null; // ?????????
27463174
27473175 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483176 break;
27493177 }
27503178 }
3179
+
3180
+ cameraView.requestFocusInWindow();
27513181 refreshContents(true);
27523182 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3183
+ if (source == editItem || source == editButton)
27543184 {
27553185 EditSelection(false);
27563186 } else
2757
- if (event.getSource() == uneditButton)
3187
+ if (source == uneditButton)
27583188 {
27593189 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603190 {
....@@ -2764,14 +3194,14 @@
27643194 child.CloseUI();
27653195 listUI.remove(child);
27663196
2767
- child.editWindow = null; // ???????????
3197
+ //child.editWindow = null; // ???????????
27683198 }
2769
- objEditor.ctrlPanel.revalidate();
3199
+ objEditor.ctrlPanel.FlushUI();
27703200 //objEditor.jTree.clearSelection();
27713201 //objEditor.ResetSliders();
27723202 refreshContents(true);
27733203 } else
2774
- if (event.getSource() == clearPanelButton)
3204
+ if (source == clearPanelButton)
27753205 {
27763206 assert(copy == group);
27773207 //copy.ClearUI();
....@@ -2782,7 +3212,7 @@
27823212 listUI.clear();
27833213 refreshContents(true);
27843214 } else
2785
- if (event.getSource() == allParamsButton)
3215
+ if (source == allParamsButton)
27863216 {
27873217 assert(copy == group);
27883218
....@@ -2803,19 +3233,19 @@
28033233
28043234 refreshContents(true);
28053235 } else
2806
- if (event.getSource() == unselectButton)
3236
+ if (source == unselectButton)
28073237 {
28083238 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3239
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103240 objEditor.ResetSliders();
28113241 refreshContents(true);
28123242 } else
2813
- if(event.getSource() instanceof cRadio)
3243
+ if(source instanceof cRadio)
28143244 {
28153245 group.parent = keepparent;
28163246 group.attributes = 0;
28173247 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3248
+ /*cRadio*/ radio = (cRadio)source;
28193249 Object3D obj = radio.GetObject();
28203250 System.out.println("Edit " + obj);
28213251 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3265,7 @@
28353265 }
28363266
28373267 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3268
+ //Globals.theRenderer.object = group;
28393269 if(!useclient)
28403270 {
28413271 cameraView.renderCamera = radio.camera;
....@@ -2844,12 +3274,17 @@
28443274 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453275 cameraView.targetLookAt.set(radio.camera.lookAt);
28463276 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3277
+ //cameraView.lighttouched = true;
3278
+ Globals.lighttouched = true;
28483279 topView.object = group;
28493280 frontView.object = group;
28503281 sideView.object = group;
28513282 }
2852
- group.editWindow = this;
3283
+
3284
+// fix "+" issue
3285
+ //group.editWindow = this;
3286
+ group.manipWindow = this;
3287
+
28533288 /*
28543289 currentLayout = radio.layout;
28553290 if (currentLayout == null)
....@@ -2861,8 +3296,23 @@
28613296 //group.parent = null; // ROOT
28623297 //group.attributes = -1;
28633298 ResetModel();
3299
+
3300
+ cameraView.requestFocusInWindow();
28643301 refreshContents(true);
2865
- }
3302
+ } else if (event.getSource() == editCameraItem)
3303
+ {
3304
+ cameraView.ProtectCamera();
3305
+ cameraView.repaint();
3306
+ return;
3307
+ } else if (event.getSource() == revertCameraItem)
3308
+ {
3309
+ cameraView.RevertCamera();
3310
+ cameraView.repaint();
3311
+ return;
3312
+ // } else if (event.getSource() == textureButton)
3313
+ // {
3314
+ // return; // true;
3315
+ }
28663316 else
28673317 {
28683318 //return super.action(event, arg);
....@@ -2871,7 +3321,6 @@
28713321 }
28723322
28733323 boolean useclient = false;
2874
- cRadio radio;
28753324
28763325 void ToggleRoot()
28773326 {
....@@ -2880,7 +3329,7 @@
28803329 if (useclient)
28813330 {
28823331 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3332
+ Globals.lighttouched = true;
28843333 //topView.object = client;
28853334 //frontView.object = client;
28863335 //sideView.object = client;
....@@ -2888,7 +3337,7 @@
28883337 else
28893338 {
28903339 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3340
+ Globals.lighttouched = true;
28923341 //topView.object = group;
28933342 //frontView.object = group;
28943343 //sideView.object = group;
....@@ -2923,6 +3372,28 @@
29233372 refreshContents();
29243373 }
29253374
3375
+ void TransformChildren()
3376
+ {
3377
+ Object3D obj;
3378
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3379
+ {
3380
+ obj = (Object3D)e.nextElement();
3381
+ obj.KeepTextureMatrices();
3382
+ obj.TransformChildren();
3383
+ obj.RestoreTextureMatrices();
3384
+
3385
+// if (obj.parent == null)
3386
+// {
3387
+// System.out.println("NULL PARENT!");
3388
+// new Exception().printStackTrace();
3389
+// }
3390
+// else
3391
+// TouchTransform(obj);
3392
+// //obj.parent.Touch();
3393
+ }
3394
+
3395
+ refreshContents();
3396
+ }
29263397
29273398 void ResetTransform()
29283399 {
....@@ -3035,7 +3506,7 @@
30353506 refreshContents();
30363507 }
30373508
3038
- void ResetCentroid()
3509
+ void ResetCentroid(boolean full)
30393510 {
30403511 Object3D obj;
30413512 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3521,16 @@
30503521 LA.matIdentity(Object3D.mat);
30513522 obj.getBounds(minima, maxima, false);
30523523 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3524
+ if (full)
3525
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543526 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553527 obj.TransformMesh(Object3D.mat);
3528
+
30563529 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3530
+ if (full)
3531
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583532 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3533
+
30593534 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603535 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613536 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3559,8 @@
30843559
30853560 int size = obj.MemorySize();
30863561
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3562
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3563
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883564 }
30893565 }
30903566 catch (Exception e)
....@@ -3121,9 +3597,9 @@
31213597 obj = (Object3D)e.nextElement();
31223598
31233599 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3600
+ Grafreed.AnalyzeObject(obj);
31253601 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3602
+ Grafreed.AnalyzeObject(obj.bRep);
31273603
31283604 // System.err.println((size/1024) + " KB is the size of " + obj);
31293605 }
....@@ -3165,6 +3641,20 @@
31653641 void GenNormals(boolean crease)
31663642 {
31673643 group.GenNormalsS(crease);
3644
+
3645
+ refreshContents();
3646
+ }
3647
+
3648
+ void GenNormalsMESH()
3649
+ {
3650
+ group.GenNormalsMeshS();
3651
+
3652
+ refreshContents();
3653
+ }
3654
+
3655
+ void GenNormalsMINE()
3656
+ {
3657
+ group.selection.GenNormalsMINE();
31683658
31693659 refreshContents();
31703660 }
....@@ -3250,7 +3740,7 @@
32503740 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513741 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523742 //
3253
-// g.add(GraphreeD.clipboard);
3743
+// g.add(GrafreeD.clipboard);
32543744 //
32553745 // buffer.add(g);
32563746 // }
....@@ -3269,8 +3759,8 @@
32693759 // nodes = new Object3D();
32703760 // vertices = new Vector<Vertex>();
32713761 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3762
+// boolean epsequal = GrafreeD.epsequal;
3763
+// GrafreeD.epsequal = true;
32743764 //
32753765 // for (int i=0; i<group.selection.size(); i++)
32763766 // {
....@@ -3311,7 +3801,7 @@
33113801 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123802 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133803 //
3314
-// g.add(GraphreeD.clipboard);
3804
+// g.add(GrafreeD.clipboard);
33153805 //
33163806 // buffer.add(g);
33173807 // }
....@@ -3319,7 +3809,7 @@
33193809 // makeSomething(buffer, i==group.selection.size()-1);
33203810 // }
33213811 //
3322
-// GraphreeD.epsequal = epsequal;
3812
+// GrafreeD.epsequal = epsequal;
33233813 //
33243814 // //buffer = null;
33253815 // temprep = null;
....@@ -3330,8 +3820,8 @@
33303820
33313821 void ParseVertices()
33323822 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3823
+ boolean epsequal = Grafreed.epsequal;
3824
+ Grafreed.epsequal = true;
33353825
33363826 for (int i=0; i<group.selection.size(); i++)
33373827 {
....@@ -3356,7 +3846,7 @@
33563846 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573847 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583848
3359
- g.add(GraphreeD.clipboard);
3849
+ g.add(Grafreed.clipboard);
33603850
33613851 buffer.add(g);
33623852 }
....@@ -3371,7 +3861,7 @@
33713861 makeSomething(buffer, i==group.selection.size()-1);
33723862 }
33733863
3374
- GraphreeD.epsequal = epsequal;
3864
+ Grafreed.epsequal = epsequal;
33753865
33763866 refreshContents();
33773867 }
....@@ -3389,7 +3879,16 @@
33893879 String pigment = Object3D.GetPigment(tex);
33903880 //String bump = Object3D.GetBump(tex);
33913881
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3882
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3883
+
3884
+ try
3885
+ {
3886
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3887
+ }
3888
+ catch (Exception e)
3889
+ {
3890
+ System.err.println("FAIL: " + node);
3891
+ }
33933892
33943893 double s = v.s;
33953894
....@@ -3416,7 +3915,7 @@
34163915 scale /= 3;
34173916
34183917 scale /= 0xFF;
3419
- scale /= 4;
3918
+ // c'est quoi ca? scale /= 4;
34203919
34213920 //v.AO = scale;
34223921
....@@ -3437,12 +3936,26 @@
34373936
34383937 void Align()
34393938 {
3939
+ if (group.selection.size() == 0)
3940
+ return;
3941
+
3942
+ cVector bbmin = new cVector();
3943
+ cVector bbmax = new cVector();
3944
+
3945
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3946
+
3947
+ double dx = bbmax.x - bbmin.x;
3948
+ double dy = bbmax.y - bbmin.y;
3949
+ double dz = bbmax.z - bbmin.z;
3950
+
3951
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3952
+
34403953 for (int i=0; i<group.selection.size(); i++)
34413954 {
34423955 Object3D obj = group.selection.get(i);
34433956
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3957
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3958
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463959 }
34473960
34483961 refreshContents();
....@@ -3455,7 +3968,7 @@
34553968 // ref.SaveSupports();
34563969 // Object3D par = ref.parent;
34573970 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3971
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593972 // ref.parent = par;
34603973 // ref.RestoreSupports();
34613974
....@@ -3463,11 +3976,11 @@
34633976
34643977 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34653978
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
3979
+ boolean random = CameraPane.SWITCH;
3980
+ CameraPane.SWITCH = false; // parse all random nodes
34683981 lowres.linkVerticesThis(null);
34693982 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
3983
+ CameraPane.SWITCH = random;
34713984
34723985 System.err.flush();
34733986
....@@ -3485,7 +3998,7 @@
34853998 // lowres.SaveSupports();
34863999 // par = lowres.parent;
34874000 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4001
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894002 Object3D newlow = CloneObject(lowres, false);
34904003 newlow.name = sn.switchobject.get(i).name;
34914004 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4020,7 @@
35074020 return;
35084021
35094022 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4023
+ Object3D ref = Grafreed.clipboard.get(0);
35114024
35124025 Object3D newgroup = new Object3D("Po:" + poses.name);
35134026
....@@ -3676,7 +4189,7 @@
36764189 group.selection.RelinkToSupport(); // july 2014
36774190 System.out.println("DONE.");
36784191 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4192
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804193 }
36814194
36824195 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4214,20 @@
37014214
37024215 void ClipMesh()
37034216 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4217
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054218 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4219
+ Object3D content = Grafreed.clipboard.get(0);
37074220
37084221 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094222 content = ((cGroup)content).get(0);
37104223
37114224 // for (int i=0; i<group.selection.size(); i++)
37124225 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4226
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144227 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4228
+ group.selection.ClipMesh(Grafreed.clipboard);
37164229 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4230
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184231 System.out.println("DONE.");
37194232 refreshContents();
37204233 }
....@@ -3759,6 +4272,18 @@
37594272 void MarkLeaves(boolean hide)
37604273 {
37614274 group.selection.MarkLeaves(hide);
4275
+ refreshContents();
4276
+ }
4277
+
4278
+ void RewindLeaves(boolean hide)
4279
+ {
4280
+ group.selection.RewindLeaves(hide);
4281
+ refreshContents();
4282
+ }
4283
+
4284
+ void RandomLeaves(boolean hide)
4285
+ {
4286
+ group.selection.RandomLeaves(hide);
37624287 refreshContents();
37634288 }
37644289
....@@ -3847,7 +4372,7 @@
38474372 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484373
38494374 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4375
+ if(elem != group || !newWindow)
38514376 {
38524377 // if (!(elem instanceof Composite))
38534378 // newWindow = false;
....@@ -3937,7 +4462,6 @@
39374462 //case 702: // Event.LIST_DESELECT
39384463 group.deselectAll();
39394464 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414465 if (tps != null)
39424466 {
39434467 for (int i=0; i < tps.length; i++)
....@@ -3946,31 +4470,30 @@
39464470
39474471 //if (child.parent != null)
39484472 //child.parent.addSelectee(child);
4473
+ objEditor.SetMaterial(child);
39494474 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534475 }
39544476 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4477
+// else
4478
+// {
4479
+// objEditor.SetMaterial(group); // .GetMaterial());
4480
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4481
+// System.err.println("info : " + group.GetPath());
4482
+// }
39614483
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4484
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654485 CameraPane.flash = true;
39664486
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4487
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684488 // a camera
39694489 {
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;
4490
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4491
+ {
4492
+ CameraPane.camerachangeframe = 0; // don't refuse it
4493
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4494
+ }
4495
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4496
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744497 }
39754498
39764499 refreshContents();
....@@ -3981,6 +4504,26 @@
39814504
39824505 freezemodel = false;
39834506 }
4507
+
4508
+ void refreshContents(boolean cp)
4509
+ {
4510
+ if (!Globals.MOUSEDRAGGED)
4511
+ {
4512
+ objEditor.ClearInfo(); // .GetMaterial());
4513
+
4514
+ for (int i=0; i < group.selection.Size(); i++)
4515
+ {
4516
+ Object3D child = (Object3D) group.selection.get(i);
4517
+
4518
+ objEditor.AddInfo(child, this, true);
4519
+ System.err.println("info : " + child.GetPath());
4520
+ }
4521
+
4522
+ objEditor.SetText(); // jan 2014
4523
+ }
4524
+
4525
+ super.refreshContents(cp);
4526
+ }
39844527
39854528 void linkSomething(Object3D thing)
39864529 {
....@@ -4052,16 +4595,19 @@
40524595 {
40534596 if (group.selection.isEmpty())
40544597 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4598
+
4599
+ Grafreed.clipboardIsTempGroup = false;
40564600 Composite tGroup = null;
40574601 if (group.selection.size() > 0) // 1)
40584602 {
40594603 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4604
+ Grafreed.clipboardIsTempGroup = true;
40614605 }
40624606
40634607 if (cut)
40644608 {
4609
+ if (Globals.SAVEONMAKE)
4610
+ Save();
40654611 //int indices[] = jList.getSelectedIndices();
40664612 //for (int i = indices.length - 1; i >= 0; i--)
40674613 //jList.remove(indices[i]);
....@@ -4097,16 +4643,16 @@
40974643 //System.out.println("cut " + child);
40984644 //System.out.println("parent = " + child.parent);
40994645 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4646
+ if (Grafreed.clipboardIsTempGroup)
41014647 tGroup.add/*Child*/(tmp);
41024648 else
4103
- GraphreeD.clipboard = tmp;
4649
+ Grafreed.clipboard = tmp;
41044650 }
41054651 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4652
+ if (Grafreed.clipboardIsTempGroup)
41074653 tGroup.add/*Child*/(child);
41084654 else
4109
- GraphreeD.clipboard = child;
4655
+ Grafreed.clipboard = child;
41104656 }
41114657
41124658 //ResetModel();
....@@ -4138,21 +4684,23 @@
41384684 //System.out.println("cut " + elem);
41394685 //System.out.println("parent = " + elem.parent);
41404686 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4687
+ if (Grafreed.clipboardIsTempGroup)
41424688 tGroup.add/*Child*/(tmp);
41434689 else
4144
- GraphreeD.clipboard = tmp;
4690
+ Grafreed.clipboard = tmp;
41454691 }
41464692 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4693
+ if (Grafreed.clipboardIsTempGroup)
41484694 tGroup.add/*Child*/(child);
41494695 else
4150
- GraphreeD.clipboard = child;
4696
+ Grafreed.clipboard = child;
41514697 }
41524698
41534699 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4700
+
4701
+ if (Grafreed.clipboardIsTempGroup)
4702
+ Grafreed.clipboard = tGroup;
4703
+
41564704 if (cut)
41574705 {
41584706 ResetModel();
....@@ -4162,11 +4710,11 @@
41624710
41634711 void paste(boolean expand)
41644712 {
4165
- // if (GraphreeD.clipboard == null)
4713
+ // if (GrafreeD.clipboard == null)
41664714 // return;
41674715 boolean first = true;
41684716
4169
- if (GraphreeD.clipboardIsTempGroup)
4717
+ if (Grafreed.clipboardIsTempGroup)
41704718 {
41714719 Composite temp;
41724720
....@@ -4177,7 +4725,7 @@
41774725 temp = (Composite)Applet3D.clipboard.deepCopy();
41784726 */
41794727 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4728
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814729 {
41824730 Object3D child = (Object3D)e.nextElement();
41834731
....@@ -4191,7 +4739,7 @@
41914739 else
41924740 elem = child.deepCopy(); // ?
41934741 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4742
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954743 // elem = elem.get(0);
41964744 makeSomething(elem, true); // ?? first);
41974745 //group.addChild(elem);
....@@ -4211,23 +4759,23 @@
42114759 //Object3D cb = Applet3D.clipboard;
42124760 //temp.addChild(cb);
42134761 //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());
4762
+ assert(Grafreed.clipboard.parent == null);
4763
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4764
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4765
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4766
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194767 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4768
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4769
+ Grafreed.clipboard.get(0).parent = keepparent;
42224770 }
42234771
42244772 ResetModel();
42254773 refreshContents();
42264774 }
42274775
4228
- void pasteInto(boolean copyit)
4776
+ void pasteInto(boolean copyit, boolean clone)
42294777 {
4230
-// if (GraphreeD.clipboard == null)
4778
+// if (GrafreeD.clipboard == null)
42314779 // return;
42324780
42334781 if (group.selection.size() != 1)
....@@ -4254,15 +4802,22 @@
42544802 if (copyit)
42554803 {
42564804 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4805
+ if (clone)
4806
+ {
4807
+ CloneClipboard(false); // sept 2014
4808
+ }
4809
+ else
4810
+ {
4811
+ paste(false);
4812
+ }
42584813 }
42594814 else
42604815 {
42614816 boolean first = true;
42624817
4263
- if (GraphreeD.clipboardIsTempGroup)
4818
+ if (Grafreed.clipboardIsTempGroup)
42644819 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4820
+ Composite temp = (Composite)Grafreed.clipboard;
42664821 Object3D copy;
42674822 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684823 {
....@@ -4272,7 +4827,7 @@
42724827 }
42734828 } else
42744829 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4830
+ linkSomething(Grafreed.clipboard); //.get(0));
42764831 }
42774832 }
42784833 }
....@@ -4464,6 +5019,26 @@
44645019 makeSomething(csg);
44655020 }
44665021
5022
+ void Ungroup(Object3D g)
5023
+ {
5024
+ if (g instanceof HiddenObject)
5025
+ {
5026
+ HiddenObject h = (HiddenObject) g;
5027
+
5028
+ for (int i=0; i<h.ActualSize(); i++)
5029
+ {
5030
+ objEditor.makeSomething(h.get(i), false);
5031
+ }
5032
+ }
5033
+ else
5034
+ {
5035
+ for (int i=0; i<g.Size(); i++)
5036
+ {
5037
+ objEditor.makeSomething(g.get(i), false);
5038
+ }
5039
+ }
5040
+ }
5041
+
44675042 void ungroup()
44685043 {
44695044 /*
....@@ -4657,21 +5232,6 @@
46575232 }
46585233 */
46595234
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
-
46755235 /*
46765236 public void Callback(Object obj)
46775237 {
....@@ -4695,26 +5255,9 @@
46955255 }
46965256 */
46975257
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
-
47155258 String GetFile(String dialogName)
47165259 {
4717
- if (GraphreeD.standAlone)
5260
+ if (Grafreed.standAlone)
47185261 {
47195262 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205263 browser.show();
....@@ -4778,10 +5321,18 @@
47785321 cButton flashSelectionButton;
47795322 cButton editButton;
47805323 cButton uneditButton;
5324
+ JCheckBox allParamsButton;
47815325 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835326 cButton unselectButton;
47845327
5328
+ cButton minButton;
5329
+ cButton maxButton;
5330
+ cButton fullButton;
5331
+ cButton undoButton;
5332
+ cButton redoButton;
5333
+ cButton saveButton;
5334
+ cButton oneStepButton;
5335
+
47855336 cButton screenfitButton;
47865337 cButton screenfitpointButton;
47875338 cButton snapobjectButton;
....@@ -4792,14 +5343,6 @@
47925343 cButton closeButton;
47935344
47945345 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;
48035346
48045347 //
48055348 //Composite
....@@ -4812,6 +5355,8 @@
48125355 private MenuItem lookFromItem;
48135356 private MenuItem switchItem;
48145357 private MenuItem cutItem;
5358
+ private MenuItem undoItem;
5359
+ private MenuItem redoItem;
48155360 private MenuItem duplicateItem;
48165361 private MenuItem cloneItem;
48175362 private MenuItem cloneSupportItem;
....@@ -4823,8 +5368,9 @@
48235368 private MenuItem resetsupportItem;
48245369 private MenuItem resetreferencesItem;
48255370 private MenuItem linkverticesItem;
5371
+ private MenuItem relinkverticesItem;
48265372 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5373
+ private MenuItem resetAllItem;
48285374 private MenuItem stepAllItem;
48295375 private MenuItem revertMeshItem;
48305376 private MenuItem poseMeshItem;
....@@ -4835,14 +5381,17 @@
48355381 private MenuItem mergeGeometriesItem;
48365382 private MenuItem copyItem;
48375383 private MenuItem pasteItem;
5384
+ private MenuItem pasteIntoItem;
48385385 private MenuItem pasteLinkItem;
48395386 private MenuItem pasteCloneItem;
48405387 private MenuItem pasteExpandItem;
48415388 private MenuItem clearItem;
48425389 private MenuItem clearAllItem;
48435390 private MenuItem genUVItem;
5391
+ private MenuItem genNormalsMESHItem;
48445392 private MenuItem genNormalsCADItem;
48455393 private MenuItem genNormalsORGANItem;
5394
+ private MenuItem genNormalsMINEItem;
48465395 private MenuItem stripifyItem;
48475396 private MenuItem unstripifyItem;
48485397 private MenuItem trimItem;
....@@ -4871,6 +5420,10 @@
48715420 private MenuItem showleavesItem;
48725421 private MenuItem markleavesItem;
48735422 private MenuItem unmarkleavesItem;
5423
+ private MenuItem rewindleavesItem;
5424
+ private MenuItem unrewindleavesItem;
5425
+ private MenuItem randomleavesItem;
5426
+ private MenuItem unrandomleavesItem;
48745427
48755428 private MenuItem flipVItem;
48765429 private MenuItem unflipVItem;
....@@ -4882,8 +5435,11 @@
48825435 private MenuItem panoTexturesItem;
48835436
48845437 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5438
+ private MenuItem resetCentroidXZItem;
48865439 private MenuItem resetTransformItem;
5440
+ private MenuItem transformGeometryItem;
5441
+ private MenuItem transformChildrenItem;
5442
+ private MenuItem hideItem;
48875443 private MenuItem grabItem;
48885444 private MenuItem backItem;
48895445 private MenuItem frontItem;
....@@ -4904,6 +5460,7 @@
49045460
49055461 private MenuItem resetParentItem;
49065462 private MenuItem repairParentItem;
5463
+ private MenuItem repairShadowItem;
49075464 private MenuItem sortbysizeItem;
49085465 private MenuItem sortbynameItem;
49095466
....@@ -4924,10 +5481,11 @@
49245481 private MenuItem coneItem;
49255482 private MenuItem torusItem;
49265483 private MenuItem superItem;
5484
+ private MenuItem kleinItem;
49275485 private MenuItem blobItem;
49285486 private MenuItem latheItem;
49295487 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5488
+ private MenuItem overlayItem;
49315489 private MenuItem meshItem;
49325490 // private MenuItem meshGroupItem;
49335491 private MenuItem springItem;
....@@ -4936,6 +5494,7 @@
49365494 private MenuItem csgItem;
49375495 private MenuItem templateItem;
49385496 private MenuItem textureItem;
5497
+ private MenuItem billboardItem;
49395498 private MenuItem shadowXItem;
49405499 private MenuItem shadowYItem;
49415500 private MenuItem shadowZItem;
....@@ -4948,11 +5507,6 @@
49485507 private MenuItem doubleItem;
49495508 private MenuItem tripleItem;
49505509
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565510 private MenuItem computeAOItem;
49575511 private MenuItem recompileItem;
49585512 private MenuItem editScriptItem;
....@@ -4962,4 +5516,8 @@
49625516 private MenuItem analyzeItem;
49635517 private MenuItem dumpItem;
49645518 //boolean freezemodel = false;
5519
+
5520
+ Menu cameraMenu;
5521
+ MenuItem editCameraItem;
5522
+ MenuItem revertCameraItem;
49655523 }