Normand Briere
2019-05-01 d1e1417edc8a6ccf195b6da3270f22234dda61e4
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,
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));
101
+ assert(GrafreeD.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
+ makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(GrafreeD.clipboard, false));
108
+ GrafreeD.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
122
+ Object3D clone = (Object3D)GrafreeD.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -219,29 +220,35 @@
219220 resetsupportItem.addActionListener(this);
220221 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221222 linkverticesItem.addActionListener(this);
223
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224
+ relinkverticesItem.addActionListener(this);
222225 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223226 setMasterItem.addActionListener(this);
224227
225228 oe.menuBar.add(menu = new Menu("Group"));
226229 grabItem = menu.add(new MenuItem("Grab"));
227230 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230231 backItem = menu.add(new MenuItem("Back"));
231232 backItem.addActionListener(this);
233
+ frontItem = menu.add(new MenuItem("Front"));
234
+ frontItem.addActionListener(this);
232235 compositeItem = menu.add(new MenuItem("Composite"));
233236 compositeItem.addActionListener(this);
237
+ hideItem = menu.add(new MenuItem("Hide"));
238
+ hideItem.addActionListener(this);
239
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
240
+ ungroupItem.addActionListener(this);
234241 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
242
+ randomItem = menu.add(new MenuItem("Switch node"));
236243 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);
241244 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242245 switchGeoItem.addActionListener(this);
243246 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244247 switchTransfoItem.addActionListener(this);
248
+ physicsItem = menu.add(new MenuItem("Physics"));
249
+ physicsItem.addActionListener(this);
250
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251
+ frameselectorItem.addActionListener(this);
245252 morphItem = menu.add(new MenuItem("Morph"));
246253 morphItem.addActionListener(this);
247254 scriptNodeItem = menu.add(new MenuItem("Script Node"));
....@@ -252,6 +259,8 @@
252259 oe.menuBar.add(menu = new Menu("Object"));
253260 textureItem = menu.add(new MenuItem("Texture"));
254261 textureItem.addActionListener(this);
262
+ billboardItem = menu.add(new MenuItem("Billboard"));
263
+ billboardItem.addActionListener(this);
255264 csgItem = menu.add(new MenuItem("CSG"));
256265 csgItem.addActionListener(this);
257266 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -269,14 +278,12 @@
269278 pointflowItem = menu.add(new MenuItem("Point Flow"));
270279 pointflowItem.addActionListener(this);
271280 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274281 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275282 resetTransformItem.addActionListener(this);
276283 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277284 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
285
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
+ transformgeometryItem.addActionListener(this);
280287
281288 oe.menuBar.add(menu = new Menu("Geometry"));
282289 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +292,10 @@
285292 genNormalsORGANItem.addActionListener(this);
286293 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287294 genNormalsCADItem.addActionListener(this);
295
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296
+ genNormalsMESHItem.addActionListener(this);
297
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298
+ genNormalsMINEItem.addActionListener(this);
288299 stripifyItem = menu.add(new MenuItem("Stripify"));
289300 stripifyItem.addActionListener(this);
290301 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -380,7 +391,7 @@
380391
381392
382393 oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
394
+ importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384395 importGFDItem.addActionListener(this);
385396 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386397 importVRMLX3DItem.addActionListener(this);
....@@ -423,150 +434,94 @@
423434 oe.radioPanel.add(dummyButton);
424435 oe.buttonGroup.add(dummyButton);
425436 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429438
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
+ liveCB.setToolTipText("Enabled animation");
431441 liveCB.addItemListener(this);
432442
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);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
451445 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);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
448
+ trackCB.setToolTipText("Enable tracking");
493449 trackCB.addItemListener(this);
494450
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
452
+ screenfitButton.setToolTipText("Screen fit");
497453 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
454
+
499455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500456 // 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;
505457
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);
458
+ if (Globals.ADVANCED)
459
+ {
460
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461
+ snapobjectButton.addActionListener(this);
462
+ snapobjectButton.setToolTipText("Snap Object");
463
+ }
464
+
465
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
466
+ flashSelectionButton.setToolTipText("Show selection");
512467 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516468
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
469
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
470
+
471
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
472
+ twoButton.setToolTipText("Show center view only");
519473 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
474
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521475 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ fourButton.setToolTipText("Show left panel only");
477
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
478
+ sixButton.setToolTipText("2-column layout left");
523479 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
+ threeButton.setToolTipText("2-column layout right");
525482 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
+ sevenButton.setToolTipText("3-column layout");
527485 sevenButton.addActionListener(this);
528486 //
529487
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
488
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
489
+ rootButton.setToolTipText("Edit selection in new tab");
531490 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
493
+ closeButton.setToolTipText("Close tab");
534494 closeButton.addActionListener(this);
535495 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536496 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538497
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
498
+ cGridBag commandsPanel = new cGridBag();
499
+
500
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
501
+ editButton.setToolTipText("Edit selection");
541502 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545503
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
504
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
505
+ uneditButton.setToolTipText("Unedit selection");
547506 uneditButton.addActionListener(this);
548507
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);
508
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
509
+ clearPanelButton.setToolTipText("Clear edit panel");
554510 clearPanelButton.addActionListener(this);
555511
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);
512
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ allParamsButton.setToolTipText("All params??");
561514 allParamsButton.addActionListener(this);
562515
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);
516
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ unselectButton.setToolTipText("Unselect");
568518 unselectButton.addActionListener(this);
569519
520
+ commandsPanel.preferredHeight = 1;
521
+
522
+ oe.treePanel.add(commandsPanel);
523
+ oe.treePanel.Return();
524
+
570525 // oe.aConstraints.gridx += 1;
571526 // oe.aConstraints.weighty = 0;
572527 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +533,37 @@
578533 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579534 // gcButton.addActionListener(this);
580535
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;
536
+ cGridBag jSPPanel = new cGridBag();
537
+
538
+ JScrollPane jSP;
592539 //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);
540
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594541 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
542
+
543
+ oe.treePanel.add(jSPPanel);
544
+ oe.treePanel.Return();
599545
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);
546
+ cGridBag copyOptionsPanel = new cGridBag();
547
+
548
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
549
+ colorCB.setToolTipText("Copy color when dropped");
604550 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
551
+
552
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
553
+ materialCB.setToolTipText("Copy material when dropped");
607554 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
555
+
556
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
557
+ textureCB.setToolTipText("Copy texture when dropped");
610558 textureCB.addItemListener(this);
611559
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
560
+ copyOptionsPanel.preferredHeight = 1;
561
+ oe.treePanel.add(copyOptionsPanel);
562
+ oe.treePanel.Return();
614563
564
+// mainPanel.setDividerLocation(0.5); //1.0);
565
+// mainPanel.setResizeWeight(0.5);
566
+
615567 //jList.addListSelectionListener(this);
616568 oe.jTree.addTreeSelectionListener(this);
617569 //jTree.setRootVisible(false);
....@@ -633,17 +585,85 @@
633585 radio.layout = sevenButton;
634586 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635587 }
588
+
589
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
590
+ {
591
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
592
+ supportCB.setToolTipText("Enabled rigging");
593
+ supportCB.addItemListener(this);
594
+
595
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
596
+ // localCB.addItemListener(this);
597
+
598
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
599
+ crowdCB.setToolTipText("Used for crowds");
600
+ crowdCB.addItemListener(this);
601
+
602
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
603
+ smoothCB.setToolTipText("Snapping delay");
604
+ smoothCB.addItemListener(this);
605
+
606
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
607
+ slowCB.setToolTipText("Smooth interpolation");
608
+ slowCB.addItemListener(this);
609
+
610
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
611
+ boxCB.setToolTipText("Display bounding boxes");
612
+ boxCB.addItemListener(this);
613
+
614
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
615
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
616
+ zoomBoxCB.addItemListener(this);
617
+
618
+// constraints.gridy += 1;
619
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
620
+// speakerMocapCB.addItemListener(this);
621
+
622
+ if (false)
623
+ {
624
+ // handled in scripts
625
+ //constraints.gridy += 1;
626
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
627
+ speakerCameraCB.addItemListener(this);
628
+
629
+ //constraints.gridy += 1;
630
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
631
+ speakerFocusCB.addItemListener(this);
632
+
633
+ //constraints.gridy += 1;
634
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
635
+ smoothfocusCB.addItemListener(this);
636
+ }
637
+
638
+//constraints.gridx += 1;
639
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
640
+// debugCB.addItemListener(this);
641
+
642
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
643
+ oeilCB.addItemListener(this);
644
+
645
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
646
+ lookAtCB.setToolTipText("Look-at target");
647
+ lookAtCB.addItemListener(this);
648
+
649
+ cGridBag fill = new cGridBag();
650
+
651
+ fill.preferredHeight = 200;
652
+
653
+ panel.add(fill);
654
+
655
+ }
636656
637657 void EditObject(Object3D obj)
638658 {
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();
659
+ cRadio radioButton = new cRadio(obj.name);
660
+ radioButton.SetObject(obj);
661
+ radioButton.layout = sevenButton;
662
+ radioButton.SetCamera(cameraView.renderCamera, false);
663
+ radioButton.addActionListener(this);
664
+ radioPanel.add(radioButton);
665
+ buttonGroup.add(radioButton);
666
+ radioButton.doClick();
647667 }
648668 void SetupViews(ObjEditor oe)
649669 {
....@@ -663,6 +683,7 @@
663683 JCheckBox fastCB;
664684 JCheckBox slowCB;
665685 JCheckBox boxCB;
686
+ JCheckBox zoomBoxCB;
666687 JCheckBox trackCB;
667688 JCheckBox smoothfocusCB;
668689 // JCheckBox speakerMocapCB;
....@@ -705,8 +726,7 @@
705726 dropAttributes |= Object3D.TEXTURE;
706727 else
707728 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
729
+ } else if(e.getSource() == liveCB)
710730 {
711731 cameraView.ToggleLive();
712732 }
....@@ -743,6 +763,10 @@
743763 Recompile();
744764 cameraView.repaint();
745765 // refreshContents();
766
+ }
767
+ else if(e.getSource() == zoomBoxCB)
768
+ {
769
+ cameraView.ToggleZoomBoxMode();
746770 }
747771 else if(e.getSource() == smoothfocusCB)
748772 {
....@@ -1033,6 +1057,8 @@
10331057 torusItem.addActionListener(this);
10341058 superItem = menu.add(new MenuItem("Superellipsoid"));
10351059 superItem.addActionListener(this);
1060
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1061
+ kleinItem.addActionListener(this);
10361062 particleItem = menu.add(new MenuItem("Particle system"));
10371063 particleItem.addActionListener(this);
10381064 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1073,7 +1099,7 @@
10731099 {
10741100 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751101 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1102
+ animationItem.setState(Globals.ANIMATION);
10771103
10781104 menu.add("-");
10791105 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1106,6 +1132,8 @@
11061132 resetParentItem.addActionListener(this);
11071133 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081134 repairParentItem.addActionListener(this);
1135
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1136
+ repairShadowItem.addActionListener(this);
11091137 menu.add(invariantsItem = new MenuItem("Invariants"));
11101138 invariantsItem.addActionListener(this);
11111139 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1441,9 +1469,9 @@
14411469
14421470 void Overwrite(int mask)
14431471 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1472
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14451473 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1474
+ Object3D content = GrafreeD.clipboard.get(0);
14471475
14481476 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491477 content = ((cGroup)content).get(0);
....@@ -1466,6 +1494,7 @@
14661494 //
14671495 public void actionPerformed(ActionEvent event) // , Object arg)
14681496 {
1497
+ Object source = event.getSource();
14691498 /*
14701499 if (event.getSource() == nameField)
14711500 {
....@@ -1477,11 +1506,11 @@
14771506 }
14781507 else
14791508 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1509
+ if (source == lookAtItem || source == lookFromItem)
14811510 {
14821511 ScreenFit();
14831512 } else
1484
- if (event.getSource() == switchItem)
1513
+ if (source == switchItem)
14851514 {
14861515 cVector v1 = new cVector();
14871516 cVector v2 = new cVector();
....@@ -1490,11 +1519,11 @@
14901519 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911520 objEditor.cameraView.repaint();
14921521 } else
1493
- if (event.getSource() == rectoidItem)
1522
+ if (source == rectoidItem)
14941523 {
14951524 makeSomething(new Box());
14961525 } else
1497
- if (event.getSource() == particleItem)
1526
+ if (source == particleItem)
14981527 {
14991528 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001529 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1544,9 @@
15151544 applyExample(particleGeom, "SMOKE");
15161545 makeSomething(particleGeom);
15171546 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1547
+ if (source == ragdollItem || source == ragdoll2Item)
15191548 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1549
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211550
15221551 ragdoll.toParent = LA.newMatrix();
15231552 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1564,7 @@
15351564 } else
15361565 /*
15371566 */
1538
- if (event.getSource() == heightFieldItem)
1567
+ if (source == heightFieldItem)
15391568 {
15401569 Object3D obj = new Object3D();
15411570
....@@ -1573,27 +1602,31 @@
15731602
15741603 makeSomething(obj);
15751604 } else
1576
- if (event.getSource() == gridItem)
1605
+ if (source == gridItem)
15771606 {
15781607 makeSomething(new Grid());
15791608 } else
1580
- if (event.getSource() == ellipsoidItem)
1609
+ if (source == ellipsoidItem)
15811610 {
15821611 makeSomething(new Sphere());
15831612 } else
1584
- if (event.getSource() == coneItem)
1613
+ if (source == coneItem)
15851614 {
15861615 makeSomething(new Cone());
15871616 } else
1588
- if (event.getSource() == torusItem)
1617
+ if (source == torusItem)
15891618 {
15901619 makeSomething(new Torus());
15911620 } else
1592
- if (event.getSource() == superItem)
1621
+ if (source == superItem)
15931622 {
15941623 makeSomething(new Superellipsoid());
15951624 } else
1596
- if (event.getSource() == blobItem)
1625
+ if (source == kleinItem)
1626
+ {
1627
+ makeSomething(new Klein());
1628
+ } else
1629
+ if (source == blobItem)
15971630 {
15981631 Blob blob = new Blob();
15991632 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1634,15 @@
16011634 //blob.retile();
16021635 makeSomething(blob);
16031636 } else
1604
- if (event.getSource() == latheItem)
1637
+ if (source == latheItem)
16051638 {
16061639 makeSomething(new Lathe());
16071640 } else
1608
- if (event.getSource() == bezierItem)
1641
+ if (source == bezierItem)
16091642 {
16101643 makeSomething(new BezierSurface());
16111644 } else
1612
- if (event.getSource() == checkerItem)
1645
+ if (source == checkerItem)
16131646 {
16141647 /*
16151648 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1657,7 @@
16241657 */
16251658 makeSomething(new Checker());
16261659 } else
1627
- if (event.getSource() == meshItem)
1660
+ if (source == meshItem)
16281661 {
16291662 Object3D itemtomake = new Object3D();
16301663 Object3D child;
....@@ -1645,35 +1678,35 @@
16451678 makeSomething(child);
16461679 }
16471680 } else
1648
- if (event.getSource() == springItem)
1681
+ if (source == springItem)
16491682 {
16501683 cSpring s = new cSpring();
16511684 s.setup();
16521685 makeSomething(s);
16531686 } else
1654
- if (event.getSource() == flagItem)
1687
+ if (source == flagItem)
16551688 {
16561689 cSpring s = new cFlag();
16571690 s.setup();
16581691 makeSomething(s);
16591692 } else
1660
- if (event.getSource() == lightItem)
1693
+ if (source == lightItem)
16611694 {
16621695 makeSomething(new Light());
16631696 } else
1664
- if (event.getSource() == csgItem)
1697
+ if (source == csgItem)
16651698 {
16661699 group(new CSG());
16671700 } else
1668
- if (event.getSource() == templateItem)
1701
+ if (source == templateItem)
16691702 {
16701703 group(new cTemplate());
16711704 } else
1672
- if (event.getSource() == attributeItem)
1705
+ if (source == attributeItem)
16731706 {
16741707 makeSomething(new Attribute());
16751708 } else
1676
- if (event.getSource() == pointflowItem)
1709
+ if (source == pointflowItem)
16771710 {
16781711 makeSomething(new PointFlow());
16791712 } else
....@@ -1685,7 +1718,7 @@
16851718 } else
16861719 */
16871720
1688
- if (event.getSource() == superLoopItem)
1721
+ if (source == superLoopItem)
16891722 {
16901723 Composite g = new cGroup();
16911724 for (int i=0; i<15; i++)
....@@ -1707,7 +1740,7 @@
17071740
17081741 group(g);
17091742 } else
1710
- if (event.getSource() == loopItem)
1743
+ if (source == loopItem)
17111744 {
17121745 Composite csg = new GroupLeaf();
17131746 csg.count = 5;
....@@ -1716,7 +1749,7 @@
17161749 csg.addChild(child);
17171750 child.addChild(csg);
17181751 } else
1719
- if (event.getSource() == doubleItem)
1752
+ if (source == doubleItem)
17201753 {
17211754 Composite csg = new GroupLeaf();
17221755 csg.count = 5;
....@@ -1728,7 +1761,7 @@
17281761 csg.addChild(child);
17291762 child.addChild(csg);
17301763 } else
1731
- if (event.getSource() == tripleItem)
1764
+ if (source == tripleItem)
17321765 {
17331766 Composite csg = new GroupLeaf();
17341767 csg.count = 4;
....@@ -1744,70 +1777,70 @@
17441777 child.addChild(csg);
17451778 } else
17461779
1747
- if (event.getSource() == importGFDItem)
1780
+ if (source == importGFDItem)
17481781 {
17491782 ImportGFD();
17501783 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1784
+ if (source == importVRMLX3DItem)
17521785 {
17531786 ImportVRMLX3D();
17541787 } else
1755
- if (event.getSource() == import3DSItem)
1788
+ if (source == import3DSItem)
17561789 {
17571790 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581791 } else
1759
- if (event.getSource() == importOBJItem)
1792
+ if (source == importOBJItem)
17601793 {
17611794 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621795 } else
1763
- if (event.getSource() == computeAOItem)
1796
+ if (source == computeAOItem)
17641797 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1798
+ Globals.drawMode = CameraPane.OCCLUSION;
1799
+ Globals.theRenderer.repaint();
17671800 } else
1768
- if (event.getSource() == recompileItem)
1801
+ if (source == recompileItem)
17691802 {
17701803 Recompile();
17711804 refreshContents();
17721805 } else
1773
- if (event.getSource() == editScriptItem)
1806
+ if (source == editScriptItem)
17741807 {
17751808 OpenDialog();
17761809 refreshContents();
17771810 } else
1778
- if (event.getSource() == invariantsItem)
1811
+ if (source == invariantsItem)
17791812 {
17801813 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1814
+ GrafreeD.grafreeD.universe.invariants();
17821815 } else
1783
- if (event.getSource() == memoryItem)
1816
+ if (source == memoryItem)
17841817 {
17851818 //System.out.println("Invariants:");
17861819 PrintMemory();
17871820 } else
1788
- if (event.getSource() == pathItem)
1821
+ if (source == pathItem)
17891822 {
17901823 PrintPath();
17911824 } else
1792
- if (event.getSource() == analyzeItem)
1825
+ if (source == analyzeItem)
17931826 {
17941827 AnalyzeObject();
17951828 } else
1796
- if (event.getSource() == dumpItem)
1829
+ if (source == dumpItem)
17971830 {
17981831 DumpObject();
17991832 } else
1800
- if (event.getSource() == screenfitButton)
1833
+ if (source == screenfitButton)
18011834 {
18021835 //Reload(lastConverter, lastFilename, true);
18031836 ScreenFit();
18041837 } else
1805
- if (event.getSource() == screenfitpointButton)
1838
+ if (source == screenfitpointButton)
18061839 {
18071840 //Reload(lastConverter, lastFilename, true);
18081841 ScreenFitPoint();
18091842 } else
1810
- if (event.getSource() == snapobjectButton)
1843
+ if (source == snapobjectButton)
18111844 {
18121845 //Reload(lastConverter, lastFilename, true);
18131846 SnapObject();
....@@ -1818,13 +1851,13 @@
18181851 // Recompile();
18191852 // refreshContents();
18201853 // } else
1821
- if (event.getSource() == gcButton)
1854
+ if (source == gcButton)
18221855 {
18231856 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241857 System.gc();
18251858 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261859 } else
1827
- if (event.getSource() == editLeafItem)
1860
+ if (source == editLeafItem)
18281861 {
18291862 Object3D obj;
18301863 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +1871,66 @@
18381871 }
18391872 refreshContents(true);
18401873 } else
1841
- if (event.getSource() == openWindowItem)
1874
+ if (source == openWindowItem)
18421875 {
18431876 EditSelection(true);
18441877 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1878
+ if (source == cutItem || source == clearButton)
18461879 {
18471880 loadClipboard(true);
18481881 } else
1849
- if (event.getSource() == duplicateItem)
1882
+ if (source == duplicateItem)
18501883 {
1851
- Object3D keep = GraphreeD.clipboard;
1884
+ Object3D keep = GrafreeD.clipboard;
18521885 loadClipboard(false);
18531886 paste(false);
1854
- GraphreeD.clipboard = keep;
1887
+ GrafreeD.clipboard = keep;
18551888 } else
1856
- if (event.getSource() == cloneItem)
1889
+ if (source == cloneItem)
18571890 {
18581891 CloneSelection(false);
18591892 } else
1860
- if (event.getSource() == cloneSupportItem)
1893
+ if (source == cloneSupportItem)
18611894 {
18621895 CloneSelection(true);
18631896 } else
1864
- if (event.getSource() == copyItem)
1897
+ if (source == copyItem)
18651898 {
18661899 loadClipboard(false);
18671900 } else
1868
- if (event.getSource() == pasteItem)
1901
+ if (source == pasteItem)
18691902 {
18701903 paste(false);
18711904 } else
1872
- if (event.getSource() == pasteLinkItem)
1905
+ if (source == pasteLinkItem)
18731906 {
18741907 pasteInto(false);
18751908 } else
1876
- if (event.getSource() == pasteCloneItem)
1909
+ if (source == pasteCloneItem)
18771910 {
18781911 pasteInto(true);
18791912 } else
1880
- if (event.getSource() == pasteExpandItem)
1913
+ if (source == pasteExpandItem)
18811914 {
18821915 paste(true);
18831916 } else
1884
- if (event.getSource() == synchronizeItem)
1917
+ if (source == synchronizeItem)
18851918 {
18861919 Overwrite(Object3D.TRANSFORM);
18871920 } else
1888
- if (event.getSource() == overwriteNameItem)
1921
+ if (source == overwriteNameItem)
18891922 {
18901923 Overwrite(Object3D.NAME);
18911924 } else
1892
- if (event.getSource() == overwriteUVItem)
1925
+ if (source == overwriteUVItem)
18931926 {
18941927 Overwrite(Object3D.UV);
18951928 } else
1896
- if (event.getSource() == overwriteMatItem)
1929
+ if (source == overwriteMatItem)
18971930 {
1931
+ /* july 2015
18981932 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
1933
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19001934 else
19011935 {
19021936 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +1942,16 @@
19081942 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19091943 }
19101944 }
1945
+ */
1946
+
1947
+ Overwrite(dropAttributes);
19111948 }
1912
- if (event.getSource() == overwriteGeoItem)
1949
+ if (source == overwriteGeoItem)
19131950 {
19141951 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1952
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19161953 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
1954
+// Object3D content = GrafreeD.clipboard.get(0);
19181955 //
19191956 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19201957 // content = ((cGroup)content).get(0);
....@@ -1926,7 +1963,7 @@
19261963 // refreshContents();
19271964 // }
19281965 } else
1929
- if (event.getSource() == generateMeshItem)
1966
+ if (source == generateMeshItem)
19301967 {
19311968 //if (group.selection.size() == 1)
19321969 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +1974,7 @@
19371974 ResetModel();
19381975 refreshContents();
19391976 } else
1940
- if (event.getSource() == extractGeometriesItem)
1977
+ if (source == extractGeometriesItem)
19411978 {
19421979 boolean one = false;
19431980
....@@ -1964,7 +2001,7 @@
19642001 ResetModel();
19652002 refreshContents();
19662003 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2004
+ if (source == cloneGeometriesItem)
19682005 {
19692006 boolean one = false;
19702007
....@@ -1990,32 +2027,37 @@
19902027 ResetModel();
19912028 refreshContents();
19922029 } else
1993
- if (event.getSource() == shareGeometriesItem)
2030
+ if (source == shareGeometriesItem)
19942031 {
19952032 boolean one = false;
19962033
19972034 if (group.selection.size() == 1)
19982035 one = true;
19992036
2037
+ Object3D merge = null;
2038
+
20002039 Object3D content = new cGroup();
20012040
20022041 for (int i=0; i<group.selection.size(); i++)
20032042 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2043
+ merge = new Merge(group.selection.get(i));
20052044
20062045 if (one)
2007
- makeSomething(sel, false);
2046
+ makeSomething(merge, false);
20082047 else
2009
- content.addChild(sel);
2048
+ content.addChild(merge);
20102049 }
20112050
20122051 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2052
+ makeSomething(content, true);
2053
+ else
2054
+ {
2055
+ ResetModel();
2056
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2057
+ refreshContents();
2058
+ }
20172059 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2060
+ if (source == mergeGeometriesItem)
20192061 {
20202062 boolean one = false;
20212063
....@@ -2045,11 +2087,11 @@
20452087 ResetModel();
20462088 refreshContents();
20472089 } else
2048
- if (event.getSource() == linkverticesItem)
2090
+ if (source == linkverticesItem)
20492091 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2092
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512093 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2094
+// Object3D content = GrafreeD.clipboard.get(0);
20532095 //
20542096 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552097 // content = ((cGroup)content).get(0);
....@@ -2058,14 +2100,14 @@
20582100 // group.selection.get(0).setMasterThis(content); // should be identity
20592101 // refreshContents();
20602102 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2103
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20622104 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2105
+ Object3D content = GrafreeD.clipboard.get(0);
20642106
20652107 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662108 content = ((cGroup)content).get(0);
20672109
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2110
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692111 for (int i=0; i<group.selection.size(); i++)
20702112 {
20712113 boolean random = CameraPane.RANDOM;
....@@ -2074,11 +2116,11 @@
20742116 // group.selection.get(i).setMasterThis(content); // should be identity
20752117 CameraPane.RANDOM = random;
20762118 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2119
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782120 refreshContents();
20792121 }
20802122 } else
2081
- if (event.getSource() == resetsupportItem)
2123
+ if (source == resetsupportItem)
20822124 {
20832125 for (int i=0; i<group.selection.size(); i++)
20842126 {
....@@ -2090,7 +2132,16 @@
20902132
20912133 refreshContents();
20922134 } else
2093
- if (event.getSource() == resetreferencesItem)
2135
+ if (source == relinkverticesItem)
2136
+ {
2137
+ boolean random = CameraPane.RANDOM;
2138
+ CameraPane.RANDOM = false; // parse all random nodes
2139
+ group.selection.RelinkToSupport();
2140
+ CameraPane.RANDOM = random;
2141
+
2142
+ refreshContents();
2143
+ } else
2144
+ if (source == resetreferencesItem)
20942145 {
20952146 for (int i=0; i<group.selection.size(); i++)
20962147 {
....@@ -2099,11 +2150,11 @@
20992150
21002151 refreshContents();
21012152 } else
2102
- if (event.getSource() == setMasterItem)
2153
+ if (source == setMasterItem)
21032154 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2155
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21052156 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2157
+ Object3D content = GrafreeD.clipboard.get(0);
21072158
21082159 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092160 content = ((cGroup)content).get(0);
....@@ -2112,13 +2163,13 @@
21122163 refreshContents();
21132164 }
21142165 } else
2115
- if (event.getSource() == poseMeshItem)
2166
+ if (source == poseMeshItem)
21162167 {
21172168 if (group.selection.size() == 1)
21182169 {
2119
- if (GraphreeD.clipboard.size() == 1)
2170
+ if (GrafreeD.clipboard.size() == 1)
21202171 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2172
+ Object3D content = GrafreeD.clipboard.get(0);
21222173
21232174 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242175 content = ((cGroup)content).get(0);
....@@ -2131,19 +2182,19 @@
21312182 }
21322183
21332184 } else
2134
- if (event.getSource() == revertMeshItem)
2185
+ if (source == revertMeshItem)
21352186 {
21362187 RevertMeshes();
21372188 } else
2138
- if (event.getSource() == resetMeshItem)
2189
+ if (source == resetMeshItem)
21392190 {
21402191 ResetAll();
21412192 } else
2142
- if (event.getSource() == stepAllItem)
2193
+ if (source == stepAllItem)
21432194 {
21442195 StepAll();
21452196 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2197
+ if (source == clearItem) // || event.getSource() == clearButton)
21472198 {
21482199 //int indices[] = jList.getSelectedIndices();
21492200 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2202,46 @@
21512202
21522203 ClearSelection(false);
21532204 } else
2154
- if (event.getSource() == clearAllItem)
2205
+ if (source == clearAllItem)
21552206 {
21562207 ClearSelection(true);
21572208 } else
2158
- if (event.getSource() == grabItem)
2209
+ if (source == grabItem)
21592210 {
21602211 group(new cGroup(), true);
21612212 } else
2162
- if (event.getSource() == frontItem)
2213
+ if (source == hideItem)
2214
+ {
2215
+ group(new HiddenObject());
2216
+ } else
2217
+ if (source == frontItem)
21632218 {
21642219 front();
21652220 } else
2166
- if (event.getSource() == backItem)
2221
+ if (source == backItem)
21672222 {
21682223 back();
21692224 } else
2170
- if (event.getSource() == cameraItem)
2225
+ if (source == cameraItem)
21712226 {
21722227 makeSomething(new Camera());
21732228 } else
2174
- if (event.getSource() == compositeItem)
2229
+ if (source == compositeItem)
21752230 {
21762231 group(new Composite());
21772232 } else
2178
- if (event.getSource() == randomItem)
2233
+ if (source == randomItem)
21792234 {
21802235 RandomNode random = new RandomNode();
21812236 group(random);
21822237 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2238
+ random.name = random.get(0).name + "Switch";
21842239 } else
2185
- if (event.getSource() == physicsItem)
2240
+ if (source == physicsItem)
21862241 {
21872242 group(new PhysicsNode());
21882243 } else
2189
- if (event.getSource() == frameselectorItem)
2244
+ if (source == frameselectorItem)
21902245 {
21912246 for (int i=0; i<group.selection.size(); i++)
21922247 {
....@@ -2198,7 +2253,7 @@
21982253 ResetModel();
21992254 refreshContents();
22002255 } else
2201
- if (event.getSource() == switchGeoItem)
2256
+ if (source == switchGeoItem)
22022257 {
22032258 for (int i=0; i<group.selection.size(); i++)
22042259 {
....@@ -2210,7 +2265,7 @@
22102265 ResetModel();
22112266 refreshContents();
22122267 } else
2213
- if (event.getSource() == switchTransfoItem)
2268
+ if (source == switchTransfoItem)
22142269 {
22152270 for (int i=0; i<group.selection.size(); i++)
22162271 {
....@@ -2222,7 +2277,7 @@
22222277 ResetModel();
22232278 refreshContents();
22242279 } else
2225
- if (event.getSource() == morphItem)
2280
+ if (source == morphItem)
22262281 {
22272282 for (int i=0; i<group.selection.size(); i++)
22282283 {
....@@ -2234,7 +2289,7 @@
22342289 ResetModel();
22352290 refreshContents();
22362291 } else
2237
- if (event.getSource() == scriptNodeItem)
2292
+ if (source == scriptNodeItem)
22382293 {
22392294 boolean atleastone = false;
22402295
....@@ -2273,195 +2328,215 @@
22732328 }
22742329 }
22752330 } else
2276
- if (event.getSource() == linkerItem)
2331
+ if (source == linkerItem)
22772332 {
22782333 group(new cLinker());
22792334 } else
2280
- if (event.getSource() == textureItem)
2335
+ if (source == textureItem)
22812336 {
22822337 group(new TextureNode());
22832338 } else
2284
- if (event.getSource() == shadowXItem)
2339
+ if (source == billboardItem)
2340
+ {
2341
+ group(new BillboardNode());
2342
+ } else
2343
+ if (source == shadowXItem)
22852344 {
22862345 CastShadow(0);
22872346 } else
2288
- if (event.getSource() == shadowYItem)
2347
+ if (source == shadowYItem)
22892348 {
22902349 CastShadow(1);
22912350 } else
2292
- if (event.getSource() == shadowZItem)
2351
+ if (source == shadowZItem)
22932352 {
22942353 CastShadow(2);
22952354 } else
2296
- if (event.getSource() == ungroupItem)
2355
+ if (source == ungroupItem)
22972356 {
2298
- ungroup();
2357
+ //ungroup();
2358
+ for (int i=0; i<group.selection.size(); i++)
2359
+ {
2360
+ Ungroup(group.selection.get(i));
2361
+ }
2362
+
2363
+ ClearSelection(false);
2364
+
2365
+ refreshContents();
22992366 } else
2300
- if (event.getSource() == genUVItem)
2367
+ if (source == genUVItem)
23012368 {
23022369 GenUV();
23032370 } else
2304
- if (event.getSource() == genNormalsCADItem)
2371
+ if (source == genNormalsCADItem)
23052372 {
23062373 GenNormals(true);
23072374 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2375
+ if (source == genNormalsMESHItem)
2376
+ {
2377
+ GenNormals(true); // TODO
2378
+ } else
2379
+ if (source == genNormalsORGANItem)
23092380 {
23102381 GenNormals(false);
23112382 } else
2312
- if (event.getSource() == stripifyItem)
2383
+ if (source == genNormalsMINEItem)
2384
+ {
2385
+ GenNormalsMINE();
2386
+ } else
2387
+ if (source == stripifyItem)
23132388 {
23142389 Stripify();
23152390 } else
2316
- if (event.getSource() == unstripifyItem)
2391
+ if (source == unstripifyItem)
23172392 {
23182393 Unstripify();
23192394 } else
2320
- if (event.getSource() == trimItem)
2395
+ if (source == trimItem)
23212396 {
23222397 Trim();
23232398 } else
2324
- if (event.getSource() == untrimItem)
2399
+ if (source == untrimItem)
23252400 {
23262401 Untrim();
23272402 } else
2328
- if (event.getSource() == clearColorsItem)
2403
+ if (source == clearColorsItem)
23292404 {
23302405 ClearColors();
23312406 } else
2332
- if (event.getSource() == clearMaterialsItem)
2407
+ if (source == clearMaterialsItem)
23332408 {
23342409 ClearMaterials();
23352410 } else
2336
- if (event.getSource() == liveleavesItem)
2411
+ if (source == liveleavesItem)
23372412 {
23382413 LiveLeaves(true);
23392414 } else
2340
- if (event.getSource() == unliveleavesItem)
2415
+ if (source == unliveleavesItem)
23412416 {
23422417 LiveLeaves(false);
23432418 } else
2344
- if (event.getSource() == supportleavesItem)
2419
+ if (source == supportleavesItem)
23452420 {
23462421 SupportLeaves(true);
23472422 } else
2348
- if (event.getSource() == unsupportleavesItem)
2423
+ if (source == unsupportleavesItem)
23492424 {
23502425 SupportLeaves(false);
23512426 } else
2352
- if (event.getSource() == hideleavesItem)
2427
+ if (source == hideleavesItem)
23532428 {
23542429 HideLeaves(true);
23552430 } else
2356
- if (event.getSource() == showleavesItem)
2431
+ if (source == showleavesItem)
23572432 {
23582433 HideLeaves(false);
23592434 } else
2360
- if (event.getSource() == markleavesItem)
2435
+ if (source == markleavesItem)
23612436 {
23622437 MarkLeaves(true);
23632438 } else
2364
- if (event.getSource() == unmarkleavesItem)
2439
+ if (source == unmarkleavesItem)
23652440 {
23662441 MarkLeaves(false);
23672442 } else
2368
- if (event.getSource() == flipVItem)
2443
+ if (source == flipVItem)
23692444 {
23702445 FlipV(true);
23712446 } else
2372
- if (event.getSource() == unflipVItem)
2447
+ if (source == unflipVItem)
23732448 {
23742449 FlipV(false);
23752450 } else
2376
- if (event.getSource() == lowTexturesItem)
2451
+ if (source == lowTexturesItem)
23772452 {
23782453 SetTexRes(0);
23792454 } else
2380
- if (event.getSource() == normalTexturesItem)
2455
+ if (source == normalTexturesItem)
23812456 {
23822457 SetTexRes(1);
23832458 } else
2384
- if (event.getSource() == highTexturesItem)
2459
+ if (source == highTexturesItem)
23852460 {
23862461 SetTexRes(2);
23872462 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2463
+ if (source == veryhighTexturesItem)
23892464 {
23902465 SetTexRes(3);
23912466 } else
2392
- if (event.getSource() == maxTexturesItem)
2467
+ if (source == maxTexturesItem)
23932468 {
23942469 SetTexRes(4);
23952470 } else
2396
- if (event.getSource() == panoTexturesItem)
2471
+ if (source == panoTexturesItem)
23972472 {
23982473 SetTexRes(5);
23992474 } else
2400
- if (event.getSource() == reverseNormalsItem)
2475
+ if (source == reverseNormalsItem)
24012476 {
24022477 ReverseNormals();
24032478 } else
2404
- if (event.getSource() == parseverticesItem)
2479
+ if (source == parseverticesItem)
24052480 {
24062481 ParseVertices();
24072482 } else
2408
- if (event.getSource() == textureFieldItem)
2483
+ if (source == textureFieldItem)
24092484 {
24102485 TextureVertices();
24112486 } else
2412
- if (event.getSource() == alignItem)
2487
+ if (source == alignItem)
24132488 {
24142489 Align();
24152490 } else
2416
- if (event.getSource() == mirrorItem)
2491
+ if (source == mirrorItem)
24172492 {
24182493 MirrorPoses();
24192494 } else
2420
- if (event.getSource() == reduceMorphItem)
2495
+ if (source == reduceMorphItem)
24212496 {
24222497 MeshReduction(false);
24232498 } else
2424
- if (event.getSource() == reduce34MorphItem)
2499
+ if (source == reduce34MorphItem)
24252500 {
24262501 MeshReduction(true);
24272502 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2503
+ if (source == reverseTrianglesItem)
24292504 {
24302505 ReverseTriangles();
24312506 } else
2432
- if (event.getSource() == reduceMeshItem)
2507
+ if (source == reduceMeshItem)
24332508 {
24342509 ReduceMesh(false);
24352510 } else
2436
- if (event.getSource() == reduce34MeshItem)
2511
+ if (source == reduce34MeshItem)
24372512 {
24382513 ReduceMesh(true);
24392514 } else
2440
- if (event.getSource() == increaseMeshItem)
2515
+ if (source == increaseMeshItem)
24412516 {
24422517 IncreaseMesh();
24432518 } else
2444
- if (event.getSource() == clipMeshItem)
2519
+ if (source == clipMeshItem)
24452520 {
24462521 ClipMesh();
24472522 } else
2448
- if (event.getSource() == smoothMeshItem)
2523
+ if (source == smoothMeshItem)
24492524 {
24502525 SmoothMesh();
24512526 } else
2452
- if (event.getSource() == transformgeometryItem)
2527
+ if (source == transformgeometryItem)
24532528 {
24542529 TransformGeometry();
24552530 } else
2456
- if (event.getSource() == resetTransformItem)
2531
+ if (source == resetTransformItem)
24572532 {
24582533 ResetTransform();
24592534 } else
2460
- if (event.getSource() == resetCentroidItem)
2535
+ if (source == resetCentroidItem)
24612536 {
24622537 ResetCentroid();
24632538 } else
2464
- if (event.getSource() == resetParentItem)
2539
+ if (source == resetParentItem)
24652540 {
24662541 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672542 {
....@@ -2471,7 +2546,7 @@
24712546
24722547 refreshContents();
24732548 } else
2474
- if (event.getSource() == repairParentItem)
2549
+ if (source == repairParentItem)
24752550 {
24762551 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772552 {
....@@ -2485,7 +2560,21 @@
24852560
24862561 refreshContents();
24872562 } else
2488
- if (event.getSource() == sortbysizeItem)
2563
+ if (source == repairShadowItem)
2564
+ {
2565
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2566
+ {
2567
+ Object3D obj = (Object3D)e.nextElement();
2568
+ obj.RepairShadow();
2569
+// for (int i=0; i<obj.size(); i++)
2570
+// {
2571
+// obj.get(i).parent = obj;
2572
+// }
2573
+ }
2574
+
2575
+ refreshContents();
2576
+ } else
2577
+ if (source == sortbysizeItem)
24892578 {
24902579 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912580 {
....@@ -2497,7 +2586,7 @@
24972586 ResetModel();
24982587 refreshContents();
24992588 } else
2500
- if (event.getSource() == sortbynameItem)
2589
+ if (source == sortbynameItem)
25012590 {
25022591 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032592 {
....@@ -2509,7 +2598,7 @@
25092598 ResetModel();
25102599 refreshContents();
25112600 } else
2512
- if (event.getSource() == attachPigmentItem)
2601
+ if (source == attachPigmentItem)
25132602 {
25142603 String texture = GetFile("Attach pigment");
25152604 Object3D obj;
....@@ -2521,7 +2610,7 @@
25212610
25222611 refreshContents();
25232612 } else
2524
- if (event.getSource() == detachPigmentItem)
2613
+ if (source == detachPigmentItem)
25252614 {
25262615 Object3D obj;
25272616 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2621,7 @@
25322621
25332622 refreshContents();
25342623 } else
2535
- if (event.getSource() == attachBumpItem)
2624
+ if (source == attachBumpItem)
25362625 {
25372626 String texture = GetFile("Attach bump");
25382627 Object3D obj;
....@@ -2544,7 +2633,7 @@
25442633
25452634 refreshContents();
25462635 } else
2547
- if (event.getSource() == detachBumpItem)
2636
+ if (source == detachBumpItem)
25482637 {
25492638 Object3D obj;
25502639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2644,7 @@
25552644
25562645 refreshContents();
25572646 } else
2558
- if (event.getSource() == pigmentBumpItem)
2647
+ if (source == pigmentBumpItem)
25592648 {
25602649 Object3D obj;
25612650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2655,195 @@
25662655
25672656 refreshContents();
25682657 } else
2569
- if (event.getSource() == flashSelectionButton)
2658
+ if (source == flashSelectionButton)
25702659 {
25712660 CameraPane.flash = true;
25722661 refreshContents();
25732662 } else
2574
- if (event.getSource() == oneButton)
2663
+ if (source == oneButton)
25752664 {
25762665 } else
2577
- if (event.getSource() == twoButton)
2666
+ if (source == twoButton)
25782667 {
25792668 radio.layout = twoButton;
25802669 // bug
25812670 //gridPanel.setDividerLocation(1.0);
25822671 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
2672
+// bigThree.remove(scenePanel);
2673
+// bigThree.remove(centralPanel);
2674
+// bigThree.remove(XYZPanel);
2675
+// aWindowConstraints.gridx = 0;
2676
+// aWindowConstraints.gridy = 0;
2677
+// aWindowConstraints.gridwidth = 1;
2678
+// // aConstraints.gridheight = 3;
2679
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2680
+// aWindowConstraints.weightx = 0;
2681
+// aWindowConstraints.weighty = 1;
2682
+// //bigThree.add(jtp, aWindowConstraints);
2683
+// aWindowConstraints.weightx = 1;
2684
+// aWindowConstraints.gridwidth = 3;
2685
+// // aConstraints.gridheight = 3;
2686
+// aWindowConstraints.gridx = 1;
2687
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2688
+// bigThree.add(centralPanel, aWindowConstraints);
2689
+// aWindowConstraints.weightx = 0;
2690
+// aWindowConstraints.gridx = 4;
2691
+// aWindowConstraints.gridwidth = 1;
2692
+// // aConstraints.gridheight = 3;
2693
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2694
+// //bigThree.add(XYZPanel, aWindowConstraints);
2695
+// scenePanel.setVisible(false);
2696
+// centralPanel.setVisible(true);
2697
+// XYZPanel.setVisible(false);
2698
+ bigThree.ClearUI();
2699
+ bigThree.add(centralPanel);
2700
+ bigThree.FlushUI();
26072701 } else
2608
- if (event.getSource() == threeButton)
2702
+ if (source == threeButton)
26092703 {
26102704 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
2705
+
2706
+// bigThree.remove(scenePanel);
2707
+// bigThree.remove(centralPanel);
2708
+// bigThree.remove(XYZPanel);
2709
+// aWindowConstraints.gridx = 0;
2710
+// aWindowConstraints.gridy = 0;
2711
+// aWindowConstraints.gridwidth = 1;
2712
+// // aConstraints.gridheight = 3;
2713
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2714
+// aWindowConstraints.weightx = 0;
2715
+// aWindowConstraints.weighty = 1;
2716
+// //bigThree.add(jtp, aWindowConstraints);
2717
+// aWindowConstraints.weightx = 1;
2718
+// aWindowConstraints.gridwidth = 3;
2719
+// // aConstraints.gridheight = 3;
2720
+// aWindowConstraints.gridx = 1;
2721
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2722
+// bigThree.add(centralPanel, aWindowConstraints);
2723
+// aWindowConstraints.weightx = 0;
2724
+// aWindowConstraints.gridx = 4;
2725
+// aWindowConstraints.gridwidth = 1;
2726
+// // aConstraints.gridheight = 3;
2727
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2728
+// bigThree.add(XYZPanel, aWindowConstraints);
2729
+// bigThree.validate();
2730
+// scenePanel.setVisible(false);
2731
+// centralPanel.setVisible(true);
2732
+// XYZPanel.setVisible(true);
2733
+ bigThree.ClearUI();
2734
+ bigThree.add(centralPanel);
2735
+ bigThree.add(XYZPanel);
2736
+ bigThree.FlushUI();
26352737 } else
2636
- if (event.getSource() == fourButton)
2738
+ if (source == fourButton)
26372739 {
26382740 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
2741
+
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
+// // aWindowConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2750
+// aWindowConstraints.weightx = 1;
2751
+// aWindowConstraints.weighty = 1;
2752
+// bigThree.add(scenePanel, 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(cameraPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aWindowConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// bigThree.validate();
2766
+// scenePanel.setVisible(true);
2767
+// centralPanel.setVisible(false);
2768
+// XYZPanel.setVisible(false);
2769
+ bigThree.ClearUI();
2770
+ bigThree.add(scenePanel);
2771
+ bigThree.FlushUI();
26632772 } else
2664
- if (event.getSource() == sixButton)
2773
+ if (source == sixButton)
26652774 {
26662775 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
2776
+
2777
+// bigThree.remove(scenePanel);
2778
+// bigThree.remove(centralPanel);
2779
+// bigThree.remove(XYZPanel);
2780
+// aWindowConstraints.gridx = 0;
2781
+// aWindowConstraints.gridy = 0;
2782
+// aWindowConstraints.gridwidth = 1;
2783
+// // aConstraints.gridheight = 3;
2784
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2785
+// aWindowConstraints.weightx = 0;
2786
+// aWindowConstraints.weighty = 1;
2787
+// bigThree.add(scenePanel, aWindowConstraints);
2788
+// aWindowConstraints.weightx = 1;
2789
+// aWindowConstraints.gridwidth = 3;
2790
+// // aWindowConstraints.gridheight = 3;
2791
+// aWindowConstraints.gridx = 1;
2792
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2793
+// bigThree.add(centralPanel, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 0;
2795
+// aWindowConstraints.gridx = 4;
2796
+// aWindowConstraints.gridwidth = 1;
2797
+// // aWindowConstraints.gridheight = 3;
2798
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2799
+// //bigThree.add(XYZPanel, aConstraints);
2800
+// bigThree.validate();
2801
+// scenePanel.setVisible(true);
2802
+// centralPanel.setVisible(true);
2803
+// XYZPanel.setVisible(false);
2804
+ bigThree.ClearUI();
2805
+ bigThree.add(scenePanel);
2806
+ bigThree.add(centralPanel);
2807
+ bigThree.FlushUI();
26912808 } else
2692
- if (event.getSource() == sevenButton)
2809
+ if (source == sevenButton)
26932810 {
26942811 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
2812
+
2813
+// bigThree.remove(scenePanel);
2814
+// bigThree.remove(centralPanel);
2815
+// bigThree.remove(XYZPanel);
2816
+// aWindowConstraints.gridx = 0;
2817
+// aWindowConstraints.gridy = 0;
2818
+// aWindowConstraints.gridwidth = 1;
2819
+// // aWindowConstraints.gridheight = 3;
2820
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
+// aWindowConstraints.weightx = 0;
2822
+// aWindowConstraints.weighty = 1;
2823
+// bigThree.add(scenePanel, aWindowConstraints);
2824
+// aWindowConstraints.weightx = 1;
2825
+// aWindowConstraints.gridwidth = 3;
2826
+// // aWindowConstraints.gridheight = 3;
2827
+// aWindowConstraints.gridx = 1;
2828
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2829
+// bigThree.add(centralPanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 0;
2831
+// aWindowConstraints.gridx = 4;
2832
+// aWindowConstraints.gridwidth = 1;
2833
+// // aConstraints.gridheight = 3;
2834
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2835
+// bigThree.add(XYZPanel, aWindowConstraints);
2836
+// bigThree.validate();
2837
+// scenePanel.setVisible(true);
2838
+// centralPanel.setVisible(true);
2839
+// XYZPanel.setVisible(true);
2840
+ bigThree.ClearUI();
2841
+ bigThree.add(scenePanel);
2842
+ bigThree.add(centralPanel);
2843
+ bigThree.add(XYZPanel);
2844
+ bigThree.FlushUI();
27192845 } else
2720
- if (event.getSource() == rootButton)
2846
+ if (source == rootButton)
27212847 {
27222848 Object3D obj;
27232849 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +2855,7 @@
27292855
27302856 refreshContents(true);
27312857 } else
2732
- if (event.getSource() == closeButton)
2858
+ if (source == closeButton)
27332859 {
27342860 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27352861 cRadio ab;
....@@ -2750,11 +2876,11 @@
27502876 }
27512877 refreshContents(true);
27522878 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
2879
+ if (source == editItem || source == editButton)
27542880 {
27552881 EditSelection(false);
27562882 } else
2757
- if (event.getSource() == uneditButton)
2883
+ if (source == uneditButton)
27582884 {
27592885 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27602886 {
....@@ -2766,12 +2892,12 @@
27662892
27672893 child.editWindow = null; // ???????????
27682894 }
2769
- objEditor.ctrlPanel.revalidate();
2895
+ objEditor.ctrlPanel.validate();
27702896 //objEditor.jTree.clearSelection();
27712897 //objEditor.ResetSliders();
27722898 refreshContents(true);
27732899 } else
2774
- if (event.getSource() == clearPanelButton)
2900
+ if (source == clearPanelButton)
27752901 {
27762902 assert(copy == group);
27772903 //copy.ClearUI();
....@@ -2782,7 +2908,7 @@
27822908 listUI.clear();
27832909 refreshContents(true);
27842910 } else
2785
- if (event.getSource() == allParamsButton)
2911
+ if (source == allParamsButton)
27862912 {
27872913 assert(copy == group);
27882914
....@@ -2803,19 +2929,19 @@
28032929
28042930 refreshContents(true);
28052931 } else
2806
- if (event.getSource() == unselectButton)
2932
+ if (source == unselectButton)
28072933 {
28082934 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
2935
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28102936 objEditor.ResetSliders();
28112937 refreshContents(true);
28122938 } else
2813
- if(event.getSource() instanceof cRadio)
2939
+ if(source instanceof cRadio)
28142940 {
28152941 group.parent = keepparent;
28162942 group.attributes = 0;
28172943 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
2944
+ /*cRadio*/ radio = (cRadio)source;
28192945 Object3D obj = radio.GetObject();
28202946 System.out.println("Edit " + obj);
28212947 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +2961,7 @@
28352961 }
28362962
28372963 copy = group;
2838
- //CameraPane.theRenderer.object = group;
2964
+ //Globals.theRenderer.object = group;
28392965 if(!useclient)
28402966 {
28412967 cameraView.renderCamera = radio.camera;
....@@ -2844,7 +2970,8 @@
28442970 cameraView.cameras[cameraView.cameracount] = radio.camera;
28452971 cameraView.targetLookAt.set(radio.camera.lookAt);
28462972 cameraView.object = group;
2847
- cameraView.lighttouched = true;
2973
+ //cameraView.lighttouched = true;
2974
+ Globals.lighttouched = true;
28482975 topView.object = group;
28492976 frontView.object = group;
28502977 sideView.object = group;
....@@ -2880,7 +3007,7 @@
28803007 if (useclient)
28813008 {
28823009 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3010
+ Globals.lighttouched = true;
28843011 //topView.object = client;
28853012 //frontView.object = client;
28863013 //sideView.object = client;
....@@ -2888,7 +3015,7 @@
28883015 else
28893016 {
28903017 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3018
+ Globals.lighttouched = true;
28923019 //topView.object = group;
28933020 //frontView.object = group;
28943021 //sideView.object = group;
....@@ -3121,9 +3248,9 @@
31213248 obj = (Object3D)e.nextElement();
31223249
31233250 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3251
+ GrafreeD.AnalyzeObject(obj);
31253252 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3253
+ GrafreeD.AnalyzeObject(obj.bRep);
31273254
31283255 // System.err.println((size/1024) + " KB is the size of " + obj);
31293256 }
....@@ -3165,6 +3292,13 @@
31653292 void GenNormals(boolean crease)
31663293 {
31673294 group.GenNormalsS(crease);
3295
+
3296
+ refreshContents();
3297
+ }
3298
+
3299
+ void GenNormalsMINE()
3300
+ {
3301
+ group.selection.GenNormalsMINE();
31683302
31693303 refreshContents();
31703304 }
....@@ -3250,7 +3384,7 @@
32503384 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513385 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523386 //
3253
-// g.add(GraphreeD.clipboard);
3387
+// g.add(GrafreeD.clipboard);
32543388 //
32553389 // buffer.add(g);
32563390 // }
....@@ -3269,8 +3403,8 @@
32693403 // nodes = new Object3D();
32703404 // vertices = new Vector<Vertex>();
32713405 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3406
+// boolean epsequal = GrafreeD.epsequal;
3407
+// GrafreeD.epsequal = true;
32743408 //
32753409 // for (int i=0; i<group.selection.size(); i++)
32763410 // {
....@@ -3311,7 +3445,7 @@
33113445 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123446 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133447 //
3314
-// g.add(GraphreeD.clipboard);
3448
+// g.add(GrafreeD.clipboard);
33153449 //
33163450 // buffer.add(g);
33173451 // }
....@@ -3319,7 +3453,7 @@
33193453 // makeSomething(buffer, i==group.selection.size()-1);
33203454 // }
33213455 //
3322
-// GraphreeD.epsequal = epsequal;
3456
+// GrafreeD.epsequal = epsequal;
33233457 //
33243458 // //buffer = null;
33253459 // temprep = null;
....@@ -3330,8 +3464,8 @@
33303464
33313465 void ParseVertices()
33323466 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3467
+ boolean epsequal = GrafreeD.epsequal;
3468
+ GrafreeD.epsequal = true;
33353469
33363470 for (int i=0; i<group.selection.size(); i++)
33373471 {
....@@ -3356,7 +3490,7 @@
33563490 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573491 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583492
3359
- g.add(GraphreeD.clipboard);
3493
+ g.add(GrafreeD.clipboard);
33603494
33613495 buffer.add(g);
33623496 }
....@@ -3371,7 +3505,7 @@
33713505 makeSomething(buffer, i==group.selection.size()-1);
33723506 }
33733507
3374
- GraphreeD.epsequal = epsequal;
3508
+ GrafreeD.epsequal = epsequal;
33753509
33763510 refreshContents();
33773511 }
....@@ -3389,7 +3523,7 @@
33893523 String pigment = Object3D.GetPigment(tex);
33903524 //String bump = Object3D.GetBump(tex);
33913525
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3526
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33933527
33943528 double s = v.s;
33953529
....@@ -3416,7 +3550,7 @@
34163550 scale /= 3;
34173551
34183552 scale /= 0xFF;
3419
- scale /= 4;
3553
+ // c'est quoi ca? scale /= 4;
34203554
34213555 //v.AO = scale;
34223556
....@@ -3437,12 +3571,26 @@
34373571
34383572 void Align()
34393573 {
3574
+ if (group.selection.size() == 0)
3575
+ return;
3576
+
3577
+ cVector bbmin = new cVector();
3578
+ cVector bbmax = new cVector();
3579
+
3580
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3581
+
3582
+ double dx = bbmax.x - bbmin.x;
3583
+ double dy = bbmax.y - bbmin.y;
3584
+ double dz = bbmax.z - bbmin.z;
3585
+
3586
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3587
+
34403588 for (int i=0; i<group.selection.size(); i++)
34413589 {
34423590 Object3D obj = group.selection.get(i);
34433591
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3592
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3593
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463594 }
34473595
34483596 refreshContents();
....@@ -3455,7 +3603,7 @@
34553603 // ref.SaveSupports();
34563604 // Object3D par = ref.parent;
34573605 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3606
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593607 // ref.parent = par;
34603608 // ref.RestoreSupports();
34613609
....@@ -3485,7 +3633,7 @@
34853633 // lowres.SaveSupports();
34863634 // par = lowres.parent;
34873635 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3636
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893637 Object3D newlow = CloneObject(lowres, false);
34903638 newlow.name = sn.switchobject.get(i).name;
34913639 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3655,7 @@
35073655 return;
35083656
35093657 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3658
+ Object3D ref = GrafreeD.clipboard.get(0);
35113659
35123660 Object3D newgroup = new Object3D("Po:" + poses.name);
35133661
....@@ -3676,7 +3824,7 @@
36763824 group.selection.RelinkToSupport(); // july 2014
36773825 System.out.println("DONE.");
36783826 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3827
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36803828 }
36813829
36823830 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +3849,20 @@
37013849
37023850 void ClipMesh()
37033851 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3852
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
37053853 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
3854
+ Object3D content = GrafreeD.clipboard.get(0);
37073855
37083856 if (content instanceof cGroup && ((cGroup)content).transientlink )
37093857 content = ((cGroup)content).get(0);
37103858
37113859 // for (int i=0; i<group.selection.size(); i++)
37123860 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3861
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37143862 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
3863
+ group.selection.ClipMesh(GrafreeD.clipboard);
37163864 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
3865
+// group.selection.ClipMesh(GrafreeD.clipboard);
37183866 System.out.println("DONE.");
37193867 refreshContents();
37203868 }
....@@ -3952,25 +4100,25 @@
39524100 System.err.println("info : " + child.GetPath());
39534101 }
39544102 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4103
+// else
4104
+// {
4105
+// objEditor.SetMaterial(group); // .GetMaterial());
4106
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4107
+// System.err.println("info : " + group.GetPath());
4108
+// }
39614109
39624110 objEditor.SetText(); // jan 2014
39634111
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4112
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39654113 CameraPane.flash = true;
39664114
39674115 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39684116 // a camera
39694117 {
39704118 CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4119
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4120
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4121
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744122 }
39754123
39764124 refreshContents();
....@@ -4052,12 +4200,12 @@
40524200 {
40534201 if (group.selection.isEmpty())
40544202 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4203
+ GrafreeD.clipboardIsTempGroup = false;
40564204 Composite tGroup = null;
40574205 if (group.selection.size() > 0) // 1)
40584206 {
40594207 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4208
+ GrafreeD.clipboardIsTempGroup = true;
40614209 }
40624210
40634211 if (cut)
....@@ -4097,16 +4245,16 @@
40974245 //System.out.println("cut " + child);
40984246 //System.out.println("parent = " + child.parent);
40994247 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4248
+ if (GrafreeD.clipboardIsTempGroup)
41014249 tGroup.add/*Child*/(tmp);
41024250 else
4103
- GraphreeD.clipboard = tmp;
4251
+ GrafreeD.clipboard = tmp;
41044252 }
41054253 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4254
+ if (GrafreeD.clipboardIsTempGroup)
41074255 tGroup.add/*Child*/(child);
41084256 else
4109
- GraphreeD.clipboard = child;
4257
+ GrafreeD.clipboard = child;
41104258 }
41114259
41124260 //ResetModel();
....@@ -4138,21 +4286,21 @@
41384286 //System.out.println("cut " + elem);
41394287 //System.out.println("parent = " + elem.parent);
41404288 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4289
+ if (GrafreeD.clipboardIsTempGroup)
41424290 tGroup.add/*Child*/(tmp);
41434291 else
4144
- GraphreeD.clipboard = tmp;
4292
+ GrafreeD.clipboard = tmp;
41454293 }
41464294 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4295
+ if (GrafreeD.clipboardIsTempGroup)
41484296 tGroup.add/*Child*/(child);
41494297 else
4150
- GraphreeD.clipboard = child;
4298
+ GrafreeD.clipboard = child;
41514299 }
41524300
41534301 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4302
+ if (GrafreeD.clipboardIsTempGroup)
4303
+ GrafreeD.clipboard = tGroup;
41564304 if (cut)
41574305 {
41584306 ResetModel();
....@@ -4162,11 +4310,11 @@
41624310
41634311 void paste(boolean expand)
41644312 {
4165
- // if (GraphreeD.clipboard == null)
4313
+ // if (GrafreeD.clipboard == null)
41664314 // return;
41674315 boolean first = true;
41684316
4169
- if (GraphreeD.clipboardIsTempGroup)
4317
+ if (GrafreeD.clipboardIsTempGroup)
41704318 {
41714319 Composite temp;
41724320
....@@ -4177,7 +4325,7 @@
41774325 temp = (Composite)Applet3D.clipboard.deepCopy();
41784326 */
41794327 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4328
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814329 {
41824330 Object3D child = (Object3D)e.nextElement();
41834331
....@@ -4191,7 +4339,7 @@
41914339 else
41924340 elem = child.deepCopy(); // ?
41934341 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4342
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954343 // elem = elem.get(0);
41964344 makeSomething(elem, true); // ?? first);
41974345 //group.addChild(elem);
....@@ -4211,14 +4359,14 @@
42114359 //Object3D cb = Applet3D.clipboard;
42124360 //temp.addChild(cb);
42134361 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4362
+ assert(GrafreeD.clipboard.parent == null);
4363
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4364
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4365
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4366
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
42194367 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4368
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4369
+ GrafreeD.clipboard.get(0).parent = keepparent;
42224370 }
42234371
42244372 ResetModel();
....@@ -4227,7 +4375,7 @@
42274375
42284376 void pasteInto(boolean copyit)
42294377 {
4230
-// if (GraphreeD.clipboard == null)
4378
+// if (GrafreeD.clipboard == null)
42314379 // return;
42324380
42334381 if (group.selection.size() != 1)
....@@ -4260,9 +4408,9 @@
42604408 {
42614409 boolean first = true;
42624410
4263
- if (GraphreeD.clipboardIsTempGroup)
4411
+ if (GrafreeD.clipboardIsTempGroup)
42644412 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4413
+ Composite temp = (Composite)GrafreeD.clipboard;
42664414 Object3D copy;
42674415 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684416 {
....@@ -4272,7 +4420,7 @@
42724420 }
42734421 } else
42744422 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4423
+ linkSomething(GrafreeD.clipboard); //.get(0));
42764424 }
42774425 }
42784426 }
....@@ -4464,6 +4612,26 @@
44644612 makeSomething(csg);
44654613 }
44664614
4615
+ void Ungroup(Object3D g)
4616
+ {
4617
+ if (g instanceof HiddenObject)
4618
+ {
4619
+ HiddenObject h = (HiddenObject) g;
4620
+
4621
+ for (int i=0; i<h.ActualSize(); i++)
4622
+ {
4623
+ objEditor.makeSomething(h.get(i), false);
4624
+ }
4625
+ }
4626
+ else
4627
+ {
4628
+ for (int i=0; i<g.Size(); i++)
4629
+ {
4630
+ objEditor.makeSomething(g.get(i), false);
4631
+ }
4632
+ }
4633
+ }
4634
+
44674635 void ungroup()
44684636 {
44694637 /*
....@@ -4659,7 +4827,7 @@
46594827
46604828 void ImportGFD()
46614829 {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4830
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
46634831 browser.show();
46644832 String filename = browser.getFile();
46654833 if (filename != null && filename.length() > 0)
....@@ -4697,7 +4865,7 @@
46974865
46984866 void ImportVRMLX3D()
46994867 {
4700
- if (GraphreeD.standAlone)
4868
+ if (GrafreeD.standAlone)
47014869 {
47024870 /**/
47034871 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4714,7 +4882,7 @@
47144882
47154883 String GetFile(String dialogName)
47164884 {
4717
- if (GraphreeD.standAlone)
4885
+ if (GrafreeD.standAlone)
47184886 {
47194887 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47204888 browser.show();
....@@ -4823,6 +4991,7 @@
48234991 private MenuItem resetsupportItem;
48244992 private MenuItem resetreferencesItem;
48254993 private MenuItem linkverticesItem;
4994
+ private MenuItem relinkverticesItem;
48264995 private MenuItem setMasterItem;
48274996 private MenuItem resetMeshItem;
48284997 private MenuItem stepAllItem;
....@@ -4841,8 +5010,10 @@
48415010 private MenuItem clearItem;
48425011 private MenuItem clearAllItem;
48435012 private MenuItem genUVItem;
5013
+ private MenuItem genNormalsMESHItem;
48445014 private MenuItem genNormalsCADItem;
48455015 private MenuItem genNormalsORGANItem;
5016
+ private MenuItem genNormalsMINEItem;
48465017 private MenuItem stripifyItem;
48475018 private MenuItem unstripifyItem;
48485019 private MenuItem trimItem;
....@@ -4884,6 +5055,7 @@
48845055 private MenuItem resetCentroidItem;
48855056 private MenuItem transformgeometryItem;
48865057 private MenuItem resetTransformItem;
5058
+ private MenuItem hideItem;
48875059 private MenuItem grabItem;
48885060 private MenuItem backItem;
48895061 private MenuItem frontItem;
....@@ -4904,6 +5076,7 @@
49045076
49055077 private MenuItem resetParentItem;
49065078 private MenuItem repairParentItem;
5079
+ private MenuItem repairShadowItem;
49075080 private MenuItem sortbysizeItem;
49085081 private MenuItem sortbynameItem;
49095082
....@@ -4924,6 +5097,7 @@
49245097 private MenuItem coneItem;
49255098 private MenuItem torusItem;
49265099 private MenuItem superItem;
5100
+ private MenuItem kleinItem;
49275101 private MenuItem blobItem;
49285102 private MenuItem latheItem;
49295103 private MenuItem bezierItem;
....@@ -4936,6 +5110,7 @@
49365110 private MenuItem csgItem;
49375111 private MenuItem templateItem;
49385112 private MenuItem textureItem;
5113
+ private MenuItem billboardItem;
49395114 private MenuItem shadowXItem;
49405115 private MenuItem shadowYItem;
49415116 private MenuItem shadowZItem;