Normand Briere
2019-06-11 5e6a6f3319f0c4c687fe71952ac9ecc17792b83a
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,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+ undoItem = menu.add(new MenuItem("Undo"));
158
+ undoItem.addActionListener(this);
159
+ redoItem = menu.add(new MenuItem("Redo"));
160
+ redoItem.addActionListener(this);
161
+ menu.add("-");
162
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
163
+ duplicateItem.addActionListener(this);
164
+ cloneItem = menu.add(new MenuItem("Clone"));
165
+ cloneItem.addActionListener(this);
166
+ if (Globals.ADVANCED)
167
+ {
168
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
169
+ cloneSupportItem.addActionListener(this);
170
+ }
171
+ menu.add("-");
172
+ cutItem = menu.add(new MenuItem("Cut"));
173
+ cutItem.addActionListener(this);
174
+ copyItem = menu.add(new MenuItem("Copy"));
175
+ copyItem.addActionListener(this);
176
+ pasteItem = menu.add(new MenuItem("Paste"));
177
+ pasteItem.addActionListener(this);
178
+ menu.add("-");
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(CameraPane.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
285
+ }
286
+
192287 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);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,48 +304,68 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
319
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
320
+ relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
222324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223325 setMasterItem.addActionListener(this);
326
+ }
224327
225328 oe.menuBar.add(menu = new Menu("Group"));
226329 grabItem = menu.add(new MenuItem("Grab"));
227330 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230331 backItem = menu.add(new MenuItem("Back"));
231332 backItem.addActionListener(this);
333
+ frontItem = menu.add(new MenuItem("Front"));
334
+ frontItem.addActionListener(this);
232335 compositeItem = menu.add(new MenuItem("Composite"));
233336 compositeItem.addActionListener(this);
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
338
+ hideItem.addActionListener(this);
339
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
340
+ ungroupItem.addActionListener(this);
234341 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
236343 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242345 switchGeoItem.addActionListener(this);
243346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244347 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
246349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
247358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248359 scriptNodeItem.addActionListener(this);
249360 cameraItem = menu.add(new MenuItem("Camera"));
250361 cameraItem.addActionListener(this);
362
+ }
251363
252364 oe.menuBar.add(menu = new Menu("Object"));
253365 textureItem = menu.add(new MenuItem("Texture"));
254366 textureItem.addActionListener(this);
367
+ billboardItem = menu.add(new MenuItem("Billboard"));
368
+ billboardItem.addActionListener(this);
255369 csgItem = menu.add(new MenuItem("CSG"));
256370 csgItem.addActionListener(this);
257371 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +374,29 @@
260374 shadowYItem.addActionListener(this);
261375 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
263380 linkerItem = menu.add(new MenuItem("Linker"));
264381 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267382 attributeItem = menu.add(new MenuItem("Attribute"));
268383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
269386 pointflowItem = menu.add(new MenuItem("Point Flow"));
270387 pointflowItem.addActionListener(this);
388
+ }
271389 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275391 resetTransformItem.addActionListener(this);
276392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277393 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
280400
281401 oe.menuBar.add(menu = new Menu("Geometry"));
282402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +405,13 @@
285405 genNormalsORGANItem.addActionListener(this);
286406 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287407 genNormalsCADItem.addActionListener(this);
408
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
409
+ genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
412
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
413
+ genNormalsMINEItem.addActionListener(this);
414
+ }
288415 stripifyItem = menu.add(new MenuItem("Stripify"));
289416 stripifyItem.addActionListener(this);
290417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +433,34 @@
306433 reduce34MeshItem.addActionListener(this);
307434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308435 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
313444
314445 oe.menuBar.add(menu = new Menu("Attributes"));
315446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
317452 menu.add("-");
318453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319454 liveleavesItem.addActionListener(this);
320455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
322459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323460 supportleavesItem.addActionListener(this);
324461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325462 unsupportleavesItem.addActionListener(this);
463
+ }
326464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327465 hideleavesItem.addActionListener(this);
328466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -366,29 +504,22 @@
366504 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367505 sortbynameItem.addActionListener(this);
368506 menu.add("-");
507
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
508
+ shareGeometriesItem.addActionListener(this);
509
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
510
+ mergeGeometriesItem.addActionListener(this);
511
+ if (Globals.ADVANCED)
512
+ {
513
+ // Pretty much the same as duplicate and clone.
369514 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370515 extractGeometriesItem.addActionListener(this);
371516 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372517 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
518
+ }
377519
378520 oe.menuBar.add(menu = new Menu("Insert"));
379521 buildCreateMenu(menu);
380522
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392523 oe.menuBar.add(menu = new Menu("Tools"));
393524 buildToolsMenu(menu);
394525 }
....@@ -423,150 +554,98 @@
423554 oe.radioPanel.add(dummyButton);
424555 oe.buttonGroup.add(dummyButton);
425556 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
557
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429558
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
559
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
560
+ liveCB.setToolTipText("Enable animation");
431561 liveCB.addItemListener(this);
432562
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
563
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564
+ oneStepButton.setToolTipText("Animate one step forward");
565
+ oneStepButton.addActionListener(this);
566
+
567
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
568
+ fastCB.setToolTipText("Fast mode");
451569 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
570
+
571
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
+ trackCB.setToolTipText("Enable tracking");
493573 trackCB.addItemListener(this);
494574
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
575
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576
+ screenfitButton.setToolTipText("Screen fit");
497577 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
578
+
499579 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500580 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505581
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
582
+ if (Globals.ADVANCED)
583
+ {
584
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ snapobjectButton.addActionListener(this);
586
+ snapobjectButton.setToolTipText("Snap Object");
587
+ }
588
+
589
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ flashSelectionButton.setToolTipText("Show selection");
512591 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516592
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
+
595
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ twoButton.setToolTipText("Show center view only");
519597 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
598
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521599 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
600
+ fourButton.setToolTipText("Show left panel only");
601
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ sixButton.setToolTipText("2-column layout left");
523603 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
604
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
+ threeButton.setToolTipText("2-column layout right");
525606 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ sevenButton.setToolTipText("3-column layout");
527609 sevenButton.addActionListener(this);
528610 //
529611
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
612
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
+ rootButton.setToolTipText("Edit selection in new tab");
531614 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
615
+
616
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ closeButton.setToolTipText("Close tab");
534618 closeButton.addActionListener(this);
535619 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536620 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538621
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
622
+ cGridBag commandsPanel = new cGridBag();
623
+
624
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
+ editButton.setToolTipText("Edit selection");
541626 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545627
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
628
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ uneditButton.setToolTipText("Unedit selection");
547630 uneditButton.addActionListener(this);
548631
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
632
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
+ allParamsButton.setToolTipText("Edit all params");
561634 allParamsButton.addActionListener(this);
562635
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
636
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ clearPanelButton.setToolTipText("Clear edit panel");
638
+ clearPanelButton.addActionListener(this);
639
+
640
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ unselectButton.setToolTipText("Unselect");
568642 unselectButton.addActionListener(this);
569643
644
+ commandsPanel.preferredHeight = 1;
645
+
646
+ oe.treePanel.add(commandsPanel);
647
+ oe.treePanel.Return();
648
+
570649 // oe.aConstraints.gridx += 1;
571650 // oe.aConstraints.weighty = 0;
572651 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +657,37 @@
578657 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579658 // gcButton.addActionListener(this);
580659
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
660
+ cGridBag jSPPanel = new cGridBag();
661
+
662
+ JScrollPane jSP;
592663 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
664
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594665 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
666
+
667
+ oe.treePanel.add(jSPPanel);
668
+ oe.treePanel.Return();
599669
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
670
+ cGridBag copyOptionsPanel = new cGridBag();
671
+
672
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
+ colorCB.setToolTipText("Copy color when dropped");
604674 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
675
+
676
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
+ materialCB.setToolTipText("Copy material when dropped");
607678 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
679
+
680
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
+ textureCB.setToolTipText("Copy texture when dropped");
610682 textureCB.addItemListener(this);
611683
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
684
+ copyOptionsPanel.preferredHeight = 1;
685
+ oe.treePanel.add(copyOptionsPanel);
686
+ oe.treePanel.Return();
614687
688
+// mainPanel.setDividerLocation(0.5); //1.0);
689
+// mainPanel.setResizeWeight(0.5);
690
+
615691 //jList.addListSelectionListener(this);
616692 oe.jTree.addTreeSelectionListener(this);
617693 //jTree.setRootVisible(false);
....@@ -633,18 +709,91 @@
633709 radio.layout = sevenButton;
634710 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635711 }
712
+
713
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
714
+ {
715
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
716
+ boxCB.setToolTipText("Display bounding boxes");
717
+ boxCB.addItemListener(this);
718
+
719
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
721
+ zoomBoxCB.addItemListener(this);
722
+
723
+ if (true) // Globals.ADVANCED)
724
+ {
725
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
+ supportCB.setToolTipText("Enable rigging");
727
+ supportCB.addItemListener(this);
728
+
729
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730
+ // localCB.addItemListener(this);
731
+
732
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733
+ crowdCB.setToolTipText("Used for crowds");
734
+ crowdCB.addItemListener(this);
735
+
736
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
737
+ smoothCB.setToolTipText("Snapping delay");
738
+ smoothCB.addItemListener(this);
739
+
740
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
741
+ slowCB.setToolTipText("Smooth interpolation");
742
+ slowCB.addItemListener(this);
743
+
744
+// constraints.gridy += 1;
745
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
746
+// speakerMocapCB.addItemListener(this);
747
+
748
+ if (false)
749
+ {
750
+ // handled in scripts
751
+ //constraints.gridy += 1;
752
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
753
+ speakerCameraCB.addItemListener(this);
754
+
755
+ //constraints.gridy += 1;
756
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
757
+ speakerFocusCB.addItemListener(this);
758
+
759
+ //constraints.gridy += 1;
760
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
761
+ smoothfocusCB.addItemListener(this);
762
+ }
763
+
764
+//constraints.gridx += 1;
765
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
766
+// debugCB.addItemListener(this);
767
+
768
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
769
+ oeilCB.addItemListener(this);
770
+
771
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772
+ lookAtCB.setToolTipText("Look-at target");
773
+ lookAtCB.addItemListener(this);
774
+
775
+ }
776
+
777
+ cGridBag fill = new cGridBag();
778
+
779
+ fill.preferredHeight = 200;
780
+
781
+ panel.add(fill);
782
+
783
+ }
636784
637785 void EditObject(Object3D obj)
638786 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
787
+ cRadio radioButton = new cRadio(obj.name);
788
+ radioButton.SetObject(obj);
789
+ radioButton.layout = sevenButton;
790
+ radioButton.SetCamera(cameraView.renderCamera, false);
791
+ radioButton.addActionListener(this);
792
+ radioPanel.add(radioButton);
793
+ buttonGroup.add(radioButton);
794
+ radioButton.doClick();
647795 }
796
+
648797 void SetupViews(ObjEditor oe)
649798 {
650799 oe.SetupViews();
....@@ -663,6 +812,7 @@
663812 JCheckBox fastCB;
664813 JCheckBox slowCB;
665814 JCheckBox boxCB;
815
+ JCheckBox zoomBoxCB;
666816 JCheckBox trackCB;
667817 JCheckBox smoothfocusCB;
668818 // JCheckBox speakerMocapCB;
....@@ -705,8 +855,7 @@
705855 dropAttributes |= Object3D.TEXTURE;
706856 else
707857 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
858
+ } else if(e.getSource() == liveCB)
710859 {
711860 cameraView.ToggleLive();
712861 }
....@@ -743,6 +892,10 @@
743892 Recompile();
744893 cameraView.repaint();
745894 // refreshContents();
895
+ }
896
+ else if(e.getSource() == zoomBoxCB)
897
+ {
898
+ cameraView.ToggleZoomBoxMode();
746899 }
747900 else if(e.getSource() == smoothfocusCB)
748901 {
....@@ -857,7 +1010,9 @@
8571010 // objEditor.DropFile((java.io.File[]) object, true);
8581011 // return;
8591012 // }
860
- if (string.charAt(0) == '/')
1013
+
1014
+ // File path for Mac and Windows
1015
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611016 {
8621017 // file(s)
8631018 String[] names = string.split("\n");
....@@ -884,7 +1039,7 @@
8841039
8851040 flashIt = false;
8861041 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1042
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881043 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891044
8901045 if (group.selection.size() == 1)
....@@ -911,11 +1066,11 @@
9111066 {
9121067 loadClipboard(true);
9131068 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1069
+ pasteInto(false, false);
9151070 } else {
9161071 loadClipboard(false);
9171072 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1073
+ pasteInto(false, false); // true); // ???
9191074 }
9201075 }
9211076 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1188,37 @@
10331188 torusItem.addActionListener(this);
10341189 superItem = menu.add(new MenuItem("Superellipsoid"));
10351190 superItem.addActionListener(this);
1191
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1192
+ kleinItem.addActionListener(this);
10361193 particleItem = menu.add(new MenuItem("Particle system"));
10371194 particleItem.addActionListener(this);
1195
+ if (Globals.ADVANCED)
1196
+ {
10381197 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391198 ragdollItem.addActionListener(this);
10401199 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411200 ragdoll2Item.addActionListener(this);
1201
+ }
10421202 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1203
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441204 meshItem.addActionListener(this);
10451205 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461206 // meshGroupItem.addActionListener(this);
1207
+ if (Globals.ADVANCED)
1208
+ {
10471209 springItem = menu.add(new MenuItem("Spring"));
10481210 springItem.addActionListener(this);
10491211 flagItem = menu.add(new MenuItem("Flag"));
10501212 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551213 blobItem = menu.add(new MenuItem("Blob"));
10561214 blobItem.addActionListener(this);
10571215 latheItem = menu.add(new MenuItem("Lathe"));
10581216 latheItem.addActionListener(this);
1217
+ }
1218
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1219
+ bezierItem.addActionListener(this);
1220
+ overlayItem = menu.add(new MenuItem("Overlay"));
1221
+ overlayItem.addActionListener(this);
10591222 lightItem = menu.add(new MenuItem("Light"));
10601223 lightItem.addActionListener(this);
10611224 menu.add("-");
....@@ -1065,34 +1228,39 @@
10651228 loopItem.addActionListener(this);
10661229 doubleItem = menu.add(new MenuItem("Fork"));
10671230 doubleItem.addActionListener(this);
1231
+ if (Globals.ADVANCED)
1232
+ {
10681233 tripleItem = menu.add(new MenuItem("Trident"));
10691234 tripleItem.addActionListener(this);
1235
+ }
10701236 }
10711237
10721238 void buildToolsMenu(Menu menu)
10731239 {
10741240 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751241 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1242
+ animationItem.setState(Globals.ANIMATION);
10771243
10781244 menu.add("-");
10791245 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801246 parseverticesItem.addActionListener(this);
10811247 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821248 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1249
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841250 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871251 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881252 reduceMorphItem.addActionListener(this);
10891253 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901254 reduce34MorphItem.addActionListener(this);
1091
-
1255
+ menu.add("-");
10921256 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931257 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951258
1259
+ if (Globals.ADVANCED)
1260
+ {
1261
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1262
+ mirrorItem.addActionListener(this);
1263
+ menu.add("-");
10961264 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971265 memoryItem.addActionListener(this);
10981266 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1274,8 @@
11061274 resetParentItem.addActionListener(this);
11071275 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081276 repairParentItem.addActionListener(this);
1277
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1278
+ repairShadowItem.addActionListener(this);
11091279 menu.add(invariantsItem = new MenuItem("Invariants"));
11101280 invariantsItem.addActionListener(this);
11111281 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1283,7 @@
11131283 menu.add("-");
11141284 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151285 editScriptItem.addActionListener(this);
1286
+ }
11161287 }
11171288
11181289 void ScreenFit()
....@@ -1441,9 +1612,9 @@
14411612
14421613 void Overwrite(int mask)
14431614 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1615
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451616 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1617
+ Object3D content = Grafreed.clipboard.get(0);
14471618
14481619 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491620 content = ((cGroup)content).get(0);
....@@ -1466,6 +1637,7 @@
14661637 //
14671638 public void actionPerformed(ActionEvent event) // , Object arg)
14681639 {
1640
+ Object source = event.getSource();
14691641 /*
14701642 if (event.getSource() == nameField)
14711643 {
....@@ -1477,11 +1649,11 @@
14771649 }
14781650 else
14791651 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1652
+ if (source == lookAtItem || source == lookFromItem)
14811653 {
14821654 ScreenFit();
14831655 } else
1484
- if (event.getSource() == switchItem)
1656
+ if (source == switchItem)
14851657 {
14861658 cVector v1 = new cVector();
14871659 cVector v2 = new cVector();
....@@ -1490,11 +1662,11 @@
14901662 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911663 objEditor.cameraView.repaint();
14921664 } else
1493
- if (event.getSource() == rectoidItem)
1665
+ if (source == rectoidItem)
14941666 {
14951667 makeSomething(new Box());
14961668 } else
1497
- if (event.getSource() == particleItem)
1669
+ if (source == particleItem)
14981670 {
14991671 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001672 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1687,9 @@
15151687 applyExample(particleGeom, "SMOKE");
15161688 makeSomething(particleGeom);
15171689 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1690
+ if (source == ragdollItem || source == ragdoll2Item)
15191691 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1692
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211693
15221694 ragdoll.toParent = LA.newMatrix();
15231695 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1707,7 @@
15351707 } else
15361708 /*
15371709 */
1538
- if (event.getSource() == heightFieldItem)
1710
+ if (source == heightFieldItem)
15391711 {
15401712 Object3D obj = new Object3D();
15411713
....@@ -1573,27 +1745,31 @@
15731745
15741746 makeSomething(obj);
15751747 } else
1576
- if (event.getSource() == gridItem)
1748
+ if (source == gridItem)
15771749 {
15781750 makeSomething(new Grid());
15791751 } else
1580
- if (event.getSource() == ellipsoidItem)
1752
+ if (source == ellipsoidItem)
15811753 {
15821754 makeSomething(new Sphere());
15831755 } else
1584
- if (event.getSource() == coneItem)
1756
+ if (source == coneItem)
15851757 {
15861758 makeSomething(new Cone());
15871759 } else
1588
- if (event.getSource() == torusItem)
1760
+ if (source == torusItem)
15891761 {
15901762 makeSomething(new Torus());
15911763 } else
1592
- if (event.getSource() == superItem)
1764
+ if (source == superItem)
15931765 {
15941766 makeSomething(new Superellipsoid());
15951767 } else
1596
- if (event.getSource() == blobItem)
1768
+ if (source == kleinItem)
1769
+ {
1770
+ makeSomething(new Klein());
1771
+ } else
1772
+ if (source == blobItem)
15971773 {
15981774 Blob blob = new Blob();
15991775 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1777,15 @@
16011777 //blob.retile();
16021778 makeSomething(blob);
16031779 } else
1604
- if (event.getSource() == latheItem)
1780
+ if (source == latheItem)
16051781 {
16061782 makeSomething(new Lathe());
16071783 } else
1608
- if (event.getSource() == bezierItem)
1784
+ if (source == bezierItem)
16091785 {
16101786 makeSomething(new BezierSurface());
16111787 } else
1612
- if (event.getSource() == checkerItem)
1788
+ if (source == overlayItem)
16131789 {
16141790 /*
16151791 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1800,7 @@
16241800 */
16251801 makeSomething(new Checker());
16261802 } else
1627
- if (event.getSource() == meshItem)
1803
+ if (source == meshItem)
16281804 {
16291805 Object3D itemtomake = new Object3D();
16301806 Object3D child;
....@@ -1645,35 +1821,35 @@
16451821 makeSomething(child);
16461822 }
16471823 } else
1648
- if (event.getSource() == springItem)
1824
+ if (source == springItem)
16491825 {
16501826 cSpring s = new cSpring();
16511827 s.setup();
16521828 makeSomething(s);
16531829 } else
1654
- if (event.getSource() == flagItem)
1830
+ if (source == flagItem)
16551831 {
16561832 cSpring s = new cFlag();
16571833 s.setup();
16581834 makeSomething(s);
16591835 } else
1660
- if (event.getSource() == lightItem)
1836
+ if (source == lightItem)
16611837 {
16621838 makeSomething(new Light());
16631839 } else
1664
- if (event.getSource() == csgItem)
1840
+ if (source == csgItem)
16651841 {
16661842 group(new CSG());
16671843 } else
1668
- if (event.getSource() == templateItem)
1844
+ if (source == templateItem)
16691845 {
16701846 group(new cTemplate());
16711847 } else
1672
- if (event.getSource() == attributeItem)
1848
+ if (source == attributeItem)
16731849 {
16741850 makeSomething(new Attribute());
16751851 } else
1676
- if (event.getSource() == pointflowItem)
1852
+ if (source == pointflowItem)
16771853 {
16781854 makeSomething(new PointFlow());
16791855 } else
....@@ -1685,7 +1861,7 @@
16851861 } else
16861862 */
16871863
1688
- if (event.getSource() == superLoopItem)
1864
+ if (source == superLoopItem)
16891865 {
16901866 Composite g = new cGroup();
16911867 for (int i=0; i<15; i++)
....@@ -1707,7 +1883,7 @@
17071883
17081884 group(g);
17091885 } else
1710
- if (event.getSource() == loopItem)
1886
+ if (source == loopItem)
17111887 {
17121888 Composite csg = new GroupLeaf();
17131889 csg.count = 5;
....@@ -1716,7 +1892,7 @@
17161892 csg.addChild(child);
17171893 child.addChild(csg);
17181894 } else
1719
- if (event.getSource() == doubleItem)
1895
+ if (source == doubleItem)
17201896 {
17211897 Composite csg = new GroupLeaf();
17221898 csg.count = 5;
....@@ -1728,7 +1904,7 @@
17281904 csg.addChild(child);
17291905 child.addChild(csg);
17301906 } else
1731
- if (event.getSource() == tripleItem)
1907
+ if (source == tripleItem)
17321908 {
17331909 Composite csg = new GroupLeaf();
17341910 csg.count = 4;
....@@ -1743,71 +1919,59 @@
17431919 csg.addChild(child);
17441920 child.addChild(csg);
17451921 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1922
+ if (source == computeAOItem)
17481923 {
1749
- ImportGFD();
1924
+ Globals.drawMode = CameraPane.OCCLUSION;
1925
+ Globals.theRenderer.repaint();
17501926 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
1927
+ if (source == recompileItem)
17691928 {
17701929 Recompile();
17711930 refreshContents();
17721931 } else
1773
- if (event.getSource() == editScriptItem)
1932
+ if (source == editScriptItem)
17741933 {
17751934 OpenDialog();
17761935 refreshContents();
17771936 } else
1778
- if (event.getSource() == invariantsItem)
1937
+ if (source == invariantsItem)
17791938 {
17801939 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1940
+ Grafreed.grafreeD.universe.invariants();
17821941 } else
1783
- if (event.getSource() == memoryItem)
1942
+ if (source == memoryItem)
17841943 {
17851944 //System.out.println("Invariants:");
17861945 PrintMemory();
17871946 } else
1788
- if (event.getSource() == pathItem)
1947
+ if (source == pathItem)
17891948 {
17901949 PrintPath();
17911950 } else
1792
- if (event.getSource() == analyzeItem)
1951
+ if (source == analyzeItem)
17931952 {
17941953 AnalyzeObject();
17951954 } else
1796
- if (event.getSource() == dumpItem)
1955
+ if (source == dumpItem)
17971956 {
17981957 DumpObject();
17991958 } else
1800
- if (event.getSource() == screenfitButton)
1959
+ if (source == oneStepButton)
1960
+ {
1961
+ Globals.ONESTEP = true;
1962
+ cameraView.repaint();
1963
+ } else
1964
+ if (source == screenfitButton)
18011965 {
18021966 //Reload(lastConverter, lastFilename, true);
18031967 ScreenFit();
18041968 } else
1805
- if (event.getSource() == screenfitpointButton)
1969
+ if (source == screenfitpointButton)
18061970 {
18071971 //Reload(lastConverter, lastFilename, true);
18081972 ScreenFitPoint();
18091973 } else
1810
- if (event.getSource() == snapobjectButton)
1974
+ if (source == snapobjectButton)
18111975 {
18121976 //Reload(lastConverter, lastFilename, true);
18131977 SnapObject();
....@@ -1818,13 +1982,13 @@
18181982 // Recompile();
18191983 // refreshContents();
18201984 // } else
1821
- if (event.getSource() == gcButton)
1985
+ if (source == gcButton)
18221986 {
18231987 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241988 System.gc();
18251989 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261990 } else
1827
- if (event.getSource() == editLeafItem)
1991
+ if (source == editLeafItem)
18281992 {
18291993 Object3D obj;
18301994 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2002,78 @@
18382002 }
18392003 refreshContents(true);
18402004 } else
1841
- if (event.getSource() == openWindowItem)
2005
+ if (source == openWindowItem)
18422006 {
18432007 EditSelection(true);
18442008 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2009
+ if (source == cutItem || source == clearButton)
18462010 {
18472011 loadClipboard(true);
18482012 } else
1849
- if (event.getSource() == duplicateItem)
2013
+ if (source == undoItem)
18502014 {
1851
- Object3D keep = GraphreeD.clipboard;
2015
+ Undo();
2016
+ } else
2017
+ if (source == redoItem)
2018
+ {
2019
+ Redo();
2020
+ } else
2021
+ if (source == duplicateItem)
2022
+ {
2023
+ Object3D keep = Grafreed.clipboard;
18522024 loadClipboard(false);
18532025 paste(false);
1854
- GraphreeD.clipboard = keep;
2026
+ Grafreed.clipboard = keep;
18552027 } else
1856
- if (event.getSource() == cloneItem)
2028
+ if (source == cloneItem)
18572029 {
18582030 CloneSelection(false);
18592031 } else
1860
- if (event.getSource() == cloneSupportItem)
2032
+ if (source == cloneSupportItem)
18612033 {
18622034 CloneSelection(true);
18632035 } else
1864
- if (event.getSource() == copyItem)
2036
+ if (source == copyItem)
18652037 {
18662038 loadClipboard(false);
18672039 } else
1868
- if (event.getSource() == pasteItem)
2040
+ if (source == pasteItem)
18692041 {
18702042 paste(false);
18712043 } else
1872
- if (event.getSource() == pasteLinkItem)
2044
+ if (source == pasteIntoItem)
18732045 {
1874
- pasteInto(false);
2046
+ pasteInto(true, false);
18752047 } else
1876
- if (event.getSource() == pasteCloneItem)
2048
+ if (source == pasteLinkItem)
18772049 {
1878
- pasteInto(true);
2050
+ pasteInto(false, false);
18792051 } else
1880
- if (event.getSource() == pasteExpandItem)
2052
+ if (source == pasteCloneItem)
2053
+ {
2054
+ pasteInto(true, true);
2055
+ } else
2056
+ if (source == pasteExpandItem)
18812057 {
18822058 paste(true);
18832059 } else
1884
- if (event.getSource() == synchronizeItem)
2060
+ if (source == synchronizeItem)
18852061 {
18862062 Overwrite(Object3D.TRANSFORM);
18872063 } else
1888
- if (event.getSource() == overwriteNameItem)
2064
+ if (source == overwriteNameItem)
18892065 {
18902066 Overwrite(Object3D.NAME);
18912067 } else
1892
- if (event.getSource() == overwriteUVItem)
2068
+ if (source == overwriteUVItem)
18932069 {
18942070 Overwrite(Object3D.UV);
18952071 } else
1896
- if (event.getSource() == overwriteMatItem)
2072
+ if (source == overwriteMatItem)
18972073 {
2074
+ /* july 2015
18982075 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2076
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002077 else
19012078 {
19022079 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2085,16 @@
19082085 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092086 }
19102087 }
2088
+ */
2089
+
2090
+ Overwrite(dropAttributes);
19112091 }
1912
- if (event.getSource() == overwriteGeoItem)
2092
+ if (source == overwriteGeoItem)
19132093 {
19142094 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2095
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162096 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2097
+// Object3D content = GrafreeD.clipboard.get(0);
19182098 //
19192099 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202100 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2106,7 @@
19262106 // refreshContents();
19272107 // }
19282108 } else
1929
- if (event.getSource() == generateMeshItem)
2109
+ if (source == generateMeshItem)
19302110 {
19312111 //if (group.selection.size() == 1)
19322112 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2117,7 @@
19372117 ResetModel();
19382118 refreshContents();
19392119 } else
1940
- if (event.getSource() == extractGeometriesItem)
2120
+ if (source == extractGeometriesItem)
19412121 {
19422122 boolean one = false;
19432123
....@@ -1964,7 +2144,7 @@
19642144 ResetModel();
19652145 refreshContents();
19662146 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2147
+ if (source == cloneGeometriesItem)
19682148 {
19692149 boolean one = false;
19702150
....@@ -1990,32 +2170,37 @@
19902170 ResetModel();
19912171 refreshContents();
19922172 } else
1993
- if (event.getSource() == shareGeometriesItem)
2173
+ if (source == shareGeometriesItem)
19942174 {
19952175 boolean one = false;
19962176
19972177 if (group.selection.size() == 1)
19982178 one = true;
19992179
2180
+ Object3D merge = null;
2181
+
20002182 Object3D content = new cGroup();
20012183
20022184 for (int i=0; i<group.selection.size(); i++)
20032185 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2186
+ merge = new Merge(group.selection.get(i));
20052187
20062188 if (one)
2007
- makeSomething(sel, false);
2189
+ makeSomething(merge, false);
20082190 else
2009
- content.addChild(sel);
2191
+ content.addChild(merge);
20102192 }
20112193
20122194 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2195
+ makeSomething(content, true);
2196
+ else
2197
+ {
2198
+ ResetModel();
2199
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2200
+ refreshContents();
2201
+ }
20172202 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2203
+ if (source == mergeGeometriesItem)
20192204 {
20202205 boolean one = false;
20212206
....@@ -2045,11 +2230,11 @@
20452230 ResetModel();
20462231 refreshContents();
20472232 } else
2048
- if (event.getSource() == linkverticesItem)
2233
+ if (source == linkverticesItem)
20492234 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2235
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512236 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2237
+// Object3D content = GrafreeD.clipboard.get(0);
20532238 //
20542239 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552240 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2243,48 @@
20582243 // group.selection.get(0).setMasterThis(content); // should be identity
20592244 // refreshContents();
20602245 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2246
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622247 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2248
+ Object3D content = Grafreed.clipboard.get(0);
20642249
20652250 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662251 content = ((cGroup)content).get(0);
20672252
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2253
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692254 for (int i=0; i<group.selection.size(); i++)
20702255 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2256
+ boolean random = CameraPane.SWITCH;
2257
+ CameraPane.SWITCH = false; // parse all random nodes
20732258 group.selection.get(i).linkVerticesThis(content);
20742259 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
20762261 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2262
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782263 refreshContents();
20792264 }
20802265 } else
2081
- if (event.getSource() == resetsupportItem)
2266
+ if (source == resetsupportItem)
20822267 {
20832268 for (int i=0; i<group.selection.size(); i++)
20842269 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2270
+ boolean random = CameraPane.SWITCH;
2271
+ CameraPane.SWITCH = false; // parse all random nodes
20872272 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2273
+ CameraPane.SWITCH = random;
20892274 }
20902275
20912276 refreshContents();
20922277 } else
2093
- if (event.getSource() == resetreferencesItem)
2278
+ if (source == relinkverticesItem)
2279
+ {
2280
+ boolean random = CameraPane.SWITCH;
2281
+ CameraPane.SWITCH = false; // parse all random nodes
2282
+ group.selection.RelinkToSupport();
2283
+ CameraPane.SWITCH = random;
2284
+
2285
+ refreshContents();
2286
+ } else
2287
+ if (source == resetreferencesItem)
20942288 {
20952289 for (int i=0; i<group.selection.size(); i++)
20962290 {
....@@ -2099,11 +2293,11 @@
20992293
21002294 refreshContents();
21012295 } else
2102
- if (event.getSource() == setMasterItem)
2296
+ if (source == setMasterItem)
21032297 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2298
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052299 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2300
+ Object3D content = Grafreed.clipboard.get(0);
21072301
21082302 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092303 content = ((cGroup)content).get(0);
....@@ -2112,13 +2306,13 @@
21122306 refreshContents();
21132307 }
21142308 } else
2115
- if (event.getSource() == poseMeshItem)
2309
+ if (source == poseMeshItem)
21162310 {
21172311 if (group.selection.size() == 1)
21182312 {
2119
- if (GraphreeD.clipboard.size() == 1)
2313
+ if (Grafreed.clipboard.size() == 1)
21202314 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2315
+ Object3D content = Grafreed.clipboard.get(0);
21222316
21232317 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242318 content = ((cGroup)content).get(0);
....@@ -2131,19 +2325,19 @@
21312325 }
21322326
21332327 } else
2134
- if (event.getSource() == revertMeshItem)
2328
+ if (source == revertMeshItem)
21352329 {
21362330 RevertMeshes();
21372331 } else
2138
- if (event.getSource() == resetMeshItem)
2332
+ if (source == resetAllItem)
21392333 {
21402334 ResetAll();
21412335 } else
2142
- if (event.getSource() == stepAllItem)
2336
+ if (source == stepAllItem)
21432337 {
21442338 StepAll();
21452339 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2340
+ if (source == clearItem) // || event.getSource() == clearButton)
21472341 {
21482342 //int indices[] = jList.getSelectedIndices();
21492343 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2345,46 @@
21512345
21522346 ClearSelection(false);
21532347 } else
2154
- if (event.getSource() == clearAllItem)
2348
+ if (source == clearAllItem)
21552349 {
21562350 ClearSelection(true);
21572351 } else
2158
- if (event.getSource() == grabItem)
2352
+ if (source == grabItem)
21592353 {
21602354 group(new cGroup(), true);
21612355 } else
2162
- if (event.getSource() == frontItem)
2356
+ if (source == hideItem)
2357
+ {
2358
+ group(new HiddenObject());
2359
+ } else
2360
+ if (source == frontItem)
21632361 {
21642362 front();
21652363 } else
2166
- if (event.getSource() == backItem)
2364
+ if (source == backItem)
21672365 {
21682366 back();
21692367 } else
2170
- if (event.getSource() == cameraItem)
2368
+ if (source == cameraItem)
21712369 {
21722370 makeSomething(new Camera());
21732371 } else
2174
- if (event.getSource() == compositeItem)
2372
+ if (source == compositeItem)
21752373 {
21762374 group(new Composite());
21772375 } else
2178
- if (event.getSource() == randomItem)
2376
+ if (source == randomItem)
21792377 {
21802378 RandomNode random = new RandomNode();
21812379 group(random);
21822380 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2381
+ random.name = random.get(0).name + "Switch";
21842382 } else
2185
- if (event.getSource() == physicsItem)
2383
+ if (source == physicsItem)
21862384 {
21872385 group(new PhysicsNode());
21882386 } else
2189
- if (event.getSource() == frameselectorItem)
2387
+ if (source == frameselectorItem)
21902388 {
21912389 for (int i=0; i<group.selection.size(); i++)
21922390 {
....@@ -2198,7 +2396,7 @@
21982396 ResetModel();
21992397 refreshContents();
22002398 } else
2201
- if (event.getSource() == switchGeoItem)
2399
+ if (source == switchGeoItem)
22022400 {
22032401 for (int i=0; i<group.selection.size(); i++)
22042402 {
....@@ -2210,7 +2408,7 @@
22102408 ResetModel();
22112409 refreshContents();
22122410 } else
2213
- if (event.getSource() == switchTransfoItem)
2411
+ if (source == switchTransfoItem)
22142412 {
22152413 for (int i=0; i<group.selection.size(); i++)
22162414 {
....@@ -2222,7 +2420,7 @@
22222420 ResetModel();
22232421 refreshContents();
22242422 } else
2225
- if (event.getSource() == morphItem)
2423
+ if (source == morphItem)
22262424 {
22272425 for (int i=0; i<group.selection.size(); i++)
22282426 {
....@@ -2234,7 +2432,7 @@
22342432 ResetModel();
22352433 refreshContents();
22362434 } else
2237
- if (event.getSource() == scriptNodeItem)
2435
+ if (source == scriptNodeItem)
22382436 {
22392437 boolean atleastone = false;
22402438
....@@ -2273,195 +2471,223 @@
22732471 }
22742472 }
22752473 } else
2276
- if (event.getSource() == linkerItem)
2474
+ if (source == linkerItem)
22772475 {
22782476 group(new cLinker());
22792477 } else
2280
- if (event.getSource() == textureItem)
2478
+ if (source == textureItem)
22812479 {
22822480 group(new TextureNode());
22832481 } else
2284
- if (event.getSource() == shadowXItem)
2482
+ if (source == billboardItem)
2483
+ {
2484
+ group(new BillboardNode());
2485
+ } else
2486
+ if (source == shadowXItem)
22852487 {
22862488 CastShadow(0);
22872489 } else
2288
- if (event.getSource() == shadowYItem)
2490
+ if (source == shadowYItem)
22892491 {
22902492 CastShadow(1);
22912493 } else
2292
- if (event.getSource() == shadowZItem)
2494
+ if (source == shadowZItem)
22932495 {
22942496 CastShadow(2);
22952497 } else
2296
- if (event.getSource() == ungroupItem)
2498
+ if (source == ungroupItem)
22972499 {
2298
- ungroup();
2500
+ //ungroup();
2501
+ for (int i=0; i<group.selection.size(); i++)
2502
+ {
2503
+ Ungroup(group.selection.get(i));
2504
+ }
2505
+
2506
+ ClearSelection(false);
2507
+
2508
+ refreshContents();
22992509 } else
2300
- if (event.getSource() == genUVItem)
2510
+ if (source == genUVItem)
23012511 {
23022512 GenUV();
23032513 } else
2304
- if (event.getSource() == genNormalsCADItem)
2514
+ if (source == genNormalsCADItem)
23052515 {
23062516 GenNormals(true);
23072517 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2518
+ if (source == genNormalsMESHItem)
2519
+ {
2520
+ GenNormals(true); // TODO
2521
+ } else
2522
+ if (source == genNormalsORGANItem)
23092523 {
23102524 GenNormals(false);
23112525 } else
2312
- if (event.getSource() == stripifyItem)
2526
+ if (source == genNormalsMINEItem)
2527
+ {
2528
+ GenNormalsMINE();
2529
+ } else
2530
+ if (source == stripifyItem)
23132531 {
23142532 Stripify();
23152533 } else
2316
- if (event.getSource() == unstripifyItem)
2534
+ if (source == unstripifyItem)
23172535 {
23182536 Unstripify();
23192537 } else
2320
- if (event.getSource() == trimItem)
2538
+ if (source == trimItem)
23212539 {
23222540 Trim();
23232541 } else
2324
- if (event.getSource() == untrimItem)
2542
+ if (source == untrimItem)
23252543 {
23262544 Untrim();
23272545 } else
2328
- if (event.getSource() == clearColorsItem)
2546
+ if (source == clearColorsItem)
23292547 {
23302548 ClearColors();
23312549 } else
2332
- if (event.getSource() == clearMaterialsItem)
2550
+ if (source == clearMaterialsItem)
23332551 {
23342552 ClearMaterials();
23352553 } else
2336
- if (event.getSource() == liveleavesItem)
2554
+ if (source == liveleavesItem)
23372555 {
23382556 LiveLeaves(true);
23392557 } else
2340
- if (event.getSource() == unliveleavesItem)
2558
+ if (source == unliveleavesItem)
23412559 {
23422560 LiveLeaves(false);
23432561 } else
2344
- if (event.getSource() == supportleavesItem)
2562
+ if (source == supportleavesItem)
23452563 {
23462564 SupportLeaves(true);
23472565 } else
2348
- if (event.getSource() == unsupportleavesItem)
2566
+ if (source == unsupportleavesItem)
23492567 {
23502568 SupportLeaves(false);
23512569 } else
2352
- if (event.getSource() == hideleavesItem)
2570
+ if (source == hideleavesItem)
23532571 {
23542572 HideLeaves(true);
23552573 } else
2356
- if (event.getSource() == showleavesItem)
2574
+ if (source == showleavesItem)
23572575 {
23582576 HideLeaves(false);
23592577 } else
2360
- if (event.getSource() == markleavesItem)
2578
+ if (source == markleavesItem)
23612579 {
23622580 MarkLeaves(true);
23632581 } else
2364
- if (event.getSource() == unmarkleavesItem)
2582
+ if (source == unmarkleavesItem)
23652583 {
23662584 MarkLeaves(false);
23672585 } else
2368
- if (event.getSource() == flipVItem)
2586
+ if (source == flipVItem)
23692587 {
23702588 FlipV(true);
23712589 } else
2372
- if (event.getSource() == unflipVItem)
2590
+ if (source == unflipVItem)
23732591 {
23742592 FlipV(false);
23752593 } else
2376
- if (event.getSource() == lowTexturesItem)
2594
+ if (source == lowTexturesItem)
23772595 {
23782596 SetTexRes(0);
23792597 } else
2380
- if (event.getSource() == normalTexturesItem)
2598
+ if (source == normalTexturesItem)
23812599 {
23822600 SetTexRes(1);
23832601 } else
2384
- if (event.getSource() == highTexturesItem)
2602
+ if (source == highTexturesItem)
23852603 {
23862604 SetTexRes(2);
23872605 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2606
+ if (source == veryhighTexturesItem)
23892607 {
23902608 SetTexRes(3);
23912609 } else
2392
- if (event.getSource() == maxTexturesItem)
2610
+ if (source == maxTexturesItem)
23932611 {
23942612 SetTexRes(4);
23952613 } else
2396
- if (event.getSource() == panoTexturesItem)
2614
+ if (source == panoTexturesItem)
23972615 {
23982616 SetTexRes(5);
23992617 } else
2400
- if (event.getSource() == reverseNormalsItem)
2618
+ if (source == reverseNormalsItem)
24012619 {
24022620 ReverseNormals();
24032621 } else
2404
- if (event.getSource() == parseverticesItem)
2622
+ if (source == parseverticesItem)
24052623 {
24062624 ParseVertices();
24072625 } else
2408
- if (event.getSource() == textureFieldItem)
2626
+ if (source == textureFieldItem)
24092627 {
24102628 TextureVertices();
24112629 } else
2412
- if (event.getSource() == alignItem)
2630
+ if (source == alignItem)
24132631 {
24142632 Align();
24152633 } else
2416
- if (event.getSource() == mirrorItem)
2634
+ if (source == mirrorItem)
24172635 {
24182636 MirrorPoses();
24192637 } else
2420
- if (event.getSource() == reduceMorphItem)
2638
+ if (source == reduceMorphItem)
24212639 {
24222640 MeshReduction(false);
24232641 } else
2424
- if (event.getSource() == reduce34MorphItem)
2642
+ if (source == reduce34MorphItem)
24252643 {
24262644 MeshReduction(true);
24272645 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2646
+ if (source == reverseTrianglesItem)
24292647 {
24302648 ReverseTriangles();
24312649 } else
2432
- if (event.getSource() == reduceMeshItem)
2650
+ if (source == reduceMeshItem)
24332651 {
24342652 ReduceMesh(false);
24352653 } else
2436
- if (event.getSource() == reduce34MeshItem)
2654
+ if (source == reduce34MeshItem)
24372655 {
24382656 ReduceMesh(true);
24392657 } else
2440
- if (event.getSource() == increaseMeshItem)
2658
+ if (source == increaseMeshItem)
24412659 {
24422660 IncreaseMesh();
24432661 } else
2444
- if (event.getSource() == clipMeshItem)
2662
+ if (source == clipMeshItem)
24452663 {
24462664 ClipMesh();
24472665 } else
2448
- if (event.getSource() == smoothMeshItem)
2666
+ if (source == smoothMeshItem)
24492667 {
24502668 SmoothMesh();
24512669 } else
2452
- if (event.getSource() == transformgeometryItem)
2670
+ if (source == transformGeometryItem)
24532671 {
24542672 TransformGeometry();
24552673 } else
2456
- if (event.getSource() == resetTransformItem)
2674
+ if (source == transformChildrenItem)
2675
+ {
2676
+ TransformChildren();
2677
+ } else
2678
+ if (source == resetTransformItem)
24572679 {
24582680 ResetTransform();
24592681 } else
2460
- if (event.getSource() == resetCentroidItem)
2682
+ if (source == resetCentroidItem)
24612683 {
2462
- ResetCentroid();
2684
+ ResetCentroid(true);
24632685 } else
2464
- if (event.getSource() == resetParentItem)
2686
+ if (source == resetCentroidXZItem)
2687
+ {
2688
+ ResetCentroid(false);
2689
+ } else
2690
+ if (source == resetParentItem)
24652691 {
24662692 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672693 {
....@@ -2471,7 +2697,7 @@
24712697
24722698 refreshContents();
24732699 } else
2474
- if (event.getSource() == repairParentItem)
2700
+ if (source == repairParentItem)
24752701 {
24762702 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772703 {
....@@ -2485,7 +2711,21 @@
24852711
24862712 refreshContents();
24872713 } else
2488
- if (event.getSource() == sortbysizeItem)
2714
+ if (source == repairShadowItem)
2715
+ {
2716
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2717
+ {
2718
+ Object3D obj = (Object3D)e.nextElement();
2719
+ obj.RepairShadow();
2720
+// for (int i=0; i<obj.size(); i++)
2721
+// {
2722
+// obj.get(i).parent = obj;
2723
+// }
2724
+ }
2725
+
2726
+ refreshContents();
2727
+ } else
2728
+ if (source == sortbysizeItem)
24892729 {
24902730 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912731 {
....@@ -2497,7 +2737,7 @@
24972737 ResetModel();
24982738 refreshContents();
24992739 } else
2500
- if (event.getSource() == sortbynameItem)
2740
+ if (source == sortbynameItem)
25012741 {
25022742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032743 {
....@@ -2509,7 +2749,7 @@
25092749 ResetModel();
25102750 refreshContents();
25112751 } else
2512
- if (event.getSource() == attachPigmentItem)
2752
+ if (source == attachPigmentItem)
25132753 {
25142754 String texture = GetFile("Attach pigment");
25152755 Object3D obj;
....@@ -2521,7 +2761,7 @@
25212761
25222762 refreshContents();
25232763 } else
2524
- if (event.getSource() == detachPigmentItem)
2764
+ if (source == detachPigmentItem)
25252765 {
25262766 Object3D obj;
25272767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2772,7 @@
25322772
25332773 refreshContents();
25342774 } else
2535
- if (event.getSource() == attachBumpItem)
2775
+ if (source == attachBumpItem)
25362776 {
25372777 String texture = GetFile("Attach bump");
25382778 Object3D obj;
....@@ -2544,7 +2784,7 @@
25442784
25452785 refreshContents();
25462786 } else
2547
- if (event.getSource() == detachBumpItem)
2787
+ if (source == detachBumpItem)
25482788 {
25492789 Object3D obj;
25502790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2795,7 @@
25552795
25562796 refreshContents();
25572797 } else
2558
- if (event.getSource() == pigmentBumpItem)
2798
+ if (source == pigmentBumpItem)
25592799 {
25602800 Object3D obj;
25612801 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2806,195 @@
25662806
25672807 refreshContents();
25682808 } else
2569
- if (event.getSource() == flashSelectionButton)
2809
+ if (source == flashSelectionButton)
25702810 {
25712811 CameraPane.flash = true;
25722812 refreshContents();
25732813 } else
2574
- if (event.getSource() == oneButton)
2814
+ if (source == oneButton)
25752815 {
25762816 } else
2577
- if (event.getSource() == twoButton)
2817
+ if (source == twoButton)
25782818 {
25792819 radio.layout = twoButton;
25802820 // bug
25812821 //gridPanel.setDividerLocation(1.0);
25822822 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
2823
+// bigThree.remove(scenePanel);
2824
+// bigThree.remove(centralPanel);
2825
+// bigThree.remove(XYZPanel);
2826
+// aWindowConstraints.gridx = 0;
2827
+// aWindowConstraints.gridy = 0;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// aWindowConstraints.weightx = 0;
2832
+// aWindowConstraints.weighty = 1;
2833
+// //bigThree.add(jtp, aWindowConstraints);
2834
+// aWindowConstraints.weightx = 1;
2835
+// aWindowConstraints.gridwidth = 3;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.gridx = 1;
2838
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2839
+// bigThree.add(centralPanel, aWindowConstraints);
2840
+// aWindowConstraints.weightx = 0;
2841
+// aWindowConstraints.gridx = 4;
2842
+// aWindowConstraints.gridwidth = 1;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2845
+// //bigThree.add(XYZPanel, aWindowConstraints);
2846
+// scenePanel.setVisible(false);
2847
+// centralPanel.setVisible(true);
2848
+// XYZPanel.setVisible(false);
2849
+ bigThree.ClearUI();
2850
+ bigThree.add(centralPanel);
2851
+ bigThree.FlushUI();
26072852 } else
2608
- if (event.getSource() == threeButton)
2853
+ if (source == threeButton)
26092854 {
26102855 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
2856
+
2857
+// bigThree.remove(scenePanel);
2858
+// bigThree.remove(centralPanel);
2859
+// bigThree.remove(XYZPanel);
2860
+// aWindowConstraints.gridx = 0;
2861
+// aWindowConstraints.gridy = 0;
2862
+// aWindowConstraints.gridwidth = 1;
2863
+// // aConstraints.gridheight = 3;
2864
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.weighty = 1;
2867
+// //bigThree.add(jtp, aWindowConstraints);
2868
+// aWindowConstraints.weightx = 1;
2869
+// aWindowConstraints.gridwidth = 3;
2870
+// // aConstraints.gridheight = 3;
2871
+// aWindowConstraints.gridx = 1;
2872
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2873
+// bigThree.add(centralPanel, aWindowConstraints);
2874
+// aWindowConstraints.weightx = 0;
2875
+// aWindowConstraints.gridx = 4;
2876
+// aWindowConstraints.gridwidth = 1;
2877
+// // aConstraints.gridheight = 3;
2878
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2879
+// bigThree.add(XYZPanel, aWindowConstraints);
2880
+// bigThree.validate();
2881
+// scenePanel.setVisible(false);
2882
+// centralPanel.setVisible(true);
2883
+// XYZPanel.setVisible(true);
2884
+ bigThree.ClearUI();
2885
+ bigThree.add(centralPanel);
2886
+ bigThree.add(XYZPanel);
2887
+ bigThree.FlushUI();
26352888 } else
2636
- if (event.getSource() == fourButton)
2889
+ if (source == fourButton)
26372890 {
26382891 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
2892
+
2893
+// bigThree.remove(scenePanel);
2894
+// bigThree.remove(centralPanel);
2895
+// bigThree.remove(XYZPanel);
2896
+// aWindowConstraints.gridx = 0;
2897
+// aWindowConstraints.gridy = 0;
2898
+// aWindowConstraints.gridwidth = 1;
2899
+// // aWindowConstraints.gridheight = 3;
2900
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.weighty = 1;
2903
+// bigThree.add(scenePanel, aWindowConstraints);
2904
+// aWindowConstraints.weightx = 1;
2905
+// aWindowConstraints.gridwidth = 3;
2906
+// // aConstraints.gridheight = 3;
2907
+// aWindowConstraints.gridx = 1;
2908
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2909
+// //bigThree.add(cameraPanel, aWindowConstraints);
2910
+// aWindowConstraints.weightx = 0;
2911
+// aWindowConstraints.gridx = 4;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aWindowConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// //bigThree.add(XYZPanel, aWindowConstraints);
2916
+// bigThree.validate();
2917
+// scenePanel.setVisible(true);
2918
+// centralPanel.setVisible(false);
2919
+// XYZPanel.setVisible(false);
2920
+ bigThree.ClearUI();
2921
+ bigThree.add(scenePanel);
2922
+ bigThree.FlushUI();
26632923 } else
2664
- if (event.getSource() == sixButton)
2924
+ if (source == sixButton)
26652925 {
26662926 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
2927
+
2928
+// bigThree.remove(scenePanel);
2929
+// bigThree.remove(centralPanel);
2930
+// bigThree.remove(XYZPanel);
2931
+// aWindowConstraints.gridx = 0;
2932
+// aWindowConstraints.gridy = 0;
2933
+// aWindowConstraints.gridwidth = 1;
2934
+// // aConstraints.gridheight = 3;
2935
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.weighty = 1;
2938
+// bigThree.add(scenePanel, aWindowConstraints);
2939
+// aWindowConstraints.weightx = 1;
2940
+// aWindowConstraints.gridwidth = 3;
2941
+// // aWindowConstraints.gridheight = 3;
2942
+// aWindowConstraints.gridx = 1;
2943
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2944
+// bigThree.add(centralPanel, aWindowConstraints);
2945
+// aWindowConstraints.weightx = 0;
2946
+// aWindowConstraints.gridx = 4;
2947
+// aWindowConstraints.gridwidth = 1;
2948
+// // aWindowConstraints.gridheight = 3;
2949
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2950
+// //bigThree.add(XYZPanel, aConstraints);
2951
+// bigThree.validate();
2952
+// scenePanel.setVisible(true);
2953
+// centralPanel.setVisible(true);
2954
+// XYZPanel.setVisible(false);
2955
+ bigThree.ClearUI();
2956
+ bigThree.add(scenePanel);
2957
+ bigThree.add(centralPanel);
2958
+ bigThree.FlushUI();
26912959 } else
2692
- if (event.getSource() == sevenButton)
2960
+ if (source == sevenButton)
26932961 {
26942962 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
2963
+
2964
+// bigThree.remove(scenePanel);
2965
+// bigThree.remove(centralPanel);
2966
+// bigThree.remove(XYZPanel);
2967
+// aWindowConstraints.gridx = 0;
2968
+// aWindowConstraints.gridy = 0;
2969
+// aWindowConstraints.gridwidth = 1;
2970
+// // aWindowConstraints.gridheight = 3;
2971
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2972
+// aWindowConstraints.weightx = 0;
2973
+// aWindowConstraints.weighty = 1;
2974
+// bigThree.add(scenePanel, aWindowConstraints);
2975
+// aWindowConstraints.weightx = 1;
2976
+// aWindowConstraints.gridwidth = 3;
2977
+// // aWindowConstraints.gridheight = 3;
2978
+// aWindowConstraints.gridx = 1;
2979
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2980
+// bigThree.add(centralPanel, aWindowConstraints);
2981
+// aWindowConstraints.weightx = 0;
2982
+// aWindowConstraints.gridx = 4;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// bigThree.add(XYZPanel, aWindowConstraints);
2987
+// bigThree.validate();
2988
+// scenePanel.setVisible(true);
2989
+// centralPanel.setVisible(true);
2990
+// XYZPanel.setVisible(true);
2991
+ bigThree.ClearUI();
2992
+ bigThree.add(scenePanel);
2993
+ bigThree.add(centralPanel);
2994
+ bigThree.add(XYZPanel);
2995
+ bigThree.FlushUI();
27192996 } else
2720
- if (event.getSource() == rootButton)
2997
+ if (source == rootButton)
27212998 {
27222999 Object3D obj;
27233000 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +3006,7 @@
27293006
27303007 refreshContents(true);
27313008 } else
2732
- if (event.getSource() == closeButton)
3009
+ if (source == closeButton)
27333010 {
27343011 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353012 cRadio ab;
....@@ -2750,11 +3027,11 @@
27503027 }
27513028 refreshContents(true);
27523029 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3030
+ if (source == editItem || source == editButton)
27543031 {
27553032 EditSelection(false);
27563033 } else
2757
- if (event.getSource() == uneditButton)
3034
+ if (source == uneditButton)
27583035 {
27593036 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603037 {
....@@ -2764,14 +3041,14 @@
27643041 child.CloseUI();
27653042 listUI.remove(child);
27663043
2767
- child.editWindow = null; // ???????????
3044
+ //child.editWindow = null; // ???????????
27683045 }
2769
- objEditor.ctrlPanel.revalidate();
3046
+ objEditor.ctrlPanel.FlushUI();
27703047 //objEditor.jTree.clearSelection();
27713048 //objEditor.ResetSliders();
27723049 refreshContents(true);
27733050 } else
2774
- if (event.getSource() == clearPanelButton)
3051
+ if (source == clearPanelButton)
27753052 {
27763053 assert(copy == group);
27773054 //copy.ClearUI();
....@@ -2782,7 +3059,7 @@
27823059 listUI.clear();
27833060 refreshContents(true);
27843061 } else
2785
- if (event.getSource() == allParamsButton)
3062
+ if (source == allParamsButton)
27863063 {
27873064 assert(copy == group);
27883065
....@@ -2803,19 +3080,19 @@
28033080
28043081 refreshContents(true);
28053082 } else
2806
- if (event.getSource() == unselectButton)
3083
+ if (source == unselectButton)
28073084 {
28083085 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3086
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103087 objEditor.ResetSliders();
28113088 refreshContents(true);
28123089 } else
2813
- if(event.getSource() instanceof cRadio)
3090
+ if(source instanceof cRadio)
28143091 {
28153092 group.parent = keepparent;
28163093 group.attributes = 0;
28173094 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3095
+ /*cRadio*/ radio = (cRadio)source;
28193096 Object3D obj = radio.GetObject();
28203097 System.out.println("Edit " + obj);
28213098 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3112,7 @@
28353112 }
28363113
28373114 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3115
+ //Globals.theRenderer.object = group;
28393116 if(!useclient)
28403117 {
28413118 cameraView.renderCamera = radio.camera;
....@@ -2844,12 +3121,15 @@
28443121 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453122 cameraView.targetLookAt.set(radio.camera.lookAt);
28463123 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3124
+ //cameraView.lighttouched = true;
3125
+ Globals.lighttouched = true;
28483126 topView.object = group;
28493127 frontView.object = group;
28503128 sideView.object = group;
28513129 }
2852
- group.editWindow = this;
3130
+
3131
+// fix "+" issue group.editWindow = this;
3132
+
28533133 /*
28543134 currentLayout = radio.layout;
28553135 if (currentLayout == null)
....@@ -2862,7 +3142,20 @@
28623142 //group.attributes = -1;
28633143 ResetModel();
28643144 refreshContents(true);
2865
- }
3145
+ } else if (event.getSource() == editCameraItem)
3146
+ {
3147
+ cameraView.ProtectCamera();
3148
+ cameraView.repaint();
3149
+ return;
3150
+ } else if (event.getSource() == revertCameraItem)
3151
+ {
3152
+ cameraView.RevertCamera();
3153
+ cameraView.repaint();
3154
+ return;
3155
+ // } else if (event.getSource() == textureButton)
3156
+ // {
3157
+ // return; // true;
3158
+ }
28663159 else
28673160 {
28683161 //return super.action(event, arg);
....@@ -2880,7 +3173,7 @@
28803173 if (useclient)
28813174 {
28823175 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3176
+ Globals.lighttouched = true;
28843177 //topView.object = client;
28853178 //frontView.object = client;
28863179 //sideView.object = client;
....@@ -2888,7 +3181,7 @@
28883181 else
28893182 {
28903183 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3184
+ Globals.lighttouched = true;
28923185 //topView.object = group;
28933186 //frontView.object = group;
28943187 //sideView.object = group;
....@@ -2923,6 +3216,28 @@
29233216 refreshContents();
29243217 }
29253218
3219
+ void TransformChildren()
3220
+ {
3221
+ Object3D obj;
3222
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3223
+ {
3224
+ obj = (Object3D)e.nextElement();
3225
+ obj.KeepTextureMatrices();
3226
+ obj.TransformChildren();
3227
+ obj.RestoreTextureMatrices();
3228
+
3229
+// if (obj.parent == null)
3230
+// {
3231
+// System.out.println("NULL PARENT!");
3232
+// new Exception().printStackTrace();
3233
+// }
3234
+// else
3235
+// TouchTransform(obj);
3236
+// //obj.parent.Touch();
3237
+ }
3238
+
3239
+ refreshContents();
3240
+ }
29263241
29273242 void ResetTransform()
29283243 {
....@@ -3035,7 +3350,7 @@
30353350 refreshContents();
30363351 }
30373352
3038
- void ResetCentroid()
3353
+ void ResetCentroid(boolean full)
30393354 {
30403355 Object3D obj;
30413356 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3365,16 @@
30503365 LA.matIdentity(Object3D.mat);
30513366 obj.getBounds(minima, maxima, false);
30523367 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3368
+ if (full)
3369
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543370 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553371 obj.TransformMesh(Object3D.mat);
3372
+
30563373 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3374
+ if (full)
3375
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583376 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3377
+
30593378 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603379 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613380 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3121,9 +3440,9 @@
31213440 obj = (Object3D)e.nextElement();
31223441
31233442 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3443
+ Grafreed.AnalyzeObject(obj);
31253444 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3445
+ Grafreed.AnalyzeObject(obj.bRep);
31273446
31283447 // System.err.println((size/1024) + " KB is the size of " + obj);
31293448 }
....@@ -3165,6 +3484,13 @@
31653484 void GenNormals(boolean crease)
31663485 {
31673486 group.GenNormalsS(crease);
3487
+
3488
+ refreshContents();
3489
+ }
3490
+
3491
+ void GenNormalsMINE()
3492
+ {
3493
+ group.selection.GenNormalsMINE();
31683494
31693495 refreshContents();
31703496 }
....@@ -3250,7 +3576,7 @@
32503576 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513577 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523578 //
3253
-// g.add(GraphreeD.clipboard);
3579
+// g.add(GrafreeD.clipboard);
32543580 //
32553581 // buffer.add(g);
32563582 // }
....@@ -3269,8 +3595,8 @@
32693595 // nodes = new Object3D();
32703596 // vertices = new Vector<Vertex>();
32713597 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3598
+// boolean epsequal = GrafreeD.epsequal;
3599
+// GrafreeD.epsequal = true;
32743600 //
32753601 // for (int i=0; i<group.selection.size(); i++)
32763602 // {
....@@ -3311,7 +3637,7 @@
33113637 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123638 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133639 //
3314
-// g.add(GraphreeD.clipboard);
3640
+// g.add(GrafreeD.clipboard);
33153641 //
33163642 // buffer.add(g);
33173643 // }
....@@ -3319,7 +3645,7 @@
33193645 // makeSomething(buffer, i==group.selection.size()-1);
33203646 // }
33213647 //
3322
-// GraphreeD.epsequal = epsequal;
3648
+// GrafreeD.epsequal = epsequal;
33233649 //
33243650 // //buffer = null;
33253651 // temprep = null;
....@@ -3330,8 +3656,8 @@
33303656
33313657 void ParseVertices()
33323658 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3659
+ boolean epsequal = Grafreed.epsequal;
3660
+ Grafreed.epsequal = true;
33353661
33363662 for (int i=0; i<group.selection.size(); i++)
33373663 {
....@@ -3356,7 +3682,7 @@
33563682 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573683 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583684
3359
- g.add(GraphreeD.clipboard);
3685
+ g.add(Grafreed.clipboard);
33603686
33613687 buffer.add(g);
33623688 }
....@@ -3371,7 +3697,7 @@
33713697 makeSomething(buffer, i==group.selection.size()-1);
33723698 }
33733699
3374
- GraphreeD.epsequal = epsequal;
3700
+ Grafreed.epsequal = epsequal;
33753701
33763702 refreshContents();
33773703 }
....@@ -3389,7 +3715,16 @@
33893715 String pigment = Object3D.GetPigment(tex);
33903716 //String bump = Object3D.GetBump(tex);
33913717
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3718
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3719
+
3720
+ try
3721
+ {
3722
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3723
+ }
3724
+ catch (Exception e)
3725
+ {
3726
+ System.err.println("FAIL: " + node);
3727
+ }
33933728
33943729 double s = v.s;
33953730
....@@ -3416,7 +3751,7 @@
34163751 scale /= 3;
34173752
34183753 scale /= 0xFF;
3419
- scale /= 4;
3754
+ // c'est quoi ca? scale /= 4;
34203755
34213756 //v.AO = scale;
34223757
....@@ -3437,12 +3772,26 @@
34373772
34383773 void Align()
34393774 {
3775
+ if (group.selection.size() == 0)
3776
+ return;
3777
+
3778
+ cVector bbmin = new cVector();
3779
+ cVector bbmax = new cVector();
3780
+
3781
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3782
+
3783
+ double dx = bbmax.x - bbmin.x;
3784
+ double dy = bbmax.y - bbmin.y;
3785
+ double dz = bbmax.z - bbmin.z;
3786
+
3787
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3788
+
34403789 for (int i=0; i<group.selection.size(); i++)
34413790 {
34423791 Object3D obj = group.selection.get(i);
34433792
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3793
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3794
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463795 }
34473796
34483797 refreshContents();
....@@ -3455,7 +3804,7 @@
34553804 // ref.SaveSupports();
34563805 // Object3D par = ref.parent;
34573806 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3807
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593808 // ref.parent = par;
34603809 // ref.RestoreSupports();
34613810
....@@ -3463,11 +3812,11 @@
34633812
34643813 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34653814
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
3815
+ boolean random = CameraPane.SWITCH;
3816
+ CameraPane.SWITCH = false; // parse all random nodes
34683817 lowres.linkVerticesThis(null);
34693818 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
3819
+ CameraPane.SWITCH = random;
34713820
34723821 System.err.flush();
34733822
....@@ -3485,7 +3834,7 @@
34853834 // lowres.SaveSupports();
34863835 // par = lowres.parent;
34873836 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3837
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893838 Object3D newlow = CloneObject(lowres, false);
34903839 newlow.name = sn.switchobject.get(i).name;
34913840 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3856,7 @@
35073856 return;
35083857
35093858 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3859
+ Object3D ref = Grafreed.clipboard.get(0);
35113860
35123861 Object3D newgroup = new Object3D("Po:" + poses.name);
35133862
....@@ -3676,7 +4025,7 @@
36764025 group.selection.RelinkToSupport(); // july 2014
36774026 System.out.println("DONE.");
36784027 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4028
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804029 }
36814030
36824031 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4050,20 @@
37014050
37024051 void ClipMesh()
37034052 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4053
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054054 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4055
+ Object3D content = Grafreed.clipboard.get(0);
37074056
37084057 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094058 content = ((cGroup)content).get(0);
37104059
37114060 // for (int i=0; i<group.selection.size(); i++)
37124061 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4062
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144063 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4064
+ group.selection.ClipMesh(Grafreed.clipboard);
37164065 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4066
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184067 System.out.println("DONE.");
37194068 refreshContents();
37204069 }
....@@ -3847,7 +4196,7 @@
38474196 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484197
38494198 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4199
+ if(elem != group || !newWindow)
38514200 {
38524201 // if (!(elem instanceof Composite))
38534202 // newWindow = false;
....@@ -3952,25 +4301,28 @@
39524301 System.err.println("info : " + child.GetPath());
39534302 }
39544303 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4304
+// else
4305
+// {
4306
+// objEditor.SetMaterial(group); // .GetMaterial());
4307
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4308
+// System.err.println("info : " + group.GetPath());
4309
+// }
39614310
39624311 objEditor.SetText(); // jan 2014
39634312
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4313
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654314 CameraPane.flash = true;
39664315
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4316
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684317 // a camera
39694318 {
3970
- CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4319
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4320
+ {
4321
+ CameraPane.camerachangeframe = 0; // don't refuse it
4322
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4323
+ }
4324
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4325
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744326 }
39754327
39764328 refreshContents();
....@@ -4052,12 +4404,12 @@
40524404 {
40534405 if (group.selection.isEmpty())
40544406 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4407
+ Grafreed.clipboardIsTempGroup = false;
40564408 Composite tGroup = null;
40574409 if (group.selection.size() > 0) // 1)
40584410 {
40594411 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4412
+ Grafreed.clipboardIsTempGroup = true;
40614413 }
40624414
40634415 if (cut)
....@@ -4097,16 +4449,16 @@
40974449 //System.out.println("cut " + child);
40984450 //System.out.println("parent = " + child.parent);
40994451 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4452
+ if (Grafreed.clipboardIsTempGroup)
41014453 tGroup.add/*Child*/(tmp);
41024454 else
4103
- GraphreeD.clipboard = tmp;
4455
+ Grafreed.clipboard = tmp;
41044456 }
41054457 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
41074459 tGroup.add/*Child*/(child);
41084460 else
4109
- GraphreeD.clipboard = child;
4461
+ Grafreed.clipboard = child;
41104462 }
41114463
41124464 //ResetModel();
....@@ -4138,21 +4490,21 @@
41384490 //System.out.println("cut " + elem);
41394491 //System.out.println("parent = " + elem.parent);
41404492 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4493
+ if (Grafreed.clipboardIsTempGroup)
41424494 tGroup.add/*Child*/(tmp);
41434495 else
4144
- GraphreeD.clipboard = tmp;
4496
+ Grafreed.clipboard = tmp;
41454497 }
41464498 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4499
+ if (Grafreed.clipboardIsTempGroup)
41484500 tGroup.add/*Child*/(child);
41494501 else
4150
- GraphreeD.clipboard = child;
4502
+ Grafreed.clipboard = child;
41514503 }
41524504
41534505 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4506
+ if (Grafreed.clipboardIsTempGroup)
4507
+ Grafreed.clipboard = tGroup;
41564508 if (cut)
41574509 {
41584510 ResetModel();
....@@ -4162,11 +4514,11 @@
41624514
41634515 void paste(boolean expand)
41644516 {
4165
- // if (GraphreeD.clipboard == null)
4517
+ // if (GrafreeD.clipboard == null)
41664518 // return;
41674519 boolean first = true;
41684520
4169
- if (GraphreeD.clipboardIsTempGroup)
4521
+ if (Grafreed.clipboardIsTempGroup)
41704522 {
41714523 Composite temp;
41724524
....@@ -4177,7 +4529,7 @@
41774529 temp = (Composite)Applet3D.clipboard.deepCopy();
41784530 */
41794531 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4532
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814533 {
41824534 Object3D child = (Object3D)e.nextElement();
41834535
....@@ -4191,7 +4543,7 @@
41914543 else
41924544 elem = child.deepCopy(); // ?
41934545 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4546
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954547 // elem = elem.get(0);
41964548 makeSomething(elem, true); // ?? first);
41974549 //group.addChild(elem);
....@@ -4211,23 +4563,23 @@
42114563 //Object3D cb = Applet3D.clipboard;
42124564 //temp.addChild(cb);
42134565 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4566
+ assert(Grafreed.clipboard.parent == null);
4567
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4568
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4569
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4570
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194571 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4572
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4573
+ Grafreed.clipboard.get(0).parent = keepparent;
42224574 }
42234575
42244576 ResetModel();
42254577 refreshContents();
42264578 }
42274579
4228
- void pasteInto(boolean copyit)
4580
+ void pasteInto(boolean copyit, boolean clone)
42294581 {
4230
-// if (GraphreeD.clipboard == null)
4582
+// if (GrafreeD.clipboard == null)
42314583 // return;
42324584
42334585 if (group.selection.size() != 1)
....@@ -4254,15 +4606,22 @@
42544606 if (copyit)
42554607 {
42564608 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4609
+ if (clone)
4610
+ {
4611
+ CloneClipboard(false); // sept 2014
4612
+ }
4613
+ else
4614
+ {
4615
+ paste(false);
4616
+ }
42584617 }
42594618 else
42604619 {
42614620 boolean first = true;
42624621
4263
- if (GraphreeD.clipboardIsTempGroup)
4622
+ if (Grafreed.clipboardIsTempGroup)
42644623 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4624
+ Composite temp = (Composite)Grafreed.clipboard;
42664625 Object3D copy;
42674626 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684627 {
....@@ -4272,7 +4631,7 @@
42724631 }
42734632 } else
42744633 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4634
+ linkSomething(Grafreed.clipboard); //.get(0));
42764635 }
42774636 }
42784637 }
....@@ -4464,6 +4823,26 @@
44644823 makeSomething(csg);
44654824 }
44664825
4826
+ void Ungroup(Object3D g)
4827
+ {
4828
+ if (g instanceof HiddenObject)
4829
+ {
4830
+ HiddenObject h = (HiddenObject) g;
4831
+
4832
+ for (int i=0; i<h.ActualSize(); i++)
4833
+ {
4834
+ objEditor.makeSomething(h.get(i), false);
4835
+ }
4836
+ }
4837
+ else
4838
+ {
4839
+ for (int i=0; i<g.Size(); i++)
4840
+ {
4841
+ objEditor.makeSomething(g.get(i), false);
4842
+ }
4843
+ }
4844
+ }
4845
+
44674846 void ungroup()
44684847 {
44694848 /*
....@@ -4657,21 +5036,6 @@
46575036 }
46585037 */
46595038
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755039 /*
46765040 public void Callback(Object obj)
46775041 {
....@@ -4695,26 +5059,9 @@
46955059 }
46965060 */
46975061
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155062 String GetFile(String dialogName)
47165063 {
4717
- if (GraphreeD.standAlone)
5064
+ if (Grafreed.standAlone)
47185065 {
47195066 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205067 browser.show();
....@@ -4778,10 +5125,12 @@
47785125 cButton flashSelectionButton;
47795126 cButton editButton;
47805127 cButton uneditButton;
5128
+ JCheckBox allParamsButton;
47815129 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835130 cButton unselectButton;
47845131
5132
+ cButton oneStepButton;
5133
+
47855134 cButton screenfitButton;
47865135 cButton screenfitpointButton;
47875136 cButton snapobjectButton;
....@@ -4812,6 +5161,8 @@
48125161 private MenuItem lookFromItem;
48135162 private MenuItem switchItem;
48145163 private MenuItem cutItem;
5164
+ private MenuItem undoItem;
5165
+ private MenuItem redoItem;
48155166 private MenuItem duplicateItem;
48165167 private MenuItem cloneItem;
48175168 private MenuItem cloneSupportItem;
....@@ -4823,8 +5174,9 @@
48235174 private MenuItem resetsupportItem;
48245175 private MenuItem resetreferencesItem;
48255176 private MenuItem linkverticesItem;
5177
+ private MenuItem relinkverticesItem;
48265178 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5179
+ private MenuItem resetAllItem;
48285180 private MenuItem stepAllItem;
48295181 private MenuItem revertMeshItem;
48305182 private MenuItem poseMeshItem;
....@@ -4835,14 +5187,17 @@
48355187 private MenuItem mergeGeometriesItem;
48365188 private MenuItem copyItem;
48375189 private MenuItem pasteItem;
5190
+ private MenuItem pasteIntoItem;
48385191 private MenuItem pasteLinkItem;
48395192 private MenuItem pasteCloneItem;
48405193 private MenuItem pasteExpandItem;
48415194 private MenuItem clearItem;
48425195 private MenuItem clearAllItem;
48435196 private MenuItem genUVItem;
5197
+ private MenuItem genNormalsMESHItem;
48445198 private MenuItem genNormalsCADItem;
48455199 private MenuItem genNormalsORGANItem;
5200
+ private MenuItem genNormalsMINEItem;
48465201 private MenuItem stripifyItem;
48475202 private MenuItem unstripifyItem;
48485203 private MenuItem trimItem;
....@@ -4882,8 +5237,11 @@
48825237 private MenuItem panoTexturesItem;
48835238
48845239 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5240
+ private MenuItem resetCentroidXZItem;
48865241 private MenuItem resetTransformItem;
5242
+ private MenuItem transformGeometryItem;
5243
+ private MenuItem transformChildrenItem;
5244
+ private MenuItem hideItem;
48875245 private MenuItem grabItem;
48885246 private MenuItem backItem;
48895247 private MenuItem frontItem;
....@@ -4904,6 +5262,7 @@
49045262
49055263 private MenuItem resetParentItem;
49065264 private MenuItem repairParentItem;
5265
+ private MenuItem repairShadowItem;
49075266 private MenuItem sortbysizeItem;
49085267 private MenuItem sortbynameItem;
49095268
....@@ -4924,10 +5283,11 @@
49245283 private MenuItem coneItem;
49255284 private MenuItem torusItem;
49265285 private MenuItem superItem;
5286
+ private MenuItem kleinItem;
49275287 private MenuItem blobItem;
49285288 private MenuItem latheItem;
49295289 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5290
+ private MenuItem overlayItem;
49315291 private MenuItem meshItem;
49325292 // private MenuItem meshGroupItem;
49335293 private MenuItem springItem;
....@@ -4936,6 +5296,7 @@
49365296 private MenuItem csgItem;
49375297 private MenuItem templateItem;
49385298 private MenuItem textureItem;
5299
+ private MenuItem billboardItem;
49395300 private MenuItem shadowXItem;
49405301 private MenuItem shadowYItem;
49415302 private MenuItem shadowZItem;
....@@ -4948,11 +5309,6 @@
49485309 private MenuItem doubleItem;
49495310 private MenuItem tripleItem;
49505311
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565312 private MenuItem computeAOItem;
49575313 private MenuItem recompileItem;
49585314 private MenuItem editScriptItem;
....@@ -4962,4 +5318,8 @@
49625318 private MenuItem analyzeItem;
49635319 private MenuItem dumpItem;
49645320 //boolean freezemodel = false;
5321
+
5322
+ Menu cameraMenu;
5323
+ MenuItem editCameraItem;
5324
+ MenuItem revertCameraItem;
49655325 }