Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
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);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
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(GrafreeD.clipboard, false));
107
- GrafreeD.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)GrafreeD.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,17 +304,26 @@
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"));
....@@ -231,52 +334,69 @@
231334 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("GrafreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392531 oe.menuBar.add(menu = new Menu("Tools"));
393532 buildToolsMenu(menu);
394533 }
395534
396535 void SetupUI2(ObjEditor oe)
397536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
398549 //new Exception().printStackTrace();
399550
400551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +574,120 @@
423574 oe.radioPanel.add(dummyButton);
424575 oe.buttonGroup.add(dummyButton);
425576 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429578
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
431605 liveCB.addItemListener(this);
432606
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
451613 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
493617 trackCB.addItemListener(this);
494618
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
497621 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
622
+
499623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500624 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505625
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Show selection");
512635 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516636
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638
+
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
519641 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521643 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
523647 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
525650 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
527653 sevenButton.addActionListener(this);
528654 //
529655
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
531658 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
534662 closeButton.addActionListener(this);
535663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536664 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538665
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
541668 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545669
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
547672 uneditButton.addActionListener(this);
548673
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
561676 allParamsButton.addActionListener(this);
562677
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
568684 unselectButton.addActionListener(this);
569685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
570691 // oe.aConstraints.gridx += 1;
571692 // oe.aConstraints.weighty = 0;
572693 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +699,37 @@
578699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579700 // gcButton.addActionListener(this);
580701
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
592705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594707 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
599711
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
604716 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
607720 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
610724 textureCB.addItemListener(this);
611725
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
614729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
615733 //jList.addListSelectionListener(this);
616734 oe.jTree.addTreeSelectionListener(this);
617735 //jTree.setRootVisible(false);
....@@ -633,20 +751,95 @@
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.addItemListener(this);
812
+
813
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
814
+ lookAtCB.setToolTipText("Look-at target");
815
+ lookAtCB.addItemListener(this);
816
+
817
+ }
818
+
819
+ cGridBag fill = new cGridBag();
820
+
821
+ fill.preferredHeight = 200;
822
+
823
+ panel.add(fill);
824
+
825
+ }
636826
637827 void EditObject(Object3D obj)
638828 {
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();
829
+ cRadio radioButton = new cRadio(obj.name);
830
+ radioButton.SetObject(obj);
831
+ radioButton.layout = sevenButton;
832
+ radioButton.SetCamera(cameraView.renderCamera, false);
833
+ radioButton.addActionListener(this);
834
+ radioPanel.add(radioButton);
835
+ buttonGroup.add(radioButton);
836
+ radioButton.doClick();
647837 }
838
+
648839 void SetupViews(ObjEditor oe)
649840 {
841
+ theFrame = this;
842
+
650843 oe.SetupViews();
651844
652845 System.out.println("SetupViews");
....@@ -663,6 +856,7 @@
663856 JCheckBox fastCB;
664857 JCheckBox slowCB;
665858 JCheckBox boxCB;
859
+ JCheckBox zoomBoxCB;
666860 JCheckBox trackCB;
667861 JCheckBox smoothfocusCB;
668862 // JCheckBox speakerMocapCB;
....@@ -705,10 +899,10 @@
705899 dropAttributes |= Object3D.TEXTURE;
706900 else
707901 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
902
+ } else if(e.getSource() == liveCB)
710903 {
711904 cameraView.ToggleLive();
905
+ refreshContents(false);
712906 }
713907 else if(e.getSource() == supportCB)
714908 {
....@@ -743,6 +937,10 @@
743937 Recompile();
744938 cameraView.repaint();
745939 // refreshContents();
940
+ }
941
+ else if(e.getSource() == zoomBoxCB)
942
+ {
943
+ cameraView.ToggleZoomBoxMode();
746944 }
747945 else if(e.getSource() == smoothfocusCB)
748946 {
....@@ -857,7 +1055,9 @@
8571055 // objEditor.DropFile((java.io.File[]) object, true);
8581056 // return;
8591057 // }
860
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611061 {
8621062 // file(s)
8631063 String[] names = string.split("\n");
....@@ -884,7 +1084,7 @@
8841084
8851085 flashIt = false;
8861086 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891089
8901090 if (group.selection.size() == 1)
....@@ -911,11 +1111,11 @@
9111111 {
9121112 loadClipboard(true);
9131113 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1114
+ pasteInto(false, false);
9151115 } else {
9161116 loadClipboard(false);
9171117 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9191119 }
9201120 }
9211121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1233,37 @@
10331233 torusItem.addActionListener(this);
10341234 superItem = menu.add(new MenuItem("Superellipsoid"));
10351235 superItem.addActionListener(this);
1236
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1237
+ kleinItem.addActionListener(this);
10361238 particleItem = menu.add(new MenuItem("Particle system"));
10371239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10381242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391243 ragdollItem.addActionListener(this);
10401244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411245 ragdoll2Item.addActionListener(this);
1246
+ }
10421247 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441249 meshItem.addActionListener(this);
10451250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10471254 springItem = menu.add(new MenuItem("Spring"));
10481255 springItem.addActionListener(this);
10491256 flagItem = menu.add(new MenuItem("Flag"));
10501257 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);
10551258 blobItem = menu.add(new MenuItem("Blob"));
10561259 blobItem.addActionListener(this);
10571260 latheItem = menu.add(new MenuItem("Lathe"));
10581261 latheItem.addActionListener(this);
1262
+ }
1263
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1264
+ bezierItem.addActionListener(this);
1265
+ overlayItem = menu.add(new MenuItem("Overlay"));
1266
+ overlayItem.addActionListener(this);
10591267 lightItem = menu.add(new MenuItem("Light"));
10601268 lightItem.addActionListener(this);
10611269 menu.add("-");
....@@ -1065,39 +1273,44 @@
10651273 loopItem.addActionListener(this);
10661274 doubleItem = menu.add(new MenuItem("Fork"));
10671275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
10681278 tripleItem = menu.add(new MenuItem("Trident"));
10691279 tripleItem.addActionListener(this);
1280
+ }
10701281 }
10711282
10721283 void buildToolsMenu(Menu menu)
10731284 {
10741285 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751286 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1287
+ animationItem.setState(Globals.ANIMATION);
10771288
10781289 menu.add("-");
10791290 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801291 parseverticesItem.addActionListener(this);
10811292 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821293 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841295 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881297 reduceMorphItem.addActionListener(this);
10891298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901299 reduce34MorphItem.addActionListener(this);
1091
-
1300
+ menu.add("-");
10921301 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931302 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
10961309 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971310 memoryItem.addActionListener(this);
10981311 menu.add(analyzeItem = new MenuItem("Analyze"));
10991312 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11011314 dumpItem.addActionListener(this);
11021315 // menu.add(pathItem = new MenuItem("From-to path"));
11031316 // pathItem.addActionListener(this);
....@@ -1106,6 +1319,8 @@
11061319 resetParentItem.addActionListener(this);
11071320 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081321 repairParentItem.addActionListener(this);
1322
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1323
+ repairShadowItem.addActionListener(this);
11091324 menu.add(invariantsItem = new MenuItem("Invariants"));
11101325 invariantsItem.addActionListener(this);
11111326 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1328,7 @@
11131328 menu.add("-");
11141329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151330 editScriptItem.addActionListener(this);
1331
+ }
11161332 }
11171333
11181334 void ScreenFit()
....@@ -1235,6 +1451,7 @@
12351451 shadow.material = new cMaterial(obj.material);
12361452 shadow.material.diffuse = 0.0001f;
12371453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12381455
12391456 makeSomething(shadow);
12401457 }
....@@ -1441,9 +1658,9 @@
14411658
14421659 void Overwrite(int mask)
14431660 {
1444
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451662 {
1446
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14471664
14481665 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491666 content = ((cGroup)content).get(0);
....@@ -1466,6 +1683,7 @@
14661683 //
14671684 public void actionPerformed(ActionEvent event) // , Object arg)
14681685 {
1686
+ Object source = event.getSource();
14691687 /*
14701688 if (event.getSource() == nameField)
14711689 {
....@@ -1477,11 +1695,11 @@
14771695 }
14781696 else
14791697 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1698
+ if (source == lookAtItem || source == lookFromItem)
14811699 {
14821700 ScreenFit();
14831701 } else
1484
- if (event.getSource() == switchItem)
1702
+ if (source == switchItem)
14851703 {
14861704 cVector v1 = new cVector();
14871705 cVector v2 = new cVector();
....@@ -1490,11 +1708,11 @@
14901708 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911709 objEditor.cameraView.repaint();
14921710 } else
1493
- if (event.getSource() == rectoidItem)
1711
+ if (source == rectoidItem)
14941712 {
14951713 makeSomething(new Box());
14961714 } else
1497
- if (event.getSource() == particleItem)
1715
+ if (source == particleItem)
14981716 {
14991717 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001718 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1733,9 @@
15151733 applyExample(particleGeom, "SMOKE");
15161734 makeSomething(particleGeom);
15171735 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1736
+ if (source == ragdollItem || source == ragdoll2Item)
15191737 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1738
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211739
15221740 ragdoll.toParent = LA.newMatrix();
15231741 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1753,7 @@
15351753 } else
15361754 /*
15371755 */
1538
- if (event.getSource() == heightFieldItem)
1756
+ if (source == heightFieldItem)
15391757 {
15401758 Object3D obj = new Object3D();
15411759
....@@ -1573,27 +1791,31 @@
15731791
15741792 makeSomething(obj);
15751793 } else
1576
- if (event.getSource() == gridItem)
1794
+ if (source == gridItem)
15771795 {
15781796 makeSomething(new Grid());
15791797 } else
1580
- if (event.getSource() == ellipsoidItem)
1798
+ if (source == ellipsoidItem)
15811799 {
15821800 makeSomething(new Sphere());
15831801 } else
1584
- if (event.getSource() == coneItem)
1802
+ if (source == coneItem)
15851803 {
15861804 makeSomething(new Cone());
15871805 } else
1588
- if (event.getSource() == torusItem)
1806
+ if (source == torusItem)
15891807 {
15901808 makeSomething(new Torus());
15911809 } else
1592
- if (event.getSource() == superItem)
1810
+ if (source == superItem)
15931811 {
15941812 makeSomething(new Superellipsoid());
15951813 } else
1596
- if (event.getSource() == blobItem)
1814
+ if (source == kleinItem)
1815
+ {
1816
+ makeSomething(new Klein());
1817
+ } else
1818
+ if (source == blobItem)
15971819 {
15981820 Blob blob = new Blob();
15991821 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1823,15 @@
16011823 //blob.retile();
16021824 makeSomething(blob);
16031825 } else
1604
- if (event.getSource() == latheItem)
1826
+ if (source == latheItem)
16051827 {
16061828 makeSomething(new Lathe());
16071829 } else
1608
- if (event.getSource() == bezierItem)
1830
+ if (source == bezierItem)
16091831 {
16101832 makeSomething(new BezierSurface());
16111833 } else
1612
- if (event.getSource() == checkerItem)
1834
+ if (source == overlayItem)
16131835 {
16141836 /*
16151837 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1846,7 @@
16241846 */
16251847 makeSomething(new Checker());
16261848 } else
1627
- if (event.getSource() == meshItem)
1849
+ if (source == meshItem)
16281850 {
16291851 Object3D itemtomake = new Object3D();
16301852 Object3D child;
....@@ -1645,35 +1867,35 @@
16451867 makeSomething(child);
16461868 }
16471869 } else
1648
- if (event.getSource() == springItem)
1870
+ if (source == springItem)
16491871 {
16501872 cSpring s = new cSpring();
16511873 s.setup();
16521874 makeSomething(s);
16531875 } else
1654
- if (event.getSource() == flagItem)
1876
+ if (source == flagItem)
16551877 {
16561878 cSpring s = new cFlag();
16571879 s.setup();
16581880 makeSomething(s);
16591881 } else
1660
- if (event.getSource() == lightItem)
1882
+ if (source == lightItem)
16611883 {
16621884 makeSomething(new Light());
16631885 } else
1664
- if (event.getSource() == csgItem)
1886
+ if (source == csgItem)
16651887 {
16661888 group(new CSG());
16671889 } else
1668
- if (event.getSource() == templateItem)
1890
+ if (source == templateItem)
16691891 {
16701892 group(new cTemplate());
16711893 } else
1672
- if (event.getSource() == attributeItem)
1894
+ if (source == attributeItem)
16731895 {
16741896 makeSomething(new Attribute());
16751897 } else
1676
- if (event.getSource() == pointflowItem)
1898
+ if (source == pointflowItem)
16771899 {
16781900 makeSomething(new PointFlow());
16791901 } else
....@@ -1685,7 +1907,7 @@
16851907 } else
16861908 */
16871909
1688
- if (event.getSource() == superLoopItem)
1910
+ if (source == superLoopItem)
16891911 {
16901912 Composite g = new cGroup();
16911913 for (int i=0; i<15; i++)
....@@ -1707,7 +1929,7 @@
17071929
17081930 group(g);
17091931 } else
1710
- if (event.getSource() == loopItem)
1932
+ if (source == loopItem)
17111933 {
17121934 Composite csg = new GroupLeaf();
17131935 csg.count = 5;
....@@ -1716,7 +1938,7 @@
17161938 csg.addChild(child);
17171939 child.addChild(csg);
17181940 } else
1719
- if (event.getSource() == doubleItem)
1941
+ if (source == doubleItem)
17201942 {
17211943 Composite csg = new GroupLeaf();
17221944 csg.count = 5;
....@@ -1728,7 +1950,7 @@
17281950 csg.addChild(child);
17291951 child.addChild(csg);
17301952 } else
1731
- if (event.getSource() == tripleItem)
1953
+ if (source == tripleItem)
17321954 {
17331955 Composite csg = new GroupLeaf();
17341956 csg.count = 4;
....@@ -1743,71 +1965,83 @@
17431965 csg.addChild(child);
17441966 child.addChild(csg);
17451967 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1968
+ if (source == computeAOItem)
17481969 {
1749
- ImportGFD();
1970
+ Globals.drawMode = CameraPane.OCCLUSION;
1971
+ Globals.theRenderer.repaint();
17501972 } 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)
1973
+ if (source == recompileItem)
17691974 {
17701975 Recompile();
17711976 refreshContents();
17721977 } else
1773
- if (event.getSource() == editScriptItem)
1978
+ if (source == editScriptItem)
17741979 {
17751980 OpenDialog();
17761981 refreshContents();
17771982 } else
1778
- if (event.getSource() == invariantsItem)
1983
+ if (source == invariantsItem)
17791984 {
17801985 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
17821987 } else
1783
- if (event.getSource() == memoryItem)
1988
+ if (source == memoryItem)
17841989 {
17851990 //System.out.println("Invariants:");
17861991 PrintMemory();
17871992 } else
1788
- if (event.getSource() == pathItem)
1993
+ if (source == pathItem)
17891994 {
17901995 PrintPath();
17911996 } else
1792
- if (event.getSource() == analyzeItem)
1997
+ if (source == analyzeItem)
17931998 {
17941999 AnalyzeObject();
17952000 } else
1796
- if (event.getSource() == dumpItem)
2001
+ if (source == dumpItem)
17972002 {
17982003 DumpObject();
17992004 } else
1800
- if (event.getSource() == screenfitButton)
2005
+ if (source == minButton)
2006
+ {
2007
+ Minimize();
2008
+ } else
2009
+ if (source == maxButton)
2010
+ {
2011
+ Maximize();
2012
+ } else
2013
+ if (source == fullButton)
2014
+ {
2015
+ ToggleFullScreen();
2016
+ } else
2017
+ if (source == undoButton)
2018
+ {
2019
+ Undo();
2020
+ } else
2021
+ if (source == redoButton)
2022
+ {
2023
+ Redo();
2024
+ } else
2025
+ if (source == saveButton)
2026
+ {
2027
+ Save();
2028
+ } else
2029
+ if (source == oneStepButton)
2030
+ {
2031
+ Globals.ONESTEP = true;
2032
+ cameraView.repaint();
2033
+ } else
2034
+ if (source == screenfitButton)
18012035 {
18022036 //Reload(lastConverter, lastFilename, true);
18032037 ScreenFit();
18042038 } else
1805
- if (event.getSource() == screenfitpointButton)
2039
+ if (source == screenfitpointButton)
18062040 {
18072041 //Reload(lastConverter, lastFilename, true);
18082042 ScreenFitPoint();
18092043 } else
1810
- if (event.getSource() == snapobjectButton)
2044
+ if (source == snapobjectButton)
18112045 {
18122046 //Reload(lastConverter, lastFilename, true);
18132047 SnapObject();
....@@ -1818,13 +2052,13 @@
18182052 // Recompile();
18192053 // refreshContents();
18202054 // } else
1821
- if (event.getSource() == gcButton)
2055
+ if (source == gcButton)
18222056 {
18232057 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242058 System.gc();
18252059 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262060 } else
1827
- if (event.getSource() == editLeafItem)
2061
+ if (source == editLeafItem)
18282062 {
18292063 Object3D obj;
18302064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +2072,74 @@
18382072 }
18392073 refreshContents(true);
18402074 } else
1841
- if (event.getSource() == openWindowItem)
2075
+ if (source == openWindowItem)
18422076 {
18432077 EditSelection(true);
18442078 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2079
+ if (source == cutItem || source == clearButton)
18462080 {
18472081 loadClipboard(true);
18482082 } else
1849
- if (event.getSource() == duplicateItem)
2083
+ if (source == undoItem)
18502084 {
1851
- Object3D keep = GrafreeD.clipboard;
2085
+ Undo();
2086
+ } else
2087
+ if (source == redoItem)
2088
+ {
2089
+ Redo();
2090
+ } else
2091
+ if (source == duplicateItem)
2092
+ {
2093
+ Object3D keep = Grafreed.clipboard;
18522094 loadClipboard(false);
18532095 paste(false);
1854
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
18552097 } else
1856
- if (event.getSource() == cloneItem)
2098
+ if (source == cloneItem)
18572099 {
18582100 CloneSelection(false);
18592101 } else
1860
- if (event.getSource() == cloneSupportItem)
2102
+ if (source == cloneSupportItem)
18612103 {
18622104 CloneSelection(true);
18632105 } else
1864
- if (event.getSource() == copyItem)
2106
+ if (source == copyItem)
18652107 {
18662108 loadClipboard(false);
18672109 } else
1868
- if (event.getSource() == pasteItem)
2110
+ if (source == pasteItem)
18692111 {
18702112 paste(false);
18712113 } else
1872
- if (event.getSource() == pasteLinkItem)
2114
+ if (source == pasteIntoItem)
18732115 {
1874
- pasteInto(false);
2116
+ pasteInto(true, false);
18752117 } else
1876
- if (event.getSource() == pasteCloneItem)
2118
+ if (source == pasteLinkItem)
18772119 {
1878
- pasteInto(true);
2120
+ pasteInto(false, false);
18792121 } else
1880
- if (event.getSource() == pasteExpandItem)
2122
+ if (source == pasteCloneItem)
2123
+ {
2124
+ pasteInto(true, true);
2125
+ } else
2126
+ if (source == pasteExpandItem)
18812127 {
18822128 paste(true);
18832129 } else
1884
- if (event.getSource() == synchronizeItem)
2130
+ if (source == synchronizeItem)
18852131 {
18862132 Overwrite(Object3D.TRANSFORM);
18872133 } else
1888
- if (event.getSource() == overwriteNameItem)
2134
+ if (source == overwriteNameItem)
18892135 {
18902136 Overwrite(Object3D.NAME);
18912137 } else
1892
- if (event.getSource() == overwriteUVItem)
2138
+ if (source == overwriteUVItem)
18932139 {
18942140 Overwrite(Object3D.UV);
18952141 } else
1896
- if (event.getSource() == overwriteMatItem)
2142
+ if (source == overwriteMatItem)
18972143 {
18982144 /* july 2015
18992145 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2159,7 @@
19132159
19142160 Overwrite(dropAttributes);
19152161 }
1916
- if (event.getSource() == overwriteGeoItem)
2162
+ if (source == overwriteGeoItem)
19172163 {
19182164 Overwrite(Object3D.GEOMETRY);
19192165 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2176,7 @@
19302176 // refreshContents();
19312177 // }
19322178 } else
1933
- if (event.getSource() == generateMeshItem)
2179
+ if (source == generateMeshItem)
19342180 {
19352181 //if (group.selection.size() == 1)
19362182 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2187,7 @@
19412187 ResetModel();
19422188 refreshContents();
19432189 } else
1944
- if (event.getSource() == extractGeometriesItem)
2190
+ if (source == extractGeometriesItem)
19452191 {
19462192 boolean one = false;
19472193
....@@ -1968,7 +2214,7 @@
19682214 ResetModel();
19692215 refreshContents();
19702216 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2217
+ if (source == cloneGeometriesItem)
19722218 {
19732219 boolean one = false;
19742220
....@@ -1994,32 +2240,37 @@
19942240 ResetModel();
19952241 refreshContents();
19962242 } else
1997
- if (event.getSource() == shareGeometriesItem)
2243
+ if (source == shareGeometriesItem)
19982244 {
19992245 boolean one = false;
20002246
20012247 if (group.selection.size() == 1)
20022248 one = true;
20032249
2250
+ Object3D merge = null;
2251
+
20042252 Object3D content = new cGroup();
20052253
20062254 for (int i=0; i<group.selection.size(); i++)
20072255 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2256
+ merge = new Merge(group.selection.get(i));
20092257
20102258 if (one)
2011
- makeSomething(sel, false);
2259
+ makeSomething(merge, false);
20122260 else
2013
- content.addChild(sel);
2261
+ content.addChild(merge);
20142262 }
20152263
20162264 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2265
+ makeSomething(content, true);
2266
+ else
2267
+ {
2268
+ ResetModel();
2269
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2270
+ refreshContents();
2271
+ }
20212272 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2273
+ if (source == mergeGeometriesItem)
20232274 {
20242275 boolean one = false;
20252276
....@@ -2049,7 +2300,7 @@
20492300 ResetModel();
20502301 refreshContents();
20512302 } else
2052
- if (event.getSource() == linkverticesItem)
2303
+ if (source == linkverticesItem)
20532304 {
20542305 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552306 // {
....@@ -2062,39 +2313,48 @@
20622313 // group.selection.get(0).setMasterThis(content); // should be identity
20632314 // refreshContents();
20642315 // }
2065
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20662317 {
2067
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
20682319
20692320 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702321 content = ((cGroup)content).get(0);
20712322
2072
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2323
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20732324 for (int i=0; i<group.selection.size(); i++)
20742325 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
20772328 group.selection.get(i).linkVerticesThis(content);
20782329 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
20802331 }
2081
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2332
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20822333 refreshContents();
20832334 }
20842335 } else
2085
- if (event.getSource() == resetsupportItem)
2336
+ if (source == resetsupportItem)
20862337 {
20872338 for (int i=0; i<group.selection.size(); i++)
20882339 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
20912342 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
20932344 }
20942345
20952346 refreshContents();
20962347 } else
2097
- if (event.getSource() == resetreferencesItem)
2348
+ if (source == relinkverticesItem)
2349
+ {
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
2352
+ group.selection.RelinkToSupport();
2353
+ CameraPane.SWITCH = random;
2354
+
2355
+ refreshContents();
2356
+ } else
2357
+ if (source == resetreferencesItem)
20982358 {
20992359 for (int i=0; i<group.selection.size(); i++)
21002360 {
....@@ -2103,11 +2363,11 @@
21032363
21042364 refreshContents();
21052365 } else
2106
- if (event.getSource() == setMasterItem)
2366
+ if (source == setMasterItem)
21072367 {
2108
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21092369 {
2110
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
21112371
21122372 if (content instanceof cGroup && ((cGroup)content).transientlink )
21132373 content = ((cGroup)content).get(0);
....@@ -2116,13 +2376,13 @@
21162376 refreshContents();
21172377 }
21182378 } else
2119
- if (event.getSource() == poseMeshItem)
2379
+ if (source == poseMeshItem)
21202380 {
21212381 if (group.selection.size() == 1)
21222382 {
2123
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
21242384 {
2125
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
21262386
21272387 if (content instanceof cGroup && ((cGroup)content).transientlink )
21282388 content = ((cGroup)content).get(0);
....@@ -2135,19 +2395,19 @@
21352395 }
21362396
21372397 } else
2138
- if (event.getSource() == revertMeshItem)
2398
+ if (source == revertMeshItem)
21392399 {
21402400 RevertMeshes();
21412401 } else
2142
- if (event.getSource() == resetMeshItem)
2402
+ if (source == resetAllItem)
21432403 {
21442404 ResetAll();
21452405 } else
2146
- if (event.getSource() == stepAllItem)
2406
+ if (source == stepAllItem)
21472407 {
21482408 StepAll();
21492409 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2410
+ if (source == clearItem) // || event.getSource() == clearButton)
21512411 {
21522412 //int indices[] = jList.getSelectedIndices();
21532413 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2415,46 @@
21552415
21562416 ClearSelection(false);
21572417 } else
2158
- if (event.getSource() == clearAllItem)
2418
+ if (source == clearAllItem)
21592419 {
21602420 ClearSelection(true);
21612421 } else
2162
- if (event.getSource() == grabItem)
2422
+ if (source == grabItem)
21632423 {
21642424 group(new cGroup(), true);
21652425 } else
2166
- if (event.getSource() == frontItem)
2426
+ if (source == hideItem)
2427
+ {
2428
+ group(new HiddenObject());
2429
+ } else
2430
+ if (source == frontItem)
21672431 {
21682432 front();
21692433 } else
2170
- if (event.getSource() == backItem)
2434
+ if (source == backItem)
21712435 {
21722436 back();
21732437 } else
2174
- if (event.getSource() == cameraItem)
2438
+ if (source == cameraItem)
21752439 {
21762440 makeSomething(new Camera());
21772441 } else
2178
- if (event.getSource() == compositeItem)
2442
+ if (source == compositeItem)
21792443 {
21802444 group(new Composite());
21812445 } else
2182
- if (event.getSource() == randomItem)
2446
+ if (source == randomItem)
21832447 {
21842448 RandomNode random = new RandomNode();
21852449 group(random);
21862450 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
21882452 } else
2189
- if (event.getSource() == physicsItem)
2453
+ if (source == physicsItem)
21902454 {
21912455 group(new PhysicsNode());
21922456 } else
2193
- if (event.getSource() == frameselectorItem)
2457
+ if (source == frameselectorItem)
21942458 {
21952459 for (int i=0; i<group.selection.size(); i++)
21962460 {
....@@ -2202,7 +2466,7 @@
22022466 ResetModel();
22032467 refreshContents();
22042468 } else
2205
- if (event.getSource() == switchGeoItem)
2469
+ if (source == switchGeoItem)
22062470 {
22072471 for (int i=0; i<group.selection.size(); i++)
22082472 {
....@@ -2214,7 +2478,7 @@
22142478 ResetModel();
22152479 refreshContents();
22162480 } else
2217
- if (event.getSource() == switchTransfoItem)
2481
+ if (source == switchTransfoItem)
22182482 {
22192483 for (int i=0; i<group.selection.size(); i++)
22202484 {
....@@ -2226,7 +2490,7 @@
22262490 ResetModel();
22272491 refreshContents();
22282492 } else
2229
- if (event.getSource() == morphItem)
2493
+ if (source == morphItem)
22302494 {
22312495 for (int i=0; i<group.selection.size(); i++)
22322496 {
....@@ -2238,7 +2502,7 @@
22382502 ResetModel();
22392503 refreshContents();
22402504 } else
2241
- if (event.getSource() == scriptNodeItem)
2505
+ if (source == scriptNodeItem)
22422506 {
22432507 boolean atleastone = false;
22442508
....@@ -2277,195 +2541,239 @@
22772541 }
22782542 }
22792543 } else
2280
- if (event.getSource() == linkerItem)
2544
+ if (source == linkerItem)
22812545 {
22822546 group(new cLinker());
22832547 } else
2284
- if (event.getSource() == textureItem)
2548
+ if (source == textureItem)
22852549 {
22862550 group(new TextureNode());
22872551 } else
2288
- if (event.getSource() == shadowXItem)
2552
+ if (source == billboardItem)
2553
+ {
2554
+ group(new BillboardNode());
2555
+ } else
2556
+ if (source == shadowXItem)
22892557 {
22902558 CastShadow(0);
22912559 } else
2292
- if (event.getSource() == shadowYItem)
2560
+ if (source == shadowYItem)
22932561 {
22942562 CastShadow(1);
22952563 } else
2296
- if (event.getSource() == shadowZItem)
2564
+ if (source == shadowZItem)
22972565 {
22982566 CastShadow(2);
22992567 } else
2300
- if (event.getSource() == ungroupItem)
2568
+ if (source == ungroupItem)
23012569 {
2302
- ungroup();
2570
+ //ungroup();
2571
+ for (int i=0; i<group.selection.size(); i++)
2572
+ {
2573
+ Ungroup(group.selection.get(i));
2574
+ }
2575
+
2576
+ ClearSelection(false);
2577
+
2578
+ refreshContents();
23032579 } else
2304
- if (event.getSource() == genUVItem)
2580
+ if (source == genUVItem)
23052581 {
23062582 GenUV();
23072583 } else
2308
- if (event.getSource() == genNormalsCADItem)
2584
+ if (source == genNormalsCADItem)
23092585 {
23102586 GenNormals(true);
23112587 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2588
+ if (source == genNormalsMESHItem)
2589
+ {
2590
+ GenNormalsMESH();
2591
+ } else
2592
+ if (source == genNormalsORGANItem)
23132593 {
23142594 GenNormals(false);
23152595 } else
2316
- if (event.getSource() == stripifyItem)
2596
+ if (source == genNormalsMINEItem)
2597
+ {
2598
+ GenNormalsMINE();
2599
+ } else
2600
+ if (source == stripifyItem)
23172601 {
23182602 Stripify();
23192603 } else
2320
- if (event.getSource() == unstripifyItem)
2604
+ if (source == unstripifyItem)
23212605 {
23222606 Unstripify();
23232607 } else
2324
- if (event.getSource() == trimItem)
2608
+ if (source == trimItem)
23252609 {
23262610 Trim();
23272611 } else
2328
- if (event.getSource() == untrimItem)
2612
+ if (source == untrimItem)
23292613 {
23302614 Untrim();
23312615 } else
2332
- if (event.getSource() == clearColorsItem)
2616
+ if (source == clearColorsItem)
23332617 {
23342618 ClearColors();
23352619 } else
2336
- if (event.getSource() == clearMaterialsItem)
2620
+ if (source == clearMaterialsItem)
23372621 {
23382622 ClearMaterials();
23392623 } else
2340
- if (event.getSource() == liveleavesItem)
2624
+ if (source == liveleavesItem)
23412625 {
23422626 LiveLeaves(true);
23432627 } else
2344
- if (event.getSource() == unliveleavesItem)
2628
+ if (source == unliveleavesItem)
23452629 {
23462630 LiveLeaves(false);
23472631 } else
2348
- if (event.getSource() == supportleavesItem)
2632
+ if (source == supportleavesItem)
23492633 {
23502634 SupportLeaves(true);
23512635 } else
2352
- if (event.getSource() == unsupportleavesItem)
2636
+ if (source == unsupportleavesItem)
23532637 {
23542638 SupportLeaves(false);
23552639 } else
2356
- if (event.getSource() == hideleavesItem)
2640
+ if (source == hideleavesItem)
23572641 {
23582642 HideLeaves(true);
23592643 } else
2360
- if (event.getSource() == showleavesItem)
2644
+ if (source == showleavesItem)
23612645 {
23622646 HideLeaves(false);
23632647 } else
2364
- if (event.getSource() == markleavesItem)
2648
+ if (source == markleavesItem)
23652649 {
23662650 MarkLeaves(true);
23672651 } else
2368
- if (event.getSource() == unmarkleavesItem)
2652
+ if (source == unmarkleavesItem)
23692653 {
23702654 MarkLeaves(false);
23712655 } else
2372
- if (event.getSource() == flipVItem)
2656
+ if (source == rewindleavesItem)
2657
+ {
2658
+ RewindLeaves(true);
2659
+ } else
2660
+ if (source == unrewindleavesItem)
2661
+ {
2662
+ RewindLeaves(false);
2663
+ } else
2664
+ if (source == randomleavesItem)
2665
+ {
2666
+ RandomLeaves(true);
2667
+ } else
2668
+ if (source == unrandomleavesItem)
2669
+ {
2670
+ RandomLeaves(false);
2671
+ } else
2672
+ if (source == flipVItem)
23732673 {
23742674 FlipV(true);
23752675 } else
2376
- if (event.getSource() == unflipVItem)
2676
+ if (source == unflipVItem)
23772677 {
23782678 FlipV(false);
23792679 } else
2380
- if (event.getSource() == lowTexturesItem)
2680
+ if (source == lowTexturesItem)
23812681 {
23822682 SetTexRes(0);
23832683 } else
2384
- if (event.getSource() == normalTexturesItem)
2684
+ if (source == normalTexturesItem)
23852685 {
23862686 SetTexRes(1);
23872687 } else
2388
- if (event.getSource() == highTexturesItem)
2688
+ if (source == highTexturesItem)
23892689 {
23902690 SetTexRes(2);
23912691 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2692
+ if (source == veryhighTexturesItem)
23932693 {
23942694 SetTexRes(3);
23952695 } else
2396
- if (event.getSource() == maxTexturesItem)
2696
+ if (source == maxTexturesItem)
23972697 {
23982698 SetTexRes(4);
23992699 } else
2400
- if (event.getSource() == panoTexturesItem)
2700
+ if (source == panoTexturesItem)
24012701 {
24022702 SetTexRes(5);
24032703 } else
2404
- if (event.getSource() == reverseNormalsItem)
2704
+ if (source == reverseNormalsItem)
24052705 {
24062706 ReverseNormals();
24072707 } else
2408
- if (event.getSource() == parseverticesItem)
2708
+ if (source == parseverticesItem)
24092709 {
24102710 ParseVertices();
24112711 } else
2412
- if (event.getSource() == textureFieldItem)
2712
+ if (source == textureFieldItem)
24132713 {
24142714 TextureVertices();
24152715 } else
2416
- if (event.getSource() == alignItem)
2716
+ if (source == alignItem)
24172717 {
24182718 Align();
24192719 } else
2420
- if (event.getSource() == mirrorItem)
2720
+ if (source == mirrorItem)
24212721 {
24222722 MirrorPoses();
24232723 } else
2424
- if (event.getSource() == reduceMorphItem)
2724
+ if (source == reduceMorphItem)
24252725 {
24262726 MeshReduction(false);
24272727 } else
2428
- if (event.getSource() == reduce34MorphItem)
2728
+ if (source == reduce34MorphItem)
24292729 {
24302730 MeshReduction(true);
24312731 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2732
+ if (source == reverseTrianglesItem)
24332733 {
24342734 ReverseTriangles();
24352735 } else
2436
- if (event.getSource() == reduceMeshItem)
2736
+ if (source == reduceMeshItem)
24372737 {
24382738 ReduceMesh(false);
24392739 } else
2440
- if (event.getSource() == reduce34MeshItem)
2740
+ if (source == reduce34MeshItem)
24412741 {
24422742 ReduceMesh(true);
24432743 } else
2444
- if (event.getSource() == increaseMeshItem)
2744
+ if (source == increaseMeshItem)
24452745 {
24462746 IncreaseMesh();
24472747 } else
2448
- if (event.getSource() == clipMeshItem)
2748
+ if (source == clipMeshItem)
24492749 {
24502750 ClipMesh();
24512751 } else
2452
- if (event.getSource() == smoothMeshItem)
2752
+ if (source == smoothMeshItem)
24532753 {
24542754 SmoothMesh();
24552755 } else
2456
- if (event.getSource() == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
24572757 {
24582758 TransformGeometry();
24592759 } else
2460
- if (event.getSource() == resetTransformItem)
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
2763
+ } else
2764
+ if (source == resetTransformItem)
24612765 {
24622766 ResetTransform();
24632767 } else
2464
- if (event.getSource() == resetCentroidItem)
2768
+ if (source == resetCentroidItem)
24652769 {
2466
- ResetCentroid();
2770
+ ResetCentroid(true);
24672771 } else
2468
- if (event.getSource() == resetParentItem)
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
2775
+ } else
2776
+ if (source == resetParentItem)
24692777 {
24702778 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712779 {
....@@ -2475,7 +2783,7 @@
24752783
24762784 refreshContents();
24772785 } else
2478
- if (event.getSource() == repairParentItem)
2786
+ if (source == repairParentItem)
24792787 {
24802788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812789 {
....@@ -2489,7 +2797,21 @@
24892797
24902798 refreshContents();
24912799 } else
2492
- if (event.getSource() == sortbysizeItem)
2800
+ if (source == repairShadowItem)
2801
+ {
2802
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2803
+ {
2804
+ Object3D obj = (Object3D)e.nextElement();
2805
+ obj.RepairShadow();
2806
+// for (int i=0; i<obj.size(); i++)
2807
+// {
2808
+// obj.get(i).parent = obj;
2809
+// }
2810
+ }
2811
+
2812
+ refreshContents();
2813
+ } else
2814
+ if (source == sortbysizeItem)
24932815 {
24942816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952817 {
....@@ -2501,7 +2823,7 @@
25012823 ResetModel();
25022824 refreshContents();
25032825 } else
2504
- if (event.getSource() == sortbynameItem)
2826
+ if (source == sortbynameItem)
25052827 {
25062828 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072829 {
....@@ -2513,7 +2835,7 @@
25132835 ResetModel();
25142836 refreshContents();
25152837 } else
2516
- if (event.getSource() == attachPigmentItem)
2838
+ if (source == attachPigmentItem)
25172839 {
25182840 String texture = GetFile("Attach pigment");
25192841 Object3D obj;
....@@ -2525,7 +2847,7 @@
25252847
25262848 refreshContents();
25272849 } else
2528
- if (event.getSource() == detachPigmentItem)
2850
+ if (source == detachPigmentItem)
25292851 {
25302852 Object3D obj;
25312853 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2858,7 @@
25362858
25372859 refreshContents();
25382860 } else
2539
- if (event.getSource() == attachBumpItem)
2861
+ if (source == attachBumpItem)
25402862 {
25412863 String texture = GetFile("Attach bump");
25422864 Object3D obj;
....@@ -2548,7 +2870,7 @@
25482870
25492871 refreshContents();
25502872 } else
2551
- if (event.getSource() == detachBumpItem)
2873
+ if (source == detachBumpItem)
25522874 {
25532875 Object3D obj;
25542876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2881,7 @@
25592881
25602882 refreshContents();
25612883 } else
2562
- if (event.getSource() == pigmentBumpItem)
2884
+ if (source == pigmentBumpItem)
25632885 {
25642886 Object3D obj;
25652887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2892,221 @@
25702892
25712893 refreshContents();
25722894 } else
2573
- if (event.getSource() == flashSelectionButton)
2895
+ if (source == flashSelectionButton)
25742896 {
25752897 CameraPane.flash = true;
25762898 refreshContents();
25772899 } else
2578
- if (event.getSource() == oneButton)
2900
+ if (source == oneButton)
25792901 {
25802902 } else
2581
- if (event.getSource() == twoButton)
2903
+ if (source == twoButton)
25822904 {
25832905 radio.layout = twoButton;
25842906 // bug
25852907 //gridPanel.setDividerLocation(1.0);
25862908 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- bigThree.revalidate();
2909
+// bigThree.remove(scenePanel);
2910
+// bigThree.remove(centralPanel);
2911
+// bigThree.remove(XYZPanel);
2912
+// aWindowConstraints.gridx = 0;
2913
+// aWindowConstraints.gridy = 0;
2914
+// aWindowConstraints.gridwidth = 1;
2915
+// // aConstraints.gridheight = 3;
2916
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2917
+// aWindowConstraints.weightx = 0;
2918
+// aWindowConstraints.weighty = 1;
2919
+// //bigThree.add(jtp, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 1;
2921
+// aWindowConstraints.gridwidth = 3;
2922
+// // aConstraints.gridheight = 3;
2923
+// aWindowConstraints.gridx = 1;
2924
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2925
+// bigThree.add(centralPanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 0;
2927
+// aWindowConstraints.gridx = 4;
2928
+// aWindowConstraints.gridwidth = 1;
2929
+// // aConstraints.gridheight = 3;
2930
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2931
+// //bigThree.add(XYZPanel, aWindowConstraints);
2932
+// scenePanel.setVisible(false);
2933
+// centralPanel.setVisible(true);
2934
+// XYZPanel.setVisible(false);
2935
+ bigThree.ClearUI();
2936
+ bigThree.add(centralPanel);
2937
+ bigThree.FlushUI();
2938
+
2939
+ cameraView.requestFocusInWindow();
2940
+
2941
+// refreshContents(true);
2942
+//
2943
+// try
2944
+// {
2945
+// java.awt.Robot bot = new java.awt.Robot();
2946
+// int mask = InputEvent.BUTTON1_MASK;
2947
+// bot.mouseMove(100, 100);
2948
+// bot.mousePress(mask);
2949
+// bot.mouseRelease(mask);
2950
+// }
2951
+// catch (Exception e)
2952
+// {
2953
+//
2954
+// }
2955
+
26112956 } else
2612
- if (event.getSource() == threeButton)
2957
+ if (source == threeButton)
26132958 {
26142959 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- bigThree.revalidate();
2960
+
2961
+// bigThree.remove(scenePanel);
2962
+// bigThree.remove(centralPanel);
2963
+// bigThree.remove(XYZPanel);
2964
+// aWindowConstraints.gridx = 0;
2965
+// aWindowConstraints.gridy = 0;
2966
+// aWindowConstraints.gridwidth = 1;
2967
+// // aConstraints.gridheight = 3;
2968
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2969
+// aWindowConstraints.weightx = 0;
2970
+// aWindowConstraints.weighty = 1;
2971
+// //bigThree.add(jtp, aWindowConstraints);
2972
+// aWindowConstraints.weightx = 1;
2973
+// aWindowConstraints.gridwidth = 3;
2974
+// // aConstraints.gridheight = 3;
2975
+// aWindowConstraints.gridx = 1;
2976
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2977
+// bigThree.add(centralPanel, aWindowConstraints);
2978
+// aWindowConstraints.weightx = 0;
2979
+// aWindowConstraints.gridx = 4;
2980
+// aWindowConstraints.gridwidth = 1;
2981
+// // aConstraints.gridheight = 3;
2982
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2983
+// bigThree.add(XYZPanel, aWindowConstraints);
2984
+// bigThree.validate();
2985
+// scenePanel.setVisible(false);
2986
+// centralPanel.setVisible(true);
2987
+// XYZPanel.setVisible(true);
2988
+ bigThree.ClearUI();
2989
+ bigThree.add(centralPanel);
2990
+ bigThree.add(XYZPanel);
2991
+ bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
26392994 } else
2640
- if (event.getSource() == fourButton)
2995
+ if (source == fourButton)
26412996 {
26422997 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
2998
+
2999
+// bigThree.remove(scenePanel);
3000
+// bigThree.remove(centralPanel);
3001
+// bigThree.remove(XYZPanel);
3002
+// aWindowConstraints.gridx = 0;
3003
+// aWindowConstraints.gridy = 0;
3004
+// aWindowConstraints.gridwidth = 1;
3005
+// // aWindowConstraints.gridheight = 3;
3006
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3007
+// aWindowConstraints.weightx = 1;
3008
+// aWindowConstraints.weighty = 1;
3009
+// bigThree.add(scenePanel, aWindowConstraints);
3010
+// aWindowConstraints.weightx = 1;
3011
+// aWindowConstraints.gridwidth = 3;
3012
+// // aConstraints.gridheight = 3;
3013
+// aWindowConstraints.gridx = 1;
3014
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3015
+// //bigThree.add(cameraPanel, aWindowConstraints);
3016
+// aWindowConstraints.weightx = 0;
3017
+// aWindowConstraints.gridx = 4;
3018
+// aWindowConstraints.gridwidth = 1;
3019
+// // aWindowConstraints.gridheight = 3;
3020
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3021
+// //bigThree.add(XYZPanel, aWindowConstraints);
3022
+// bigThree.validate();
3023
+// scenePanel.setVisible(true);
3024
+// centralPanel.setVisible(false);
3025
+// XYZPanel.setVisible(false);
3026
+ bigThree.ClearUI();
3027
+ bigThree.add(scenePanel);
3028
+ bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
26673031 } else
2668
- if (event.getSource() == sixButton)
3032
+ if (source == sixButton)
26693033 {
26703034 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- bigThree.revalidate();
3035
+
3036
+// bigThree.remove(scenePanel);
3037
+// bigThree.remove(centralPanel);
3038
+// bigThree.remove(XYZPanel);
3039
+// aWindowConstraints.gridx = 0;
3040
+// aWindowConstraints.gridy = 0;
3041
+// aWindowConstraints.gridwidth = 1;
3042
+// // aConstraints.gridheight = 3;
3043
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3044
+// aWindowConstraints.weightx = 0;
3045
+// aWindowConstraints.weighty = 1;
3046
+// bigThree.add(scenePanel, aWindowConstraints);
3047
+// aWindowConstraints.weightx = 1;
3048
+// aWindowConstraints.gridwidth = 3;
3049
+// // aWindowConstraints.gridheight = 3;
3050
+// aWindowConstraints.gridx = 1;
3051
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3052
+// bigThree.add(centralPanel, aWindowConstraints);
3053
+// aWindowConstraints.weightx = 0;
3054
+// aWindowConstraints.gridx = 4;
3055
+// aWindowConstraints.gridwidth = 1;
3056
+// // aWindowConstraints.gridheight = 3;
3057
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3058
+// //bigThree.add(XYZPanel, aConstraints);
3059
+// bigThree.validate();
3060
+// scenePanel.setVisible(true);
3061
+// centralPanel.setVisible(true);
3062
+// XYZPanel.setVisible(false);
3063
+ bigThree.ClearUI();
3064
+ bigThree.add(scenePanel);
3065
+ bigThree.add(centralPanel);
3066
+ bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
26953069 } else
2696
- if (event.getSource() == sevenButton)
3070
+ if (source == sevenButton)
26973071 {
26983072 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
3073
+
3074
+// bigThree.remove(scenePanel);
3075
+// bigThree.remove(centralPanel);
3076
+// bigThree.remove(XYZPanel);
3077
+// aWindowConstraints.gridx = 0;
3078
+// aWindowConstraints.gridy = 0;
3079
+// aWindowConstraints.gridwidth = 1;
3080
+// // aWindowConstraints.gridheight = 3;
3081
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3082
+// aWindowConstraints.weightx = 0;
3083
+// aWindowConstraints.weighty = 1;
3084
+// bigThree.add(scenePanel, aWindowConstraints);
3085
+// aWindowConstraints.weightx = 1;
3086
+// aWindowConstraints.gridwidth = 3;
3087
+// // aWindowConstraints.gridheight = 3;
3088
+// aWindowConstraints.gridx = 1;
3089
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3090
+// bigThree.add(centralPanel, aWindowConstraints);
3091
+// aWindowConstraints.weightx = 0;
3092
+// aWindowConstraints.gridx = 4;
3093
+// aWindowConstraints.gridwidth = 1;
3094
+// // aConstraints.gridheight = 3;
3095
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3096
+// bigThree.add(XYZPanel, aWindowConstraints);
3097
+// bigThree.validate();
3098
+// scenePanel.setVisible(true);
3099
+// centralPanel.setVisible(true);
3100
+// XYZPanel.setVisible(true);
3101
+ bigThree.ClearUI();
3102
+ bigThree.add(scenePanel);
3103
+ bigThree.add(centralPanel);
3104
+ bigThree.add(XYZPanel);
3105
+ bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
27233108 } else
2724
- if (event.getSource() == rootButton)
3109
+ if (source == rootButton)
27253110 {
27263111 Object3D obj;
27273112 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2731,9 +3116,10 @@
27313116 EditObject(obj);
27323117 }
27333118
3119
+ cameraView.requestFocusInWindow();
27343120 refreshContents(true);
27353121 } else
2736
- if (event.getSource() == closeButton)
3122
+ if (source == closeButton)
27373123 {
27383124 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27393125 cRadio ab;
....@@ -2752,13 +3138,15 @@
27523138 break;
27533139 }
27543140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
27553143 refreshContents(true);
27563144 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
3145
+ if (source == editItem || source == editButton)
27583146 {
27593147 EditSelection(false);
27603148 } else
2761
- if (event.getSource() == uneditButton)
3149
+ if (source == uneditButton)
27623150 {
27633151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27643152 {
....@@ -2768,14 +3156,14 @@
27683156 child.CloseUI();
27693157 listUI.remove(child);
27703158
2771
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
27723160 }
2773
- objEditor.ctrlPanel.revalidate();
3161
+ objEditor.ctrlPanel.FlushUI();
27743162 //objEditor.jTree.clearSelection();
27753163 //objEditor.ResetSliders();
27763164 refreshContents(true);
27773165 } else
2778
- if (event.getSource() == clearPanelButton)
3166
+ if (source == clearPanelButton)
27793167 {
27803168 assert(copy == group);
27813169 //copy.ClearUI();
....@@ -2786,7 +3174,7 @@
27863174 listUI.clear();
27873175 refreshContents(true);
27883176 } else
2789
- if (event.getSource() == allParamsButton)
3177
+ if (source == allParamsButton)
27903178 {
27913179 assert(copy == group);
27923180
....@@ -2807,19 +3195,19 @@
28073195
28083196 refreshContents(true);
28093197 } else
2810
- if (event.getSource() == unselectButton)
3198
+ if (source == unselectButton)
28113199 {
28123200 objEditor.jTree.clearSelection();
28133201 // ?? oct 2012 GrafreeD.clipboard.clear();
28143202 objEditor.ResetSliders();
28153203 refreshContents(true);
28163204 } else
2817
- if(event.getSource() instanceof cRadio)
3205
+ if(source instanceof cRadio)
28183206 {
28193207 group.parent = keepparent;
28203208 group.attributes = 0;
28213209 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3210
+ /*cRadio*/ radio = (cRadio)source;
28233211 Object3D obj = radio.GetObject();
28243212 System.out.println("Edit " + obj);
28253213 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3227,7 @@
28393227 }
28403228
28413229 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3230
+ //Globals.theRenderer.object = group;
28433231 if(!useclient)
28443232 {
28453233 cameraView.renderCamera = radio.camera;
....@@ -2848,12 +3236,16 @@
28483236 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493237 cameraView.targetLookAt.set(radio.camera.lookAt);
28503238 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3239
+ //cameraView.lighttouched = true;
3240
+ Globals.lighttouched = true;
28523241 topView.object = group;
28533242 frontView.object = group;
28543243 sideView.object = group;
28553244 }
2856
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
28573249 /*
28583250 currentLayout = radio.layout;
28593251 if (currentLayout == null)
....@@ -2865,8 +3257,23 @@
28653257 //group.parent = null; // ROOT
28663258 //group.attributes = -1;
28673259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
28683262 refreshContents(true);
2869
- }
3263
+ } else if (event.getSource() == editCameraItem)
3264
+ {
3265
+ cameraView.ProtectCamera();
3266
+ cameraView.repaint();
3267
+ return;
3268
+ } else if (event.getSource() == revertCameraItem)
3269
+ {
3270
+ cameraView.RevertCamera();
3271
+ cameraView.repaint();
3272
+ return;
3273
+ // } else if (event.getSource() == textureButton)
3274
+ // {
3275
+ // return; // true;
3276
+ }
28703277 else
28713278 {
28723279 //return super.action(event, arg);
....@@ -2875,7 +3282,6 @@
28753282 }
28763283
28773284 boolean useclient = false;
2878
- cRadio radio;
28793285
28803286 void ToggleRoot()
28813287 {
....@@ -2884,7 +3290,7 @@
28843290 if (useclient)
28853291 {
28863292 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3293
+ Globals.lighttouched = true;
28883294 //topView.object = client;
28893295 //frontView.object = client;
28903296 //sideView.object = client;
....@@ -2892,7 +3298,7 @@
28923298 else
28933299 {
28943300 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3301
+ Globals.lighttouched = true;
28963302 //topView.object = group;
28973303 //frontView.object = group;
28983304 //sideView.object = group;
....@@ -2927,6 +3333,28 @@
29273333 refreshContents();
29283334 }
29293335
3336
+ void TransformChildren()
3337
+ {
3338
+ Object3D obj;
3339
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3340
+ {
3341
+ obj = (Object3D)e.nextElement();
3342
+ obj.KeepTextureMatrices();
3343
+ obj.TransformChildren();
3344
+ obj.RestoreTextureMatrices();
3345
+
3346
+// if (obj.parent == null)
3347
+// {
3348
+// System.out.println("NULL PARENT!");
3349
+// new Exception().printStackTrace();
3350
+// }
3351
+// else
3352
+// TouchTransform(obj);
3353
+// //obj.parent.Touch();
3354
+ }
3355
+
3356
+ refreshContents();
3357
+ }
29303358
29313359 void ResetTransform()
29323360 {
....@@ -3039,7 +3467,7 @@
30393467 refreshContents();
30403468 }
30413469
3042
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
30433471 {
30443472 Object3D obj;
30453473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3054,12 +3482,16 @@
30543482 LA.matIdentity(Object3D.mat);
30553483 obj.getBounds(minima, maxima, false);
30563484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30583487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30593488 obj.TransformMesh(Object3D.mat);
3489
+
30603490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3061
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30623493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
30633495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30643496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30653497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3088,7 +3520,8 @@
30883520
30893521 int size = obj.MemorySize();
30903522
3091
- System.err.println((size/1024) + " KB is the size of " + obj);
3523
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3524
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30923525 }
30933526 }
30943527 catch (Exception e)
....@@ -3125,9 +3558,9 @@
31253558 obj = (Object3D)e.nextElement();
31263559
31273560 System.out.println("Object is: " + obj);
3128
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
31293562 System.out.println("Boundary rep: " + obj.bRep);
3130
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
31313564
31323565 // System.err.println((size/1024) + " KB is the size of " + obj);
31333566 }
....@@ -3169,6 +3602,20 @@
31693602 void GenNormals(boolean crease)
31703603 {
31713604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
3612
+
3613
+ refreshContents();
3614
+ }
3615
+
3616
+ void GenNormalsMINE()
3617
+ {
3618
+ group.selection.GenNormalsMINE();
31723619
31733620 refreshContents();
31743621 }
....@@ -3334,8 +3781,8 @@
33343781
33353782 void ParseVertices()
33363783 {
3337
- boolean epsequal = GrafreeD.epsequal;
3338
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
33393786
33403787 for (int i=0; i<group.selection.size(); i++)
33413788 {
....@@ -3360,7 +3807,7 @@
33603807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33613808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33623809
3363
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
33643811
33653812 buffer.add(g);
33663813 }
....@@ -3375,7 +3822,7 @@
33753822 makeSomething(buffer, i==group.selection.size()-1);
33763823 }
33773824
3378
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
33793826
33803827 refreshContents();
33813828 }
....@@ -3393,7 +3840,16 @@
33933840 String pigment = Object3D.GetPigment(tex);
33943841 //String bump = Object3D.GetBump(tex);
33953842
3396
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3843
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3844
+
3845
+ try
3846
+ {
3847
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3848
+ }
3849
+ catch (Exception e)
3850
+ {
3851
+ System.err.println("FAIL: " + node);
3852
+ }
33973853
33983854 double s = v.s;
33993855
....@@ -3441,12 +3897,26 @@
34413897
34423898 void Align()
34433899 {
3900
+ if (group.selection.size() == 0)
3901
+ return;
3902
+
3903
+ cVector bbmin = new cVector();
3904
+ cVector bbmax = new cVector();
3905
+
3906
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3907
+
3908
+ double dx = bbmax.x - bbmin.x;
3909
+ double dy = bbmax.y - bbmin.y;
3910
+ double dz = bbmax.z - bbmin.z;
3911
+
3912
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3913
+
34443914 for (int i=0; i<group.selection.size(); i++)
34453915 {
34463916 Object3D obj = group.selection.get(i);
34473917
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3918
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3919
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503920 }
34513921
34523922 refreshContents();
....@@ -3467,11 +3937,11 @@
34673937
34683938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693939
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
34723942 lowres.linkVerticesThis(null);
34733943 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
34753945
34763946 System.err.flush();
34773947
....@@ -3511,7 +3981,7 @@
35113981 return;
35123982
35133983 Object3D poses = group.selection.get(0);
3514
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
35153985
35163986 Object3D newgroup = new Object3D("Po:" + poses.name);
35173987
....@@ -3680,7 +4150,7 @@
36804150 group.selection.RelinkToSupport(); // july 2014
36814151 System.out.println("DONE.");
36824152 refreshContents();
3683
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4153
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36844154 }
36854155
36864156 void ReduceMesh(boolean reduction34)
....@@ -3705,9 +4175,9 @@
37054175
37064176 void ClipMesh()
37074177 {
3708
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37094179 {
3710
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
37114181
37124182 if (content instanceof cGroup && ((cGroup)content).transientlink )
37134183 content = ((cGroup)content).get(0);
....@@ -3716,7 +4186,7 @@
37164186 // {
37174187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37184188 // }
3719
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
37204190 }
37214191 // group.selection.ClipMesh(GrafreeD.clipboard);
37224192 System.out.println("DONE.");
....@@ -3763,6 +4233,18 @@
37634233 void MarkLeaves(boolean hide)
37644234 {
37654235 group.selection.MarkLeaves(hide);
4236
+ refreshContents();
4237
+ }
4238
+
4239
+ void RewindLeaves(boolean hide)
4240
+ {
4241
+ group.selection.RewindLeaves(hide);
4242
+ refreshContents();
4243
+ }
4244
+
4245
+ void RandomLeaves(boolean hide)
4246
+ {
4247
+ group.selection.RandomLeaves(hide);
37664248 refreshContents();
37674249 }
37684250
....@@ -3851,7 +4333,7 @@
38514333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38524334
38534335 Object3D elem = (Object3D)group.selection.elementAt(i);
3854
- if(elem != group)
4336
+ if(elem != group || !newWindow)
38554337 {
38564338 // if (!(elem instanceof Composite))
38574339 // newWindow = false;
....@@ -3941,7 +4423,6 @@
39414423 //case 702: // Event.LIST_DESELECT
39424424 group.deselectAll();
39434425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3944
- objEditor.ClearInfo(); // .GetMaterial());
39454426 if (tps != null)
39464427 {
39474428 for (int i=0; i < tps.length; i++)
....@@ -3950,31 +4431,30 @@
39504431
39514432 //if (child.parent != null)
39524433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
39534435 group.addSelectee(child);
3954
- objEditor.SetMaterial(child); // .GetMaterial());
3955
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3956
- System.err.println("info : " + child.GetPath());
39574436 }
39584437 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4438
+// else
4439
+// {
4440
+// objEditor.SetMaterial(group); // .GetMaterial());
4441
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4442
+// System.err.println("info : " + group.GetPath());
4443
+// }
39654444
3966
- objEditor.SetText(); // jan 2014
3967
-
3968
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4445
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39694446 CameraPane.flash = true;
39704447
3971
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39724449 // a camera
39734450 {
3974
- CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4451
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4452
+ {
4453
+ CameraPane.camerachangeframe = 0; // don't refuse it
4454
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4455
+ }
4456
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4457
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784458 }
39794459
39804460 refreshContents();
....@@ -3985,6 +4465,26 @@
39854465
39864466 freezemodel = false;
39874467 }
4468
+
4469
+ void refreshContents(boolean cp)
4470
+ {
4471
+ if (!Globals.MOUSEDRAGGED)
4472
+ {
4473
+ objEditor.ClearInfo(); // .GetMaterial());
4474
+
4475
+ for (int i=0; i < group.selection.Size(); i++)
4476
+ {
4477
+ Object3D child = (Object3D) group.selection.get(i);
4478
+
4479
+ objEditor.AddInfo(child, this, true);
4480
+ System.err.println("info : " + child.GetPath());
4481
+ }
4482
+
4483
+ objEditor.SetText(); // jan 2014
4484
+ }
4485
+
4486
+ super.refreshContents(cp);
4487
+ }
39884488
39894489 void linkSomething(Object3D thing)
39904490 {
....@@ -4056,16 +4556,18 @@
40564556 {
40574557 if (group.selection.isEmpty())
40584558 return;
4059
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
40604561 Composite tGroup = null;
40614562 if (group.selection.size() > 0) // 1)
40624563 {
40634564 tGroup = new cGroup();
4064
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
40654566 }
40664567
40674568 if (cut)
40684569 {
4570
+ Save();
40694571 //int indices[] = jList.getSelectedIndices();
40704572 //for (int i = indices.length - 1; i >= 0; i--)
40714573 //jList.remove(indices[i]);
....@@ -4101,16 +4603,16 @@
41014603 //System.out.println("cut " + child);
41024604 //System.out.println("parent = " + child.parent);
41034605 // tmp.addChild(child);
4104
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
41054607 tGroup.add/*Child*/(tmp);
41064608 else
4107
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
41084610 }
41094611 else
4110
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
41114613 tGroup.add/*Child*/(child);
41124614 else
4113
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
41144616 }
41154617
41164618 //ResetModel();
....@@ -4142,21 +4644,23 @@
41424644 //System.out.println("cut " + elem);
41434645 //System.out.println("parent = " + elem.parent);
41444646 // tmp.addChild(elem);
4145
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
41464648 tGroup.add/*Child*/(tmp);
41474649 else
4148
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
41494651 }
41504652 else
4151
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
41524654 tGroup.add/*Child*/(child);
41534655 else
4154
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
41554657 }
41564658
41574659 }
4158
- if (GrafreeD.clipboardIsTempGroup)
4159
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
41604664 if (cut)
41614665 {
41624666 ResetModel();
....@@ -4170,7 +4674,7 @@
41704674 // return;
41714675 boolean first = true;
41724676
4173
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
41744678 {
41754679 Composite temp;
41764680
....@@ -4181,7 +4685,7 @@
41814685 temp = (Composite)Applet3D.clipboard.deepCopy();
41824686 */
41834687 Object3D elem;
4184
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4688
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41854689 {
41864690 Object3D child = (Object3D)e.nextElement();
41874691
....@@ -4215,21 +4719,21 @@
42154719 //Object3D cb = Applet3D.clipboard;
42164720 //temp.addChild(cb);
42174721 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4218
- assert(GrafreeD.clipboard.parent == null);
4219
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4722
+ assert(Grafreed.clipboard.parent == null);
4723
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4724
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4725
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4726
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42234727 else
4224
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
42264730 }
42274731
42284732 ResetModel();
42294733 refreshContents();
42304734 }
42314735
4232
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
42334737 {
42344738 // if (GrafreeD.clipboard == null)
42354739 // return;
....@@ -4258,15 +4762,22 @@
42584762 if (copyit)
42594763 {
42604764 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
42624773 }
42634774 else
42644775 {
42654776 boolean first = true;
42664777
4267
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
42684779 {
4269
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
42704781 Object3D copy;
42714782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42724783 {
....@@ -4276,7 +4787,7 @@
42764787 }
42774788 } else
42784789 {
4279
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
42804791 }
42814792 }
42824793 }
....@@ -4468,6 +4979,26 @@
44684979 makeSomething(csg);
44694980 }
44704981
4982
+ void Ungroup(Object3D g)
4983
+ {
4984
+ if (g instanceof HiddenObject)
4985
+ {
4986
+ HiddenObject h = (HiddenObject) g;
4987
+
4988
+ for (int i=0; i<h.ActualSize(); i++)
4989
+ {
4990
+ objEditor.makeSomething(h.get(i), false);
4991
+ }
4992
+ }
4993
+ else
4994
+ {
4995
+ for (int i=0; i<g.Size(); i++)
4996
+ {
4997
+ objEditor.makeSomething(g.get(i), false);
4998
+ }
4999
+ }
5000
+ }
5001
+
44715002 void ungroup()
44725003 {
44735004 /*
....@@ -4661,21 +5192,6 @@
46615192 }
46625193 */
46635194
4664
- void ImportGFD()
4665
- {
4666
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4667
- browser.show();
4668
- String filename = browser.getFile();
4669
- if (filename != null && filename.length() > 0)
4670
- {
4671
- String fullname = browser.getDirectory() + filename;
4672
-
4673
- //Object3D readobj =
4674
- objEditor.ReadGFD(fullname, objEditor);
4675
- //makeSomething(readobj);
4676
- }
4677
- }
4678
-
46795195 /*
46805196 public void Callback(Object obj)
46815197 {
....@@ -4699,26 +5215,9 @@
46995215 }
47005216 */
47015217
4702
- void ImportVRMLX3D()
4703
- {
4704
- if (GrafreeD.standAlone)
4705
- {
4706
- /**/
4707
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4708
- browser.show();
4709
- String filename = browser.getFile();
4710
- if (filename != null && filename.length() > 0)
4711
- {
4712
- String fullname = browser.getDirectory() + filename;
4713
- LoadVRMLX3D(fullname);
4714
- }
4715
- /**/
4716
- }
4717
- }
4718
-
47195218 String GetFile(String dialogName)
47205219 {
4721
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
47225221 {
47235222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47245223 browser.show();
....@@ -4782,10 +5281,18 @@
47825281 cButton flashSelectionButton;
47835282 cButton editButton;
47845283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
47855285 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875286 cButton unselectButton;
47885287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
47895296 cButton screenfitButton;
47905297 cButton screenfitpointButton;
47915298 cButton snapobjectButton;
....@@ -4796,14 +5303,6 @@
47965303 cButton closeButton;
47975304
47985305 cButton setsupportButton;
4799
-
4800
- cButton twoButton;
4801
- cButton sixButton;
4802
- cButton threeButton;
4803
- cButton sevenButton;
4804
- cButton fourButton; // full panel
4805
- cButton oneButton; // full XYZ
4806
- //cButton currentLayout;
48075306
48085307 //
48095308 //Composite
....@@ -4816,6 +5315,8 @@
48165315 private MenuItem lookFromItem;
48175316 private MenuItem switchItem;
48185317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
48195320 private MenuItem duplicateItem;
48205321 private MenuItem cloneItem;
48215322 private MenuItem cloneSupportItem;
....@@ -4827,8 +5328,9 @@
48275328 private MenuItem resetsupportItem;
48285329 private MenuItem resetreferencesItem;
48295330 private MenuItem linkverticesItem;
5331
+ private MenuItem relinkverticesItem;
48305332 private MenuItem setMasterItem;
4831
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
48325334 private MenuItem stepAllItem;
48335335 private MenuItem revertMeshItem;
48345336 private MenuItem poseMeshItem;
....@@ -4839,14 +5341,17 @@
48395341 private MenuItem mergeGeometriesItem;
48405342 private MenuItem copyItem;
48415343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
48425345 private MenuItem pasteLinkItem;
48435346 private MenuItem pasteCloneItem;
48445347 private MenuItem pasteExpandItem;
48455348 private MenuItem clearItem;
48465349 private MenuItem clearAllItem;
48475350 private MenuItem genUVItem;
5351
+ private MenuItem genNormalsMESHItem;
48485352 private MenuItem genNormalsCADItem;
48495353 private MenuItem genNormalsORGANItem;
5354
+ private MenuItem genNormalsMINEItem;
48505355 private MenuItem stripifyItem;
48515356 private MenuItem unstripifyItem;
48525357 private MenuItem trimItem;
....@@ -4875,6 +5380,10 @@
48755380 private MenuItem showleavesItem;
48765381 private MenuItem markleavesItem;
48775382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
48785387
48795388 private MenuItem flipVItem;
48805389 private MenuItem unflipVItem;
....@@ -4886,8 +5395,11 @@
48865395 private MenuItem panoTexturesItem;
48875396
48885397 private MenuItem resetCentroidItem;
4889
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
48905399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
5402
+ private MenuItem hideItem;
48915403 private MenuItem grabItem;
48925404 private MenuItem backItem;
48935405 private MenuItem frontItem;
....@@ -4908,6 +5420,7 @@
49085420
49095421 private MenuItem resetParentItem;
49105422 private MenuItem repairParentItem;
5423
+ private MenuItem repairShadowItem;
49115424 private MenuItem sortbysizeItem;
49125425 private MenuItem sortbynameItem;
49135426
....@@ -4928,10 +5441,11 @@
49285441 private MenuItem coneItem;
49295442 private MenuItem torusItem;
49305443 private MenuItem superItem;
5444
+ private MenuItem kleinItem;
49315445 private MenuItem blobItem;
49325446 private MenuItem latheItem;
49335447 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
49355449 private MenuItem meshItem;
49365450 // private MenuItem meshGroupItem;
49375451 private MenuItem springItem;
....@@ -4940,6 +5454,7 @@
49405454 private MenuItem csgItem;
49415455 private MenuItem templateItem;
49425456 private MenuItem textureItem;
5457
+ private MenuItem billboardItem;
49435458 private MenuItem shadowXItem;
49445459 private MenuItem shadowYItem;
49455460 private MenuItem shadowZItem;
....@@ -4952,11 +5467,6 @@
49525467 private MenuItem doubleItem;
49535468 private MenuItem tripleItem;
49545469
4955
- private MenuItem importGFDItem;
4956
- private MenuItem importVRMLX3DItem;
4957
- private MenuItem import3DSItem;
4958
- private MenuItem importOBJItem;
4959
-
49605470 private MenuItem computeAOItem;
49615471 private MenuItem recompileItem;
49625472 private MenuItem editScriptItem;
....@@ -4966,4 +5476,8 @@
49665476 private MenuItem analyzeItem;
49675477 private MenuItem dumpItem;
49685478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
49695483 }