Normand Briere
2019-06-11 4113164b3be1e50251ac40d6fd65660f0a6c2e63
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,130 @@
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
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //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
-
286
+ }
287
+
192288 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);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,48 +305,68 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
222325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223326 setMasterItem.addActionListener(this);
327
+ }
224328
225329 oe.menuBar.add(menu = new Menu("Group"));
226330 grabItem = menu.add(new MenuItem("Grab"));
227331 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230332 backItem = menu.add(new MenuItem("Back"));
231333 backItem.addActionListener(this);
334
+ frontItem = menu.add(new MenuItem("Front"));
335
+ frontItem.addActionListener(this);
232336 compositeItem = menu.add(new MenuItem("Composite"));
233337 compositeItem.addActionListener(this);
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
339
+ hideItem.addActionListener(this);
340
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
341
+ ungroupItem.addActionListener(this);
234342 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
236344 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);
241345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242346 switchGeoItem.addActionListener(this);
243347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244348 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
246350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
247359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248360 scriptNodeItem.addActionListener(this);
249361 cameraItem = menu.add(new MenuItem("Camera"));
250362 cameraItem.addActionListener(this);
363
+ }
251364
252365 oe.menuBar.add(menu = new Menu("Object"));
253366 textureItem = menu.add(new MenuItem("Texture"));
254367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
255370 csgItem = menu.add(new MenuItem("CSG"));
256371 csgItem.addActionListener(this);
257372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +375,29 @@
260375 shadowYItem.addActionListener(this);
261376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
263381 linkerItem = menu.add(new MenuItem("Linker"));
264382 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267383 attributeItem = menu.add(new MenuItem("Attribute"));
268384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
269387 pointflowItem = menu.add(new MenuItem("Point Flow"));
270388 pointflowItem.addActionListener(this);
389
+ }
271390 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275392 resetTransformItem.addActionListener(this);
276393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277394 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
280401
281402 oe.menuBar.add(menu = new Menu("Geometry"));
282403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +406,13 @@
285406 genNormalsORGANItem.addActionListener(this);
286407 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287408 genNormalsCADItem.addActionListener(this);
409
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
410
+ genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
288416 stripifyItem = menu.add(new MenuItem("Stripify"));
289417 stripifyItem.addActionListener(this);
290418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +434,34 @@
306434 reduce34MeshItem.addActionListener(this);
307435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308436 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
313445
314446 oe.menuBar.add(menu = new Menu("Attributes"));
315447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
317453 menu.add("-");
318454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319455 liveleavesItem.addActionListener(this);
320456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
322460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323461 supportleavesItem.addActionListener(this);
324462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325463 unsupportleavesItem.addActionListener(this);
464
+ }
326465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327466 hideleavesItem.addActionListener(this);
328467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -366,29 +505,22 @@
366505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367506 sortbynameItem.addActionListener(this);
368507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
369515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370516 extractGeometriesItem.addActionListener(this);
371517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372518 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);
519
+ }
377520
378521 oe.menuBar.add(menu = new Menu("Insert"));
379522 buildCreateMenu(menu);
380523
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
-
392524 oe.menuBar.add(menu = new Menu("Tools"));
393525 buildToolsMenu(menu);
394526 }
....@@ -423,150 +555,110 @@
423555 oe.radioPanel.add(dummyButton);
424556 oe.buttonGroup.add(dummyButton);
425557 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429559
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
431574 liveCB.addItemListener(this);
432575
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);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
451582 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);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
493586 trackCB.addItemListener(this);
494587
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
497590 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
591
+
499592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500593 // 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;
505594
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);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ flashSelectionButton.setToolTipText("Show selection");
512604 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516605
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607
+
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ twoButton.setToolTipText("Show center view only");
519610 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521612 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
613
+ fourButton.setToolTipText("Show left panel only");
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ sixButton.setToolTipText("2-column layout left");
523616 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618
+ threeButton.setToolTipText("2-column layout right");
525619 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ sevenButton.setToolTipText("3-column layout");
527622 sevenButton.addActionListener(this);
528623 //
529624
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
531627 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ closeButton.setToolTipText("Close tab");
534631 closeButton.addActionListener(this);
535632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536633 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538634
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
541639 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545640
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
547643 uneditButton.addActionListener(this);
548644
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);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
561647 allParamsButton.addActionListener(this);
562648
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);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
568655 unselectButton.addActionListener(this);
569656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
570662 // oe.aConstraints.gridx += 1;
571663 // oe.aConstraints.weighty = 0;
572664 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +670,37 @@
578670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579671 // gcButton.addActionListener(this);
580672
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;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
592676 //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);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594678 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
599682
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);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
604687 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
607691 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
610695 textureCB.addItemListener(this);
611696
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
614700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
615704 //jList.addListSelectionListener(this);
616705 oe.jTree.addTreeSelectionListener(this);
617706 //jTree.setRootVisible(false);
....@@ -633,18 +722,91 @@
633722 radio.layout = sevenButton;
634723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635724 }
725
+
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727
+ {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
757
+// constraints.gridy += 1;
758
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759
+// speakerMocapCB.addItemListener(this);
760
+
761
+ if (false)
762
+ {
763
+ // handled in scripts
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
766
+ speakerCameraCB.addItemListener(this);
767
+
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
770
+ speakerFocusCB.addItemListener(this);
771
+
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774
+ smoothfocusCB.addItemListener(this);
775
+ }
776
+
777
+//constraints.gridx += 1;
778
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779
+// debugCB.addItemListener(this);
780
+
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
782
+ oeilCB.addItemListener(this);
783
+
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785
+ lookAtCB.setToolTipText("Look-at target");
786
+ lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
795
+
796
+ }
636797
637798 void EditObject(Object3D obj)
638799 {
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();
800
+ cRadio radioButton = new cRadio(obj.name);
801
+ radioButton.SetObject(obj);
802
+ radioButton.layout = sevenButton;
803
+ radioButton.SetCamera(cameraView.renderCamera, false);
804
+ radioButton.addActionListener(this);
805
+ radioPanel.add(radioButton);
806
+ buttonGroup.add(radioButton);
807
+ radioButton.doClick();
647808 }
809
+
648810 void SetupViews(ObjEditor oe)
649811 {
650812 oe.SetupViews();
....@@ -663,6 +825,7 @@
663825 JCheckBox fastCB;
664826 JCheckBox slowCB;
665827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
666829 JCheckBox trackCB;
667830 JCheckBox smoothfocusCB;
668831 // JCheckBox speakerMocapCB;
....@@ -705,8 +868,7 @@
705868 dropAttributes |= Object3D.TEXTURE;
706869 else
707870 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
710872 {
711873 cameraView.ToggleLive();
712874 }
....@@ -743,6 +905,10 @@
743905 Recompile();
744906 cameraView.repaint();
745907 // refreshContents();
908
+ }
909
+ else if(e.getSource() == zoomBoxCB)
910
+ {
911
+ cameraView.ToggleZoomBoxMode();
746912 }
747913 else if(e.getSource() == smoothfocusCB)
748914 {
....@@ -857,7 +1023,9 @@
8571023 // objEditor.DropFile((java.io.File[]) object, true);
8581024 // return;
8591025 // }
860
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611029 {
8621030 // file(s)
8631031 String[] names = string.split("\n");
....@@ -884,7 +1052,7 @@
8841052
8851053 flashIt = false;
8861054 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891057
8901058 if (group.selection.size() == 1)
....@@ -911,11 +1079,11 @@
9111079 {
9121080 loadClipboard(true);
9131081 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1082
+ pasteInto(false, false);
9151083 } else {
9161084 loadClipboard(false);
9171085 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9191087 }
9201088 }
9211089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1201,37 @@
10331201 torusItem.addActionListener(this);
10341202 superItem = menu.add(new MenuItem("Superellipsoid"));
10351203 superItem.addActionListener(this);
1204
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1205
+ kleinItem.addActionListener(this);
10361206 particleItem = menu.add(new MenuItem("Particle system"));
10371207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10381210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391211 ragdollItem.addActionListener(this);
10401212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411213 ragdoll2Item.addActionListener(this);
1214
+ }
10421215 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441217 meshItem.addActionListener(this);
10451218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10471222 springItem = menu.add(new MenuItem("Spring"));
10481223 springItem.addActionListener(this);
10491224 flagItem = menu.add(new MenuItem("Flag"));
10501225 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);
10551226 blobItem = menu.add(new MenuItem("Blob"));
10561227 blobItem.addActionListener(this);
10571228 latheItem = menu.add(new MenuItem("Lathe"));
10581229 latheItem.addActionListener(this);
1230
+ }
1231
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1232
+ bezierItem.addActionListener(this);
1233
+ overlayItem = menu.add(new MenuItem("Overlay"));
1234
+ overlayItem.addActionListener(this);
10591235 lightItem = menu.add(new MenuItem("Light"));
10601236 lightItem.addActionListener(this);
10611237 menu.add("-");
....@@ -1065,34 +1241,39 @@
10651241 loopItem.addActionListener(this);
10661242 doubleItem = menu.add(new MenuItem("Fork"));
10671243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
10681246 tripleItem = menu.add(new MenuItem("Trident"));
10691247 tripleItem.addActionListener(this);
1248
+ }
10701249 }
10711250
10721251 void buildToolsMenu(Menu menu)
10731252 {
10741253 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751254 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1255
+ animationItem.setState(Globals.ANIMATION);
10771256
10781257 menu.add("-");
10791258 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801259 parseverticesItem.addActionListener(this);
10811260 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821261 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841263 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881265 reduceMorphItem.addActionListener(this);
10891266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901267 reduce34MorphItem.addActionListener(this);
1091
-
1268
+ menu.add("-");
10921269 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931270 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
10961277 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971278 memoryItem.addActionListener(this);
10981279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1287,8 @@
11061287 resetParentItem.addActionListener(this);
11071288 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081289 repairParentItem.addActionListener(this);
1290
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1291
+ repairShadowItem.addActionListener(this);
11091292 menu.add(invariantsItem = new MenuItem("Invariants"));
11101293 invariantsItem.addActionListener(this);
11111294 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1296,7 @@
11131296 menu.add("-");
11141297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151298 editScriptItem.addActionListener(this);
1299
+ }
11161300 }
11171301
11181302 void ScreenFit()
....@@ -1441,9 +1625,9 @@
14411625
14421626 void Overwrite(int mask)
14431627 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451629 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14471631
14481632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491633 content = ((cGroup)content).get(0);
....@@ -1466,6 +1650,7 @@
14661650 //
14671651 public void actionPerformed(ActionEvent event) // , Object arg)
14681652 {
1653
+ Object source = event.getSource();
14691654 /*
14701655 if (event.getSource() == nameField)
14711656 {
....@@ -1477,11 +1662,11 @@
14771662 }
14781663 else
14791664 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1665
+ if (source == lookAtItem || source == lookFromItem)
14811666 {
14821667 ScreenFit();
14831668 } else
1484
- if (event.getSource() == switchItem)
1669
+ if (source == switchItem)
14851670 {
14861671 cVector v1 = new cVector();
14871672 cVector v2 = new cVector();
....@@ -1490,11 +1675,11 @@
14901675 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911676 objEditor.cameraView.repaint();
14921677 } else
1493
- if (event.getSource() == rectoidItem)
1678
+ if (source == rectoidItem)
14941679 {
14951680 makeSomething(new Box());
14961681 } else
1497
- if (event.getSource() == particleItem)
1682
+ if (source == particleItem)
14981683 {
14991684 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001685 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1700,9 @@
15151700 applyExample(particleGeom, "SMOKE");
15161701 makeSomething(particleGeom);
15171702 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1703
+ if (source == ragdollItem || source == ragdoll2Item)
15191704 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1705
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211706
15221707 ragdoll.toParent = LA.newMatrix();
15231708 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1720,7 @@
15351720 } else
15361721 /*
15371722 */
1538
- if (event.getSource() == heightFieldItem)
1723
+ if (source == heightFieldItem)
15391724 {
15401725 Object3D obj = new Object3D();
15411726
....@@ -1573,27 +1758,31 @@
15731758
15741759 makeSomething(obj);
15751760 } else
1576
- if (event.getSource() == gridItem)
1761
+ if (source == gridItem)
15771762 {
15781763 makeSomething(new Grid());
15791764 } else
1580
- if (event.getSource() == ellipsoidItem)
1765
+ if (source == ellipsoidItem)
15811766 {
15821767 makeSomething(new Sphere());
15831768 } else
1584
- if (event.getSource() == coneItem)
1769
+ if (source == coneItem)
15851770 {
15861771 makeSomething(new Cone());
15871772 } else
1588
- if (event.getSource() == torusItem)
1773
+ if (source == torusItem)
15891774 {
15901775 makeSomething(new Torus());
15911776 } else
1592
- if (event.getSource() == superItem)
1777
+ if (source == superItem)
15931778 {
15941779 makeSomething(new Superellipsoid());
15951780 } else
1596
- if (event.getSource() == blobItem)
1781
+ if (source == kleinItem)
1782
+ {
1783
+ makeSomething(new Klein());
1784
+ } else
1785
+ if (source == blobItem)
15971786 {
15981787 Blob blob = new Blob();
15991788 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1790,15 @@
16011790 //blob.retile();
16021791 makeSomething(blob);
16031792 } else
1604
- if (event.getSource() == latheItem)
1793
+ if (source == latheItem)
16051794 {
16061795 makeSomething(new Lathe());
16071796 } else
1608
- if (event.getSource() == bezierItem)
1797
+ if (source == bezierItem)
16091798 {
16101799 makeSomething(new BezierSurface());
16111800 } else
1612
- if (event.getSource() == checkerItem)
1801
+ if (source == overlayItem)
16131802 {
16141803 /*
16151804 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1813,7 @@
16241813 */
16251814 makeSomething(new Checker());
16261815 } else
1627
- if (event.getSource() == meshItem)
1816
+ if (source == meshItem)
16281817 {
16291818 Object3D itemtomake = new Object3D();
16301819 Object3D child;
....@@ -1645,35 +1834,35 @@
16451834 makeSomething(child);
16461835 }
16471836 } else
1648
- if (event.getSource() == springItem)
1837
+ if (source == springItem)
16491838 {
16501839 cSpring s = new cSpring();
16511840 s.setup();
16521841 makeSomething(s);
16531842 } else
1654
- if (event.getSource() == flagItem)
1843
+ if (source == flagItem)
16551844 {
16561845 cSpring s = new cFlag();
16571846 s.setup();
16581847 makeSomething(s);
16591848 } else
1660
- if (event.getSource() == lightItem)
1849
+ if (source == lightItem)
16611850 {
16621851 makeSomething(new Light());
16631852 } else
1664
- if (event.getSource() == csgItem)
1853
+ if (source == csgItem)
16651854 {
16661855 group(new CSG());
16671856 } else
1668
- if (event.getSource() == templateItem)
1857
+ if (source == templateItem)
16691858 {
16701859 group(new cTemplate());
16711860 } else
1672
- if (event.getSource() == attributeItem)
1861
+ if (source == attributeItem)
16731862 {
16741863 makeSomething(new Attribute());
16751864 } else
1676
- if (event.getSource() == pointflowItem)
1865
+ if (source == pointflowItem)
16771866 {
16781867 makeSomething(new PointFlow());
16791868 } else
....@@ -1685,7 +1874,7 @@
16851874 } else
16861875 */
16871876
1688
- if (event.getSource() == superLoopItem)
1877
+ if (source == superLoopItem)
16891878 {
16901879 Composite g = new cGroup();
16911880 for (int i=0; i<15; i++)
....@@ -1707,7 +1896,7 @@
17071896
17081897 group(g);
17091898 } else
1710
- if (event.getSource() == loopItem)
1899
+ if (source == loopItem)
17111900 {
17121901 Composite csg = new GroupLeaf();
17131902 csg.count = 5;
....@@ -1716,7 +1905,7 @@
17161905 csg.addChild(child);
17171906 child.addChild(csg);
17181907 } else
1719
- if (event.getSource() == doubleItem)
1908
+ if (source == doubleItem)
17201909 {
17211910 Composite csg = new GroupLeaf();
17221911 csg.count = 5;
....@@ -1728,7 +1917,7 @@
17281917 csg.addChild(child);
17291918 child.addChild(csg);
17301919 } else
1731
- if (event.getSource() == tripleItem)
1920
+ if (source == tripleItem)
17321921 {
17331922 Composite csg = new GroupLeaf();
17341923 csg.count = 4;
....@@ -1743,71 +1932,71 @@
17431932 csg.addChild(child);
17441933 child.addChild(csg);
17451934 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1935
+ if (source == computeAOItem)
17481936 {
1749
- ImportGFD();
1937
+ Globals.drawMode = CameraPane.OCCLUSION;
1938
+ Globals.theRenderer.repaint();
17501939 } 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)
1940
+ if (source == recompileItem)
17691941 {
17701942 Recompile();
17711943 refreshContents();
17721944 } else
1773
- if (event.getSource() == editScriptItem)
1945
+ if (source == editScriptItem)
17741946 {
17751947 OpenDialog();
17761948 refreshContents();
17771949 } else
1778
- if (event.getSource() == invariantsItem)
1950
+ if (source == invariantsItem)
17791951 {
17801952 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
17821954 } else
1783
- if (event.getSource() == memoryItem)
1955
+ if (source == memoryItem)
17841956 {
17851957 //System.out.println("Invariants:");
17861958 PrintMemory();
17871959 } else
1788
- if (event.getSource() == pathItem)
1960
+ if (source == pathItem)
17891961 {
17901962 PrintPath();
17911963 } else
1792
- if (event.getSource() == analyzeItem)
1964
+ if (source == analyzeItem)
17931965 {
17941966 AnalyzeObject();
17951967 } else
1796
- if (event.getSource() == dumpItem)
1968
+ if (source == dumpItem)
17971969 {
17981970 DumpObject();
17991971 } else
1800
- if (event.getSource() == screenfitButton)
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
1984
+ if (source == oneStepButton)
1985
+ {
1986
+ Globals.ONESTEP = true;
1987
+ cameraView.repaint();
1988
+ } else
1989
+ if (source == screenfitButton)
18011990 {
18021991 //Reload(lastConverter, lastFilename, true);
18031992 ScreenFit();
18041993 } else
1805
- if (event.getSource() == screenfitpointButton)
1994
+ if (source == screenfitpointButton)
18061995 {
18071996 //Reload(lastConverter, lastFilename, true);
18081997 ScreenFitPoint();
18091998 } else
1810
- if (event.getSource() == snapobjectButton)
1999
+ if (source == snapobjectButton)
18112000 {
18122001 //Reload(lastConverter, lastFilename, true);
18132002 SnapObject();
....@@ -1818,13 +2007,13 @@
18182007 // Recompile();
18192008 // refreshContents();
18202009 // } else
1821
- if (event.getSource() == gcButton)
2010
+ if (source == gcButton)
18222011 {
18232012 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242013 System.gc();
18252014 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262015 } else
1827
- if (event.getSource() == editLeafItem)
2016
+ if (source == editLeafItem)
18282017 {
18292018 Object3D obj;
18302019 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2027,78 @@
18382027 }
18392028 refreshContents(true);
18402029 } else
1841
- if (event.getSource() == openWindowItem)
2030
+ if (source == openWindowItem)
18422031 {
18432032 EditSelection(true);
18442033 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2034
+ if (source == cutItem || source == clearButton)
18462035 {
18472036 loadClipboard(true);
18482037 } else
1849
- if (event.getSource() == duplicateItem)
2038
+ if (source == undoItem)
18502039 {
1851
- Object3D keep = GraphreeD.clipboard;
2040
+ Undo();
2041
+ } else
2042
+ if (source == redoItem)
2043
+ {
2044
+ Redo();
2045
+ } else
2046
+ if (source == duplicateItem)
2047
+ {
2048
+ Object3D keep = Grafreed.clipboard;
18522049 loadClipboard(false);
18532050 paste(false);
1854
- GraphreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
18552052 } else
1856
- if (event.getSource() == cloneItem)
2053
+ if (source == cloneItem)
18572054 {
18582055 CloneSelection(false);
18592056 } else
1860
- if (event.getSource() == cloneSupportItem)
2057
+ if (source == cloneSupportItem)
18612058 {
18622059 CloneSelection(true);
18632060 } else
1864
- if (event.getSource() == copyItem)
2061
+ if (source == copyItem)
18652062 {
18662063 loadClipboard(false);
18672064 } else
1868
- if (event.getSource() == pasteItem)
2065
+ if (source == pasteItem)
18692066 {
18702067 paste(false);
18712068 } else
1872
- if (event.getSource() == pasteLinkItem)
2069
+ if (source == pasteIntoItem)
18732070 {
1874
- pasteInto(false);
2071
+ pasteInto(true, false);
18752072 } else
1876
- if (event.getSource() == pasteCloneItem)
2073
+ if (source == pasteLinkItem)
18772074 {
1878
- pasteInto(true);
2075
+ pasteInto(false, false);
18792076 } else
1880
- if (event.getSource() == pasteExpandItem)
2077
+ if (source == pasteCloneItem)
2078
+ {
2079
+ pasteInto(true, true);
2080
+ } else
2081
+ if (source == pasteExpandItem)
18812082 {
18822083 paste(true);
18832084 } else
1884
- if (event.getSource() == synchronizeItem)
2085
+ if (source == synchronizeItem)
18852086 {
18862087 Overwrite(Object3D.TRANSFORM);
18872088 } else
1888
- if (event.getSource() == overwriteNameItem)
2089
+ if (source == overwriteNameItem)
18892090 {
18902091 Overwrite(Object3D.NAME);
18912092 } else
1892
- if (event.getSource() == overwriteUVItem)
2093
+ if (source == overwriteUVItem)
18932094 {
18942095 Overwrite(Object3D.UV);
18952096 } else
1896
- if (event.getSource() == overwriteMatItem)
2097
+ if (source == overwriteMatItem)
18972098 {
2099
+ /* july 2015
18982100 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2101
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002102 else
19012103 {
19022104 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2110,16 @@
19082110 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092111 }
19102112 }
2113
+ */
2114
+
2115
+ Overwrite(dropAttributes);
19112116 }
1912
- if (event.getSource() == overwriteGeoItem)
2117
+ if (source == overwriteGeoItem)
19132118 {
19142119 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2120
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162121 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2122
+// Object3D content = GrafreeD.clipboard.get(0);
19182123 //
19192124 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202125 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2131,7 @@
19262131 // refreshContents();
19272132 // }
19282133 } else
1929
- if (event.getSource() == generateMeshItem)
2134
+ if (source == generateMeshItem)
19302135 {
19312136 //if (group.selection.size() == 1)
19322137 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2142,7 @@
19372142 ResetModel();
19382143 refreshContents();
19392144 } else
1940
- if (event.getSource() == extractGeometriesItem)
2145
+ if (source == extractGeometriesItem)
19412146 {
19422147 boolean one = false;
19432148
....@@ -1964,7 +2169,7 @@
19642169 ResetModel();
19652170 refreshContents();
19662171 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2172
+ if (source == cloneGeometriesItem)
19682173 {
19692174 boolean one = false;
19702175
....@@ -1990,32 +2195,37 @@
19902195 ResetModel();
19912196 refreshContents();
19922197 } else
1993
- if (event.getSource() == shareGeometriesItem)
2198
+ if (source == shareGeometriesItem)
19942199 {
19952200 boolean one = false;
19962201
19972202 if (group.selection.size() == 1)
19982203 one = true;
19992204
2205
+ Object3D merge = null;
2206
+
20002207 Object3D content = new cGroup();
20012208
20022209 for (int i=0; i<group.selection.size(); i++)
20032210 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2211
+ merge = new Merge(group.selection.get(i));
20052212
20062213 if (one)
2007
- makeSomething(sel, false);
2214
+ makeSomething(merge, false);
20082215 else
2009
- content.addChild(sel);
2216
+ content.addChild(merge);
20102217 }
20112218
20122219 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2220
+ makeSomething(content, true);
2221
+ else
2222
+ {
2223
+ ResetModel();
2224
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2225
+ refreshContents();
2226
+ }
20172227 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2228
+ if (source == mergeGeometriesItem)
20192229 {
20202230 boolean one = false;
20212231
....@@ -2045,11 +2255,11 @@
20452255 ResetModel();
20462256 refreshContents();
20472257 } else
2048
- if (event.getSource() == linkverticesItem)
2258
+ if (source == linkverticesItem)
20492259 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2260
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512261 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2262
+// Object3D content = GrafreeD.clipboard.get(0);
20532263 //
20542264 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552265 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2268,48 @@
20582268 // group.selection.get(0).setMasterThis(content); // should be identity
20592269 // refreshContents();
20602270 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622272 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
20642274
20652275 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662276 content = ((cGroup)content).get(0);
20672277
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2278
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692279 for (int i=0; i<group.selection.size(); i++)
20702280 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
20732283 group.selection.get(i).linkVerticesThis(content);
20742284 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
20762286 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2287
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782288 refreshContents();
20792289 }
20802290 } else
2081
- if (event.getSource() == resetsupportItem)
2291
+ if (source == resetsupportItem)
20822292 {
20832293 for (int i=0; i<group.selection.size(); i++)
20842294 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
20872297 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
20892299 }
20902300
20912301 refreshContents();
20922302 } else
2093
- if (event.getSource() == resetreferencesItem)
2303
+ if (source == relinkverticesItem)
2304
+ {
2305
+ boolean random = CameraPane.SWITCH;
2306
+ CameraPane.SWITCH = false; // parse all random nodes
2307
+ group.selection.RelinkToSupport();
2308
+ CameraPane.SWITCH = random;
2309
+
2310
+ refreshContents();
2311
+ } else
2312
+ if (source == resetreferencesItem)
20942313 {
20952314 for (int i=0; i<group.selection.size(); i++)
20962315 {
....@@ -2099,11 +2318,11 @@
20992318
21002319 refreshContents();
21012320 } else
2102
- if (event.getSource() == setMasterItem)
2321
+ if (source == setMasterItem)
21032322 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052324 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
21072326
21082327 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092328 content = ((cGroup)content).get(0);
....@@ -2112,13 +2331,13 @@
21122331 refreshContents();
21132332 }
21142333 } else
2115
- if (event.getSource() == poseMeshItem)
2334
+ if (source == poseMeshItem)
21162335 {
21172336 if (group.selection.size() == 1)
21182337 {
2119
- if (GraphreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
21202339 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21222341
21232342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242343 content = ((cGroup)content).get(0);
....@@ -2131,19 +2350,19 @@
21312350 }
21322351
21332352 } else
2134
- if (event.getSource() == revertMeshItem)
2353
+ if (source == revertMeshItem)
21352354 {
21362355 RevertMeshes();
21372356 } else
2138
- if (event.getSource() == resetMeshItem)
2357
+ if (source == resetAllItem)
21392358 {
21402359 ResetAll();
21412360 } else
2142
- if (event.getSource() == stepAllItem)
2361
+ if (source == stepAllItem)
21432362 {
21442363 StepAll();
21452364 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2365
+ if (source == clearItem) // || event.getSource() == clearButton)
21472366 {
21482367 //int indices[] = jList.getSelectedIndices();
21492368 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2370,46 @@
21512370
21522371 ClearSelection(false);
21532372 } else
2154
- if (event.getSource() == clearAllItem)
2373
+ if (source == clearAllItem)
21552374 {
21562375 ClearSelection(true);
21572376 } else
2158
- if (event.getSource() == grabItem)
2377
+ if (source == grabItem)
21592378 {
21602379 group(new cGroup(), true);
21612380 } else
2162
- if (event.getSource() == frontItem)
2381
+ if (source == hideItem)
2382
+ {
2383
+ group(new HiddenObject());
2384
+ } else
2385
+ if (source == frontItem)
21632386 {
21642387 front();
21652388 } else
2166
- if (event.getSource() == backItem)
2389
+ if (source == backItem)
21672390 {
21682391 back();
21692392 } else
2170
- if (event.getSource() == cameraItem)
2393
+ if (source == cameraItem)
21712394 {
21722395 makeSomething(new Camera());
21732396 } else
2174
- if (event.getSource() == compositeItem)
2397
+ if (source == compositeItem)
21752398 {
21762399 group(new Composite());
21772400 } else
2178
- if (event.getSource() == randomItem)
2401
+ if (source == randomItem)
21792402 {
21802403 RandomNode random = new RandomNode();
21812404 group(random);
21822405 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
21842407 } else
2185
- if (event.getSource() == physicsItem)
2408
+ if (source == physicsItem)
21862409 {
21872410 group(new PhysicsNode());
21882411 } else
2189
- if (event.getSource() == frameselectorItem)
2412
+ if (source == frameselectorItem)
21902413 {
21912414 for (int i=0; i<group.selection.size(); i++)
21922415 {
....@@ -2198,7 +2421,7 @@
21982421 ResetModel();
21992422 refreshContents();
22002423 } else
2201
- if (event.getSource() == switchGeoItem)
2424
+ if (source == switchGeoItem)
22022425 {
22032426 for (int i=0; i<group.selection.size(); i++)
22042427 {
....@@ -2210,7 +2433,7 @@
22102433 ResetModel();
22112434 refreshContents();
22122435 } else
2213
- if (event.getSource() == switchTransfoItem)
2436
+ if (source == switchTransfoItem)
22142437 {
22152438 for (int i=0; i<group.selection.size(); i++)
22162439 {
....@@ -2222,7 +2445,7 @@
22222445 ResetModel();
22232446 refreshContents();
22242447 } else
2225
- if (event.getSource() == morphItem)
2448
+ if (source == morphItem)
22262449 {
22272450 for (int i=0; i<group.selection.size(); i++)
22282451 {
....@@ -2234,7 +2457,7 @@
22342457 ResetModel();
22352458 refreshContents();
22362459 } else
2237
- if (event.getSource() == scriptNodeItem)
2460
+ if (source == scriptNodeItem)
22382461 {
22392462 boolean atleastone = false;
22402463
....@@ -2273,195 +2496,223 @@
22732496 }
22742497 }
22752498 } else
2276
- if (event.getSource() == linkerItem)
2499
+ if (source == linkerItem)
22772500 {
22782501 group(new cLinker());
22792502 } else
2280
- if (event.getSource() == textureItem)
2503
+ if (source == textureItem)
22812504 {
22822505 group(new TextureNode());
22832506 } else
2284
- if (event.getSource() == shadowXItem)
2507
+ if (source == billboardItem)
2508
+ {
2509
+ group(new BillboardNode());
2510
+ } else
2511
+ if (source == shadowXItem)
22852512 {
22862513 CastShadow(0);
22872514 } else
2288
- if (event.getSource() == shadowYItem)
2515
+ if (source == shadowYItem)
22892516 {
22902517 CastShadow(1);
22912518 } else
2292
- if (event.getSource() == shadowZItem)
2519
+ if (source == shadowZItem)
22932520 {
22942521 CastShadow(2);
22952522 } else
2296
- if (event.getSource() == ungroupItem)
2523
+ if (source == ungroupItem)
22972524 {
2298
- ungroup();
2525
+ //ungroup();
2526
+ for (int i=0; i<group.selection.size(); i++)
2527
+ {
2528
+ Ungroup(group.selection.get(i));
2529
+ }
2530
+
2531
+ ClearSelection(false);
2532
+
2533
+ refreshContents();
22992534 } else
2300
- if (event.getSource() == genUVItem)
2535
+ if (source == genUVItem)
23012536 {
23022537 GenUV();
23032538 } else
2304
- if (event.getSource() == genNormalsCADItem)
2539
+ if (source == genNormalsCADItem)
23052540 {
23062541 GenNormals(true);
23072542 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2543
+ if (source == genNormalsMESHItem)
2544
+ {
2545
+ GenNormals(true); // TODO
2546
+ } else
2547
+ if (source == genNormalsORGANItem)
23092548 {
23102549 GenNormals(false);
23112550 } else
2312
- if (event.getSource() == stripifyItem)
2551
+ if (source == genNormalsMINEItem)
2552
+ {
2553
+ GenNormalsMINE();
2554
+ } else
2555
+ if (source == stripifyItem)
23132556 {
23142557 Stripify();
23152558 } else
2316
- if (event.getSource() == unstripifyItem)
2559
+ if (source == unstripifyItem)
23172560 {
23182561 Unstripify();
23192562 } else
2320
- if (event.getSource() == trimItem)
2563
+ if (source == trimItem)
23212564 {
23222565 Trim();
23232566 } else
2324
- if (event.getSource() == untrimItem)
2567
+ if (source == untrimItem)
23252568 {
23262569 Untrim();
23272570 } else
2328
- if (event.getSource() == clearColorsItem)
2571
+ if (source == clearColorsItem)
23292572 {
23302573 ClearColors();
23312574 } else
2332
- if (event.getSource() == clearMaterialsItem)
2575
+ if (source == clearMaterialsItem)
23332576 {
23342577 ClearMaterials();
23352578 } else
2336
- if (event.getSource() == liveleavesItem)
2579
+ if (source == liveleavesItem)
23372580 {
23382581 LiveLeaves(true);
23392582 } else
2340
- if (event.getSource() == unliveleavesItem)
2583
+ if (source == unliveleavesItem)
23412584 {
23422585 LiveLeaves(false);
23432586 } else
2344
- if (event.getSource() == supportleavesItem)
2587
+ if (source == supportleavesItem)
23452588 {
23462589 SupportLeaves(true);
23472590 } else
2348
- if (event.getSource() == unsupportleavesItem)
2591
+ if (source == unsupportleavesItem)
23492592 {
23502593 SupportLeaves(false);
23512594 } else
2352
- if (event.getSource() == hideleavesItem)
2595
+ if (source == hideleavesItem)
23532596 {
23542597 HideLeaves(true);
23552598 } else
2356
- if (event.getSource() == showleavesItem)
2599
+ if (source == showleavesItem)
23572600 {
23582601 HideLeaves(false);
23592602 } else
2360
- if (event.getSource() == markleavesItem)
2603
+ if (source == markleavesItem)
23612604 {
23622605 MarkLeaves(true);
23632606 } else
2364
- if (event.getSource() == unmarkleavesItem)
2607
+ if (source == unmarkleavesItem)
23652608 {
23662609 MarkLeaves(false);
23672610 } else
2368
- if (event.getSource() == flipVItem)
2611
+ if (source == flipVItem)
23692612 {
23702613 FlipV(true);
23712614 } else
2372
- if (event.getSource() == unflipVItem)
2615
+ if (source == unflipVItem)
23732616 {
23742617 FlipV(false);
23752618 } else
2376
- if (event.getSource() == lowTexturesItem)
2619
+ if (source == lowTexturesItem)
23772620 {
23782621 SetTexRes(0);
23792622 } else
2380
- if (event.getSource() == normalTexturesItem)
2623
+ if (source == normalTexturesItem)
23812624 {
23822625 SetTexRes(1);
23832626 } else
2384
- if (event.getSource() == highTexturesItem)
2627
+ if (source == highTexturesItem)
23852628 {
23862629 SetTexRes(2);
23872630 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2631
+ if (source == veryhighTexturesItem)
23892632 {
23902633 SetTexRes(3);
23912634 } else
2392
- if (event.getSource() == maxTexturesItem)
2635
+ if (source == maxTexturesItem)
23932636 {
23942637 SetTexRes(4);
23952638 } else
2396
- if (event.getSource() == panoTexturesItem)
2639
+ if (source == panoTexturesItem)
23972640 {
23982641 SetTexRes(5);
23992642 } else
2400
- if (event.getSource() == reverseNormalsItem)
2643
+ if (source == reverseNormalsItem)
24012644 {
24022645 ReverseNormals();
24032646 } else
2404
- if (event.getSource() == parseverticesItem)
2647
+ if (source == parseverticesItem)
24052648 {
24062649 ParseVertices();
24072650 } else
2408
- if (event.getSource() == textureFieldItem)
2651
+ if (source == textureFieldItem)
24092652 {
24102653 TextureVertices();
24112654 } else
2412
- if (event.getSource() == alignItem)
2655
+ if (source == alignItem)
24132656 {
24142657 Align();
24152658 } else
2416
- if (event.getSource() == mirrorItem)
2659
+ if (source == mirrorItem)
24172660 {
24182661 MirrorPoses();
24192662 } else
2420
- if (event.getSource() == reduceMorphItem)
2663
+ if (source == reduceMorphItem)
24212664 {
24222665 MeshReduction(false);
24232666 } else
2424
- if (event.getSource() == reduce34MorphItem)
2667
+ if (source == reduce34MorphItem)
24252668 {
24262669 MeshReduction(true);
24272670 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2671
+ if (source == reverseTrianglesItem)
24292672 {
24302673 ReverseTriangles();
24312674 } else
2432
- if (event.getSource() == reduceMeshItem)
2675
+ if (source == reduceMeshItem)
24332676 {
24342677 ReduceMesh(false);
24352678 } else
2436
- if (event.getSource() == reduce34MeshItem)
2679
+ if (source == reduce34MeshItem)
24372680 {
24382681 ReduceMesh(true);
24392682 } else
2440
- if (event.getSource() == increaseMeshItem)
2683
+ if (source == increaseMeshItem)
24412684 {
24422685 IncreaseMesh();
24432686 } else
2444
- if (event.getSource() == clipMeshItem)
2687
+ if (source == clipMeshItem)
24452688 {
24462689 ClipMesh();
24472690 } else
2448
- if (event.getSource() == smoothMeshItem)
2691
+ if (source == smoothMeshItem)
24492692 {
24502693 SmoothMesh();
24512694 } else
2452
- if (event.getSource() == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
24532696 {
24542697 TransformGeometry();
24552698 } else
2456
- if (event.getSource() == resetTransformItem)
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
2702
+ } else
2703
+ if (source == resetTransformItem)
24572704 {
24582705 ResetTransform();
24592706 } else
2460
- if (event.getSource() == resetCentroidItem)
2707
+ if (source == resetCentroidItem)
24612708 {
2462
- ResetCentroid();
2709
+ ResetCentroid(true);
24632710 } else
2464
- if (event.getSource() == resetParentItem)
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
2714
+ } else
2715
+ if (source == resetParentItem)
24652716 {
24662717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672718 {
....@@ -2471,7 +2722,7 @@
24712722
24722723 refreshContents();
24732724 } else
2474
- if (event.getSource() == repairParentItem)
2725
+ if (source == repairParentItem)
24752726 {
24762727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772728 {
....@@ -2485,7 +2736,21 @@
24852736
24862737 refreshContents();
24872738 } else
2488
- if (event.getSource() == sortbysizeItem)
2739
+ if (source == repairShadowItem)
2740
+ {
2741
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2742
+ {
2743
+ Object3D obj = (Object3D)e.nextElement();
2744
+ obj.RepairShadow();
2745
+// for (int i=0; i<obj.size(); i++)
2746
+// {
2747
+// obj.get(i).parent = obj;
2748
+// }
2749
+ }
2750
+
2751
+ refreshContents();
2752
+ } else
2753
+ if (source == sortbysizeItem)
24892754 {
24902755 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912756 {
....@@ -2497,7 +2762,7 @@
24972762 ResetModel();
24982763 refreshContents();
24992764 } else
2500
- if (event.getSource() == sortbynameItem)
2765
+ if (source == sortbynameItem)
25012766 {
25022767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032768 {
....@@ -2509,7 +2774,7 @@
25092774 ResetModel();
25102775 refreshContents();
25112776 } else
2512
- if (event.getSource() == attachPigmentItem)
2777
+ if (source == attachPigmentItem)
25132778 {
25142779 String texture = GetFile("Attach pigment");
25152780 Object3D obj;
....@@ -2521,7 +2786,7 @@
25212786
25222787 refreshContents();
25232788 } else
2524
- if (event.getSource() == detachPigmentItem)
2789
+ if (source == detachPigmentItem)
25252790 {
25262791 Object3D obj;
25272792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2797,7 @@
25322797
25332798 refreshContents();
25342799 } else
2535
- if (event.getSource() == attachBumpItem)
2800
+ if (source == attachBumpItem)
25362801 {
25372802 String texture = GetFile("Attach bump");
25382803 Object3D obj;
....@@ -2544,7 +2809,7 @@
25442809
25452810 refreshContents();
25462811 } else
2547
- if (event.getSource() == detachBumpItem)
2812
+ if (source == detachBumpItem)
25482813 {
25492814 Object3D obj;
25502815 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2820,7 @@
25552820
25562821 refreshContents();
25572822 } else
2558
- if (event.getSource() == pigmentBumpItem)
2823
+ if (source == pigmentBumpItem)
25592824 {
25602825 Object3D obj;
25612826 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2831,195 @@
25662831
25672832 refreshContents();
25682833 } else
2569
- if (event.getSource() == flashSelectionButton)
2834
+ if (source == flashSelectionButton)
25702835 {
25712836 CameraPane.flash = true;
25722837 refreshContents();
25732838 } else
2574
- if (event.getSource() == oneButton)
2839
+ if (source == oneButton)
25752840 {
25762841 } else
2577
- if (event.getSource() == twoButton)
2842
+ if (source == twoButton)
25782843 {
25792844 radio.layout = twoButton;
25802845 // bug
25812846 //gridPanel.setDividerLocation(1.0);
25822847 //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();
2848
+// bigThree.remove(scenePanel);
2849
+// bigThree.remove(centralPanel);
2850
+// bigThree.remove(XYZPanel);
2851
+// aWindowConstraints.gridx = 0;
2852
+// aWindowConstraints.gridy = 0;
2853
+// aWindowConstraints.gridwidth = 1;
2854
+// // aConstraints.gridheight = 3;
2855
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2856
+// aWindowConstraints.weightx = 0;
2857
+// aWindowConstraints.weighty = 1;
2858
+// //bigThree.add(jtp, aWindowConstraints);
2859
+// aWindowConstraints.weightx = 1;
2860
+// aWindowConstraints.gridwidth = 3;
2861
+// // aConstraints.gridheight = 3;
2862
+// aWindowConstraints.gridx = 1;
2863
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2864
+// bigThree.add(centralPanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.gridx = 4;
2867
+// aWindowConstraints.gridwidth = 1;
2868
+// // aConstraints.gridheight = 3;
2869
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2870
+// //bigThree.add(XYZPanel, aWindowConstraints);
2871
+// scenePanel.setVisible(false);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(centralPanel);
2876
+ bigThree.FlushUI();
26072877 } else
2608
- if (event.getSource() == threeButton)
2878
+ if (source == threeButton)
26092879 {
26102880 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();
2881
+
2882
+// bigThree.remove(scenePanel);
2883
+// bigThree.remove(centralPanel);
2884
+// bigThree.remove(XYZPanel);
2885
+// aWindowConstraints.gridx = 0;
2886
+// aWindowConstraints.gridy = 0;
2887
+// aWindowConstraints.gridwidth = 1;
2888
+// // aConstraints.gridheight = 3;
2889
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.weighty = 1;
2892
+// //bigThree.add(jtp, aWindowConstraints);
2893
+// aWindowConstraints.weightx = 1;
2894
+// aWindowConstraints.gridwidth = 3;
2895
+// // aConstraints.gridheight = 3;
2896
+// aWindowConstraints.gridx = 1;
2897
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2898
+// bigThree.add(centralPanel, aWindowConstraints);
2899
+// aWindowConstraints.weightx = 0;
2900
+// aWindowConstraints.gridx = 4;
2901
+// aWindowConstraints.gridwidth = 1;
2902
+// // aConstraints.gridheight = 3;
2903
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2904
+// bigThree.add(XYZPanel, aWindowConstraints);
2905
+// bigThree.validate();
2906
+// scenePanel.setVisible(false);
2907
+// centralPanel.setVisible(true);
2908
+// XYZPanel.setVisible(true);
2909
+ bigThree.ClearUI();
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.add(XYZPanel);
2912
+ bigThree.FlushUI();
26352913 } else
2636
- if (event.getSource() == fourButton)
2914
+ if (source == fourButton)
26372915 {
26382916 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();
2917
+
2918
+// bigThree.remove(scenePanel);
2919
+// bigThree.remove(centralPanel);
2920
+// bigThree.remove(XYZPanel);
2921
+// aWindowConstraints.gridx = 0;
2922
+// aWindowConstraints.gridy = 0;
2923
+// aWindowConstraints.gridwidth = 1;
2924
+// // aWindowConstraints.gridheight = 3;
2925
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.weighty = 1;
2928
+// bigThree.add(scenePanel, aWindowConstraints);
2929
+// aWindowConstraints.weightx = 1;
2930
+// aWindowConstraints.gridwidth = 3;
2931
+// // aConstraints.gridheight = 3;
2932
+// aWindowConstraints.gridx = 1;
2933
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2934
+// //bigThree.add(cameraPanel, aWindowConstraints);
2935
+// aWindowConstraints.weightx = 0;
2936
+// aWindowConstraints.gridx = 4;
2937
+// aWindowConstraints.gridwidth = 1;
2938
+// // aWindowConstraints.gridheight = 3;
2939
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2940
+// //bigThree.add(XYZPanel, aWindowConstraints);
2941
+// bigThree.validate();
2942
+// scenePanel.setVisible(true);
2943
+// centralPanel.setVisible(false);
2944
+// XYZPanel.setVisible(false);
2945
+ bigThree.ClearUI();
2946
+ bigThree.add(scenePanel);
2947
+ bigThree.FlushUI();
26632948 } else
2664
- if (event.getSource() == sixButton)
2949
+ if (source == sixButton)
26652950 {
26662951 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();
2952
+
2953
+// bigThree.remove(scenePanel);
2954
+// bigThree.remove(centralPanel);
2955
+// bigThree.remove(XYZPanel);
2956
+// aWindowConstraints.gridx = 0;
2957
+// aWindowConstraints.gridy = 0;
2958
+// aWindowConstraints.gridwidth = 1;
2959
+// // aConstraints.gridheight = 3;
2960
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2961
+// aWindowConstraints.weightx = 0;
2962
+// aWindowConstraints.weighty = 1;
2963
+// bigThree.add(scenePanel, aWindowConstraints);
2964
+// aWindowConstraints.weightx = 1;
2965
+// aWindowConstraints.gridwidth = 3;
2966
+// // aWindowConstraints.gridheight = 3;
2967
+// aWindowConstraints.gridx = 1;
2968
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2969
+// bigThree.add(centralPanel, aWindowConstraints);
2970
+// aWindowConstraints.weightx = 0;
2971
+// aWindowConstraints.gridx = 4;
2972
+// aWindowConstraints.gridwidth = 1;
2973
+// // aWindowConstraints.gridheight = 3;
2974
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2975
+// //bigThree.add(XYZPanel, aConstraints);
2976
+// bigThree.validate();
2977
+// scenePanel.setVisible(true);
2978
+// centralPanel.setVisible(true);
2979
+// XYZPanel.setVisible(false);
2980
+ bigThree.ClearUI();
2981
+ bigThree.add(scenePanel);
2982
+ bigThree.add(centralPanel);
2983
+ bigThree.FlushUI();
26912984 } else
2692
- if (event.getSource() == sevenButton)
2985
+ if (source == sevenButton)
26932986 {
26942987 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();
2988
+
2989
+// bigThree.remove(scenePanel);
2990
+// bigThree.remove(centralPanel);
2991
+// bigThree.remove(XYZPanel);
2992
+// aWindowConstraints.gridx = 0;
2993
+// aWindowConstraints.gridy = 0;
2994
+// aWindowConstraints.gridwidth = 1;
2995
+// // aWindowConstraints.gridheight = 3;
2996
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2997
+// aWindowConstraints.weightx = 0;
2998
+// aWindowConstraints.weighty = 1;
2999
+// bigThree.add(scenePanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 1;
3001
+// aWindowConstraints.gridwidth = 3;
3002
+// // aWindowConstraints.gridheight = 3;
3003
+// aWindowConstraints.gridx = 1;
3004
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3005
+// bigThree.add(centralPanel, aWindowConstraints);
3006
+// aWindowConstraints.weightx = 0;
3007
+// aWindowConstraints.gridx = 4;
3008
+// aWindowConstraints.gridwidth = 1;
3009
+// // aConstraints.gridheight = 3;
3010
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3011
+// bigThree.add(XYZPanel, aWindowConstraints);
3012
+// bigThree.validate();
3013
+// scenePanel.setVisible(true);
3014
+// centralPanel.setVisible(true);
3015
+// XYZPanel.setVisible(true);
3016
+ bigThree.ClearUI();
3017
+ bigThree.add(scenePanel);
3018
+ bigThree.add(centralPanel);
3019
+ bigThree.add(XYZPanel);
3020
+ bigThree.FlushUI();
27193021 } else
2720
- if (event.getSource() == rootButton)
3022
+ if (source == rootButton)
27213023 {
27223024 Object3D obj;
27233025 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +3031,7 @@
27293031
27303032 refreshContents(true);
27313033 } else
2732
- if (event.getSource() == closeButton)
3034
+ if (source == closeButton)
27333035 {
27343036 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353037 cRadio ab;
....@@ -2750,11 +3052,11 @@
27503052 }
27513053 refreshContents(true);
27523054 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3055
+ if (source == editItem || source == editButton)
27543056 {
27553057 EditSelection(false);
27563058 } else
2757
- if (event.getSource() == uneditButton)
3059
+ if (source == uneditButton)
27583060 {
27593061 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603062 {
....@@ -2764,14 +3066,14 @@
27643066 child.CloseUI();
27653067 listUI.remove(child);
27663068
2767
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
27683070 }
2769
- objEditor.ctrlPanel.revalidate();
3071
+ objEditor.ctrlPanel.FlushUI();
27703072 //objEditor.jTree.clearSelection();
27713073 //objEditor.ResetSliders();
27723074 refreshContents(true);
27733075 } else
2774
- if (event.getSource() == clearPanelButton)
3076
+ if (source == clearPanelButton)
27753077 {
27763078 assert(copy == group);
27773079 //copy.ClearUI();
....@@ -2782,7 +3084,7 @@
27823084 listUI.clear();
27833085 refreshContents(true);
27843086 } else
2785
- if (event.getSource() == allParamsButton)
3087
+ if (source == allParamsButton)
27863088 {
27873089 assert(copy == group);
27883090
....@@ -2803,19 +3105,19 @@
28033105
28043106 refreshContents(true);
28053107 } else
2806
- if (event.getSource() == unselectButton)
3108
+ if (source == unselectButton)
28073109 {
28083110 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3111
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103112 objEditor.ResetSliders();
28113113 refreshContents(true);
28123114 } else
2813
- if(event.getSource() instanceof cRadio)
3115
+ if(source instanceof cRadio)
28143116 {
28153117 group.parent = keepparent;
28163118 group.attributes = 0;
28173119 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3120
+ /*cRadio*/ radio = (cRadio)source;
28193121 Object3D obj = radio.GetObject();
28203122 System.out.println("Edit " + obj);
28213123 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3137,7 @@
28353137 }
28363138
28373139 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3140
+ //Globals.theRenderer.object = group;
28393141 if(!useclient)
28403142 {
28413143 cameraView.renderCamera = radio.camera;
....@@ -2844,12 +3146,16 @@
28443146 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453147 cameraView.targetLookAt.set(radio.camera.lookAt);
28463148 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3149
+ //cameraView.lighttouched = true;
3150
+ Globals.lighttouched = true;
28483151 topView.object = group;
28493152 frontView.object = group;
28503153 sideView.object = group;
28513154 }
3155
+
3156
+// fix "+" issue
28523157 group.editWindow = this;
3158
+
28533159 /*
28543160 currentLayout = radio.layout;
28553161 if (currentLayout == null)
....@@ -2862,7 +3168,20 @@
28623168 //group.attributes = -1;
28633169 ResetModel();
28643170 refreshContents(true);
2865
- }
3171
+ } else if (event.getSource() == editCameraItem)
3172
+ {
3173
+ cameraView.ProtectCamera();
3174
+ cameraView.repaint();
3175
+ return;
3176
+ } else if (event.getSource() == revertCameraItem)
3177
+ {
3178
+ cameraView.RevertCamera();
3179
+ cameraView.repaint();
3180
+ return;
3181
+ // } else if (event.getSource() == textureButton)
3182
+ // {
3183
+ // return; // true;
3184
+ }
28663185 else
28673186 {
28683187 //return super.action(event, arg);
....@@ -2880,7 +3199,7 @@
28803199 if (useclient)
28813200 {
28823201 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3202
+ Globals.lighttouched = true;
28843203 //topView.object = client;
28853204 //frontView.object = client;
28863205 //sideView.object = client;
....@@ -2888,7 +3207,7 @@
28883207 else
28893208 {
28903209 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3210
+ Globals.lighttouched = true;
28923211 //topView.object = group;
28933212 //frontView.object = group;
28943213 //sideView.object = group;
....@@ -2923,6 +3242,28 @@
29233242 refreshContents();
29243243 }
29253244
3245
+ void TransformChildren()
3246
+ {
3247
+ Object3D obj;
3248
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3249
+ {
3250
+ obj = (Object3D)e.nextElement();
3251
+ obj.KeepTextureMatrices();
3252
+ obj.TransformChildren();
3253
+ obj.RestoreTextureMatrices();
3254
+
3255
+// if (obj.parent == null)
3256
+// {
3257
+// System.out.println("NULL PARENT!");
3258
+// new Exception().printStackTrace();
3259
+// }
3260
+// else
3261
+// TouchTransform(obj);
3262
+// //obj.parent.Touch();
3263
+ }
3264
+
3265
+ refreshContents();
3266
+ }
29263267
29273268 void ResetTransform()
29283269 {
....@@ -3035,7 +3376,7 @@
30353376 refreshContents();
30363377 }
30373378
3038
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
30393380 {
30403381 Object3D obj;
30413382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3391,16 @@
30503391 LA.matIdentity(Object3D.mat);
30513392 obj.getBounds(minima, maxima, false);
30523393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553397 obj.TransformMesh(Object3D.mat);
3398
+
30563399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
30593404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3429,8 @@
30843429
30853430 int size = obj.MemorySize();
30863431
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3432
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883434 }
30893435 }
30903436 catch (Exception e)
....@@ -3121,9 +3467,9 @@
31213467 obj = (Object3D)e.nextElement();
31223468
31233469 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3470
+ Grafreed.AnalyzeObject(obj);
31253471 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3472
+ Grafreed.AnalyzeObject(obj.bRep);
31273473
31283474 // System.err.println((size/1024) + " KB is the size of " + obj);
31293475 }
....@@ -3165,6 +3511,13 @@
31653511 void GenNormals(boolean crease)
31663512 {
31673513 group.GenNormalsS(crease);
3514
+
3515
+ refreshContents();
3516
+ }
3517
+
3518
+ void GenNormalsMINE()
3519
+ {
3520
+ group.selection.GenNormalsMINE();
31683521
31693522 refreshContents();
31703523 }
....@@ -3250,7 +3603,7 @@
32503603 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513604 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523605 //
3253
-// g.add(GraphreeD.clipboard);
3606
+// g.add(GrafreeD.clipboard);
32543607 //
32553608 // buffer.add(g);
32563609 // }
....@@ -3269,8 +3622,8 @@
32693622 // nodes = new Object3D();
32703623 // vertices = new Vector<Vertex>();
32713624 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3625
+// boolean epsequal = GrafreeD.epsequal;
3626
+// GrafreeD.epsequal = true;
32743627 //
32753628 // for (int i=0; i<group.selection.size(); i++)
32763629 // {
....@@ -3311,7 +3664,7 @@
33113664 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123665 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133666 //
3314
-// g.add(GraphreeD.clipboard);
3667
+// g.add(GrafreeD.clipboard);
33153668 //
33163669 // buffer.add(g);
33173670 // }
....@@ -3319,7 +3672,7 @@
33193672 // makeSomething(buffer, i==group.selection.size()-1);
33203673 // }
33213674 //
3322
-// GraphreeD.epsequal = epsequal;
3675
+// GrafreeD.epsequal = epsequal;
33233676 //
33243677 // //buffer = null;
33253678 // temprep = null;
....@@ -3330,8 +3683,8 @@
33303683
33313684 void ParseVertices()
33323685 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3686
+ boolean epsequal = Grafreed.epsequal;
3687
+ Grafreed.epsequal = true;
33353688
33363689 for (int i=0; i<group.selection.size(); i++)
33373690 {
....@@ -3356,7 +3709,7 @@
33563709 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573710 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583711
3359
- g.add(GraphreeD.clipboard);
3712
+ g.add(Grafreed.clipboard);
33603713
33613714 buffer.add(g);
33623715 }
....@@ -3371,7 +3724,7 @@
33713724 makeSomething(buffer, i==group.selection.size()-1);
33723725 }
33733726
3374
- GraphreeD.epsequal = epsequal;
3727
+ Grafreed.epsequal = epsequal;
33753728
33763729 refreshContents();
33773730 }
....@@ -3389,7 +3742,16 @@
33893742 String pigment = Object3D.GetPigment(tex);
33903743 //String bump = Object3D.GetBump(tex);
33913744
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3745
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3746
+
3747
+ try
3748
+ {
3749
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3750
+ }
3751
+ catch (Exception e)
3752
+ {
3753
+ System.err.println("FAIL: " + node);
3754
+ }
33933755
33943756 double s = v.s;
33953757
....@@ -3416,7 +3778,7 @@
34163778 scale /= 3;
34173779
34183780 scale /= 0xFF;
3419
- scale /= 4;
3781
+ // c'est quoi ca? scale /= 4;
34203782
34213783 //v.AO = scale;
34223784
....@@ -3437,12 +3799,26 @@
34373799
34383800 void Align()
34393801 {
3802
+ if (group.selection.size() == 0)
3803
+ return;
3804
+
3805
+ cVector bbmin = new cVector();
3806
+ cVector bbmax = new cVector();
3807
+
3808
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3809
+
3810
+ double dx = bbmax.x - bbmin.x;
3811
+ double dy = bbmax.y - bbmin.y;
3812
+ double dz = bbmax.z - bbmin.z;
3813
+
3814
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3815
+
34403816 for (int i=0; i<group.selection.size(); i++)
34413817 {
34423818 Object3D obj = group.selection.get(i);
34433819
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3820
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3821
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463822 }
34473823
34483824 refreshContents();
....@@ -3455,7 +3831,7 @@
34553831 // ref.SaveSupports();
34563832 // Object3D par = ref.parent;
34573833 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3834
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593835 // ref.parent = par;
34603836 // ref.RestoreSupports();
34613837
....@@ -3463,11 +3839,11 @@
34633839
34643840 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34653841
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
3842
+ boolean random = CameraPane.SWITCH;
3843
+ CameraPane.SWITCH = false; // parse all random nodes
34683844 lowres.linkVerticesThis(null);
34693845 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
3846
+ CameraPane.SWITCH = random;
34713847
34723848 System.err.flush();
34733849
....@@ -3485,7 +3861,7 @@
34853861 // lowres.SaveSupports();
34863862 // par = lowres.parent;
34873863 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3864
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893865 Object3D newlow = CloneObject(lowres, false);
34903866 newlow.name = sn.switchobject.get(i).name;
34913867 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3883,7 @@
35073883 return;
35083884
35093885 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3886
+ Object3D ref = Grafreed.clipboard.get(0);
35113887
35123888 Object3D newgroup = new Object3D("Po:" + poses.name);
35133889
....@@ -3676,7 +4052,7 @@
36764052 group.selection.RelinkToSupport(); // july 2014
36774053 System.out.println("DONE.");
36784054 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4055
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804056 }
36814057
36824058 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4077,20 @@
37014077
37024078 void ClipMesh()
37034079 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4080
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054081 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4082
+ Object3D content = Grafreed.clipboard.get(0);
37074083
37084084 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094085 content = ((cGroup)content).get(0);
37104086
37114087 // for (int i=0; i<group.selection.size(); i++)
37124088 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4089
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144090 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4091
+ group.selection.ClipMesh(Grafreed.clipboard);
37164092 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4093
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184094 System.out.println("DONE.");
37194095 refreshContents();
37204096 }
....@@ -3847,7 +4223,7 @@
38474223 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484224
38494225 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4226
+ if(elem != group || !newWindow)
38514227 {
38524228 // if (!(elem instanceof Composite))
38534229 // newWindow = false;
....@@ -3952,25 +4328,28 @@
39524328 System.err.println("info : " + child.GetPath());
39534329 }
39544330 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4331
+// else
4332
+// {
4333
+// objEditor.SetMaterial(group); // .GetMaterial());
4334
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4335
+// System.err.println("info : " + group.GetPath());
4336
+// }
39614337
39624338 objEditor.SetText(); // jan 2014
39634339
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4340
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654341 CameraPane.flash = true;
39664342
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4343
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684344 // a camera
39694345 {
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;
4346
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4347
+ {
4348
+ CameraPane.camerachangeframe = 0; // don't refuse it
4349
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4350
+ }
4351
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4352
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744353 }
39754354
39764355 refreshContents();
....@@ -4052,16 +4431,18 @@
40524431 {
40534432 if (group.selection.isEmpty())
40544433 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4434
+
4435
+ Grafreed.clipboardIsTempGroup = false;
40564436 Composite tGroup = null;
40574437 if (group.selection.size() > 0) // 1)
40584438 {
40594439 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4440
+ Grafreed.clipboardIsTempGroup = true;
40614441 }
40624442
40634443 if (cut)
40644444 {
4445
+ Save();
40654446 //int indices[] = jList.getSelectedIndices();
40664447 //for (int i = indices.length - 1; i >= 0; i--)
40674448 //jList.remove(indices[i]);
....@@ -4097,16 +4478,16 @@
40974478 //System.out.println("cut " + child);
40984479 //System.out.println("parent = " + child.parent);
40994480 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4481
+ if (Grafreed.clipboardIsTempGroup)
41014482 tGroup.add/*Child*/(tmp);
41024483 else
4103
- GraphreeD.clipboard = tmp;
4484
+ Grafreed.clipboard = tmp;
41044485 }
41054486 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4487
+ if (Grafreed.clipboardIsTempGroup)
41074488 tGroup.add/*Child*/(child);
41084489 else
4109
- GraphreeD.clipboard = child;
4490
+ Grafreed.clipboard = child;
41104491 }
41114492
41124493 //ResetModel();
....@@ -4138,21 +4519,23 @@
41384519 //System.out.println("cut " + elem);
41394520 //System.out.println("parent = " + elem.parent);
41404521 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4522
+ if (Grafreed.clipboardIsTempGroup)
41424523 tGroup.add/*Child*/(tmp);
41434524 else
4144
- GraphreeD.clipboard = tmp;
4525
+ Grafreed.clipboard = tmp;
41454526 }
41464527 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4528
+ if (Grafreed.clipboardIsTempGroup)
41484529 tGroup.add/*Child*/(child);
41494530 else
4150
- GraphreeD.clipboard = child;
4531
+ Grafreed.clipboard = child;
41514532 }
41524533
41534534 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4535
+
4536
+ if (Grafreed.clipboardIsTempGroup)
4537
+ Grafreed.clipboard = tGroup;
4538
+
41564539 if (cut)
41574540 {
41584541 ResetModel();
....@@ -4162,11 +4545,11 @@
41624545
41634546 void paste(boolean expand)
41644547 {
4165
- // if (GraphreeD.clipboard == null)
4548
+ // if (GrafreeD.clipboard == null)
41664549 // return;
41674550 boolean first = true;
41684551
4169
- if (GraphreeD.clipboardIsTempGroup)
4552
+ if (Grafreed.clipboardIsTempGroup)
41704553 {
41714554 Composite temp;
41724555
....@@ -4177,7 +4560,7 @@
41774560 temp = (Composite)Applet3D.clipboard.deepCopy();
41784561 */
41794562 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4563
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814564 {
41824565 Object3D child = (Object3D)e.nextElement();
41834566
....@@ -4191,7 +4574,7 @@
41914574 else
41924575 elem = child.deepCopy(); // ?
41934576 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4577
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954578 // elem = elem.get(0);
41964579 makeSomething(elem, true); // ?? first);
41974580 //group.addChild(elem);
....@@ -4211,23 +4594,23 @@
42114594 //Object3D cb = Applet3D.clipboard;
42124595 //temp.addChild(cb);
42134596 //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());
4597
+ assert(Grafreed.clipboard.parent == null);
4598
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4599
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4600
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4601
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194602 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4603
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4604
+ Grafreed.clipboard.get(0).parent = keepparent;
42224605 }
42234606
42244607 ResetModel();
42254608 refreshContents();
42264609 }
42274610
4228
- void pasteInto(boolean copyit)
4611
+ void pasteInto(boolean copyit, boolean clone)
42294612 {
4230
-// if (GraphreeD.clipboard == null)
4613
+// if (GrafreeD.clipboard == null)
42314614 // return;
42324615
42334616 if (group.selection.size() != 1)
....@@ -4254,15 +4637,22 @@
42544637 if (copyit)
42554638 {
42564639 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4640
+ if (clone)
4641
+ {
4642
+ CloneClipboard(false); // sept 2014
4643
+ }
4644
+ else
4645
+ {
4646
+ paste(false);
4647
+ }
42584648 }
42594649 else
42604650 {
42614651 boolean first = true;
42624652
4263
- if (GraphreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42644654 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4655
+ Composite temp = (Composite)Grafreed.clipboard;
42664656 Object3D copy;
42674657 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684658 {
....@@ -4272,7 +4662,7 @@
42724662 }
42734663 } else
42744664 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4665
+ linkSomething(Grafreed.clipboard); //.get(0));
42764666 }
42774667 }
42784668 }
....@@ -4464,6 +4854,26 @@
44644854 makeSomething(csg);
44654855 }
44664856
4857
+ void Ungroup(Object3D g)
4858
+ {
4859
+ if (g instanceof HiddenObject)
4860
+ {
4861
+ HiddenObject h = (HiddenObject) g;
4862
+
4863
+ for (int i=0; i<h.ActualSize(); i++)
4864
+ {
4865
+ objEditor.makeSomething(h.get(i), false);
4866
+ }
4867
+ }
4868
+ else
4869
+ {
4870
+ for (int i=0; i<g.Size(); i++)
4871
+ {
4872
+ objEditor.makeSomething(g.get(i), false);
4873
+ }
4874
+ }
4875
+ }
4876
+
44674877 void ungroup()
44684878 {
44694879 /*
....@@ -4657,21 +5067,6 @@
46575067 }
46585068 */
46595069
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
-
46755070 /*
46765071 public void Callback(Object obj)
46775072 {
....@@ -4695,26 +5090,9 @@
46955090 }
46965091 */
46975092
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
-
47155093 String GetFile(String dialogName)
47165094 {
4717
- if (GraphreeD.standAlone)
5095
+ if (Grafreed.standAlone)
47185096 {
47195097 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205098 browser.show();
....@@ -4778,10 +5156,15 @@
47785156 cButton flashSelectionButton;
47795157 cButton editButton;
47805158 cButton uneditButton;
5159
+ JCheckBox allParamsButton;
47815160 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835161 cButton unselectButton;
47845162
5163
+ cButton saveButton;
5164
+ cButton undoButton;
5165
+ cButton redoButton;
5166
+ cButton oneStepButton;
5167
+
47855168 cButton screenfitButton;
47865169 cButton screenfitpointButton;
47875170 cButton snapobjectButton;
....@@ -4812,6 +5195,8 @@
48125195 private MenuItem lookFromItem;
48135196 private MenuItem switchItem;
48145197 private MenuItem cutItem;
5198
+ private MenuItem undoItem;
5199
+ private MenuItem redoItem;
48155200 private MenuItem duplicateItem;
48165201 private MenuItem cloneItem;
48175202 private MenuItem cloneSupportItem;
....@@ -4823,8 +5208,9 @@
48235208 private MenuItem resetsupportItem;
48245209 private MenuItem resetreferencesItem;
48255210 private MenuItem linkverticesItem;
5211
+ private MenuItem relinkverticesItem;
48265212 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5213
+ private MenuItem resetAllItem;
48285214 private MenuItem stepAllItem;
48295215 private MenuItem revertMeshItem;
48305216 private MenuItem poseMeshItem;
....@@ -4835,14 +5221,17 @@
48355221 private MenuItem mergeGeometriesItem;
48365222 private MenuItem copyItem;
48375223 private MenuItem pasteItem;
5224
+ private MenuItem pasteIntoItem;
48385225 private MenuItem pasteLinkItem;
48395226 private MenuItem pasteCloneItem;
48405227 private MenuItem pasteExpandItem;
48415228 private MenuItem clearItem;
48425229 private MenuItem clearAllItem;
48435230 private MenuItem genUVItem;
5231
+ private MenuItem genNormalsMESHItem;
48445232 private MenuItem genNormalsCADItem;
48455233 private MenuItem genNormalsORGANItem;
5234
+ private MenuItem genNormalsMINEItem;
48465235 private MenuItem stripifyItem;
48475236 private MenuItem unstripifyItem;
48485237 private MenuItem trimItem;
....@@ -4882,8 +5271,11 @@
48825271 private MenuItem panoTexturesItem;
48835272
48845273 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5274
+ private MenuItem resetCentroidXZItem;
48865275 private MenuItem resetTransformItem;
5276
+ private MenuItem transformGeometryItem;
5277
+ private MenuItem transformChildrenItem;
5278
+ private MenuItem hideItem;
48875279 private MenuItem grabItem;
48885280 private MenuItem backItem;
48895281 private MenuItem frontItem;
....@@ -4904,6 +5296,7 @@
49045296
49055297 private MenuItem resetParentItem;
49065298 private MenuItem repairParentItem;
5299
+ private MenuItem repairShadowItem;
49075300 private MenuItem sortbysizeItem;
49085301 private MenuItem sortbynameItem;
49095302
....@@ -4924,10 +5317,11 @@
49245317 private MenuItem coneItem;
49255318 private MenuItem torusItem;
49265319 private MenuItem superItem;
5320
+ private MenuItem kleinItem;
49275321 private MenuItem blobItem;
49285322 private MenuItem latheItem;
49295323 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5324
+ private MenuItem overlayItem;
49315325 private MenuItem meshItem;
49325326 // private MenuItem meshGroupItem;
49335327 private MenuItem springItem;
....@@ -4936,6 +5330,7 @@
49365330 private MenuItem csgItem;
49375331 private MenuItem templateItem;
49385332 private MenuItem textureItem;
5333
+ private MenuItem billboardItem;
49395334 private MenuItem shadowXItem;
49405335 private MenuItem shadowYItem;
49415336 private MenuItem shadowZItem;
....@@ -4948,11 +5343,6 @@
49485343 private MenuItem doubleItem;
49495344 private MenuItem tripleItem;
49505345
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565346 private MenuItem computeAOItem;
49575347 private MenuItem recompileItem;
49585348 private MenuItem editScriptItem;
....@@ -4962,4 +5352,8 @@
49625352 private MenuItem analyzeItem;
49635353 private MenuItem dumpItem;
49645354 //boolean freezemodel = false;
5355
+
5356
+ Menu cameraMenu;
5357
+ MenuItem editCameraItem;
5358
+ MenuItem revertCameraItem;
49655359 }