Normand Briere
2019-05-02 c209bbe1cf788c9af3dcffea7667c830170a3f1f
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,36 +163,48 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175174 cutItem = menu.add(new MenuItem("Cut"));
176175 cutItem.addActionListener(this);
177176 copyItem = menu.add(new MenuItem("Copy"));
178177 copyItem.addActionListener(this);
179178 pasteItem = menu.add(new MenuItem("Paste"));
180179 pasteItem.addActionListener(this);
180
+ menu.add("-");
181
+ cloneItem = menu.add(new MenuItem("Clone"));
182
+ cloneItem.addActionListener(this);
183
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
+ cloneSupportItem.addActionListener(this);
185
+ menu.add("-");
186
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
187
+ pasteIntoItem.addActionListener(this);
181188 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182189 pasteLinkItem.addActionListener(this);
183190 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184191 pasteCloneItem.addActionListener(this);
185192 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186193 // pasteExpandItem.addActionListener(this);
194
+ menu.add("-");
187195 clearItem = menu.add(new MenuItem("Clear"));
188196 clearItem.addActionListener(this);
197
+
198
+ if (Globals.ADVANCED)
199
+ {
200
+ // Deletes the cameras...
189201 clearAllItem = menu.add(new MenuItem("Clear All"));
190202 clearAllItem.addActionListener(this);
203
+ }
191204
192205 oe.menuBar.add(menu = new Menu("Setting"));
206
+ if (Globals.ADVANCED)
207
+ {
193208 resetMeshItem = menu.add(new MenuItem("Reset All"));
194209 resetMeshItem.addActionListener(this);
195210 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +214,7 @@
199214 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200215 resetreferencesItem.addActionListener(this);
201216 menu.add("-");
217
+ }
202218 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203219 overwriteGeoItem.addActionListener(this);
204220 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +226,26 @@
210226 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211227 overwriteUVItem.addActionListener(this);
212228 menu.add("-");
229
+ if (Globals.ADVANCED)
230
+ {
213231 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214232 generateMeshItem.addActionListener(this);
215233 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216234 poseMeshItem.addActionListener(this);
217235 menu.add("-");
236
+ }
218237 resetsupportItem = menu.add(new MenuItem("Reset support"));
219238 resetsupportItem.addActionListener(this);
220239 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221240 linkverticesItem.addActionListener(this);
241
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
242
+ relinkverticesItem.addActionListener(this);
243
+
244
+ if (Globals.ADVANCED)
245
+ {
222246 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223247 setMasterItem.addActionListener(this);
248
+ }
224249
225250 oe.menuBar.add(menu = new Menu("Group"));
226251 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +256,37 @@
231256 frontItem.addActionListener(this);
232257 compositeItem = menu.add(new MenuItem("Composite"));
233258 compositeItem.addActionListener(this);
259
+ hideItem = menu.add(new MenuItem("Hidden Group"));
260
+ hideItem.addActionListener(this);
261
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
262
+ ungroupItem.addActionListener(this);
234263 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
264
+ randomItem = menu.add(new MenuItem("Switch node"));
236265 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241266 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242267 switchGeoItem.addActionListener(this);
243268 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244269 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
270
+ morphItem = menu.add(new MenuItem("Morph Group"));
246271 morphItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
275
+ physicsItem = menu.add(new MenuItem("Physics"));
276
+ physicsItem.addActionListener(this);
277
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278
+ frameselectorItem.addActionListener(this);
247279 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248280 scriptNodeItem.addActionListener(this);
249281 cameraItem = menu.add(new MenuItem("Camera"));
250282 cameraItem.addActionListener(this);
283
+ }
251284
252285 oe.menuBar.add(menu = new Menu("Object"));
253286 textureItem = menu.add(new MenuItem("Texture"));
254287 textureItem.addActionListener(this);
288
+ billboardItem = menu.add(new MenuItem("Billboard"));
289
+ billboardItem.addActionListener(this);
255290 csgItem = menu.add(new MenuItem("CSG"));
256291 csgItem.addActionListener(this);
257292 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +295,24 @@
260295 shadowYItem.addActionListener(this);
261296 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262297 shadowZItem.addActionListener(this);
298
+ if (Globals.ADVANCED)
299
+ {
263300 linkerItem = menu.add(new MenuItem("Linker"));
264301 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267302 attributeItem = menu.add(new MenuItem("Attribute"));
268303 attributeItem.addActionListener(this);
304
+ templateItem = menu.add(new MenuItem("Template"));
305
+ templateItem.addActionListener(this);
269306 pointflowItem = menu.add(new MenuItem("Point Flow"));
270307 pointflowItem.addActionListener(this);
271308 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
309
+ }
274310 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275311 resetTransformItem.addActionListener(this);
276312 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277313 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
314
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
+ transformgeometryItem.addActionListener(this);
280316
281317 oe.menuBar.add(menu = new Menu("Geometry"));
282318 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +323,11 @@
287323 genNormalsCADItem.addActionListener(this);
288324 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289325 genNormalsMESHItem.addActionListener(this);
326
+ if (Globals.ADVANCED)
327
+ {
328
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
329
+ genNormalsMINEItem.addActionListener(this);
330
+ }
290331 stripifyItem = menu.add(new MenuItem("Stripify"));
291332 stripifyItem.addActionListener(this);
292333 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,10 +349,14 @@
308349 reduce34MeshItem.addActionListener(this);
309350 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310351 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313352 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314353 clipMeshItem.addActionListener(this);
354
+
355
+ if (Globals.ADVANCED)
356
+ {
357
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
358
+ smoothMeshItem.addActionListener(this);
359
+ }
315360
316361 oe.menuBar.add(menu = new Menu("Attributes"));
317362 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -321,10 +366,13 @@
321366 liveleavesItem.addActionListener(this);
322367 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323368 unliveleavesItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
324371 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325372 supportleavesItem.addActionListener(this);
326373 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327374 unsupportleavesItem.addActionListener(this);
375
+ }
328376 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329377 hideleavesItem.addActionListener(this);
330378 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -367,6 +415,8 @@
367415 sortbysizeItem.addActionListener(this);
368416 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369417 sortbynameItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
370420 menu.add("-");
371421 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372422 extractGeometriesItem.addActionListener(this);
....@@ -376,11 +426,11 @@
376426 shareGeometriesItem.addActionListener(this);
377427 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378428 mergeGeometriesItem.addActionListener(this);
429
+ }
379430
380431 oe.menuBar.add(menu = new Menu("Insert"));
381432 buildCreateMenu(menu);
382433
383
-
384434 oe.menuBar.add(menu = new Menu("Include"));
385435 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386436 importGFDItem.addActionListener(this);
....@@ -425,150 +475,98 @@
425475 oe.radioPanel.add(dummyButton);
426476 oe.buttonGroup.add(dummyButton);
427477 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
478
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431479
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
480
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
+ liveCB.setToolTipText("Enabled animation");
433482 liveCB.addItemListener(this);
434483
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
484
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485
+ oneStepButton.setToolTipText("Animate one step forward");
486
+ oneStepButton.addActionListener(this);
487
+
488
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
489
+ fastCB.setToolTipText("Fast mode");
453490 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
493
+ trackCB.setToolTipText("Enable tracking");
495494 trackCB.addItemListener(this);
496495
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
496
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
497
+ screenfitButton.setToolTipText("Screen fit");
499498 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
499
+
501500 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502501 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507502
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
503
+ if (Globals.ADVANCED)
504
+ {
505
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
506
+ snapobjectButton.addActionListener(this);
507
+ snapobjectButton.setToolTipText("Snap Object");
508
+ }
509
+
510
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ flashSelectionButton.setToolTipText("Show selection");
514512 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518513
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
514
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515
+
516
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ twoButton.setToolTipText("Show center view only");
521518 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
519
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523520 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
521
+ fourButton.setToolTipText("Show left panel only");
522
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523
+ sixButton.setToolTipText("2-column layout left");
525524 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
+ threeButton.setToolTipText("2-column layout right");
527527 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
528
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
+ sevenButton.setToolTipText("3-column layout");
529530 sevenButton.addActionListener(this);
530531 //
531532
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
533
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ rootButton.setToolTipText("Edit selection in new tab");
533535 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
536
+
537
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
538
+ closeButton.setToolTipText("Close tab");
536539 closeButton.addActionListener(this);
537540 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538541 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540542
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
+ cGridBag commandsPanel = new cGridBag();
544
+
545
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
+ editButton.setToolTipText("Edit selection");
543547 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547548
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
549
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
+ uneditButton.setToolTipText("Unedit selection");
549551 uneditButton.addActionListener(this);
550552
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
553
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
+ allParamsButton.setToolTipText("Edit all params");
563555 allParamsButton.addActionListener(this);
564556
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
557
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
558
+ clearPanelButton.setToolTipText("Clear edit panel");
559
+ clearPanelButton.addActionListener(this);
560
+
561
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
562
+ unselectButton.setToolTipText("Unselect");
570563 unselectButton.addActionListener(this);
571564
565
+ commandsPanel.preferredHeight = 1;
566
+
567
+ oe.treePanel.add(commandsPanel);
568
+ oe.treePanel.Return();
569
+
572570 // oe.aConstraints.gridx += 1;
573571 // oe.aConstraints.weighty = 0;
574572 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +578,37 @@
580578 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581579 // gcButton.addActionListener(this);
582580
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
581
+ cGridBag jSPPanel = new cGridBag();
582
+
583
+ JScrollPane jSP;
594584 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
585
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596586 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
587
+
588
+ oe.treePanel.add(jSPPanel);
589
+ oe.treePanel.Return();
601590
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
591
+ cGridBag copyOptionsPanel = new cGridBag();
592
+
593
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
+ colorCB.setToolTipText("Copy color when dropped");
606595 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
596
+
597
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
+ materialCB.setToolTipText("Copy material when dropped");
609599 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
600
+
601
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
+ textureCB.setToolTipText("Copy texture when dropped");
612603 textureCB.addItemListener(this);
613604
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
605
+ copyOptionsPanel.preferredHeight = 1;
606
+ oe.treePanel.add(copyOptionsPanel);
607
+ oe.treePanel.Return();
616608
609
+// mainPanel.setDividerLocation(0.5); //1.0);
610
+// mainPanel.setResizeWeight(0.5);
611
+
617612 //jList.addListSelectionListener(this);
618613 oe.jTree.addTreeSelectionListener(this);
619614 //jTree.setRootVisible(false);
....@@ -635,17 +630,89 @@
635630 radio.layout = sevenButton;
636631 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637632 }
633
+
634
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
635
+ {
636
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
637
+ boxCB.setToolTipText("Display bounding boxes");
638
+ boxCB.addItemListener(this);
639
+
640
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
641
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642
+ zoomBoxCB.addItemListener(this);
643
+
644
+ if (Globals.ADVANCED)
645
+ {
646
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
+ supportCB.setToolTipText("Enable rigging");
648
+ supportCB.addItemListener(this);
649
+
650
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
651
+ // localCB.addItemListener(this);
652
+
653
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
654
+ crowdCB.setToolTipText("Used for crowds");
655
+ crowdCB.addItemListener(this);
656
+
657
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
658
+ smoothCB.setToolTipText("Snapping delay");
659
+ smoothCB.addItemListener(this);
660
+
661
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
662
+ slowCB.setToolTipText("Smooth interpolation");
663
+ slowCB.addItemListener(this);
664
+
665
+// constraints.gridy += 1;
666
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
667
+// speakerMocapCB.addItemListener(this);
668
+
669
+ if (false)
670
+ {
671
+ // handled in scripts
672
+ //constraints.gridy += 1;
673
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
674
+ speakerCameraCB.addItemListener(this);
675
+
676
+ //constraints.gridy += 1;
677
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
678
+ speakerFocusCB.addItemListener(this);
679
+
680
+ //constraints.gridy += 1;
681
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
682
+ smoothfocusCB.addItemListener(this);
683
+ }
684
+
685
+//constraints.gridx += 1;
686
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
687
+// debugCB.addItemListener(this);
688
+
689
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
690
+ oeilCB.addItemListener(this);
691
+
692
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
693
+ lookAtCB.setToolTipText("Look-at target");
694
+ lookAtCB.addItemListener(this);
695
+
696
+ }
697
+
698
+ cGridBag fill = new cGridBag();
699
+
700
+ fill.preferredHeight = 200;
701
+
702
+ panel.add(fill);
703
+
704
+ }
638705
639706 void EditObject(Object3D obj)
640707 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
708
+ cRadio radioButton = new cRadio(obj.name);
709
+ radioButton.SetObject(obj);
710
+ radioButton.layout = sevenButton;
711
+ radioButton.SetCamera(cameraView.renderCamera, false);
712
+ radioButton.addActionListener(this);
713
+ radioPanel.add(radioButton);
714
+ buttonGroup.add(radioButton);
715
+ radioButton.doClick();
649716 }
650717 void SetupViews(ObjEditor oe)
651718 {
....@@ -665,6 +732,7 @@
665732 JCheckBox fastCB;
666733 JCheckBox slowCB;
667734 JCheckBox boxCB;
735
+ JCheckBox zoomBoxCB;
668736 JCheckBox trackCB;
669737 JCheckBox smoothfocusCB;
670738 // JCheckBox speakerMocapCB;
....@@ -707,8 +775,7 @@
707775 dropAttributes |= Object3D.TEXTURE;
708776 else
709777 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
778
+ } else if(e.getSource() == liveCB)
712779 {
713780 cameraView.ToggleLive();
714781 }
....@@ -745,6 +812,10 @@
745812 Recompile();
746813 cameraView.repaint();
747814 // refreshContents();
815
+ }
816
+ else if(e.getSource() == zoomBoxCB)
817
+ {
818
+ cameraView.ToggleZoomBoxMode();
748819 }
749820 else if(e.getSource() == smoothfocusCB)
750821 {
....@@ -913,11 +984,11 @@
913984 {
914985 loadClipboard(true);
915986 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
987
+ pasteInto(false, false);
917988 } else {
918989 loadClipboard(false);
919990 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
991
+ pasteInto(false, false); // true); // ???
921992 }
922993 }
923994 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1106,37 @@
10351106 torusItem.addActionListener(this);
10361107 superItem = menu.add(new MenuItem("Superellipsoid"));
10371108 superItem.addActionListener(this);
1109
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1110
+ kleinItem.addActionListener(this);
10381111 particleItem = menu.add(new MenuItem("Particle system"));
10391112 particleItem.addActionListener(this);
1113
+ if (Globals.ADVANCED)
1114
+ {
10401115 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411116 ragdollItem.addActionListener(this);
10421117 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431118 ragdoll2Item.addActionListener(this);
1119
+ }
10441120 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1121
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461122 meshItem.addActionListener(this);
10471123 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481124 // meshGroupItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10491127 springItem = menu.add(new MenuItem("Spring"));
10501128 springItem.addActionListener(this);
10511129 flagItem = menu.add(new MenuItem("Flag"));
10521130 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571131 blobItem = menu.add(new MenuItem("Blob"));
10581132 blobItem.addActionListener(this);
10591133 latheItem = menu.add(new MenuItem("Lathe"));
10601134 latheItem.addActionListener(this);
1135
+ }
1136
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1137
+ bezierItem.addActionListener(this);
1138
+ overlayItem = menu.add(new MenuItem("Overlay"));
1139
+ overlayItem.addActionListener(this);
10611140 lightItem = menu.add(new MenuItem("Light"));
10621141 lightItem.addActionListener(this);
10631142 menu.add("-");
....@@ -1067,25 +1146,26 @@
10671146 loopItem.addActionListener(this);
10681147 doubleItem = menu.add(new MenuItem("Fork"));
10691148 doubleItem.addActionListener(this);
1149
+ if (Globals.ADVANCED)
1150
+ {
10701151 tripleItem = menu.add(new MenuItem("Trident"));
10711152 tripleItem.addActionListener(this);
1153
+ }
10721154 }
10731155
10741156 void buildToolsMenu(Menu menu)
10751157 {
10761158 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771159 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1160
+ animationItem.setState(Globals.ANIMATION);
10791161
10801162 menu.add("-");
10811163 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821164 parseverticesItem.addActionListener(this);
10831165 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841166 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1167
+ alignItem = menu.add(new MenuItem("Align Object"));
10861168 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891169 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901170 reduceMorphItem.addActionListener(this);
10911171 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
....@@ -1093,8 +1173,12 @@
10931173
10941174 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951175 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971176
1177
+ if (Globals.ADVANCED)
1178
+ {
1179
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1180
+ mirrorItem.addActionListener(this);
1181
+ menu.add("-");
10981182 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991183 memoryItem.addActionListener(this);
11001184 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1108,6 +1192,8 @@
11081192 resetParentItem.addActionListener(this);
11091193 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101194 repairParentItem.addActionListener(this);
1195
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1196
+ repairShadowItem.addActionListener(this);
11111197 menu.add(invariantsItem = new MenuItem("Invariants"));
11121198 invariantsItem.addActionListener(this);
11131199 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1201,7 @@
11151201 menu.add("-");
11161202 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171203 editScriptItem.addActionListener(this);
1204
+ }
11181205 }
11191206
11201207 void ScreenFit()
....@@ -1468,6 +1555,7 @@
14681555 //
14691556 public void actionPerformed(ActionEvent event) // , Object arg)
14701557 {
1558
+ Object source = event.getSource();
14711559 /*
14721560 if (event.getSource() == nameField)
14731561 {
....@@ -1479,11 +1567,11 @@
14791567 }
14801568 else
14811569 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1570
+ if (source == lookAtItem || source == lookFromItem)
14831571 {
14841572 ScreenFit();
14851573 } else
1486
- if (event.getSource() == switchItem)
1574
+ if (source == switchItem)
14871575 {
14881576 cVector v1 = new cVector();
14891577 cVector v2 = new cVector();
....@@ -1492,11 +1580,11 @@
14921580 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931581 objEditor.cameraView.repaint();
14941582 } else
1495
- if (event.getSource() == rectoidItem)
1583
+ if (source == rectoidItem)
14961584 {
14971585 makeSomething(new Box());
14981586 } else
1499
- if (event.getSource() == particleItem)
1587
+ if (source == particleItem)
15001588 {
15011589 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021590 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1605,9 @@
15171605 applyExample(particleGeom, "SMOKE");
15181606 makeSomething(particleGeom);
15191607 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1608
+ if (source == ragdollItem || source == ragdoll2Item)
15211609 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1610
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231611
15241612 ragdoll.toParent = LA.newMatrix();
15251613 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1625,7 @@
15371625 } else
15381626 /*
15391627 */
1540
- if (event.getSource() == heightFieldItem)
1628
+ if (source == heightFieldItem)
15411629 {
15421630 Object3D obj = new Object3D();
15431631
....@@ -1575,27 +1663,31 @@
15751663
15761664 makeSomething(obj);
15771665 } else
1578
- if (event.getSource() == gridItem)
1666
+ if (source == gridItem)
15791667 {
15801668 makeSomething(new Grid());
15811669 } else
1582
- if (event.getSource() == ellipsoidItem)
1670
+ if (source == ellipsoidItem)
15831671 {
15841672 makeSomething(new Sphere());
15851673 } else
1586
- if (event.getSource() == coneItem)
1674
+ if (source == coneItem)
15871675 {
15881676 makeSomething(new Cone());
15891677 } else
1590
- if (event.getSource() == torusItem)
1678
+ if (source == torusItem)
15911679 {
15921680 makeSomething(new Torus());
15931681 } else
1594
- if (event.getSource() == superItem)
1682
+ if (source == superItem)
15951683 {
15961684 makeSomething(new Superellipsoid());
15971685 } else
1598
- if (event.getSource() == blobItem)
1686
+ if (source == kleinItem)
1687
+ {
1688
+ makeSomething(new Klein());
1689
+ } else
1690
+ if (source == blobItem)
15991691 {
16001692 Blob blob = new Blob();
16011693 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1695,15 @@
16031695 //blob.retile();
16041696 makeSomething(blob);
16051697 } else
1606
- if (event.getSource() == latheItem)
1698
+ if (source == latheItem)
16071699 {
16081700 makeSomething(new Lathe());
16091701 } else
1610
- if (event.getSource() == bezierItem)
1702
+ if (source == bezierItem)
16111703 {
16121704 makeSomething(new BezierSurface());
16131705 } else
1614
- if (event.getSource() == checkerItem)
1706
+ if (source == overlayItem)
16151707 {
16161708 /*
16171709 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1718,7 @@
16261718 */
16271719 makeSomething(new Checker());
16281720 } else
1629
- if (event.getSource() == meshItem)
1721
+ if (source == meshItem)
16301722 {
16311723 Object3D itemtomake = new Object3D();
16321724 Object3D child;
....@@ -1647,35 +1739,35 @@
16471739 makeSomething(child);
16481740 }
16491741 } else
1650
- if (event.getSource() == springItem)
1742
+ if (source == springItem)
16511743 {
16521744 cSpring s = new cSpring();
16531745 s.setup();
16541746 makeSomething(s);
16551747 } else
1656
- if (event.getSource() == flagItem)
1748
+ if (source == flagItem)
16571749 {
16581750 cSpring s = new cFlag();
16591751 s.setup();
16601752 makeSomething(s);
16611753 } else
1662
- if (event.getSource() == lightItem)
1754
+ if (source == lightItem)
16631755 {
16641756 makeSomething(new Light());
16651757 } else
1666
- if (event.getSource() == csgItem)
1758
+ if (source == csgItem)
16671759 {
16681760 group(new CSG());
16691761 } else
1670
- if (event.getSource() == templateItem)
1762
+ if (source == templateItem)
16711763 {
16721764 group(new cTemplate());
16731765 } else
1674
- if (event.getSource() == attributeItem)
1766
+ if (source == attributeItem)
16751767 {
16761768 makeSomething(new Attribute());
16771769 } else
1678
- if (event.getSource() == pointflowItem)
1770
+ if (source == pointflowItem)
16791771 {
16801772 makeSomething(new PointFlow());
16811773 } else
....@@ -1687,7 +1779,7 @@
16871779 } else
16881780 */
16891781
1690
- if (event.getSource() == superLoopItem)
1782
+ if (source == superLoopItem)
16911783 {
16921784 Composite g = new cGroup();
16931785 for (int i=0; i<15; i++)
....@@ -1709,7 +1801,7 @@
17091801
17101802 group(g);
17111803 } else
1712
- if (event.getSource() == loopItem)
1804
+ if (source == loopItem)
17131805 {
17141806 Composite csg = new GroupLeaf();
17151807 csg.count = 5;
....@@ -1718,7 +1810,7 @@
17181810 csg.addChild(child);
17191811 child.addChild(csg);
17201812 } else
1721
- if (event.getSource() == doubleItem)
1813
+ if (source == doubleItem)
17221814 {
17231815 Composite csg = new GroupLeaf();
17241816 csg.count = 5;
....@@ -1730,7 +1822,7 @@
17301822 csg.addChild(child);
17311823 child.addChild(csg);
17321824 } else
1733
- if (event.getSource() == tripleItem)
1825
+ if (source == tripleItem)
17341826 {
17351827 Composite csg = new GroupLeaf();
17361828 csg.count = 4;
....@@ -1746,70 +1838,75 @@
17461838 child.addChild(csg);
17471839 } else
17481840
1749
- if (event.getSource() == importGFDItem)
1841
+ if (source == importGFDItem)
17501842 {
17511843 ImportGFD();
17521844 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1845
+ if (source == importVRMLX3DItem)
17541846 {
17551847 ImportVRMLX3D();
17561848 } else
1757
- if (event.getSource() == import3DSItem)
1849
+ if (source == import3DSItem)
17581850 {
17591851 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17601852 } else
1761
- if (event.getSource() == importOBJItem)
1853
+ if (source == importOBJItem)
17621854 {
17631855 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17641856 } else
1765
- if (event.getSource() == computeAOItem)
1857
+ if (source == computeAOItem)
17661858 {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1859
+ Globals.drawMode = CameraPane.OCCLUSION;
1860
+ Globals.theRenderer.repaint();
17691861 } else
1770
- if (event.getSource() == recompileItem)
1862
+ if (source == recompileItem)
17711863 {
17721864 Recompile();
17731865 refreshContents();
17741866 } else
1775
- if (event.getSource() == editScriptItem)
1867
+ if (source == editScriptItem)
17761868 {
17771869 OpenDialog();
17781870 refreshContents();
17791871 } else
1780
- if (event.getSource() == invariantsItem)
1872
+ if (source == invariantsItem)
17811873 {
17821874 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1875
+ GrafreeD.grafreeD.universe.invariants();
17841876 } else
1785
- if (event.getSource() == memoryItem)
1877
+ if (source == memoryItem)
17861878 {
17871879 //System.out.println("Invariants:");
17881880 PrintMemory();
17891881 } else
1790
- if (event.getSource() == pathItem)
1882
+ if (source == pathItem)
17911883 {
17921884 PrintPath();
17931885 } else
1794
- if (event.getSource() == analyzeItem)
1886
+ if (source == analyzeItem)
17951887 {
17961888 AnalyzeObject();
17971889 } else
1798
- if (event.getSource() == dumpItem)
1890
+ if (source == dumpItem)
17991891 {
18001892 DumpObject();
18011893 } else
1802
- if (event.getSource() == screenfitButton)
1894
+ if (source == oneStepButton)
1895
+ {
1896
+ Globals.ONESTEP = true;
1897
+ cameraView.repaint();
1898
+ } else
1899
+ if (source == screenfitButton)
18031900 {
18041901 //Reload(lastConverter, lastFilename, true);
18051902 ScreenFit();
18061903 } else
1807
- if (event.getSource() == screenfitpointButton)
1904
+ if (source == screenfitpointButton)
18081905 {
18091906 //Reload(lastConverter, lastFilename, true);
18101907 ScreenFitPoint();
18111908 } else
1812
- if (event.getSource() == snapobjectButton)
1909
+ if (source == snapobjectButton)
18131910 {
18141911 //Reload(lastConverter, lastFilename, true);
18151912 SnapObject();
....@@ -1820,13 +1917,13 @@
18201917 // Recompile();
18211918 // refreshContents();
18221919 // } else
1823
- if (event.getSource() == gcButton)
1920
+ if (source == gcButton)
18241921 {
18251922 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261923 System.gc();
18271924 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281925 } else
1829
- if (event.getSource() == editLeafItem)
1926
+ if (source == editLeafItem)
18301927 {
18311928 Object3D obj;
18321929 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1937,66 @@
18401937 }
18411938 refreshContents(true);
18421939 } else
1843
- if (event.getSource() == openWindowItem)
1940
+ if (source == openWindowItem)
18441941 {
18451942 EditSelection(true);
18461943 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1944
+ if (source == cutItem || source == clearButton)
18481945 {
18491946 loadClipboard(true);
18501947 } else
1851
- if (event.getSource() == duplicateItem)
1948
+ if (source == duplicateItem)
18521949 {
18531950 Object3D keep = GrafreeD.clipboard;
18541951 loadClipboard(false);
18551952 paste(false);
18561953 GrafreeD.clipboard = keep;
18571954 } else
1858
- if (event.getSource() == cloneItem)
1955
+ if (source == cloneItem)
18591956 {
18601957 CloneSelection(false);
18611958 } else
1862
- if (event.getSource() == cloneSupportItem)
1959
+ if (source == cloneSupportItem)
18631960 {
18641961 CloneSelection(true);
18651962 } else
1866
- if (event.getSource() == copyItem)
1963
+ if (source == copyItem)
18671964 {
18681965 loadClipboard(false);
18691966 } else
1870
- if (event.getSource() == pasteItem)
1967
+ if (source == pasteItem)
18711968 {
18721969 paste(false);
18731970 } else
1874
- if (event.getSource() == pasteLinkItem)
1971
+ if (source == pasteIntoItem)
18751972 {
1876
- pasteInto(false);
1973
+ pasteInto(true, false);
18771974 } else
1878
- if (event.getSource() == pasteCloneItem)
1975
+ if (source == pasteLinkItem)
18791976 {
1880
- pasteInto(true);
1977
+ pasteInto(false, false);
18811978 } else
1882
- if (event.getSource() == pasteExpandItem)
1979
+ if (source == pasteCloneItem)
1980
+ {
1981
+ pasteInto(true, true);
1982
+ } else
1983
+ if (source == pasteExpandItem)
18831984 {
18841985 paste(true);
18851986 } else
1886
- if (event.getSource() == synchronizeItem)
1987
+ if (source == synchronizeItem)
18871988 {
18881989 Overwrite(Object3D.TRANSFORM);
18891990 } else
1890
- if (event.getSource() == overwriteNameItem)
1991
+ if (source == overwriteNameItem)
18911992 {
18921993 Overwrite(Object3D.NAME);
18931994 } else
1894
- if (event.getSource() == overwriteUVItem)
1995
+ if (source == overwriteUVItem)
18951996 {
18961997 Overwrite(Object3D.UV);
18971998 } else
1898
- if (event.getSource() == overwriteMatItem)
1999
+ if (source == overwriteMatItem)
18992000 {
19002001 /* july 2015
19012002 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2016,7 @@
19152016
19162017 Overwrite(dropAttributes);
19172018 }
1918
- if (event.getSource() == overwriteGeoItem)
2019
+ if (source == overwriteGeoItem)
19192020 {
19202021 Overwrite(Object3D.GEOMETRY);
19212022 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2033,7 @@
19322033 // refreshContents();
19332034 // }
19342035 } else
1935
- if (event.getSource() == generateMeshItem)
2036
+ if (source == generateMeshItem)
19362037 {
19372038 //if (group.selection.size() == 1)
19382039 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2044,7 @@
19432044 ResetModel();
19442045 refreshContents();
19452046 } else
1946
- if (event.getSource() == extractGeometriesItem)
2047
+ if (source == extractGeometriesItem)
19472048 {
19482049 boolean one = false;
19492050
....@@ -1970,7 +2071,7 @@
19702071 ResetModel();
19712072 refreshContents();
19722073 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2074
+ if (source == cloneGeometriesItem)
19742075 {
19752076 boolean one = false;
19762077
....@@ -1996,32 +2097,37 @@
19962097 ResetModel();
19972098 refreshContents();
19982099 } else
1999
- if (event.getSource() == shareGeometriesItem)
2100
+ if (source == shareGeometriesItem)
20002101 {
20012102 boolean one = false;
20022103
20032104 if (group.selection.size() == 1)
20042105 one = true;
20052106
2107
+ Object3D merge = null;
2108
+
20062109 Object3D content = new cGroup();
20072110
20082111 for (int i=0; i<group.selection.size(); i++)
20092112 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2113
+ merge = new Merge(group.selection.get(i));
20112114
20122115 if (one)
2013
- makeSomething(sel, false);
2116
+ makeSomething(merge, false);
20142117 else
2015
- content.addChild(sel);
2118
+ content.addChild(merge);
20162119 }
20172120
20182121 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2122
+ makeSomething(content, true);
2123
+ else
2124
+ {
2125
+ ResetModel();
2126
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2127
+ refreshContents();
2128
+ }
20232129 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2130
+ if (source == mergeGeometriesItem)
20252131 {
20262132 boolean one = false;
20272133
....@@ -2051,7 +2157,7 @@
20512157 ResetModel();
20522158 refreshContents();
20532159 } else
2054
- if (event.getSource() == linkverticesItem)
2160
+ if (source == linkverticesItem)
20552161 {
20562162 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572163 // {
....@@ -2071,32 +2177,41 @@
20712177 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722178 content = ((cGroup)content).get(0);
20732179
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2180
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752181 for (int i=0; i<group.selection.size(); i++)
20762182 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2183
+ boolean random = CameraPane.SWITCH;
2184
+ CameraPane.SWITCH = false; // parse all random nodes
20792185 group.selection.get(i).linkVerticesThis(content);
20802186 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2187
+ CameraPane.SWITCH = random;
20822188 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2189
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842190 refreshContents();
20852191 }
20862192 } else
2087
- if (event.getSource() == resetsupportItem)
2193
+ if (source == resetsupportItem)
20882194 {
20892195 for (int i=0; i<group.selection.size(); i++)
20902196 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2197
+ boolean random = CameraPane.SWITCH;
2198
+ CameraPane.SWITCH = false; // parse all random nodes
20932199 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2200
+ CameraPane.SWITCH = random;
20952201 }
20962202
20972203 refreshContents();
20982204 } else
2099
- if (event.getSource() == resetreferencesItem)
2205
+ if (source == relinkverticesItem)
2206
+ {
2207
+ boolean random = CameraPane.SWITCH;
2208
+ CameraPane.SWITCH = false; // parse all random nodes
2209
+ group.selection.RelinkToSupport();
2210
+ CameraPane.SWITCH = random;
2211
+
2212
+ refreshContents();
2213
+ } else
2214
+ if (source == resetreferencesItem)
21002215 {
21012216 for (int i=0; i<group.selection.size(); i++)
21022217 {
....@@ -2105,7 +2220,7 @@
21052220
21062221 refreshContents();
21072222 } else
2108
- if (event.getSource() == setMasterItem)
2223
+ if (source == setMasterItem)
21092224 {
21102225 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21112226 {
....@@ -2118,7 +2233,7 @@
21182233 refreshContents();
21192234 }
21202235 } else
2121
- if (event.getSource() == poseMeshItem)
2236
+ if (source == poseMeshItem)
21222237 {
21232238 if (group.selection.size() == 1)
21242239 {
....@@ -2137,19 +2252,19 @@
21372252 }
21382253
21392254 } else
2140
- if (event.getSource() == revertMeshItem)
2255
+ if (source == revertMeshItem)
21412256 {
21422257 RevertMeshes();
21432258 } else
2144
- if (event.getSource() == resetMeshItem)
2259
+ if (source == resetMeshItem)
21452260 {
21462261 ResetAll();
21472262 } else
2148
- if (event.getSource() == stepAllItem)
2263
+ if (source == stepAllItem)
21492264 {
21502265 StepAll();
21512266 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2267
+ if (source == clearItem) // || event.getSource() == clearButton)
21532268 {
21542269 //int indices[] = jList.getSelectedIndices();
21552270 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2272,46 @@
21572272
21582273 ClearSelection(false);
21592274 } else
2160
- if (event.getSource() == clearAllItem)
2275
+ if (source == clearAllItem)
21612276 {
21622277 ClearSelection(true);
21632278 } else
2164
- if (event.getSource() == grabItem)
2279
+ if (source == grabItem)
21652280 {
21662281 group(new cGroup(), true);
21672282 } else
2168
- if (event.getSource() == frontItem)
2283
+ if (source == hideItem)
2284
+ {
2285
+ group(new HiddenObject());
2286
+ } else
2287
+ if (source == frontItem)
21692288 {
21702289 front();
21712290 } else
2172
- if (event.getSource() == backItem)
2291
+ if (source == backItem)
21732292 {
21742293 back();
21752294 } else
2176
- if (event.getSource() == cameraItem)
2295
+ if (source == cameraItem)
21772296 {
21782297 makeSomething(new Camera());
21792298 } else
2180
- if (event.getSource() == compositeItem)
2299
+ if (source == compositeItem)
21812300 {
21822301 group(new Composite());
21832302 } else
2184
- if (event.getSource() == randomItem)
2303
+ if (source == randomItem)
21852304 {
21862305 RandomNode random = new RandomNode();
21872306 group(random);
21882307 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2308
+ random.name = random.get(0).name + "Switch";
21902309 } else
2191
- if (event.getSource() == physicsItem)
2310
+ if (source == physicsItem)
21922311 {
21932312 group(new PhysicsNode());
21942313 } else
2195
- if (event.getSource() == frameselectorItem)
2314
+ if (source == frameselectorItem)
21962315 {
21972316 for (int i=0; i<group.selection.size(); i++)
21982317 {
....@@ -2204,7 +2323,7 @@
22042323 ResetModel();
22052324 refreshContents();
22062325 } else
2207
- if (event.getSource() == switchGeoItem)
2326
+ if (source == switchGeoItem)
22082327 {
22092328 for (int i=0; i<group.selection.size(); i++)
22102329 {
....@@ -2216,7 +2335,7 @@
22162335 ResetModel();
22172336 refreshContents();
22182337 } else
2219
- if (event.getSource() == switchTransfoItem)
2338
+ if (source == switchTransfoItem)
22202339 {
22212340 for (int i=0; i<group.selection.size(); i++)
22222341 {
....@@ -2228,7 +2347,7 @@
22282347 ResetModel();
22292348 refreshContents();
22302349 } else
2231
- if (event.getSource() == morphItem)
2350
+ if (source == morphItem)
22322351 {
22332352 for (int i=0; i<group.selection.size(); i++)
22342353 {
....@@ -2240,7 +2359,7 @@
22402359 ResetModel();
22412360 refreshContents();
22422361 } else
2243
- if (event.getSource() == scriptNodeItem)
2362
+ if (source == scriptNodeItem)
22442363 {
22452364 boolean atleastone = false;
22462365
....@@ -2279,199 +2398,215 @@
22792398 }
22802399 }
22812400 } else
2282
- if (event.getSource() == linkerItem)
2401
+ if (source == linkerItem)
22832402 {
22842403 group(new cLinker());
22852404 } else
2286
- if (event.getSource() == textureItem)
2405
+ if (source == textureItem)
22872406 {
22882407 group(new TextureNode());
22892408 } else
2290
- if (event.getSource() == shadowXItem)
2409
+ if (source == billboardItem)
2410
+ {
2411
+ group(new BillboardNode());
2412
+ } else
2413
+ if (source == shadowXItem)
22912414 {
22922415 CastShadow(0);
22932416 } else
2294
- if (event.getSource() == shadowYItem)
2417
+ if (source == shadowYItem)
22952418 {
22962419 CastShadow(1);
22972420 } else
2298
- if (event.getSource() == shadowZItem)
2421
+ if (source == shadowZItem)
22992422 {
23002423 CastShadow(2);
23012424 } else
2302
- if (event.getSource() == ungroupItem)
2425
+ if (source == ungroupItem)
23032426 {
2304
- ungroup();
2427
+ //ungroup();
2428
+ for (int i=0; i<group.selection.size(); i++)
2429
+ {
2430
+ Ungroup(group.selection.get(i));
2431
+ }
2432
+
2433
+ ClearSelection(false);
2434
+
2435
+ refreshContents();
23052436 } else
2306
- if (event.getSource() == genUVItem)
2437
+ if (source == genUVItem)
23072438 {
23082439 GenUV();
23092440 } else
2310
- if (event.getSource() == genNormalsCADItem)
2441
+ if (source == genNormalsCADItem)
23112442 {
23122443 GenNormals(true);
23132444 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2445
+ if (source == genNormalsMESHItem)
23152446 {
23162447 GenNormals(true); // TODO
23172448 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2449
+ if (source == genNormalsORGANItem)
23192450 {
23202451 GenNormals(false);
23212452 } else
2322
- if (event.getSource() == stripifyItem)
2453
+ if (source == genNormalsMINEItem)
2454
+ {
2455
+ GenNormalsMINE();
2456
+ } else
2457
+ if (source == stripifyItem)
23232458 {
23242459 Stripify();
23252460 } else
2326
- if (event.getSource() == unstripifyItem)
2461
+ if (source == unstripifyItem)
23272462 {
23282463 Unstripify();
23292464 } else
2330
- if (event.getSource() == trimItem)
2465
+ if (source == trimItem)
23312466 {
23322467 Trim();
23332468 } else
2334
- if (event.getSource() == untrimItem)
2469
+ if (source == untrimItem)
23352470 {
23362471 Untrim();
23372472 } else
2338
- if (event.getSource() == clearColorsItem)
2473
+ if (source == clearColorsItem)
23392474 {
23402475 ClearColors();
23412476 } else
2342
- if (event.getSource() == clearMaterialsItem)
2477
+ if (source == clearMaterialsItem)
23432478 {
23442479 ClearMaterials();
23452480 } else
2346
- if (event.getSource() == liveleavesItem)
2481
+ if (source == liveleavesItem)
23472482 {
23482483 LiveLeaves(true);
23492484 } else
2350
- if (event.getSource() == unliveleavesItem)
2485
+ if (source == unliveleavesItem)
23512486 {
23522487 LiveLeaves(false);
23532488 } else
2354
- if (event.getSource() == supportleavesItem)
2489
+ if (source == supportleavesItem)
23552490 {
23562491 SupportLeaves(true);
23572492 } else
2358
- if (event.getSource() == unsupportleavesItem)
2493
+ if (source == unsupportleavesItem)
23592494 {
23602495 SupportLeaves(false);
23612496 } else
2362
- if (event.getSource() == hideleavesItem)
2497
+ if (source == hideleavesItem)
23632498 {
23642499 HideLeaves(true);
23652500 } else
2366
- if (event.getSource() == showleavesItem)
2501
+ if (source == showleavesItem)
23672502 {
23682503 HideLeaves(false);
23692504 } else
2370
- if (event.getSource() == markleavesItem)
2505
+ if (source == markleavesItem)
23712506 {
23722507 MarkLeaves(true);
23732508 } else
2374
- if (event.getSource() == unmarkleavesItem)
2509
+ if (source == unmarkleavesItem)
23752510 {
23762511 MarkLeaves(false);
23772512 } else
2378
- if (event.getSource() == flipVItem)
2513
+ if (source == flipVItem)
23792514 {
23802515 FlipV(true);
23812516 } else
2382
- if (event.getSource() == unflipVItem)
2517
+ if (source == unflipVItem)
23832518 {
23842519 FlipV(false);
23852520 } else
2386
- if (event.getSource() == lowTexturesItem)
2521
+ if (source == lowTexturesItem)
23872522 {
23882523 SetTexRes(0);
23892524 } else
2390
- if (event.getSource() == normalTexturesItem)
2525
+ if (source == normalTexturesItem)
23912526 {
23922527 SetTexRes(1);
23932528 } else
2394
- if (event.getSource() == highTexturesItem)
2529
+ if (source == highTexturesItem)
23952530 {
23962531 SetTexRes(2);
23972532 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2533
+ if (source == veryhighTexturesItem)
23992534 {
24002535 SetTexRes(3);
24012536 } else
2402
- if (event.getSource() == maxTexturesItem)
2537
+ if (source == maxTexturesItem)
24032538 {
24042539 SetTexRes(4);
24052540 } else
2406
- if (event.getSource() == panoTexturesItem)
2541
+ if (source == panoTexturesItem)
24072542 {
24082543 SetTexRes(5);
24092544 } else
2410
- if (event.getSource() == reverseNormalsItem)
2545
+ if (source == reverseNormalsItem)
24112546 {
24122547 ReverseNormals();
24132548 } else
2414
- if (event.getSource() == parseverticesItem)
2549
+ if (source == parseverticesItem)
24152550 {
24162551 ParseVertices();
24172552 } else
2418
- if (event.getSource() == textureFieldItem)
2553
+ if (source == textureFieldItem)
24192554 {
24202555 TextureVertices();
24212556 } else
2422
- if (event.getSource() == alignItem)
2557
+ if (source == alignItem)
24232558 {
24242559 Align();
24252560 } else
2426
- if (event.getSource() == mirrorItem)
2561
+ if (source == mirrorItem)
24272562 {
24282563 MirrorPoses();
24292564 } else
2430
- if (event.getSource() == reduceMorphItem)
2565
+ if (source == reduceMorphItem)
24312566 {
24322567 MeshReduction(false);
24332568 } else
2434
- if (event.getSource() == reduce34MorphItem)
2569
+ if (source == reduce34MorphItem)
24352570 {
24362571 MeshReduction(true);
24372572 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2573
+ if (source == reverseTrianglesItem)
24392574 {
24402575 ReverseTriangles();
24412576 } else
2442
- if (event.getSource() == reduceMeshItem)
2577
+ if (source == reduceMeshItem)
24432578 {
24442579 ReduceMesh(false);
24452580 } else
2446
- if (event.getSource() == reduce34MeshItem)
2581
+ if (source == reduce34MeshItem)
24472582 {
24482583 ReduceMesh(true);
24492584 } else
2450
- if (event.getSource() == increaseMeshItem)
2585
+ if (source == increaseMeshItem)
24512586 {
24522587 IncreaseMesh();
24532588 } else
2454
- if (event.getSource() == clipMeshItem)
2589
+ if (source == clipMeshItem)
24552590 {
24562591 ClipMesh();
24572592 } else
2458
- if (event.getSource() == smoothMeshItem)
2593
+ if (source == smoothMeshItem)
24592594 {
24602595 SmoothMesh();
24612596 } else
2462
- if (event.getSource() == transformgeometryItem)
2597
+ if (source == transformgeometryItem)
24632598 {
24642599 TransformGeometry();
24652600 } else
2466
- if (event.getSource() == resetTransformItem)
2601
+ if (source == resetTransformItem)
24672602 {
24682603 ResetTransform();
24692604 } else
2470
- if (event.getSource() == resetCentroidItem)
2605
+ if (source == resetCentroidItem)
24712606 {
24722607 ResetCentroid();
24732608 } else
2474
- if (event.getSource() == resetParentItem)
2609
+ if (source == resetParentItem)
24752610 {
24762611 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772612 {
....@@ -2481,7 +2616,7 @@
24812616
24822617 refreshContents();
24832618 } else
2484
- if (event.getSource() == repairParentItem)
2619
+ if (source == repairParentItem)
24852620 {
24862621 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872622 {
....@@ -2495,7 +2630,21 @@
24952630
24962631 refreshContents();
24972632 } else
2498
- if (event.getSource() == sortbysizeItem)
2633
+ if (source == repairShadowItem)
2634
+ {
2635
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2636
+ {
2637
+ Object3D obj = (Object3D)e.nextElement();
2638
+ obj.RepairShadow();
2639
+// for (int i=0; i<obj.size(); i++)
2640
+// {
2641
+// obj.get(i).parent = obj;
2642
+// }
2643
+ }
2644
+
2645
+ refreshContents();
2646
+ } else
2647
+ if (source == sortbysizeItem)
24992648 {
25002649 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012650 {
....@@ -2507,7 +2656,7 @@
25072656 ResetModel();
25082657 refreshContents();
25092658 } else
2510
- if (event.getSource() == sortbynameItem)
2659
+ if (source == sortbynameItem)
25112660 {
25122661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132662 {
....@@ -2519,7 +2668,7 @@
25192668 ResetModel();
25202669 refreshContents();
25212670 } else
2522
- if (event.getSource() == attachPigmentItem)
2671
+ if (source == attachPigmentItem)
25232672 {
25242673 String texture = GetFile("Attach pigment");
25252674 Object3D obj;
....@@ -2531,7 +2680,7 @@
25312680
25322681 refreshContents();
25332682 } else
2534
- if (event.getSource() == detachPigmentItem)
2683
+ if (source == detachPigmentItem)
25352684 {
25362685 Object3D obj;
25372686 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2691,7 @@
25422691
25432692 refreshContents();
25442693 } else
2545
- if (event.getSource() == attachBumpItem)
2694
+ if (source == attachBumpItem)
25462695 {
25472696 String texture = GetFile("Attach bump");
25482697 Object3D obj;
....@@ -2554,7 +2703,7 @@
25542703
25552704 refreshContents();
25562705 } else
2557
- if (event.getSource() == detachBumpItem)
2706
+ if (source == detachBumpItem)
25582707 {
25592708 Object3D obj;
25602709 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2714,7 @@
25652714
25662715 refreshContents();
25672716 } else
2568
- if (event.getSource() == pigmentBumpItem)
2717
+ if (source == pigmentBumpItem)
25692718 {
25702719 Object3D obj;
25712720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2725,195 @@
25762725
25772726 refreshContents();
25782727 } else
2579
- if (event.getSource() == flashSelectionButton)
2728
+ if (source == flashSelectionButton)
25802729 {
25812730 CameraPane.flash = true;
25822731 refreshContents();
25832732 } else
2584
- if (event.getSource() == oneButton)
2733
+ if (source == oneButton)
25852734 {
25862735 } else
2587
- if (event.getSource() == twoButton)
2736
+ if (source == twoButton)
25882737 {
25892738 radio.layout = twoButton;
25902739 // bug
25912740 //gridPanel.setDividerLocation(1.0);
25922741 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2750
+// aWindowConstraints.weightx = 0;
2751
+// aWindowConstraints.weighty = 1;
2752
+// //bigThree.add(jtp, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// bigThree.add(centralPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// scenePanel.setVisible(false);
2766
+// centralPanel.setVisible(true);
2767
+// XYZPanel.setVisible(false);
2768
+ bigThree.ClearUI();
2769
+ bigThree.add(centralPanel);
2770
+ bigThree.FlushUI();
26172771 } else
2618
- if (event.getSource() == threeButton)
2772
+ if (source == threeButton)
26192773 {
26202774 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
2775
+
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// bigThree.add(XYZPanel, aWindowConstraints);
2799
+// bigThree.validate();
2800
+// scenePanel.setVisible(false);
2801
+// centralPanel.setVisible(true);
2802
+// XYZPanel.setVisible(true);
2803
+ bigThree.ClearUI();
2804
+ bigThree.add(centralPanel);
2805
+ bigThree.add(XYZPanel);
2806
+ bigThree.FlushUI();
26452807 } else
2646
- if (event.getSource() == fourButton)
2808
+ if (source == fourButton)
26472809 {
26482810 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
2811
+
2812
+// bigThree.remove(scenePanel);
2813
+// bigThree.remove(centralPanel);
2814
+// bigThree.remove(XYZPanel);
2815
+// aWindowConstraints.gridx = 0;
2816
+// aWindowConstraints.gridy = 0;
2817
+// aWindowConstraints.gridwidth = 1;
2818
+// // aWindowConstraints.gridheight = 3;
2819
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.weighty = 1;
2822
+// bigThree.add(scenePanel, aWindowConstraints);
2823
+// aWindowConstraints.weightx = 1;
2824
+// aWindowConstraints.gridwidth = 3;
2825
+// // aConstraints.gridheight = 3;
2826
+// aWindowConstraints.gridx = 1;
2827
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2828
+// //bigThree.add(cameraPanel, aWindowConstraints);
2829
+// aWindowConstraints.weightx = 0;
2830
+// aWindowConstraints.gridx = 4;
2831
+// aWindowConstraints.gridwidth = 1;
2832
+// // aWindowConstraints.gridheight = 3;
2833
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2834
+// //bigThree.add(XYZPanel, aWindowConstraints);
2835
+// bigThree.validate();
2836
+// scenePanel.setVisible(true);
2837
+// centralPanel.setVisible(false);
2838
+// XYZPanel.setVisible(false);
2839
+ bigThree.ClearUI();
2840
+ bigThree.add(scenePanel);
2841
+ bigThree.FlushUI();
26732842 } else
2674
- if (event.getSource() == sixButton)
2843
+ if (source == sixButton)
26752844 {
26762845 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
2846
+
2847
+// bigThree.remove(scenePanel);
2848
+// bigThree.remove(centralPanel);
2849
+// bigThree.remove(XYZPanel);
2850
+// aWindowConstraints.gridx = 0;
2851
+// aWindowConstraints.gridy = 0;
2852
+// aWindowConstraints.gridwidth = 1;
2853
+// // aConstraints.gridheight = 3;
2854
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2855
+// aWindowConstraints.weightx = 0;
2856
+// aWindowConstraints.weighty = 1;
2857
+// bigThree.add(scenePanel, aWindowConstraints);
2858
+// aWindowConstraints.weightx = 1;
2859
+// aWindowConstraints.gridwidth = 3;
2860
+// // aWindowConstraints.gridheight = 3;
2861
+// aWindowConstraints.gridx = 1;
2862
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2863
+// bigThree.add(centralPanel, aWindowConstraints);
2864
+// aWindowConstraints.weightx = 0;
2865
+// aWindowConstraints.gridx = 4;
2866
+// aWindowConstraints.gridwidth = 1;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2869
+// //bigThree.add(XYZPanel, aConstraints);
2870
+// bigThree.validate();
2871
+// scenePanel.setVisible(true);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(scenePanel);
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
27012878 } else
2702
- if (event.getSource() == sevenButton)
2879
+ if (source == sevenButton)
27032880 {
27042881 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aWindowConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// bigThree.add(scenePanel, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(true);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(scenePanel);
2912
+ bigThree.add(centralPanel);
2913
+ bigThree.add(XYZPanel);
2914
+ bigThree.FlushUI();
27292915 } else
2730
- if (event.getSource() == rootButton)
2916
+ if (source == rootButton)
27312917 {
27322918 Object3D obj;
27332919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2925,7 @@
27392925
27402926 refreshContents(true);
27412927 } else
2742
- if (event.getSource() == closeButton)
2928
+ if (source == closeButton)
27432929 {
27442930 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452931 cRadio ab;
....@@ -2760,11 +2946,11 @@
27602946 }
27612947 refreshContents(true);
27622948 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
2949
+ if (source == editItem || source == editButton)
27642950 {
27652951 EditSelection(false);
27662952 } else
2767
- if (event.getSource() == uneditButton)
2953
+ if (source == uneditButton)
27682954 {
27692955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27702956 {
....@@ -2776,12 +2962,12 @@
27762962
27772963 child.editWindow = null; // ???????????
27782964 }
2779
- objEditor.ctrlPanel.revalidate();
2965
+ objEditor.ctrlPanel.FlushUI();
27802966 //objEditor.jTree.clearSelection();
27812967 //objEditor.ResetSliders();
27822968 refreshContents(true);
27832969 } else
2784
- if (event.getSource() == clearPanelButton)
2970
+ if (source == clearPanelButton)
27852971 {
27862972 assert(copy == group);
27872973 //copy.ClearUI();
....@@ -2792,7 +2978,7 @@
27922978 listUI.clear();
27932979 refreshContents(true);
27942980 } else
2795
- if (event.getSource() == allParamsButton)
2981
+ if (source == allParamsButton)
27962982 {
27972983 assert(copy == group);
27982984
....@@ -2813,19 +2999,19 @@
28132999
28143000 refreshContents(true);
28153001 } else
2816
- if (event.getSource() == unselectButton)
3002
+ if (source == unselectButton)
28173003 {
28183004 objEditor.jTree.clearSelection();
28193005 // ?? oct 2012 GrafreeD.clipboard.clear();
28203006 objEditor.ResetSliders();
28213007 refreshContents(true);
28223008 } else
2823
- if(event.getSource() instanceof cRadio)
3009
+ if(source instanceof cRadio)
28243010 {
28253011 group.parent = keepparent;
28263012 group.attributes = 0;
28273013 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3014
+ /*cRadio*/ radio = (cRadio)source;
28293015 Object3D obj = radio.GetObject();
28303016 System.out.println("Edit " + obj);
28313017 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3031,7 @@
28453031 }
28463032
28473033 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3034
+ //Globals.theRenderer.object = group;
28493035 if(!useclient)
28503036 {
28513037 cameraView.renderCamera = radio.camera;
....@@ -2854,7 +3040,8 @@
28543040 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553041 cameraView.targetLookAt.set(radio.camera.lookAt);
28563042 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3043
+ //cameraView.lighttouched = true;
3044
+ Globals.lighttouched = true;
28583045 topView.object = group;
28593046 frontView.object = group;
28603047 sideView.object = group;
....@@ -2890,7 +3077,7 @@
28903077 if (useclient)
28913078 {
28923079 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3080
+ Globals.lighttouched = true;
28943081 //topView.object = client;
28953082 //frontView.object = client;
28963083 //sideView.object = client;
....@@ -2898,7 +3085,7 @@
28983085 else
28993086 {
29003087 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3088
+ Globals.lighttouched = true;
29023089 //topView.object = group;
29033090 //frontView.object = group;
29043091 //sideView.object = group;
....@@ -3179,6 +3366,13 @@
31793366 refreshContents();
31803367 }
31813368
3369
+ void GenNormalsMINE()
3370
+ {
3371
+ group.selection.GenNormalsMINE();
3372
+
3373
+ refreshContents();
3374
+ }
3375
+
31823376 void Stripify()
31833377 {
31843378 group.StripifyS();
....@@ -3399,7 +3593,7 @@
33993593 String pigment = Object3D.GetPigment(tex);
34003594 //String bump = Object3D.GetBump(tex);
34013595
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3596
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34033597
34043598 double s = v.s;
34053599
....@@ -3447,12 +3641,26 @@
34473641
34483642 void Align()
34493643 {
3644
+ if (group.selection.size() == 0)
3645
+ return;
3646
+
3647
+ cVector bbmin = new cVector();
3648
+ cVector bbmax = new cVector();
3649
+
3650
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3651
+
3652
+ double dx = bbmax.x - bbmin.x;
3653
+ double dy = bbmax.y - bbmin.y;
3654
+ double dz = bbmax.z - bbmin.z;
3655
+
3656
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3657
+
34503658 for (int i=0; i<group.selection.size(); i++)
34513659 {
34523660 Object3D obj = group.selection.get(i);
34533661
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3662
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3663
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563664 }
34573665
34583666 refreshContents();
....@@ -3473,11 +3681,11 @@
34733681
34743682 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753683
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3684
+ boolean random = CameraPane.SWITCH;
3685
+ CameraPane.SWITCH = false; // parse all random nodes
34783686 lowres.linkVerticesThis(null);
34793687 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3688
+ CameraPane.SWITCH = random;
34813689
34823690 System.err.flush();
34833691
....@@ -3686,7 +3894,7 @@
36863894 group.selection.RelinkToSupport(); // july 2014
36873895 System.out.println("DONE.");
36883896 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3897
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36903898 }
36913899
36923900 void ReduceMesh(boolean reduction34)
....@@ -3962,25 +4170,25 @@
39624170 System.err.println("info : " + child.GetPath());
39634171 }
39644172 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4173
+// else
4174
+// {
4175
+// objEditor.SetMaterial(group); // .GetMaterial());
4176
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4177
+// System.err.println("info : " + group.GetPath());
4178
+// }
39714179
39724180 objEditor.SetText(); // jan 2014
39734181
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4182
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39754183 CameraPane.flash = true;
39764184
39774185 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784186 // a camera
39794187 {
39804188 CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4189
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4190
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4191
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844192 }
39854193
39864194 refreshContents();
....@@ -4235,7 +4443,7 @@
42354443 refreshContents();
42364444 }
42374445
4238
- void pasteInto(boolean copyit)
4446
+ void pasteInto(boolean copyit, boolean clone)
42394447 {
42404448 // if (GrafreeD.clipboard == null)
42414449 // return;
....@@ -4264,7 +4472,14 @@
42644472 if (copyit)
42654473 {
42664474 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4475
+ if (clone)
4476
+ {
4477
+ CloneClipboard(false); // sept 2014
4478
+ }
4479
+ else
4480
+ {
4481
+ paste(false);
4482
+ }
42684483 }
42694484 else
42704485 {
....@@ -4474,6 +4689,26 @@
44744689 makeSomething(csg);
44754690 }
44764691
4692
+ void Ungroup(Object3D g)
4693
+ {
4694
+ if (g instanceof HiddenObject)
4695
+ {
4696
+ HiddenObject h = (HiddenObject) g;
4697
+
4698
+ for (int i=0; i<h.ActualSize(); i++)
4699
+ {
4700
+ objEditor.makeSomething(h.get(i), false);
4701
+ }
4702
+ }
4703
+ else
4704
+ {
4705
+ for (int i=0; i<g.Size(); i++)
4706
+ {
4707
+ objEditor.makeSomething(g.get(i), false);
4708
+ }
4709
+ }
4710
+ }
4711
+
44774712 void ungroup()
44784713 {
44794714 /*
....@@ -4788,10 +5023,12 @@
47885023 cButton flashSelectionButton;
47895024 cButton editButton;
47905025 cButton uneditButton;
5026
+ JCheckBox allParamsButton;
47915027 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935028 cButton unselectButton;
47945029
5030
+ cButton oneStepButton;
5031
+
47955032 cButton screenfitButton;
47965033 cButton screenfitpointButton;
47975034 cButton snapobjectButton;
....@@ -4833,6 +5070,7 @@
48335070 private MenuItem resetsupportItem;
48345071 private MenuItem resetreferencesItem;
48355072 private MenuItem linkverticesItem;
5073
+ private MenuItem relinkverticesItem;
48365074 private MenuItem setMasterItem;
48375075 private MenuItem resetMeshItem;
48385076 private MenuItem stepAllItem;
....@@ -4845,6 +5083,7 @@
48455083 private MenuItem mergeGeometriesItem;
48465084 private MenuItem copyItem;
48475085 private MenuItem pasteItem;
5086
+ private MenuItem pasteIntoItem;
48485087 private MenuItem pasteLinkItem;
48495088 private MenuItem pasteCloneItem;
48505089 private MenuItem pasteExpandItem;
....@@ -4854,6 +5093,7 @@
48545093 private MenuItem genNormalsMESHItem;
48555094 private MenuItem genNormalsCADItem;
48565095 private MenuItem genNormalsORGANItem;
5096
+ private MenuItem genNormalsMINEItem;
48575097 private MenuItem stripifyItem;
48585098 private MenuItem unstripifyItem;
48595099 private MenuItem trimItem;
....@@ -4895,6 +5135,7 @@
48955135 private MenuItem resetCentroidItem;
48965136 private MenuItem transformgeometryItem;
48975137 private MenuItem resetTransformItem;
5138
+ private MenuItem hideItem;
48985139 private MenuItem grabItem;
48995140 private MenuItem backItem;
49005141 private MenuItem frontItem;
....@@ -4915,6 +5156,7 @@
49155156
49165157 private MenuItem resetParentItem;
49175158 private MenuItem repairParentItem;
5159
+ private MenuItem repairShadowItem;
49185160 private MenuItem sortbysizeItem;
49195161 private MenuItem sortbynameItem;
49205162
....@@ -4935,10 +5177,11 @@
49355177 private MenuItem coneItem;
49365178 private MenuItem torusItem;
49375179 private MenuItem superItem;
5180
+ private MenuItem kleinItem;
49385181 private MenuItem blobItem;
49395182 private MenuItem latheItem;
49405183 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5184
+ private MenuItem overlayItem;
49425185 private MenuItem meshItem;
49435186 // private MenuItem meshGroupItem;
49445187 private MenuItem springItem;
....@@ -4947,6 +5190,7 @@
49475190 private MenuItem csgItem;
49485191 private MenuItem templateItem;
49495192 private MenuItem textureItem;
5193
+ private MenuItem billboardItem;
49505194 private MenuItem shadowXItem;
49515195 private MenuItem shadowYItem;
49525196 private MenuItem shadowZItem;