Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
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,18 +220,24 @@
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("-");
235242 randomItem = menu.add(new MenuItem("Random"));
236243 randomItem.addActionListener(this);
....@@ -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,84 +434,26 @@
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);
451
- 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);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444
+ trackCB.setToolTipText("Enable tracking");
493445 trackCB.addItemListener(this);
494446
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
448
+ screenfitButton.setToolTipText("Screen fit");
497449 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
450
+
499451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500452 // screenfitpointButton.addActionListener(this);
501453 // oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503455 snapobjectButton.addActionListener(this);
456
+ snapobjectButton.setToolTipText("Snap Object");
504457 oe.aConstraints.gridx += 1;
505458
506459 //aConstraints.gridx = 0;
....@@ -508,65 +461,66 @@
508461 oe.aConstraints.weighty = 0;
509462 oe.aConstraints.gridwidth = 1;
510463
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
+ flashSelectionButton.setToolTipText("Show selection");
512466 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516467
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
+
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
+ twoButton.setToolTipText("Show center view only");
519472 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521474 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
475
+ fourButton.setToolTipText("Show left panel only");
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
477
+ sixButton.setToolTipText("2-column layout left");
523478 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
480
+ threeButton.setToolTipText("2-column layout right");
525481 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483
+ sevenButton.setToolTipText("3-column layout");
527484 sevenButton.addActionListener(this);
528485 //
529486
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
487
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
+ rootButton.setToolTipText("Edit selection in new tab");
531489 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
490
+
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ closeButton.setToolTipText("Close tab");
534493 closeButton.addActionListener(this);
535494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536495 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538496
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
497
+ cGridBag commandsPanel = new cGridBag();
498
+
499
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
500
+ editButton.setToolTipText("Edit selection");
541501 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545502
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
547505 uneditButton.addActionListener(this);
548506
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);
507
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ clearPanelButton.setToolTipText("Clear edit panel");
554509 clearPanelButton.addActionListener(this);
555510
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);
511
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ allParamsButton.setToolTipText("All params??");
561513 allParamsButton.addActionListener(this);
562514
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);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
568517 unselectButton.addActionListener(this);
569518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
570524 // oe.aConstraints.gridx += 1;
571525 // oe.aConstraints.weighty = 0;
572526 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +532,37 @@
578532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579533 // gcButton.addActionListener(this);
580534
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;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
592538 //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);
539
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594540 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
599544
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);
545
+ cGridBag copyOptionsPanel = new cGridBag();
546
+
547
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
+ colorCB.setToolTipText("Copy color when dropped");
604549 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
550
+
551
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
+ materialCB.setToolTipText("Copy material when dropped");
607553 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
+ textureCB.setToolTipText("Copy texture when dropped");
610557 textureCB.addItemListener(this);
611558
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
614562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
615566 //jList.addListSelectionListener(this);
616567 oe.jTree.addTreeSelectionListener(this);
617568 //jTree.setRootVisible(false);
....@@ -633,17 +584,97 @@
633584 radio.layout = sevenButton;
634585 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635586 }
587
+
588
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589
+ {
590
+ //constraints.gridx = 0;
591
+ //constraints.gridy = 0;
592
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
+ fastCB.setToolTipText("Fast mode");
594
+ fastCB.addItemListener(this);
595
+ //constraints.gridy += 1;
596
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597
+ supportCB.setToolTipText("Enabled rigging");
598
+ supportCB.addItemListener(this);
599
+
600
+ // constraints.gridy += 1;
601
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602
+ // localCB.addItemListener(this);
603
+
604
+ //constraints.gridy += 1;
605
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606
+ crowdCB.setToolTipText("Used for crowds");
607
+ crowdCB.addItemListener(this);
608
+
609
+ //constraints.gridy += 1;
610
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611
+ smoothCB.setToolTipText("Snapping delay");
612
+ smoothCB.addItemListener(this);
613
+
614
+ //constraints.gridy += 1;
615
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616
+ slowCB.setToolTipText("Smooth interpolation");
617
+ slowCB.addItemListener(this);
618
+ //constraints.gridy += 1;
619
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620
+ boxCB.setToolTipText("Display bounding boxes");
621
+ boxCB.addItemListener(this);
622
+ //constraints.gridy += 1;
623
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625
+ zoomBoxCB.addItemListener(this);
626
+
627
+// constraints.gridy += 1;
628
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629
+// speakerMocapCB.addItemListener(this);
630
+
631
+ if (false)
632
+ {
633
+ // handled in scripts
634
+ //constraints.gridy += 1;
635
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
636
+ speakerCameraCB.addItemListener(this);
637
+
638
+ //constraints.gridy += 1;
639
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
640
+ speakerFocusCB.addItemListener(this);
641
+
642
+ //constraints.gridy += 1;
643
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
644
+ smoothfocusCB.addItemListener(this);
645
+ }
646
+
647
+//constraints.gridx += 1;
648
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649
+// debugCB.addItemListener(this);
650
+
651
+ //constraints.gridy += 1;
652
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653
+ oeilCB.addItemListener(this);
654
+
655
+ //constraints.gridy += 1;
656
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657
+ lookAtCB.setToolTipText("Look-at target");
658
+ lookAtCB.addItemListener(this);
659
+
660
+ cGridBag fill = new cGridBag();
661
+
662
+ fill.preferredHeight = 200;
663
+
664
+ panel.add(fill);
665
+
666
+ }
636667
637668 void EditObject(Object3D obj)
638669 {
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();
670
+ cRadio radioButton = new cRadio(obj.name);
671
+ radioButton.SetObject(obj);
672
+ radioButton.layout = sevenButton;
673
+ radioButton.SetCamera(cameraView.renderCamera, false);
674
+ radioButton.addActionListener(this);
675
+ radioPanel.add(radioButton);
676
+ buttonGroup.add(radioButton);
677
+ radioButton.doClick();
647678 }
648679 void SetupViews(ObjEditor oe)
649680 {
....@@ -663,6 +694,7 @@
663694 JCheckBox fastCB;
664695 JCheckBox slowCB;
665696 JCheckBox boxCB;
697
+ JCheckBox zoomBoxCB;
666698 JCheckBox trackCB;
667699 JCheckBox smoothfocusCB;
668700 // JCheckBox speakerMocapCB;
....@@ -705,8 +737,7 @@
705737 dropAttributes |= Object3D.TEXTURE;
706738 else
707739 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
740
+ } else if(e.getSource() == liveCB)
710741 {
711742 cameraView.ToggleLive();
712743 }
....@@ -743,6 +774,10 @@
743774 Recompile();
744775 cameraView.repaint();
745776 // refreshContents();
777
+ }
778
+ else if(e.getSource() == zoomBoxCB)
779
+ {
780
+ cameraView.ToggleZoomBoxMode();
746781 }
747782 else if(e.getSource() == smoothfocusCB)
748783 {
....@@ -1033,6 +1068,8 @@
10331068 torusItem.addActionListener(this);
10341069 superItem = menu.add(new MenuItem("Superellipsoid"));
10351070 superItem.addActionListener(this);
1071
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1072
+ kleinItem.addActionListener(this);
10361073 particleItem = menu.add(new MenuItem("Particle system"));
10371074 particleItem.addActionListener(this);
10381075 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1106,6 +1143,8 @@
11061143 resetParentItem.addActionListener(this);
11071144 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081145 repairParentItem.addActionListener(this);
1146
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1147
+ repairShadowItem.addActionListener(this);
11091148 menu.add(invariantsItem = new MenuItem("Invariants"));
11101149 invariantsItem.addActionListener(this);
11111150 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1441,9 +1480,9 @@
14411480
14421481 void Overwrite(int mask)
14431482 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1483
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14451484 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1485
+ Object3D content = GrafreeD.clipboard.get(0);
14471486
14481487 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491488 content = ((cGroup)content).get(0);
....@@ -1466,6 +1505,7 @@
14661505 //
14671506 public void actionPerformed(ActionEvent event) // , Object arg)
14681507 {
1508
+ Object source = event.getSource();
14691509 /*
14701510 if (event.getSource() == nameField)
14711511 {
....@@ -1477,11 +1517,11 @@
14771517 }
14781518 else
14791519 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1520
+ if (source == lookAtItem || source == lookFromItem)
14811521 {
14821522 ScreenFit();
14831523 } else
1484
- if (event.getSource() == switchItem)
1524
+ if (source == switchItem)
14851525 {
14861526 cVector v1 = new cVector();
14871527 cVector v2 = new cVector();
....@@ -1490,11 +1530,11 @@
14901530 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911531 objEditor.cameraView.repaint();
14921532 } else
1493
- if (event.getSource() == rectoidItem)
1533
+ if (source == rectoidItem)
14941534 {
14951535 makeSomething(new Box());
14961536 } else
1497
- if (event.getSource() == particleItem)
1537
+ if (source == particleItem)
14981538 {
14991539 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001540 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1555,9 @@
15151555 applyExample(particleGeom, "SMOKE");
15161556 makeSomething(particleGeom);
15171557 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1558
+ if (source == ragdollItem || source == ragdoll2Item)
15191559 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1560
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211561
15221562 ragdoll.toParent = LA.newMatrix();
15231563 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1575,7 @@
15351575 } else
15361576 /*
15371577 */
1538
- if (event.getSource() == heightFieldItem)
1578
+ if (source == heightFieldItem)
15391579 {
15401580 Object3D obj = new Object3D();
15411581
....@@ -1573,27 +1613,31 @@
15731613
15741614 makeSomething(obj);
15751615 } else
1576
- if (event.getSource() == gridItem)
1616
+ if (source == gridItem)
15771617 {
15781618 makeSomething(new Grid());
15791619 } else
1580
- if (event.getSource() == ellipsoidItem)
1620
+ if (source == ellipsoidItem)
15811621 {
15821622 makeSomething(new Sphere());
15831623 } else
1584
- if (event.getSource() == coneItem)
1624
+ if (source == coneItem)
15851625 {
15861626 makeSomething(new Cone());
15871627 } else
1588
- if (event.getSource() == torusItem)
1628
+ if (source == torusItem)
15891629 {
15901630 makeSomething(new Torus());
15911631 } else
1592
- if (event.getSource() == superItem)
1632
+ if (source == superItem)
15931633 {
15941634 makeSomething(new Superellipsoid());
15951635 } else
1596
- if (event.getSource() == blobItem)
1636
+ if (source == kleinItem)
1637
+ {
1638
+ makeSomething(new Klein());
1639
+ } else
1640
+ if (source == blobItem)
15971641 {
15981642 Blob blob = new Blob();
15991643 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1645,15 @@
16011645 //blob.retile();
16021646 makeSomething(blob);
16031647 } else
1604
- if (event.getSource() == latheItem)
1648
+ if (source == latheItem)
16051649 {
16061650 makeSomething(new Lathe());
16071651 } else
1608
- if (event.getSource() == bezierItem)
1652
+ if (source == bezierItem)
16091653 {
16101654 makeSomething(new BezierSurface());
16111655 } else
1612
- if (event.getSource() == checkerItem)
1656
+ if (source == checkerItem)
16131657 {
16141658 /*
16151659 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1668,7 @@
16241668 */
16251669 makeSomething(new Checker());
16261670 } else
1627
- if (event.getSource() == meshItem)
1671
+ if (source == meshItem)
16281672 {
16291673 Object3D itemtomake = new Object3D();
16301674 Object3D child;
....@@ -1645,35 +1689,35 @@
16451689 makeSomething(child);
16461690 }
16471691 } else
1648
- if (event.getSource() == springItem)
1692
+ if (source == springItem)
16491693 {
16501694 cSpring s = new cSpring();
16511695 s.setup();
16521696 makeSomething(s);
16531697 } else
1654
- if (event.getSource() == flagItem)
1698
+ if (source == flagItem)
16551699 {
16561700 cSpring s = new cFlag();
16571701 s.setup();
16581702 makeSomething(s);
16591703 } else
1660
- if (event.getSource() == lightItem)
1704
+ if (source == lightItem)
16611705 {
16621706 makeSomething(new Light());
16631707 } else
1664
- if (event.getSource() == csgItem)
1708
+ if (source == csgItem)
16651709 {
16661710 group(new CSG());
16671711 } else
1668
- if (event.getSource() == templateItem)
1712
+ if (source == templateItem)
16691713 {
16701714 group(new cTemplate());
16711715 } else
1672
- if (event.getSource() == attributeItem)
1716
+ if (source == attributeItem)
16731717 {
16741718 makeSomething(new Attribute());
16751719 } else
1676
- if (event.getSource() == pointflowItem)
1720
+ if (source == pointflowItem)
16771721 {
16781722 makeSomething(new PointFlow());
16791723 } else
....@@ -1685,7 +1729,7 @@
16851729 } else
16861730 */
16871731
1688
- if (event.getSource() == superLoopItem)
1732
+ if (source == superLoopItem)
16891733 {
16901734 Composite g = new cGroup();
16911735 for (int i=0; i<15; i++)
....@@ -1707,7 +1751,7 @@
17071751
17081752 group(g);
17091753 } else
1710
- if (event.getSource() == loopItem)
1754
+ if (source == loopItem)
17111755 {
17121756 Composite csg = new GroupLeaf();
17131757 csg.count = 5;
....@@ -1716,7 +1760,7 @@
17161760 csg.addChild(child);
17171761 child.addChild(csg);
17181762 } else
1719
- if (event.getSource() == doubleItem)
1763
+ if (source == doubleItem)
17201764 {
17211765 Composite csg = new GroupLeaf();
17221766 csg.count = 5;
....@@ -1728,7 +1772,7 @@
17281772 csg.addChild(child);
17291773 child.addChild(csg);
17301774 } else
1731
- if (event.getSource() == tripleItem)
1775
+ if (source == tripleItem)
17321776 {
17331777 Composite csg = new GroupLeaf();
17341778 csg.count = 4;
....@@ -1744,70 +1788,70 @@
17441788 child.addChild(csg);
17451789 } else
17461790
1747
- if (event.getSource() == importGFDItem)
1791
+ if (source == importGFDItem)
17481792 {
17491793 ImportGFD();
17501794 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1795
+ if (source == importVRMLX3DItem)
17521796 {
17531797 ImportVRMLX3D();
17541798 } else
1755
- if (event.getSource() == import3DSItem)
1799
+ if (source == import3DSItem)
17561800 {
17571801 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581802 } else
1759
- if (event.getSource() == importOBJItem)
1803
+ if (source == importOBJItem)
17601804 {
17611805 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621806 } else
1763
- if (event.getSource() == computeAOItem)
1807
+ if (source == computeAOItem)
17641808 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1809
+ Globals.drawMode = CameraPane.OCCLUSION;
1810
+ Globals.theRenderer.repaint();
17671811 } else
1768
- if (event.getSource() == recompileItem)
1812
+ if (source == recompileItem)
17691813 {
17701814 Recompile();
17711815 refreshContents();
17721816 } else
1773
- if (event.getSource() == editScriptItem)
1817
+ if (source == editScriptItem)
17741818 {
17751819 OpenDialog();
17761820 refreshContents();
17771821 } else
1778
- if (event.getSource() == invariantsItem)
1822
+ if (source == invariantsItem)
17791823 {
17801824 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1825
+ GrafreeD.grafreeD.universe.invariants();
17821826 } else
1783
- if (event.getSource() == memoryItem)
1827
+ if (source == memoryItem)
17841828 {
17851829 //System.out.println("Invariants:");
17861830 PrintMemory();
17871831 } else
1788
- if (event.getSource() == pathItem)
1832
+ if (source == pathItem)
17891833 {
17901834 PrintPath();
17911835 } else
1792
- if (event.getSource() == analyzeItem)
1836
+ if (source == analyzeItem)
17931837 {
17941838 AnalyzeObject();
17951839 } else
1796
- if (event.getSource() == dumpItem)
1840
+ if (source == dumpItem)
17971841 {
17981842 DumpObject();
17991843 } else
1800
- if (event.getSource() == screenfitButton)
1844
+ if (source == screenfitButton)
18011845 {
18021846 //Reload(lastConverter, lastFilename, true);
18031847 ScreenFit();
18041848 } else
1805
- if (event.getSource() == screenfitpointButton)
1849
+ if (source == screenfitpointButton)
18061850 {
18071851 //Reload(lastConverter, lastFilename, true);
18081852 ScreenFitPoint();
18091853 } else
1810
- if (event.getSource() == snapobjectButton)
1854
+ if (source == snapobjectButton)
18111855 {
18121856 //Reload(lastConverter, lastFilename, true);
18131857 SnapObject();
....@@ -1818,13 +1862,13 @@
18181862 // Recompile();
18191863 // refreshContents();
18201864 // } else
1821
- if (event.getSource() == gcButton)
1865
+ if (source == gcButton)
18221866 {
18231867 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241868 System.gc();
18251869 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261870 } else
1827
- if (event.getSource() == editLeafItem)
1871
+ if (source == editLeafItem)
18281872 {
18291873 Object3D obj;
18301874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +1882,66 @@
18381882 }
18391883 refreshContents(true);
18401884 } else
1841
- if (event.getSource() == openWindowItem)
1885
+ if (source == openWindowItem)
18421886 {
18431887 EditSelection(true);
18441888 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1889
+ if (source == cutItem || source == clearButton)
18461890 {
18471891 loadClipboard(true);
18481892 } else
1849
- if (event.getSource() == duplicateItem)
1893
+ if (source == duplicateItem)
18501894 {
1851
- Object3D keep = GraphreeD.clipboard;
1895
+ Object3D keep = GrafreeD.clipboard;
18521896 loadClipboard(false);
18531897 paste(false);
1854
- GraphreeD.clipboard = keep;
1898
+ GrafreeD.clipboard = keep;
18551899 } else
1856
- if (event.getSource() == cloneItem)
1900
+ if (source == cloneItem)
18571901 {
18581902 CloneSelection(false);
18591903 } else
1860
- if (event.getSource() == cloneSupportItem)
1904
+ if (source == cloneSupportItem)
18611905 {
18621906 CloneSelection(true);
18631907 } else
1864
- if (event.getSource() == copyItem)
1908
+ if (source == copyItem)
18651909 {
18661910 loadClipboard(false);
18671911 } else
1868
- if (event.getSource() == pasteItem)
1912
+ if (source == pasteItem)
18691913 {
18701914 paste(false);
18711915 } else
1872
- if (event.getSource() == pasteLinkItem)
1916
+ if (source == pasteLinkItem)
18731917 {
18741918 pasteInto(false);
18751919 } else
1876
- if (event.getSource() == pasteCloneItem)
1920
+ if (source == pasteCloneItem)
18771921 {
18781922 pasteInto(true);
18791923 } else
1880
- if (event.getSource() == pasteExpandItem)
1924
+ if (source == pasteExpandItem)
18811925 {
18821926 paste(true);
18831927 } else
1884
- if (event.getSource() == synchronizeItem)
1928
+ if (source == synchronizeItem)
18851929 {
18861930 Overwrite(Object3D.TRANSFORM);
18871931 } else
1888
- if (event.getSource() == overwriteNameItem)
1932
+ if (source == overwriteNameItem)
18891933 {
18901934 Overwrite(Object3D.NAME);
18911935 } else
1892
- if (event.getSource() == overwriteUVItem)
1936
+ if (source == overwriteUVItem)
18931937 {
18941938 Overwrite(Object3D.UV);
18951939 } else
1896
- if (event.getSource() == overwriteMatItem)
1940
+ if (source == overwriteMatItem)
18971941 {
1942
+ /* july 2015
18981943 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
1944
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19001945 else
19011946 {
19021947 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +1953,16 @@
19081953 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19091954 }
19101955 }
1956
+ */
1957
+
1958
+ Overwrite(dropAttributes);
19111959 }
1912
- if (event.getSource() == overwriteGeoItem)
1960
+ if (source == overwriteGeoItem)
19131961 {
19141962 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1963
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19161964 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
1965
+// Object3D content = GrafreeD.clipboard.get(0);
19181966 //
19191967 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19201968 // content = ((cGroup)content).get(0);
....@@ -1926,7 +1974,7 @@
19261974 // refreshContents();
19271975 // }
19281976 } else
1929
- if (event.getSource() == generateMeshItem)
1977
+ if (source == generateMeshItem)
19301978 {
19311979 //if (group.selection.size() == 1)
19321980 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +1985,7 @@
19371985 ResetModel();
19381986 refreshContents();
19391987 } else
1940
- if (event.getSource() == extractGeometriesItem)
1988
+ if (source == extractGeometriesItem)
19411989 {
19421990 boolean one = false;
19431991
....@@ -1964,7 +2012,7 @@
19642012 ResetModel();
19652013 refreshContents();
19662014 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2015
+ if (source == cloneGeometriesItem)
19682016 {
19692017 boolean one = false;
19702018
....@@ -1990,32 +2038,37 @@
19902038 ResetModel();
19912039 refreshContents();
19922040 } else
1993
- if (event.getSource() == shareGeometriesItem)
2041
+ if (source == shareGeometriesItem)
19942042 {
19952043 boolean one = false;
19962044
19972045 if (group.selection.size() == 1)
19982046 one = true;
19992047
2048
+ Object3D merge = null;
2049
+
20002050 Object3D content = new cGroup();
20012051
20022052 for (int i=0; i<group.selection.size(); i++)
20032053 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2054
+ merge = new Merge(group.selection.get(i));
20052055
20062056 if (one)
2007
- makeSomething(sel, false);
2057
+ makeSomething(merge, false);
20082058 else
2009
- content.addChild(sel);
2059
+ content.addChild(merge);
20102060 }
20112061
20122062 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2063
+ makeSomething(content, true);
2064
+ else
2065
+ {
2066
+ ResetModel();
2067
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2068
+ refreshContents();
2069
+ }
20172070 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2071
+ if (source == mergeGeometriesItem)
20192072 {
20202073 boolean one = false;
20212074
....@@ -2045,11 +2098,11 @@
20452098 ResetModel();
20462099 refreshContents();
20472100 } else
2048
- if (event.getSource() == linkverticesItem)
2101
+ if (source == linkverticesItem)
20492102 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2103
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512104 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2105
+// Object3D content = GrafreeD.clipboard.get(0);
20532106 //
20542107 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552108 // content = ((cGroup)content).get(0);
....@@ -2058,14 +2111,14 @@
20582111 // group.selection.get(0).setMasterThis(content); // should be identity
20592112 // refreshContents();
20602113 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2114
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20622115 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2116
+ Object3D content = GrafreeD.clipboard.get(0);
20642117
20652118 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662119 content = ((cGroup)content).get(0);
20672120
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2121
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692122 for (int i=0; i<group.selection.size(); i++)
20702123 {
20712124 boolean random = CameraPane.RANDOM;
....@@ -2074,11 +2127,11 @@
20742127 // group.selection.get(i).setMasterThis(content); // should be identity
20752128 CameraPane.RANDOM = random;
20762129 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2130
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782131 refreshContents();
20792132 }
20802133 } else
2081
- if (event.getSource() == resetsupportItem)
2134
+ if (source == resetsupportItem)
20822135 {
20832136 for (int i=0; i<group.selection.size(); i++)
20842137 {
....@@ -2090,7 +2143,16 @@
20902143
20912144 refreshContents();
20922145 } else
2093
- if (event.getSource() == resetreferencesItem)
2146
+ if (source == relinkverticesItem)
2147
+ {
2148
+ boolean random = CameraPane.RANDOM;
2149
+ CameraPane.RANDOM = false; // parse all random nodes
2150
+ group.selection.RelinkToSupport();
2151
+ CameraPane.RANDOM = random;
2152
+
2153
+ refreshContents();
2154
+ } else
2155
+ if (source == resetreferencesItem)
20942156 {
20952157 for (int i=0; i<group.selection.size(); i++)
20962158 {
....@@ -2099,11 +2161,11 @@
20992161
21002162 refreshContents();
21012163 } else
2102
- if (event.getSource() == setMasterItem)
2164
+ if (source == setMasterItem)
21032165 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2166
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21052167 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2168
+ Object3D content = GrafreeD.clipboard.get(0);
21072169
21082170 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092171 content = ((cGroup)content).get(0);
....@@ -2112,13 +2174,13 @@
21122174 refreshContents();
21132175 }
21142176 } else
2115
- if (event.getSource() == poseMeshItem)
2177
+ if (source == poseMeshItem)
21162178 {
21172179 if (group.selection.size() == 1)
21182180 {
2119
- if (GraphreeD.clipboard.size() == 1)
2181
+ if (GrafreeD.clipboard.size() == 1)
21202182 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2183
+ Object3D content = GrafreeD.clipboard.get(0);
21222184
21232185 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242186 content = ((cGroup)content).get(0);
....@@ -2131,19 +2193,19 @@
21312193 }
21322194
21332195 } else
2134
- if (event.getSource() == revertMeshItem)
2196
+ if (source == revertMeshItem)
21352197 {
21362198 RevertMeshes();
21372199 } else
2138
- if (event.getSource() == resetMeshItem)
2200
+ if (source == resetMeshItem)
21392201 {
21402202 ResetAll();
21412203 } else
2142
- if (event.getSource() == stepAllItem)
2204
+ if (source == stepAllItem)
21432205 {
21442206 StepAll();
21452207 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2208
+ if (source == clearItem) // || event.getSource() == clearButton)
21472209 {
21482210 //int indices[] = jList.getSelectedIndices();
21492211 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2213,46 @@
21512213
21522214 ClearSelection(false);
21532215 } else
2154
- if (event.getSource() == clearAllItem)
2216
+ if (source == clearAllItem)
21552217 {
21562218 ClearSelection(true);
21572219 } else
2158
- if (event.getSource() == grabItem)
2220
+ if (source == grabItem)
21592221 {
21602222 group(new cGroup(), true);
21612223 } else
2162
- if (event.getSource() == frontItem)
2224
+ if (source == hideItem)
2225
+ {
2226
+ group(new HiddenObject());
2227
+ } else
2228
+ if (source == frontItem)
21632229 {
21642230 front();
21652231 } else
2166
- if (event.getSource() == backItem)
2232
+ if (source == backItem)
21672233 {
21682234 back();
21692235 } else
2170
- if (event.getSource() == cameraItem)
2236
+ if (source == cameraItem)
21712237 {
21722238 makeSomething(new Camera());
21732239 } else
2174
- if (event.getSource() == compositeItem)
2240
+ if (source == compositeItem)
21752241 {
21762242 group(new Composite());
21772243 } else
2178
- if (event.getSource() == randomItem)
2244
+ if (source == randomItem)
21792245 {
21802246 RandomNode random = new RandomNode();
21812247 group(random);
21822248 if (random.size() > 0)
21832249 random.name = random.get(0).name + "Rnd";
21842250 } else
2185
- if (event.getSource() == physicsItem)
2251
+ if (source == physicsItem)
21862252 {
21872253 group(new PhysicsNode());
21882254 } else
2189
- if (event.getSource() == frameselectorItem)
2255
+ if (source == frameselectorItem)
21902256 {
21912257 for (int i=0; i<group.selection.size(); i++)
21922258 {
....@@ -2198,7 +2264,7 @@
21982264 ResetModel();
21992265 refreshContents();
22002266 } else
2201
- if (event.getSource() == switchGeoItem)
2267
+ if (source == switchGeoItem)
22022268 {
22032269 for (int i=0; i<group.selection.size(); i++)
22042270 {
....@@ -2210,7 +2276,7 @@
22102276 ResetModel();
22112277 refreshContents();
22122278 } else
2213
- if (event.getSource() == switchTransfoItem)
2279
+ if (source == switchTransfoItem)
22142280 {
22152281 for (int i=0; i<group.selection.size(); i++)
22162282 {
....@@ -2222,7 +2288,7 @@
22222288 ResetModel();
22232289 refreshContents();
22242290 } else
2225
- if (event.getSource() == morphItem)
2291
+ if (source == morphItem)
22262292 {
22272293 for (int i=0; i<group.selection.size(); i++)
22282294 {
....@@ -2234,7 +2300,7 @@
22342300 ResetModel();
22352301 refreshContents();
22362302 } else
2237
- if (event.getSource() == scriptNodeItem)
2303
+ if (source == scriptNodeItem)
22382304 {
22392305 boolean atleastone = false;
22402306
....@@ -2273,195 +2339,215 @@
22732339 }
22742340 }
22752341 } else
2276
- if (event.getSource() == linkerItem)
2342
+ if (source == linkerItem)
22772343 {
22782344 group(new cLinker());
22792345 } else
2280
- if (event.getSource() == textureItem)
2346
+ if (source == textureItem)
22812347 {
22822348 group(new TextureNode());
22832349 } else
2284
- if (event.getSource() == shadowXItem)
2350
+ if (source == billboardItem)
2351
+ {
2352
+ group(new BillboardNode());
2353
+ } else
2354
+ if (source == shadowXItem)
22852355 {
22862356 CastShadow(0);
22872357 } else
2288
- if (event.getSource() == shadowYItem)
2358
+ if (source == shadowYItem)
22892359 {
22902360 CastShadow(1);
22912361 } else
2292
- if (event.getSource() == shadowZItem)
2362
+ if (source == shadowZItem)
22932363 {
22942364 CastShadow(2);
22952365 } else
2296
- if (event.getSource() == ungroupItem)
2366
+ if (source == ungroupItem)
22972367 {
2298
- ungroup();
2368
+ //ungroup();
2369
+ for (int i=0; i<group.selection.size(); i++)
2370
+ {
2371
+ Ungroup(group.selection.get(i));
2372
+ }
2373
+
2374
+ ClearSelection(false);
2375
+
2376
+ refreshContents();
22992377 } else
2300
- if (event.getSource() == genUVItem)
2378
+ if (source == genUVItem)
23012379 {
23022380 GenUV();
23032381 } else
2304
- if (event.getSource() == genNormalsCADItem)
2382
+ if (source == genNormalsCADItem)
23052383 {
23062384 GenNormals(true);
23072385 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2386
+ if (source == genNormalsMESHItem)
2387
+ {
2388
+ GenNormals(true); // TODO
2389
+ } else
2390
+ if (source == genNormalsORGANItem)
23092391 {
23102392 GenNormals(false);
23112393 } else
2312
- if (event.getSource() == stripifyItem)
2394
+ if (source == genNormalsMINEItem)
2395
+ {
2396
+ GenNormalsMINE();
2397
+ } else
2398
+ if (source == stripifyItem)
23132399 {
23142400 Stripify();
23152401 } else
2316
- if (event.getSource() == unstripifyItem)
2402
+ if (source == unstripifyItem)
23172403 {
23182404 Unstripify();
23192405 } else
2320
- if (event.getSource() == trimItem)
2406
+ if (source == trimItem)
23212407 {
23222408 Trim();
23232409 } else
2324
- if (event.getSource() == untrimItem)
2410
+ if (source == untrimItem)
23252411 {
23262412 Untrim();
23272413 } else
2328
- if (event.getSource() == clearColorsItem)
2414
+ if (source == clearColorsItem)
23292415 {
23302416 ClearColors();
23312417 } else
2332
- if (event.getSource() == clearMaterialsItem)
2418
+ if (source == clearMaterialsItem)
23332419 {
23342420 ClearMaterials();
23352421 } else
2336
- if (event.getSource() == liveleavesItem)
2422
+ if (source == liveleavesItem)
23372423 {
23382424 LiveLeaves(true);
23392425 } else
2340
- if (event.getSource() == unliveleavesItem)
2426
+ if (source == unliveleavesItem)
23412427 {
23422428 LiveLeaves(false);
23432429 } else
2344
- if (event.getSource() == supportleavesItem)
2430
+ if (source == supportleavesItem)
23452431 {
23462432 SupportLeaves(true);
23472433 } else
2348
- if (event.getSource() == unsupportleavesItem)
2434
+ if (source == unsupportleavesItem)
23492435 {
23502436 SupportLeaves(false);
23512437 } else
2352
- if (event.getSource() == hideleavesItem)
2438
+ if (source == hideleavesItem)
23532439 {
23542440 HideLeaves(true);
23552441 } else
2356
- if (event.getSource() == showleavesItem)
2442
+ if (source == showleavesItem)
23572443 {
23582444 HideLeaves(false);
23592445 } else
2360
- if (event.getSource() == markleavesItem)
2446
+ if (source == markleavesItem)
23612447 {
23622448 MarkLeaves(true);
23632449 } else
2364
- if (event.getSource() == unmarkleavesItem)
2450
+ if (source == unmarkleavesItem)
23652451 {
23662452 MarkLeaves(false);
23672453 } else
2368
- if (event.getSource() == flipVItem)
2454
+ if (source == flipVItem)
23692455 {
23702456 FlipV(true);
23712457 } else
2372
- if (event.getSource() == unflipVItem)
2458
+ if (source == unflipVItem)
23732459 {
23742460 FlipV(false);
23752461 } else
2376
- if (event.getSource() == lowTexturesItem)
2462
+ if (source == lowTexturesItem)
23772463 {
23782464 SetTexRes(0);
23792465 } else
2380
- if (event.getSource() == normalTexturesItem)
2466
+ if (source == normalTexturesItem)
23812467 {
23822468 SetTexRes(1);
23832469 } else
2384
- if (event.getSource() == highTexturesItem)
2470
+ if (source == highTexturesItem)
23852471 {
23862472 SetTexRes(2);
23872473 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2474
+ if (source == veryhighTexturesItem)
23892475 {
23902476 SetTexRes(3);
23912477 } else
2392
- if (event.getSource() == maxTexturesItem)
2478
+ if (source == maxTexturesItem)
23932479 {
23942480 SetTexRes(4);
23952481 } else
2396
- if (event.getSource() == panoTexturesItem)
2482
+ if (source == panoTexturesItem)
23972483 {
23982484 SetTexRes(5);
23992485 } else
2400
- if (event.getSource() == reverseNormalsItem)
2486
+ if (source == reverseNormalsItem)
24012487 {
24022488 ReverseNormals();
24032489 } else
2404
- if (event.getSource() == parseverticesItem)
2490
+ if (source == parseverticesItem)
24052491 {
24062492 ParseVertices();
24072493 } else
2408
- if (event.getSource() == textureFieldItem)
2494
+ if (source == textureFieldItem)
24092495 {
24102496 TextureVertices();
24112497 } else
2412
- if (event.getSource() == alignItem)
2498
+ if (source == alignItem)
24132499 {
24142500 Align();
24152501 } else
2416
- if (event.getSource() == mirrorItem)
2502
+ if (source == mirrorItem)
24172503 {
24182504 MirrorPoses();
24192505 } else
2420
- if (event.getSource() == reduceMorphItem)
2506
+ if (source == reduceMorphItem)
24212507 {
24222508 MeshReduction(false);
24232509 } else
2424
- if (event.getSource() == reduce34MorphItem)
2510
+ if (source == reduce34MorphItem)
24252511 {
24262512 MeshReduction(true);
24272513 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2514
+ if (source == reverseTrianglesItem)
24292515 {
24302516 ReverseTriangles();
24312517 } else
2432
- if (event.getSource() == reduceMeshItem)
2518
+ if (source == reduceMeshItem)
24332519 {
24342520 ReduceMesh(false);
24352521 } else
2436
- if (event.getSource() == reduce34MeshItem)
2522
+ if (source == reduce34MeshItem)
24372523 {
24382524 ReduceMesh(true);
24392525 } else
2440
- if (event.getSource() == increaseMeshItem)
2526
+ if (source == increaseMeshItem)
24412527 {
24422528 IncreaseMesh();
24432529 } else
2444
- if (event.getSource() == clipMeshItem)
2530
+ if (source == clipMeshItem)
24452531 {
24462532 ClipMesh();
24472533 } else
2448
- if (event.getSource() == smoothMeshItem)
2534
+ if (source == smoothMeshItem)
24492535 {
24502536 SmoothMesh();
24512537 } else
2452
- if (event.getSource() == transformgeometryItem)
2538
+ if (source == transformgeometryItem)
24532539 {
24542540 TransformGeometry();
24552541 } else
2456
- if (event.getSource() == resetTransformItem)
2542
+ if (source == resetTransformItem)
24572543 {
24582544 ResetTransform();
24592545 } else
2460
- if (event.getSource() == resetCentroidItem)
2546
+ if (source == resetCentroidItem)
24612547 {
24622548 ResetCentroid();
24632549 } else
2464
- if (event.getSource() == resetParentItem)
2550
+ if (source == resetParentItem)
24652551 {
24662552 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672553 {
....@@ -2471,7 +2557,7 @@
24712557
24722558 refreshContents();
24732559 } else
2474
- if (event.getSource() == repairParentItem)
2560
+ if (source == repairParentItem)
24752561 {
24762562 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772563 {
....@@ -2485,7 +2571,21 @@
24852571
24862572 refreshContents();
24872573 } else
2488
- if (event.getSource() == sortbysizeItem)
2574
+ if (source == repairShadowItem)
2575
+ {
2576
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2577
+ {
2578
+ Object3D obj = (Object3D)e.nextElement();
2579
+ obj.RepairShadow();
2580
+// for (int i=0; i<obj.size(); i++)
2581
+// {
2582
+// obj.get(i).parent = obj;
2583
+// }
2584
+ }
2585
+
2586
+ refreshContents();
2587
+ } else
2588
+ if (source == sortbysizeItem)
24892589 {
24902590 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912591 {
....@@ -2497,7 +2597,7 @@
24972597 ResetModel();
24982598 refreshContents();
24992599 } else
2500
- if (event.getSource() == sortbynameItem)
2600
+ if (source == sortbynameItem)
25012601 {
25022602 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032603 {
....@@ -2509,7 +2609,7 @@
25092609 ResetModel();
25102610 refreshContents();
25112611 } else
2512
- if (event.getSource() == attachPigmentItem)
2612
+ if (source == attachPigmentItem)
25132613 {
25142614 String texture = GetFile("Attach pigment");
25152615 Object3D obj;
....@@ -2521,7 +2621,7 @@
25212621
25222622 refreshContents();
25232623 } else
2524
- if (event.getSource() == detachPigmentItem)
2624
+ if (source == detachPigmentItem)
25252625 {
25262626 Object3D obj;
25272627 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2632,7 @@
25322632
25332633 refreshContents();
25342634 } else
2535
- if (event.getSource() == attachBumpItem)
2635
+ if (source == attachBumpItem)
25362636 {
25372637 String texture = GetFile("Attach bump");
25382638 Object3D obj;
....@@ -2544,7 +2644,7 @@
25442644
25452645 refreshContents();
25462646 } else
2547
- if (event.getSource() == detachBumpItem)
2647
+ if (source == detachBumpItem)
25482648 {
25492649 Object3D obj;
25502650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2655,7 @@
25552655
25562656 refreshContents();
25572657 } else
2558
- if (event.getSource() == pigmentBumpItem)
2658
+ if (source == pigmentBumpItem)
25592659 {
25602660 Object3D obj;
25612661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2666,195 @@
25662666
25672667 refreshContents();
25682668 } else
2569
- if (event.getSource() == flashSelectionButton)
2669
+ if (source == flashSelectionButton)
25702670 {
25712671 CameraPane.flash = true;
25722672 refreshContents();
25732673 } else
2574
- if (event.getSource() == oneButton)
2674
+ if (source == oneButton)
25752675 {
25762676 } else
2577
- if (event.getSource() == twoButton)
2677
+ if (source == twoButton)
25782678 {
25792679 radio.layout = twoButton;
25802680 // bug
25812681 //gridPanel.setDividerLocation(1.0);
25822682 //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();
2683
+// bigThree.remove(scenePanel);
2684
+// bigThree.remove(centralPanel);
2685
+// bigThree.remove(XYZPanel);
2686
+// aWindowConstraints.gridx = 0;
2687
+// aWindowConstraints.gridy = 0;
2688
+// aWindowConstraints.gridwidth = 1;
2689
+// // aConstraints.gridheight = 3;
2690
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2691
+// aWindowConstraints.weightx = 0;
2692
+// aWindowConstraints.weighty = 1;
2693
+// //bigThree.add(jtp, aWindowConstraints);
2694
+// aWindowConstraints.weightx = 1;
2695
+// aWindowConstraints.gridwidth = 3;
2696
+// // aConstraints.gridheight = 3;
2697
+// aWindowConstraints.gridx = 1;
2698
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2699
+// bigThree.add(centralPanel, aWindowConstraints);
2700
+// aWindowConstraints.weightx = 0;
2701
+// aWindowConstraints.gridx = 4;
2702
+// aWindowConstraints.gridwidth = 1;
2703
+// // aConstraints.gridheight = 3;
2704
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2705
+// //bigThree.add(XYZPanel, aWindowConstraints);
2706
+// scenePanel.setVisible(false);
2707
+// centralPanel.setVisible(true);
2708
+// XYZPanel.setVisible(false);
2709
+ bigThree.ClearUI();
2710
+ bigThree.add(centralPanel);
2711
+ bigThree.FlushUI();
26072712 } else
2608
- if (event.getSource() == threeButton)
2713
+ if (source == threeButton)
26092714 {
26102715 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();
2716
+
2717
+// bigThree.remove(scenePanel);
2718
+// bigThree.remove(centralPanel);
2719
+// bigThree.remove(XYZPanel);
2720
+// aWindowConstraints.gridx = 0;
2721
+// aWindowConstraints.gridy = 0;
2722
+// aWindowConstraints.gridwidth = 1;
2723
+// // aConstraints.gridheight = 3;
2724
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2725
+// aWindowConstraints.weightx = 0;
2726
+// aWindowConstraints.weighty = 1;
2727
+// //bigThree.add(jtp, aWindowConstraints);
2728
+// aWindowConstraints.weightx = 1;
2729
+// aWindowConstraints.gridwidth = 3;
2730
+// // aConstraints.gridheight = 3;
2731
+// aWindowConstraints.gridx = 1;
2732
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2733
+// bigThree.add(centralPanel, aWindowConstraints);
2734
+// aWindowConstraints.weightx = 0;
2735
+// aWindowConstraints.gridx = 4;
2736
+// aWindowConstraints.gridwidth = 1;
2737
+// // aConstraints.gridheight = 3;
2738
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2739
+// bigThree.add(XYZPanel, aWindowConstraints);
2740
+// bigThree.validate();
2741
+// scenePanel.setVisible(false);
2742
+// centralPanel.setVisible(true);
2743
+// XYZPanel.setVisible(true);
2744
+ bigThree.ClearUI();
2745
+ bigThree.add(centralPanel);
2746
+ bigThree.add(XYZPanel);
2747
+ bigThree.FlushUI();
26352748 } else
2636
- if (event.getSource() == fourButton)
2749
+ if (source == fourButton)
26372750 {
26382751 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();
2752
+
2753
+// bigThree.remove(scenePanel);
2754
+// bigThree.remove(centralPanel);
2755
+// bigThree.remove(XYZPanel);
2756
+// aWindowConstraints.gridx = 0;
2757
+// aWindowConstraints.gridy = 0;
2758
+// aWindowConstraints.gridwidth = 1;
2759
+// // aWindowConstraints.gridheight = 3;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// aWindowConstraints.weightx = 1;
2762
+// aWindowConstraints.weighty = 1;
2763
+// bigThree.add(scenePanel, aWindowConstraints);
2764
+// aWindowConstraints.weightx = 1;
2765
+// aWindowConstraints.gridwidth = 3;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.gridx = 1;
2768
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
+// //bigThree.add(cameraPanel, aWindowConstraints);
2770
+// aWindowConstraints.weightx = 0;
2771
+// aWindowConstraints.gridx = 4;
2772
+// aWindowConstraints.gridwidth = 1;
2773
+// // aWindowConstraints.gridheight = 3;
2774
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
+// //bigThree.add(XYZPanel, aWindowConstraints);
2776
+// bigThree.validate();
2777
+// scenePanel.setVisible(true);
2778
+// centralPanel.setVisible(false);
2779
+// XYZPanel.setVisible(false);
2780
+ bigThree.ClearUI();
2781
+ bigThree.add(scenePanel);
2782
+ bigThree.FlushUI();
26632783 } else
2664
- if (event.getSource() == sixButton)
2784
+ if (source == sixButton)
26652785 {
26662786 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();
2787
+
2788
+// bigThree.remove(scenePanel);
2789
+// bigThree.remove(centralPanel);
2790
+// bigThree.remove(XYZPanel);
2791
+// aWindowConstraints.gridx = 0;
2792
+// aWindowConstraints.gridy = 0;
2793
+// aWindowConstraints.gridwidth = 1;
2794
+// // aConstraints.gridheight = 3;
2795
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2796
+// aWindowConstraints.weightx = 0;
2797
+// aWindowConstraints.weighty = 1;
2798
+// bigThree.add(scenePanel, aWindowConstraints);
2799
+// aWindowConstraints.weightx = 1;
2800
+// aWindowConstraints.gridwidth = 3;
2801
+// // aWindowConstraints.gridheight = 3;
2802
+// aWindowConstraints.gridx = 1;
2803
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2804
+// bigThree.add(centralPanel, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 0;
2806
+// aWindowConstraints.gridx = 4;
2807
+// aWindowConstraints.gridwidth = 1;
2808
+// // aWindowConstraints.gridheight = 3;
2809
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2810
+// //bigThree.add(XYZPanel, aConstraints);
2811
+// bigThree.validate();
2812
+// scenePanel.setVisible(true);
2813
+// centralPanel.setVisible(true);
2814
+// XYZPanel.setVisible(false);
2815
+ bigThree.ClearUI();
2816
+ bigThree.add(scenePanel);
2817
+ bigThree.add(centralPanel);
2818
+ bigThree.FlushUI();
26912819 } else
2692
- if (event.getSource() == sevenButton)
2820
+ if (source == sevenButton)
26932821 {
26942822 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();
2823
+
2824
+// bigThree.remove(scenePanel);
2825
+// bigThree.remove(centralPanel);
2826
+// bigThree.remove(XYZPanel);
2827
+// aWindowConstraints.gridx = 0;
2828
+// aWindowConstraints.gridy = 0;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aWindowConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// aWindowConstraints.weightx = 0;
2833
+// aWindowConstraints.weighty = 1;
2834
+// bigThree.add(scenePanel, aWindowConstraints);
2835
+// aWindowConstraints.weightx = 1;
2836
+// aWindowConstraints.gridwidth = 3;
2837
+// // aWindowConstraints.gridheight = 3;
2838
+// aWindowConstraints.gridx = 1;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// bigThree.add(centralPanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 0;
2842
+// aWindowConstraints.gridx = 4;
2843
+// aWindowConstraints.gridwidth = 1;
2844
+// // aConstraints.gridheight = 3;
2845
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2846
+// bigThree.add(XYZPanel, aWindowConstraints);
2847
+// bigThree.validate();
2848
+// scenePanel.setVisible(true);
2849
+// centralPanel.setVisible(true);
2850
+// XYZPanel.setVisible(true);
2851
+ bigThree.ClearUI();
2852
+ bigThree.add(scenePanel);
2853
+ bigThree.add(centralPanel);
2854
+ bigThree.add(XYZPanel);
2855
+ bigThree.FlushUI();
27192856 } else
2720
- if (event.getSource() == rootButton)
2857
+ if (source == rootButton)
27212858 {
27222859 Object3D obj;
27232860 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +2866,7 @@
27292866
27302867 refreshContents(true);
27312868 } else
2732
- if (event.getSource() == closeButton)
2869
+ if (source == closeButton)
27332870 {
27342871 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27352872 cRadio ab;
....@@ -2750,11 +2887,11 @@
27502887 }
27512888 refreshContents(true);
27522889 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
2890
+ if (source == editItem || source == editButton)
27542891 {
27552892 EditSelection(false);
27562893 } else
2757
- if (event.getSource() == uneditButton)
2894
+ if (source == uneditButton)
27582895 {
27592896 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27602897 {
....@@ -2766,12 +2903,12 @@
27662903
27672904 child.editWindow = null; // ???????????
27682905 }
2769
- objEditor.ctrlPanel.revalidate();
2906
+ objEditor.ctrlPanel.validate();
27702907 //objEditor.jTree.clearSelection();
27712908 //objEditor.ResetSliders();
27722909 refreshContents(true);
27732910 } else
2774
- if (event.getSource() == clearPanelButton)
2911
+ if (source == clearPanelButton)
27752912 {
27762913 assert(copy == group);
27772914 //copy.ClearUI();
....@@ -2782,7 +2919,7 @@
27822919 listUI.clear();
27832920 refreshContents(true);
27842921 } else
2785
- if (event.getSource() == allParamsButton)
2922
+ if (source == allParamsButton)
27862923 {
27872924 assert(copy == group);
27882925
....@@ -2803,19 +2940,19 @@
28032940
28042941 refreshContents(true);
28052942 } else
2806
- if (event.getSource() == unselectButton)
2943
+ if (source == unselectButton)
28072944 {
28082945 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
2946
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28102947 objEditor.ResetSliders();
28112948 refreshContents(true);
28122949 } else
2813
- if(event.getSource() instanceof cRadio)
2950
+ if(source instanceof cRadio)
28142951 {
28152952 group.parent = keepparent;
28162953 group.attributes = 0;
28172954 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
2955
+ /*cRadio*/ radio = (cRadio)source;
28192956 Object3D obj = radio.GetObject();
28202957 System.out.println("Edit " + obj);
28212958 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +2972,7 @@
28352972 }
28362973
28372974 copy = group;
2838
- //CameraPane.theRenderer.object = group;
2975
+ //Globals.theRenderer.object = group;
28392976 if(!useclient)
28402977 {
28412978 cameraView.renderCamera = radio.camera;
....@@ -2844,7 +2981,8 @@
28442981 cameraView.cameras[cameraView.cameracount] = radio.camera;
28452982 cameraView.targetLookAt.set(radio.camera.lookAt);
28462983 cameraView.object = group;
2847
- cameraView.lighttouched = true;
2984
+ //cameraView.lighttouched = true;
2985
+ Globals.lighttouched = true;
28482986 topView.object = group;
28492987 frontView.object = group;
28502988 sideView.object = group;
....@@ -2880,7 +3018,7 @@
28803018 if (useclient)
28813019 {
28823020 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
28843022 //topView.object = client;
28853023 //frontView.object = client;
28863024 //sideView.object = client;
....@@ -2888,7 +3026,7 @@
28883026 else
28893027 {
28903028 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3029
+ Globals.lighttouched = true;
28923030 //topView.object = group;
28933031 //frontView.object = group;
28943032 //sideView.object = group;
....@@ -3121,9 +3259,9 @@
31213259 obj = (Object3D)e.nextElement();
31223260
31233261 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3262
+ GrafreeD.AnalyzeObject(obj);
31253263 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3264
+ GrafreeD.AnalyzeObject(obj.bRep);
31273265
31283266 // System.err.println((size/1024) + " KB is the size of " + obj);
31293267 }
....@@ -3165,6 +3303,13 @@
31653303 void GenNormals(boolean crease)
31663304 {
31673305 group.GenNormalsS(crease);
3306
+
3307
+ refreshContents();
3308
+ }
3309
+
3310
+ void GenNormalsMINE()
3311
+ {
3312
+ group.selection.GenNormalsMINE();
31683313
31693314 refreshContents();
31703315 }
....@@ -3250,7 +3395,7 @@
32503395 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513396 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523397 //
3253
-// g.add(GraphreeD.clipboard);
3398
+// g.add(GrafreeD.clipboard);
32543399 //
32553400 // buffer.add(g);
32563401 // }
....@@ -3269,8 +3414,8 @@
32693414 // nodes = new Object3D();
32703415 // vertices = new Vector<Vertex>();
32713416 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3417
+// boolean epsequal = GrafreeD.epsequal;
3418
+// GrafreeD.epsequal = true;
32743419 //
32753420 // for (int i=0; i<group.selection.size(); i++)
32763421 // {
....@@ -3311,7 +3456,7 @@
33113456 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123457 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133458 //
3314
-// g.add(GraphreeD.clipboard);
3459
+// g.add(GrafreeD.clipboard);
33153460 //
33163461 // buffer.add(g);
33173462 // }
....@@ -3319,7 +3464,7 @@
33193464 // makeSomething(buffer, i==group.selection.size()-1);
33203465 // }
33213466 //
3322
-// GraphreeD.epsequal = epsequal;
3467
+// GrafreeD.epsequal = epsequal;
33233468 //
33243469 // //buffer = null;
33253470 // temprep = null;
....@@ -3330,8 +3475,8 @@
33303475
33313476 void ParseVertices()
33323477 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3478
+ boolean epsequal = GrafreeD.epsequal;
3479
+ GrafreeD.epsequal = true;
33353480
33363481 for (int i=0; i<group.selection.size(); i++)
33373482 {
....@@ -3356,7 +3501,7 @@
33563501 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573502 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583503
3359
- g.add(GraphreeD.clipboard);
3504
+ g.add(GrafreeD.clipboard);
33603505
33613506 buffer.add(g);
33623507 }
....@@ -3371,7 +3516,7 @@
33713516 makeSomething(buffer, i==group.selection.size()-1);
33723517 }
33733518
3374
- GraphreeD.epsequal = epsequal;
3519
+ GrafreeD.epsequal = epsequal;
33753520
33763521 refreshContents();
33773522 }
....@@ -3389,7 +3534,7 @@
33893534 String pigment = Object3D.GetPigment(tex);
33903535 //String bump = Object3D.GetBump(tex);
33913536
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3537
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33933538
33943539 double s = v.s;
33953540
....@@ -3416,7 +3561,7 @@
34163561 scale /= 3;
34173562
34183563 scale /= 0xFF;
3419
- scale /= 4;
3564
+ // c'est quoi ca? scale /= 4;
34203565
34213566 //v.AO = scale;
34223567
....@@ -3437,12 +3582,26 @@
34373582
34383583 void Align()
34393584 {
3585
+ if (group.selection.size() == 0)
3586
+ return;
3587
+
3588
+ cVector bbmin = new cVector();
3589
+ cVector bbmax = new cVector();
3590
+
3591
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3592
+
3593
+ double dx = bbmax.x - bbmin.x;
3594
+ double dy = bbmax.y - bbmin.y;
3595
+ double dz = bbmax.z - bbmin.z;
3596
+
3597
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3598
+
34403599 for (int i=0; i<group.selection.size(); i++)
34413600 {
34423601 Object3D obj = group.selection.get(i);
34433602
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3603
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3604
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463605 }
34473606
34483607 refreshContents();
....@@ -3455,7 +3614,7 @@
34553614 // ref.SaveSupports();
34563615 // Object3D par = ref.parent;
34573616 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3617
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593618 // ref.parent = par;
34603619 // ref.RestoreSupports();
34613620
....@@ -3485,7 +3644,7 @@
34853644 // lowres.SaveSupports();
34863645 // par = lowres.parent;
34873646 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3647
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893648 Object3D newlow = CloneObject(lowres, false);
34903649 newlow.name = sn.switchobject.get(i).name;
34913650 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3666,7 @@
35073666 return;
35083667
35093668 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3669
+ Object3D ref = GrafreeD.clipboard.get(0);
35113670
35123671 Object3D newgroup = new Object3D("Po:" + poses.name);
35133672
....@@ -3676,7 +3835,7 @@
36763835 group.selection.RelinkToSupport(); // july 2014
36773836 System.out.println("DONE.");
36783837 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3838
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36803839 }
36813840
36823841 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +3860,20 @@
37013860
37023861 void ClipMesh()
37033862 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3863
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
37053864 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
3865
+ Object3D content = GrafreeD.clipboard.get(0);
37073866
37083867 if (content instanceof cGroup && ((cGroup)content).transientlink )
37093868 content = ((cGroup)content).get(0);
37103869
37113870 // for (int i=0; i<group.selection.size(); i++)
37123871 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3872
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37143873 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
3874
+ group.selection.ClipMesh(GrafreeD.clipboard);
37163875 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
3876
+// group.selection.ClipMesh(GrafreeD.clipboard);
37183877 System.out.println("DONE.");
37193878 refreshContents();
37203879 }
....@@ -3952,25 +4111,25 @@
39524111 System.err.println("info : " + child.GetPath());
39534112 }
39544113 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
39614120
39624121 objEditor.SetText(); // jan 2014
39634122
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4123
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39654124 CameraPane.flash = true;
39664125
39674126 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39684127 // a camera
39694128 {
39704129 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;
4130
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4131
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4132
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744133 }
39754134
39764135 refreshContents();
....@@ -4052,12 +4211,12 @@
40524211 {
40534212 if (group.selection.isEmpty())
40544213 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4214
+ GrafreeD.clipboardIsTempGroup = false;
40564215 Composite tGroup = null;
40574216 if (group.selection.size() > 0) // 1)
40584217 {
40594218 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4219
+ GrafreeD.clipboardIsTempGroup = true;
40614220 }
40624221
40634222 if (cut)
....@@ -4097,16 +4256,16 @@
40974256 //System.out.println("cut " + child);
40984257 //System.out.println("parent = " + child.parent);
40994258 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4259
+ if (GrafreeD.clipboardIsTempGroup)
41014260 tGroup.add/*Child*/(tmp);
41024261 else
4103
- GraphreeD.clipboard = tmp;
4262
+ GrafreeD.clipboard = tmp;
41044263 }
41054264 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4265
+ if (GrafreeD.clipboardIsTempGroup)
41074266 tGroup.add/*Child*/(child);
41084267 else
4109
- GraphreeD.clipboard = child;
4268
+ GrafreeD.clipboard = child;
41104269 }
41114270
41124271 //ResetModel();
....@@ -4138,21 +4297,21 @@
41384297 //System.out.println("cut " + elem);
41394298 //System.out.println("parent = " + elem.parent);
41404299 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4300
+ if (GrafreeD.clipboardIsTempGroup)
41424301 tGroup.add/*Child*/(tmp);
41434302 else
4144
- GraphreeD.clipboard = tmp;
4303
+ GrafreeD.clipboard = tmp;
41454304 }
41464305 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4306
+ if (GrafreeD.clipboardIsTempGroup)
41484307 tGroup.add/*Child*/(child);
41494308 else
4150
- GraphreeD.clipboard = child;
4309
+ GrafreeD.clipboard = child;
41514310 }
41524311
41534312 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4313
+ if (GrafreeD.clipboardIsTempGroup)
4314
+ GrafreeD.clipboard = tGroup;
41564315 if (cut)
41574316 {
41584317 ResetModel();
....@@ -4162,11 +4321,11 @@
41624321
41634322 void paste(boolean expand)
41644323 {
4165
- // if (GraphreeD.clipboard == null)
4324
+ // if (GrafreeD.clipboard == null)
41664325 // return;
41674326 boolean first = true;
41684327
4169
- if (GraphreeD.clipboardIsTempGroup)
4328
+ if (GrafreeD.clipboardIsTempGroup)
41704329 {
41714330 Composite temp;
41724331
....@@ -4177,7 +4336,7 @@
41774336 temp = (Composite)Applet3D.clipboard.deepCopy();
41784337 */
41794338 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4339
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814340 {
41824341 Object3D child = (Object3D)e.nextElement();
41834342
....@@ -4191,7 +4350,7 @@
41914350 else
41924351 elem = child.deepCopy(); // ?
41934352 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4353
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954354 // elem = elem.get(0);
41964355 makeSomething(elem, true); // ?? first);
41974356 //group.addChild(elem);
....@@ -4211,14 +4370,14 @@
42114370 //Object3D cb = Applet3D.clipboard;
42124371 //temp.addChild(cb);
42134372 //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());
4373
+ assert(GrafreeD.clipboard.parent == null);
4374
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4375
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4376
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4377
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
42194378 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4379
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4380
+ GrafreeD.clipboard.get(0).parent = keepparent;
42224381 }
42234382
42244383 ResetModel();
....@@ -4227,7 +4386,7 @@
42274386
42284387 void pasteInto(boolean copyit)
42294388 {
4230
-// if (GraphreeD.clipboard == null)
4389
+// if (GrafreeD.clipboard == null)
42314390 // return;
42324391
42334392 if (group.selection.size() != 1)
....@@ -4260,9 +4419,9 @@
42604419 {
42614420 boolean first = true;
42624421
4263
- if (GraphreeD.clipboardIsTempGroup)
4422
+ if (GrafreeD.clipboardIsTempGroup)
42644423 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4424
+ Composite temp = (Composite)GrafreeD.clipboard;
42664425 Object3D copy;
42674426 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684427 {
....@@ -4272,7 +4431,7 @@
42724431 }
42734432 } else
42744433 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4434
+ linkSomething(GrafreeD.clipboard); //.get(0));
42764435 }
42774436 }
42784437 }
....@@ -4464,6 +4623,26 @@
44644623 makeSomething(csg);
44654624 }
44664625
4626
+ void Ungroup(Object3D g)
4627
+ {
4628
+ if (g instanceof HiddenObject)
4629
+ {
4630
+ HiddenObject h = (HiddenObject) g;
4631
+
4632
+ for (int i=0; i<h.ActualSize(); i++)
4633
+ {
4634
+ objEditor.makeSomething(h.get(i), false);
4635
+ }
4636
+ }
4637
+ else
4638
+ {
4639
+ for (int i=0; i<g.Size(); i++)
4640
+ {
4641
+ objEditor.makeSomething(g.get(i), false);
4642
+ }
4643
+ }
4644
+ }
4645
+
44674646 void ungroup()
44684647 {
44694648 /*
....@@ -4659,7 +4838,7 @@
46594838
46604839 void ImportGFD()
46614840 {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4841
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
46634842 browser.show();
46644843 String filename = browser.getFile();
46654844 if (filename != null && filename.length() > 0)
....@@ -4697,7 +4876,7 @@
46974876
46984877 void ImportVRMLX3D()
46994878 {
4700
- if (GraphreeD.standAlone)
4879
+ if (GrafreeD.standAlone)
47014880 {
47024881 /**/
47034882 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4714,7 +4893,7 @@
47144893
47154894 String GetFile(String dialogName)
47164895 {
4717
- if (GraphreeD.standAlone)
4896
+ if (GrafreeD.standAlone)
47184897 {
47194898 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47204899 browser.show();
....@@ -4823,6 +5002,7 @@
48235002 private MenuItem resetsupportItem;
48245003 private MenuItem resetreferencesItem;
48255004 private MenuItem linkverticesItem;
5005
+ private MenuItem relinkverticesItem;
48265006 private MenuItem setMasterItem;
48275007 private MenuItem resetMeshItem;
48285008 private MenuItem stepAllItem;
....@@ -4841,8 +5021,10 @@
48415021 private MenuItem clearItem;
48425022 private MenuItem clearAllItem;
48435023 private MenuItem genUVItem;
5024
+ private MenuItem genNormalsMESHItem;
48445025 private MenuItem genNormalsCADItem;
48455026 private MenuItem genNormalsORGANItem;
5027
+ private MenuItem genNormalsMINEItem;
48465028 private MenuItem stripifyItem;
48475029 private MenuItem unstripifyItem;
48485030 private MenuItem trimItem;
....@@ -4884,6 +5066,7 @@
48845066 private MenuItem resetCentroidItem;
48855067 private MenuItem transformgeometryItem;
48865068 private MenuItem resetTransformItem;
5069
+ private MenuItem hideItem;
48875070 private MenuItem grabItem;
48885071 private MenuItem backItem;
48895072 private MenuItem frontItem;
....@@ -4904,6 +5087,7 @@
49045087
49055088 private MenuItem resetParentItem;
49065089 private MenuItem repairParentItem;
5090
+ private MenuItem repairShadowItem;
49075091 private MenuItem sortbysizeItem;
49085092 private MenuItem sortbynameItem;
49095093
....@@ -4924,6 +5108,7 @@
49245108 private MenuItem coneItem;
49255109 private MenuItem torusItem;
49265110 private MenuItem superItem;
5111
+ private MenuItem kleinItem;
49275112 private MenuItem blobItem;
49285113 private MenuItem latheItem;
49295114 private MenuItem bezierItem;
....@@ -4936,6 +5121,7 @@
49365121 private MenuItem csgItem;
49375122 private MenuItem templateItem;
49385123 private MenuItem textureItem;
5124
+ private MenuItem billboardItem;
49395125 private MenuItem shadowXItem;
49405126 private MenuItem shadowYItem;
49415127 private MenuItem shadowZItem;