Normand Briere
2019-05-01 20c1a07b76c39462594aedfedfe6e6adb17cd552
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,30 @@
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);
501457 // oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
458
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503459 snapobjectButton.addActionListener(this);
460
+ snapobjectButton.setToolTipText("Snap Object");
504461 oe.aConstraints.gridx += 1;
505462
506463 //aConstraints.gridx = 0;
....@@ -508,65 +465,66 @@
508465 oe.aConstraints.weighty = 0;
509466 oe.aConstraints.gridwidth = 1;
510467
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
469
+ flashSelectionButton.setToolTipText("Show selection");
512470 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516471
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
472
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473
+
474
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
475
+ twoButton.setToolTipText("Show center view only");
519476 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521478 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
479
+ fourButton.setToolTipText("Show left panel only");
480
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
+ sixButton.setToolTipText("2-column layout left");
523482 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
+ threeButton.setToolTipText("2-column layout right");
525485 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
486
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
487
+ sevenButton.setToolTipText("3-column layout");
527488 sevenButton.addActionListener(this);
528489 //
529490
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
491
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ rootButton.setToolTipText("Edit selection in new tab");
531493 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
494
+
495
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
496
+ closeButton.setToolTipText("Close tab");
534497 closeButton.addActionListener(this);
535498 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536499 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538500
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
501
+ cGridBag commandsPanel = new cGridBag();
502
+
503
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ editButton.setToolTipText("Edit selection");
541505 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545506
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
507
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ uneditButton.setToolTipText("Unedit selection");
547509 uneditButton.addActionListener(this);
548510
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);
511
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ clearPanelButton.setToolTipText("Clear edit panel");
554513 clearPanelButton.addActionListener(this);
555514
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);
515
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ allParamsButton.setToolTipText("All params??");
561517 allParamsButton.addActionListener(this);
562518
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);
519
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ unselectButton.setToolTipText("Unselect");
568521 unselectButton.addActionListener(this);
569522
523
+ commandsPanel.preferredHeight = 1;
524
+
525
+ oe.treePanel.add(commandsPanel);
526
+ oe.treePanel.Return();
527
+
570528 // oe.aConstraints.gridx += 1;
571529 // oe.aConstraints.weighty = 0;
572530 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +536,37 @@
578536 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579537 // gcButton.addActionListener(this);
580538
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;
539
+ cGridBag jSPPanel = new cGridBag();
540
+
541
+ JScrollPane jSP;
592542 //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);
543
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594544 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
545
+
546
+ oe.treePanel.add(jSPPanel);
547
+ oe.treePanel.Return();
599548
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);
549
+ cGridBag copyOptionsPanel = new cGridBag();
550
+
551
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
552
+ colorCB.setToolTipText("Copy color when dropped");
604553 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
556
+ materialCB.setToolTipText("Copy material when dropped");
607557 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
558
+
559
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
560
+ textureCB.setToolTipText("Copy texture when dropped");
610561 textureCB.addItemListener(this);
611562
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
563
+ copyOptionsPanel.preferredHeight = 1;
564
+ oe.treePanel.add(copyOptionsPanel);
565
+ oe.treePanel.Return();
614566
567
+// mainPanel.setDividerLocation(0.5); //1.0);
568
+// mainPanel.setResizeWeight(0.5);
569
+
615570 //jList.addListSelectionListener(this);
616571 oe.jTree.addTreeSelectionListener(this);
617572 //jTree.setRootVisible(false);
....@@ -633,17 +588,85 @@
633588 radio.layout = sevenButton;
634589 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635590 }
591
+
592
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593
+ {
594
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
+ supportCB.setToolTipText("Enabled rigging");
596
+ supportCB.addItemListener(this);
597
+
598
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
599
+ // localCB.addItemListener(this);
600
+
601
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
602
+ crowdCB.setToolTipText("Used for crowds");
603
+ crowdCB.addItemListener(this);
604
+
605
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
606
+ smoothCB.setToolTipText("Snapping delay");
607
+ smoothCB.addItemListener(this);
608
+
609
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
610
+ slowCB.setToolTipText("Smooth interpolation");
611
+ slowCB.addItemListener(this);
612
+
613
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
614
+ boxCB.setToolTipText("Display bounding boxes");
615
+ boxCB.addItemListener(this);
616
+
617
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
618
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
619
+ zoomBoxCB.addItemListener(this);
620
+
621
+// constraints.gridy += 1;
622
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623
+// speakerMocapCB.addItemListener(this);
624
+
625
+ if (false)
626
+ {
627
+ // handled in scripts
628
+ //constraints.gridy += 1;
629
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
630
+ speakerCameraCB.addItemListener(this);
631
+
632
+ //constraints.gridy += 1;
633
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
634
+ speakerFocusCB.addItemListener(this);
635
+
636
+ //constraints.gridy += 1;
637
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
638
+ smoothfocusCB.addItemListener(this);
639
+ }
640
+
641
+//constraints.gridx += 1;
642
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
643
+// debugCB.addItemListener(this);
644
+
645
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
646
+ oeilCB.addItemListener(this);
647
+
648
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649
+ lookAtCB.setToolTipText("Look-at target");
650
+ lookAtCB.addItemListener(this);
651
+
652
+ cGridBag fill = new cGridBag();
653
+
654
+ fill.preferredHeight = 200;
655
+
656
+ panel.add(fill);
657
+
658
+ }
636659
637660 void EditObject(Object3D obj)
638661 {
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();
662
+ cRadio radioButton = new cRadio(obj.name);
663
+ radioButton.SetObject(obj);
664
+ radioButton.layout = sevenButton;
665
+ radioButton.SetCamera(cameraView.renderCamera, false);
666
+ radioButton.addActionListener(this);
667
+ radioPanel.add(radioButton);
668
+ buttonGroup.add(radioButton);
669
+ radioButton.doClick();
647670 }
648671 void SetupViews(ObjEditor oe)
649672 {
....@@ -663,6 +686,7 @@
663686 JCheckBox fastCB;
664687 JCheckBox slowCB;
665688 JCheckBox boxCB;
689
+ JCheckBox zoomBoxCB;
666690 JCheckBox trackCB;
667691 JCheckBox smoothfocusCB;
668692 // JCheckBox speakerMocapCB;
....@@ -705,8 +729,7 @@
705729 dropAttributes |= Object3D.TEXTURE;
706730 else
707731 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
732
+ } else if(e.getSource() == liveCB)
710733 {
711734 cameraView.ToggleLive();
712735 }
....@@ -743,6 +766,10 @@
743766 Recompile();
744767 cameraView.repaint();
745768 // refreshContents();
769
+ }
770
+ else if(e.getSource() == zoomBoxCB)
771
+ {
772
+ cameraView.ToggleZoomBoxMode();
746773 }
747774 else if(e.getSource() == smoothfocusCB)
748775 {
....@@ -1033,6 +1060,8 @@
10331060 torusItem.addActionListener(this);
10341061 superItem = menu.add(new MenuItem("Superellipsoid"));
10351062 superItem.addActionListener(this);
1063
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1064
+ kleinItem.addActionListener(this);
10361065 particleItem = menu.add(new MenuItem("Particle system"));
10371066 particleItem.addActionListener(this);
10381067 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1073,7 +1102,7 @@
10731102 {
10741103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751104 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
10771106
10781107 menu.add("-");
10791108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1106,6 +1135,8 @@
11061135 resetParentItem.addActionListener(this);
11071136 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081137 repairParentItem.addActionListener(this);
1138
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1139
+ repairShadowItem.addActionListener(this);
11091140 menu.add(invariantsItem = new MenuItem("Invariants"));
11101141 invariantsItem.addActionListener(this);
11111142 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1441,9 +1472,9 @@
14411472
14421473 void Overwrite(int mask)
14431474 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1475
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14451476 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1477
+ Object3D content = GrafreeD.clipboard.get(0);
14471478
14481479 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491480 content = ((cGroup)content).get(0);
....@@ -1466,6 +1497,7 @@
14661497 //
14671498 public void actionPerformed(ActionEvent event) // , Object arg)
14681499 {
1500
+ Object source = event.getSource();
14691501 /*
14701502 if (event.getSource() == nameField)
14711503 {
....@@ -1477,11 +1509,11 @@
14771509 }
14781510 else
14791511 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1512
+ if (source == lookAtItem || source == lookFromItem)
14811513 {
14821514 ScreenFit();
14831515 } else
1484
- if (event.getSource() == switchItem)
1516
+ if (source == switchItem)
14851517 {
14861518 cVector v1 = new cVector();
14871519 cVector v2 = new cVector();
....@@ -1490,11 +1522,11 @@
14901522 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911523 objEditor.cameraView.repaint();
14921524 } else
1493
- if (event.getSource() == rectoidItem)
1525
+ if (source == rectoidItem)
14941526 {
14951527 makeSomething(new Box());
14961528 } else
1497
- if (event.getSource() == particleItem)
1529
+ if (source == particleItem)
14981530 {
14991531 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001532 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1547,9 @@
15151547 applyExample(particleGeom, "SMOKE");
15161548 makeSomething(particleGeom);
15171549 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1550
+ if (source == ragdollItem || source == ragdoll2Item)
15191551 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1552
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211553
15221554 ragdoll.toParent = LA.newMatrix();
15231555 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1567,7 @@
15351567 } else
15361568 /*
15371569 */
1538
- if (event.getSource() == heightFieldItem)
1570
+ if (source == heightFieldItem)
15391571 {
15401572 Object3D obj = new Object3D();
15411573
....@@ -1573,27 +1605,31 @@
15731605
15741606 makeSomething(obj);
15751607 } else
1576
- if (event.getSource() == gridItem)
1608
+ if (source == gridItem)
15771609 {
15781610 makeSomething(new Grid());
15791611 } else
1580
- if (event.getSource() == ellipsoidItem)
1612
+ if (source == ellipsoidItem)
15811613 {
15821614 makeSomething(new Sphere());
15831615 } else
1584
- if (event.getSource() == coneItem)
1616
+ if (source == coneItem)
15851617 {
15861618 makeSomething(new Cone());
15871619 } else
1588
- if (event.getSource() == torusItem)
1620
+ if (source == torusItem)
15891621 {
15901622 makeSomething(new Torus());
15911623 } else
1592
- if (event.getSource() == superItem)
1624
+ if (source == superItem)
15931625 {
15941626 makeSomething(new Superellipsoid());
15951627 } else
1596
- if (event.getSource() == blobItem)
1628
+ if (source == kleinItem)
1629
+ {
1630
+ makeSomething(new Klein());
1631
+ } else
1632
+ if (source == blobItem)
15971633 {
15981634 Blob blob = new Blob();
15991635 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1637,15 @@
16011637 //blob.retile();
16021638 makeSomething(blob);
16031639 } else
1604
- if (event.getSource() == latheItem)
1640
+ if (source == latheItem)
16051641 {
16061642 makeSomething(new Lathe());
16071643 } else
1608
- if (event.getSource() == bezierItem)
1644
+ if (source == bezierItem)
16091645 {
16101646 makeSomething(new BezierSurface());
16111647 } else
1612
- if (event.getSource() == checkerItem)
1648
+ if (source == checkerItem)
16131649 {
16141650 /*
16151651 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1660,7 @@
16241660 */
16251661 makeSomething(new Checker());
16261662 } else
1627
- if (event.getSource() == meshItem)
1663
+ if (source == meshItem)
16281664 {
16291665 Object3D itemtomake = new Object3D();
16301666 Object3D child;
....@@ -1645,35 +1681,35 @@
16451681 makeSomething(child);
16461682 }
16471683 } else
1648
- if (event.getSource() == springItem)
1684
+ if (source == springItem)
16491685 {
16501686 cSpring s = new cSpring();
16511687 s.setup();
16521688 makeSomething(s);
16531689 } else
1654
- if (event.getSource() == flagItem)
1690
+ if (source == flagItem)
16551691 {
16561692 cSpring s = new cFlag();
16571693 s.setup();
16581694 makeSomething(s);
16591695 } else
1660
- if (event.getSource() == lightItem)
1696
+ if (source == lightItem)
16611697 {
16621698 makeSomething(new Light());
16631699 } else
1664
- if (event.getSource() == csgItem)
1700
+ if (source == csgItem)
16651701 {
16661702 group(new CSG());
16671703 } else
1668
- if (event.getSource() == templateItem)
1704
+ if (source == templateItem)
16691705 {
16701706 group(new cTemplate());
16711707 } else
1672
- if (event.getSource() == attributeItem)
1708
+ if (source == attributeItem)
16731709 {
16741710 makeSomething(new Attribute());
16751711 } else
1676
- if (event.getSource() == pointflowItem)
1712
+ if (source == pointflowItem)
16771713 {
16781714 makeSomething(new PointFlow());
16791715 } else
....@@ -1685,7 +1721,7 @@
16851721 } else
16861722 */
16871723
1688
- if (event.getSource() == superLoopItem)
1724
+ if (source == superLoopItem)
16891725 {
16901726 Composite g = new cGroup();
16911727 for (int i=0; i<15; i++)
....@@ -1707,7 +1743,7 @@
17071743
17081744 group(g);
17091745 } else
1710
- if (event.getSource() == loopItem)
1746
+ if (source == loopItem)
17111747 {
17121748 Composite csg = new GroupLeaf();
17131749 csg.count = 5;
....@@ -1716,7 +1752,7 @@
17161752 csg.addChild(child);
17171753 child.addChild(csg);
17181754 } else
1719
- if (event.getSource() == doubleItem)
1755
+ if (source == doubleItem)
17201756 {
17211757 Composite csg = new GroupLeaf();
17221758 csg.count = 5;
....@@ -1728,7 +1764,7 @@
17281764 csg.addChild(child);
17291765 child.addChild(csg);
17301766 } else
1731
- if (event.getSource() == tripleItem)
1767
+ if (source == tripleItem)
17321768 {
17331769 Composite csg = new GroupLeaf();
17341770 csg.count = 4;
....@@ -1744,70 +1780,70 @@
17441780 child.addChild(csg);
17451781 } else
17461782
1747
- if (event.getSource() == importGFDItem)
1783
+ if (source == importGFDItem)
17481784 {
17491785 ImportGFD();
17501786 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1787
+ if (source == importVRMLX3DItem)
17521788 {
17531789 ImportVRMLX3D();
17541790 } else
1755
- if (event.getSource() == import3DSItem)
1791
+ if (source == import3DSItem)
17561792 {
17571793 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581794 } else
1759
- if (event.getSource() == importOBJItem)
1795
+ if (source == importOBJItem)
17601796 {
17611797 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621798 } else
1763
- if (event.getSource() == computeAOItem)
1799
+ if (source == computeAOItem)
17641800 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1801
+ Globals.drawMode = CameraPane.OCCLUSION;
1802
+ Globals.theRenderer.repaint();
17671803 } else
1768
- if (event.getSource() == recompileItem)
1804
+ if (source == recompileItem)
17691805 {
17701806 Recompile();
17711807 refreshContents();
17721808 } else
1773
- if (event.getSource() == editScriptItem)
1809
+ if (source == editScriptItem)
17741810 {
17751811 OpenDialog();
17761812 refreshContents();
17771813 } else
1778
- if (event.getSource() == invariantsItem)
1814
+ if (source == invariantsItem)
17791815 {
17801816 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1817
+ GrafreeD.grafreeD.universe.invariants();
17821818 } else
1783
- if (event.getSource() == memoryItem)
1819
+ if (source == memoryItem)
17841820 {
17851821 //System.out.println("Invariants:");
17861822 PrintMemory();
17871823 } else
1788
- if (event.getSource() == pathItem)
1824
+ if (source == pathItem)
17891825 {
17901826 PrintPath();
17911827 } else
1792
- if (event.getSource() == analyzeItem)
1828
+ if (source == analyzeItem)
17931829 {
17941830 AnalyzeObject();
17951831 } else
1796
- if (event.getSource() == dumpItem)
1832
+ if (source == dumpItem)
17971833 {
17981834 DumpObject();
17991835 } else
1800
- if (event.getSource() == screenfitButton)
1836
+ if (source == screenfitButton)
18011837 {
18021838 //Reload(lastConverter, lastFilename, true);
18031839 ScreenFit();
18041840 } else
1805
- if (event.getSource() == screenfitpointButton)
1841
+ if (source == screenfitpointButton)
18061842 {
18071843 //Reload(lastConverter, lastFilename, true);
18081844 ScreenFitPoint();
18091845 } else
1810
- if (event.getSource() == snapobjectButton)
1846
+ if (source == snapobjectButton)
18111847 {
18121848 //Reload(lastConverter, lastFilename, true);
18131849 SnapObject();
....@@ -1818,13 +1854,13 @@
18181854 // Recompile();
18191855 // refreshContents();
18201856 // } else
1821
- if (event.getSource() == gcButton)
1857
+ if (source == gcButton)
18221858 {
18231859 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241860 System.gc();
18251861 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261862 } else
1827
- if (event.getSource() == editLeafItem)
1863
+ if (source == editLeafItem)
18281864 {
18291865 Object3D obj;
18301866 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +1874,66 @@
18381874 }
18391875 refreshContents(true);
18401876 } else
1841
- if (event.getSource() == openWindowItem)
1877
+ if (source == openWindowItem)
18421878 {
18431879 EditSelection(true);
18441880 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1881
+ if (source == cutItem || source == clearButton)
18461882 {
18471883 loadClipboard(true);
18481884 } else
1849
- if (event.getSource() == duplicateItem)
1885
+ if (source == duplicateItem)
18501886 {
1851
- Object3D keep = GraphreeD.clipboard;
1887
+ Object3D keep = GrafreeD.clipboard;
18521888 loadClipboard(false);
18531889 paste(false);
1854
- GraphreeD.clipboard = keep;
1890
+ GrafreeD.clipboard = keep;
18551891 } else
1856
- if (event.getSource() == cloneItem)
1892
+ if (source == cloneItem)
18571893 {
18581894 CloneSelection(false);
18591895 } else
1860
- if (event.getSource() == cloneSupportItem)
1896
+ if (source == cloneSupportItem)
18611897 {
18621898 CloneSelection(true);
18631899 } else
1864
- if (event.getSource() == copyItem)
1900
+ if (source == copyItem)
18651901 {
18661902 loadClipboard(false);
18671903 } else
1868
- if (event.getSource() == pasteItem)
1904
+ if (source == pasteItem)
18691905 {
18701906 paste(false);
18711907 } else
1872
- if (event.getSource() == pasteLinkItem)
1908
+ if (source == pasteLinkItem)
18731909 {
18741910 pasteInto(false);
18751911 } else
1876
- if (event.getSource() == pasteCloneItem)
1912
+ if (source == pasteCloneItem)
18771913 {
18781914 pasteInto(true);
18791915 } else
1880
- if (event.getSource() == pasteExpandItem)
1916
+ if (source == pasteExpandItem)
18811917 {
18821918 paste(true);
18831919 } else
1884
- if (event.getSource() == synchronizeItem)
1920
+ if (source == synchronizeItem)
18851921 {
18861922 Overwrite(Object3D.TRANSFORM);
18871923 } else
1888
- if (event.getSource() == overwriteNameItem)
1924
+ if (source == overwriteNameItem)
18891925 {
18901926 Overwrite(Object3D.NAME);
18911927 } else
1892
- if (event.getSource() == overwriteUVItem)
1928
+ if (source == overwriteUVItem)
18931929 {
18941930 Overwrite(Object3D.UV);
18951931 } else
1896
- if (event.getSource() == overwriteMatItem)
1932
+ if (source == overwriteMatItem)
18971933 {
1934
+ /* july 2015
18981935 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
1936
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19001937 else
19011938 {
19021939 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +1945,16 @@
19081945 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19091946 }
19101947 }
1948
+ */
1949
+
1950
+ Overwrite(dropAttributes);
19111951 }
1912
- if (event.getSource() == overwriteGeoItem)
1952
+ if (source == overwriteGeoItem)
19131953 {
19141954 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1955
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19161956 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
1957
+// Object3D content = GrafreeD.clipboard.get(0);
19181958 //
19191959 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19201960 // content = ((cGroup)content).get(0);
....@@ -1926,7 +1966,7 @@
19261966 // refreshContents();
19271967 // }
19281968 } else
1929
- if (event.getSource() == generateMeshItem)
1969
+ if (source == generateMeshItem)
19301970 {
19311971 //if (group.selection.size() == 1)
19321972 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +1977,7 @@
19371977 ResetModel();
19381978 refreshContents();
19391979 } else
1940
- if (event.getSource() == extractGeometriesItem)
1980
+ if (source == extractGeometriesItem)
19411981 {
19421982 boolean one = false;
19431983
....@@ -1964,7 +2004,7 @@
19642004 ResetModel();
19652005 refreshContents();
19662006 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2007
+ if (source == cloneGeometriesItem)
19682008 {
19692009 boolean one = false;
19702010
....@@ -1990,32 +2030,37 @@
19902030 ResetModel();
19912031 refreshContents();
19922032 } else
1993
- if (event.getSource() == shareGeometriesItem)
2033
+ if (source == shareGeometriesItem)
19942034 {
19952035 boolean one = false;
19962036
19972037 if (group.selection.size() == 1)
19982038 one = true;
19992039
2040
+ Object3D merge = null;
2041
+
20002042 Object3D content = new cGroup();
20012043
20022044 for (int i=0; i<group.selection.size(); i++)
20032045 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2046
+ merge = new Merge(group.selection.get(i));
20052047
20062048 if (one)
2007
- makeSomething(sel, false);
2049
+ makeSomething(merge, false);
20082050 else
2009
- content.addChild(sel);
2051
+ content.addChild(merge);
20102052 }
20112053
20122054 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2055
+ makeSomething(content, true);
2056
+ else
2057
+ {
2058
+ ResetModel();
2059
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2060
+ refreshContents();
2061
+ }
20172062 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2063
+ if (source == mergeGeometriesItem)
20192064 {
20202065 boolean one = false;
20212066
....@@ -2045,11 +2090,11 @@
20452090 ResetModel();
20462091 refreshContents();
20472092 } else
2048
- if (event.getSource() == linkverticesItem)
2093
+ if (source == linkverticesItem)
20492094 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2095
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512096 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2097
+// Object3D content = GrafreeD.clipboard.get(0);
20532098 //
20542099 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552100 // content = ((cGroup)content).get(0);
....@@ -2058,14 +2103,14 @@
20582103 // group.selection.get(0).setMasterThis(content); // should be identity
20592104 // refreshContents();
20602105 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2106
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20622107 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2108
+ Object3D content = GrafreeD.clipboard.get(0);
20642109
20652110 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662111 content = ((cGroup)content).get(0);
20672112
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2113
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692114 for (int i=0; i<group.selection.size(); i++)
20702115 {
20712116 boolean random = CameraPane.RANDOM;
....@@ -2074,11 +2119,11 @@
20742119 // group.selection.get(i).setMasterThis(content); // should be identity
20752120 CameraPane.RANDOM = random;
20762121 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2122
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782123 refreshContents();
20792124 }
20802125 } else
2081
- if (event.getSource() == resetsupportItem)
2126
+ if (source == resetsupportItem)
20822127 {
20832128 for (int i=0; i<group.selection.size(); i++)
20842129 {
....@@ -2090,7 +2135,16 @@
20902135
20912136 refreshContents();
20922137 } else
2093
- if (event.getSource() == resetreferencesItem)
2138
+ if (source == relinkverticesItem)
2139
+ {
2140
+ boolean random = CameraPane.RANDOM;
2141
+ CameraPane.RANDOM = false; // parse all random nodes
2142
+ group.selection.RelinkToSupport();
2143
+ CameraPane.RANDOM = random;
2144
+
2145
+ refreshContents();
2146
+ } else
2147
+ if (source == resetreferencesItem)
20942148 {
20952149 for (int i=0; i<group.selection.size(); i++)
20962150 {
....@@ -2099,11 +2153,11 @@
20992153
21002154 refreshContents();
21012155 } else
2102
- if (event.getSource() == setMasterItem)
2156
+ if (source == setMasterItem)
21032157 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2158
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21052159 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2160
+ Object3D content = GrafreeD.clipboard.get(0);
21072161
21082162 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092163 content = ((cGroup)content).get(0);
....@@ -2112,13 +2166,13 @@
21122166 refreshContents();
21132167 }
21142168 } else
2115
- if (event.getSource() == poseMeshItem)
2169
+ if (source == poseMeshItem)
21162170 {
21172171 if (group.selection.size() == 1)
21182172 {
2119
- if (GraphreeD.clipboard.size() == 1)
2173
+ if (GrafreeD.clipboard.size() == 1)
21202174 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2175
+ Object3D content = GrafreeD.clipboard.get(0);
21222176
21232177 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242178 content = ((cGroup)content).get(0);
....@@ -2131,19 +2185,19 @@
21312185 }
21322186
21332187 } else
2134
- if (event.getSource() == revertMeshItem)
2188
+ if (source == revertMeshItem)
21352189 {
21362190 RevertMeshes();
21372191 } else
2138
- if (event.getSource() == resetMeshItem)
2192
+ if (source == resetMeshItem)
21392193 {
21402194 ResetAll();
21412195 } else
2142
- if (event.getSource() == stepAllItem)
2196
+ if (source == stepAllItem)
21432197 {
21442198 StepAll();
21452199 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2200
+ if (source == clearItem) // || event.getSource() == clearButton)
21472201 {
21482202 //int indices[] = jList.getSelectedIndices();
21492203 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2205,46 @@
21512205
21522206 ClearSelection(false);
21532207 } else
2154
- if (event.getSource() == clearAllItem)
2208
+ if (source == clearAllItem)
21552209 {
21562210 ClearSelection(true);
21572211 } else
2158
- if (event.getSource() == grabItem)
2212
+ if (source == grabItem)
21592213 {
21602214 group(new cGroup(), true);
21612215 } else
2162
- if (event.getSource() == frontItem)
2216
+ if (source == hideItem)
2217
+ {
2218
+ group(new HiddenObject());
2219
+ } else
2220
+ if (source == frontItem)
21632221 {
21642222 front();
21652223 } else
2166
- if (event.getSource() == backItem)
2224
+ if (source == backItem)
21672225 {
21682226 back();
21692227 } else
2170
- if (event.getSource() == cameraItem)
2228
+ if (source == cameraItem)
21712229 {
21722230 makeSomething(new Camera());
21732231 } else
2174
- if (event.getSource() == compositeItem)
2232
+ if (source == compositeItem)
21752233 {
21762234 group(new Composite());
21772235 } else
2178
- if (event.getSource() == randomItem)
2236
+ if (source == randomItem)
21792237 {
21802238 RandomNode random = new RandomNode();
21812239 group(random);
21822240 if (random.size() > 0)
21832241 random.name = random.get(0).name + "Rnd";
21842242 } else
2185
- if (event.getSource() == physicsItem)
2243
+ if (source == physicsItem)
21862244 {
21872245 group(new PhysicsNode());
21882246 } else
2189
- if (event.getSource() == frameselectorItem)
2247
+ if (source == frameselectorItem)
21902248 {
21912249 for (int i=0; i<group.selection.size(); i++)
21922250 {
....@@ -2198,7 +2256,7 @@
21982256 ResetModel();
21992257 refreshContents();
22002258 } else
2201
- if (event.getSource() == switchGeoItem)
2259
+ if (source == switchGeoItem)
22022260 {
22032261 for (int i=0; i<group.selection.size(); i++)
22042262 {
....@@ -2210,7 +2268,7 @@
22102268 ResetModel();
22112269 refreshContents();
22122270 } else
2213
- if (event.getSource() == switchTransfoItem)
2271
+ if (source == switchTransfoItem)
22142272 {
22152273 for (int i=0; i<group.selection.size(); i++)
22162274 {
....@@ -2222,7 +2280,7 @@
22222280 ResetModel();
22232281 refreshContents();
22242282 } else
2225
- if (event.getSource() == morphItem)
2283
+ if (source == morphItem)
22262284 {
22272285 for (int i=0; i<group.selection.size(); i++)
22282286 {
....@@ -2234,7 +2292,7 @@
22342292 ResetModel();
22352293 refreshContents();
22362294 } else
2237
- if (event.getSource() == scriptNodeItem)
2295
+ if (source == scriptNodeItem)
22382296 {
22392297 boolean atleastone = false;
22402298
....@@ -2273,195 +2331,215 @@
22732331 }
22742332 }
22752333 } else
2276
- if (event.getSource() == linkerItem)
2334
+ if (source == linkerItem)
22772335 {
22782336 group(new cLinker());
22792337 } else
2280
- if (event.getSource() == textureItem)
2338
+ if (source == textureItem)
22812339 {
22822340 group(new TextureNode());
22832341 } else
2284
- if (event.getSource() == shadowXItem)
2342
+ if (source == billboardItem)
2343
+ {
2344
+ group(new BillboardNode());
2345
+ } else
2346
+ if (source == shadowXItem)
22852347 {
22862348 CastShadow(0);
22872349 } else
2288
- if (event.getSource() == shadowYItem)
2350
+ if (source == shadowYItem)
22892351 {
22902352 CastShadow(1);
22912353 } else
2292
- if (event.getSource() == shadowZItem)
2354
+ if (source == shadowZItem)
22932355 {
22942356 CastShadow(2);
22952357 } else
2296
- if (event.getSource() == ungroupItem)
2358
+ if (source == ungroupItem)
22972359 {
2298
- ungroup();
2360
+ //ungroup();
2361
+ for (int i=0; i<group.selection.size(); i++)
2362
+ {
2363
+ Ungroup(group.selection.get(i));
2364
+ }
2365
+
2366
+ ClearSelection(false);
2367
+
2368
+ refreshContents();
22992369 } else
2300
- if (event.getSource() == genUVItem)
2370
+ if (source == genUVItem)
23012371 {
23022372 GenUV();
23032373 } else
2304
- if (event.getSource() == genNormalsCADItem)
2374
+ if (source == genNormalsCADItem)
23052375 {
23062376 GenNormals(true);
23072377 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2378
+ if (source == genNormalsMESHItem)
2379
+ {
2380
+ GenNormals(true); // TODO
2381
+ } else
2382
+ if (source == genNormalsORGANItem)
23092383 {
23102384 GenNormals(false);
23112385 } else
2312
- if (event.getSource() == stripifyItem)
2386
+ if (source == genNormalsMINEItem)
2387
+ {
2388
+ GenNormalsMINE();
2389
+ } else
2390
+ if (source == stripifyItem)
23132391 {
23142392 Stripify();
23152393 } else
2316
- if (event.getSource() == unstripifyItem)
2394
+ if (source == unstripifyItem)
23172395 {
23182396 Unstripify();
23192397 } else
2320
- if (event.getSource() == trimItem)
2398
+ if (source == trimItem)
23212399 {
23222400 Trim();
23232401 } else
2324
- if (event.getSource() == untrimItem)
2402
+ if (source == untrimItem)
23252403 {
23262404 Untrim();
23272405 } else
2328
- if (event.getSource() == clearColorsItem)
2406
+ if (source == clearColorsItem)
23292407 {
23302408 ClearColors();
23312409 } else
2332
- if (event.getSource() == clearMaterialsItem)
2410
+ if (source == clearMaterialsItem)
23332411 {
23342412 ClearMaterials();
23352413 } else
2336
- if (event.getSource() == liveleavesItem)
2414
+ if (source == liveleavesItem)
23372415 {
23382416 LiveLeaves(true);
23392417 } else
2340
- if (event.getSource() == unliveleavesItem)
2418
+ if (source == unliveleavesItem)
23412419 {
23422420 LiveLeaves(false);
23432421 } else
2344
- if (event.getSource() == supportleavesItem)
2422
+ if (source == supportleavesItem)
23452423 {
23462424 SupportLeaves(true);
23472425 } else
2348
- if (event.getSource() == unsupportleavesItem)
2426
+ if (source == unsupportleavesItem)
23492427 {
23502428 SupportLeaves(false);
23512429 } else
2352
- if (event.getSource() == hideleavesItem)
2430
+ if (source == hideleavesItem)
23532431 {
23542432 HideLeaves(true);
23552433 } else
2356
- if (event.getSource() == showleavesItem)
2434
+ if (source == showleavesItem)
23572435 {
23582436 HideLeaves(false);
23592437 } else
2360
- if (event.getSource() == markleavesItem)
2438
+ if (source == markleavesItem)
23612439 {
23622440 MarkLeaves(true);
23632441 } else
2364
- if (event.getSource() == unmarkleavesItem)
2442
+ if (source == unmarkleavesItem)
23652443 {
23662444 MarkLeaves(false);
23672445 } else
2368
- if (event.getSource() == flipVItem)
2446
+ if (source == flipVItem)
23692447 {
23702448 FlipV(true);
23712449 } else
2372
- if (event.getSource() == unflipVItem)
2450
+ if (source == unflipVItem)
23732451 {
23742452 FlipV(false);
23752453 } else
2376
- if (event.getSource() == lowTexturesItem)
2454
+ if (source == lowTexturesItem)
23772455 {
23782456 SetTexRes(0);
23792457 } else
2380
- if (event.getSource() == normalTexturesItem)
2458
+ if (source == normalTexturesItem)
23812459 {
23822460 SetTexRes(1);
23832461 } else
2384
- if (event.getSource() == highTexturesItem)
2462
+ if (source == highTexturesItem)
23852463 {
23862464 SetTexRes(2);
23872465 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2466
+ if (source == veryhighTexturesItem)
23892467 {
23902468 SetTexRes(3);
23912469 } else
2392
- if (event.getSource() == maxTexturesItem)
2470
+ if (source == maxTexturesItem)
23932471 {
23942472 SetTexRes(4);
23952473 } else
2396
- if (event.getSource() == panoTexturesItem)
2474
+ if (source == panoTexturesItem)
23972475 {
23982476 SetTexRes(5);
23992477 } else
2400
- if (event.getSource() == reverseNormalsItem)
2478
+ if (source == reverseNormalsItem)
24012479 {
24022480 ReverseNormals();
24032481 } else
2404
- if (event.getSource() == parseverticesItem)
2482
+ if (source == parseverticesItem)
24052483 {
24062484 ParseVertices();
24072485 } else
2408
- if (event.getSource() == textureFieldItem)
2486
+ if (source == textureFieldItem)
24092487 {
24102488 TextureVertices();
24112489 } else
2412
- if (event.getSource() == alignItem)
2490
+ if (source == alignItem)
24132491 {
24142492 Align();
24152493 } else
2416
- if (event.getSource() == mirrorItem)
2494
+ if (source == mirrorItem)
24172495 {
24182496 MirrorPoses();
24192497 } else
2420
- if (event.getSource() == reduceMorphItem)
2498
+ if (source == reduceMorphItem)
24212499 {
24222500 MeshReduction(false);
24232501 } else
2424
- if (event.getSource() == reduce34MorphItem)
2502
+ if (source == reduce34MorphItem)
24252503 {
24262504 MeshReduction(true);
24272505 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2506
+ if (source == reverseTrianglesItem)
24292507 {
24302508 ReverseTriangles();
24312509 } else
2432
- if (event.getSource() == reduceMeshItem)
2510
+ if (source == reduceMeshItem)
24332511 {
24342512 ReduceMesh(false);
24352513 } else
2436
- if (event.getSource() == reduce34MeshItem)
2514
+ if (source == reduce34MeshItem)
24372515 {
24382516 ReduceMesh(true);
24392517 } else
2440
- if (event.getSource() == increaseMeshItem)
2518
+ if (source == increaseMeshItem)
24412519 {
24422520 IncreaseMesh();
24432521 } else
2444
- if (event.getSource() == clipMeshItem)
2522
+ if (source == clipMeshItem)
24452523 {
24462524 ClipMesh();
24472525 } else
2448
- if (event.getSource() == smoothMeshItem)
2526
+ if (source == smoothMeshItem)
24492527 {
24502528 SmoothMesh();
24512529 } else
2452
- if (event.getSource() == transformgeometryItem)
2530
+ if (source == transformgeometryItem)
24532531 {
24542532 TransformGeometry();
24552533 } else
2456
- if (event.getSource() == resetTransformItem)
2534
+ if (source == resetTransformItem)
24572535 {
24582536 ResetTransform();
24592537 } else
2460
- if (event.getSource() == resetCentroidItem)
2538
+ if (source == resetCentroidItem)
24612539 {
24622540 ResetCentroid();
24632541 } else
2464
- if (event.getSource() == resetParentItem)
2542
+ if (source == resetParentItem)
24652543 {
24662544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672545 {
....@@ -2471,7 +2549,7 @@
24712549
24722550 refreshContents();
24732551 } else
2474
- if (event.getSource() == repairParentItem)
2552
+ if (source == repairParentItem)
24752553 {
24762554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772555 {
....@@ -2485,7 +2563,21 @@
24852563
24862564 refreshContents();
24872565 } else
2488
- if (event.getSource() == sortbysizeItem)
2566
+ if (source == repairShadowItem)
2567
+ {
2568
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2569
+ {
2570
+ Object3D obj = (Object3D)e.nextElement();
2571
+ obj.RepairShadow();
2572
+// for (int i=0; i<obj.size(); i++)
2573
+// {
2574
+// obj.get(i).parent = obj;
2575
+// }
2576
+ }
2577
+
2578
+ refreshContents();
2579
+ } else
2580
+ if (source == sortbysizeItem)
24892581 {
24902582 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912583 {
....@@ -2497,7 +2589,7 @@
24972589 ResetModel();
24982590 refreshContents();
24992591 } else
2500
- if (event.getSource() == sortbynameItem)
2592
+ if (source == sortbynameItem)
25012593 {
25022594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032595 {
....@@ -2509,7 +2601,7 @@
25092601 ResetModel();
25102602 refreshContents();
25112603 } else
2512
- if (event.getSource() == attachPigmentItem)
2604
+ if (source == attachPigmentItem)
25132605 {
25142606 String texture = GetFile("Attach pigment");
25152607 Object3D obj;
....@@ -2521,7 +2613,7 @@
25212613
25222614 refreshContents();
25232615 } else
2524
- if (event.getSource() == detachPigmentItem)
2616
+ if (source == detachPigmentItem)
25252617 {
25262618 Object3D obj;
25272619 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2624,7 @@
25322624
25332625 refreshContents();
25342626 } else
2535
- if (event.getSource() == attachBumpItem)
2627
+ if (source == attachBumpItem)
25362628 {
25372629 String texture = GetFile("Attach bump");
25382630 Object3D obj;
....@@ -2544,7 +2636,7 @@
25442636
25452637 refreshContents();
25462638 } else
2547
- if (event.getSource() == detachBumpItem)
2639
+ if (source == detachBumpItem)
25482640 {
25492641 Object3D obj;
25502642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2647,7 @@
25552647
25562648 refreshContents();
25572649 } else
2558
- if (event.getSource() == pigmentBumpItem)
2650
+ if (source == pigmentBumpItem)
25592651 {
25602652 Object3D obj;
25612653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2658,195 @@
25662658
25672659 refreshContents();
25682660 } else
2569
- if (event.getSource() == flashSelectionButton)
2661
+ if (source == flashSelectionButton)
25702662 {
25712663 CameraPane.flash = true;
25722664 refreshContents();
25732665 } else
2574
- if (event.getSource() == oneButton)
2666
+ if (source == oneButton)
25752667 {
25762668 } else
2577
- if (event.getSource() == twoButton)
2669
+ if (source == twoButton)
25782670 {
25792671 radio.layout = twoButton;
25802672 // bug
25812673 //gridPanel.setDividerLocation(1.0);
25822674 //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();
2675
+// bigThree.remove(scenePanel);
2676
+// bigThree.remove(centralPanel);
2677
+// bigThree.remove(XYZPanel);
2678
+// aWindowConstraints.gridx = 0;
2679
+// aWindowConstraints.gridy = 0;
2680
+// aWindowConstraints.gridwidth = 1;
2681
+// // aConstraints.gridheight = 3;
2682
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2683
+// aWindowConstraints.weightx = 0;
2684
+// aWindowConstraints.weighty = 1;
2685
+// //bigThree.add(jtp, aWindowConstraints);
2686
+// aWindowConstraints.weightx = 1;
2687
+// aWindowConstraints.gridwidth = 3;
2688
+// // aConstraints.gridheight = 3;
2689
+// aWindowConstraints.gridx = 1;
2690
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2691
+// bigThree.add(centralPanel, aWindowConstraints);
2692
+// aWindowConstraints.weightx = 0;
2693
+// aWindowConstraints.gridx = 4;
2694
+// aWindowConstraints.gridwidth = 1;
2695
+// // aConstraints.gridheight = 3;
2696
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2697
+// //bigThree.add(XYZPanel, aWindowConstraints);
2698
+// scenePanel.setVisible(false);
2699
+// centralPanel.setVisible(true);
2700
+// XYZPanel.setVisible(false);
2701
+ bigThree.ClearUI();
2702
+ bigThree.add(centralPanel);
2703
+ bigThree.FlushUI();
26072704 } else
2608
- if (event.getSource() == threeButton)
2705
+ if (source == threeButton)
26092706 {
26102707 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();
2708
+
2709
+// bigThree.remove(scenePanel);
2710
+// bigThree.remove(centralPanel);
2711
+// bigThree.remove(XYZPanel);
2712
+// aWindowConstraints.gridx = 0;
2713
+// aWindowConstraints.gridy = 0;
2714
+// aWindowConstraints.gridwidth = 1;
2715
+// // aConstraints.gridheight = 3;
2716
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
+// aWindowConstraints.weightx = 0;
2718
+// aWindowConstraints.weighty = 1;
2719
+// //bigThree.add(jtp, aWindowConstraints);
2720
+// aWindowConstraints.weightx = 1;
2721
+// aWindowConstraints.gridwidth = 3;
2722
+// // aConstraints.gridheight = 3;
2723
+// aWindowConstraints.gridx = 1;
2724
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2725
+// bigThree.add(centralPanel, aWindowConstraints);
2726
+// aWindowConstraints.weightx = 0;
2727
+// aWindowConstraints.gridx = 4;
2728
+// aWindowConstraints.gridwidth = 1;
2729
+// // aConstraints.gridheight = 3;
2730
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2731
+// bigThree.add(XYZPanel, aWindowConstraints);
2732
+// bigThree.validate();
2733
+// scenePanel.setVisible(false);
2734
+// centralPanel.setVisible(true);
2735
+// XYZPanel.setVisible(true);
2736
+ bigThree.ClearUI();
2737
+ bigThree.add(centralPanel);
2738
+ bigThree.add(XYZPanel);
2739
+ bigThree.FlushUI();
26352740 } else
2636
- if (event.getSource() == fourButton)
2741
+ if (source == fourButton)
26372742 {
26382743 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();
2744
+
2745
+// bigThree.remove(scenePanel);
2746
+// bigThree.remove(centralPanel);
2747
+// bigThree.remove(XYZPanel);
2748
+// aWindowConstraints.gridx = 0;
2749
+// aWindowConstraints.gridy = 0;
2750
+// aWindowConstraints.gridwidth = 1;
2751
+// // aWindowConstraints.gridheight = 3;
2752
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.weighty = 1;
2755
+// bigThree.add(scenePanel, aWindowConstraints);
2756
+// aWindowConstraints.weightx = 1;
2757
+// aWindowConstraints.gridwidth = 3;
2758
+// // aConstraints.gridheight = 3;
2759
+// aWindowConstraints.gridx = 1;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// //bigThree.add(cameraPanel, aWindowConstraints);
2762
+// aWindowConstraints.weightx = 0;
2763
+// aWindowConstraints.gridx = 4;
2764
+// aWindowConstraints.gridwidth = 1;
2765
+// // aWindowConstraints.gridheight = 3;
2766
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2767
+// //bigThree.add(XYZPanel, aWindowConstraints);
2768
+// bigThree.validate();
2769
+// scenePanel.setVisible(true);
2770
+// centralPanel.setVisible(false);
2771
+// XYZPanel.setVisible(false);
2772
+ bigThree.ClearUI();
2773
+ bigThree.add(scenePanel);
2774
+ bigThree.FlushUI();
26632775 } else
2664
- if (event.getSource() == sixButton)
2776
+ if (source == sixButton)
26652777 {
26662778 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();
2779
+
2780
+// bigThree.remove(scenePanel);
2781
+// bigThree.remove(centralPanel);
2782
+// bigThree.remove(XYZPanel);
2783
+// aWindowConstraints.gridx = 0;
2784
+// aWindowConstraints.gridy = 0;
2785
+// aWindowConstraints.gridwidth = 1;
2786
+// // aConstraints.gridheight = 3;
2787
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2788
+// aWindowConstraints.weightx = 0;
2789
+// aWindowConstraints.weighty = 1;
2790
+// bigThree.add(scenePanel, aWindowConstraints);
2791
+// aWindowConstraints.weightx = 1;
2792
+// aWindowConstraints.gridwidth = 3;
2793
+// // aWindowConstraints.gridheight = 3;
2794
+// aWindowConstraints.gridx = 1;
2795
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2796
+// bigThree.add(centralPanel, aWindowConstraints);
2797
+// aWindowConstraints.weightx = 0;
2798
+// aWindowConstraints.gridx = 4;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aWindowConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// //bigThree.add(XYZPanel, aConstraints);
2803
+// bigThree.validate();
2804
+// scenePanel.setVisible(true);
2805
+// centralPanel.setVisible(true);
2806
+// XYZPanel.setVisible(false);
2807
+ bigThree.ClearUI();
2808
+ bigThree.add(scenePanel);
2809
+ bigThree.add(centralPanel);
2810
+ bigThree.FlushUI();
26912811 } else
2692
- if (event.getSource() == sevenButton)
2812
+ if (source == sevenButton)
26932813 {
26942814 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();
2815
+
2816
+// bigThree.remove(scenePanel);
2817
+// bigThree.remove(centralPanel);
2818
+// bigThree.remove(XYZPanel);
2819
+// aWindowConstraints.gridx = 0;
2820
+// aWindowConstraints.gridy = 0;
2821
+// aWindowConstraints.gridwidth = 1;
2822
+// // aWindowConstraints.gridheight = 3;
2823
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2824
+// aWindowConstraints.weightx = 0;
2825
+// aWindowConstraints.weighty = 1;
2826
+// bigThree.add(scenePanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.gridwidth = 3;
2829
+// // aWindowConstraints.gridheight = 3;
2830
+// aWindowConstraints.gridx = 1;
2831
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2832
+// bigThree.add(centralPanel, aWindowConstraints);
2833
+// aWindowConstraints.weightx = 0;
2834
+// aWindowConstraints.gridx = 4;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2838
+// bigThree.add(XYZPanel, aWindowConstraints);
2839
+// bigThree.validate();
2840
+// scenePanel.setVisible(true);
2841
+// centralPanel.setVisible(true);
2842
+// XYZPanel.setVisible(true);
2843
+ bigThree.ClearUI();
2844
+ bigThree.add(scenePanel);
2845
+ bigThree.add(centralPanel);
2846
+ bigThree.add(XYZPanel);
2847
+ bigThree.FlushUI();
27192848 } else
2720
- if (event.getSource() == rootButton)
2849
+ if (source == rootButton)
27212850 {
27222851 Object3D obj;
27232852 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +2858,7 @@
27292858
27302859 refreshContents(true);
27312860 } else
2732
- if (event.getSource() == closeButton)
2861
+ if (source == closeButton)
27332862 {
27342863 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27352864 cRadio ab;
....@@ -2750,11 +2879,11 @@
27502879 }
27512880 refreshContents(true);
27522881 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
2882
+ if (source == editItem || source == editButton)
27542883 {
27552884 EditSelection(false);
27562885 } else
2757
- if (event.getSource() == uneditButton)
2886
+ if (source == uneditButton)
27582887 {
27592888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27602889 {
....@@ -2766,12 +2895,12 @@
27662895
27672896 child.editWindow = null; // ???????????
27682897 }
2769
- objEditor.ctrlPanel.revalidate();
2898
+ objEditor.ctrlPanel.validate();
27702899 //objEditor.jTree.clearSelection();
27712900 //objEditor.ResetSliders();
27722901 refreshContents(true);
27732902 } else
2774
- if (event.getSource() == clearPanelButton)
2903
+ if (source == clearPanelButton)
27752904 {
27762905 assert(copy == group);
27772906 //copy.ClearUI();
....@@ -2782,7 +2911,7 @@
27822911 listUI.clear();
27832912 refreshContents(true);
27842913 } else
2785
- if (event.getSource() == allParamsButton)
2914
+ if (source == allParamsButton)
27862915 {
27872916 assert(copy == group);
27882917
....@@ -2803,19 +2932,19 @@
28032932
28042933 refreshContents(true);
28052934 } else
2806
- if (event.getSource() == unselectButton)
2935
+ if (source == unselectButton)
28072936 {
28082937 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
2938
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28102939 objEditor.ResetSliders();
28112940 refreshContents(true);
28122941 } else
2813
- if(event.getSource() instanceof cRadio)
2942
+ if(source instanceof cRadio)
28142943 {
28152944 group.parent = keepparent;
28162945 group.attributes = 0;
28172946 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
2947
+ /*cRadio*/ radio = (cRadio)source;
28192948 Object3D obj = radio.GetObject();
28202949 System.out.println("Edit " + obj);
28212950 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +2964,7 @@
28352964 }
28362965
28372966 copy = group;
2838
- //CameraPane.theRenderer.object = group;
2967
+ //Globals.theRenderer.object = group;
28392968 if(!useclient)
28402969 {
28412970 cameraView.renderCamera = radio.camera;
....@@ -2844,7 +2973,8 @@
28442973 cameraView.cameras[cameraView.cameracount] = radio.camera;
28452974 cameraView.targetLookAt.set(radio.camera.lookAt);
28462975 cameraView.object = group;
2847
- cameraView.lighttouched = true;
2976
+ //cameraView.lighttouched = true;
2977
+ Globals.lighttouched = true;
28482978 topView.object = group;
28492979 frontView.object = group;
28502980 sideView.object = group;
....@@ -2880,7 +3010,7 @@
28803010 if (useclient)
28813011 {
28823012 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3013
+ Globals.lighttouched = true;
28843014 //topView.object = client;
28853015 //frontView.object = client;
28863016 //sideView.object = client;
....@@ -2888,7 +3018,7 @@
28883018 else
28893019 {
28903020 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
28923022 //topView.object = group;
28933023 //frontView.object = group;
28943024 //sideView.object = group;
....@@ -3121,9 +3251,9 @@
31213251 obj = (Object3D)e.nextElement();
31223252
31233253 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3254
+ GrafreeD.AnalyzeObject(obj);
31253255 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3256
+ GrafreeD.AnalyzeObject(obj.bRep);
31273257
31283258 // System.err.println((size/1024) + " KB is the size of " + obj);
31293259 }
....@@ -3165,6 +3295,13 @@
31653295 void GenNormals(boolean crease)
31663296 {
31673297 group.GenNormalsS(crease);
3298
+
3299
+ refreshContents();
3300
+ }
3301
+
3302
+ void GenNormalsMINE()
3303
+ {
3304
+ group.selection.GenNormalsMINE();
31683305
31693306 refreshContents();
31703307 }
....@@ -3250,7 +3387,7 @@
32503387 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513388 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523389 //
3253
-// g.add(GraphreeD.clipboard);
3390
+// g.add(GrafreeD.clipboard);
32543391 //
32553392 // buffer.add(g);
32563393 // }
....@@ -3269,8 +3406,8 @@
32693406 // nodes = new Object3D();
32703407 // vertices = new Vector<Vertex>();
32713408 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3409
+// boolean epsequal = GrafreeD.epsequal;
3410
+// GrafreeD.epsequal = true;
32743411 //
32753412 // for (int i=0; i<group.selection.size(); i++)
32763413 // {
....@@ -3311,7 +3448,7 @@
33113448 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123449 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133450 //
3314
-// g.add(GraphreeD.clipboard);
3451
+// g.add(GrafreeD.clipboard);
33153452 //
33163453 // buffer.add(g);
33173454 // }
....@@ -3319,7 +3456,7 @@
33193456 // makeSomething(buffer, i==group.selection.size()-1);
33203457 // }
33213458 //
3322
-// GraphreeD.epsequal = epsequal;
3459
+// GrafreeD.epsequal = epsequal;
33233460 //
33243461 // //buffer = null;
33253462 // temprep = null;
....@@ -3330,8 +3467,8 @@
33303467
33313468 void ParseVertices()
33323469 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3470
+ boolean epsequal = GrafreeD.epsequal;
3471
+ GrafreeD.epsequal = true;
33353472
33363473 for (int i=0; i<group.selection.size(); i++)
33373474 {
....@@ -3356,7 +3493,7 @@
33563493 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573494 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583495
3359
- g.add(GraphreeD.clipboard);
3496
+ g.add(GrafreeD.clipboard);
33603497
33613498 buffer.add(g);
33623499 }
....@@ -3371,7 +3508,7 @@
33713508 makeSomething(buffer, i==group.selection.size()-1);
33723509 }
33733510
3374
- GraphreeD.epsequal = epsequal;
3511
+ GrafreeD.epsequal = epsequal;
33753512
33763513 refreshContents();
33773514 }
....@@ -3389,7 +3526,7 @@
33893526 String pigment = Object3D.GetPigment(tex);
33903527 //String bump = Object3D.GetBump(tex);
33913528
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3529
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33933530
33943531 double s = v.s;
33953532
....@@ -3416,7 +3553,7 @@
34163553 scale /= 3;
34173554
34183555 scale /= 0xFF;
3419
- scale /= 4;
3556
+ // c'est quoi ca? scale /= 4;
34203557
34213558 //v.AO = scale;
34223559
....@@ -3437,12 +3574,26 @@
34373574
34383575 void Align()
34393576 {
3577
+ if (group.selection.size() == 0)
3578
+ return;
3579
+
3580
+ cVector bbmin = new cVector();
3581
+ cVector bbmax = new cVector();
3582
+
3583
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3584
+
3585
+ double dx = bbmax.x - bbmin.x;
3586
+ double dy = bbmax.y - bbmin.y;
3587
+ double dz = bbmax.z - bbmin.z;
3588
+
3589
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3590
+
34403591 for (int i=0; i<group.selection.size(); i++)
34413592 {
34423593 Object3D obj = group.selection.get(i);
34433594
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3595
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3596
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463597 }
34473598
34483599 refreshContents();
....@@ -3455,7 +3606,7 @@
34553606 // ref.SaveSupports();
34563607 // Object3D par = ref.parent;
34573608 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3609
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593610 // ref.parent = par;
34603611 // ref.RestoreSupports();
34613612
....@@ -3485,7 +3636,7 @@
34853636 // lowres.SaveSupports();
34863637 // par = lowres.parent;
34873638 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3639
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893640 Object3D newlow = CloneObject(lowres, false);
34903641 newlow.name = sn.switchobject.get(i).name;
34913642 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3658,7 @@
35073658 return;
35083659
35093660 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3661
+ Object3D ref = GrafreeD.clipboard.get(0);
35113662
35123663 Object3D newgroup = new Object3D("Po:" + poses.name);
35133664
....@@ -3676,7 +3827,7 @@
36763827 group.selection.RelinkToSupport(); // july 2014
36773828 System.out.println("DONE.");
36783829 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3830
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36803831 }
36813832
36823833 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +3852,20 @@
37013852
37023853 void ClipMesh()
37033854 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3855
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
37053856 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
3857
+ Object3D content = GrafreeD.clipboard.get(0);
37073858
37083859 if (content instanceof cGroup && ((cGroup)content).transientlink )
37093860 content = ((cGroup)content).get(0);
37103861
37113862 // for (int i=0; i<group.selection.size(); i++)
37123863 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3864
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37143865 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
3866
+ group.selection.ClipMesh(GrafreeD.clipboard);
37163867 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
3868
+// group.selection.ClipMesh(GrafreeD.clipboard);
37183869 System.out.println("DONE.");
37193870 refreshContents();
37203871 }
....@@ -3952,25 +4103,25 @@
39524103 System.err.println("info : " + child.GetPath());
39534104 }
39544105 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4106
+// else
4107
+// {
4108
+// objEditor.SetMaterial(group); // .GetMaterial());
4109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4110
+// System.err.println("info : " + group.GetPath());
4111
+// }
39614112
39624113 objEditor.SetText(); // jan 2014
39634114
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4115
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39654116 CameraPane.flash = true;
39664117
39674118 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39684119 // a camera
39694120 {
39704121 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;
4122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4123
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4124
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744125 }
39754126
39764127 refreshContents();
....@@ -4052,12 +4203,12 @@
40524203 {
40534204 if (group.selection.isEmpty())
40544205 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4206
+ GrafreeD.clipboardIsTempGroup = false;
40564207 Composite tGroup = null;
40574208 if (group.selection.size() > 0) // 1)
40584209 {
40594210 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4211
+ GrafreeD.clipboardIsTempGroup = true;
40614212 }
40624213
40634214 if (cut)
....@@ -4097,16 +4248,16 @@
40974248 //System.out.println("cut " + child);
40984249 //System.out.println("parent = " + child.parent);
40994250 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4251
+ if (GrafreeD.clipboardIsTempGroup)
41014252 tGroup.add/*Child*/(tmp);
41024253 else
4103
- GraphreeD.clipboard = tmp;
4254
+ GrafreeD.clipboard = tmp;
41044255 }
41054256 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4257
+ if (GrafreeD.clipboardIsTempGroup)
41074258 tGroup.add/*Child*/(child);
41084259 else
4109
- GraphreeD.clipboard = child;
4260
+ GrafreeD.clipboard = child;
41104261 }
41114262
41124263 //ResetModel();
....@@ -4138,21 +4289,21 @@
41384289 //System.out.println("cut " + elem);
41394290 //System.out.println("parent = " + elem.parent);
41404291 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4292
+ if (GrafreeD.clipboardIsTempGroup)
41424293 tGroup.add/*Child*/(tmp);
41434294 else
4144
- GraphreeD.clipboard = tmp;
4295
+ GrafreeD.clipboard = tmp;
41454296 }
41464297 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4298
+ if (GrafreeD.clipboardIsTempGroup)
41484299 tGroup.add/*Child*/(child);
41494300 else
4150
- GraphreeD.clipboard = child;
4301
+ GrafreeD.clipboard = child;
41514302 }
41524303
41534304 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4305
+ if (GrafreeD.clipboardIsTempGroup)
4306
+ GrafreeD.clipboard = tGroup;
41564307 if (cut)
41574308 {
41584309 ResetModel();
....@@ -4162,11 +4313,11 @@
41624313
41634314 void paste(boolean expand)
41644315 {
4165
- // if (GraphreeD.clipboard == null)
4316
+ // if (GrafreeD.clipboard == null)
41664317 // return;
41674318 boolean first = true;
41684319
4169
- if (GraphreeD.clipboardIsTempGroup)
4320
+ if (GrafreeD.clipboardIsTempGroup)
41704321 {
41714322 Composite temp;
41724323
....@@ -4177,7 +4328,7 @@
41774328 temp = (Composite)Applet3D.clipboard.deepCopy();
41784329 */
41794330 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4331
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814332 {
41824333 Object3D child = (Object3D)e.nextElement();
41834334
....@@ -4191,7 +4342,7 @@
41914342 else
41924343 elem = child.deepCopy(); // ?
41934344 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4345
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954346 // elem = elem.get(0);
41964347 makeSomething(elem, true); // ?? first);
41974348 //group.addChild(elem);
....@@ -4211,14 +4362,14 @@
42114362 //Object3D cb = Applet3D.clipboard;
42124363 //temp.addChild(cb);
42134364 //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());
4365
+ assert(GrafreeD.clipboard.parent == null);
4366
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4367
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4368
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4369
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
42194370 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4371
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4372
+ GrafreeD.clipboard.get(0).parent = keepparent;
42224373 }
42234374
42244375 ResetModel();
....@@ -4227,7 +4378,7 @@
42274378
42284379 void pasteInto(boolean copyit)
42294380 {
4230
-// if (GraphreeD.clipboard == null)
4381
+// if (GrafreeD.clipboard == null)
42314382 // return;
42324383
42334384 if (group.selection.size() != 1)
....@@ -4260,9 +4411,9 @@
42604411 {
42614412 boolean first = true;
42624413
4263
- if (GraphreeD.clipboardIsTempGroup)
4414
+ if (GrafreeD.clipboardIsTempGroup)
42644415 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4416
+ Composite temp = (Composite)GrafreeD.clipboard;
42664417 Object3D copy;
42674418 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684419 {
....@@ -4272,7 +4423,7 @@
42724423 }
42734424 } else
42744425 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4426
+ linkSomething(GrafreeD.clipboard); //.get(0));
42764427 }
42774428 }
42784429 }
....@@ -4464,6 +4615,26 @@
44644615 makeSomething(csg);
44654616 }
44664617
4618
+ void Ungroup(Object3D g)
4619
+ {
4620
+ if (g instanceof HiddenObject)
4621
+ {
4622
+ HiddenObject h = (HiddenObject) g;
4623
+
4624
+ for (int i=0; i<h.ActualSize(); i++)
4625
+ {
4626
+ objEditor.makeSomething(h.get(i), false);
4627
+ }
4628
+ }
4629
+ else
4630
+ {
4631
+ for (int i=0; i<g.Size(); i++)
4632
+ {
4633
+ objEditor.makeSomething(g.get(i), false);
4634
+ }
4635
+ }
4636
+ }
4637
+
44674638 void ungroup()
44684639 {
44694640 /*
....@@ -4659,7 +4830,7 @@
46594830
46604831 void ImportGFD()
46614832 {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4833
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
46634834 browser.show();
46644835 String filename = browser.getFile();
46654836 if (filename != null && filename.length() > 0)
....@@ -4697,7 +4868,7 @@
46974868
46984869 void ImportVRMLX3D()
46994870 {
4700
- if (GraphreeD.standAlone)
4871
+ if (GrafreeD.standAlone)
47014872 {
47024873 /**/
47034874 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4714,7 +4885,7 @@
47144885
47154886 String GetFile(String dialogName)
47164887 {
4717
- if (GraphreeD.standAlone)
4888
+ if (GrafreeD.standAlone)
47184889 {
47194890 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47204891 browser.show();
....@@ -4823,6 +4994,7 @@
48234994 private MenuItem resetsupportItem;
48244995 private MenuItem resetreferencesItem;
48254996 private MenuItem linkverticesItem;
4997
+ private MenuItem relinkverticesItem;
48264998 private MenuItem setMasterItem;
48274999 private MenuItem resetMeshItem;
48285000 private MenuItem stepAllItem;
....@@ -4841,8 +5013,10 @@
48415013 private MenuItem clearItem;
48425014 private MenuItem clearAllItem;
48435015 private MenuItem genUVItem;
5016
+ private MenuItem genNormalsMESHItem;
48445017 private MenuItem genNormalsCADItem;
48455018 private MenuItem genNormalsORGANItem;
5019
+ private MenuItem genNormalsMINEItem;
48465020 private MenuItem stripifyItem;
48475021 private MenuItem unstripifyItem;
48485022 private MenuItem trimItem;
....@@ -4884,6 +5058,7 @@
48845058 private MenuItem resetCentroidItem;
48855059 private MenuItem transformgeometryItem;
48865060 private MenuItem resetTransformItem;
5061
+ private MenuItem hideItem;
48875062 private MenuItem grabItem;
48885063 private MenuItem backItem;
48895064 private MenuItem frontItem;
....@@ -4904,6 +5079,7 @@
49045079
49055080 private MenuItem resetParentItem;
49065081 private MenuItem repairParentItem;
5082
+ private MenuItem repairShadowItem;
49075083 private MenuItem sortbysizeItem;
49085084 private MenuItem sortbynameItem;
49095085
....@@ -4924,6 +5100,7 @@
49245100 private MenuItem coneItem;
49255101 private MenuItem torusItem;
49265102 private MenuItem superItem;
5103
+ private MenuItem kleinItem;
49275104 private MenuItem blobItem;
49285105 private MenuItem latheItem;
49295106 private MenuItem bezierItem;
....@@ -4936,6 +5113,7 @@
49365113 private MenuItem csgItem;
49375114 private MenuItem templateItem;
49385115 private MenuItem textureItem;
5116
+ private MenuItem billboardItem;
49395117 private MenuItem shadowXItem;
49405118 private MenuItem shadowYItem;
49415119 private MenuItem shadowZItem;