Normand Briere
2019-06-09 3ae9b1de47e51e7c150412f2bb14383cb6a5f8f8
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,
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.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(GrafreeD.clipboard, false));
107
- GrafreeD.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)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -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,17 +163,21 @@
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("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,27 +185,37 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
211
+ if (Globals.ADVANCED)
212
+ {
197213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198214 revertMeshItem.addActionListener(this);
199215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200216 resetreferencesItem.addActionListener(this);
201217 menu.add("-");
218
+ }
202219 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203220 overwriteGeoItem.addActionListener(this);
204221 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +227,26 @@
210227 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211228 overwriteUVItem.addActionListener(this);
212229 menu.add("-");
230
+ if (Globals.ADVANCED)
231
+ {
213232 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214233 generateMeshItem.addActionListener(this);
215234 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216235 poseMeshItem.addActionListener(this);
217236 menu.add("-");
237
+ }
218238 resetsupportItem = menu.add(new MenuItem("Reset support"));
219239 resetsupportItem.addActionListener(this);
220240 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221241 linkverticesItem.addActionListener(this);
222242 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223243 relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
224247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225248 setMasterItem.addActionListener(this);
249
+ }
226250
227251 oe.menuBar.add(menu = new Menu("Group"));
228252 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +257,32 @@
233257 frontItem.addActionListener(this);
234258 compositeItem = menu.add(new MenuItem("Composite"));
235259 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237261 hideItem.addActionListener(this);
238262 ungroupItem = menu.add(new MenuItem("Ungroup"));
239263 ungroupItem.addActionListener(this);
240264 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
242266 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248268 switchGeoItem.addActionListener(this);
249269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250270 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
252272 morphItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ menu.add("-");
277
+ physicsItem = menu.add(new MenuItem("Physics"));
278
+ physicsItem.addActionListener(this);
279
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
280
+ frameselectorItem.addActionListener(this);
253281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254282 scriptNodeItem.addActionListener(this);
255283 cameraItem = menu.add(new MenuItem("Camera"));
256284 cameraItem.addActionListener(this);
285
+ }
257286
258287 oe.menuBar.add(menu = new Menu("Object"));
259288 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +297,29 @@
268297 shadowYItem.addActionListener(this);
269298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
271303 linkerItem = menu.add(new MenuItem("Linker"));
272304 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275305 attributeItem = menu.add(new MenuItem("Attribute"));
276306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
277309 pointflowItem = menu.add(new MenuItem("Point Flow"));
278310 pointflowItem.addActionListener(this);
311
+ }
279312 menu.add("-");
280313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281314 resetTransformItem.addActionListener(this);
282315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283316 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
317
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
318
+ resetCentroidXZItem.addActionListener(this);
319
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
320
+ transformGeometryItem.addActionListener(this);
321
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
322
+ transformChildrenItem.addActionListener(this);
286323
287324 oe.menuBar.add(menu = new Menu("Geometry"));
288325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +356,34 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326370 clearMaterialsItem.addActionListener(this);
371
+ resetAllItem = menu.add(new MenuItem("Reset All"));
372
+ resetAllItem.addActionListener(this);
373
+ stepAllItem = menu.add(new MenuItem("Step All"));
374
+ stepAllItem.addActionListener(this);
327375 menu.add("-");
328376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329377 liveleavesItem.addActionListener(this);
330378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
332382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333383 supportleavesItem.addActionListener(this);
334384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335385 unsupportleavesItem.addActionListener(this);
386
+ }
336387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337388 hideleavesItem.addActionListener(this);
338389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,28 +427,34 @@
376427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377428 sortbynameItem.addActionListener(this);
378429 menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ // Pretty much the same as duplicate and clone.
379437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380438 extractGeometriesItem.addActionListener(this);
381439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382440 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
441
+ }
387442
388443 oe.menuBar.add(menu = new Menu("Insert"));
389444 buildCreateMenu(menu);
390445
391
-
392446 oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398448 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
401458
402459 oe.menuBar.add(menu = new Menu("Tools"));
403460 buildToolsMenu(menu);
....@@ -433,110 +490,98 @@
433490 oe.radioPanel.add(dummyButton);
434491 oe.buttonGroup.add(dummyButton);
435492 */
436
- aConstraints.gridy += 1;
437
-
438493 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439494
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
445497 liveCB.addItemListener(this);
446498
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500
+ oneStepButton.setToolTipText("Animate one step forward");
501
+ oneStepButton.addActionListener(this);
502
+
503
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
504
+ fastCB.setToolTipText("Fast mode");
505
+ fastCB.addItemListener(this);
506
+
507
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449508 trackCB.setToolTipText("Enable tracking");
450509 trackCB.addItemListener(this);
451510
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454512 screenfitButton.setToolTipText("Screen fit");
455513 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
514
+
457515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458516 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464517
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
518
+ if (Globals.ADVANCED)
519
+ {
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521
+ snapobjectButton.addActionListener(this);
522
+ snapobjectButton.setToolTipText("Snap Object");
523
+ }
524
+
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471526 flashSelectionButton.setToolTipText("Show selection");
472527 flashSelectionButton.addActionListener(this);
473528
474
- oe.toolbarPanel.add(new cButton(" ", false));
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475530
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482532 twoButton.setToolTipText("Show center view only");
483533 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485535 fourButton.addActionListener(this);
486536 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488538 sixButton.setToolTipText("2-column layout left");
489539 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491541 threeButton.setToolTipText("2-column layout right");
492542 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494544 sevenButton.setToolTipText("3-column layout");
495545 sevenButton.addActionListener(this);
496546 //
497547
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
+ rootButton.setToolTipText("Edit selection in new tab");
500550 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503553 closeButton.setToolTipText("Close tab");
504554 closeButton.addActionListener(this);
505555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506556 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508557
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
558
+ cGridBag commandsPanel = new cGridBag();
559
+
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ editButton.setToolTipText("Edit selection");
511562 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515563
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
517566 uneditButton.addActionListener(this);
518567
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
568
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
+ allParamsButton.setToolTipText("Edit all params");
531570 allParamsButton.addActionListener(this);
532571
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ clearPanelButton.setToolTipText("Clear edit panel");
574
+ clearPanelButton.addActionListener(this);
575
+
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ unselectButton.setToolTipText("Unselect");
538578 unselectButton.addActionListener(this);
539579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
540585 // oe.aConstraints.gridx += 1;
541586 // oe.aConstraints.weighty = 0;
542587 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +593,37 @@
548593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549594 // gcButton.addActionListener(this);
550595
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
562599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
600
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564601 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
569605
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
+ cGridBag copyOptionsPanel = new cGridBag();
607
+
608
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
+ colorCB.setToolTipText("Copy color when dropped");
574610 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
611
+
612
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
+ materialCB.setToolTipText("Copy material when dropped");
577614 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
615
+
616
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
+ textureCB.setToolTipText("Copy texture when dropped");
580618 textureCB.addItemListener(this);
581619
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
584623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
585627 //jList.addListSelectionListener(this);
586628 oe.jTree.addTreeSelectionListener(this);
587629 //jTree.setRootVisible(false);
....@@ -604,45 +646,37 @@
604646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605647 }
606648
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
649
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608650 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
651
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639652 boxCB.setToolTipText("Display bounding boxes");
640653 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
654
+
655
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644657 zoomBoxCB.addItemListener(this);
645658
659
+ if (true) // Globals.ADVANCED)
660
+ {
661
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
+ supportCB.setToolTipText("Enable rigging");
663
+ supportCB.addItemListener(this);
664
+
665
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
666
+ // localCB.addItemListener(this);
667
+
668
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
669
+ crowdCB.setToolTipText("Used for crowds");
670
+ crowdCB.addItemListener(this);
671
+
672
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
673
+ smoothCB.setToolTipText("Snapping delay");
674
+ smoothCB.addItemListener(this);
675
+
676
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
677
+ slowCB.setToolTipText("Smooth interpolation");
678
+ slowCB.addItemListener(this);
679
+
646680 // constraints.gridy += 1;
647681 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648682 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +684,16 @@
650684 if (false)
651685 {
652686 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
687
+ //constraints.gridy += 1;
688
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655689 speakerCameraCB.addItemListener(this);
656690
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
691
+ //constraints.gridy += 1;
692
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659693 speakerFocusCB.addItemListener(this);
660694
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
695
+ //constraints.gridy += 1;
696
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663697 smoothfocusCB.addItemListener(this);
664698 }
665699
....@@ -667,14 +701,20 @@
667701 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668702 // debugCB.addItemListener(this);
669703
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
704
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672705 oeilCB.addItemListener(this);
673706
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
707
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676708 lookAtCB.setToolTipText("Look-at target");
677709 lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
678718
679719 }
680720
....@@ -689,6 +729,7 @@
689729 buttonGroup.add(radioButton);
690730 radioButton.doClick();
691731 }
732
+
692733 void SetupViews(ObjEditor oe)
693734 {
694735 oe.SetupViews();
....@@ -905,7 +946,9 @@
905946 // objEditor.DropFile((java.io.File[]) object, true);
906947 // return;
907948 // }
908
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
909952 {
910953 // file(s)
911954 String[] names = string.split("\n");
....@@ -932,7 +975,7 @@
932975
933976 flashIt = false;
934977 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
936979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
937980
938981 if (group.selection.size() == 1)
....@@ -959,11 +1002,11 @@
9591002 {
9601003 loadClipboard(true);
9611004 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1005
+ pasteInto(false, false);
9631006 } else {
9641007 loadClipboard(false);
9651008 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9671010 }
9681011 }
9691012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1128,33 @@
10851128 kleinItem.addActionListener(this);
10861129 particleItem = menu.add(new MenuItem("Particle system"));
10871130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10881133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891134 ragdollItem.addActionListener(this);
10901135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911136 ragdoll2Item.addActionListener(this);
1137
+ }
10921138 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941140 meshItem.addActionListener(this);
10951141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10971145 springItem = menu.add(new MenuItem("Spring"));
10981146 springItem.addActionListener(this);
10991147 flagItem = menu.add(new MenuItem("Flag"));
11001148 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051149 blobItem = menu.add(new MenuItem("Blob"));
11061150 blobItem.addActionListener(this);
11071151 latheItem = menu.add(new MenuItem("Lathe"));
11081152 latheItem.addActionListener(this);
1153
+ }
1154
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1155
+ bezierItem.addActionListener(this);
1156
+ overlayItem = menu.add(new MenuItem("Overlay"));
1157
+ overlayItem.addActionListener(this);
11091158 lightItem = menu.add(new MenuItem("Light"));
11101159 lightItem.addActionListener(this);
11111160 menu.add("-");
....@@ -1115,34 +1164,39 @@
11151164 loopItem.addActionListener(this);
11161165 doubleItem = menu.add(new MenuItem("Fork"));
11171166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
11181169 tripleItem = menu.add(new MenuItem("Trident"));
11191170 tripleItem.addActionListener(this);
1171
+ }
11201172 }
11211173
11221174 void buildToolsMenu(Menu menu)
11231175 {
11241176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251177 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
11271179
11281180 menu.add("-");
11291181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301182 parseverticesItem.addActionListener(this);
11311183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321184 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341186 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381188 reduceMorphItem.addActionListener(this);
11391189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401190 reduce34MorphItem.addActionListener(this);
1141
-
1191
+ menu.add("-");
11421192 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431193 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
11461200 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471201 memoryItem.addActionListener(this);
11481202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1219,7 @@
11651219 menu.add("-");
11661220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671221 editScriptItem.addActionListener(this);
1222
+ }
11681223 }
11691224
11701225 void ScreenFit()
....@@ -1493,9 +1548,9 @@
14931548
14941549 void Overwrite(int mask)
14951550 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971552 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14991554
15001555 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011556 content = ((cGroup)content).get(0);
....@@ -1666,7 +1721,7 @@
16661721 {
16671722 makeSomething(new BezierSurface());
16681723 } else
1669
- if (source == checkerItem)
1724
+ if (source == overlayItem)
16701725 {
16711726 /*
16721727 Object3D obj = new BezierSurface(5,8);
....@@ -1815,7 +1870,15 @@
18151870 } else
18161871 if (source == importOBJItem)
18171872 {
1818
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1874
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1875
+ browser.setVisible(true);
1876
+ String filename = browser.getFile();
1877
+ if (filename != null && filename.length() > 0)
1878
+ {
1879
+ String fullname = browser.getDirectory() + filename;
1880
+ makeSomething(ReadOBJ(fullname), true);
1881
+ }
18191882 } else
18201883 if (source == computeAOItem)
18211884 {
....@@ -1835,7 +1898,7 @@
18351898 if (source == invariantsItem)
18361899 {
18371900 System.out.println("Invariants:");
1838
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
18391902 } else
18401903 if (source == memoryItem)
18411904 {
....@@ -1853,6 +1916,11 @@
18531916 if (source == dumpItem)
18541917 {
18551918 DumpObject();
1919
+ } else
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
18561924 } else
18571925 if (source == screenfitButton)
18581926 {
....@@ -1905,10 +1973,10 @@
19051973 } else
19061974 if (source == duplicateItem)
19071975 {
1908
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
19091977 loadClipboard(false);
19101978 paste(false);
1911
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
19121980 } else
19131981 if (source == cloneItem)
19141982 {
....@@ -1926,13 +1994,17 @@
19261994 {
19271995 paste(false);
19281996 } else
1997
+ if (source == pasteIntoItem)
1998
+ {
1999
+ pasteInto(true, false);
2000
+ } else
19292001 if (source == pasteLinkItem)
19302002 {
1931
- pasteInto(false);
2003
+ pasteInto(false, false);
19322004 } else
19332005 if (source == pasteCloneItem)
19342006 {
1935
- pasteInto(true);
2007
+ pasteInto(true, true);
19362008 } else
19372009 if (source == pasteExpandItem)
19382010 {
....@@ -2124,9 +2196,9 @@
21242196 // group.selection.get(0).setMasterThis(content); // should be identity
21252197 // refreshContents();
21262198 // }
2127
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21282200 {
2129
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
21302202
21312203 if (content instanceof cGroup && ((cGroup)content).transientlink )
21322204 content = ((cGroup)content).get(0);
....@@ -2134,11 +2206,11 @@
21342206 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352207 for (int i=0; i<group.selection.size(); i++)
21362208 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
21392211 group.selection.get(i).linkVerticesThis(content);
21402212 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
21422214 }
21432215 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442216 refreshContents();
....@@ -2148,20 +2220,20 @@
21482220 {
21492221 for (int i=0; i<group.selection.size(); i++)
21502222 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
21532225 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
21552227 }
21562228
21572229 refreshContents();
21582230 } else
21592231 if (source == relinkverticesItem)
21602232 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
21632235 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2236
+ CameraPane.SWITCH = random;
21652237
21662238 refreshContents();
21672239 } else
....@@ -2176,9 +2248,9 @@
21762248 } else
21772249 if (source == setMasterItem)
21782250 {
2179
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21802252 {
2181
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21822254
21832255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21842256 content = ((cGroup)content).get(0);
....@@ -2191,9 +2263,9 @@
21912263 {
21922264 if (group.selection.size() == 1)
21932265 {
2194
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21952267 {
2196
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21972269
21982270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21992271 content = ((cGroup)content).get(0);
....@@ -2210,7 +2282,7 @@
22102282 {
22112283 RevertMeshes();
22122284 } else
2213
- if (source == resetMeshItem)
2285
+ if (source == resetAllItem)
22142286 {
22152287 ResetAll();
22162288 } else
....@@ -2259,7 +2331,7 @@
22592331 RandomNode random = new RandomNode();
22602332 group(random);
22612333 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
22632335 } else
22642336 if (source == physicsItem)
22652337 {
....@@ -2548,9 +2620,13 @@
25482620 {
25492621 SmoothMesh();
25502622 } else
2551
- if (source == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
25522624 {
25532625 TransformGeometry();
2626
+ } else
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
25542630 } else
25552631 if (source == resetTransformItem)
25562632 {
....@@ -2558,7 +2634,11 @@
25582634 } else
25592635 if (source == resetCentroidItem)
25602636 {
2561
- ResetCentroid();
2637
+ ResetCentroid(true);
2638
+ } else
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
25622642 } else
25632643 if (source == resetParentItem)
25642644 {
....@@ -2916,7 +2996,7 @@
29162996
29172997 child.editWindow = null; // ???????????
29182998 }
2919
- objEditor.ctrlPanel.revalidate();
2999
+ objEditor.ctrlPanel.FlushUI();
29203000 //objEditor.jTree.clearSelection();
29213001 //objEditor.ResetSliders();
29223002 refreshContents(true);
....@@ -3000,7 +3080,9 @@
30003080 frontView.object = group;
30013081 sideView.object = group;
30023082 }
3003
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
30043086 /*
30053087 currentLayout = radio.layout;
30063088 if (currentLayout == null)
....@@ -3074,6 +3156,28 @@
30743156 refreshContents();
30753157 }
30763158
3159
+ void TransformChildren()
3160
+ {
3161
+ Object3D obj;
3162
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3163
+ {
3164
+ obj = (Object3D)e.nextElement();
3165
+ obj.KeepTextureMatrices();
3166
+ obj.TransformChildren();
3167
+ obj.RestoreTextureMatrices();
3168
+
3169
+// if (obj.parent == null)
3170
+// {
3171
+// System.out.println("NULL PARENT!");
3172
+// new Exception().printStackTrace();
3173
+// }
3174
+// else
3175
+// TouchTransform(obj);
3176
+// //obj.parent.Touch();
3177
+ }
3178
+
3179
+ refreshContents();
3180
+ }
30773181
30783182 void ResetTransform()
30793183 {
....@@ -3186,7 +3290,7 @@
31863290 refreshContents();
31873291 }
31883292
3189
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
31903294 {
31913295 Object3D obj;
31923296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3201,12 +3305,16 @@
32013305 LA.matIdentity(Object3D.mat);
32023306 obj.getBounds(minima, maxima, false);
32033307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3204
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32053310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32063311 obj.TransformMesh(Object3D.mat);
3312
+
32073313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3208
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32093316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
32103318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32113319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32123320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3272,9 +3380,9 @@
32723380 obj = (Object3D)e.nextElement();
32733381
32743382 System.out.println("Object is: " + obj);
3275
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
32763384 System.out.println("Boundary rep: " + obj.bRep);
3277
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
32783386
32793387 // System.err.println((size/1024) + " KB is the size of " + obj);
32803388 }
....@@ -3488,8 +3596,8 @@
34883596
34893597 void ParseVertices()
34903598 {
3491
- boolean epsequal = GrafreeD.epsequal;
3492
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
34933601
34943602 for (int i=0; i<group.selection.size(); i++)
34953603 {
....@@ -3514,7 +3622,7 @@
35143622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35153623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35163624
3517
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
35183626
35193627 buffer.add(g);
35203628 }
....@@ -3529,7 +3637,7 @@
35293637 makeSomething(buffer, i==group.selection.size()-1);
35303638 }
35313639
3532
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
35333641
35343642 refreshContents();
35353643 }
....@@ -3547,7 +3655,16 @@
35473655 String pigment = Object3D.GetPigment(tex);
35483656 //String bump = Object3D.GetBump(tex);
35493657
3550
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3658
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3659
+
3660
+ try
3661
+ {
3662
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3663
+ }
3664
+ catch (Exception e)
3665
+ {
3666
+ System.err.println("FAIL: " + node);
3667
+ }
35513668
35523669 double s = v.s;
35533670
....@@ -3635,11 +3752,11 @@
36353752
36363753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36373754
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
36403757 lowres.linkVerticesThis(null);
36413758 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
36433760
36443761 System.err.flush();
36453762
....@@ -3679,7 +3796,7 @@
36793796 return;
36803797
36813798 Object3D poses = group.selection.get(0);
3682
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
36833800
36843801 Object3D newgroup = new Object3D("Po:" + poses.name);
36853802
....@@ -3873,9 +3990,9 @@
38733990
38743991 void ClipMesh()
38753992 {
3876
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38773994 {
3878
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
38793996
38803997 if (content instanceof cGroup && ((cGroup)content).transientlink )
38813998 content = ((cGroup)content).get(0);
....@@ -3884,7 +4001,7 @@
38844001 // {
38854002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38864003 // }
3887
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
38884005 }
38894006 // group.selection.ClipMesh(GrafreeD.clipboard);
38904007 System.out.println("DONE.");
....@@ -4019,7 +4136,7 @@
40194136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40204137
40214138 Object3D elem = (Object3D)group.selection.elementAt(i);
4022
- if(elem != group)
4139
+ if(elem != group || !newWindow)
40234140 {
40244141 // if (!(elem instanceof Composite))
40254142 // newWindow = false;
....@@ -4124,12 +4241,12 @@
41244241 System.err.println("info : " + child.GetPath());
41254242 }
41264243 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
41334250
41344251 objEditor.SetText(); // jan 2014
41354252
....@@ -4224,12 +4341,12 @@
42244341 {
42254342 if (group.selection.isEmpty())
42264343 return;
4227
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
42284345 Composite tGroup = null;
42294346 if (group.selection.size() > 0) // 1)
42304347 {
42314348 tGroup = new cGroup();
4232
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
42334350 }
42344351
42354352 if (cut)
....@@ -4269,16 +4386,16 @@
42694386 //System.out.println("cut " + child);
42704387 //System.out.println("parent = " + child.parent);
42714388 // tmp.addChild(child);
4272
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
42734390 tGroup.add/*Child*/(tmp);
42744391 else
4275
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
42764393 }
42774394 else
4278
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
42794396 tGroup.add/*Child*/(child);
42804397 else
4281
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
42824399 }
42834400
42844401 //ResetModel();
....@@ -4310,21 +4427,21 @@
43104427 //System.out.println("cut " + elem);
43114428 //System.out.println("parent = " + elem.parent);
43124429 // tmp.addChild(elem);
4313
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
43144431 tGroup.add/*Child*/(tmp);
43154432 else
4316
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
43174434 }
43184435 else
4319
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
43204437 tGroup.add/*Child*/(child);
43214438 else
4322
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
43234440 }
43244441
43254442 }
4326
- if (GrafreeD.clipboardIsTempGroup)
4327
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
43284445 if (cut)
43294446 {
43304447 ResetModel();
....@@ -4338,7 +4455,7 @@
43384455 // return;
43394456 boolean first = true;
43404457
4341
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
43424459 {
43434460 Composite temp;
43444461
....@@ -4349,7 +4466,7 @@
43494466 temp = (Composite)Applet3D.clipboard.deepCopy();
43504467 */
43514468 Object3D elem;
4352
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4469
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43534470 {
43544471 Object3D child = (Object3D)e.nextElement();
43554472
....@@ -4383,21 +4500,21 @@
43834500 //Object3D cb = Applet3D.clipboard;
43844501 //temp.addChild(cb);
43854502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4386
- assert(GrafreeD.clipboard.parent == null);
4387
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4388
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4389
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4390
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4503
+ assert(Grafreed.clipboard.parent == null);
4504
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4505
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4506
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4507
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43914508 else
4392
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4393
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
43944511 }
43954512
43964513 ResetModel();
43974514 refreshContents();
43984515 }
43994516
4400
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
44014518 {
44024519 // if (GrafreeD.clipboard == null)
44034520 // return;
....@@ -4426,15 +4543,22 @@
44264543 if (copyit)
44274544 {
44284545 // paste(false);
4429
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
44304554 }
44314555 else
44324556 {
44334557 boolean first = true;
44344558
4435
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
44364560 {
4437
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
44384562 Object3D copy;
44394563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44404564 {
....@@ -4444,7 +4568,7 @@
44444568 }
44454569 } else
44464570 {
4447
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
44484572 }
44494573 }
44504574 }
....@@ -4889,7 +5013,7 @@
48895013
48905014 void ImportVRMLX3D()
48915015 {
4892
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
48935017 {
48945018 /**/
48955019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4906,7 +5030,7 @@
49065030
49075031 String GetFile(String dialogName)
49085032 {
4909
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
49105034 {
49115035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49125036 browser.show();
....@@ -4970,10 +5094,12 @@
49705094 cButton flashSelectionButton;
49715095 cButton editButton;
49725096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
49735098 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755099 cButton unselectButton;
49765100
5101
+ cButton oneStepButton;
5102
+
49775103 cButton screenfitButton;
49785104 cButton screenfitpointButton;
49795105 cButton snapobjectButton;
....@@ -5017,7 +5143,7 @@
50175143 private MenuItem linkverticesItem;
50185144 private MenuItem relinkverticesItem;
50195145 private MenuItem setMasterItem;
5020
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
50215147 private MenuItem stepAllItem;
50225148 private MenuItem revertMeshItem;
50235149 private MenuItem poseMeshItem;
....@@ -5028,6 +5154,7 @@
50285154 private MenuItem mergeGeometriesItem;
50295155 private MenuItem copyItem;
50305156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
50315158 private MenuItem pasteLinkItem;
50325159 private MenuItem pasteCloneItem;
50335160 private MenuItem pasteExpandItem;
....@@ -5077,8 +5204,10 @@
50775204 private MenuItem panoTexturesItem;
50785205
50795206 private MenuItem resetCentroidItem;
5080
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
50815208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
50825211 private MenuItem hideItem;
50835212 private MenuItem grabItem;
50845213 private MenuItem backItem;
....@@ -5125,7 +5254,7 @@
51255254 private MenuItem blobItem;
51265255 private MenuItem latheItem;
51275256 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
51295258 private MenuItem meshItem;
51305259 // private MenuItem meshGroupItem;
51315260 private MenuItem springItem;