Normand Briere
2019-05-02 c209bbe1cf788c9af3dcffea7667c830170a3f1f
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,
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,36 +163,48 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175174 cutItem = menu.add(new MenuItem("Cut"));
176175 cutItem.addActionListener(this);
177176 copyItem = menu.add(new MenuItem("Copy"));
178177 copyItem.addActionListener(this);
179178 pasteItem = menu.add(new MenuItem("Paste"));
180179 pasteItem.addActionListener(this);
180
+ menu.add("-");
181
+ cloneItem = menu.add(new MenuItem("Clone"));
182
+ cloneItem.addActionListener(this);
183
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
+ cloneSupportItem.addActionListener(this);
185
+ menu.add("-");
186
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
187
+ pasteIntoItem.addActionListener(this);
181188 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182189 pasteLinkItem.addActionListener(this);
183190 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184191 pasteCloneItem.addActionListener(this);
185192 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186193 // pasteExpandItem.addActionListener(this);
194
+ menu.add("-");
187195 clearItem = menu.add(new MenuItem("Clear"));
188196 clearItem.addActionListener(this);
197
+
198
+ if (Globals.ADVANCED)
199
+ {
200
+ // Deletes the cameras...
189201 clearAllItem = menu.add(new MenuItem("Clear All"));
190202 clearAllItem.addActionListener(this);
203
+ }
191204
192205 oe.menuBar.add(menu = new Menu("Setting"));
206
+ if (Globals.ADVANCED)
207
+ {
193208 resetMeshItem = menu.add(new MenuItem("Reset All"));
194209 resetMeshItem.addActionListener(this);
195210 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +214,7 @@
199214 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200215 resetreferencesItem.addActionListener(this);
201216 menu.add("-");
217
+ }
202218 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203219 overwriteGeoItem.addActionListener(this);
204220 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +226,26 @@
210226 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211227 overwriteUVItem.addActionListener(this);
212228 menu.add("-");
229
+ if (Globals.ADVANCED)
230
+ {
213231 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214232 generateMeshItem.addActionListener(this);
215233 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216234 poseMeshItem.addActionListener(this);
217235 menu.add("-");
236
+ }
218237 resetsupportItem = menu.add(new MenuItem("Reset support"));
219238 resetsupportItem.addActionListener(this);
220239 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221240 linkverticesItem.addActionListener(this);
241
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
242
+ relinkverticesItem.addActionListener(this);
243
+
244
+ if (Globals.ADVANCED)
245
+ {
222246 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223247 setMasterItem.addActionListener(this);
248
+ }
224249
225250 oe.menuBar.add(menu = new Menu("Group"));
226251 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +256,37 @@
231256 frontItem.addActionListener(this);
232257 compositeItem = menu.add(new MenuItem("Composite"));
233258 compositeItem.addActionListener(this);
259
+ hideItem = menu.add(new MenuItem("Hidden Group"));
260
+ hideItem.addActionListener(this);
261
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
262
+ ungroupItem.addActionListener(this);
234263 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
264
+ randomItem = menu.add(new MenuItem("Switch node"));
236265 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);
241266 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242267 switchGeoItem.addActionListener(this);
243268 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244269 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
270
+ morphItem = menu.add(new MenuItem("Morph Group"));
246271 morphItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
275
+ physicsItem = menu.add(new MenuItem("Physics"));
276
+ physicsItem.addActionListener(this);
277
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278
+ frameselectorItem.addActionListener(this);
247279 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248280 scriptNodeItem.addActionListener(this);
249281 cameraItem = menu.add(new MenuItem("Camera"));
250282 cameraItem.addActionListener(this);
283
+ }
251284
252285 oe.menuBar.add(menu = new Menu("Object"));
253286 textureItem = menu.add(new MenuItem("Texture"));
254287 textureItem.addActionListener(this);
288
+ billboardItem = menu.add(new MenuItem("Billboard"));
289
+ billboardItem.addActionListener(this);
255290 csgItem = menu.add(new MenuItem("CSG"));
256291 csgItem.addActionListener(this);
257292 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +295,24 @@
260295 shadowYItem.addActionListener(this);
261296 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262297 shadowZItem.addActionListener(this);
298
+ if (Globals.ADVANCED)
299
+ {
263300 linkerItem = menu.add(new MenuItem("Linker"));
264301 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267302 attributeItem = menu.add(new MenuItem("Attribute"));
268303 attributeItem.addActionListener(this);
304
+ templateItem = menu.add(new MenuItem("Template"));
305
+ templateItem.addActionListener(this);
269306 pointflowItem = menu.add(new MenuItem("Point Flow"));
270307 pointflowItem.addActionListener(this);
271308 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
309
+ }
274310 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275311 resetTransformItem.addActionListener(this);
276312 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277313 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
314
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
+ transformgeometryItem.addActionListener(this);
280316
281317 oe.menuBar.add(menu = new Menu("Geometry"));
282318 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +321,13 @@
285321 genNormalsORGANItem.addActionListener(this);
286322 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287323 genNormalsCADItem.addActionListener(this);
324
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
325
+ genNormalsMESHItem.addActionListener(this);
326
+ if (Globals.ADVANCED)
327
+ {
328
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
329
+ genNormalsMINEItem.addActionListener(this);
330
+ }
288331 stripifyItem = menu.add(new MenuItem("Stripify"));
289332 stripifyItem.addActionListener(this);
290333 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,10 +349,14 @@
306349 reduce34MeshItem.addActionListener(this);
307350 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308351 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311352 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312353 clipMeshItem.addActionListener(this);
354
+
355
+ if (Globals.ADVANCED)
356
+ {
357
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
358
+ smoothMeshItem.addActionListener(this);
359
+ }
313360
314361 oe.menuBar.add(menu = new Menu("Attributes"));
315362 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -319,10 +366,13 @@
319366 liveleavesItem.addActionListener(this);
320367 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321368 unliveleavesItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
322371 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323372 supportleavesItem.addActionListener(this);
324373 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325374 unsupportleavesItem.addActionListener(this);
375
+ }
326376 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327377 hideleavesItem.addActionListener(this);
328378 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -365,6 +415,8 @@
365415 sortbysizeItem.addActionListener(this);
366416 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367417 sortbynameItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
368420 menu.add("-");
369421 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370422 extractGeometriesItem.addActionListener(this);
....@@ -374,11 +426,11 @@
374426 shareGeometriesItem.addActionListener(this);
375427 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376428 mergeGeometriesItem.addActionListener(this);
429
+ }
377430
378431 oe.menuBar.add(menu = new Menu("Insert"));
379432 buildCreateMenu(menu);
380433
381
-
382434 oe.menuBar.add(menu = new Menu("Include"));
383435 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384436 importGFDItem.addActionListener(this);
....@@ -423,150 +475,98 @@
423475 oe.radioPanel.add(dummyButton);
424476 oe.buttonGroup.add(dummyButton);
425477 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
478
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429479
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
480
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
+ liveCB.setToolTipText("Enabled animation");
431482 liveCB.addItemListener(this);
432483
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
484
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485
+ oneStepButton.setToolTipText("Animate one step forward");
486
+ oneStepButton.addActionListener(this);
487
+
488
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
489
+ fastCB.setToolTipText("Fast mode");
451490 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
493
+ trackCB.setToolTipText("Enable tracking");
493494 trackCB.addItemListener(this);
494495
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
496
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
497
+ screenfitButton.setToolTipText("Screen fit");
497498 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
499
+
499500 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500501 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505502
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
503
+ if (Globals.ADVANCED)
504
+ {
505
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
506
+ snapobjectButton.addActionListener(this);
507
+ snapobjectButton.setToolTipText("Snap Object");
508
+ }
509
+
510
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ flashSelectionButton.setToolTipText("Show selection");
512512 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516513
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
514
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515
+
516
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ twoButton.setToolTipText("Show center view only");
519518 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
519
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521520 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
521
+ fourButton.setToolTipText("Show left panel only");
522
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523
+ sixButton.setToolTipText("2-column layout left");
523524 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
+ threeButton.setToolTipText("2-column layout right");
525527 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
528
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
+ sevenButton.setToolTipText("3-column layout");
527530 sevenButton.addActionListener(this);
528531 //
529532
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
533
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ rootButton.setToolTipText("Edit selection in new tab");
531535 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
536
+
537
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
538
+ closeButton.setToolTipText("Close tab");
534539 closeButton.addActionListener(this);
535540 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536541 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538542
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
+ cGridBag commandsPanel = new cGridBag();
544
+
545
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
+ editButton.setToolTipText("Edit selection");
541547 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545548
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
549
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
+ uneditButton.setToolTipText("Unedit selection");
547551 uneditButton.addActionListener(this);
548552
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
553
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
+ allParamsButton.setToolTipText("Edit all params");
561555 allParamsButton.addActionListener(this);
562556
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
557
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
558
+ clearPanelButton.setToolTipText("Clear edit panel");
559
+ clearPanelButton.addActionListener(this);
560
+
561
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
562
+ unselectButton.setToolTipText("Unselect");
568563 unselectButton.addActionListener(this);
569564
565
+ commandsPanel.preferredHeight = 1;
566
+
567
+ oe.treePanel.add(commandsPanel);
568
+ oe.treePanel.Return();
569
+
570570 // oe.aConstraints.gridx += 1;
571571 // oe.aConstraints.weighty = 0;
572572 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +578,37 @@
578578 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579579 // gcButton.addActionListener(this);
580580
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
581
+ cGridBag jSPPanel = new cGridBag();
582
+
583
+ JScrollPane jSP;
592584 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
585
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594586 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
587
+
588
+ oe.treePanel.add(jSPPanel);
589
+ oe.treePanel.Return();
599590
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
591
+ cGridBag copyOptionsPanel = new cGridBag();
592
+
593
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
+ colorCB.setToolTipText("Copy color when dropped");
604595 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
596
+
597
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
+ materialCB.setToolTipText("Copy material when dropped");
607599 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
600
+
601
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
+ textureCB.setToolTipText("Copy texture when dropped");
610603 textureCB.addItemListener(this);
611604
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
605
+ copyOptionsPanel.preferredHeight = 1;
606
+ oe.treePanel.add(copyOptionsPanel);
607
+ oe.treePanel.Return();
614608
609
+// mainPanel.setDividerLocation(0.5); //1.0);
610
+// mainPanel.setResizeWeight(0.5);
611
+
615612 //jList.addListSelectionListener(this);
616613 oe.jTree.addTreeSelectionListener(this);
617614 //jTree.setRootVisible(false);
....@@ -633,17 +630,89 @@
633630 radio.layout = sevenButton;
634631 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635632 }
633
+
634
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
635
+ {
636
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
637
+ boxCB.setToolTipText("Display bounding boxes");
638
+ boxCB.addItemListener(this);
639
+
640
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
641
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642
+ zoomBoxCB.addItemListener(this);
643
+
644
+ if (Globals.ADVANCED)
645
+ {
646
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
+ supportCB.setToolTipText("Enable rigging");
648
+ supportCB.addItemListener(this);
649
+
650
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
651
+ // localCB.addItemListener(this);
652
+
653
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
654
+ crowdCB.setToolTipText("Used for crowds");
655
+ crowdCB.addItemListener(this);
656
+
657
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
658
+ smoothCB.setToolTipText("Snapping delay");
659
+ smoothCB.addItemListener(this);
660
+
661
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
662
+ slowCB.setToolTipText("Smooth interpolation");
663
+ slowCB.addItemListener(this);
664
+
665
+// constraints.gridy += 1;
666
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
667
+// speakerMocapCB.addItemListener(this);
668
+
669
+ if (false)
670
+ {
671
+ // handled in scripts
672
+ //constraints.gridy += 1;
673
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
674
+ speakerCameraCB.addItemListener(this);
675
+
676
+ //constraints.gridy += 1;
677
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
678
+ speakerFocusCB.addItemListener(this);
679
+
680
+ //constraints.gridy += 1;
681
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
682
+ smoothfocusCB.addItemListener(this);
683
+ }
684
+
685
+//constraints.gridx += 1;
686
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
687
+// debugCB.addItemListener(this);
688
+
689
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
690
+ oeilCB.addItemListener(this);
691
+
692
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
693
+ lookAtCB.setToolTipText("Look-at target");
694
+ lookAtCB.addItemListener(this);
695
+
696
+ }
697
+
698
+ cGridBag fill = new cGridBag();
699
+
700
+ fill.preferredHeight = 200;
701
+
702
+ panel.add(fill);
703
+
704
+ }
636705
637706 void EditObject(Object3D obj)
638707 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
708
+ cRadio radioButton = new cRadio(obj.name);
709
+ radioButton.SetObject(obj);
710
+ radioButton.layout = sevenButton;
711
+ radioButton.SetCamera(cameraView.renderCamera, false);
712
+ radioButton.addActionListener(this);
713
+ radioPanel.add(radioButton);
714
+ buttonGroup.add(radioButton);
715
+ radioButton.doClick();
647716 }
648717 void SetupViews(ObjEditor oe)
649718 {
....@@ -663,6 +732,7 @@
663732 JCheckBox fastCB;
664733 JCheckBox slowCB;
665734 JCheckBox boxCB;
735
+ JCheckBox zoomBoxCB;
666736 JCheckBox trackCB;
667737 JCheckBox smoothfocusCB;
668738 // JCheckBox speakerMocapCB;
....@@ -705,8 +775,7 @@
705775 dropAttributes |= Object3D.TEXTURE;
706776 else
707777 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
778
+ } else if(e.getSource() == liveCB)
710779 {
711780 cameraView.ToggleLive();
712781 }
....@@ -743,6 +812,10 @@
743812 Recompile();
744813 cameraView.repaint();
745814 // refreshContents();
815
+ }
816
+ else if(e.getSource() == zoomBoxCB)
817
+ {
818
+ cameraView.ToggleZoomBoxMode();
746819 }
747820 else if(e.getSource() == smoothfocusCB)
748821 {
....@@ -911,11 +984,11 @@
911984 {
912985 loadClipboard(true);
913986 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
987
+ pasteInto(false, false);
915988 } else {
916989 loadClipboard(false);
917990 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
991
+ pasteInto(false, false); // true); // ???
919992 }
920993 }
921994 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1106,37 @@
10331106 torusItem.addActionListener(this);
10341107 superItem = menu.add(new MenuItem("Superellipsoid"));
10351108 superItem.addActionListener(this);
1109
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1110
+ kleinItem.addActionListener(this);
10361111 particleItem = menu.add(new MenuItem("Particle system"));
10371112 particleItem.addActionListener(this);
1113
+ if (Globals.ADVANCED)
1114
+ {
10381115 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391116 ragdollItem.addActionListener(this);
10401117 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411118 ragdoll2Item.addActionListener(this);
1119
+ }
10421120 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1121
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441122 meshItem.addActionListener(this);
10451123 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461124 // meshGroupItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10471127 springItem = menu.add(new MenuItem("Spring"));
10481128 springItem.addActionListener(this);
10491129 flagItem = menu.add(new MenuItem("Flag"));
10501130 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551131 blobItem = menu.add(new MenuItem("Blob"));
10561132 blobItem.addActionListener(this);
10571133 latheItem = menu.add(new MenuItem("Lathe"));
10581134 latheItem.addActionListener(this);
1135
+ }
1136
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1137
+ bezierItem.addActionListener(this);
1138
+ overlayItem = menu.add(new MenuItem("Overlay"));
1139
+ overlayItem.addActionListener(this);
10591140 lightItem = menu.add(new MenuItem("Light"));
10601141 lightItem.addActionListener(this);
10611142 menu.add("-");
....@@ -1065,25 +1146,26 @@
10651146 loopItem.addActionListener(this);
10661147 doubleItem = menu.add(new MenuItem("Fork"));
10671148 doubleItem.addActionListener(this);
1149
+ if (Globals.ADVANCED)
1150
+ {
10681151 tripleItem = menu.add(new MenuItem("Trident"));
10691152 tripleItem.addActionListener(this);
1153
+ }
10701154 }
10711155
10721156 void buildToolsMenu(Menu menu)
10731157 {
10741158 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751159 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1160
+ animationItem.setState(Globals.ANIMATION);
10771161
10781162 menu.add("-");
10791163 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801164 parseverticesItem.addActionListener(this);
10811165 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821166 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1167
+ alignItem = menu.add(new MenuItem("Align Object"));
10841168 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871169 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881170 reduceMorphItem.addActionListener(this);
10891171 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
....@@ -1091,8 +1173,12 @@
10911173
10921174 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931175 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951176
1177
+ if (Globals.ADVANCED)
1178
+ {
1179
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1180
+ mirrorItem.addActionListener(this);
1181
+ menu.add("-");
10961182 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971183 memoryItem.addActionListener(this);
10981184 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1192,8 @@
11061192 resetParentItem.addActionListener(this);
11071193 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081194 repairParentItem.addActionListener(this);
1195
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1196
+ repairShadowItem.addActionListener(this);
11091197 menu.add(invariantsItem = new MenuItem("Invariants"));
11101198 invariantsItem.addActionListener(this);
11111199 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1201,7 @@
11131201 menu.add("-");
11141202 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151203 editScriptItem.addActionListener(this);
1204
+ }
11161205 }
11171206
11181207 void ScreenFit()
....@@ -1466,6 +1555,7 @@
14661555 //
14671556 public void actionPerformed(ActionEvent event) // , Object arg)
14681557 {
1558
+ Object source = event.getSource();
14691559 /*
14701560 if (event.getSource() == nameField)
14711561 {
....@@ -1477,11 +1567,11 @@
14771567 }
14781568 else
14791569 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1570
+ if (source == lookAtItem || source == lookFromItem)
14811571 {
14821572 ScreenFit();
14831573 } else
1484
- if (event.getSource() == switchItem)
1574
+ if (source == switchItem)
14851575 {
14861576 cVector v1 = new cVector();
14871577 cVector v2 = new cVector();
....@@ -1490,11 +1580,11 @@
14901580 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911581 objEditor.cameraView.repaint();
14921582 } else
1493
- if (event.getSource() == rectoidItem)
1583
+ if (source == rectoidItem)
14941584 {
14951585 makeSomething(new Box());
14961586 } else
1497
- if (event.getSource() == particleItem)
1587
+ if (source == particleItem)
14981588 {
14991589 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001590 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1605,9 @@
15151605 applyExample(particleGeom, "SMOKE");
15161606 makeSomething(particleGeom);
15171607 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1608
+ if (source == ragdollItem || source == ragdoll2Item)
15191609 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1610
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211611
15221612 ragdoll.toParent = LA.newMatrix();
15231613 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1625,7 @@
15351625 } else
15361626 /*
15371627 */
1538
- if (event.getSource() == heightFieldItem)
1628
+ if (source == heightFieldItem)
15391629 {
15401630 Object3D obj = new Object3D();
15411631
....@@ -1573,27 +1663,31 @@
15731663
15741664 makeSomething(obj);
15751665 } else
1576
- if (event.getSource() == gridItem)
1666
+ if (source == gridItem)
15771667 {
15781668 makeSomething(new Grid());
15791669 } else
1580
- if (event.getSource() == ellipsoidItem)
1670
+ if (source == ellipsoidItem)
15811671 {
15821672 makeSomething(new Sphere());
15831673 } else
1584
- if (event.getSource() == coneItem)
1674
+ if (source == coneItem)
15851675 {
15861676 makeSomething(new Cone());
15871677 } else
1588
- if (event.getSource() == torusItem)
1678
+ if (source == torusItem)
15891679 {
15901680 makeSomething(new Torus());
15911681 } else
1592
- if (event.getSource() == superItem)
1682
+ if (source == superItem)
15931683 {
15941684 makeSomething(new Superellipsoid());
15951685 } else
1596
- if (event.getSource() == blobItem)
1686
+ if (source == kleinItem)
1687
+ {
1688
+ makeSomething(new Klein());
1689
+ } else
1690
+ if (source == blobItem)
15971691 {
15981692 Blob blob = new Blob();
15991693 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1695,15 @@
16011695 //blob.retile();
16021696 makeSomething(blob);
16031697 } else
1604
- if (event.getSource() == latheItem)
1698
+ if (source == latheItem)
16051699 {
16061700 makeSomething(new Lathe());
16071701 } else
1608
- if (event.getSource() == bezierItem)
1702
+ if (source == bezierItem)
16091703 {
16101704 makeSomething(new BezierSurface());
16111705 } else
1612
- if (event.getSource() == checkerItem)
1706
+ if (source == overlayItem)
16131707 {
16141708 /*
16151709 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1718,7 @@
16241718 */
16251719 makeSomething(new Checker());
16261720 } else
1627
- if (event.getSource() == meshItem)
1721
+ if (source == meshItem)
16281722 {
16291723 Object3D itemtomake = new Object3D();
16301724 Object3D child;
....@@ -1645,35 +1739,35 @@
16451739 makeSomething(child);
16461740 }
16471741 } else
1648
- if (event.getSource() == springItem)
1742
+ if (source == springItem)
16491743 {
16501744 cSpring s = new cSpring();
16511745 s.setup();
16521746 makeSomething(s);
16531747 } else
1654
- if (event.getSource() == flagItem)
1748
+ if (source == flagItem)
16551749 {
16561750 cSpring s = new cFlag();
16571751 s.setup();
16581752 makeSomething(s);
16591753 } else
1660
- if (event.getSource() == lightItem)
1754
+ if (source == lightItem)
16611755 {
16621756 makeSomething(new Light());
16631757 } else
1664
- if (event.getSource() == csgItem)
1758
+ if (source == csgItem)
16651759 {
16661760 group(new CSG());
16671761 } else
1668
- if (event.getSource() == templateItem)
1762
+ if (source == templateItem)
16691763 {
16701764 group(new cTemplate());
16711765 } else
1672
- if (event.getSource() == attributeItem)
1766
+ if (source == attributeItem)
16731767 {
16741768 makeSomething(new Attribute());
16751769 } else
1676
- if (event.getSource() == pointflowItem)
1770
+ if (source == pointflowItem)
16771771 {
16781772 makeSomething(new PointFlow());
16791773 } else
....@@ -1685,7 +1779,7 @@
16851779 } else
16861780 */
16871781
1688
- if (event.getSource() == superLoopItem)
1782
+ if (source == superLoopItem)
16891783 {
16901784 Composite g = new cGroup();
16911785 for (int i=0; i<15; i++)
....@@ -1707,7 +1801,7 @@
17071801
17081802 group(g);
17091803 } else
1710
- if (event.getSource() == loopItem)
1804
+ if (source == loopItem)
17111805 {
17121806 Composite csg = new GroupLeaf();
17131807 csg.count = 5;
....@@ -1716,7 +1810,7 @@
17161810 csg.addChild(child);
17171811 child.addChild(csg);
17181812 } else
1719
- if (event.getSource() == doubleItem)
1813
+ if (source == doubleItem)
17201814 {
17211815 Composite csg = new GroupLeaf();
17221816 csg.count = 5;
....@@ -1728,7 +1822,7 @@
17281822 csg.addChild(child);
17291823 child.addChild(csg);
17301824 } else
1731
- if (event.getSource() == tripleItem)
1825
+ if (source == tripleItem)
17321826 {
17331827 Composite csg = new GroupLeaf();
17341828 csg.count = 4;
....@@ -1744,70 +1838,75 @@
17441838 child.addChild(csg);
17451839 } else
17461840
1747
- if (event.getSource() == importGFDItem)
1841
+ if (source == importGFDItem)
17481842 {
17491843 ImportGFD();
17501844 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1845
+ if (source == importVRMLX3DItem)
17521846 {
17531847 ImportVRMLX3D();
17541848 } else
1755
- if (event.getSource() == import3DSItem)
1849
+ if (source == import3DSItem)
17561850 {
17571851 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581852 } else
1759
- if (event.getSource() == importOBJItem)
1853
+ if (source == importOBJItem)
17601854 {
17611855 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621856 } else
1763
- if (event.getSource() == computeAOItem)
1857
+ if (source == computeAOItem)
17641858 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1859
+ Globals.drawMode = CameraPane.OCCLUSION;
1860
+ Globals.theRenderer.repaint();
17671861 } else
1768
- if (event.getSource() == recompileItem)
1862
+ if (source == recompileItem)
17691863 {
17701864 Recompile();
17711865 refreshContents();
17721866 } else
1773
- if (event.getSource() == editScriptItem)
1867
+ if (source == editScriptItem)
17741868 {
17751869 OpenDialog();
17761870 refreshContents();
17771871 } else
1778
- if (event.getSource() == invariantsItem)
1872
+ if (source == invariantsItem)
17791873 {
17801874 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1875
+ GrafreeD.grafreeD.universe.invariants();
17821876 } else
1783
- if (event.getSource() == memoryItem)
1877
+ if (source == memoryItem)
17841878 {
17851879 //System.out.println("Invariants:");
17861880 PrintMemory();
17871881 } else
1788
- if (event.getSource() == pathItem)
1882
+ if (source == pathItem)
17891883 {
17901884 PrintPath();
17911885 } else
1792
- if (event.getSource() == analyzeItem)
1886
+ if (source == analyzeItem)
17931887 {
17941888 AnalyzeObject();
17951889 } else
1796
- if (event.getSource() == dumpItem)
1890
+ if (source == dumpItem)
17971891 {
17981892 DumpObject();
17991893 } else
1800
- if (event.getSource() == screenfitButton)
1894
+ if (source == oneStepButton)
1895
+ {
1896
+ Globals.ONESTEP = true;
1897
+ cameraView.repaint();
1898
+ } else
1899
+ if (source == screenfitButton)
18011900 {
18021901 //Reload(lastConverter, lastFilename, true);
18031902 ScreenFit();
18041903 } else
1805
- if (event.getSource() == screenfitpointButton)
1904
+ if (source == screenfitpointButton)
18061905 {
18071906 //Reload(lastConverter, lastFilename, true);
18081907 ScreenFitPoint();
18091908 } else
1810
- if (event.getSource() == snapobjectButton)
1909
+ if (source == snapobjectButton)
18111910 {
18121911 //Reload(lastConverter, lastFilename, true);
18131912 SnapObject();
....@@ -1818,13 +1917,13 @@
18181917 // Recompile();
18191918 // refreshContents();
18201919 // } else
1821
- if (event.getSource() == gcButton)
1920
+ if (source == gcButton)
18221921 {
18231922 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241923 System.gc();
18251924 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261925 } else
1827
- if (event.getSource() == editLeafItem)
1926
+ if (source == editLeafItem)
18281927 {
18291928 Object3D obj;
18301929 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1937,66 @@
18381937 }
18391938 refreshContents(true);
18401939 } else
1841
- if (event.getSource() == openWindowItem)
1940
+ if (source == openWindowItem)
18421941 {
18431942 EditSelection(true);
18441943 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1944
+ if (source == cutItem || source == clearButton)
18461945 {
18471946 loadClipboard(true);
18481947 } else
1849
- if (event.getSource() == duplicateItem)
1948
+ if (source == duplicateItem)
18501949 {
18511950 Object3D keep = GrafreeD.clipboard;
18521951 loadClipboard(false);
18531952 paste(false);
18541953 GrafreeD.clipboard = keep;
18551954 } else
1856
- if (event.getSource() == cloneItem)
1955
+ if (source == cloneItem)
18571956 {
18581957 CloneSelection(false);
18591958 } else
1860
- if (event.getSource() == cloneSupportItem)
1959
+ if (source == cloneSupportItem)
18611960 {
18621961 CloneSelection(true);
18631962 } else
1864
- if (event.getSource() == copyItem)
1963
+ if (source == copyItem)
18651964 {
18661965 loadClipboard(false);
18671966 } else
1868
- if (event.getSource() == pasteItem)
1967
+ if (source == pasteItem)
18691968 {
18701969 paste(false);
18711970 } else
1872
- if (event.getSource() == pasteLinkItem)
1971
+ if (source == pasteIntoItem)
18731972 {
1874
- pasteInto(false);
1973
+ pasteInto(true, false);
18751974 } else
1876
- if (event.getSource() == pasteCloneItem)
1975
+ if (source == pasteLinkItem)
18771976 {
1878
- pasteInto(true);
1977
+ pasteInto(false, false);
18791978 } else
1880
- if (event.getSource() == pasteExpandItem)
1979
+ if (source == pasteCloneItem)
1980
+ {
1981
+ pasteInto(true, true);
1982
+ } else
1983
+ if (source == pasteExpandItem)
18811984 {
18821985 paste(true);
18831986 } else
1884
- if (event.getSource() == synchronizeItem)
1987
+ if (source == synchronizeItem)
18851988 {
18861989 Overwrite(Object3D.TRANSFORM);
18871990 } else
1888
- if (event.getSource() == overwriteNameItem)
1991
+ if (source == overwriteNameItem)
18891992 {
18901993 Overwrite(Object3D.NAME);
18911994 } else
1892
- if (event.getSource() == overwriteUVItem)
1995
+ if (source == overwriteUVItem)
18931996 {
18941997 Overwrite(Object3D.UV);
18951998 } else
1896
- if (event.getSource() == overwriteMatItem)
1999
+ if (source == overwriteMatItem)
18972000 {
18982001 /* july 2015
18992002 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2016,7 @@
19132016
19142017 Overwrite(dropAttributes);
19152018 }
1916
- if (event.getSource() == overwriteGeoItem)
2019
+ if (source == overwriteGeoItem)
19172020 {
19182021 Overwrite(Object3D.GEOMETRY);
19192022 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2033,7 @@
19302033 // refreshContents();
19312034 // }
19322035 } else
1933
- if (event.getSource() == generateMeshItem)
2036
+ if (source == generateMeshItem)
19342037 {
19352038 //if (group.selection.size() == 1)
19362039 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2044,7 @@
19412044 ResetModel();
19422045 refreshContents();
19432046 } else
1944
- if (event.getSource() == extractGeometriesItem)
2047
+ if (source == extractGeometriesItem)
19452048 {
19462049 boolean one = false;
19472050
....@@ -1968,7 +2071,7 @@
19682071 ResetModel();
19692072 refreshContents();
19702073 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2074
+ if (source == cloneGeometriesItem)
19722075 {
19732076 boolean one = false;
19742077
....@@ -1994,32 +2097,37 @@
19942097 ResetModel();
19952098 refreshContents();
19962099 } else
1997
- if (event.getSource() == shareGeometriesItem)
2100
+ if (source == shareGeometriesItem)
19982101 {
19992102 boolean one = false;
20002103
20012104 if (group.selection.size() == 1)
20022105 one = true;
20032106
2107
+ Object3D merge = null;
2108
+
20042109 Object3D content = new cGroup();
20052110
20062111 for (int i=0; i<group.selection.size(); i++)
20072112 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2113
+ merge = new Merge(group.selection.get(i));
20092114
20102115 if (one)
2011
- makeSomething(sel, false);
2116
+ makeSomething(merge, false);
20122117 else
2013
- content.addChild(sel);
2118
+ content.addChild(merge);
20142119 }
20152120
20162121 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2122
+ makeSomething(content, true);
2123
+ else
2124
+ {
2125
+ ResetModel();
2126
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2127
+ refreshContents();
2128
+ }
20212129 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2130
+ if (source == mergeGeometriesItem)
20232131 {
20242132 boolean one = false;
20252133
....@@ -2049,7 +2157,7 @@
20492157 ResetModel();
20502158 refreshContents();
20512159 } else
2052
- if (event.getSource() == linkverticesItem)
2160
+ if (source == linkverticesItem)
20532161 {
20542162 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552163 // {
....@@ -2069,32 +2177,41 @@
20692177 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702178 content = ((cGroup)content).get(0);
20712179
2072
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2180
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20732181 for (int i=0; i<group.selection.size(); i++)
20742182 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2183
+ boolean random = CameraPane.SWITCH;
2184
+ CameraPane.SWITCH = false; // parse all random nodes
20772185 group.selection.get(i).linkVerticesThis(content);
20782186 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2187
+ CameraPane.SWITCH = random;
20802188 }
2081
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2189
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20822190 refreshContents();
20832191 }
20842192 } else
2085
- if (event.getSource() == resetsupportItem)
2193
+ if (source == resetsupportItem)
20862194 {
20872195 for (int i=0; i<group.selection.size(); i++)
20882196 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2197
+ boolean random = CameraPane.SWITCH;
2198
+ CameraPane.SWITCH = false; // parse all random nodes
20912199 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2200
+ CameraPane.SWITCH = random;
20932201 }
20942202
20952203 refreshContents();
20962204 } else
2097
- if (event.getSource() == resetreferencesItem)
2205
+ if (source == relinkverticesItem)
2206
+ {
2207
+ boolean random = CameraPane.SWITCH;
2208
+ CameraPane.SWITCH = false; // parse all random nodes
2209
+ group.selection.RelinkToSupport();
2210
+ CameraPane.SWITCH = random;
2211
+
2212
+ refreshContents();
2213
+ } else
2214
+ if (source == resetreferencesItem)
20982215 {
20992216 for (int i=0; i<group.selection.size(); i++)
21002217 {
....@@ -2103,7 +2220,7 @@
21032220
21042221 refreshContents();
21052222 } else
2106
- if (event.getSource() == setMasterItem)
2223
+ if (source == setMasterItem)
21072224 {
21082225 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21092226 {
....@@ -2116,7 +2233,7 @@
21162233 refreshContents();
21172234 }
21182235 } else
2119
- if (event.getSource() == poseMeshItem)
2236
+ if (source == poseMeshItem)
21202237 {
21212238 if (group.selection.size() == 1)
21222239 {
....@@ -2135,19 +2252,19 @@
21352252 }
21362253
21372254 } else
2138
- if (event.getSource() == revertMeshItem)
2255
+ if (source == revertMeshItem)
21392256 {
21402257 RevertMeshes();
21412258 } else
2142
- if (event.getSource() == resetMeshItem)
2259
+ if (source == resetMeshItem)
21432260 {
21442261 ResetAll();
21452262 } else
2146
- if (event.getSource() == stepAllItem)
2263
+ if (source == stepAllItem)
21472264 {
21482265 StepAll();
21492266 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2267
+ if (source == clearItem) // || event.getSource() == clearButton)
21512268 {
21522269 //int indices[] = jList.getSelectedIndices();
21532270 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2272,46 @@
21552272
21562273 ClearSelection(false);
21572274 } else
2158
- if (event.getSource() == clearAllItem)
2275
+ if (source == clearAllItem)
21592276 {
21602277 ClearSelection(true);
21612278 } else
2162
- if (event.getSource() == grabItem)
2279
+ if (source == grabItem)
21632280 {
21642281 group(new cGroup(), true);
21652282 } else
2166
- if (event.getSource() == frontItem)
2283
+ if (source == hideItem)
2284
+ {
2285
+ group(new HiddenObject());
2286
+ } else
2287
+ if (source == frontItem)
21672288 {
21682289 front();
21692290 } else
2170
- if (event.getSource() == backItem)
2291
+ if (source == backItem)
21712292 {
21722293 back();
21732294 } else
2174
- if (event.getSource() == cameraItem)
2295
+ if (source == cameraItem)
21752296 {
21762297 makeSomething(new Camera());
21772298 } else
2178
- if (event.getSource() == compositeItem)
2299
+ if (source == compositeItem)
21792300 {
21802301 group(new Composite());
21812302 } else
2182
- if (event.getSource() == randomItem)
2303
+ if (source == randomItem)
21832304 {
21842305 RandomNode random = new RandomNode();
21852306 group(random);
21862307 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2308
+ random.name = random.get(0).name + "Switch";
21882309 } else
2189
- if (event.getSource() == physicsItem)
2310
+ if (source == physicsItem)
21902311 {
21912312 group(new PhysicsNode());
21922313 } else
2193
- if (event.getSource() == frameselectorItem)
2314
+ if (source == frameselectorItem)
21942315 {
21952316 for (int i=0; i<group.selection.size(); i++)
21962317 {
....@@ -2202,7 +2323,7 @@
22022323 ResetModel();
22032324 refreshContents();
22042325 } else
2205
- if (event.getSource() == switchGeoItem)
2326
+ if (source == switchGeoItem)
22062327 {
22072328 for (int i=0; i<group.selection.size(); i++)
22082329 {
....@@ -2214,7 +2335,7 @@
22142335 ResetModel();
22152336 refreshContents();
22162337 } else
2217
- if (event.getSource() == switchTransfoItem)
2338
+ if (source == switchTransfoItem)
22182339 {
22192340 for (int i=0; i<group.selection.size(); i++)
22202341 {
....@@ -2226,7 +2347,7 @@
22262347 ResetModel();
22272348 refreshContents();
22282349 } else
2229
- if (event.getSource() == morphItem)
2350
+ if (source == morphItem)
22302351 {
22312352 for (int i=0; i<group.selection.size(); i++)
22322353 {
....@@ -2238,7 +2359,7 @@
22382359 ResetModel();
22392360 refreshContents();
22402361 } else
2241
- if (event.getSource() == scriptNodeItem)
2362
+ if (source == scriptNodeItem)
22422363 {
22432364 boolean atleastone = false;
22442365
....@@ -2277,195 +2398,215 @@
22772398 }
22782399 }
22792400 } else
2280
- if (event.getSource() == linkerItem)
2401
+ if (source == linkerItem)
22812402 {
22822403 group(new cLinker());
22832404 } else
2284
- if (event.getSource() == textureItem)
2405
+ if (source == textureItem)
22852406 {
22862407 group(new TextureNode());
22872408 } else
2288
- if (event.getSource() == shadowXItem)
2409
+ if (source == billboardItem)
2410
+ {
2411
+ group(new BillboardNode());
2412
+ } else
2413
+ if (source == shadowXItem)
22892414 {
22902415 CastShadow(0);
22912416 } else
2292
- if (event.getSource() == shadowYItem)
2417
+ if (source == shadowYItem)
22932418 {
22942419 CastShadow(1);
22952420 } else
2296
- if (event.getSource() == shadowZItem)
2421
+ if (source == shadowZItem)
22972422 {
22982423 CastShadow(2);
22992424 } else
2300
- if (event.getSource() == ungroupItem)
2425
+ if (source == ungroupItem)
23012426 {
2302
- ungroup();
2427
+ //ungroup();
2428
+ for (int i=0; i<group.selection.size(); i++)
2429
+ {
2430
+ Ungroup(group.selection.get(i));
2431
+ }
2432
+
2433
+ ClearSelection(false);
2434
+
2435
+ refreshContents();
23032436 } else
2304
- if (event.getSource() == genUVItem)
2437
+ if (source == genUVItem)
23052438 {
23062439 GenUV();
23072440 } else
2308
- if (event.getSource() == genNormalsCADItem)
2441
+ if (source == genNormalsCADItem)
23092442 {
23102443 GenNormals(true);
23112444 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2445
+ if (source == genNormalsMESHItem)
2446
+ {
2447
+ GenNormals(true); // TODO
2448
+ } else
2449
+ if (source == genNormalsORGANItem)
23132450 {
23142451 GenNormals(false);
23152452 } else
2316
- if (event.getSource() == stripifyItem)
2453
+ if (source == genNormalsMINEItem)
2454
+ {
2455
+ GenNormalsMINE();
2456
+ } else
2457
+ if (source == stripifyItem)
23172458 {
23182459 Stripify();
23192460 } else
2320
- if (event.getSource() == unstripifyItem)
2461
+ if (source == unstripifyItem)
23212462 {
23222463 Unstripify();
23232464 } else
2324
- if (event.getSource() == trimItem)
2465
+ if (source == trimItem)
23252466 {
23262467 Trim();
23272468 } else
2328
- if (event.getSource() == untrimItem)
2469
+ if (source == untrimItem)
23292470 {
23302471 Untrim();
23312472 } else
2332
- if (event.getSource() == clearColorsItem)
2473
+ if (source == clearColorsItem)
23332474 {
23342475 ClearColors();
23352476 } else
2336
- if (event.getSource() == clearMaterialsItem)
2477
+ if (source == clearMaterialsItem)
23372478 {
23382479 ClearMaterials();
23392480 } else
2340
- if (event.getSource() == liveleavesItem)
2481
+ if (source == liveleavesItem)
23412482 {
23422483 LiveLeaves(true);
23432484 } else
2344
- if (event.getSource() == unliveleavesItem)
2485
+ if (source == unliveleavesItem)
23452486 {
23462487 LiveLeaves(false);
23472488 } else
2348
- if (event.getSource() == supportleavesItem)
2489
+ if (source == supportleavesItem)
23492490 {
23502491 SupportLeaves(true);
23512492 } else
2352
- if (event.getSource() == unsupportleavesItem)
2493
+ if (source == unsupportleavesItem)
23532494 {
23542495 SupportLeaves(false);
23552496 } else
2356
- if (event.getSource() == hideleavesItem)
2497
+ if (source == hideleavesItem)
23572498 {
23582499 HideLeaves(true);
23592500 } else
2360
- if (event.getSource() == showleavesItem)
2501
+ if (source == showleavesItem)
23612502 {
23622503 HideLeaves(false);
23632504 } else
2364
- if (event.getSource() == markleavesItem)
2505
+ if (source == markleavesItem)
23652506 {
23662507 MarkLeaves(true);
23672508 } else
2368
- if (event.getSource() == unmarkleavesItem)
2509
+ if (source == unmarkleavesItem)
23692510 {
23702511 MarkLeaves(false);
23712512 } else
2372
- if (event.getSource() == flipVItem)
2513
+ if (source == flipVItem)
23732514 {
23742515 FlipV(true);
23752516 } else
2376
- if (event.getSource() == unflipVItem)
2517
+ if (source == unflipVItem)
23772518 {
23782519 FlipV(false);
23792520 } else
2380
- if (event.getSource() == lowTexturesItem)
2521
+ if (source == lowTexturesItem)
23812522 {
23822523 SetTexRes(0);
23832524 } else
2384
- if (event.getSource() == normalTexturesItem)
2525
+ if (source == normalTexturesItem)
23852526 {
23862527 SetTexRes(1);
23872528 } else
2388
- if (event.getSource() == highTexturesItem)
2529
+ if (source == highTexturesItem)
23892530 {
23902531 SetTexRes(2);
23912532 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2533
+ if (source == veryhighTexturesItem)
23932534 {
23942535 SetTexRes(3);
23952536 } else
2396
- if (event.getSource() == maxTexturesItem)
2537
+ if (source == maxTexturesItem)
23972538 {
23982539 SetTexRes(4);
23992540 } else
2400
- if (event.getSource() == panoTexturesItem)
2541
+ if (source == panoTexturesItem)
24012542 {
24022543 SetTexRes(5);
24032544 } else
2404
- if (event.getSource() == reverseNormalsItem)
2545
+ if (source == reverseNormalsItem)
24052546 {
24062547 ReverseNormals();
24072548 } else
2408
- if (event.getSource() == parseverticesItem)
2549
+ if (source == parseverticesItem)
24092550 {
24102551 ParseVertices();
24112552 } else
2412
- if (event.getSource() == textureFieldItem)
2553
+ if (source == textureFieldItem)
24132554 {
24142555 TextureVertices();
24152556 } else
2416
- if (event.getSource() == alignItem)
2557
+ if (source == alignItem)
24172558 {
24182559 Align();
24192560 } else
2420
- if (event.getSource() == mirrorItem)
2561
+ if (source == mirrorItem)
24212562 {
24222563 MirrorPoses();
24232564 } else
2424
- if (event.getSource() == reduceMorphItem)
2565
+ if (source == reduceMorphItem)
24252566 {
24262567 MeshReduction(false);
24272568 } else
2428
- if (event.getSource() == reduce34MorphItem)
2569
+ if (source == reduce34MorphItem)
24292570 {
24302571 MeshReduction(true);
24312572 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2573
+ if (source == reverseTrianglesItem)
24332574 {
24342575 ReverseTriangles();
24352576 } else
2436
- if (event.getSource() == reduceMeshItem)
2577
+ if (source == reduceMeshItem)
24372578 {
24382579 ReduceMesh(false);
24392580 } else
2440
- if (event.getSource() == reduce34MeshItem)
2581
+ if (source == reduce34MeshItem)
24412582 {
24422583 ReduceMesh(true);
24432584 } else
2444
- if (event.getSource() == increaseMeshItem)
2585
+ if (source == increaseMeshItem)
24452586 {
24462587 IncreaseMesh();
24472588 } else
2448
- if (event.getSource() == clipMeshItem)
2589
+ if (source == clipMeshItem)
24492590 {
24502591 ClipMesh();
24512592 } else
2452
- if (event.getSource() == smoothMeshItem)
2593
+ if (source == smoothMeshItem)
24532594 {
24542595 SmoothMesh();
24552596 } else
2456
- if (event.getSource() == transformgeometryItem)
2597
+ if (source == transformgeometryItem)
24572598 {
24582599 TransformGeometry();
24592600 } else
2460
- if (event.getSource() == resetTransformItem)
2601
+ if (source == resetTransformItem)
24612602 {
24622603 ResetTransform();
24632604 } else
2464
- if (event.getSource() == resetCentroidItem)
2605
+ if (source == resetCentroidItem)
24652606 {
24662607 ResetCentroid();
24672608 } else
2468
- if (event.getSource() == resetParentItem)
2609
+ if (source == resetParentItem)
24692610 {
24702611 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712612 {
....@@ -2475,7 +2616,7 @@
24752616
24762617 refreshContents();
24772618 } else
2478
- if (event.getSource() == repairParentItem)
2619
+ if (source == repairParentItem)
24792620 {
24802621 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812622 {
....@@ -2489,7 +2630,21 @@
24892630
24902631 refreshContents();
24912632 } else
2492
- if (event.getSource() == sortbysizeItem)
2633
+ if (source == repairShadowItem)
2634
+ {
2635
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2636
+ {
2637
+ Object3D obj = (Object3D)e.nextElement();
2638
+ obj.RepairShadow();
2639
+// for (int i=0; i<obj.size(); i++)
2640
+// {
2641
+// obj.get(i).parent = obj;
2642
+// }
2643
+ }
2644
+
2645
+ refreshContents();
2646
+ } else
2647
+ if (source == sortbysizeItem)
24932648 {
24942649 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952650 {
....@@ -2501,7 +2656,7 @@
25012656 ResetModel();
25022657 refreshContents();
25032658 } else
2504
- if (event.getSource() == sortbynameItem)
2659
+ if (source == sortbynameItem)
25052660 {
25062661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072662 {
....@@ -2513,7 +2668,7 @@
25132668 ResetModel();
25142669 refreshContents();
25152670 } else
2516
- if (event.getSource() == attachPigmentItem)
2671
+ if (source == attachPigmentItem)
25172672 {
25182673 String texture = GetFile("Attach pigment");
25192674 Object3D obj;
....@@ -2525,7 +2680,7 @@
25252680
25262681 refreshContents();
25272682 } else
2528
- if (event.getSource() == detachPigmentItem)
2683
+ if (source == detachPigmentItem)
25292684 {
25302685 Object3D obj;
25312686 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2691,7 @@
25362691
25372692 refreshContents();
25382693 } else
2539
- if (event.getSource() == attachBumpItem)
2694
+ if (source == attachBumpItem)
25402695 {
25412696 String texture = GetFile("Attach bump");
25422697 Object3D obj;
....@@ -2548,7 +2703,7 @@
25482703
25492704 refreshContents();
25502705 } else
2551
- if (event.getSource() == detachBumpItem)
2706
+ if (source == detachBumpItem)
25522707 {
25532708 Object3D obj;
25542709 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2714,7 @@
25592714
25602715 refreshContents();
25612716 } else
2562
- if (event.getSource() == pigmentBumpItem)
2717
+ if (source == pigmentBumpItem)
25632718 {
25642719 Object3D obj;
25652720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2725,195 @@
25702725
25712726 refreshContents();
25722727 } else
2573
- if (event.getSource() == flashSelectionButton)
2728
+ if (source == flashSelectionButton)
25742729 {
25752730 CameraPane.flash = true;
25762731 refreshContents();
25772732 } else
2578
- if (event.getSource() == oneButton)
2733
+ if (source == oneButton)
25792734 {
25802735 } else
2581
- if (event.getSource() == twoButton)
2736
+ if (source == twoButton)
25822737 {
25832738 radio.layout = twoButton;
25842739 // bug
25852740 //gridPanel.setDividerLocation(1.0);
25862741 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- bigThree.revalidate();
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2750
+// aWindowConstraints.weightx = 0;
2751
+// aWindowConstraints.weighty = 1;
2752
+// //bigThree.add(jtp, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// bigThree.add(centralPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// scenePanel.setVisible(false);
2766
+// centralPanel.setVisible(true);
2767
+// XYZPanel.setVisible(false);
2768
+ bigThree.ClearUI();
2769
+ bigThree.add(centralPanel);
2770
+ bigThree.FlushUI();
26112771 } else
2612
- if (event.getSource() == threeButton)
2772
+ if (source == threeButton)
26132773 {
26142774 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- bigThree.revalidate();
2775
+
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// bigThree.add(XYZPanel, aWindowConstraints);
2799
+// bigThree.validate();
2800
+// scenePanel.setVisible(false);
2801
+// centralPanel.setVisible(true);
2802
+// XYZPanel.setVisible(true);
2803
+ bigThree.ClearUI();
2804
+ bigThree.add(centralPanel);
2805
+ bigThree.add(XYZPanel);
2806
+ bigThree.FlushUI();
26392807 } else
2640
- if (event.getSource() == fourButton)
2808
+ if (source == fourButton)
26412809 {
26422810 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
2811
+
2812
+// bigThree.remove(scenePanel);
2813
+// bigThree.remove(centralPanel);
2814
+// bigThree.remove(XYZPanel);
2815
+// aWindowConstraints.gridx = 0;
2816
+// aWindowConstraints.gridy = 0;
2817
+// aWindowConstraints.gridwidth = 1;
2818
+// // aWindowConstraints.gridheight = 3;
2819
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.weighty = 1;
2822
+// bigThree.add(scenePanel, aWindowConstraints);
2823
+// aWindowConstraints.weightx = 1;
2824
+// aWindowConstraints.gridwidth = 3;
2825
+// // aConstraints.gridheight = 3;
2826
+// aWindowConstraints.gridx = 1;
2827
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2828
+// //bigThree.add(cameraPanel, aWindowConstraints);
2829
+// aWindowConstraints.weightx = 0;
2830
+// aWindowConstraints.gridx = 4;
2831
+// aWindowConstraints.gridwidth = 1;
2832
+// // aWindowConstraints.gridheight = 3;
2833
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2834
+// //bigThree.add(XYZPanel, aWindowConstraints);
2835
+// bigThree.validate();
2836
+// scenePanel.setVisible(true);
2837
+// centralPanel.setVisible(false);
2838
+// XYZPanel.setVisible(false);
2839
+ bigThree.ClearUI();
2840
+ bigThree.add(scenePanel);
2841
+ bigThree.FlushUI();
26672842 } else
2668
- if (event.getSource() == sixButton)
2843
+ if (source == sixButton)
26692844 {
26702845 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- bigThree.revalidate();
2846
+
2847
+// bigThree.remove(scenePanel);
2848
+// bigThree.remove(centralPanel);
2849
+// bigThree.remove(XYZPanel);
2850
+// aWindowConstraints.gridx = 0;
2851
+// aWindowConstraints.gridy = 0;
2852
+// aWindowConstraints.gridwidth = 1;
2853
+// // aConstraints.gridheight = 3;
2854
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2855
+// aWindowConstraints.weightx = 0;
2856
+// aWindowConstraints.weighty = 1;
2857
+// bigThree.add(scenePanel, aWindowConstraints);
2858
+// aWindowConstraints.weightx = 1;
2859
+// aWindowConstraints.gridwidth = 3;
2860
+// // aWindowConstraints.gridheight = 3;
2861
+// aWindowConstraints.gridx = 1;
2862
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2863
+// bigThree.add(centralPanel, aWindowConstraints);
2864
+// aWindowConstraints.weightx = 0;
2865
+// aWindowConstraints.gridx = 4;
2866
+// aWindowConstraints.gridwidth = 1;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2869
+// //bigThree.add(XYZPanel, aConstraints);
2870
+// bigThree.validate();
2871
+// scenePanel.setVisible(true);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(scenePanel);
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
26952878 } else
2696
- if (event.getSource() == sevenButton)
2879
+ if (source == sevenButton)
26972880 {
26982881 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aWindowConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// bigThree.add(scenePanel, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(true);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(scenePanel);
2912
+ bigThree.add(centralPanel);
2913
+ bigThree.add(XYZPanel);
2914
+ bigThree.FlushUI();
27232915 } else
2724
- if (event.getSource() == rootButton)
2916
+ if (source == rootButton)
27252917 {
27262918 Object3D obj;
27272919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2925,7 @@
27332925
27342926 refreshContents(true);
27352927 } else
2736
- if (event.getSource() == closeButton)
2928
+ if (source == closeButton)
27372929 {
27382930 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392931 cRadio ab;
....@@ -2754,11 +2946,11 @@
27542946 }
27552947 refreshContents(true);
27562948 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
2949
+ if (source == editItem || source == editButton)
27582950 {
27592951 EditSelection(false);
27602952 } else
2761
- if (event.getSource() == uneditButton)
2953
+ if (source == uneditButton)
27622954 {
27632955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27642956 {
....@@ -2770,12 +2962,12 @@
27702962
27712963 child.editWindow = null; // ???????????
27722964 }
2773
- objEditor.ctrlPanel.revalidate();
2965
+ objEditor.ctrlPanel.FlushUI();
27742966 //objEditor.jTree.clearSelection();
27752967 //objEditor.ResetSliders();
27762968 refreshContents(true);
27772969 } else
2778
- if (event.getSource() == clearPanelButton)
2970
+ if (source == clearPanelButton)
27792971 {
27802972 assert(copy == group);
27812973 //copy.ClearUI();
....@@ -2786,7 +2978,7 @@
27862978 listUI.clear();
27872979 refreshContents(true);
27882980 } else
2789
- if (event.getSource() == allParamsButton)
2981
+ if (source == allParamsButton)
27902982 {
27912983 assert(copy == group);
27922984
....@@ -2807,19 +2999,19 @@
28072999
28083000 refreshContents(true);
28093001 } else
2810
- if (event.getSource() == unselectButton)
3002
+ if (source == unselectButton)
28113003 {
28123004 objEditor.jTree.clearSelection();
28133005 // ?? oct 2012 GrafreeD.clipboard.clear();
28143006 objEditor.ResetSliders();
28153007 refreshContents(true);
28163008 } else
2817
- if(event.getSource() instanceof cRadio)
3009
+ if(source instanceof cRadio)
28183010 {
28193011 group.parent = keepparent;
28203012 group.attributes = 0;
28213013 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3014
+ /*cRadio*/ radio = (cRadio)source;
28233015 Object3D obj = radio.GetObject();
28243016 System.out.println("Edit " + obj);
28253017 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3031,7 @@
28393031 }
28403032
28413033 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3034
+ //Globals.theRenderer.object = group;
28433035 if(!useclient)
28443036 {
28453037 cameraView.renderCamera = radio.camera;
....@@ -2848,7 +3040,8 @@
28483040 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493041 cameraView.targetLookAt.set(radio.camera.lookAt);
28503042 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3043
+ //cameraView.lighttouched = true;
3044
+ Globals.lighttouched = true;
28523045 topView.object = group;
28533046 frontView.object = group;
28543047 sideView.object = group;
....@@ -2884,7 +3077,7 @@
28843077 if (useclient)
28853078 {
28863079 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3080
+ Globals.lighttouched = true;
28883081 //topView.object = client;
28893082 //frontView.object = client;
28903083 //sideView.object = client;
....@@ -2892,7 +3085,7 @@
28923085 else
28933086 {
28943087 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3088
+ Globals.lighttouched = true;
28963089 //topView.object = group;
28973090 //frontView.object = group;
28983091 //sideView.object = group;
....@@ -3173,6 +3366,13 @@
31733366 refreshContents();
31743367 }
31753368
3369
+ void GenNormalsMINE()
3370
+ {
3371
+ group.selection.GenNormalsMINE();
3372
+
3373
+ refreshContents();
3374
+ }
3375
+
31763376 void Stripify()
31773377 {
31783378 group.StripifyS();
....@@ -3393,7 +3593,7 @@
33933593 String pigment = Object3D.GetPigment(tex);
33943594 //String bump = Object3D.GetBump(tex);
33953595
3396
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3596
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33973597
33983598 double s = v.s;
33993599
....@@ -3441,12 +3641,26 @@
34413641
34423642 void Align()
34433643 {
3644
+ if (group.selection.size() == 0)
3645
+ return;
3646
+
3647
+ cVector bbmin = new cVector();
3648
+ cVector bbmax = new cVector();
3649
+
3650
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3651
+
3652
+ double dx = bbmax.x - bbmin.x;
3653
+ double dy = bbmax.y - bbmin.y;
3654
+ double dz = bbmax.z - bbmin.z;
3655
+
3656
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3657
+
34443658 for (int i=0; i<group.selection.size(); i++)
34453659 {
34463660 Object3D obj = group.selection.get(i);
34473661
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3662
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3663
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503664 }
34513665
34523666 refreshContents();
....@@ -3467,11 +3681,11 @@
34673681
34683682 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693683
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3684
+ boolean random = CameraPane.SWITCH;
3685
+ CameraPane.SWITCH = false; // parse all random nodes
34723686 lowres.linkVerticesThis(null);
34733687 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3688
+ CameraPane.SWITCH = random;
34753689
34763690 System.err.flush();
34773691
....@@ -3680,7 +3894,7 @@
36803894 group.selection.RelinkToSupport(); // july 2014
36813895 System.out.println("DONE.");
36823896 refreshContents();
3683
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3897
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36843898 }
36853899
36863900 void ReduceMesh(boolean reduction34)
....@@ -3956,25 +4170,25 @@
39564170 System.err.println("info : " + child.GetPath());
39574171 }
39584172 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4173
+// else
4174
+// {
4175
+// objEditor.SetMaterial(group); // .GetMaterial());
4176
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4177
+// System.err.println("info : " + group.GetPath());
4178
+// }
39654179
39664180 objEditor.SetText(); // jan 2014
39674181
3968
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4182
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39694183 CameraPane.flash = true;
39704184
39714185 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724186 // a camera
39734187 {
39744188 CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4189
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4190
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4191
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784192 }
39794193
39804194 refreshContents();
....@@ -4229,7 +4443,7 @@
42294443 refreshContents();
42304444 }
42314445
4232
- void pasteInto(boolean copyit)
4446
+ void pasteInto(boolean copyit, boolean clone)
42334447 {
42344448 // if (GrafreeD.clipboard == null)
42354449 // return;
....@@ -4258,7 +4472,14 @@
42584472 if (copyit)
42594473 {
42604474 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4475
+ if (clone)
4476
+ {
4477
+ CloneClipboard(false); // sept 2014
4478
+ }
4479
+ else
4480
+ {
4481
+ paste(false);
4482
+ }
42624483 }
42634484 else
42644485 {
....@@ -4468,6 +4689,26 @@
44684689 makeSomething(csg);
44694690 }
44704691
4692
+ void Ungroup(Object3D g)
4693
+ {
4694
+ if (g instanceof HiddenObject)
4695
+ {
4696
+ HiddenObject h = (HiddenObject) g;
4697
+
4698
+ for (int i=0; i<h.ActualSize(); i++)
4699
+ {
4700
+ objEditor.makeSomething(h.get(i), false);
4701
+ }
4702
+ }
4703
+ else
4704
+ {
4705
+ for (int i=0; i<g.Size(); i++)
4706
+ {
4707
+ objEditor.makeSomething(g.get(i), false);
4708
+ }
4709
+ }
4710
+ }
4711
+
44714712 void ungroup()
44724713 {
44734714 /*
....@@ -4782,10 +5023,12 @@
47825023 cButton flashSelectionButton;
47835024 cButton editButton;
47845025 cButton uneditButton;
5026
+ JCheckBox allParamsButton;
47855027 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875028 cButton unselectButton;
47885029
5030
+ cButton oneStepButton;
5031
+
47895032 cButton screenfitButton;
47905033 cButton screenfitpointButton;
47915034 cButton snapobjectButton;
....@@ -4827,6 +5070,7 @@
48275070 private MenuItem resetsupportItem;
48285071 private MenuItem resetreferencesItem;
48295072 private MenuItem linkverticesItem;
5073
+ private MenuItem relinkverticesItem;
48305074 private MenuItem setMasterItem;
48315075 private MenuItem resetMeshItem;
48325076 private MenuItem stepAllItem;
....@@ -4839,14 +5083,17 @@
48395083 private MenuItem mergeGeometriesItem;
48405084 private MenuItem copyItem;
48415085 private MenuItem pasteItem;
5086
+ private MenuItem pasteIntoItem;
48425087 private MenuItem pasteLinkItem;
48435088 private MenuItem pasteCloneItem;
48445089 private MenuItem pasteExpandItem;
48455090 private MenuItem clearItem;
48465091 private MenuItem clearAllItem;
48475092 private MenuItem genUVItem;
5093
+ private MenuItem genNormalsMESHItem;
48485094 private MenuItem genNormalsCADItem;
48495095 private MenuItem genNormalsORGANItem;
5096
+ private MenuItem genNormalsMINEItem;
48505097 private MenuItem stripifyItem;
48515098 private MenuItem unstripifyItem;
48525099 private MenuItem trimItem;
....@@ -4888,6 +5135,7 @@
48885135 private MenuItem resetCentroidItem;
48895136 private MenuItem transformgeometryItem;
48905137 private MenuItem resetTransformItem;
5138
+ private MenuItem hideItem;
48915139 private MenuItem grabItem;
48925140 private MenuItem backItem;
48935141 private MenuItem frontItem;
....@@ -4908,6 +5156,7 @@
49085156
49095157 private MenuItem resetParentItem;
49105158 private MenuItem repairParentItem;
5159
+ private MenuItem repairShadowItem;
49115160 private MenuItem sortbysizeItem;
49125161 private MenuItem sortbynameItem;
49135162
....@@ -4928,10 +5177,11 @@
49285177 private MenuItem coneItem;
49295178 private MenuItem torusItem;
49305179 private MenuItem superItem;
5180
+ private MenuItem kleinItem;
49315181 private MenuItem blobItem;
49325182 private MenuItem latheItem;
49335183 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5184
+ private MenuItem overlayItem;
49355185 private MenuItem meshItem;
49365186 // private MenuItem meshGroupItem;
49375187 private MenuItem springItem;
....@@ -4940,6 +5190,7 @@
49405190 private MenuItem csgItem;
49415191 private MenuItem templateItem;
49425192 private MenuItem textureItem;
5193
+ private MenuItem billboardItem;
49435194 private MenuItem shadowXItem;
49445195 private MenuItem shadowYItem;
49455196 private MenuItem shadowZItem;