Normand Briere
2019-05-13 f924d3e00db476c06f55f3d5aaef307e17575340
GroupEditor.java
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
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));
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));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -150,6 +150,8 @@
150150
151151 void SetupMenu2(ObjEditor oe)
152152 {
153
+ if (Globals.ADVANCED)
154
+ {
153155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,17 +163,21 @@
161163 lookAtItem.addActionListener(this);
162164 //lookFromItem.addActinoListener(this);
163165 //switchItem.addActionListener(this);
166
+ }
167
+
164168 Menu menu;
165169 oe.menuBar.add(menu = new Menu("Edit"));
166170 //editItem = menu.add(new MenuItem("Edit"));
167171 //editItem.addActionListener(this);
168172 duplicateItem = menu.add(new MenuItem("Duplicate"));
169173 duplicateItem.addActionListener(this);
170
- menu.add("-");
171174 cloneItem = menu.add(new MenuItem("Clone"));
172175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
173178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174179 cloneSupportItem.addActionListener(this);
180
+ }
175181 menu.add("-");
176182 cutItem = menu.add(new MenuItem("Cut"));
177183 cutItem.addActionListener(this);
....@@ -179,18 +185,31 @@
179185 copyItem.addActionListener(this);
180186 pasteItem = menu.add(new MenuItem("Paste"));
181187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
182193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183194 pasteLinkItem.addActionListener(this);
184195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185196 pasteCloneItem.addActionListener(this);
186197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
188200 clearItem = menu.add(new MenuItem("Clear"));
189201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
190206 clearAllItem = menu.add(new MenuItem("Clear All"));
191207 clearAllItem.addActionListener(this);
208
+ }
192209
193210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
194213 resetMeshItem = menu.add(new MenuItem("Reset All"));
195214 resetMeshItem.addActionListener(this);
196215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -200,6 +219,7 @@
200219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201220 resetreferencesItem.addActionListener(this);
202221 menu.add("-");
222
+ }
203223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204224 overwriteGeoItem.addActionListener(this);
205225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +231,26 @@
211231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212232 overwriteUVItem.addActionListener(this);
213233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
214236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215237 generateMeshItem.addActionListener(this);
216238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217239 poseMeshItem.addActionListener(this);
218240 menu.add("-");
241
+ }
219242 resetsupportItem = menu.add(new MenuItem("Reset support"));
220243 resetsupportItem.addActionListener(this);
221244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222245 linkverticesItem.addActionListener(this);
223246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
225251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226252 setMasterItem.addActionListener(this);
253
+ }
227254
228255 oe.menuBar.add(menu = new Menu("Group"));
229256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,27 +261,32 @@
234261 frontItem.addActionListener(this);
235262 compositeItem = menu.add(new MenuItem("Composite"));
236263 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238265 hideItem.addActionListener(this);
239266 ungroupItem = menu.add(new MenuItem("Ungroup"));
240267 ungroupItem.addActionListener(this);
241268 menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
243270 randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
248271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249272 switchGeoItem.addActionListener(this);
250273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251274 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
253276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
254285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255286 scriptNodeItem.addActionListener(this);
256287 cameraItem = menu.add(new MenuItem("Camera"));
257288 cameraItem.addActionListener(this);
289
+ }
258290
259291 oe.menuBar.add(menu = new Menu("Object"));
260292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -269,21 +301,29 @@
269301 shadowYItem.addActionListener(this);
270302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
271303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
272307 linkerItem = menu.add(new MenuItem("Linker"));
273308 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276309 attributeItem = menu.add(new MenuItem("Attribute"));
277310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
278313 pointflowItem = menu.add(new MenuItem("Point Flow"));
279314 pointflowItem.addActionListener(this);
315
+ }
280316 menu.add("-");
281317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282318 resetTransformItem.addActionListener(this);
283319 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284320 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
321
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
322
+ resetCentroidXZItem.addActionListener(this);
323
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
324
+ transformGeometryItem.addActionListener(this);
325
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
326
+ transformChildrenItem.addActionListener(this);
287327
288328 oe.menuBar.add(menu = new Menu("Geometry"));
289329 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +334,11 @@
294334 genNormalsCADItem.addActionListener(this);
295335 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296336 genNormalsMESHItem.addActionListener(this);
337
+ if (Globals.ADVANCED)
338
+ {
297339 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298340 genNormalsMINEItem.addActionListener(this);
341
+ }
299342 stripifyItem = menu.add(new MenuItem("Stripify"));
300343 stripifyItem.addActionListener(this);
301344 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,10 +360,14 @@
317360 reduce34MeshItem.addActionListener(this);
318361 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319362 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322363 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323364 clipMeshItem.addActionListener(this);
365
+
366
+ if (Globals.ADVANCED)
367
+ {
368
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
369
+ smoothMeshItem.addActionListener(this);
370
+ }
324371
325372 oe.menuBar.add(menu = new Menu("Attributes"));
326373 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -330,10 +377,13 @@
330377 liveleavesItem.addActionListener(this);
331378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
333382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334383 supportleavesItem.addActionListener(this);
335384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336385 unsupportleavesItem.addActionListener(this);
386
+ }
337387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338388 hideleavesItem.addActionListener(this);
339389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -377,28 +427,34 @@
377427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378428 sortbynameItem.addActionListener(this);
379429 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.
380437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381438 extractGeometriesItem.addActionListener(this);
382439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383440 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
441
+ }
388442
389443 oe.menuBar.add(menu = new Menu("Insert"));
390444 buildCreateMenu(menu);
391445
392
-
393446 oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
399448 importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
401451 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);
402458
403459 oe.menuBar.add(menu = new Menu("Tools"));
404460 buildToolsMenu(menu);
....@@ -440,55 +496,60 @@
440496 liveCB.setToolTipText("Enabled animation");
441497 liveCB.addItemListener(this);
442498
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
+
443507 oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444508 trackCB.setToolTipText("Enable tracking");
445509 trackCB.addItemListener(this);
446510
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448512 screenfitButton.setToolTipText("Screen fit");
449513 screenfitButton.addActionListener(this);
450514
451515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452516 // screenfitpointButton.addActionListener(this);
453
-// oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455
- snapobjectButton.addActionListener(this);
456
- snapobjectButton.setToolTipText("Snap Object");
457
- oe.aConstraints.gridx += 1;
458517
459
- //aConstraints.gridx = 0;
460
- //aConstraints.gridy += 1;
461
- oe.aConstraints.weighty = 0;
462
- oe.aConstraints.gridwidth = 1;
463
-
464
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, 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);
465526 flashSelectionButton.setToolTipText("Show selection");
466527 flashSelectionButton.addActionListener(this);
467528
468529 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469530
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471532 twoButton.setToolTipText("Show center view only");
472533 twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474535 fourButton.addActionListener(this);
475536 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477538 sixButton.setToolTipText("2-column layout left");
478539 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480541 threeButton.setToolTipText("2-column layout right");
481542 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483544 sevenButton.setToolTipText("3-column layout");
484545 sevenButton.addActionListener(this);
485546 //
486547
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488549 rootButton.setToolTipText("Edit selection in new tab");
489550 rootButton.addActionListener(this);
490551
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492553 closeButton.setToolTipText("Close tab");
493554 closeButton.addActionListener(this);
494555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -496,23 +557,23 @@
496557
497558 cGridBag commandsPanel = new cGridBag();
498559
499
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500561 editButton.setToolTipText("Edit selection");
501562 editButton.addActionListener(this);
502563
503
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504565 uneditButton.setToolTipText("Unedit selection");
505566 uneditButton.addActionListener(this);
506567
507
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
568
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
+ allParamsButton.setToolTipText("Edit all params");
570
+ allParamsButton.addActionListener(this);
571
+
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508573 clearPanelButton.setToolTipText("Clear edit panel");
509574 clearPanelButton.addActionListener(this);
510575
511
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
- allParamsButton.setToolTipText("All params??");
513
- allParamsButton.addActionListener(this);
514
-
515
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516577 unselectButton.setToolTipText("Unselect");
517578 unselectButton.addActionListener(this);
518579
....@@ -587,43 +648,35 @@
587648
588649 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589650 {
590
- //constraints.gridx = 0;
591
- //constraints.gridy = 0;
592
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
- fastCB.setToolTipText("Fast mode");
594
- fastCB.addItemListener(this);
595
- //constraints.gridy += 1;
596
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597
- supportCB.setToolTipText("Enabled rigging");
598
- supportCB.addItemListener(this);
599
-
600
- // constraints.gridy += 1;
601
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602
- // localCB.addItemListener(this);
603
-
604
- //constraints.gridy += 1;
605
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606
- crowdCB.setToolTipText("Used for crowds");
607
- crowdCB.addItemListener(this);
608
-
609
- //constraints.gridy += 1;
610
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611
- smoothCB.setToolTipText("Snapping delay");
612
- smoothCB.addItemListener(this);
613
-
614
- //constraints.gridy += 1;
615
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616
- slowCB.setToolTipText("Smooth interpolation");
617
- slowCB.addItemListener(this);
618
- //constraints.gridy += 1;
619651 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620652 boxCB.setToolTipText("Display bounding boxes");
621653 boxCB.addItemListener(this);
622
- //constraints.gridy += 1;
654
+
623655 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625657 zoomBoxCB.addItemListener(this);
626658
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
+
627680 // constraints.gridy += 1;
628681 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629682 // speakerMocapCB.addItemListener(this);
....@@ -648,14 +701,14 @@
648701 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649702 // debugCB.addItemListener(this);
650703
651
- //constraints.gridy += 1;
652704 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653705 oeilCB.addItemListener(this);
654706
655
- //constraints.gridy += 1;
656707 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657708 lookAtCB.setToolTipText("Look-at target");
658709 lookAtCB.addItemListener(this);
710
+
711
+ }
659712
660713 cGridBag fill = new cGridBag();
661714
....@@ -892,7 +945,9 @@
892945 // objEditor.DropFile((java.io.File[]) object, true);
893946 // return;
894947 // }
895
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
896951 {
897952 // file(s)
898953 String[] names = string.split("\n");
....@@ -919,7 +974,7 @@
919974
920975 flashIt = false;
921976 CameraPane pane = (CameraPane) target;
922
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
923978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
924979
925980 if (group.selection.size() == 1)
....@@ -946,11 +1001,11 @@
9461001 {
9471002 loadClipboard(true);
9481003 objEditor.jTree.setSelectionPath(destinationPath);
949
- pasteInto(false);
1004
+ pasteInto(false, false);
9501005 } else {
9511006 loadClipboard(false);
9521007 objEditor.jTree.setSelectionPath(destinationPath);
953
- pasteInto(false); // true); // ???
1008
+ pasteInto(false, false); // true); // ???
9541009 }
9551010 }
9561011 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1072,27 +1127,33 @@
10721127 kleinItem.addActionListener(this);
10731128 particleItem = menu.add(new MenuItem("Particle system"));
10741129 particleItem.addActionListener(this);
1130
+ if (Globals.ADVANCED)
1131
+ {
10751132 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10761133 ragdollItem.addActionListener(this);
10771134 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10781135 ragdoll2Item.addActionListener(this);
1136
+ }
10791137 menu.add("-");
1080
- meshItem = menu.add(new MenuItem("Mesh"));
1138
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10811139 meshItem.addActionListener(this);
10821140 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10831141 // meshGroupItem.addActionListener(this);
1142
+ if (Globals.ADVANCED)
1143
+ {
10841144 springItem = menu.add(new MenuItem("Spring"));
10851145 springItem.addActionListener(this);
10861146 flagItem = menu.add(new MenuItem("Flag"));
10871147 flagItem.addActionListener(this);
1088
- bezierItem = menu.add(new MenuItem("Patch"));
1089
- bezierItem.addActionListener(this);
1090
- checkerItem = menu.add(new MenuItem("Checker"));
1091
- checkerItem.addActionListener(this);
10921148 blobItem = menu.add(new MenuItem("Blob"));
10931149 blobItem.addActionListener(this);
10941150 latheItem = menu.add(new MenuItem("Lathe"));
10951151 latheItem.addActionListener(this);
1152
+ }
1153
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1154
+ bezierItem.addActionListener(this);
1155
+ overlayItem = menu.add(new MenuItem("Overlay"));
1156
+ overlayItem.addActionListener(this);
10961157 lightItem = menu.add(new MenuItem("Light"));
10971158 lightItem.addActionListener(this);
10981159 menu.add("-");
....@@ -1102,34 +1163,39 @@
11021163 loopItem.addActionListener(this);
11031164 doubleItem = menu.add(new MenuItem("Fork"));
11041165 doubleItem.addActionListener(this);
1166
+ if (Globals.ADVANCED)
1167
+ {
11051168 tripleItem = menu.add(new MenuItem("Trident"));
11061169 tripleItem.addActionListener(this);
1170
+ }
11071171 }
11081172
11091173 void buildToolsMenu(Menu menu)
11101174 {
11111175 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11121176 animationItem.addItemListener(this);
1113
- animationItem.setState(CameraPane.ANIMATION);
1177
+ animationItem.setState(Globals.ANIMATION);
11141178
11151179 menu.add("-");
11161180 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11171181 parseverticesItem.addActionListener(this);
11181182 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11191183 textureFieldItem.addActionListener(this);
1120
- alignItem = menu.add(new MenuItem("Align"));
1184
+ alignItem = menu.add(new MenuItem("Align Objects"));
11211185 alignItem.addActionListener(this);
1122
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1123
- mirrorItem.addActionListener(this);
11241186 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11251187 reduceMorphItem.addActionListener(this);
11261188 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11271189 reduce34MorphItem.addActionListener(this);
1128
-
1190
+ menu.add("-");
11291191 menu.add(computeAOItem = new MenuItem("Compute AO"));
11301192 computeAOItem.addActionListener(this);
1131
- menu.add("-");
11321193
1194
+ if (Globals.ADVANCED)
1195
+ {
1196
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1197
+ mirrorItem.addActionListener(this);
1198
+ menu.add("-");
11331199 menu.add(memoryItem = new MenuItem("Memory Usage"));
11341200 memoryItem.addActionListener(this);
11351201 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1152,6 +1218,7 @@
11521218 menu.add("-");
11531219 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11541220 editScriptItem.addActionListener(this);
1221
+ }
11551222 }
11561223
11571224 void ScreenFit()
....@@ -1480,9 +1547,9 @@
14801547
14811548 void Overwrite(int mask)
14821549 {
1483
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14841551 {
1485
- Object3D content = GrafreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
14861553
14871554 if (content instanceof cGroup && ((cGroup)content).transientlink )
14881555 content = ((cGroup)content).get(0);
....@@ -1653,7 +1720,7 @@
16531720 {
16541721 makeSomething(new BezierSurface());
16551722 } else
1656
- if (source == checkerItem)
1723
+ if (source == overlayItem)
16571724 {
16581725 /*
16591726 Object3D obj = new BezierSurface(5,8);
....@@ -1802,7 +1869,15 @@
18021869 } else
18031870 if (source == importOBJItem)
18041871 {
1805
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1872
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
+ browser.setVisible(true);
1875
+ String filename = browser.getFile();
1876
+ if (filename != null && filename.length() > 0)
1877
+ {
1878
+ String fullname = browser.getDirectory() + filename;
1879
+ makeSomething(ReadOBJ(fullname), true);
1880
+ }
18061881 } else
18071882 if (source == computeAOItem)
18081883 {
....@@ -1822,7 +1897,7 @@
18221897 if (source == invariantsItem)
18231898 {
18241899 System.out.println("Invariants:");
1825
- GrafreeD.grafreeD.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
18261901 } else
18271902 if (source == memoryItem)
18281903 {
....@@ -1840,6 +1915,11 @@
18401915 if (source == dumpItem)
18411916 {
18421917 DumpObject();
1918
+ } else
1919
+ if (source == oneStepButton)
1920
+ {
1921
+ Globals.ONESTEP = true;
1922
+ cameraView.repaint();
18431923 } else
18441924 if (source == screenfitButton)
18451925 {
....@@ -1892,10 +1972,10 @@
18921972 } else
18931973 if (source == duplicateItem)
18941974 {
1895
- Object3D keep = GrafreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
18961976 loadClipboard(false);
18971977 paste(false);
1898
- GrafreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
18991979 } else
19001980 if (source == cloneItem)
19011981 {
....@@ -1913,13 +1993,17 @@
19131993 {
19141994 paste(false);
19151995 } else
1996
+ if (source == pasteIntoItem)
1997
+ {
1998
+ pasteInto(true, false);
1999
+ } else
19162000 if (source == pasteLinkItem)
19172001 {
1918
- pasteInto(false);
2002
+ pasteInto(false, false);
19192003 } else
19202004 if (source == pasteCloneItem)
19212005 {
1922
- pasteInto(true);
2006
+ pasteInto(true, true);
19232007 } else
19242008 if (source == pasteExpandItem)
19252009 {
....@@ -2111,9 +2195,9 @@
21112195 // group.selection.get(0).setMasterThis(content); // should be identity
21122196 // refreshContents();
21132197 // }
2114
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21152199 {
2116
- Object3D content = GrafreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
21172201
21182202 if (content instanceof cGroup && ((cGroup)content).transientlink )
21192203 content = ((cGroup)content).get(0);
....@@ -2121,11 +2205,11 @@
21212205 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21222206 for (int i=0; i<group.selection.size(); i++)
21232207 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2208
+ boolean random = CameraPane.SWITCH;
2209
+ CameraPane.SWITCH = false; // parse all random nodes
21262210 group.selection.get(i).linkVerticesThis(content);
21272211 // group.selection.get(i).setMasterThis(content); // should be identity
2128
- CameraPane.RANDOM = random;
2212
+ CameraPane.SWITCH = random;
21292213 }
21302214 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21312215 refreshContents();
....@@ -2135,20 +2219,20 @@
21352219 {
21362220 for (int i=0; i<group.selection.size(); i++)
21372221 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2222
+ boolean random = CameraPane.SWITCH;
2223
+ CameraPane.SWITCH = false; // parse all random nodes
21402224 group.selection.get(i).linkVerticesThis(null);
2141
- CameraPane.RANDOM = random;
2225
+ CameraPane.SWITCH = random;
21422226 }
21432227
21442228 refreshContents();
21452229 } else
21462230 if (source == relinkverticesItem)
21472231 {
2148
- boolean random = CameraPane.RANDOM;
2149
- CameraPane.RANDOM = false; // parse all random nodes
2232
+ boolean random = CameraPane.SWITCH;
2233
+ CameraPane.SWITCH = false; // parse all random nodes
21502234 group.selection.RelinkToSupport();
2151
- CameraPane.RANDOM = random;
2235
+ CameraPane.SWITCH = random;
21522236
21532237 refreshContents();
21542238 } else
....@@ -2163,9 +2247,9 @@
21632247 } else
21642248 if (source == setMasterItem)
21652249 {
2166
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21672251 {
2168
- Object3D content = GrafreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
21692253
21702254 if (content instanceof cGroup && ((cGroup)content).transientlink )
21712255 content = ((cGroup)content).get(0);
....@@ -2178,9 +2262,9 @@
21782262 {
21792263 if (group.selection.size() == 1)
21802264 {
2181
- if (GrafreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
21822266 {
2183
- Object3D content = GrafreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
21842268
21852269 if (content instanceof cGroup && ((cGroup)content).transientlink )
21862270 content = ((cGroup)content).get(0);
....@@ -2246,7 +2330,7 @@
22462330 RandomNode random = new RandomNode();
22472331 group(random);
22482332 if (random.size() > 0)
2249
- random.name = random.get(0).name + "Rnd";
2333
+ random.name = random.get(0).name + "Switch";
22502334 } else
22512335 if (source == physicsItem)
22522336 {
....@@ -2535,9 +2619,13 @@
25352619 {
25362620 SmoothMesh();
25372621 } else
2538
- if (source == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
25392623 {
25402624 TransformGeometry();
2625
+ } else
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
25412629 } else
25422630 if (source == resetTransformItem)
25432631 {
....@@ -2545,7 +2633,11 @@
25452633 } else
25462634 if (source == resetCentroidItem)
25472635 {
2548
- ResetCentroid();
2636
+ ResetCentroid(true);
2637
+ } else
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
25492641 } else
25502642 if (source == resetParentItem)
25512643 {
....@@ -2903,7 +2995,7 @@
29032995
29042996 child.editWindow = null; // ???????????
29052997 }
2906
- objEditor.ctrlPanel.validate();
2998
+ objEditor.ctrlPanel.FlushUI();
29072999 //objEditor.jTree.clearSelection();
29083000 //objEditor.ResetSliders();
29093001 refreshContents(true);
....@@ -3061,6 +3153,28 @@
30613153 refreshContents();
30623154 }
30633155
3156
+ void TransformChildren()
3157
+ {
3158
+ Object3D obj;
3159
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3160
+ {
3161
+ obj = (Object3D)e.nextElement();
3162
+ obj.KeepTextureMatrices();
3163
+ obj.TransformChildren();
3164
+ obj.RestoreTextureMatrices();
3165
+
3166
+// if (obj.parent == null)
3167
+// {
3168
+// System.out.println("NULL PARENT!");
3169
+// new Exception().printStackTrace();
3170
+// }
3171
+// else
3172
+// TouchTransform(obj);
3173
+// //obj.parent.Touch();
3174
+ }
3175
+
3176
+ refreshContents();
3177
+ }
30643178
30653179 void ResetTransform()
30663180 {
....@@ -3173,7 +3287,7 @@
31733287 refreshContents();
31743288 }
31753289
3176
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
31773291 {
31783292 Object3D obj;
31793293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3188,12 +3302,16 @@
31883302 LA.matIdentity(Object3D.mat);
31893303 obj.getBounds(minima, maxima, false);
31903304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3191
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31923307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31933308 obj.TransformMesh(Object3D.mat);
3309
+
31943310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3195
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31963313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
31973315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31983316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31993317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3259,9 +3377,9 @@
32593377 obj = (Object3D)e.nextElement();
32603378
32613379 System.out.println("Object is: " + obj);
3262
- GrafreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
32633381 System.out.println("Boundary rep: " + obj.bRep);
3264
- GrafreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
32653383
32663384 // System.err.println((size/1024) + " KB is the size of " + obj);
32673385 }
....@@ -3475,8 +3593,8 @@
34753593
34763594 void ParseVertices()
34773595 {
3478
- boolean epsequal = GrafreeD.epsequal;
3479
- GrafreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
34803598
34813599 for (int i=0; i<group.selection.size(); i++)
34823600 {
....@@ -3501,7 +3619,7 @@
35013619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35023620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35033621
3504
- g.add(GrafreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
35053623
35063624 buffer.add(g);
35073625 }
....@@ -3516,7 +3634,7 @@
35163634 makeSomething(buffer, i==group.selection.size()-1);
35173635 }
35183636
3519
- GrafreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
35203638
35213639 refreshContents();
35223640 }
....@@ -3622,11 +3740,11 @@
36223740
36233741 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36243742
3625
- boolean random = CameraPane.RANDOM;
3626
- CameraPane.RANDOM = false; // parse all random nodes
3743
+ boolean random = CameraPane.SWITCH;
3744
+ CameraPane.SWITCH = false; // parse all random nodes
36273745 lowres.linkVerticesThis(null);
36283746 lowres.linkVerticesThis(sn);
3629
- CameraPane.RANDOM = random;
3747
+ CameraPane.SWITCH = random;
36303748
36313749 System.err.flush();
36323750
....@@ -3666,7 +3784,7 @@
36663784 return;
36673785
36683786 Object3D poses = group.selection.get(0);
3669
- Object3D ref = GrafreeD.clipboard.get(0);
3787
+ Object3D ref = Grafreed.clipboard.get(0);
36703788
36713789 Object3D newgroup = new Object3D("Po:" + poses.name);
36723790
....@@ -3860,9 +3978,9 @@
38603978
38613979 void ClipMesh()
38623980 {
3863
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3981
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38643982 {
3865
- Object3D content = GrafreeD.clipboard.get(0);
3983
+ Object3D content = Grafreed.clipboard.get(0);
38663984
38673985 if (content instanceof cGroup && ((cGroup)content).transientlink )
38683986 content = ((cGroup)content).get(0);
....@@ -3871,7 +3989,7 @@
38713989 // {
38723990 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38733991 // }
3874
- group.selection.ClipMesh(GrafreeD.clipboard);
3992
+ group.selection.ClipMesh(Grafreed.clipboard);
38753993 }
38763994 // group.selection.ClipMesh(GrafreeD.clipboard);
38773995 System.out.println("DONE.");
....@@ -4211,12 +4329,12 @@
42114329 {
42124330 if (group.selection.isEmpty())
42134331 return;
4214
- GrafreeD.clipboardIsTempGroup = false;
4332
+ Grafreed.clipboardIsTempGroup = false;
42154333 Composite tGroup = null;
42164334 if (group.selection.size() > 0) // 1)
42174335 {
42184336 tGroup = new cGroup();
4219
- GrafreeD.clipboardIsTempGroup = true;
4337
+ Grafreed.clipboardIsTempGroup = true;
42204338 }
42214339
42224340 if (cut)
....@@ -4256,16 +4374,16 @@
42564374 //System.out.println("cut " + child);
42574375 //System.out.println("parent = " + child.parent);
42584376 // tmp.addChild(child);
4259
- if (GrafreeD.clipboardIsTempGroup)
4377
+ if (Grafreed.clipboardIsTempGroup)
42604378 tGroup.add/*Child*/(tmp);
42614379 else
4262
- GrafreeD.clipboard = tmp;
4380
+ Grafreed.clipboard = tmp;
42634381 }
42644382 else
4265
- if (GrafreeD.clipboardIsTempGroup)
4383
+ if (Grafreed.clipboardIsTempGroup)
42664384 tGroup.add/*Child*/(child);
42674385 else
4268
- GrafreeD.clipboard = child;
4386
+ Grafreed.clipboard = child;
42694387 }
42704388
42714389 //ResetModel();
....@@ -4297,21 +4415,21 @@
42974415 //System.out.println("cut " + elem);
42984416 //System.out.println("parent = " + elem.parent);
42994417 // tmp.addChild(elem);
4300
- if (GrafreeD.clipboardIsTempGroup)
4418
+ if (Grafreed.clipboardIsTempGroup)
43014419 tGroup.add/*Child*/(tmp);
43024420 else
4303
- GrafreeD.clipboard = tmp;
4421
+ Grafreed.clipboard = tmp;
43044422 }
43054423 else
4306
- if (GrafreeD.clipboardIsTempGroup)
4424
+ if (Grafreed.clipboardIsTempGroup)
43074425 tGroup.add/*Child*/(child);
43084426 else
4309
- GrafreeD.clipboard = child;
4427
+ Grafreed.clipboard = child;
43104428 }
43114429
43124430 }
4313
- if (GrafreeD.clipboardIsTempGroup)
4314
- GrafreeD.clipboard = tGroup;
4431
+ if (Grafreed.clipboardIsTempGroup)
4432
+ Grafreed.clipboard = tGroup;
43154433 if (cut)
43164434 {
43174435 ResetModel();
....@@ -4325,7 +4443,7 @@
43254443 // return;
43264444 boolean first = true;
43274445
4328
- if (GrafreeD.clipboardIsTempGroup)
4446
+ if (Grafreed.clipboardIsTempGroup)
43294447 {
43304448 Composite temp;
43314449
....@@ -4336,7 +4454,7 @@
43364454 temp = (Composite)Applet3D.clipboard.deepCopy();
43374455 */
43384456 Object3D elem;
4339
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4457
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43404458 {
43414459 Object3D child = (Object3D)e.nextElement();
43424460
....@@ -4370,21 +4488,21 @@
43704488 //Object3D cb = Applet3D.clipboard;
43714489 //temp.addChild(cb);
43724490 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4373
- assert(GrafreeD.clipboard.parent == null);
4374
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4375
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4376
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4377
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4491
+ assert(Grafreed.clipboard.parent == null);
4492
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4493
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4494
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4495
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43784496 else
4379
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4380
- GrafreeD.clipboard.get(0).parent = keepparent;
4497
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4498
+ Grafreed.clipboard.get(0).parent = keepparent;
43814499 }
43824500
43834501 ResetModel();
43844502 refreshContents();
43854503 }
43864504
4387
- void pasteInto(boolean copyit)
4505
+ void pasteInto(boolean copyit, boolean clone)
43884506 {
43894507 // if (GrafreeD.clipboard == null)
43904508 // return;
....@@ -4413,15 +4531,22 @@
44134531 if (copyit)
44144532 {
44154533 // paste(false);
4416
- CloneClipboard(false); // sept 2014
4534
+ if (clone)
4535
+ {
4536
+ CloneClipboard(false); // sept 2014
4537
+ }
4538
+ else
4539
+ {
4540
+ paste(false);
4541
+ }
44174542 }
44184543 else
44194544 {
44204545 boolean first = true;
44214546
4422
- if (GrafreeD.clipboardIsTempGroup)
4547
+ if (Grafreed.clipboardIsTempGroup)
44234548 {
4424
- Composite temp = (Composite)GrafreeD.clipboard;
4549
+ Composite temp = (Composite)Grafreed.clipboard;
44254550 Object3D copy;
44264551 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44274552 {
....@@ -4431,7 +4556,7 @@
44314556 }
44324557 } else
44334558 {
4434
- linkSomething(GrafreeD.clipboard); //.get(0));
4559
+ linkSomething(Grafreed.clipboard); //.get(0));
44354560 }
44364561 }
44374562 }
....@@ -4876,7 +5001,7 @@
48765001
48775002 void ImportVRMLX3D()
48785003 {
4879
- if (GrafreeD.standAlone)
5004
+ if (Grafreed.standAlone)
48805005 {
48815006 /**/
48825007 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4893,7 +5018,7 @@
48935018
48945019 String GetFile(String dialogName)
48955020 {
4896
- if (GrafreeD.standAlone)
5021
+ if (Grafreed.standAlone)
48975022 {
48985023 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48995024 browser.show();
....@@ -4957,10 +5082,12 @@
49575082 cButton flashSelectionButton;
49585083 cButton editButton;
49595084 cButton uneditButton;
5085
+ JCheckBox allParamsButton;
49605086 cButton clearpanelButton;
4961
- cButton allParamsButton;
49625087 cButton unselectButton;
49635088
5089
+ cButton oneStepButton;
5090
+
49645091 cButton screenfitButton;
49655092 cButton screenfitpointButton;
49665093 cButton snapobjectButton;
....@@ -5015,6 +5142,7 @@
50155142 private MenuItem mergeGeometriesItem;
50165143 private MenuItem copyItem;
50175144 private MenuItem pasteItem;
5145
+ private MenuItem pasteIntoItem;
50185146 private MenuItem pasteLinkItem;
50195147 private MenuItem pasteCloneItem;
50205148 private MenuItem pasteExpandItem;
....@@ -5064,8 +5192,10 @@
50645192 private MenuItem panoTexturesItem;
50655193
50665194 private MenuItem resetCentroidItem;
5067
- private MenuItem transformgeometryItem;
5195
+ private MenuItem resetCentroidXZItem;
50685196 private MenuItem resetTransformItem;
5197
+ private MenuItem transformGeometryItem;
5198
+ private MenuItem transformChildrenItem;
50695199 private MenuItem hideItem;
50705200 private MenuItem grabItem;
50715201 private MenuItem backItem;
....@@ -5112,7 +5242,7 @@
51125242 private MenuItem blobItem;
51135243 private MenuItem latheItem;
51145244 private MenuItem bezierItem;
5115
- private MenuItem checkerItem;
5245
+ private MenuItem overlayItem;
51165246 private MenuItem meshItem;
51175247 // private MenuItem meshGroupItem;
51185248 private MenuItem springItem;