Normand Briere
2019-07-07 46dbce888e7c3eff8969f1ddbe22e144410b67f4
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,30 +148,29 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
163155 Menu menu;
164156 oe.menuBar.add(menu = new Menu("Edit"));
165157 //editItem = menu.add(new MenuItem("Edit"));
166158 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168166 duplicateItem.addActionListener(this);
169
- menu.add("-");
170167 cloneItem = menu.add(new MenuItem("Clone"));
171168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
172171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173172 cloneSupportItem.addActionListener(this);
173
+ }
174174 menu.add("-");
175175 cutItem = menu.add(new MenuItem("Cut"));
176176 cutItem.addActionListener(this);
....@@ -178,27 +178,123 @@
178178 copyItem.addActionListener(this);
179179 pasteItem = menu.add(new MenuItem("Paste"));
180180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
181185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182186 pasteLinkItem.addActionListener(this);
183187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184188 pasteCloneItem.addActionListener(this);
185189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
187192 clearItem = menu.add(new MenuItem("Clear"));
188193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
189198 clearAllItem = menu.add(new MenuItem("Clear All"));
190199 clearAllItem.addActionListener(this);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209
+
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
191237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
192289 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);
290
+ if (Globals.ADVANCED)
291
+ {
197292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198293 revertMeshItem.addActionListener(this);
199294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200295 resetreferencesItem.addActionListener(this);
201296 menu.add("-");
297
+ }
202298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203299 overwriteGeoItem.addActionListener(this);
204300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +306,104 @@
210306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211307 overwriteUVItem.addActionListener(this);
212308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
213311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214312 generateMeshItem.addActionListener(this);
215313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216314 poseMeshItem.addActionListener(this);
217315 menu.add("-");
316
+ }
218317 resetsupportItem = menu.add(new MenuItem("Reset support"));
219318 resetsupportItem.addActionListener(this);
220319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221320 linkverticesItem.addActionListener(this);
321
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
322
+ relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
222326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223327 setMasterItem.addActionListener(this);
328
+ }
224329
225330 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
228333 backItem = menu.add(new MenuItem("Back"));
229334 backItem.addActionListener(this);
230335 frontItem = menu.add(new MenuItem("Front"));
231336 frontItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
343
+ hideItem.addActionListener(this);
344
+ }
345
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
346
+ ungroupItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
241354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242355 switchGeoItem.addActionListener(this);
243356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244357 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
246359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
247366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248367 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
368
+ }
251369
252370 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
373
+ billboardItem = menu.add(new MenuItem("Billboard"));
374
+ billboardItem.addActionListener(this);
255375 csgItem = menu.add(new MenuItem("CSG"));
256376 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258378 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260380 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262382 shadowZItem.addActionListener(this);
383
+
384
+ if (Globals.ADVANCED)
385
+ {
386
+ menu.add("-");
263387 linkerItem = menu.add(new MenuItem("Linker"));
264388 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267389 attributeItem = menu.add(new MenuItem("Attribute"));
268390 attributeItem.addActionListener(this);
391
+ templateItem = menu.add(new MenuItem("Template"));
392
+ templateItem.addActionListener(this);
269393 pointflowItem = menu.add(new MenuItem("Point Flow"));
270394 pointflowItem.addActionListener(this);
395
+ }
271396 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274397 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275398 resetTransformItem.addActionListener(this);
276399 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277400 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
401
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
402
+ resetCentroidXZItem.addActionListener(this);
403
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
404
+ transformGeometryItem.addActionListener(this);
405
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
406
+ transformChildrenItem.addActionListener(this);
280407
281408 oe.menuBar.add(menu = new Menu("Geometry"));
282409 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +414,11 @@
287414 genNormalsCADItem.addActionListener(this);
288415 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289416 genNormalsMESHItem.addActionListener(this);
417
+ if (Globals.ADVANCED)
418
+ {
419
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
420
+ genNormalsMINEItem.addActionListener(this);
421
+ }
290422 stripifyItem = menu.add(new MenuItem("Stripify"));
291423 stripifyItem.addActionListener(this);
292424 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +440,34 @@
308440 reduce34MeshItem.addActionListener(this);
309441 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310442 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313443 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314444 clipMeshItem.addActionListener(this);
445
+
446
+ if (Globals.ADVANCED)
447
+ {
448
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
449
+ smoothMeshItem.addActionListener(this);
450
+ }
315451
316452 oe.menuBar.add(menu = new Menu("Attributes"));
317453 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318454 clearMaterialsItem.addActionListener(this);
455
+ resetAllItem = menu.add(new MenuItem("Reset All"));
456
+ resetAllItem.addActionListener(this);
457
+ stepAllItem = menu.add(new MenuItem("Step All"));
458
+ stepAllItem.addActionListener(this);
319459 menu.add("-");
320460 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321461 liveleavesItem.addActionListener(this);
322462 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323463 unliveleavesItem.addActionListener(this);
464
+ if (Globals.ADVANCED)
465
+ {
324466 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325467 supportleavesItem.addActionListener(this);
326468 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327469 unsupportleavesItem.addActionListener(this);
470
+ }
328471 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329472 hideleavesItem.addActionListener(this);
330473 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +476,14 @@
333476 markleavesItem.addActionListener(this);
334477 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335478 unmarkleavesItem.addActionListener(this);
479
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
480
+ rewindleavesItem.addActionListener(this);
481
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
482
+ unrewindleavesItem.addActionListener(this);
483
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
484
+ randomleavesItem.addActionListener(this);
485
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
486
+ unrandomleavesItem.addActionListener(this);
336487 menu.add("-");
337488 flipVItem = menu.add(new MenuItem("Flip V"));
338489 flipVItem.addActionListener(this);
....@@ -368,35 +519,40 @@
368519 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369520 sortbynameItem.addActionListener(this);
370521 menu.add("-");
522
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
523
+ shareGeometriesItem.addActionListener(this);
524
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
525
+ mergeGeometriesItem.addActionListener(this);
526
+ if (Globals.ADVANCED)
527
+ {
528
+ // Pretty much the same as duplicate and clone.
371529 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372530 extractGeometriesItem.addActionListener(this);
373531 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374532 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
533
+ }
379534
380535 oe.menuBar.add(menu = new Menu("Insert"));
381536 buildCreateMenu(menu);
382537
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394538 oe.menuBar.add(menu = new Menu("Tools"));
395539 buildToolsMenu(menu);
396540 }
397541
398542 void SetupUI2(ObjEditor oe)
399543 {
544
+ // June 2019
545
+ if (oe == null)
546
+ {
547
+ //super.SetupUI2(this);
548
+ //return;
549
+ }
550
+
551
+ if (copy != group)
552
+ {
553
+ //super.SetupUI2(this);
554
+ }
555
+
400556 //new Exception().printStackTrace();
401557
402558 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -425,150 +581,217 @@
425581 oe.radioPanel.add(dummyButton);
426582 oe.buttonGroup.add(dummyButton);
427583 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
584
+ cGridBag copyOptionsPanel = new cGridBag();
585
+
586
+ copyOptionsPanel.preferredHeight = 1;
431587
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
588
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
589
+
590
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ //minButton.setToolTipText("Minimize window");
592
+ //minButton.addActionListener(this);
593
+
594
+ if (Globals.ADVANCED)
595
+ {
596
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ maxButton.setToolTipText("Maximize window");
598
+ maxButton.addActionListener(this);
599
+ }
600
+
601
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ fullButton.setToolTipText("Full-screen window");
603
+ fullButton.addActionListener(this);
604
+
605
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ screenfitButton.setToolTipText("Screen fit");
607
+ screenfitButton.addActionListener(this);
608
+
609
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ restoreCameraButton.setToolTipText("Restore viewpoint");
611
+ restoreCameraButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ undoButton.setToolTipText("Undo changes");
615
+ undoButton.addActionListener(this);
616
+ undoButton.setEnabled(false);
617
+
618
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ redoButton.setToolTipText("Redo changes");
620
+ redoButton.addActionListener(this);
621
+ redoButton.setEnabled(false);
622
+
623
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ saveButton.setToolTipText("Save changes");
625
+ saveButton.addActionListener(this);
626
+
627
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
628
+ liveCB.setToolTipText("Enable animation");
433629 liveCB.addItemListener(this);
434630
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
631
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ oneStepButton.setToolTipText("Animate one step forward");
633
+ oneStepButton.addActionListener(this);
634
+
635
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
636
+ fastCB.setToolTipText("Fast mode");
453637 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
638
+
639
+ //oe.toolboxPanel.Return();
640
+
641
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
642
+// trackCB.setToolTipText("Enable tracking");
643
+// trackCB.addItemListener(this);
460644
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
495
- trackCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
499
- screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
501645 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502646 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507647
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
514
- flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
648
+ if (Globals.ADVANCED)
649
+ {
650
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ snapobjectButton.addActionListener(this);
652
+ snapobjectButton.setToolTipText("Snap Object");
653
+ }
654
+
655
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
518656
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ twoButton.setToolTipText("Show center view only");
521659 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
660
+ this.fullscreenLayout = twoButton;
661
+
662
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523663 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
664
+ fourButton.setToolTipText("Show left panel only");
665
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ sixButton.setToolTipText("2-column layout left");
525667 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ threeButton.setToolTipText("2-column layout right");
527670 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
671
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
672
+ sevenButton.setToolTipText("3-column layout");
529673 sevenButton.addActionListener(this);
530674 //
531675
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
+ rootButton.setToolTipText("Edit selection in new tab");
533678 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
679
+
680
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
681
+ closeButton.setToolTipText("Close tab");
536682 closeButton.addActionListener(this);
537683 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538684 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540
-
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
- editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547685
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
686
+ // INSERT
687
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ gridButton.setToolTipText("Create grid");
689
+ gridButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
692
+ boxButton.setToolTipText("Create box");
693
+ boxButton.addActionListener(this);
694
+
695
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ sphereButton.setToolTipText("Create sphere");
697
+ sphereButton.addActionListener(this);
698
+
699
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ coneButton.setToolTipText("Create cone");
701
+ coneButton.addActionListener(this);
702
+
703
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+ torusButton.setToolTipText("Create torus");
705
+ torusButton.addActionListener(this);
706
+
707
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ superButton.setToolTipText("Create superellipsoid");
709
+ superButton.addActionListener(this);
710
+
711
+ if (Globals.ADVANCED)
712
+ {
713
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
714
+ kleinButton.setToolTipText("Create Klein bottle");
715
+ kleinButton.addActionListener(this);
716
+ }
717
+
718
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ particlesButton.setToolTipText("Create particle system");
720
+ particlesButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.Return();
723
+
724
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ groupButton.setToolTipText("Create group");
726
+ groupButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ compositeButton.setToolTipText("Create composite");
730
+ compositeButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ switchButton.setToolTipText("Create item switcher");
734
+ switchButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ loopButton.setToolTipText("Create loop");
738
+ loopButton.addActionListener(this);
739
+
740
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ textureButton.setToolTipText("Create texture");
742
+ textureButton.addActionListener(this);
743
+
744
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ overlayButton.setToolTipText("Create overlay");
746
+ overlayButton.addActionListener(this);
747
+
748
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
749
+ lightButton.setToolTipText("Create light");
750
+ lightButton.addActionListener(this);
751
+
752
+ for (int i=6; --i>=0;)
753
+ {
754
+ oe.toolboxPanel.Return();
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ oe.toolboxPanel.add(new cGridBag());
759
+ oe.toolboxPanel.add(new cGridBag());
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ oe.toolboxPanel.add(new cGridBag());
762
+ }
763
+
764
+ // EDIT panel
765
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ editButton.setToolTipText("Pin selection controls");
767
+ editButton.addActionListener(this);
768
+
769
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
770
+ uneditButton.setToolTipText("Remove selection controls");
549771 uneditButton.addActionListener(this);
550772
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
773
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
774
+ allParamsButton.setToolTipText("Show all controle");
563775 allParamsButton.addActionListener(this);
564776
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
777
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
778
+ clearPanelButton.setToolTipText("Clear edit panel");
779
+ clearPanelButton.addActionListener(this);
780
+
781
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ unselectButton.setToolTipText("Unselect");
570783 unselectButton.addActionListener(this);
571784
785
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
786
+ flashSelectionButton.setToolTipText("Highlight selection");
787
+ flashSelectionButton.addActionListener(this);
788
+
789
+ editCommandsPanel.preferredHeight = 1;
790
+
791
+ SetPinStates(false);
792
+// oe.treePanel.add(commandsPanel);
793
+// oe.treePanel.Return();
794
+
572795 // oe.aConstraints.gridx += 1;
573796 // oe.aConstraints.weighty = 0;
574797 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +803,22 @@
580803 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581804 // gcButton.addActionListener(this);
582805
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
806
+ cGridBag jSPPanel = new cGridBag();
807
+
808
+ JScrollPane jSP;
594809 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
810
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596811 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
601
-
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
- colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
609
- materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
612
- textureCB.addItemListener(this);
613
-
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
616812
813
+ oe.treePanel.add(jSPPanel);
814
+ oe.treePanel.Return();
815
+
816
+ oe.treePanel.add(copyOptionsPanel);
817
+ oe.treePanel.Return();
818
+
819
+// mainPanel.setDividerLocation(0.5); //1.0);
820
+// mainPanel.setResizeWeight(0.5);
821
+
617822 //jList.addListSelectionListener(this);
618823 oe.jTree.addTreeSelectionListener(this);
619824 //jTree.setRootVisible(false);
....@@ -635,20 +840,157 @@
635840 radio.layout = sevenButton;
636841 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637842 }
843
+
844
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
845
+ {
846
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
847
+ colorCB.setToolTipText("Copy color when dropped");
848
+ colorCB.addItemListener(this);
849
+
850
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
851
+ materialCB.setToolTipText("Copy material when dropped");
852
+ materialCB.addItemListener(this);
853
+
854
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
855
+ textureCB.setToolTipText("Copy texture when dropped");
856
+ textureCB.addItemListener(this);
857
+
858
+ panel.Return();
859
+
860
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
861
+ boxCB.setToolTipText("Display bounding boxes");
862
+ boxCB.addItemListener(this);
863
+
864
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
865
+ zoomBoxCB.setToolTipText("Display only for wheel");
866
+ zoomBoxCB.addItemListener(this);
867
+
868
+ if (true) // Globals.ADVANCED)
869
+ {
870
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
871
+// supportCB.setToolTipText("Enable rigging");
872
+// supportCB.addItemListener(this);
873
+
874
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
875
+ freezeCB.setToolTipText("Fast moving camera");
876
+ freezeCB.addItemListener(this);
877
+
878
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
879
+ // localCB.addItemListener(this);
880
+
881
+ panel.Return();
882
+
883
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
884
+ crowdCB.setToolTipText("Used for crowds");
885
+ crowdCB.addItemListener(this);
886
+
887
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
888
+ smoothCB.setToolTipText("Snapping delay");
889
+ smoothCB.addItemListener(this);
890
+
891
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
892
+ slowCB.setToolTipText("Smooth interpolation");
893
+ slowCB.addItemListener(this);
894
+
895
+// constraints.gridy += 1;
896
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
897
+// speakerMocapCB.addItemListener(this);
898
+
899
+ panel.Return();
900
+
901
+ if (false)
902
+ {
903
+ // handled in scripts
904
+ //constraints.gridy += 1;
905
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
906
+ speakerCameraCB.addItemListener(this);
907
+
908
+ //constraints.gridy += 1;
909
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
910
+ speakerFocusCB.addItemListener(this);
911
+
912
+ //constraints.gridy += 1;
913
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
914
+ smoothfocusCB.addItemListener(this);
915
+ panel.Return();
916
+ }
917
+
918
+//constraints.gridx += 1;
919
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
920
+// debugCB.addItemListener(this);
921
+
922
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
923
+ trackCB.setToolTipText("Enable tracking target");
924
+ trackCB.addItemListener(this);
925
+
926
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
927
+ oeilCB.setToolTipText("Move camera when tracking");
928
+ oeilCB.addItemListener(this);
929
+
930
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
931
+ shadowCB.setToolTipText("When live compute shadows");
932
+ shadowCB.addItemListener(this);
933
+
934
+ panel.Return();
935
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
936
+ toggleTextureCB.setToolTipText("Load textures");
937
+ toggleTextureCB.addItemListener(this);
938
+
939
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
940
+ toggleSwitchCB.setToolTipText("Choose a single item");
941
+ toggleSwitchCB.addItemListener(this);
942
+
943
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
944
+ autosaveCB.setToolTipText("On structure change");
945
+ autosaveCB.addItemListener(this);
946
+
947
+ panel.Return();
948
+ if (Globals.ADVANCED)
949
+ {
950
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
951
+ lookAtCB.setToolTipText("Look-at target");
952
+ lookAtCB.addItemListener(this);
953
+ }
954
+
955
+ }
956
+
957
+ cGridBag fill = new cGridBag();
958
+ fill.preferredHeight = 200;
959
+ cGridBag fill2 = new cGridBag();
960
+ fill2.preferredHeight = 200;
961
+ cGridBag fill3 = new cGridBag();
962
+ fill3.preferredHeight = 200;
963
+
964
+ panel.add(fill);
965
+ panel.add(fill2);
966
+ panel.add(fill3);
967
+
968
+ }
638969
639970 void EditObject(Object3D obj)
640971 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
972
+ cRadio radioButton = new cRadio(obj.name);
973
+
974
+ // Patch to avoid bug with transparency.
975
+ radioButton.hadMaterial = obj.material != null;
976
+ if (!radioButton.hadMaterial)
977
+ {
978
+ obj.material = new cMaterial();
979
+ }
980
+
981
+ radioButton.SetObject(obj);
982
+ radioButton.layout = sevenButton;
983
+ radioButton.SetCamera(cameraView.renderCamera, false);
984
+ radioButton.addActionListener(this);
985
+ radioPanel.add(radioButton);
986
+ buttonGroup.add(radioButton);
987
+ radioButton.doClick();
649988 }
989
+
650990 void SetupViews(ObjEditor oe)
651991 {
992
+ theFrame = this;
993
+
652994 oe.SetupViews();
653995
654996 System.out.println("SetupViews");
....@@ -657,22 +999,28 @@
657999 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6581000 }
6591001
660
- JCheckBox liveCB;
661
- JCheckBox supportCB;
662
- JCheckBox localCB;
663
- JCheckBox crowdCB;
664
- JCheckBox smoothCB;
665
- JCheckBox fastCB;
666
- JCheckBox slowCB;
667
- JCheckBox boxCB;
668
- JCheckBox trackCB;
669
- JCheckBox smoothfocusCB;
1002
+ cToggleButton liveCB;
1003
+ cCheckBox supportCB;
1004
+ cCheckBox localCB;
1005
+ cCheckBox crowdCB;
1006
+ cCheckBox smoothCB;
1007
+ cToggleButton fastCB;
1008
+ cCheckBox slowCB;
1009
+ cCheckBox boxCB;
1010
+ cCheckBox zoomBoxCB;
1011
+ cCheckBox freezeCB;
1012
+ //cToggleButton trackCB;
1013
+ cCheckBox trackCB;
1014
+ cCheckBox smoothfocusCB;
6701015 // JCheckBox speakerMocapCB;
671
- JCheckBox speakerCameraCB;
672
- JCheckBox speakerFocusCB;
673
- JCheckBox debugCB;
674
- JCheckBox oeilCB;
675
- JCheckBox lookAtCB;
1016
+ cCheckBox speakerCameraCB;
1017
+ cCheckBox speakerFocusCB;
1018
+ cCheckBox debugCB;
1019
+
1020
+ cCheckBox oeilCB;
1021
+ cCheckBox shadowCB;
1022
+ cCheckBox autosaveCB;
1023
+ cCheckBox lookAtCB;
6761024
6771025 // static int COLOR = 1;
6781026 // static int MATERIAL = 2;
....@@ -680,9 +1028,9 @@
6801028
6811029 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6821030
683
- JCheckBox colorCB;
684
- JCheckBox materialCB;
685
- JCheckBox textureCB;
1031
+ cCheckBox colorCB;
1032
+ cCheckBox materialCB;
1033
+ cCheckBox textureCB;
6861034
6871035 public void itemStateChanged(ItemEvent e)
6881036 {
....@@ -707,10 +1055,10 @@
7071055 dropAttributes |= Object3D.TEXTURE;
7081056 else
7091057 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
1058
+ } else if(e.getSource() == liveCB)
7121059 {
7131060 cameraView.ToggleLive();
1061
+ refreshContents(false);
7141062 }
7151063 else if(e.getSource() == supportCB)
7161064 {
....@@ -746,6 +1094,10 @@
7461094 cameraView.repaint();
7471095 // refreshContents();
7481096 }
1097
+ else if(e.getSource() == zoomBoxCB)
1098
+ {
1099
+ cameraView.ToggleZoomBoxMode();
1100
+ }
7491101 else if(e.getSource() == smoothfocusCB)
7501102 {
7511103 cameraView.ToggleSmoothFocus();
....@@ -771,6 +1123,18 @@
7711123 {
7721124 cameraView.ToggleOeil();
7731125 }
1126
+ else if(e.getSource() == shadowCB)
1127
+ {
1128
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1129
+ }
1130
+ else if(e.getSource() == freezeCB)
1131
+ {
1132
+ Globals.FREEZEONMOVE ^= true;
1133
+ }
1134
+ else if(e.getSource() == autosaveCB)
1135
+ {
1136
+ Globals.SAVEONMAKE ^= true;
1137
+ }
7741138 else if(e.getSource() == lookAtCB)
7751139 {
7761140 cameraView.ToggleLookAt();
....@@ -787,7 +1151,8 @@
7871151
7881152 /**/
7891153 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
790
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1154
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1155
+ TreePath path = objEditor.jTree.getSelectionPath();
7911156 if ((path == null) || (path.getPathCount() <= 1)) {
7921157 // We can't move the root node or an empty selection
7931158 return;
....@@ -850,8 +1215,6 @@
8501215 }
8511216 }
8521217
853
- String string = (String) object;
854
-
8551218 System.out.println("Transfer = " + object + "; drop : " + target);
8561219 // if( object instanceof java.io.File[])
8571220 // {
....@@ -859,7 +1222,11 @@
8591222 // objEditor.DropFile((java.io.File[]) object, true);
8601223 // return;
8611224 // }
862
- if (string.charAt(0) == '/')
1225
+
1226
+ String string = (String) object;
1227
+
1228
+ // File path for Mac and Windows
1229
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631230 {
8641231 // file(s)
8651232 String[] names = string.split("\n");
....@@ -886,7 +1253,7 @@
8861253
8871254 flashIt = false;
8881255 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1256
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901257 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911258
8921259 if (group.selection.size() == 1)
....@@ -902,23 +1269,33 @@
9021269
9031270 assert target == objEditor.jTree;
9041271 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1272
+ Object3D destinationLeaf;
9051273 try {
906
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1274
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9071275 } catch (Exception e) {
9081276 System.out.println("destinationPath : " + destinationPath);
9091277 return;
9101278 }
9111279
912
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1280
+ for (int i=group.selection.size(); --i>=0;)
9131281 {
1282
+ Object3D child = (Object3D)group.selection.elementAt(i);
1283
+
1284
+ // Cannot move into itself
1285
+ if (child == destinationLeaf)
1286
+ return;
1287
+ }
1288
+
1289
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1290
+// {
9141291 loadClipboard(true);
9151292 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
917
- } else {
918
- loadClipboard(false);
919
- objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
921
- }
1293
+ pasteInto(false, false);
1294
+// } else {
1295
+// loadClipboard(false);
1296
+// objEditor.jTree.setSelectionPath(destinationPath);
1297
+// pasteInto(false, false); // true); // ???
1298
+// }
9221299 }
9231300 public void dropActionChanged(DropTargetDragEvent dtde)
9241301 // Called if the user has modified the current drop gesture
....@@ -1023,83 +1400,107 @@
10231400 {
10241401 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10251402 //heightFieldItem.addActionListener(this);
1026
- gridItem = menu.add(new MenuItem("Grid"));
1027
- gridItem.addActionListener(this);
1028
- rectoidItem = menu.add(new MenuItem("Box"));
1029
- rectoidItem.addActionListener(this);
1030
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1031
- ellipsoidItem.addActionListener(this);
1032
- coneItem = menu.add(new MenuItem("Cone"));
1033
- coneItem.addActionListener(this);
1034
- torusItem = menu.add(new MenuItem("Torus"));
1035
- torusItem.addActionListener(this);
1036
- superItem = menu.add(new MenuItem("Superellipsoid"));
1037
- superItem.addActionListener(this);
1038
- particleItem = menu.add(new MenuItem("Particle system"));
1039
- particleItem.addActionListener(this);
1403
+// gridItem = menu.add(new MenuItem("Grid"));
1404
+// gridItem.addActionListener(this);
1405
+// rectoidItem = menu.add(new MenuItem("Box"));
1406
+// rectoidItem.addActionListener(this);
1407
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1408
+// ellipsoidItem.addActionListener(this);
1409
+// coneItem = menu.add(new MenuItem("Cone"));
1410
+// coneItem.addActionListener(this);
1411
+// torusItem = menu.add(new MenuItem("Torus"));
1412
+// torusItem.addActionListener(this);
1413
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1414
+// superItem.addActionListener(this);
1415
+
1416
+ cameraItem = menu.add(new MenuItem("Camera"));
1417
+ cameraItem.addActionListener(this);
1418
+
1419
+ if (!Globals.ADVANCED)
1420
+ {
1421
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1422
+ kleinItem.addActionListener(this);
1423
+ }
1424
+
1425
+// particleItem = menu.add(new MenuItem("Particle system"));
1426
+// particleItem.addActionListener(this);
1427
+ if (Globals.ADVANCED)
1428
+ {
10401429 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411430 ragdollItem.addActionListener(this);
10421431 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431432 ragdoll2Item.addActionListener(this);
1433
+ }
10441434 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1435
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461436 meshItem.addActionListener(this);
10471437 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481438 // meshGroupItem.addActionListener(this);
1439
+ if (Globals.ADVANCED)
1440
+ {
10491441 springItem = menu.add(new MenuItem("Spring"));
10501442 springItem.addActionListener(this);
10511443 flagItem = menu.add(new MenuItem("Flag"));
10521444 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571445 blobItem = menu.add(new MenuItem("Blob"));
10581446 blobItem.addActionListener(this);
10591447 latheItem = menu.add(new MenuItem("Lathe"));
10601448 latheItem.addActionListener(this);
1061
- lightItem = menu.add(new MenuItem("Light"));
1062
- lightItem.addActionListener(this);
1449
+ }
1450
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1451
+ bezierItem.addActionListener(this);
1452
+// overlayItem = menu.add(new MenuItem("Overlay"));
1453
+// overlayItem.addActionListener(this);
1454
+// lightItem = menu.add(new MenuItem("Light"));
1455
+// lightItem.addActionListener(this);
10631456 menu.add("-");
10641457 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10651458 //superLoopItem.addActionListener(this);
1066
- loopItem = menu.add(new MenuItem("Loop"));
1067
- loopItem.addActionListener(this);
1459
+// loopItem = menu.add(new MenuItem("Loop"));
1460
+// loopItem.addActionListener(this);
10681461 doubleItem = menu.add(new MenuItem("Fork"));
10691462 doubleItem.addActionListener(this);
1463
+ if (Globals.ADVANCED)
1464
+ {
10701465 tripleItem = menu.add(new MenuItem("Trident"));
10711466 tripleItem.addActionListener(this);
1467
+ }
10721468 }
10731469
10741470 void buildToolsMenu(Menu menu)
10751471 {
10761472 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771473 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1474
+ animationItem.setState(Globals.ANIMATION);
1475
+
1476
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1477
+ archiveItem.addActionListener(this);
10791478
10801479 menu.add("-");
10811480 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821481 parseverticesItem.addActionListener(this);
10831482 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841483 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1484
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861485 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891486 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901487 reduceMorphItem.addActionListener(this);
10911488 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921489 reduce34MorphItem.addActionListener(this);
1093
-
1490
+ menu.add("-");
10941491 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951492 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971493
1494
+ if (Globals.ADVANCED)
1495
+ {
1496
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1497
+ mirrorItem.addActionListener(this);
1498
+ menu.add("-");
10981499 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991500 memoryItem.addActionListener(this);
11001501 menu.add(analyzeItem = new MenuItem("Analyze"));
11011502 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1503
+ menu.add(dumpItem = new MenuItem("Print"));
11031504 dumpItem.addActionListener(this);
11041505 // menu.add(pathItem = new MenuItem("From-to path"));
11051506 // pathItem.addActionListener(this);
....@@ -1108,6 +1509,8 @@
11081509 resetParentItem.addActionListener(this);
11091510 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101511 repairParentItem.addActionListener(this);
1512
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1513
+ repairShadowItem.addActionListener(this);
11111514 menu.add(invariantsItem = new MenuItem("Invariants"));
11121515 invariantsItem.addActionListener(this);
11131516 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1518,7 @@
11151518 menu.add("-");
11161519 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171520 editScriptItem.addActionListener(this);
1521
+ }
11181522 }
11191523
11201524 void ScreenFit()
....@@ -1237,9 +1641,24 @@
12371641 shadow.material = new cMaterial(obj.material);
12381642 shadow.material.diffuse = 0.0001f;
12391643 shadow.material.specular = 0.0001f;
1644
+ //shadow.projectedVertices[1].x = 300;
12401645
12411646 makeSomething(shadow);
12421647 }
1648
+
1649
+ private void ClearUnpinned()
1650
+ {
1651
+ //for (Object3D obj : listUI)
1652
+ for (int i=listUI.size(); --i>=0;)
1653
+ {
1654
+ Object3D obj = listUI.elementAt(i);
1655
+ if (!obj.pinned)
1656
+ {
1657
+ obj.CloseUI();
1658
+ listUI.remove(i);
1659
+ }
1660
+ }
1661
+ }
12431662
12441663 /**
12451664 * applyExample
....@@ -1443,9 +1862,9 @@
14431862
14441863 void Overwrite(int mask)
14451864 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1865
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471866 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1867
+ Object3D content = Grafreed.clipboard.get(0);
14491868
14501869 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511870 content = ((cGroup)content).get(0);
....@@ -1468,6 +1887,7 @@
14681887 //
14691888 public void actionPerformed(ActionEvent event) // , Object arg)
14701889 {
1890
+ Object source = event.getSource();
14711891 /*
14721892 if (event.getSource() == nameField)
14731893 {
....@@ -1479,11 +1899,11 @@
14791899 }
14801900 else
14811901 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1902
+ if (source == lookAtItem || source == lookFromItem)
14831903 {
14841904 ScreenFit();
14851905 } else
1486
- if (event.getSource() == switchItem)
1906
+ if (source == switchViewItem)
14871907 {
14881908 cVector v1 = new cVector();
14891909 cVector v2 = new cVector();
....@@ -1492,11 +1912,11 @@
14921912 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931913 objEditor.cameraView.repaint();
14941914 } else
1495
- if (event.getSource() == rectoidItem)
1915
+ if (source == rectoidItem || source == boxButton)
14961916 {
14971917 makeSomething(new Box());
14981918 } else
1499
- if (event.getSource() == particleItem)
1919
+ if (source == particleItem || source == particlesButton)
15001920 {
15011921 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021922 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1937,9 @@
15171937 applyExample(particleGeom, "SMOKE");
15181938 makeSomething(particleGeom);
15191939 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1940
+ if (source == ragdollItem || source == ragdoll2Item)
15211941 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1942
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231943
15241944 ragdoll.toParent = LA.newMatrix();
15251945 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1957,7 @@
15371957 } else
15381958 /*
15391959 */
1540
- if (event.getSource() == heightFieldItem)
1960
+ if (source == heightFieldItem)
15411961 {
15421962 Object3D obj = new Object3D();
15431963
....@@ -1575,27 +1995,31 @@
15751995
15761996 makeSomething(obj);
15771997 } else
1578
- if (event.getSource() == gridItem)
1998
+ if (source == gridItem || source == gridButton)
15791999 {
15802000 makeSomething(new Grid());
15812001 } else
1582
- if (event.getSource() == ellipsoidItem)
2002
+ if (source == ellipsoidItem || source == sphereButton)
15832003 {
15842004 makeSomething(new Sphere());
15852005 } else
1586
- if (event.getSource() == coneItem)
2006
+ if (source == coneItem || source == coneButton)
15872007 {
15882008 makeSomething(new Cone());
15892009 } else
1590
- if (event.getSource() == torusItem)
2010
+ if (source == torusItem || source == torusButton)
15912011 {
15922012 makeSomething(new Torus());
15932013 } else
1594
- if (event.getSource() == superItem)
2014
+ if (source == superItem || source == superButton)
15952015 {
15962016 makeSomething(new Superellipsoid());
15972017 } else
1598
- if (event.getSource() == blobItem)
2018
+ if (source == kleinItem || source == kleinButton)
2019
+ {
2020
+ makeSomething(new Klein());
2021
+ } else
2022
+ if (source == blobItem)
15992023 {
16002024 Blob blob = new Blob();
16012025 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +2027,15 @@
16032027 //blob.retile();
16042028 makeSomething(blob);
16052029 } else
1606
- if (event.getSource() == latheItem)
2030
+ if (source == latheItem)
16072031 {
16082032 makeSomething(new Lathe());
16092033 } else
1610
- if (event.getSource() == bezierItem)
2034
+ if (source == bezierItem)
16112035 {
16122036 makeSomething(new BezierSurface());
16132037 } else
1614
- if (event.getSource() == checkerItem)
2038
+ if (source == overlayItem || source == overlayButton)
16152039 {
16162040 /*
16172041 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +2050,7 @@
16262050 */
16272051 makeSomething(new Checker());
16282052 } else
1629
- if (event.getSource() == meshItem)
2053
+ if (source == meshItem)
16302054 {
16312055 Object3D itemtomake = new Object3D();
16322056 Object3D child;
....@@ -1647,35 +2071,35 @@
16472071 makeSomething(child);
16482072 }
16492073 } else
1650
- if (event.getSource() == springItem)
2074
+ if (source == springItem)
16512075 {
16522076 cSpring s = new cSpring();
16532077 s.setup();
16542078 makeSomething(s);
16552079 } else
1656
- if (event.getSource() == flagItem)
2080
+ if (source == flagItem)
16572081 {
16582082 cSpring s = new cFlag();
16592083 s.setup();
16602084 makeSomething(s);
16612085 } else
1662
- if (event.getSource() == lightItem)
2086
+ if (source == lightItem || source == lightButton)
16632087 {
16642088 makeSomething(new Light());
16652089 } else
1666
- if (event.getSource() == csgItem)
2090
+ if (source == csgItem)
16672091 {
16682092 group(new CSG());
16692093 } else
1670
- if (event.getSource() == templateItem)
2094
+ if (source == templateItem)
16712095 {
16722096 group(new cTemplate());
16732097 } else
1674
- if (event.getSource() == attributeItem)
2098
+ if (source == attributeItem)
16752099 {
16762100 makeSomething(new Attribute());
16772101 } else
1678
- if (event.getSource() == pointflowItem)
2102
+ if (source == pointflowItem)
16792103 {
16802104 makeSomething(new PointFlow());
16812105 } else
....@@ -1687,7 +2111,7 @@
16872111 } else
16882112 */
16892113
1690
- if (event.getSource() == superLoopItem)
2114
+ if (source == superLoopItem)
16912115 {
16922116 Composite g = new cGroup();
16932117 for (int i=0; i<15; i++)
....@@ -1709,30 +2133,30 @@
17092133
17102134 group(g);
17112135 } else
1712
- if (event.getSource() == loopItem)
2136
+ if (source == loopItem || source == loopButton)
17132137 {
17142138 Composite csg = new GroupLeaf();
17152139 csg.count = 5;
17162140 group(csg);
1717
- Composite child = new cGroup();
2141
+ Composite child = new cGroup("Branch");
17182142 csg.addChild(child);
17192143 child.addChild(csg);
17202144 } else
1721
- if (event.getSource() == doubleItem)
2145
+ if (source == doubleItem)
17222146 {
1723
- Composite csg = new GroupLeaf();
2147
+ Composite csg = new GroupLeaf("Fork");
17242148 csg.count = 5;
17252149 group(csg);
1726
- Composite child = new cGroup();
2150
+ Composite child = new cGroup("Branch A");
17272151 csg.addChild(child);
17282152 child.addChild(csg);
1729
- child = new cGroup();
2153
+ child = new cGroup("Branch B");
17302154 csg.addChild(child);
17312155 child.addChild(csg);
17322156 } else
1733
- if (event.getSource() == tripleItem)
2157
+ if (source == tripleItem)
17342158 {
1735
- Composite csg = new GroupLeaf();
2159
+ Composite csg = new GroupLeaf("Trident");
17362160 csg.count = 4;
17372161 group(csg);
17382162 Composite child = new cGroup();
....@@ -1745,73 +2169,84 @@
17452169 csg.addChild(child);
17462170 child.addChild(csg);
17472171 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
2172
+ if (source == computeAOItem)
17502173 {
1751
- ImportGFD();
2174
+ Globals.drawMode = CameraPane.OCCLUSION;
2175
+ Globals.theRenderer.repaint();
17522176 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
2177
+ if (source == recompileItem)
17712178 {
17722179 Recompile();
17732180 refreshContents();
17742181 } else
1775
- if (event.getSource() == editScriptItem)
2182
+ if (source == editScriptItem)
17762183 {
17772184 OpenDialog();
17782185 refreshContents();
17792186 } else
1780
- if (event.getSource() == invariantsItem)
2187
+ if (source == invariantsItem)
17812188 {
17822189 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
2190
+ Grafreed.grafreeD.universe.invariants();
17842191 } else
1785
- if (event.getSource() == memoryItem)
2192
+ if (source == memoryItem)
17862193 {
17872194 //System.out.println("Invariants:");
17882195 PrintMemory();
17892196 } else
1790
- if (event.getSource() == pathItem)
2197
+ if (source == pathItem)
17912198 {
17922199 PrintPath();
17932200 } else
1794
- if (event.getSource() == analyzeItem)
2201
+ if (source == analyzeItem)
17952202 {
17962203 AnalyzeObject();
17972204 } else
1798
- if (event.getSource() == dumpItem)
2205
+ if (source == dumpItem)
17992206 {
18002207 DumpObject();
18012208 } else
1802
- if (event.getSource() == screenfitButton)
2209
+ if (source == minButton)
18032210 {
1804
- //Reload(lastConverter, lastFilename, true);
2211
+ Minimize();
2212
+ } else
2213
+ if (source == maxButton)
2214
+ {
2215
+ Maximize();
2216
+ } else
2217
+ if (source == fullButton)
2218
+ {
2219
+ ToggleFullScreen();
2220
+ } else
2221
+ if (source == undoButton)
2222
+ {
2223
+ if (!Undo())
2224
+ java.awt.Toolkit.getDefaultToolkit().beep();
2225
+ } else
2226
+ if (source == redoButton)
2227
+ {
2228
+ Redo();
2229
+ } else
2230
+ if (source == saveButton)
2231
+ {
2232
+ if (!Save(true))
2233
+ java.awt.Toolkit.getDefaultToolkit().beep();
2234
+ } else
2235
+ if (source == oneStepButton)
2236
+ {
2237
+ Globals.ONESTEP = true;
2238
+ cameraView.repaint();
2239
+ } else
2240
+ if (source == screenfitButton)
2241
+ {
18052242 ScreenFit();
18062243 } else
1807
- if (event.getSource() == screenfitpointButton)
2244
+ if (source == screenfitpointButton)
18082245 {
1809
- //Reload(lastConverter, lastFilename, true);
18102246 ScreenFitPoint();
18112247 } else
1812
- if (event.getSource() == snapobjectButton)
2248
+ if (source == snapobjectButton)
18132249 {
1814
- //Reload(lastConverter, lastFilename, true);
18152250 SnapObject();
18162251 } else
18172252 // if (event.getSource() == recompileButton)
....@@ -1820,13 +2255,13 @@
18202255 // Recompile();
18212256 // refreshContents();
18222257 // } else
1823
- if (event.getSource() == gcButton)
2258
+ if (source == gcButton)
18242259 {
18252260 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262261 System.gc();
18272262 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282263 } else
1829
- if (event.getSource() == editLeafItem)
2264
+ if (source == editLeafItem)
18302265 {
18312266 Object3D obj;
18322267 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2275,74 @@
18402275 }
18412276 refreshContents(true);
18422277 } else
1843
- if (event.getSource() == openWindowItem)
2278
+ if (source == openWindowItem)
18442279 {
18452280 EditSelection(true);
18462281 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2282
+ if (source == cutItem || source == clearButton)
18482283 {
18492284 loadClipboard(true);
18502285 } else
1851
- if (event.getSource() == duplicateItem)
2286
+ if (source == undoItem)
18522287 {
1853
- Object3D keep = GrafreeD.clipboard;
2288
+ Undo();
2289
+ } else
2290
+ if (source == redoItem)
2291
+ {
2292
+ Redo();
2293
+ } else
2294
+ if (source == duplicateItem)
2295
+ {
2296
+ Object3D keep = Grafreed.clipboard;
18542297 loadClipboard(false);
18552298 paste(false);
1856
- GrafreeD.clipboard = keep;
2299
+ Grafreed.clipboard = keep;
18572300 } else
1858
- if (event.getSource() == cloneItem)
2301
+ if (source == cloneItem)
18592302 {
18602303 CloneSelection(false);
18612304 } else
1862
- if (event.getSource() == cloneSupportItem)
2305
+ if (source == cloneSupportItem)
18632306 {
18642307 CloneSelection(true);
18652308 } else
1866
- if (event.getSource() == copyItem)
2309
+ if (source == copyItem)
18672310 {
18682311 loadClipboard(false);
18692312 } else
1870
- if (event.getSource() == pasteItem)
2313
+ if (source == pasteItem)
18712314 {
18722315 paste(false);
18732316 } else
1874
- if (event.getSource() == pasteLinkItem)
2317
+ if (source == pasteIntoItem)
18752318 {
1876
- pasteInto(false);
2319
+ pasteInto(true, false);
18772320 } else
1878
- if (event.getSource() == pasteCloneItem)
2321
+ if (source == pasteLinkItem)
18792322 {
1880
- pasteInto(true);
2323
+ pasteInto(false, false);
18812324 } else
1882
- if (event.getSource() == pasteExpandItem)
2325
+ if (source == pasteCloneItem)
2326
+ {
2327
+ pasteInto(true, true);
2328
+ } else
2329
+ if (source == pasteExpandItem)
18832330 {
18842331 paste(true);
18852332 } else
1886
- if (event.getSource() == synchronizeItem)
2333
+ if (source == synchronizeItem)
18872334 {
18882335 Overwrite(Object3D.TRANSFORM);
18892336 } else
1890
- if (event.getSource() == overwriteNameItem)
2337
+ if (source == overwriteNameItem)
18912338 {
18922339 Overwrite(Object3D.NAME);
18932340 } else
1894
- if (event.getSource() == overwriteUVItem)
2341
+ if (source == overwriteUVItem)
18952342 {
18962343 Overwrite(Object3D.UV);
18972344 } else
1898
- if (event.getSource() == overwriteMatItem)
2345
+ if (source == overwriteMatItem)
18992346 {
19002347 /* july 2015
19012348 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2362,7 @@
19152362
19162363 Overwrite(dropAttributes);
19172364 }
1918
- if (event.getSource() == overwriteGeoItem)
2365
+ if (source == overwriteGeoItem)
19192366 {
19202367 Overwrite(Object3D.GEOMETRY);
19212368 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2379,7 @@
19322379 // refreshContents();
19332380 // }
19342381 } else
1935
- if (event.getSource() == generateMeshItem)
2382
+ if (source == generateMeshItem)
19362383 {
19372384 //if (group.selection.size() == 1)
19382385 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2390,7 @@
19432390 ResetModel();
19442391 refreshContents();
19452392 } else
1946
- if (event.getSource() == extractGeometriesItem)
2393
+ if (source == extractGeometriesItem)
19472394 {
19482395 boolean one = false;
19492396
....@@ -1970,7 +2417,7 @@
19702417 ResetModel();
19712418 refreshContents();
19722419 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2420
+ if (source == cloneGeometriesItem)
19742421 {
19752422 boolean one = false;
19762423
....@@ -1996,32 +2443,37 @@
19962443 ResetModel();
19972444 refreshContents();
19982445 } else
1999
- if (event.getSource() == shareGeometriesItem)
2446
+ if (source == shareGeometriesItem)
20002447 {
20012448 boolean one = false;
20022449
20032450 if (group.selection.size() == 1)
20042451 one = true;
20052452
2453
+ Object3D merge = null;
2454
+
20062455 Object3D content = new cGroup();
20072456
20082457 for (int i=0; i<group.selection.size(); i++)
20092458 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2459
+ merge = new Merge(group.selection.get(i));
20112460
20122461 if (one)
2013
- makeSomething(sel, false);
2462
+ makeSomething(merge, false);
20142463 else
2015
- content.addChild(sel);
2464
+ content.addChild(merge);
20162465 }
20172466
20182467 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2468
+ makeSomething(content, true);
2469
+ else
2470
+ {
2471
+ ResetModel();
2472
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2473
+ refreshContents();
2474
+ }
20232475 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2476
+ if (source == mergeGeometriesItem)
20252477 {
20262478 boolean one = false;
20272479
....@@ -2051,7 +2503,7 @@
20512503 ResetModel();
20522504 refreshContents();
20532505 } else
2054
- if (event.getSource() == linkverticesItem)
2506
+ if (source == linkverticesItem)
20552507 {
20562508 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572509 // {
....@@ -2064,39 +2516,48 @@
20642516 // group.selection.get(0).setMasterThis(content); // should be identity
20652517 // refreshContents();
20662518 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2519
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682520 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2521
+ Object3D content = Grafreed.clipboard.get(0);
20702522
20712523 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722524 content = ((cGroup)content).get(0);
20732525
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2526
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752527 for (int i=0; i<group.selection.size(); i++)
20762528 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2529
+ boolean random = CameraPane.SWITCH;
2530
+ CameraPane.SWITCH = false; // parse all random nodes
20792531 group.selection.get(i).linkVerticesThis(content);
20802532 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2533
+ CameraPane.SWITCH = random;
20822534 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2535
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842536 refreshContents();
20852537 }
20862538 } else
2087
- if (event.getSource() == resetsupportItem)
2539
+ if (source == resetsupportItem)
20882540 {
20892541 for (int i=0; i<group.selection.size(); i++)
20902542 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2543
+ boolean random = CameraPane.SWITCH;
2544
+ CameraPane.SWITCH = false; // parse all random nodes
20932545 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2546
+ CameraPane.SWITCH = random;
20952547 }
20962548
20972549 refreshContents();
20982550 } else
2099
- if (event.getSource() == resetreferencesItem)
2551
+ if (source == relinkverticesItem)
2552
+ {
2553
+ boolean random = CameraPane.SWITCH;
2554
+ CameraPane.SWITCH = false; // parse all random nodes
2555
+ group.selection.RelinkToSupport();
2556
+ CameraPane.SWITCH = random;
2557
+
2558
+ refreshContents();
2559
+ } else
2560
+ if (source == resetreferencesItem)
21002561 {
21012562 for (int i=0; i<group.selection.size(); i++)
21022563 {
....@@ -2105,11 +2566,11 @@
21052566
21062567 refreshContents();
21072568 } else
2108
- if (event.getSource() == setMasterItem)
2569
+ if (source == setMasterItem)
21092570 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2571
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112572 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2573
+ Object3D content = Grafreed.clipboard.get(0);
21132574
21142575 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152576 content = ((cGroup)content).get(0);
....@@ -2118,13 +2579,13 @@
21182579 refreshContents();
21192580 }
21202581 } else
2121
- if (event.getSource() == poseMeshItem)
2582
+ if (source == poseMeshItem)
21222583 {
21232584 if (group.selection.size() == 1)
21242585 {
2125
- if (GrafreeD.clipboard.size() == 1)
2586
+ if (Grafreed.clipboard.size() == 1)
21262587 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2588
+ Object3D content = Grafreed.clipboard.get(0);
21282589
21292590 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302591 content = ((cGroup)content).get(0);
....@@ -2137,19 +2598,19 @@
21372598 }
21382599
21392600 } else
2140
- if (event.getSource() == revertMeshItem)
2601
+ if (source == revertMeshItem)
21412602 {
21422603 RevertMeshes();
21432604 } else
2144
- if (event.getSource() == resetMeshItem)
2605
+ if (source == resetAllItem)
21452606 {
21462607 ResetAll();
21472608 } else
2148
- if (event.getSource() == stepAllItem)
2609
+ if (source == stepAllItem)
21492610 {
21502611 StepAll();
21512612 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2613
+ if (source == clearItem) // || event.getSource() == clearButton)
21532614 {
21542615 //int indices[] = jList.getSelectedIndices();
21552616 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2618,46 @@
21572618
21582619 ClearSelection(false);
21592620 } else
2160
- if (event.getSource() == clearAllItem)
2621
+ if (source == clearAllItem)
21612622 {
21622623 ClearSelection(true);
21632624 } else
2164
- if (event.getSource() == grabItem)
2625
+ if (source == grabItem || source == groupButton)
21652626 {
2166
- group(new cGroup(), true);
2627
+ group(new cGroup(), false); // true);
21672628 } else
2168
- if (event.getSource() == frontItem)
2629
+ if (source == hideItem)
2630
+ {
2631
+ group(new HiddenObject());
2632
+ } else
2633
+ if (source == frontItem)
21692634 {
21702635 front();
21712636 } else
2172
- if (event.getSource() == backItem)
2637
+ if (source == backItem)
21732638 {
21742639 back();
21752640 } else
2176
- if (event.getSource() == cameraItem)
2641
+ if (source == cameraItem)
21772642 {
21782643 makeSomething(new Camera());
21792644 } else
2180
- if (event.getSource() == compositeItem)
2645
+ if (source == compositeItem || source == compositeButton)
21812646 {
21822647 group(new Composite());
21832648 } else
2184
- if (event.getSource() == randomItem)
2649
+ if (source == switchItem || source == switchButton)
21852650 {
21862651 RandomNode random = new RandomNode();
21872652 group(random);
21882653 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2654
+ random.name = random.get(0).name + "Switch";
21902655 } else
2191
- if (event.getSource() == physicsItem)
2656
+ if (source == physicsItem)
21922657 {
21932658 group(new PhysicsNode());
21942659 } else
2195
- if (event.getSource() == frameselectorItem)
2660
+ if (source == frameselectorItem)
21962661 {
21972662 for (int i=0; i<group.selection.size(); i++)
21982663 {
....@@ -2204,7 +2669,7 @@
22042669 ResetModel();
22052670 refreshContents();
22062671 } else
2207
- if (event.getSource() == switchGeoItem)
2672
+ if (source == switchGeoItem)
22082673 {
22092674 for (int i=0; i<group.selection.size(); i++)
22102675 {
....@@ -2216,7 +2681,7 @@
22162681 ResetModel();
22172682 refreshContents();
22182683 } else
2219
- if (event.getSource() == switchTransfoItem)
2684
+ if (source == switchTransfoItem)
22202685 {
22212686 for (int i=0; i<group.selection.size(); i++)
22222687 {
....@@ -2228,7 +2693,7 @@
22282693 ResetModel();
22292694 refreshContents();
22302695 } else
2231
- if (event.getSource() == morphItem)
2696
+ if (source == morphItem)
22322697 {
22332698 for (int i=0; i<group.selection.size(); i++)
22342699 {
....@@ -2240,7 +2705,7 @@
22402705 ResetModel();
22412706 refreshContents();
22422707 } else
2243
- if (event.getSource() == scriptNodeItem)
2708
+ if (source == scriptNodeItem)
22442709 {
22452710 boolean atleastone = false;
22462711
....@@ -2279,199 +2744,252 @@
22792744 }
22802745 }
22812746 } else
2282
- if (event.getSource() == linkerItem)
2747
+ if (source == linkerItem)
22832748 {
22842749 group(new cLinker());
22852750 } else
2286
- if (event.getSource() == textureItem)
2751
+ if (source == textureItem || source == textureButton)
22872752 {
22882753 group(new TextureNode());
22892754 } else
2290
- if (event.getSource() == shadowXItem)
2755
+ if (source == billboardItem)
2756
+ {
2757
+ group(new BillboardNode());
2758
+ } else
2759
+ if (source == shadowXItem)
22912760 {
22922761 CastShadow(0);
22932762 } else
2294
- if (event.getSource() == shadowYItem)
2763
+ if (source == shadowYItem)
22952764 {
22962765 CastShadow(1);
22972766 } else
2298
- if (event.getSource() == shadowZItem)
2767
+ if (source == shadowZItem)
22992768 {
23002769 CastShadow(2);
23012770 } else
2302
- if (event.getSource() == ungroupItem)
2771
+ if (source == ungroupItem || source == ungroupButton)
23032772 {
2304
- ungroup();
2773
+ boolean hasRoot = false;
2774
+
2775
+ for (int i=0; i<group.selection.size(); i++)
2776
+ {
2777
+ if (group.selection.get(i) == group)
2778
+ {
2779
+ hasRoot = true;
2780
+ break;
2781
+ }
2782
+ }
2783
+
2784
+ if (!hasRoot)
2785
+ {
2786
+ for (int i=0; i<group.selection.size(); i++)
2787
+ {
2788
+ Ungroup(group.selection.get(i));
2789
+ }
2790
+
2791
+ ClearSelection(false);
2792
+
2793
+ refreshContents();
2794
+ }
23052795 } else
2306
- if (event.getSource() == genUVItem)
2796
+ if (source == genUVItem)
23072797 {
23082798 GenUV();
23092799 } else
2310
- if (event.getSource() == genNormalsCADItem)
2800
+ if (source == genNormalsCADItem)
23112801 {
23122802 GenNormals(true);
23132803 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2804
+ if (source == genNormalsMESHItem)
23152805 {
2316
- GenNormals(true); // TODO
2806
+ GenNormalsMESH();
23172807 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2808
+ if (source == genNormalsORGANItem)
23192809 {
23202810 GenNormals(false);
23212811 } else
2322
- if (event.getSource() == stripifyItem)
2812
+ if (source == genNormalsMINEItem)
2813
+ {
2814
+ GenNormalsMINE();
2815
+ } else
2816
+ if (source == stripifyItem)
23232817 {
23242818 Stripify();
23252819 } else
2326
- if (event.getSource() == unstripifyItem)
2820
+ if (source == unstripifyItem)
23272821 {
23282822 Unstripify();
23292823 } else
2330
- if (event.getSource() == trimItem)
2824
+ if (source == trimItem)
23312825 {
23322826 Trim();
23332827 } else
2334
- if (event.getSource() == untrimItem)
2828
+ if (source == untrimItem)
23352829 {
23362830 Untrim();
23372831 } else
2338
- if (event.getSource() == clearColorsItem)
2832
+ if (source == clearColorsItem)
23392833 {
23402834 ClearColors();
23412835 } else
2342
- if (event.getSource() == clearMaterialsItem)
2836
+ if (source == clearMaterialsItem)
23432837 {
23442838 ClearMaterials();
23452839 } else
2346
- if (event.getSource() == liveleavesItem)
2840
+ if (source == liveleavesItem)
23472841 {
23482842 LiveLeaves(true);
23492843 } else
2350
- if (event.getSource() == unliveleavesItem)
2844
+ if (source == unliveleavesItem)
23512845 {
23522846 LiveLeaves(false);
23532847 } else
2354
- if (event.getSource() == supportleavesItem)
2848
+ if (source == supportleavesItem)
23552849 {
23562850 SupportLeaves(true);
23572851 } else
2358
- if (event.getSource() == unsupportleavesItem)
2852
+ if (source == unsupportleavesItem)
23592853 {
23602854 SupportLeaves(false);
23612855 } else
2362
- if (event.getSource() == hideleavesItem)
2856
+ if (source == hideleavesItem)
23632857 {
23642858 HideLeaves(true);
23652859 } else
2366
- if (event.getSource() == showleavesItem)
2860
+ if (source == showleavesItem)
23672861 {
23682862 HideLeaves(false);
23692863 } else
2370
- if (event.getSource() == markleavesItem)
2864
+ if (source == markleavesItem)
23712865 {
23722866 MarkLeaves(true);
23732867 } else
2374
- if (event.getSource() == unmarkleavesItem)
2868
+ if (source == unmarkleavesItem)
23752869 {
23762870 MarkLeaves(false);
23772871 } else
2378
- if (event.getSource() == flipVItem)
2872
+ if (source == rewindleavesItem)
2873
+ {
2874
+ RewindLeaves(true);
2875
+ } else
2876
+ if (source == unrewindleavesItem)
2877
+ {
2878
+ RewindLeaves(false);
2879
+ } else
2880
+ if (source == randomleavesItem)
2881
+ {
2882
+ RandomLeaves(true);
2883
+ } else
2884
+ if (source == unrandomleavesItem)
2885
+ {
2886
+ RandomLeaves(false);
2887
+ } else
2888
+ if (source == flipVItem)
23792889 {
23802890 FlipV(true);
23812891 } else
2382
- if (event.getSource() == unflipVItem)
2892
+ if (source == unflipVItem)
23832893 {
23842894 FlipV(false);
23852895 } else
2386
- if (event.getSource() == lowTexturesItem)
2896
+ if (source == lowTexturesItem)
23872897 {
23882898 SetTexRes(0);
23892899 } else
2390
- if (event.getSource() == normalTexturesItem)
2900
+ if (source == normalTexturesItem)
23912901 {
23922902 SetTexRes(1);
23932903 } else
2394
- if (event.getSource() == highTexturesItem)
2904
+ if (source == highTexturesItem)
23952905 {
23962906 SetTexRes(2);
23972907 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2908
+ if (source == veryhighTexturesItem)
23992909 {
24002910 SetTexRes(3);
24012911 } else
2402
- if (event.getSource() == maxTexturesItem)
2912
+ if (source == maxTexturesItem)
24032913 {
24042914 SetTexRes(4);
24052915 } else
2406
- if (event.getSource() == panoTexturesItem)
2916
+ if (source == panoTexturesItem)
24072917 {
24082918 SetTexRes(5);
24092919 } else
2410
- if (event.getSource() == reverseNormalsItem)
2920
+ if (source == reverseNormalsItem)
24112921 {
24122922 ReverseNormals();
24132923 } else
2414
- if (event.getSource() == parseverticesItem)
2924
+ if (source == parseverticesItem)
24152925 {
24162926 ParseVertices();
24172927 } else
2418
- if (event.getSource() == textureFieldItem)
2928
+ if (source == textureFieldItem)
24192929 {
24202930 TextureVertices();
24212931 } else
2422
- if (event.getSource() == alignItem)
2932
+ if (source == alignItem)
24232933 {
24242934 Align();
24252935 } else
2426
- if (event.getSource() == mirrorItem)
2936
+ if (source == mirrorItem)
24272937 {
24282938 MirrorPoses();
24292939 } else
2430
- if (event.getSource() == reduceMorphItem)
2940
+ if (source == reduceMorphItem)
24312941 {
24322942 MeshReduction(false);
24332943 } else
2434
- if (event.getSource() == reduce34MorphItem)
2944
+ if (source == reduce34MorphItem)
24352945 {
24362946 MeshReduction(true);
24372947 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2948
+ if (source == reverseTrianglesItem)
24392949 {
24402950 ReverseTriangles();
24412951 } else
2442
- if (event.getSource() == reduceMeshItem)
2952
+ if (source == reduceMeshItem)
24432953 {
24442954 ReduceMesh(false);
24452955 } else
2446
- if (event.getSource() == reduce34MeshItem)
2956
+ if (source == reduce34MeshItem)
24472957 {
24482958 ReduceMesh(true);
24492959 } else
2450
- if (event.getSource() == increaseMeshItem)
2960
+ if (source == increaseMeshItem)
24512961 {
24522962 IncreaseMesh();
24532963 } else
2454
- if (event.getSource() == clipMeshItem)
2964
+ if (source == clipMeshItem)
24552965 {
24562966 ClipMesh();
24572967 } else
2458
- if (event.getSource() == smoothMeshItem)
2968
+ if (source == smoothMeshItem)
24592969 {
24602970 SmoothMesh();
24612971 } else
2462
- if (event.getSource() == transformgeometryItem)
2972
+ if (source == transformGeometryItem)
24632973 {
24642974 TransformGeometry();
24652975 } else
2466
- if (event.getSource() == resetTransformItem)
2976
+ if (source == transformChildrenItem)
2977
+ {
2978
+ TransformChildren();
2979
+ } else
2980
+ if (source == resetTransformItem)
24672981 {
24682982 ResetTransform();
24692983 } else
2470
- if (event.getSource() == resetCentroidItem)
2984
+ if (source == resetCentroidItem)
24712985 {
2472
- ResetCentroid();
2986
+ ResetCentroid(true);
24732987 } else
2474
- if (event.getSource() == resetParentItem)
2988
+ if (source == resetCentroidXZItem)
2989
+ {
2990
+ ResetCentroid(false);
2991
+ } else
2992
+ if (source == resetParentItem)
24752993 {
24762994 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772995 {
....@@ -2481,7 +2999,7 @@
24812999
24823000 refreshContents();
24833001 } else
2484
- if (event.getSource() == repairParentItem)
3002
+ if (source == repairParentItem)
24853003 {
24863004 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24873005 {
....@@ -2495,7 +3013,21 @@
24953013
24963014 refreshContents();
24973015 } else
2498
- if (event.getSource() == sortbysizeItem)
3016
+ if (source == repairShadowItem)
3017
+ {
3018
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3019
+ {
3020
+ Object3D obj = (Object3D)e.nextElement();
3021
+ obj.RepairShadow();
3022
+// for (int i=0; i<obj.size(); i++)
3023
+// {
3024
+// obj.get(i).parent = obj;
3025
+// }
3026
+ }
3027
+
3028
+ refreshContents();
3029
+ } else
3030
+ if (source == sortbysizeItem)
24993031 {
25003032 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25013033 {
....@@ -2507,7 +3039,7 @@
25073039 ResetModel();
25083040 refreshContents();
25093041 } else
2510
- if (event.getSource() == sortbynameItem)
3042
+ if (source == sortbynameItem)
25113043 {
25123044 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25133045 {
....@@ -2519,7 +3051,7 @@
25193051 ResetModel();
25203052 refreshContents();
25213053 } else
2522
- if (event.getSource() == attachPigmentItem)
3054
+ if (source == attachPigmentItem)
25233055 {
25243056 String texture = GetFile("Attach pigment");
25253057 Object3D obj;
....@@ -2531,7 +3063,7 @@
25313063
25323064 refreshContents();
25333065 } else
2534
- if (event.getSource() == detachPigmentItem)
3066
+ if (source == detachPigmentItem)
25353067 {
25363068 Object3D obj;
25373069 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +3074,7 @@
25423074
25433075 refreshContents();
25443076 } else
2545
- if (event.getSource() == attachBumpItem)
3077
+ if (source == attachBumpItem)
25463078 {
25473079 String texture = GetFile("Attach bump");
25483080 Object3D obj;
....@@ -2554,7 +3086,7 @@
25543086
25553087 refreshContents();
25563088 } else
2557
- if (event.getSource() == detachBumpItem)
3089
+ if (source == detachBumpItem)
25583090 {
25593091 Object3D obj;
25603092 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +3097,7 @@
25653097
25663098 refreshContents();
25673099 } else
2568
- if (event.getSource() == pigmentBumpItem)
3100
+ if (source == pigmentBumpItem)
25693101 {
25703102 Object3D obj;
25713103 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +3108,237 @@
25763108
25773109 refreshContents();
25783110 } else
2579
- if (event.getSource() == flashSelectionButton)
3111
+ if (source == flashSelectionButton)
25803112 {
25813113 CameraPane.flash = true;
25823114 refreshContents();
25833115 } else
2584
- if (event.getSource() == oneButton)
3116
+ if (source == oneButton)
25853117 {
25863118 } else
2587
- if (event.getSource() == twoButton)
3119
+ if (source == twoButton)
25883120 {
25893121 radio.layout = twoButton;
3122
+
3123
+ if (CameraPane.FULLSCREEN)
3124
+ fullscreenLayout = radio.layout;
3125
+
25903126 // bug
25913127 //gridPanel.setDividerLocation(1.0);
25923128 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
3129
+// bigThree.remove(scenePanel);
3130
+// bigThree.remove(centralPanel);
3131
+// bigThree.remove(XYZPanel);
3132
+// aWindowConstraints.gridx = 0;
3133
+// aWindowConstraints.gridy = 0;
3134
+// aWindowConstraints.gridwidth = 1;
3135
+// // aConstraints.gridheight = 3;
3136
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3137
+// aWindowConstraints.weightx = 0;
3138
+// aWindowConstraints.weighty = 1;
3139
+// //bigThree.add(jtp, aWindowConstraints);
3140
+// aWindowConstraints.weightx = 1;
3141
+// aWindowConstraints.gridwidth = 3;
3142
+// // aConstraints.gridheight = 3;
3143
+// aWindowConstraints.gridx = 1;
3144
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3145
+// bigThree.add(centralPanel, aWindowConstraints);
3146
+// aWindowConstraints.weightx = 0;
3147
+// aWindowConstraints.gridx = 4;
3148
+// aWindowConstraints.gridwidth = 1;
3149
+// // aConstraints.gridheight = 3;
3150
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3151
+// //bigThree.add(XYZPanel, aWindowConstraints);
3152
+// scenePanel.setVisible(false);
3153
+// centralPanel.setVisible(true);
3154
+// XYZPanel.setVisible(false);
3155
+ bigThree.ClearUI();
3156
+ bigThree.add(centralPanel);
3157
+ bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
3160
+
3161
+// refreshContents(true);
3162
+//
3163
+// try
3164
+// {
3165
+// java.awt.Robot bot = new java.awt.Robot();
3166
+// int mask = InputEvent.BUTTON1_MASK;
3167
+// bot.mouseMove(100, 100);
3168
+// bot.mousePress(mask);
3169
+// bot.mouseRelease(mask);
3170
+// }
3171
+// catch (Exception e)
3172
+// {
3173
+//
3174
+// }
3175
+
26173176 } else
2618
- if (event.getSource() == threeButton)
3177
+ if (source == threeButton)
26193178 {
26203179 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
3180
+
3181
+ if (CameraPane.FULLSCREEN)
3182
+ fullscreenLayout = radio.layout;
3183
+
3184
+// bigThree.remove(scenePanel);
3185
+// bigThree.remove(centralPanel);
3186
+// bigThree.remove(XYZPanel);
3187
+// aWindowConstraints.gridx = 0;
3188
+// aWindowConstraints.gridy = 0;
3189
+// aWindowConstraints.gridwidth = 1;
3190
+// // aConstraints.gridheight = 3;
3191
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3192
+// aWindowConstraints.weightx = 0;
3193
+// aWindowConstraints.weighty = 1;
3194
+// //bigThree.add(jtp, aWindowConstraints);
3195
+// aWindowConstraints.weightx = 1;
3196
+// aWindowConstraints.gridwidth = 3;
3197
+// // aConstraints.gridheight = 3;
3198
+// aWindowConstraints.gridx = 1;
3199
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3200
+// bigThree.add(centralPanel, aWindowConstraints);
3201
+// aWindowConstraints.weightx = 0;
3202
+// aWindowConstraints.gridx = 4;
3203
+// aWindowConstraints.gridwidth = 1;
3204
+// // aConstraints.gridheight = 3;
3205
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3206
+// bigThree.add(XYZPanel, aWindowConstraints);
3207
+// bigThree.validate();
3208
+// scenePanel.setVisible(false);
3209
+// centralPanel.setVisible(true);
3210
+// XYZPanel.setVisible(true);
3211
+ bigThree.ClearUI();
3212
+ bigThree.add(centralPanel);
3213
+ bigThree.add(XYZPanel);
3214
+ bigThree.FlushUI();
3215
+
3216
+ cameraView.requestFocusInWindow();
26453217 } else
2646
- if (event.getSource() == fourButton)
3218
+ if (source == fourButton)
26473219 {
26483220 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
3221
+
3222
+ if (CameraPane.FULLSCREEN)
3223
+ fullscreenLayout = radio.layout;
3224
+
3225
+// bigThree.remove(scenePanel);
3226
+// bigThree.remove(centralPanel);
3227
+// bigThree.remove(XYZPanel);
3228
+// aWindowConstraints.gridx = 0;
3229
+// aWindowConstraints.gridy = 0;
3230
+// aWindowConstraints.gridwidth = 1;
3231
+// // aWindowConstraints.gridheight = 3;
3232
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3233
+// aWindowConstraints.weightx = 1;
3234
+// aWindowConstraints.weighty = 1;
3235
+// bigThree.add(scenePanel, aWindowConstraints);
3236
+// aWindowConstraints.weightx = 1;
3237
+// aWindowConstraints.gridwidth = 3;
3238
+// // aConstraints.gridheight = 3;
3239
+// aWindowConstraints.gridx = 1;
3240
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3241
+// //bigThree.add(cameraPanel, aWindowConstraints);
3242
+// aWindowConstraints.weightx = 0;
3243
+// aWindowConstraints.gridx = 4;
3244
+// aWindowConstraints.gridwidth = 1;
3245
+// // aWindowConstraints.gridheight = 3;
3246
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3247
+// //bigThree.add(XYZPanel, aWindowConstraints);
3248
+// bigThree.validate();
3249
+// scenePanel.setVisible(true);
3250
+// centralPanel.setVisible(false);
3251
+// XYZPanel.setVisible(false);
3252
+ bigThree.ClearUI();
3253
+ bigThree.add(scenePanel);
3254
+ bigThree.FlushUI();
3255
+
3256
+ cameraView.requestFocusInWindow();
26733257 } else
2674
- if (event.getSource() == sixButton)
3258
+ if (source == sixButton)
26753259 {
26763260 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
3261
+
3262
+ if (CameraPane.FULLSCREEN)
3263
+ fullscreenLayout = radio.layout;
3264
+
3265
+// bigThree.remove(scenePanel);
3266
+// bigThree.remove(centralPanel);
3267
+// bigThree.remove(XYZPanel);
3268
+// aWindowConstraints.gridx = 0;
3269
+// aWindowConstraints.gridy = 0;
3270
+// aWindowConstraints.gridwidth = 1;
3271
+// // aConstraints.gridheight = 3;
3272
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3273
+// aWindowConstraints.weightx = 0;
3274
+// aWindowConstraints.weighty = 1;
3275
+// bigThree.add(scenePanel, aWindowConstraints);
3276
+// aWindowConstraints.weightx = 1;
3277
+// aWindowConstraints.gridwidth = 3;
3278
+// // aWindowConstraints.gridheight = 3;
3279
+// aWindowConstraints.gridx = 1;
3280
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3281
+// bigThree.add(centralPanel, aWindowConstraints);
3282
+// aWindowConstraints.weightx = 0;
3283
+// aWindowConstraints.gridx = 4;
3284
+// aWindowConstraints.gridwidth = 1;
3285
+// // aWindowConstraints.gridheight = 3;
3286
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3287
+// //bigThree.add(XYZPanel, aConstraints);
3288
+// bigThree.validate();
3289
+// scenePanel.setVisible(true);
3290
+// centralPanel.setVisible(true);
3291
+// XYZPanel.setVisible(false);
3292
+ bigThree.ClearUI();
3293
+ bigThree.add(scenePanel);
3294
+ bigThree.add(centralPanel);
3295
+ bigThree.FlushUI();
3296
+
3297
+ cameraView.requestFocusInWindow();
27013298 } else
2702
- if (event.getSource() == sevenButton)
3299
+ if (source == sevenButton)
27033300 {
27043301 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
3302
+
3303
+ if (CameraPane.FULLSCREEN)
3304
+ fullscreenLayout = radio.layout;
3305
+
3306
+// bigThree.remove(scenePanel);
3307
+// bigThree.remove(centralPanel);
3308
+// bigThree.remove(XYZPanel);
3309
+// aWindowConstraints.gridx = 0;
3310
+// aWindowConstraints.gridy = 0;
3311
+// aWindowConstraints.gridwidth = 1;
3312
+// // aWindowConstraints.gridheight = 3;
3313
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3314
+// aWindowConstraints.weightx = 0;
3315
+// aWindowConstraints.weighty = 1;
3316
+// bigThree.add(scenePanel, aWindowConstraints);
3317
+// aWindowConstraints.weightx = 1;
3318
+// aWindowConstraints.gridwidth = 3;
3319
+// // aWindowConstraints.gridheight = 3;
3320
+// aWindowConstraints.gridx = 1;
3321
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3322
+// bigThree.add(centralPanel, aWindowConstraints);
3323
+// aWindowConstraints.weightx = 0;
3324
+// aWindowConstraints.gridx = 4;
3325
+// aWindowConstraints.gridwidth = 1;
3326
+// // aConstraints.gridheight = 3;
3327
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3328
+// bigThree.add(XYZPanel, aWindowConstraints);
3329
+// bigThree.validate();
3330
+// scenePanel.setVisible(true);
3331
+// centralPanel.setVisible(true);
3332
+// XYZPanel.setVisible(true);
3333
+ bigThree.ClearUI();
3334
+ bigThree.add(scenePanel);
3335
+ bigThree.add(centralPanel);
3336
+ bigThree.add(XYZPanel);
3337
+ bigThree.FlushUI();
3338
+
3339
+ cameraView.requestFocusInWindow();
27293340 } else
2730
- if (event.getSource() == rootButton)
3341
+ if (source == rootButton)
27313342 {
27323343 Object3D obj;
27333344 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2737,66 +3348,84 @@
27373348 EditObject(obj);
27383349 }
27393350
3351
+ cameraView.requestFocusInWindow();
27403352 refreshContents(true);
27413353 } else
2742
- if (event.getSource() == closeButton)
3354
+ if (source == closeButton)
27433355 {
27443356 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453357 cRadio ab;
27463358 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27473359 {
27483360 ab = (cRadio)e.nextElement();
2749
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3361
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27503362 {
3363
+ // Patch to avoid bug with transparency.
3364
+ if (!ab.hadMaterial)
3365
+ {
3366
+ ab.object.material = null;
3367
+ }
3368
+
27513369 buttonGroup.remove(ab);
27523370 radioPanel.remove(ab);
27533371
2754
- ab.GetObject().editWindow = null;
3372
+ //ab.GetObject().editWindow = null;
3373
+ ab.GetObject().manipWindow = null;
27553374 // ab.GetObject().objectUI = null; // ?????????
27563375
27573376 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27583377 break;
27593378 }
27603379 }
3380
+
3381
+ cameraView.requestFocusInWindow();
27613382 refreshContents(true);
27623383 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3384
+ if (source == editItem || source == editButton)
27643385 {
3386
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3387
+ {
3388
+ Object3D child = (Object3D)e.nextElement();
3389
+ child.pinned = true;
3390
+ }
3391
+
27653392 EditSelection(false);
27663393 } else
2767
- if (event.getSource() == uneditButton)
3394
+ if (source == uneditButton)
27683395 {
27693396 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703397 {
27713398 Object3D child = (Object3D)e.nextElement();
27723399 if(child.editWindow != null)
27733400 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3401
+ child.pinned = false;
27743402 child.CloseUI();
27753403 listUI.remove(child);
27763404
2777
- child.editWindow = null; // ???????????
3405
+ //child.editWindow = null; // ???????????
27783406 }
2779
- objEditor.ctrlPanel.revalidate();
3407
+ objEditor.ctrlPanel.FlushUI();
27803408 //objEditor.jTree.clearSelection();
27813409 //objEditor.ResetSliders();
27823410 refreshContents(true);
27833411 } else
2784
- if (event.getSource() == clearPanelButton)
3412
+ if (source == clearPanelButton)
27853413 {
27863414 assert(copy == group);
27873415 //copy.ClearUI();
27883416 for (Object3D obj : listUI)
27893417 {
3418
+ obj.pinned = false;
27903419 obj.CloseUI();
27913420 }
27923421 listUI.clear();
27933422 refreshContents(true);
27943423 } else
2795
- if (event.getSource() == allParamsButton)
3424
+ if (source == allParamsButton)
27963425 {
27973426 assert(copy == group);
27983427
2799
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3428
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28003429
28013430 for (Object3D obj : listUI)
28023431 {
....@@ -2813,19 +3442,19 @@
28133442
28143443 refreshContents(true);
28153444 } else
2816
- if (event.getSource() == unselectButton)
3445
+ if (source == unselectButton)
28173446 {
28183447 objEditor.jTree.clearSelection();
28193448 // ?? oct 2012 GrafreeD.clipboard.clear();
28203449 objEditor.ResetSliders();
28213450 refreshContents(true);
28223451 } else
2823
- if(event.getSource() instanceof cRadio)
3452
+ if(source instanceof cRadio)
28243453 {
28253454 group.parent = keepparent;
28263455 group.attributes = 0;
28273456 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3457
+ /*cRadio*/ radio = (cRadio)source;
28293458 Object3D obj = radio.GetObject();
28303459 System.out.println("Edit " + obj);
28313460 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3474,7 @@
28453474 }
28463475
28473476 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3477
+ //Globals.theRenderer.object = group;
28493478 if(!useclient)
28503479 {
28513480 cameraView.renderCamera = radio.camera;
....@@ -2854,25 +3483,50 @@
28543483 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553484 cameraView.targetLookAt.set(radio.camera.lookAt);
28563485 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3486
+ //cameraView.lighttouched = true;
3487
+ Globals.lighttouched = true;
28583488 topView.object = group;
28593489 frontView.object = group;
28603490 sideView.object = group;
28613491 }
2862
- group.editWindow = this;
3492
+
3493
+// fix "+" issue
3494
+ //group.editWindow = this;
3495
+ group.manipWindow = this;
3496
+
28633497 /*
28643498 currentLayout = radio.layout;
28653499 if (currentLayout == null)
28663500 currentLayout = sevenButton;
28673501 */
28683502 radio.layout.doClick();
3503
+
3504
+ ClearUnpinned();
3505
+ SetPinStates(group.selection.size() > 0);
3506
+ if (group.selection.size() == 1)
3507
+ EditSelection(false);
28693508 keepparent = group.parent;
28703509 // PARENT = NULL or not???
28713510 //group.parent = null; // ROOT
28723511 //group.attributes = -1;
28733512 ResetModel();
3513
+
3514
+ cameraView.requestFocusInWindow();
28743515 refreshContents(true);
2875
- }
3516
+ } else if (event.getSource() == editCameraItem)
3517
+ {
3518
+ cameraView.ProtectCamera();
3519
+ cameraView.repaint();
3520
+ return;
3521
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3522
+ {
3523
+ cameraView.RevertCamera();
3524
+ cameraView.repaint();
3525
+ return;
3526
+ // } else if (event.getSource() == textureButton)
3527
+ // {
3528
+ // return; // true;
3529
+ }
28763530 else
28773531 {
28783532 //return super.action(event, arg);
....@@ -2881,7 +3535,6 @@
28813535 }
28823536
28833537 boolean useclient = false;
2884
- cRadio radio;
28853538
28863539 void ToggleRoot()
28873540 {
....@@ -2890,7 +3543,7 @@
28903543 if (useclient)
28913544 {
28923545 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3546
+ Globals.lighttouched = true;
28943547 //topView.object = client;
28953548 //frontView.object = client;
28963549 //sideView.object = client;
....@@ -2898,7 +3551,7 @@
28983551 else
28993552 {
29003553 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3554
+ Globals.lighttouched = true;
29023555 //topView.object = group;
29033556 //frontView.object = group;
29043557 //sideView.object = group;
....@@ -2933,6 +3586,28 @@
29333586 refreshContents();
29343587 }
29353588
3589
+ void TransformChildren()
3590
+ {
3591
+ Object3D obj;
3592
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3593
+ {
3594
+ obj = (Object3D)e.nextElement();
3595
+ obj.KeepTextureMatrices();
3596
+ obj.TransformChildren();
3597
+ obj.RestoreTextureMatrices();
3598
+
3599
+// if (obj.parent == null)
3600
+// {
3601
+// System.out.println("NULL PARENT!");
3602
+// new Exception().printStackTrace();
3603
+// }
3604
+// else
3605
+// TouchTransform(obj);
3606
+// //obj.parent.Touch();
3607
+ }
3608
+
3609
+ refreshContents();
3610
+ }
29363611
29373612 void ResetTransform()
29383613 {
....@@ -3045,7 +3720,7 @@
30453720 refreshContents();
30463721 }
30473722
3048
- void ResetCentroid()
3723
+ void ResetCentroid(boolean full)
30493724 {
30503725 Object3D obj;
30513726 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3735,16 @@
30603735 LA.matIdentity(Object3D.mat);
30613736 obj.getBounds(minima, maxima, false);
30623737 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3738
+ if (full)
3739
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643740 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653741 obj.TransformMesh(Object3D.mat);
3742
+
30663743 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3744
+ if (full)
3745
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683746 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3747
+
30693748 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703749 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713750 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3773,8 @@
30943773
30953774 int size = obj.MemorySize();
30963775
3097
- System.err.println((size/1024) + " KB is the size of " + obj);
3776
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3777
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30983778 }
30993779 }
31003780 catch (Exception e)
....@@ -3131,9 +3811,9 @@
31313811 obj = (Object3D)e.nextElement();
31323812
31333813 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3814
+ Grafreed.AnalyzeObject(obj);
31353815 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3816
+ Grafreed.AnalyzeObject(obj.bRep);
31373817
31383818 // System.err.println((size/1024) + " KB is the size of " + obj);
31393819 }
....@@ -3175,6 +3855,20 @@
31753855 void GenNormals(boolean crease)
31763856 {
31773857 group.GenNormalsS(crease);
3858
+
3859
+ refreshContents();
3860
+ }
3861
+
3862
+ void GenNormalsMESH()
3863
+ {
3864
+ group.GenNormalsMeshS();
3865
+
3866
+ refreshContents();
3867
+ }
3868
+
3869
+ void GenNormalsMINE()
3870
+ {
3871
+ group.selection.GenNormalsMINE();
31783872
31793873 refreshContents();
31803874 }
....@@ -3340,8 +4034,8 @@
33404034
33414035 void ParseVertices()
33424036 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
4037
+ boolean epsequal = Grafreed.epsequal;
4038
+ Grafreed.epsequal = true;
33454039
33464040 for (int i=0; i<group.selection.size(); i++)
33474041 {
....@@ -3366,7 +4060,7 @@
33664060 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33674061 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33684062
3369
- g.add(GrafreeD.clipboard);
4063
+ g.add(Grafreed.clipboard);
33704064
33714065 buffer.add(g);
33724066 }
....@@ -3381,7 +4075,7 @@
33814075 makeSomething(buffer, i==group.selection.size()-1);
33824076 }
33834077
3384
- GrafreeD.epsequal = epsequal;
4078
+ Grafreed.epsequal = epsequal;
33854079
33864080 refreshContents();
33874081 }
....@@ -3399,7 +4093,16 @@
33994093 String pigment = Object3D.GetPigment(tex);
34004094 //String bump = Object3D.GetBump(tex);
34014095
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4096
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4097
+
4098
+ try
4099
+ {
4100
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4101
+ }
4102
+ catch (Exception e)
4103
+ {
4104
+ System.err.println("FAIL: " + node);
4105
+ }
34034106
34044107 double s = v.s;
34054108
....@@ -3447,12 +4150,26 @@
34474150
34484151 void Align()
34494152 {
4153
+ if (group.selection.size() == 0)
4154
+ return;
4155
+
4156
+ cVector bbmin = new cVector();
4157
+ cVector bbmax = new cVector();
4158
+
4159
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4160
+
4161
+ double dx = bbmax.x - bbmin.x;
4162
+ double dy = bbmax.y - bbmin.y;
4163
+ double dz = bbmax.z - bbmin.z;
4164
+
4165
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4166
+
34504167 for (int i=0; i<group.selection.size(); i++)
34514168 {
34524169 Object3D obj = group.selection.get(i);
34534170
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4171
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4172
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34564173 }
34574174
34584175 refreshContents();
....@@ -3473,11 +4190,11 @@
34734190
34744191 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34754192
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
4193
+ boolean random = CameraPane.SWITCH;
4194
+ CameraPane.SWITCH = false; // parse all random nodes
34784195 lowres.linkVerticesThis(null);
34794196 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
4197
+ CameraPane.SWITCH = random;
34814198
34824199 System.err.flush();
34834200
....@@ -3517,7 +4234,7 @@
35174234 return;
35184235
35194236 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
4237
+ Object3D ref = Grafreed.clipboard.get(0);
35214238
35224239 Object3D newgroup = new Object3D("Po:" + poses.name);
35234240
....@@ -3686,7 +4403,7 @@
36864403 group.selection.RelinkToSupport(); // july 2014
36874404 System.out.println("DONE.");
36884405 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4406
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904407 }
36914408
36924409 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4428,9 @@
37114428
37124429 void ClipMesh()
37134430 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4431
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154432 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4433
+ Object3D content = Grafreed.clipboard.get(0);
37174434
37184435 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194436 content = ((cGroup)content).get(0);
....@@ -3722,7 +4439,7 @@
37224439 // {
37234440 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244441 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4442
+ group.selection.ClipMesh(Grafreed.clipboard);
37264443 }
37274444 // group.selection.ClipMesh(GrafreeD.clipboard);
37284445 System.out.println("DONE.");
....@@ -3769,6 +4486,18 @@
37694486 void MarkLeaves(boolean hide)
37704487 {
37714488 group.selection.MarkLeaves(hide);
4489
+ refreshContents();
4490
+ }
4491
+
4492
+ void RewindLeaves(boolean hide)
4493
+ {
4494
+ group.selection.RewindLeaves(hide);
4495
+ refreshContents();
4496
+ }
4497
+
4498
+ void RandomLeaves(boolean hide)
4499
+ {
4500
+ group.selection.RandomLeaves(hide);
37724501 refreshContents();
37734502 }
37744503
....@@ -3843,10 +4572,6 @@
38434572 // }
38444573 // }
38454574
3846
- static boolean allparams = true;
3847
-
3848
- static Vector<Object3D> listUI = new Vector<Object3D>();
3849
-
38504575 void EditSelection(boolean newWindow)
38514576 {
38524577 // aConstraints.gridy = 0;
....@@ -3854,10 +4579,10 @@
38544579 {
38554580 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38564581 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3857
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4582
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584583
38594584 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4585
+ if(elem != group || !newWindow)
38614586 {
38624587 // if (!(elem instanceof Composite))
38634588 // newWindow = false;
....@@ -3939,7 +4664,8 @@
39394664 //new Exception().printStackTrace();
39404665
39414666 freezemodel = true;
3942
-
4667
+ ClearUnpinned();
4668
+
39434669 /**/
39444670 //switch (event.id)
39454671 {
....@@ -3947,7 +4673,6 @@
39474673 //case 702: // Event.LIST_DESELECT
39484674 group.deselectAll();
39494675 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514676 if (tps != null)
39524677 {
39534678 for (int i=0; i < tps.length; i++)
....@@ -3956,33 +4681,39 @@
39564681
39574682 //if (child.parent != null)
39584683 //child.parent.addSelectee(child);
4684
+ objEditor.SetMaterial(child);
39594685 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634686 }
39644687 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4688
+// else
4689
+// {
4690
+// objEditor.SetMaterial(group); // .GetMaterial());
4691
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4692
+// System.err.println("info : " + group.GetPath());
4693
+// }
39714694
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4695
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39754696 CameraPane.flash = true;
39764697
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4698
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784699 // a camera
39794700 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4701
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4702
+ {
4703
+ CameraPane.camerachangeframe = 0; // don't refuse it
4704
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4705
+ }
4706
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4707
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844708 }
39854709
4710
+ if (tps != null && tps.length == 1)
4711
+ {
4712
+ EditSelection(false);
4713
+ }
4714
+
4715
+ SetPinStates(tps != null && tps.length > 0);
4716
+
39864717 refreshContents();
39874718 //return true;
39884719 }
....@@ -3991,6 +4722,35 @@
39914722
39924723 freezemodel = false;
39934724 }
4725
+
4726
+ void SetPinStates(boolean enabled)
4727
+ {
4728
+ editButton.setEnabled(enabled);
4729
+ uneditButton.setEnabled(enabled);
4730
+ unselectButton.setEnabled(enabled);
4731
+ flashSelectionButton.setEnabled(enabled);
4732
+ }
4733
+
4734
+ void refreshContents(boolean cp)
4735
+ {
4736
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4737
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4738
+ {
4739
+ objEditor.ClearInfo(); // .GetMaterial());
4740
+
4741
+ for (int i=0; i < group.selection.Size(); i++)
4742
+ {
4743
+ Object3D child = (Object3D) group.selection.get(i);
4744
+
4745
+ objEditor.AddInfo(child, this, true);
4746
+ System.err.println("info : " + child.GetPath());
4747
+ }
4748
+
4749
+ objEditor.SetText(); // jan 2014
4750
+ }
4751
+
4752
+ super.refreshContents(cp);
4753
+ }
39944754
39954755 void linkSomething(Object3D thing)
39964756 {
....@@ -4062,16 +4822,19 @@
40624822 {
40634823 if (group.selection.isEmpty())
40644824 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4825
+
4826
+ Grafreed.clipboardIsTempGroup = false;
40664827 Composite tGroup = null;
40674828 if (group.selection.size() > 0) // 1)
40684829 {
40694830 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4831
+ Grafreed.clipboardIsTempGroup = true;
40714832 }
40724833
40734834 if (cut)
40744835 {
4836
+ if (Globals.SAVEONMAKE)
4837
+ Save();
40754838 //int indices[] = jList.getSelectedIndices();
40764839 //for (int i = indices.length - 1; i >= 0; i--)
40774840 //jList.remove(indices[i]);
....@@ -4107,16 +4870,16 @@
41074870 //System.out.println("cut " + child);
41084871 //System.out.println("parent = " + child.parent);
41094872 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4873
+ if (Grafreed.clipboardIsTempGroup)
41114874 tGroup.add/*Child*/(tmp);
41124875 else
4113
- GrafreeD.clipboard = tmp;
4876
+ Grafreed.clipboard = tmp;
41144877 }
41154878 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4879
+ if (Grafreed.clipboardIsTempGroup)
41174880 tGroup.add/*Child*/(child);
41184881 else
4119
- GrafreeD.clipboard = child;
4882
+ Grafreed.clipboard = child;
41204883 }
41214884
41224885 //ResetModel();
....@@ -4148,21 +4911,23 @@
41484911 //System.out.println("cut " + elem);
41494912 //System.out.println("parent = " + elem.parent);
41504913 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4914
+ if (Grafreed.clipboardIsTempGroup)
41524915 tGroup.add/*Child*/(tmp);
41534916 else
4154
- GrafreeD.clipboard = tmp;
4917
+ Grafreed.clipboard = tmp;
41554918 }
41564919 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4920
+ if (Grafreed.clipboardIsTempGroup)
41584921 tGroup.add/*Child*/(child);
41594922 else
4160
- GrafreeD.clipboard = child;
4923
+ Grafreed.clipboard = child;
41614924 }
41624925
41634926 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4927
+
4928
+ if (Grafreed.clipboardIsTempGroup)
4929
+ Grafreed.clipboard = tGroup;
4930
+
41664931 if (cut)
41674932 {
41684933 ResetModel();
....@@ -4176,7 +4941,7 @@
41764941 // return;
41774942 boolean first = true;
41784943
4179
- if (GrafreeD.clipboardIsTempGroup)
4944
+ if (Grafreed.clipboardIsTempGroup)
41804945 {
41814946 Composite temp;
41824947
....@@ -4187,7 +4952,7 @@
41874952 temp = (Composite)Applet3D.clipboard.deepCopy();
41884953 */
41894954 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4955
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41914956 {
41924957 Object3D child = (Object3D)e.nextElement();
41934958
....@@ -4221,21 +4986,21 @@
42214986 //Object3D cb = Applet3D.clipboard;
42224987 //temp.addChild(cb);
42234988 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4989
+ assert(Grafreed.clipboard.parent == null);
4990
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4991
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4992
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4993
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42294994 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4995
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4996
+ Grafreed.clipboard.get(0).parent = keepparent;
42324997 }
42334998
42344999 ResetModel();
42355000 refreshContents();
42365001 }
42375002
4238
- void pasteInto(boolean copyit)
5003
+ void pasteInto(boolean copyit, boolean clone)
42395004 {
42405005 // if (GrafreeD.clipboard == null)
42415006 // return;
....@@ -4264,15 +5029,22 @@
42645029 if (copyit)
42655030 {
42665031 // paste(false);
4267
- CloneClipboard(false); // sept 2014
5032
+ if (clone)
5033
+ {
5034
+ CloneClipboard(false); // sept 2014
5035
+ }
5036
+ else
5037
+ {
5038
+ paste(false);
5039
+ }
42685040 }
42695041 else
42705042 {
42715043 boolean first = true;
42725044
4273
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
42745046 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
5047
+ Composite temp = (Composite)Grafreed.clipboard;
42765048 Object3D copy;
42775049 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42785050 {
....@@ -4282,7 +5054,7 @@
42825054 }
42835055 } else
42845056 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
5057
+ linkSomething(Grafreed.clipboard); //.get(0));
42865058 }
42875059 }
42885060 }
....@@ -4474,6 +5246,26 @@
44745246 makeSomething(csg);
44755247 }
44765248
5249
+ void Ungroup(Object3D g)
5250
+ {
5251
+ if (g instanceof HiddenObject)
5252
+ {
5253
+ HiddenObject h = (HiddenObject) g;
5254
+
5255
+ for (int i=0; i<h.ActualSize(); i++)
5256
+ {
5257
+ objEditor.makeSomething(h.get(i), false);
5258
+ }
5259
+ }
5260
+ else
5261
+ {
5262
+ for (int i=0; i<g.Size(); i++)
5263
+ {
5264
+ objEditor.makeSomething(g.get(i), false);
5265
+ }
5266
+ }
5267
+ }
5268
+
44775269 void ungroup()
44785270 {
44795271 /*
....@@ -4667,21 +5459,6 @@
46675459 }
46685460 */
46695461
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855462 /*
46865463 public void Callback(Object obj)
46875464 {
....@@ -4705,26 +5482,9 @@
47055482 }
47065483 */
47075484
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255485 String GetFile(String dialogName)
47265486 {
4727
- if (GrafreeD.standAlone)
5487
+ if (Grafreed.standAlone)
47285488 {
47295489 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305490 browser.show();
....@@ -4788,10 +5548,33 @@
47885548 cButton flashSelectionButton;
47895549 cButton editButton;
47905550 cButton uneditButton;
5551
+ JCheckBox allParamsButton;
47915552 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935553 cButton unselectButton;
47945554
5555
+ cButton restoreCameraButton;
5556
+
5557
+ cButton saveButton;
5558
+ cButton oneStepButton;
5559
+
5560
+ cButton groupButton;
5561
+ cButton ungroupButton;
5562
+ cButton compositeButton;
5563
+ cButton switchButton;
5564
+ cButton loopButton;
5565
+ cButton textureButton;
5566
+
5567
+ cButton gridButton;
5568
+ cButton boxButton;
5569
+ cButton sphereButton;
5570
+ cButton coneButton;
5571
+ cButton torusButton;
5572
+ cButton superButton;
5573
+ cButton kleinButton;
5574
+ cButton particlesButton;
5575
+ cButton overlayButton;
5576
+ cButton lightButton;
5577
+
47955578 cButton screenfitButton;
47965579 cButton screenfitpointButton;
47975580 cButton snapobjectButton;
....@@ -4803,14 +5586,6 @@
48035586
48045587 cButton setsupportButton;
48055588
4806
- cButton twoButton;
4807
- cButton sixButton;
4808
- cButton threeButton;
4809
- cButton sevenButton;
4810
- cButton fourButton; // full panel
4811
- cButton oneButton; // full XYZ
4812
- //cButton currentLayout;
4813
-
48145589 //
48155590 //Composite
48165591 Object3D // to do !!
....@@ -4820,9 +5595,11 @@
48205595 //JTree jTree;
48215596 private MenuItem lookAtItem;
48225597 private MenuItem lookFromItem;
4823
- private MenuItem switchItem;
5598
+ private MenuItem switchViewItem;
48245599 private MenuItem cutItem;
4825
- private MenuItem duplicateItem;
5600
+ private MenuItem undoItem;
5601
+ private MenuItem redoItem;
5602
+ private JMenuItem duplicateItem;
48265603 private MenuItem cloneItem;
48275604 private MenuItem cloneSupportItem;
48285605 private MenuItem overwriteGeoItem;
....@@ -4833,8 +5610,9 @@
48335610 private MenuItem resetsupportItem;
48345611 private MenuItem resetreferencesItem;
48355612 private MenuItem linkverticesItem;
5613
+ private MenuItem relinkverticesItem;
48365614 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5615
+ private MenuItem resetAllItem;
48385616 private MenuItem stepAllItem;
48395617 private MenuItem revertMeshItem;
48405618 private MenuItem poseMeshItem;
....@@ -4845,6 +5623,7 @@
48455623 private MenuItem mergeGeometriesItem;
48465624 private MenuItem copyItem;
48475625 private MenuItem pasteItem;
5626
+ private MenuItem pasteIntoItem;
48485627 private MenuItem pasteLinkItem;
48495628 private MenuItem pasteCloneItem;
48505629 private MenuItem pasteExpandItem;
....@@ -4854,6 +5633,7 @@
48545633 private MenuItem genNormalsMESHItem;
48555634 private MenuItem genNormalsCADItem;
48565635 private MenuItem genNormalsORGANItem;
5636
+ private MenuItem genNormalsMINEItem;
48575637 private MenuItem stripifyItem;
48585638 private MenuItem unstripifyItem;
48595639 private MenuItem trimItem;
....@@ -4882,6 +5662,10 @@
48825662 private MenuItem showleavesItem;
48835663 private MenuItem markleavesItem;
48845664 private MenuItem unmarkleavesItem;
5665
+ private MenuItem rewindleavesItem;
5666
+ private MenuItem unrewindleavesItem;
5667
+ private MenuItem randomleavesItem;
5668
+ private MenuItem unrandomleavesItem;
48855669
48865670 private MenuItem flipVItem;
48875671 private MenuItem unflipVItem;
....@@ -4893,14 +5677,17 @@
48935677 private MenuItem panoTexturesItem;
48945678
48955679 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5680
+ private MenuItem resetCentroidXZItem;
48975681 private MenuItem resetTransformItem;
5682
+ private MenuItem transformGeometryItem;
5683
+ private MenuItem transformChildrenItem;
5684
+ private MenuItem hideItem;
48985685 private MenuItem grabItem;
48995686 private MenuItem backItem;
49005687 private MenuItem frontItem;
49015688 private MenuItem cameraItem;
49025689 private MenuItem compositeItem;
4903
- private MenuItem randomItem;
5690
+ private MenuItem switchItem;
49045691 private MenuItem physicsItem;
49055692 private MenuItem frameselectorItem;
49065693 private MenuItem scriptNodeItem;
....@@ -4915,6 +5702,7 @@
49155702
49165703 private MenuItem resetParentItem;
49175704 private MenuItem repairParentItem;
5705
+ private MenuItem repairShadowItem;
49185706 private MenuItem sortbysizeItem;
49195707 private MenuItem sortbynameItem;
49205708
....@@ -4935,10 +5723,11 @@
49355723 private MenuItem coneItem;
49365724 private MenuItem torusItem;
49375725 private MenuItem superItem;
5726
+ private MenuItem kleinItem;
49385727 private MenuItem blobItem;
49395728 private MenuItem latheItem;
49405729 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5730
+ private MenuItem overlayItem;
49425731 private MenuItem meshItem;
49435732 // private MenuItem meshGroupItem;
49445733 private MenuItem springItem;
....@@ -4947,6 +5736,7 @@
49475736 private MenuItem csgItem;
49485737 private MenuItem templateItem;
49495738 private MenuItem textureItem;
5739
+ private MenuItem billboardItem;
49505740 private MenuItem shadowXItem;
49515741 private MenuItem shadowYItem;
49525742 private MenuItem shadowZItem;
....@@ -4959,11 +5749,6 @@
49595749 private MenuItem doubleItem;
49605750 private MenuItem tripleItem;
49615751
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675752 private MenuItem computeAOItem;
49685753 private MenuItem recompileItem;
49695754 private MenuItem editScriptItem;
....@@ -4973,4 +5758,8 @@
49735758 private MenuItem analyzeItem;
49745759 private MenuItem dumpItem;
49755760 //boolean freezemodel = false;
5761
+
5762
+ Menu cameraMenu;
5763
+ MenuItem editCameraItem;
5764
+ MenuItem restoreCameraItem;
49765765 }