Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
GroupEditor.java
....@@ -12,9 +12,10 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
17
-class GroupEditor extends ObjEditor implements iParse, //iCallBack,
18
+class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
1819 ObjectUI,
1920 Runnable,
2021 ActionListener,
....@@ -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,44 +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
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
193
- resetMeshItem.addActionListener(this);
194
- stepAllItem = menu.add(new MenuItem("Step All"));
195
- stepAllItem.addActionListener(this);
286
+ }
287
+
288
+ oe.menuBar.add(menu = new Menu("Setting"));
289
+ if (Globals.ADVANCED)
290
+ {
196291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197292 revertMeshItem.addActionListener(this);
198293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199294 resetreferencesItem.addActionListener(this);
200295 menu.add("-");
296
+ }
201297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202298 overwriteGeoItem.addActionListener(this);
203299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,47 +305,68 @@
209305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210306 overwriteUVItem.addActionListener(this);
211307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
212310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213311 generateMeshItem.addActionListener(this);
214312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215313 poseMeshItem.addActionListener(this);
216314 menu.add("-");
315
+ }
217316 resetsupportItem = menu.add(new MenuItem("Reset support"));
218317 resetsupportItem.addActionListener(this);
219318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
221325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222326 setMasterItem.addActionListener(this);
327
+ }
223328
224
- oe.menuBar.add(menu = new Menu("Object"));
329
+ oe.menuBar.add(menu = new Menu("Group"));
225330 grabItem = menu.add(new MenuItem("Grab"));
226331 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229332 backItem = menu.add(new MenuItem("Back"));
230333 backItem.addActionListener(this);
334
+ frontItem = menu.add(new MenuItem("Front"));
335
+ frontItem.addActionListener(this);
231336 compositeItem = menu.add(new MenuItem("Composite"));
232337 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);
233342 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
235344 randomItem.addActionListener(this);
236
- physicsItem = menu.add(new MenuItem("Physics"));
237
- physicsItem.addActionListener(this);
238
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
239
- frameselectorItem.addActionListener(this);
240345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241346 switchGeoItem.addActionListener(this);
242347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243348 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
245350 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);
246359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247360 scriptNodeItem.addActionListener(this);
248361 cameraItem = menu.add(new MenuItem("Camera"));
249362 cameraItem.addActionListener(this);
250
- menu.add("-");
363
+ }
364
+
365
+ oe.menuBar.add(menu = new Menu("Object"));
251366 textureItem = menu.add(new MenuItem("Texture"));
252367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
253370 csgItem = menu.add(new MenuItem("CSG"));
254371 csgItem.addActionListener(this);
255372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -258,23 +375,29 @@
258375 shadowYItem.addActionListener(this);
259376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
260377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
261381 linkerItem = menu.add(new MenuItem("Linker"));
262382 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265383 attributeItem = menu.add(new MenuItem("Attribute"));
266384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
267387 pointflowItem = menu.add(new MenuItem("Point Flow"));
268388 pointflowItem.addActionListener(this);
389
+ }
269390 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273392 resetTransformItem.addActionListener(this);
274393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275394 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- 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);
278401
279402 oe.menuBar.add(menu = new Menu("Geometry"));
280403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +406,13 @@
283406 genNormalsORGANItem.addActionListener(this);
284407 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285408 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
+ }
286416 stripifyItem = menu.add(new MenuItem("Stripify"));
287417 stripifyItem.addActionListener(this);
288418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +422,6 @@
292422 untrimItem = menu.add(new MenuItem("Untrim"));
293423 untrimItem.addActionListener(this);
294424 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297425 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298426 clearColorsItem.addActionListener(this);
299427 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +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
+ }
445
+
446
+ oe.menuBar.add(menu = new Menu("Attributes"));
447
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
448
+ 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);
313453 menu.add("-");
314454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315455 liveleavesItem.addActionListener(this);
316456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
318460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319461 supportleavesItem.addActionListener(this);
320462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321463 unsupportleavesItem.addActionListener(this);
464
+ }
322465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323466 hideleavesItem.addActionListener(this);
324467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +470,31 @@
327470 markleavesItem.addActionListener(this);
328471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
330481 menu.add("-");
331482 flipVItem = menu.add(new MenuItem("Flip V"));
332483 flipVItem.addActionListener(this);
333484 unflipVItem = menu.add(new MenuItem("Unflip V"));
334485 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
486
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336487 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
488
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338489 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
490
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340491 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
492
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342493 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
494
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344495 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
496
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346497 panoTexturesItem.addActionListener(this);
347
- menu.add("-");
348
- extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
349
- extractGeometriesItem.addActionListener(this);
350
- cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
351
- cloneGeometriesItem.addActionListener(this);
352
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
353
- shareGeometriesItem.addActionListener(this);
354
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
355
- mergeGeometriesItem.addActionListener(this);
356498
357499 oe.menuBar.add(menu = new Menu("Selection"));
358500 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +512,24 @@
370512 sortbysizeItem.addActionListener(this);
371513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372514 sortbynameItem.addActionListener(this);
515
+ menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
520
+ if (Globals.ADVANCED)
521
+ {
522
+ // Pretty much the same as duplicate and clone.
523
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
524
+ extractGeometriesItem.addActionListener(this);
525
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
526
+ cloneGeometriesItem.addActionListener(this);
527
+ }
528
+
373529 oe.menuBar.add(menu = new Menu("Insert"));
374530 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
531
+
532
+ oe.menuBar.add(menu = new Menu("Tools"));
376533 buildToolsMenu(menu);
377534 }
378535
....@@ -406,150 +563,110 @@
406563 oe.radioPanel.add(dummyButton);
407564 oe.buttonGroup.add(dummyButton);
408565 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
566
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412567
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
568
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ undoButton.setToolTipText("Undo changes");
570
+ undoButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ redoButton.setToolTipText("Redo changes");
574
+ redoButton.addActionListener(this);
575
+
576
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ saveButton.setToolTipText("Save changes");
578
+ saveButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
581
+ liveCB.setToolTipText("Enable animation");
414582 liveCB.addItemListener(this);
415583
416
- oe.aConstraints.gridx += 1;
417
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
418
- supportCB.addItemListener(this);
419
-
420
- // oe.aConstraints.gridx += 1;
421
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
422
- // localCB.addItemListener(this);
423
-
424
- oe.aConstraints.gridx += 1;
425
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
426
- crowdCB.addItemListener(this);
427
-
428
- oe.aConstraints.gridx += 1;
429
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
430
- smoothCB.addItemListener(this);
431
-
432
- oe.aConstraints.gridx += 1;
433
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
584
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ oneStepButton.setToolTipText("Animate one step forward");
586
+ oneStepButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
589
+ fastCB.setToolTipText("Fast mode");
434590 fastCB.addItemListener(this);
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
437
- slowCB.addItemListener(this);
438
- oe.aConstraints.gridx += 1;
439
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
440
- boxCB.addItemListener(this);
441
-
442
-// oe.aConstraints.gridx += 1;
443
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
444
-// speakerMocapCB.addItemListener(this);
445
-
446
- if (false)
447
- {
448
- // handled in scripts
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
451
- speakerCameraCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
455
- speakerFocusCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
459
- smoothfocusCB.addItemListener(this);
460
- }
461
-
462
-//oe.aConstraints.gridx += 1;
463
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
464
-// debugCB.addItemListener(this);
465
-
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
468
- oeilCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
472
- lookAtCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
591
+
592
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
593
+ trackCB.setToolTipText("Enable tracking");
476594 trackCB.addItemListener(this);
477595
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ screenfitButton.setToolTipText("Screen fit");
480598 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
599
+
482600 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483601 // screenfitpointButton.addActionListener(this);
484
-// oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
486
- snapobjectButton.addActionListener(this);
487
- oe.aConstraints.gridx += 1;
488602
489
- //aConstraints.gridx = 0;
490
- //aConstraints.gridy += 1;
491
- oe.aConstraints.weighty = 0;
492
- oe.aConstraints.gridwidth = 1;
493
-
494
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
603
+ if (Globals.ADVANCED)
604
+ {
605
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ snapobjectButton.addActionListener(this);
607
+ snapobjectButton.setToolTipText("Snap Object");
608
+ }
609
+
610
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ flashSelectionButton.setToolTipText("Show selection");
495612 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499613
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
614
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
615
+
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ twoButton.setToolTipText("Show center view only");
502618 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504620 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
621
+ fourButton.setToolTipText("Show left panel only");
622
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623
+ sixButton.setToolTipText("2-column layout left");
506624 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ threeButton.setToolTipText("2-column layout right");
508627 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ sevenButton.setToolTipText("3-column layout");
510630 sevenButton.addActionListener(this);
511631 //
512632
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
633
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ rootButton.setToolTipText("Edit selection in new tab");
514635 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
636
+
637
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ closeButton.setToolTipText("Close tab");
517639 closeButton.addActionListener(this);
518640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519641 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521642
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
643
+ cGridBag commandsPanel = new cGridBag();
644
+
645
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ editButton.setToolTipText("Edit selection");
524647 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528648
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
530651 uneditButton.addActionListener(this);
531652
532
- oe.aConstraints.gridx += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
537
- clearPanelButton.addActionListener(this);
538
-
539
- oe.aConstraints.gridx += 1;
540
- oe.aConstraints.weighty = 0;
541
- oe.aConstraints.gridwidth = 1;
542
-
543
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
653
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654
+ allParamsButton.setToolTipText("Edit all params");
544655 allParamsButton.addActionListener(this);
545656
546
- oe.aConstraints.gridx += 1;
547
- oe.aConstraints.weighty = 0;
548
- oe.aConstraints.gridwidth = 1;
549
-
550
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
657
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ clearPanelButton.setToolTipText("Clear edit panel");
659
+ clearPanelButton.addActionListener(this);
660
+
661
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ unselectButton.setToolTipText("Unselect");
551663 unselectButton.addActionListener(this);
552664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
553670 // oe.aConstraints.gridx += 1;
554671 // oe.aConstraints.weighty = 0;
555672 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +678,37 @@
561678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562679 // gcButton.addActionListener(this);
563680
564
- oe.aConstraints.gridx = 0;
565
- oe.aConstraints.gridy += 1;
566
-
567
- //ctrlPanel.add(objList = new List(5, true));
568
- oe.aConstraints.gridwidth = 100;
569
- // oe.aConstraints.gridheight = 100;
570
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
571
- oe.aConstraints.gridheight = 1;
572
- oe.aConstraints.weighty = 0.5;
573
- oe.aConstraints.gridx = 0;
574
- JScrollPane jSP;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
575684 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
576
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
685
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577686 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
582690
583
- oe.aConstraints.weighty = 0;
584
- oe.aConstraints.gridwidth = 2;
585
-
586
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
691
+ cGridBag copyOptionsPanel = new cGridBag();
692
+
693
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
694
+ colorCB.setToolTipText("Copy color when dropped");
587695 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
696
+
697
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
698
+ materialCB.setToolTipText("Copy material when dropped");
590699 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
700
+
701
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
702
+ textureCB.setToolTipText("Copy texture when dropped");
593703 textureCB.addItemListener(this);
594704
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
597708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
598712 //jList.addListSelectionListener(this);
599713 oe.jTree.addTreeSelectionListener(this);
600714 //jTree.setRootVisible(false);
....@@ -616,18 +730,91 @@
616730 radio.layout = sevenButton;
617731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618732 }
733
+
734
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
735
+ {
736
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
737
+ boxCB.setToolTipText("Display bounding boxes");
738
+ boxCB.addItemListener(this);
739
+
740
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
741
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
742
+ zoomBoxCB.addItemListener(this);
743
+
744
+ if (true) // Globals.ADVANCED)
745
+ {
746
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
747
+ supportCB.setToolTipText("Enable rigging");
748
+ supportCB.addItemListener(this);
749
+
750
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
751
+ // localCB.addItemListener(this);
752
+
753
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
754
+ crowdCB.setToolTipText("Used for crowds");
755
+ crowdCB.addItemListener(this);
756
+
757
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
758
+ smoothCB.setToolTipText("Snapping delay");
759
+ smoothCB.addItemListener(this);
760
+
761
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
762
+ slowCB.setToolTipText("Smooth interpolation");
763
+ slowCB.addItemListener(this);
764
+
765
+// constraints.gridy += 1;
766
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
767
+// speakerMocapCB.addItemListener(this);
768
+
769
+ if (false)
770
+ {
771
+ // handled in scripts
772
+ //constraints.gridy += 1;
773
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
774
+ speakerCameraCB.addItemListener(this);
775
+
776
+ //constraints.gridy += 1;
777
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
778
+ speakerFocusCB.addItemListener(this);
779
+
780
+ //constraints.gridy += 1;
781
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
782
+ smoothfocusCB.addItemListener(this);
783
+ }
784
+
785
+//constraints.gridx += 1;
786
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
787
+// debugCB.addItemListener(this);
788
+
789
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
790
+ oeilCB.addItemListener(this);
791
+
792
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
793
+ lookAtCB.setToolTipText("Look-at target");
794
+ lookAtCB.addItemListener(this);
795
+
796
+ }
797
+
798
+ cGridBag fill = new cGridBag();
799
+
800
+ fill.preferredHeight = 200;
801
+
802
+ panel.add(fill);
803
+
804
+ }
619805
620806 void EditObject(Object3D obj)
621807 {
622
- cRadio dummyButton = new cRadio(obj.name);
623
- dummyButton.SetObject(obj);
624
- dummyButton.layout = sevenButton;
625
- dummyButton.SetCamera(cameraView.renderCamera, false);
626
- dummyButton.addActionListener(this);
627
- radioPanel.add(dummyButton);
628
- buttonGroup.add(dummyButton);
629
- dummyButton.doClick();
808
+ cRadio radioButton = new cRadio(obj.name);
809
+ radioButton.SetObject(obj);
810
+ radioButton.layout = sevenButton;
811
+ radioButton.SetCamera(cameraView.renderCamera, false);
812
+ radioButton.addActionListener(this);
813
+ radioPanel.add(radioButton);
814
+ buttonGroup.add(radioButton);
815
+ radioButton.doClick();
630816 }
817
+
631818 void SetupViews(ObjEditor oe)
632819 {
633820 oe.SetupViews();
....@@ -646,6 +833,7 @@
646833 JCheckBox fastCB;
647834 JCheckBox slowCB;
648835 JCheckBox boxCB;
836
+ JCheckBox zoomBoxCB;
649837 JCheckBox trackCB;
650838 JCheckBox smoothfocusCB;
651839 // JCheckBox speakerMocapCB;
....@@ -688,10 +876,10 @@
688876 dropAttributes |= Object3D.TEXTURE;
689877 else
690878 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
879
+ } else if(e.getSource() == liveCB)
693880 {
694881 cameraView.ToggleLive();
882
+ refreshContents(false);
695883 }
696884 else if(e.getSource() == supportCB)
697885 {
....@@ -726,6 +914,10 @@
726914 Recompile();
727915 cameraView.repaint();
728916 // refreshContents();
917
+ }
918
+ else if(e.getSource() == zoomBoxCB)
919
+ {
920
+ cameraView.ToggleZoomBoxMode();
729921 }
730922 else if(e.getSource() == smoothfocusCB)
731923 {
....@@ -840,7 +1032,9 @@
8401032 // objEditor.DropFile((java.io.File[]) object, true);
8411033 // return;
8421034 // }
843
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441038 {
8451039 // file(s)
8461040 String[] names = string.split("\n");
....@@ -867,7 +1061,7 @@
8671061
8681062 flashIt = false;
8691063 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721066
8731067 if (group.selection.size() == 1)
....@@ -894,11 +1088,11 @@
8941088 {
8951089 loadClipboard(true);
8961090 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
1091
+ pasteInto(false, false);
8981092 } else {
8991093 loadClipboard(false);
9001094 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9021096 }
9031097 }
9041098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1196,8 @@
10021196
10031197 void buildCreateMenu(Menu menu)
10041198 {
1199
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1200
+ //heightFieldItem.addActionListener(this);
10051201 gridItem = menu.add(new MenuItem("Grid"));
10061202 gridItem.addActionListener(this);
10071203 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1210,37 @@
10141210 torusItem.addActionListener(this);
10151211 superItem = menu.add(new MenuItem("Superellipsoid"));
10161212 superItem.addActionListener(this);
1213
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1214
+ kleinItem.addActionListener(this);
10171215 particleItem = menu.add(new MenuItem("Particle system"));
10181216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10191219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201220 ragdollItem.addActionListener(this);
10211221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221222 ragdoll2Item.addActionListener(this);
1223
+ }
10231224 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251226 meshItem.addActionListener(this);
10261227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10281231 springItem = menu.add(new MenuItem("Spring"));
10291232 springItem.addActionListener(this);
10301233 flagItem = menu.add(new MenuItem("Flag"));
10311234 flagItem.addActionListener(this);
1032
- bezierItem = menu.add(new MenuItem("Patch"));
1033
- bezierItem.addActionListener(this);
1034
- checkerItem = menu.add(new MenuItem("Checker"));
1035
- checkerItem.addActionListener(this);
10361235 blobItem = menu.add(new MenuItem("Blob"));
10371236 blobItem.addActionListener(this);
10381237 latheItem = menu.add(new MenuItem("Lathe"));
10391238 latheItem.addActionListener(this);
1239
+ }
1240
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1241
+ bezierItem.addActionListener(this);
1242
+ overlayItem = menu.add(new MenuItem("Overlay"));
1243
+ overlayItem.addActionListener(this);
10401244 lightItem = menu.add(new MenuItem("Light"));
10411245 lightItem.addActionListener(this);
10421246 menu.add("-");
....@@ -1046,46 +1250,44 @@
10461250 loopItem.addActionListener(this);
10471251 doubleItem = menu.add(new MenuItem("Fork"));
10481252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
10491255 tripleItem = menu.add(new MenuItem("Trident"));
10501256 tripleItem.addActionListener(this);
1051
- menu.add("-");
1052
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
1053
- importGFDItem.addActionListener(this);
1054
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
1055
- importVRMLX3DItem.addActionListener(this);
1056
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
1057
- importOBJItem.addActionListener(this);
1058
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
1059
- import3DSItem.addActionListener(this);
1257
+ }
10601258 }
10611259
10621260 void buildToolsMenu(Menu menu)
10631261 {
10641262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651263 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
10671265
10681266 menu.add("-");
10691267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701268 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1269
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1270
+ textureFieldItem.addActionListener(this);
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721272 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761274 reduceMorphItem.addActionListener(this);
10771275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781276 reduce34MorphItem.addActionListener(this);
1079
-
1277
+ menu.add("-");
10801278 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811279 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
10841286 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851287 memoryItem.addActionListener(this);
10861288 menu.add(analyzeItem = new MenuItem("Analyze"));
10871289 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
10891291 dumpItem.addActionListener(this);
10901292 // menu.add(pathItem = new MenuItem("From-to path"));
10911293 // pathItem.addActionListener(this);
....@@ -1094,6 +1296,8 @@
10941296 resetParentItem.addActionListener(this);
10951297 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961298 repairParentItem.addActionListener(this);
1299
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1300
+ repairShadowItem.addActionListener(this);
10971301 menu.add(invariantsItem = new MenuItem("Invariants"));
10981302 invariantsItem.addActionListener(this);
10991303 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1305,7 @@
11011305 menu.add("-");
11021306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031307 editScriptItem.addActionListener(this);
1308
+ }
11041309 }
11051310
11061311 void ScreenFit()
....@@ -1429,9 +1634,9 @@
14291634
14301635 void Overwrite(int mask)
14311636 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331638 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14351640
14361641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371642 content = ((cGroup)content).get(0);
....@@ -1454,6 +1659,7 @@
14541659 //
14551660 public void actionPerformed(ActionEvent event) // , Object arg)
14561661 {
1662
+ Object source = event.getSource();
14571663 /*
14581664 if (event.getSource() == nameField)
14591665 {
....@@ -1465,11 +1671,11 @@
14651671 }
14661672 else
14671673 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
14691675 {
14701676 ScreenFit();
14711677 } else
1472
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
14731679 {
14741680 cVector v1 = new cVector();
14751681 cVector v2 = new cVector();
....@@ -1478,11 +1684,11 @@
14781684 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791685 objEditor.cameraView.repaint();
14801686 } else
1481
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
14821688 {
14831689 makeSomething(new Box());
14841690 } else
1485
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
14861692 {
14871693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1709,9 @@
15031709 applyExample(particleGeom, "SMOKE");
15041710 makeSomething(particleGeom);
15051711 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15071713 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091715
15101716 ragdoll.toParent = LA.newMatrix();
15111717 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1727,71 @@
15211727 makeSomething(ragdoll);
15221728 //makeSomething(new VehicleDemo());
15231729 } else
1524
- if (event.getSource() == gridItem)
1730
+ /*
1731
+ */
1732
+ if (source == heightFieldItem)
1733
+ {
1734
+ Object3D obj = new Object3D();
1735
+
1736
+ obj.CreateMaterial();
1737
+ obj.bRep = new BoundaryRep();
1738
+
1739
+ obj.bRep.CreateMesh(new iHeightField()
1740
+ {
1741
+ public double f(double x, double y)
1742
+ {
1743
+ // The Mandelbrot set is represented by coloring
1744
+ // each point (x,y) according to the number of
1745
+ // iterations it takes before the while loop in
1746
+ // this method ends. For points that are actually
1747
+ // in the Mandelbrot set, or very close to it, the
1748
+ // count will reach the maximum value, 80. These
1749
+ // points will be colored purple. All other colors
1750
+ // represent points that are definitely NOT in the set.
1751
+ x -= 600;
1752
+ y -= 500;
1753
+ x /= 200;
1754
+ y /= 200;
1755
+ int count = 0;
1756
+ double zx = x;
1757
+ double zy = y;
1758
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1759
+ double new_zx = zx*zx - zy*zy + x;
1760
+ zy = 2*zx*zy + y;
1761
+ zx = new_zx;
1762
+ count++;
1763
+ }
1764
+ return count; // Math.sqrt(count);
1765
+ }
1766
+ }, 1000,1000);
1767
+
1768
+ makeSomething(obj);
1769
+ } else
1770
+ if (source == gridItem)
15251771 {
15261772 makeSomething(new Grid());
15271773 } else
1528
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
15291775 {
15301776 makeSomething(new Sphere());
15311777 } else
1532
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
15331779 {
15341780 makeSomething(new Cone());
15351781 } else
1536
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
15371783 {
15381784 makeSomething(new Torus());
15391785 } else
1540
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
15411787 {
15421788 makeSomething(new Superellipsoid());
15431789 } else
1544
- if (event.getSource() == blobItem)
1790
+ if (source == kleinItem)
1791
+ {
1792
+ makeSomething(new Klein());
1793
+ } else
1794
+ if (source == blobItem)
15451795 {
15461796 Blob blob = new Blob();
15471797 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1799,15 @@
15491799 //blob.retile();
15501800 makeSomething(blob);
15511801 } else
1552
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
15531803 {
15541804 makeSomething(new Lathe());
15551805 } else
1556
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
15571807 {
15581808 makeSomething(new BezierSurface());
15591809 } else
1560
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
15611811 {
15621812 /*
15631813 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1820,9 @@
15701820 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711821 LA.matInvert(obj.toParent, obj.fromParent);
15721822 */
1573
- makeSomething(new CheckerIG());
1823
+ makeSomething(new Checker());
15741824 } else
1575
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
15761826 {
15771827 Object3D itemtomake = new Object3D();
15781828 Object3D child;
....@@ -1593,35 +1843,35 @@
15931843 makeSomething(child);
15941844 }
15951845 } else
1596
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
15971847 {
15981848 cSpring s = new cSpring();
15991849 s.setup();
16001850 makeSomething(s);
16011851 } else
1602
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
16031853 {
16041854 cSpring s = new cFlag();
16051855 s.setup();
16061856 makeSomething(s);
16071857 } else
1608
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
16091859 {
16101860 makeSomething(new Light());
16111861 } else
1612
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
16131863 {
16141864 group(new CSG());
16151865 } else
1616
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
16171867 {
16181868 group(new cTemplate());
16191869 } else
1620
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
16211871 {
16221872 makeSomething(new Attribute());
16231873 } else
1624
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
16251875 {
16261876 makeSomething(new PointFlow());
16271877 } else
....@@ -1633,7 +1883,7 @@
16331883 } else
16341884 */
16351885
1636
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
16371887 {
16381888 Composite g = new cGroup();
16391889 for (int i=0; i<15; i++)
....@@ -1655,7 +1905,7 @@
16551905
16561906 group(g);
16571907 } else
1658
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
16591909 {
16601910 Composite csg = new GroupLeaf();
16611911 csg.count = 5;
....@@ -1664,7 +1914,7 @@
16641914 csg.addChild(child);
16651915 child.addChild(csg);
16661916 } else
1667
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
16681918 {
16691919 Composite csg = new GroupLeaf();
16701920 csg.count = 5;
....@@ -1676,7 +1926,7 @@
16761926 csg.addChild(child);
16771927 child.addChild(csg);
16781928 } else
1679
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
16801930 {
16811931 Composite csg = new GroupLeaf();
16821932 csg.count = 4;
....@@ -1691,71 +1941,71 @@
16911941 csg.addChild(child);
16921942 child.addChild(csg);
16931943 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
1944
+ if (source == computeAOItem)
16961945 {
1697
- ImportGFD();
1946
+ Globals.drawMode = CameraPane.OCCLUSION;
1947
+ Globals.theRenderer.repaint();
16981948 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1700
- {
1701
- ImportVRMLX3D();
1702
- } else
1703
- if (event.getSource() == import3DSItem)
1704
- {
1705
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1706
- } else
1707
- if (event.getSource() == importOBJItem)
1708
- {
1709
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1710
- } else
1711
- if (event.getSource() == computeAOItem)
1712
- {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1715
- } else
1716
- if (event.getSource() == recompileItem)
1949
+ if (source == recompileItem)
17171950 {
17181951 Recompile();
17191952 refreshContents();
17201953 } else
1721
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
17221955 {
17231956 OpenDialog();
17241957 refreshContents();
17251958 } else
1726
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
17271960 {
17281961 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
17301963 } else
1731
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
17321965 {
17331966 //System.out.println("Invariants:");
17341967 PrintMemory();
17351968 } else
1736
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
17371970 {
17381971 PrintPath();
17391972 } else
1740
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
17411974 {
17421975 AnalyzeObject();
17431976 } else
1744
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
17451978 {
17461979 DumpObject();
17471980 } else
1748
- if (event.getSource() == screenfitButton)
1981
+ if (source == undoButton)
1982
+ {
1983
+ Undo();
1984
+ } else
1985
+ if (source == redoButton)
1986
+ {
1987
+ Redo();
1988
+ } else
1989
+ if (source == saveButton)
1990
+ {
1991
+ Save();
1992
+ } else
1993
+ if (source == oneStepButton)
1994
+ {
1995
+ Globals.ONESTEP = true;
1996
+ cameraView.repaint();
1997
+ } else
1998
+ if (source == screenfitButton)
17491999 {
17502000 //Reload(lastConverter, lastFilename, true);
17512001 ScreenFit();
17522002 } else
1753
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
17542004 {
17552005 //Reload(lastConverter, lastFilename, true);
17562006 ScreenFitPoint();
17572007 } else
1758
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
17592009 {
17602010 //Reload(lastConverter, lastFilename, true);
17612011 SnapObject();
....@@ -1766,13 +2016,13 @@
17662016 // Recompile();
17672017 // refreshContents();
17682018 // } else
1769
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
17702020 {
17712021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722022 System.gc();
17732023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742024 } else
1775
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
17762026 {
17772027 Object3D obj;
17782028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2036,78 @@
17862036 }
17872037 refreshContents(true);
17882038 } else
1789
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
17902040 {
17912041 EditSelection(true);
17922042 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
17942044 {
17952045 loadClipboard(true);
17962046 } else
1797
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
17982048 {
1799
- Object3D keep = GraphreeD.clipboard;
2049
+ Undo();
2050
+ } else
2051
+ if (source == redoItem)
2052
+ {
2053
+ Redo();
2054
+ } else
2055
+ if (source == duplicateItem)
2056
+ {
2057
+ Object3D keep = Grafreed.clipboard;
18002058 loadClipboard(false);
18012059 paste(false);
1802
- GraphreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
18032061 } else
1804
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
18052063 {
18062064 CloneSelection(false);
18072065 } else
1808
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
18092067 {
18102068 CloneSelection(true);
18112069 } else
1812
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
18132071 {
18142072 loadClipboard(false);
18152073 } else
1816
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
18172075 {
18182076 paste(false);
18192077 } else
1820
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
18212079 {
1822
- pasteInto(false);
2080
+ pasteInto(true, false);
18232081 } else
1824
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
18252083 {
1826
- pasteInto(true);
2084
+ pasteInto(false, false);
18272085 } else
1828
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
18292091 {
18302092 paste(true);
18312093 } else
1832
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
18332095 {
18342096 Overwrite(Object3D.TRANSFORM);
18352097 } else
1836
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
18372099 {
18382100 Overwrite(Object3D.NAME);
18392101 } else
1840
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
18412103 {
18422104 Overwrite(Object3D.UV);
18432105 } else
1844
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
18452107 {
2108
+ /* july 2015
18462109 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2110
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482111 else
18492112 {
18502113 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2119,16 @@
18562119 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572120 }
18582121 }
2122
+ */
2123
+
2124
+ Overwrite(dropAttributes);
18592125 }
1860
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
18612127 {
18622128 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2129
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642130 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2131
+// Object3D content = GrafreeD.clipboard.get(0);
18662132 //
18672133 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682134 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2140,7 @@
18742140 // refreshContents();
18752141 // }
18762142 } else
1877
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
18782144 {
18792145 //if (group.selection.size() == 1)
18802146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2151,7 @@
18852151 ResetModel();
18862152 refreshContents();
18872153 } else
1888
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
18892155 {
18902156 boolean one = false;
18912157
....@@ -1912,7 +2178,7 @@
19122178 ResetModel();
19132179 refreshContents();
19142180 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
19162182 {
19172183 boolean one = false;
19182184
....@@ -1938,32 +2204,37 @@
19382204 ResetModel();
19392205 refreshContents();
19402206 } else
1941
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
19422208 {
19432209 boolean one = false;
19442210
19452211 if (group.selection.size() == 1)
19462212 one = true;
19472213
2214
+ Object3D merge = null;
2215
+
19482216 Object3D content = new cGroup();
19492217
19502218 for (int i=0; i<group.selection.size(); i++)
19512219 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2220
+ merge = new Merge(group.selection.get(i));
19532221
19542222 if (one)
1955
- makeSomething(sel, false);
2223
+ makeSomething(merge, false);
19562224 else
1957
- content.addChild(sel);
2225
+ content.addChild(merge);
19582226 }
19592227
19602228 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2229
+ makeSomething(content, true);
2230
+ else
2231
+ {
2232
+ ResetModel();
2233
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2234
+ refreshContents();
2235
+ }
19652236 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
19672238 {
19682239 boolean one = false;
19692240
....@@ -1993,11 +2264,11 @@
19932264 ResetModel();
19942265 refreshContents();
19952266 } else
1996
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
19972268 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2269
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992270 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2271
+// Object3D content = GrafreeD.clipboard.get(0);
20012272 //
20022273 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032274 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2277,48 @@
20062277 // group.selection.get(0).setMasterThis(content); // should be identity
20072278 // refreshContents();
20082279 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102281 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
20122283
20132284 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142285 content = ((cGroup)content).get(0);
20152286
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2287
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172288 for (int i=0; i<group.selection.size(); i++)
20182289 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
20212292 group.selection.get(i).linkVerticesThis(content);
20222293 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
20242295 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2296
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262297 refreshContents();
20272298 }
20282299 } else
2029
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
20302301 {
20312302 for (int i=0; i<group.selection.size(); i++)
20322303 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
20352306 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
20372308 }
20382309
20392310 refreshContents();
20402311 } else
2041
- if (event.getSource() == resetreferencesItem)
2312
+ if (source == relinkverticesItem)
2313
+ {
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
2316
+ group.selection.RelinkToSupport();
2317
+ CameraPane.SWITCH = random;
2318
+
2319
+ refreshContents();
2320
+ } else
2321
+ if (source == resetreferencesItem)
20422322 {
20432323 for (int i=0; i<group.selection.size(); i++)
20442324 {
....@@ -2047,11 +2327,11 @@
20472327
20482328 refreshContents();
20492329 } else
2050
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
20512331 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532333 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
20552335
20562336 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572337 content = ((cGroup)content).get(0);
....@@ -2060,13 +2340,13 @@
20602340 refreshContents();
20612341 }
20622342 } else
2063
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
20642344 {
20652345 if (group.selection.size() == 1)
20662346 {
2067
- if (GraphreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
20682348 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
20702350
20712351 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722352 content = ((cGroup)content).get(0);
....@@ -2079,19 +2359,19 @@
20792359 }
20802360
20812361 } else
2082
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
20832363 {
20842364 RevertMeshes();
20852365 } else
2086
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
20872367 {
20882368 ResetAll();
20892369 } else
2090
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
20912371 {
20922372 StepAll();
20932373 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
20952375 {
20962376 //int indices[] = jList.getSelectedIndices();
20972377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2379,46 @@
20992379
21002380 ClearSelection(false);
21012381 } else
2102
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
21032383 {
21042384 ClearSelection(true);
21052385 } else
2106
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
21072387 {
21082388 group(new cGroup(), true);
21092389 } else
2110
- if (event.getSource() == frontItem)
2390
+ if (source == hideItem)
2391
+ {
2392
+ group(new HiddenObject());
2393
+ } else
2394
+ if (source == frontItem)
21112395 {
21122396 front();
21132397 } else
2114
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
21152399 {
21162400 back();
21172401 } else
2118
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
21192403 {
21202404 makeSomething(new Camera());
21212405 } else
2122
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
21232407 {
21242408 group(new Composite());
21252409 } else
2126
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
21272411 {
21282412 RandomNode random = new RandomNode();
21292413 group(random);
21302414 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
21322416 } else
2133
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
21342418 {
21352419 group(new PhysicsNode());
21362420 } else
2137
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
21382422 {
21392423 for (int i=0; i<group.selection.size(); i++)
21402424 {
....@@ -2146,7 +2430,7 @@
21462430 ResetModel();
21472431 refreshContents();
21482432 } else
2149
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
21502434 {
21512435 for (int i=0; i<group.selection.size(); i++)
21522436 {
....@@ -2158,7 +2442,7 @@
21582442 ResetModel();
21592443 refreshContents();
21602444 } else
2161
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
21622446 {
21632447 for (int i=0; i<group.selection.size(); i++)
21642448 {
....@@ -2170,7 +2454,7 @@
21702454 ResetModel();
21712455 refreshContents();
21722456 } else
2173
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
21742458 {
21752459 for (int i=0; i<group.selection.size(); i++)
21762460 {
....@@ -2182,7 +2466,7 @@
21822466 ResetModel();
21832467 refreshContents();
21842468 } else
2185
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
21862470 {
21872471 boolean atleastone = false;
21882472
....@@ -2221,191 +2505,239 @@
22212505 }
22222506 }
22232507 } else
2224
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
22252509 {
22262510 group(new cLinker());
22272511 } else
2228
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
22292513 {
22302514 group(new TextureNode());
22312515 } else
2232
- if (event.getSource() == shadowXItem)
2516
+ if (source == billboardItem)
2517
+ {
2518
+ group(new BillboardNode());
2519
+ } else
2520
+ if (source == shadowXItem)
22332521 {
22342522 CastShadow(0);
22352523 } else
2236
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
22372525 {
22382526 CastShadow(1);
22392527 } else
2240
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
22412529 {
22422530 CastShadow(2);
22432531 } else
2244
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
22452533 {
2246
- ungroup();
2534
+ //ungroup();
2535
+ for (int i=0; i<group.selection.size(); i++)
2536
+ {
2537
+ Ungroup(group.selection.get(i));
2538
+ }
2539
+
2540
+ ClearSelection(false);
2541
+
2542
+ refreshContents();
22472543 } else
2248
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
22492545 {
22502546 GenUV();
22512547 } else
2252
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
22532549 {
22542550 GenNormals(true);
22552551 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2552
+ if (source == genNormalsMESHItem)
2553
+ {
2554
+ GenNormalsMESH();
2555
+ } else
2556
+ if (source == genNormalsORGANItem)
22572557 {
22582558 GenNormals(false);
22592559 } else
2260
- if (event.getSource() == stripifyItem)
2560
+ if (source == genNormalsMINEItem)
2561
+ {
2562
+ GenNormalsMINE();
2563
+ } else
2564
+ if (source == stripifyItem)
22612565 {
22622566 Stripify();
22632567 } else
2264
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
22652569 {
22662570 Unstripify();
22672571 } else
2268
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
22692573 {
22702574 Trim();
22712575 } else
2272
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
22732577 {
22742578 Untrim();
22752579 } else
2276
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
22772581 {
22782582 ClearColors();
22792583 } else
2280
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
22812585 {
22822586 ClearMaterials();
22832587 } else
2284
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
22852589 {
22862590 LiveLeaves(true);
22872591 } else
2288
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
22892593 {
22902594 LiveLeaves(false);
22912595 } else
2292
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
22932597 {
22942598 SupportLeaves(true);
22952599 } else
2296
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
22972601 {
22982602 SupportLeaves(false);
22992603 } else
2300
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
23012605 {
23022606 HideLeaves(true);
23032607 } else
2304
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
23052609 {
23062610 HideLeaves(false);
23072611 } else
2308
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
23092613 {
23102614 MarkLeaves(true);
23112615 } else
2312
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
23132617 {
23142618 MarkLeaves(false);
23152619 } else
2316
- if (event.getSource() == flipVItem)
2620
+ if (source == rewindleavesItem)
2621
+ {
2622
+ RewindLeaves(true);
2623
+ } else
2624
+ if (source == unrewindleavesItem)
2625
+ {
2626
+ RewindLeaves(false);
2627
+ } else
2628
+ if (source == randomleavesItem)
2629
+ {
2630
+ RandomLeaves(true);
2631
+ } else
2632
+ if (source == unrandomleavesItem)
2633
+ {
2634
+ RandomLeaves(false);
2635
+ } else
2636
+ if (source == flipVItem)
23172637 {
23182638 FlipV(true);
23192639 } else
2320
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
23212641 {
23222642 FlipV(false);
23232643 } else
2324
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
23252645 {
23262646 SetTexRes(0);
23272647 } else
2328
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
23292649 {
23302650 SetTexRes(1);
23312651 } else
2332
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
23332653 {
23342654 SetTexRes(2);
23352655 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
23372657 {
23382658 SetTexRes(3);
23392659 } else
2340
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
23412661 {
23422662 SetTexRes(4);
23432663 } else
2344
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
23452665 {
23462666 SetTexRes(5);
23472667 } else
2348
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
23492669 {
23502670 ReverseNormals();
23512671 } else
2352
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
23532673 {
23542674 ParseVertices();
23552675 } else
2356
- if (event.getSource() == alignItem)
2676
+ if (source == textureFieldItem)
2677
+ {
2678
+ TextureVertices();
2679
+ } else
2680
+ if (source == alignItem)
23572681 {
23582682 Align();
23592683 } else
2360
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
23612685 {
23622686 MirrorPoses();
23632687 } else
2364
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
23652689 {
23662690 MeshReduction(false);
23672691 } else
2368
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
23692693 {
23702694 MeshReduction(true);
23712695 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
23732697 {
23742698 ReverseTriangles();
23752699 } else
2376
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
23772701 {
23782702 ReduceMesh(false);
23792703 } else
2380
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
23812705 {
23822706 ReduceMesh(true);
23832707 } else
2384
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
23852709 {
23862710 IncreaseMesh();
23872711 } else
2388
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
23892713 {
23902714 ClipMesh();
23912715 } else
2392
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
23932717 {
23942718 SmoothMesh();
23952719 } else
2396
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
23972721 {
23982722 TransformGeometry();
23992723 } else
2400
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
24012729 {
24022730 ResetTransform();
24032731 } else
2404
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
24052733 {
2406
- ResetCentroid();
2734
+ ResetCentroid(true);
24072735 } else
2408
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
24092741 {
24102742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112743 {
....@@ -2415,7 +2747,7 @@
24152747
24162748 refreshContents();
24172749 } else
2418
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
24192751 {
24202752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212753 {
....@@ -2429,7 +2761,21 @@
24292761
24302762 refreshContents();
24312763 } else
2432
- if (event.getSource() == sortbysizeItem)
2764
+ if (source == repairShadowItem)
2765
+ {
2766
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2767
+ {
2768
+ Object3D obj = (Object3D)e.nextElement();
2769
+ obj.RepairShadow();
2770
+// for (int i=0; i<obj.size(); i++)
2771
+// {
2772
+// obj.get(i).parent = obj;
2773
+// }
2774
+ }
2775
+
2776
+ refreshContents();
2777
+ } else
2778
+ if (source == sortbysizeItem)
24332779 {
24342780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352781 {
....@@ -2441,7 +2787,7 @@
24412787 ResetModel();
24422788 refreshContents();
24432789 } else
2444
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
24452791 {
24462792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472793 {
....@@ -2453,7 +2799,7 @@
24532799 ResetModel();
24542800 refreshContents();
24552801 } else
2456
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
24572803 {
24582804 String texture = GetFile("Attach pigment");
24592805 Object3D obj;
....@@ -2465,7 +2811,7 @@
24652811
24662812 refreshContents();
24672813 } else
2468
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
24692815 {
24702816 Object3D obj;
24712817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2822,7 @@
24762822
24772823 refreshContents();
24782824 } else
2479
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
24802826 {
24812827 String texture = GetFile("Attach bump");
24822828 Object3D obj;
....@@ -2488,7 +2834,7 @@
24882834
24892835 refreshContents();
24902836 } else
2491
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
24922838 {
24932839 Object3D obj;
24942840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2845,7 @@
24992845
25002846 refreshContents();
25012847 } else
2502
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
25032849 {
25042850 Object3D obj;
25052851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2856,195 @@
25102856
25112857 refreshContents();
25122858 } else
2513
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
25142860 {
25152861 CameraPane.flash = true;
25162862 refreshContents();
25172863 } else
2518
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
25192865 {
25202866 } else
2521
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
25222868 {
25232869 radio.layout = twoButton;
25242870 // bug
25252871 //gridPanel.setDividerLocation(1.0);
25262872 //bigPanel.setDividerLocation(0.0);
2527
- bigThree.remove(jtp);
2528
- bigThree.remove(cameraPanel);
2529
- bigThree.remove(XYZPanel);
2530
- aWindowConstraints.gridx = 0;
2531
- aWindowConstraints.gridy = 0;
2532
- aWindowConstraints.gridwidth = 1;
2533
- // aConstraints.gridheight = 3;
2534
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2535
- aWindowConstraints.weightx = 0;
2536
- aWindowConstraints.weighty = 1;
2537
- //bigThree.add(jtp, aWindowConstraints);
2538
- aWindowConstraints.weightx = 1;
2539
- aWindowConstraints.gridwidth = 3;
2540
- // aConstraints.gridheight = 3;
2541
- aWindowConstraints.gridx = 1;
2542
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2543
- bigThree.add(cameraPanel, aWindowConstraints);
2544
- aWindowConstraints.weightx = 0;
2545
- aWindowConstraints.gridx = 4;
2546
- aWindowConstraints.gridwidth = 1;
2547
- // aConstraints.gridheight = 3;
2548
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2549
- //bigThree.add(XYZPanel, aWindowConstraints);
2550
- bigThree.revalidate();
2873
+// bigThree.remove(scenePanel);
2874
+// bigThree.remove(centralPanel);
2875
+// bigThree.remove(XYZPanel);
2876
+// aWindowConstraints.gridx = 0;
2877
+// aWindowConstraints.gridy = 0;
2878
+// aWindowConstraints.gridwidth = 1;
2879
+// // aConstraints.gridheight = 3;
2880
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2881
+// aWindowConstraints.weightx = 0;
2882
+// aWindowConstraints.weighty = 1;
2883
+// //bigThree.add(jtp, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 1;
2885
+// aWindowConstraints.gridwidth = 3;
2886
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.gridx = 1;
2888
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2889
+// bigThree.add(centralPanel, aWindowConstraints);
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.gridx = 4;
2892
+// aWindowConstraints.gridwidth = 1;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2895
+// //bigThree.add(XYZPanel, aWindowConstraints);
2896
+// scenePanel.setVisible(false);
2897
+// centralPanel.setVisible(true);
2898
+// XYZPanel.setVisible(false);
2899
+ bigThree.ClearUI();
2900
+ bigThree.add(centralPanel);
2901
+ bigThree.FlushUI();
25512902 } else
2552
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
25532904 {
25542905 radio.layout = threeButton;
2555
- bigThree.remove(jtp);
2556
- bigThree.remove(cameraPanel);
2557
- bigThree.remove(XYZPanel);
2558
- aWindowConstraints.gridx = 0;
2559
- aWindowConstraints.gridy = 0;
2560
- aWindowConstraints.gridwidth = 1;
2561
- // aConstraints.gridheight = 3;
2562
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2563
- aWindowConstraints.weightx = 0;
2564
- aWindowConstraints.weighty = 1;
2565
- //bigThree.add(jtp, aWindowConstraints);
2566
- aWindowConstraints.weightx = 1;
2567
- aWindowConstraints.gridwidth = 3;
2568
- // aConstraints.gridheight = 3;
2569
- aWindowConstraints.gridx = 1;
2570
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2571
- bigThree.add(cameraPanel, aWindowConstraints);
2572
- aWindowConstraints.weightx = 0;
2573
- aWindowConstraints.gridx = 4;
2574
- aWindowConstraints.gridwidth = 1;
2575
- // aConstraints.gridheight = 3;
2576
- aConstraints.fill = GridBagConstraints.VERTICAL;
2577
- bigThree.add(XYZPanel, aWindowConstraints);
2578
- bigThree.revalidate();
2906
+
2907
+// bigThree.remove(scenePanel);
2908
+// bigThree.remove(centralPanel);
2909
+// bigThree.remove(XYZPanel);
2910
+// aWindowConstraints.gridx = 0;
2911
+// aWindowConstraints.gridy = 0;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// aWindowConstraints.weightx = 0;
2916
+// aWindowConstraints.weighty = 1;
2917
+// //bigThree.add(jtp, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 1;
2919
+// aWindowConstraints.gridwidth = 3;
2920
+// // aConstraints.gridheight = 3;
2921
+// aWindowConstraints.gridx = 1;
2922
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2923
+// bigThree.add(centralPanel, aWindowConstraints);
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.gridx = 4;
2926
+// aWindowConstraints.gridwidth = 1;
2927
+// // aConstraints.gridheight = 3;
2928
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2929
+// bigThree.add(XYZPanel, aWindowConstraints);
2930
+// bigThree.validate();
2931
+// scenePanel.setVisible(false);
2932
+// centralPanel.setVisible(true);
2933
+// XYZPanel.setVisible(true);
2934
+ bigThree.ClearUI();
2935
+ bigThree.add(centralPanel);
2936
+ bigThree.add(XYZPanel);
2937
+ bigThree.FlushUI();
25792938 } else
2580
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
25812940 {
25822941 radio.layout = fourButton;
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
- // aWindowConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2591
- aWindowConstraints.weightx = 1;
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
- // aWindowConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
2942
+
2943
+// bigThree.remove(scenePanel);
2944
+// bigThree.remove(centralPanel);
2945
+// bigThree.remove(XYZPanel);
2946
+// aWindowConstraints.gridx = 0;
2947
+// aWindowConstraints.gridy = 0;
2948
+// aWindowConstraints.gridwidth = 1;
2949
+// // aWindowConstraints.gridheight = 3;
2950
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2951
+// aWindowConstraints.weightx = 1;
2952
+// aWindowConstraints.weighty = 1;
2953
+// bigThree.add(scenePanel, aWindowConstraints);
2954
+// aWindowConstraints.weightx = 1;
2955
+// aWindowConstraints.gridwidth = 3;
2956
+// // aConstraints.gridheight = 3;
2957
+// aWindowConstraints.gridx = 1;
2958
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2959
+// //bigThree.add(cameraPanel, aWindowConstraints);
2960
+// aWindowConstraints.weightx = 0;
2961
+// aWindowConstraints.gridx = 4;
2962
+// aWindowConstraints.gridwidth = 1;
2963
+// // aWindowConstraints.gridheight = 3;
2964
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2965
+// //bigThree.add(XYZPanel, aWindowConstraints);
2966
+// bigThree.validate();
2967
+// scenePanel.setVisible(true);
2968
+// centralPanel.setVisible(false);
2969
+// XYZPanel.setVisible(false);
2970
+ bigThree.ClearUI();
2971
+ bigThree.add(scenePanel);
2972
+ bigThree.FlushUI();
26072973 } else
2608
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
26092975 {
26102976 radio.layout = sixButton;
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
- // aWindowConstraints.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
- // aWindowConstraints.gridheight = 3;
2632
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2633
- //bigThree.add(XYZPanel, aConstraints);
2634
- bigThree.revalidate();
2977
+
2978
+// bigThree.remove(scenePanel);
2979
+// bigThree.remove(centralPanel);
2980
+// bigThree.remove(XYZPanel);
2981
+// aWindowConstraints.gridx = 0;
2982
+// aWindowConstraints.gridy = 0;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// aWindowConstraints.weightx = 0;
2987
+// aWindowConstraints.weighty = 1;
2988
+// bigThree.add(scenePanel, aWindowConstraints);
2989
+// aWindowConstraints.weightx = 1;
2990
+// aWindowConstraints.gridwidth = 3;
2991
+// // aWindowConstraints.gridheight = 3;
2992
+// aWindowConstraints.gridx = 1;
2993
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2994
+// bigThree.add(centralPanel, aWindowConstraints);
2995
+// aWindowConstraints.weightx = 0;
2996
+// aWindowConstraints.gridx = 4;
2997
+// aWindowConstraints.gridwidth = 1;
2998
+// // aWindowConstraints.gridheight = 3;
2999
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3000
+// //bigThree.add(XYZPanel, aConstraints);
3001
+// bigThree.validate();
3002
+// scenePanel.setVisible(true);
3003
+// centralPanel.setVisible(true);
3004
+// XYZPanel.setVisible(false);
3005
+ bigThree.ClearUI();
3006
+ bigThree.add(scenePanel);
3007
+ bigThree.add(centralPanel);
3008
+ bigThree.FlushUI();
26353009 } else
2636
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
26373011 {
26383012 radio.layout = sevenButton;
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.VERTICAL;
2647
- aWindowConstraints.weightx = 0;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aWindowConstraints.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
- // aConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3013
+
3014
+// bigThree.remove(scenePanel);
3015
+// bigThree.remove(centralPanel);
3016
+// bigThree.remove(XYZPanel);
3017
+// aWindowConstraints.gridx = 0;
3018
+// aWindowConstraints.gridy = 0;
3019
+// aWindowConstraints.gridwidth = 1;
3020
+// // aWindowConstraints.gridheight = 3;
3021
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3022
+// aWindowConstraints.weightx = 0;
3023
+// aWindowConstraints.weighty = 1;
3024
+// bigThree.add(scenePanel, aWindowConstraints);
3025
+// aWindowConstraints.weightx = 1;
3026
+// aWindowConstraints.gridwidth = 3;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.gridx = 1;
3029
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3030
+// bigThree.add(centralPanel, aWindowConstraints);
3031
+// aWindowConstraints.weightx = 0;
3032
+// aWindowConstraints.gridx = 4;
3033
+// aWindowConstraints.gridwidth = 1;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3036
+// bigThree.add(XYZPanel, aWindowConstraints);
3037
+// bigThree.validate();
3038
+// scenePanel.setVisible(true);
3039
+// centralPanel.setVisible(true);
3040
+// XYZPanel.setVisible(true);
3041
+ bigThree.ClearUI();
3042
+ bigThree.add(scenePanel);
3043
+ bigThree.add(centralPanel);
3044
+ bigThree.add(XYZPanel);
3045
+ bigThree.FlushUI();
26633046 } else
2664
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
26653048 {
26663049 Object3D obj;
26673050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +3056,7 @@
26733056
26743057 refreshContents(true);
26753058 } else
2676
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
26773060 {
26783061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793062 cRadio ab;
....@@ -2694,11 +3077,11 @@
26943077 }
26953078 refreshContents(true);
26963079 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
26983081 {
26993082 EditSelection(false);
27003083 } else
2701
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
27023085 {
27033086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043087 {
....@@ -2708,14 +3091,14 @@
27083091 child.CloseUI();
27093092 listUI.remove(child);
27103093
2711
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
27123095 }
2713
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
27143097 //objEditor.jTree.clearSelection();
27153098 //objEditor.ResetSliders();
27163099 refreshContents(true);
27173100 } else
2718
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
27193102 {
27203103 assert(copy == group);
27213104 //copy.ClearUI();
....@@ -2726,7 +3109,7 @@
27263109 listUI.clear();
27273110 refreshContents(true);
27283111 } else
2729
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
27303113 {
27313114 assert(copy == group);
27323115
....@@ -2747,19 +3130,19 @@
27473130
27483131 refreshContents(true);
27493132 } else
2750
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
27513134 {
27523135 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3136
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543137 objEditor.ResetSliders();
27553138 refreshContents(true);
27563139 } else
2757
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
27583141 {
27593142 group.parent = keepparent;
27603143 group.attributes = 0;
27613144 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
27633146 Object3D obj = radio.GetObject();
27643147 System.out.println("Edit " + obj);
27653148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3162,7 @@
27793162 }
27803163
27813164 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3165
+ //Globals.theRenderer.object = group;
27833166 if(!useclient)
27843167 {
27853168 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3171,16 @@
27883171 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893172 cameraView.targetLookAt.set(radio.camera.lookAt);
27903173 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3174
+ //cameraView.lighttouched = true;
3175
+ Globals.lighttouched = true;
27923176 topView.object = group;
27933177 frontView.object = group;
27943178 sideView.object = group;
27953179 }
3180
+
3181
+// fix "+" issue
27963182 group.editWindow = this;
3183
+
27973184 /*
27983185 currentLayout = radio.layout;
27993186 if (currentLayout == null)
....@@ -2806,7 +3193,20 @@
28063193 //group.attributes = -1;
28073194 ResetModel();
28083195 refreshContents(true);
2809
- }
3196
+ } else if (event.getSource() == editCameraItem)
3197
+ {
3198
+ cameraView.ProtectCamera();
3199
+ cameraView.repaint();
3200
+ return;
3201
+ } else if (event.getSource() == revertCameraItem)
3202
+ {
3203
+ cameraView.RevertCamera();
3204
+ cameraView.repaint();
3205
+ return;
3206
+ // } else if (event.getSource() == textureButton)
3207
+ // {
3208
+ // return; // true;
3209
+ }
28103210 else
28113211 {
28123212 //return super.action(event, arg);
....@@ -2824,7 +3224,7 @@
28243224 if (useclient)
28253225 {
28263226 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3227
+ Globals.lighttouched = true;
28283228 //topView.object = client;
28293229 //frontView.object = client;
28303230 //sideView.object = client;
....@@ -2832,7 +3232,7 @@
28323232 else
28333233 {
28343234 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3235
+ Globals.lighttouched = true;
28363236 //topView.object = group;
28373237 //frontView.object = group;
28383238 //sideView.object = group;
....@@ -2867,6 +3267,28 @@
28673267 refreshContents();
28683268 }
28693269
3270
+ void TransformChildren()
3271
+ {
3272
+ Object3D obj;
3273
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3274
+ {
3275
+ obj = (Object3D)e.nextElement();
3276
+ obj.KeepTextureMatrices();
3277
+ obj.TransformChildren();
3278
+ obj.RestoreTextureMatrices();
3279
+
3280
+// if (obj.parent == null)
3281
+// {
3282
+// System.out.println("NULL PARENT!");
3283
+// new Exception().printStackTrace();
3284
+// }
3285
+// else
3286
+// TouchTransform(obj);
3287
+// //obj.parent.Touch();
3288
+ }
3289
+
3290
+ refreshContents();
3291
+ }
28703292
28713293 void ResetTransform()
28723294 {
....@@ -2979,7 +3401,7 @@
29793401 refreshContents();
29803402 }
29813403
2982
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
29833405 {
29843406 Object3D obj;
29853407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3416,16 @@
29943416 LA.matIdentity(Object3D.mat);
29953417 obj.getBounds(minima, maxima, false);
29963418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993422 obj.TransformMesh(Object3D.mat);
3423
+
30003424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
30033429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3454,8 @@
30283454
30293455 int size = obj.MemorySize();
30303456
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3457
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3458
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323459 }
30333460 }
30343461 catch (Exception e)
....@@ -3065,9 +3492,9 @@
30653492 obj = (Object3D)e.nextElement();
30663493
30673494 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
30693496 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
30713498
30723499 // System.err.println((size/1024) + " KB is the size of " + obj);
30733500 }
....@@ -3109,6 +3536,20 @@
31093536 void GenNormals(boolean crease)
31103537 {
31113538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
3546
+
3547
+ refreshContents();
3548
+ }
3549
+
3550
+ void GenNormalsMINE()
3551
+ {
3552
+ group.selection.GenNormalsMINE();
31123553
31133554 refreshContents();
31143555 }
....@@ -3157,104 +3598,259 @@
31573598
31583599 //Object3D buffer;
31593600 cVector temp = new cVector();
3160
- BoundaryRep temprep;
3161
- Object3D nodes;
3162
- Vector<Vertex> vertices;
3163
-
3164
- public void Vertex(Object3D node, Vertex v)
3165
- {
3166
- vertices.add(v);
3167
- nodes.addElement(node);
3168
-
3169
- if (temprep.GetCache(v) != null)
3170
- {
3171
- temprep.Remove(v);
3172
- }
3173
- else
3174
- {
3175
- temprep.Remember(v);
3176
- }
3177
- }
3178
-
3179
- public void Face(Object3D node, Face f)
3180
- {
3181
-
3182
- }
3183
-
3601
+// BoundaryRep temprep;
3602
+// Object3D nodes;
3603
+// Vector<Vertex> vertices;
3604
+//
3605
+// cGroup buffer;
3606
+//
3607
+// public void Vertex(Object3D node, Vertex v)
3608
+// {
3609
+//// vertices.add(v);
3610
+//// nodes.addElement(node);
3611
+////
3612
+//// if (temprep.GetCache(v) != null)
3613
+//// {
3614
+//// temprep.Remove(v);
3615
+//// } else
3616
+//// {
3617
+//// temprep.Remember(v);
3618
+//// }
3619
+//
3620
+// //Object3D node = nodes.get(index);
3621
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3622
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3623
+//
3624
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3625
+//
3626
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3627
+//
3628
+// cGroup g = new cGroup();
3629
+//
3630
+// if (g.toParent == null)
3631
+// {
3632
+// g.toParent = LA.newMatrix();
3633
+// g.fromParent = LA.newMatrix();
3634
+// }
3635
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3636
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3637
+//
3638
+// g.add(GrafreeD.clipboard);
3639
+//
3640
+// buffer.add(g);
3641
+// }
3642
+//
3643
+// public void Face(Object3D node, Face f)
3644
+// {
3645
+//
3646
+// }
3647
+//
3648
+// void ParseVerticesOld() // ??
3649
+// {
3650
+// //if (group.selection.size() != 1)
3651
+// // return;
3652
+//
3653
+// temprep = new BoundaryRep();
3654
+// nodes = new Object3D();
3655
+// vertices = new Vector<Vertex>();
3656
+//
3657
+// boolean epsequal = GrafreeD.epsequal;
3658
+// GrafreeD.epsequal = true;
3659
+//
3660
+// for (int i=0; i<group.selection.size(); i++)
3661
+// {
3662
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3663
+//
3664
+// group.selection.get(i).Parse(
3665
+//this );
3666
+//
3667
+// int repsize = temprep.VertexCount();
3668
+// int tablesize = temprep.vertextable.size();
3669
+// int nodesize = nodes.size();
3670
+//
3671
+// assert(vertices.size() == nodes.size());
3672
+//
3673
+// temprep.vertextable.elements();
3674
+//
3675
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3676
+//
3677
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3678
+// {
3679
+// cGroup g = new cGroup();
3680
+//
3681
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3682
+//
3683
+// Object3D node = nodes.get(index);
3684
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3685
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3686
+//
3687
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3688
+//
3689
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3690
+//
3691
+// if (g.toParent == null)
3692
+// {
3693
+// g.toParent = LA.newMatrix();
3694
+// g.fromParent = LA.newMatrix();
3695
+// }
3696
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3697
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3698
+//
3699
+// g.add(GrafreeD.clipboard);
3700
+//
3701
+// buffer.add(g);
3702
+// }
3703
+//
3704
+// makeSomething(buffer, i==group.selection.size()-1);
3705
+// }
3706
+//
3707
+// GrafreeD.epsequal = epsequal;
3708
+//
3709
+// //buffer = null;
3710
+// temprep = null;
3711
+// nodes = null;
3712
+//
3713
+// refreshContents();
3714
+// }
3715
+
31843716 void ParseVertices()
31853717 {
3186
- //if (group.selection.size() != 1)
3187
- // return;
3188
-
3189
- temprep = new BoundaryRep();
3190
- nodes = new Object3D();
3191
- vertices = new Vector<Vertex>();
3192
-
3193
- boolean epsequal = GraphreeD.epsequal;
3194
- GraphreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
31953720
31963721 for (int i=0; i<group.selection.size(); i++)
31973722 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3723
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993724
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3725
+ group.selection.get(i).Parse(
3726
+
3727
+ new iParse()
3728
+ {
3729
+ public void Vertex(Object3D node, Vertex v)
3730
+ {
3731
+ temp.set(v);
3732
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053733
3206
- assert(vertices.size() == nodes.size());
3207
-
3208
- temprep.vertextable.elements();
3209
-
3210
- java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3734
+ cGroup g = new cGroup();
32113735
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3736
+ if (g.toParent == null)
3737
+ {
3738
+ g.toParent = LA.newMatrix();
3739
+ g.fromParent = LA.newMatrix();
3740
+ }
3741
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3742
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153743
3216
- int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3217
- Object3D node = nodes.get(index);
3218
- temp.set(vertices.get(index)); // temprep.GetVertex(k));
3219
- // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3744
+ g.add(Grafreed.clipboard);
32203745
3221
- LA.xformPos(temp, node.GlobalTransformInv(), temp);
3222
-
3223
- // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3224
-
3225
- if (g.toParent == null)
3226
- {
3227
- g.toParent = LA.newMatrix();
3228
- g.fromParent = LA.newMatrix();
3229
- }
3230
- LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3231
- LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3746
+ buffer.add(g);
3747
+ }
32323748
3233
- g.add(GraphreeD.clipboard);
3749
+ public void Face(Object3D node, Face f)
3750
+ {
32343751
3235
- buffer.add(g);
3236
- }
3752
+ }
3753
+ }
3754
+ );
32373755
32383756 makeSomething(buffer, i==group.selection.size()-1);
32393757 }
32403758
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3759
+ Grafreed.epsequal = epsequal;
32463760
32473761 refreshContents();
32483762 }
3249
-
3763
+
3764
+ void TextureVertices()
3765
+ {
3766
+ for (int i=0; i<group.selection.size(); i++)
3767
+ {
3768
+ group.selection.get(i).Parse(
3769
+ new iParse()
3770
+ {
3771
+ public void Vertex(Object3D node, Vertex v)
3772
+ {
3773
+ cTexture tex = node.GetTextures();
3774
+ String pigment = Object3D.GetPigment(tex);
3775
+ //String bump = Object3D.GetBump(tex);
3776
+
3777
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3778
+
3779
+ try
3780
+ {
3781
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3782
+ }
3783
+ catch (Exception e)
3784
+ {
3785
+ System.err.println("FAIL: " + node);
3786
+ }
3787
+
3788
+ double s = v.s;
3789
+
3790
+ if (s == 1)
3791
+ s = 0;
3792
+
3793
+ double t = v.t;
3794
+
3795
+ if (t == 1)
3796
+ t = 0;
3797
+
3798
+ int indexs = (int) (texturedata.getWidth() * s);
3799
+ int indext = (int) (texturedata.getHeight() * t);
3800
+
3801
+ int index = indext * texturedata.getWidth() + indexs;
3802
+
3803
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3804
+
3805
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3806
+
3807
+ float scale = bytebuf.get(index*slide) & 0xFF;
3808
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3809
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3810
+ scale /= 3;
3811
+
3812
+ scale /= 0xFF;
3813
+ // c'est quoi ca? scale /= 4;
3814
+
3815
+ //v.AO = scale;
3816
+
3817
+ v.x += v.norm.x * scale;
3818
+ v.y += v.norm.y * scale;
3819
+ v.z += v.norm.z * scale;
3820
+ }
3821
+
3822
+ public void Face(Object3D node, Face f)
3823
+ {
3824
+ }
3825
+ }
3826
+ );
3827
+ }
3828
+
3829
+ refreshContents();
3830
+ }
3831
+
32503832 void Align()
32513833 {
3834
+ if (group.selection.size() == 0)
3835
+ return;
3836
+
3837
+ cVector bbmin = new cVector();
3838
+ cVector bbmax = new cVector();
3839
+
3840
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3841
+
3842
+ double dx = bbmax.x - bbmin.x;
3843
+ double dy = bbmax.y - bbmin.y;
3844
+ double dz = bbmax.z - bbmin.z;
3845
+
3846
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3847
+
32523848 for (int i=0; i<group.selection.size(); i++)
32533849 {
32543850 Object3D obj = group.selection.get(i);
32553851
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3852
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3853
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583854 }
32593855
32603856 refreshContents();
....@@ -3267,7 +3863,7 @@
32673863 // ref.SaveSupports();
32683864 // Object3D par = ref.parent;
32693865 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3866
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713867 // ref.parent = par;
32723868 // ref.RestoreSupports();
32733869
....@@ -3275,11 +3871,11 @@
32753871
32763872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773873
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
32803876 lowres.linkVerticesThis(null);
32813877 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
32833879
32843880 System.err.flush();
32853881
....@@ -3297,7 +3893,7 @@
32973893 // lowres.SaveSupports();
32983894 // par = lowres.parent;
32993895 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3896
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013897 Object3D newlow = CloneObject(lowres, false);
33023898 newlow.name = sn.switchobject.get(i).name;
33033899 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3915,7 @@
33193915 return;
33203916
33213917 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
33233919
33243920 Object3D newgroup = new Object3D("Po:" + poses.name);
33253921
....@@ -3488,7 +4084,7 @@
34884084 group.selection.RelinkToSupport(); // july 2014
34894085 System.out.println("DONE.");
34904086 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4087
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924088 }
34934089
34944090 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4109,20 @@
35134109
35144110 void ClipMesh()
35154111 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174113 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
35194115
35204116 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214117 content = ((cGroup)content).get(0);
35224118
35234119 // for (int i=0; i<group.selection.size(); i++)
35244120 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4121
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264122 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
35284124 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4125
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304126 System.out.println("DONE.");
35314127 refreshContents();
35324128 }
....@@ -3571,6 +4167,18 @@
35714167 void MarkLeaves(boolean hide)
35724168 {
35734169 group.selection.MarkLeaves(hide);
4170
+ refreshContents();
4171
+ }
4172
+
4173
+ void RewindLeaves(boolean hide)
4174
+ {
4175
+ group.selection.RewindLeaves(hide);
4176
+ refreshContents();
4177
+ }
4178
+
4179
+ void RandomLeaves(boolean hide)
4180
+ {
4181
+ group.selection.RandomLeaves(hide);
35744182 refreshContents();
35754183 }
35764184
....@@ -3659,7 +4267,7 @@
36594267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604268
36614269 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4270
+ if(elem != group || !newWindow)
36634271 {
36644272 // if (!(elem instanceof Composite))
36654273 // newWindow = false;
....@@ -3749,7 +4357,6 @@
37494357 //case 702: // Event.LIST_DESELECT
37504358 group.deselectAll();
37514359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534360 if (tps != null)
37544361 {
37554362 for (int i=0; i < tps.length; i++)
....@@ -3758,31 +4365,30 @@
37584365
37594366 //if (child.parent != null)
37604367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
37614369 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654370 }
37664371 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
37734378
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4379
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774380 CameraPane.flash = true;
37784381
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804383 // a camera
37814384 {
3782
- CameraPane.camerachangeframe = 0; // don't refuse it
3783
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3784
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3785
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4385
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4386
+ {
4387
+ CameraPane.camerachangeframe = 0; // don't refuse it
4388
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4389
+ }
4390
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4391
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864392 }
37874393
37884394 refreshContents();
....@@ -3793,6 +4399,26 @@
37934399
37944400 freezemodel = false;
37954401 }
4402
+
4403
+ void refreshContents(boolean cp)
4404
+ {
4405
+ if (!Globals.MOUSEDRAGGED)
4406
+ {
4407
+ objEditor.ClearInfo(); // .GetMaterial());
4408
+
4409
+ for (int i=0; i < group.selection.Size(); i++)
4410
+ {
4411
+ Object3D child = (Object3D) group.selection.get(i);
4412
+
4413
+ objEditor.AddInfo(child, this, true);
4414
+ System.err.println("info : " + child.GetPath());
4415
+ }
4416
+
4417
+ objEditor.SetText(); // jan 2014
4418
+ }
4419
+
4420
+ super.refreshContents(cp);
4421
+ }
37964422
37974423 void linkSomething(Object3D thing)
37984424 {
....@@ -3864,16 +4490,18 @@
38644490 {
38654491 if (group.selection.isEmpty())
38664492 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
38684495 Composite tGroup = null;
38694496 if (group.selection.size() > 0) // 1)
38704497 {
38714498 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
38734500 }
38744501
38754502 if (cut)
38764503 {
4504
+ Save();
38774505 //int indices[] = jList.getSelectedIndices();
38784506 //for (int i = indices.length - 1; i >= 0; i--)
38794507 //jList.remove(indices[i]);
....@@ -3909,16 +4537,16 @@
39094537 //System.out.println("cut " + child);
39104538 //System.out.println("parent = " + child.parent);
39114539 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
39134541 tGroup.add/*Child*/(tmp);
39144542 else
3915
- GraphreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
39164544 }
39174545 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
39194547 tGroup.add/*Child*/(child);
39204548 else
3921
- GraphreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
39224550 }
39234551
39244552 //ResetModel();
....@@ -3950,21 +4578,23 @@
39504578 //System.out.println("cut " + elem);
39514579 //System.out.println("parent = " + elem.parent);
39524580 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
39544582 tGroup.add/*Child*/(tmp);
39554583 else
3956
- GraphreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
39574585 }
39584586 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
39604588 tGroup.add/*Child*/(child);
39614589 else
3962
- GraphreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
39634591 }
39644592
39654593 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
39684598 if (cut)
39694599 {
39704600 ResetModel();
....@@ -3974,11 +4604,11 @@
39744604
39754605 void paste(boolean expand)
39764606 {
3977
- // if (GraphreeD.clipboard == null)
4607
+ // if (GrafreeD.clipboard == null)
39784608 // return;
39794609 boolean first = true;
39804610
3981
- if (GraphreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
39824612 {
39834613 Composite temp;
39844614
....@@ -3989,7 +4619,7 @@
39894619 temp = (Composite)Applet3D.clipboard.deepCopy();
39904620 */
39914621 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4622
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934623 {
39944624 Object3D child = (Object3D)e.nextElement();
39954625
....@@ -4003,7 +4633,7 @@
40034633 else
40044634 elem = child.deepCopy(); // ?
40054635 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4636
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074637 // elem = elem.get(0);
40084638 makeSomething(elem, true); // ?? first);
40094639 //group.addChild(elem);
....@@ -4023,23 +4653,23 @@
40234653 //Object3D cb = Applet3D.clipboard;
40244654 //temp.addChild(cb);
40254655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4026
- assert(GraphreeD.clipboard.parent == null);
4027
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4028
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4029
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4030
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4656
+ assert(Grafreed.clipboard.parent == null);
4657
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4658
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4659
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4660
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314661 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
40344664 }
40354665
40364666 ResetModel();
40374667 refreshContents();
40384668 }
40394669
4040
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
40414671 {
4042
-// if (GraphreeD.clipboard == null)
4672
+// if (GrafreeD.clipboard == null)
40434673 // return;
40444674
40454675 if (group.selection.size() != 1)
....@@ -4066,15 +4696,22 @@
40664696 if (copyit)
40674697 {
40684698 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
40704707 }
40714708 else
40724709 {
40734710 boolean first = true;
40744711
4075
- if (GraphreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
40764713 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
40784715 Object3D copy;
40794716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804717 {
....@@ -4084,7 +4721,7 @@
40844721 }
40854722 } else
40864723 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
40884725 }
40894726 }
40904727 }
....@@ -4276,6 +4913,26 @@
42764913 makeSomething(csg);
42774914 }
42784915
4916
+ void Ungroup(Object3D g)
4917
+ {
4918
+ if (g instanceof HiddenObject)
4919
+ {
4920
+ HiddenObject h = (HiddenObject) g;
4921
+
4922
+ for (int i=0; i<h.ActualSize(); i++)
4923
+ {
4924
+ objEditor.makeSomething(h.get(i), false);
4925
+ }
4926
+ }
4927
+ else
4928
+ {
4929
+ for (int i=0; i<g.Size(); i++)
4930
+ {
4931
+ objEditor.makeSomething(g.get(i), false);
4932
+ }
4933
+ }
4934
+ }
4935
+
42794936 void ungroup()
42804937 {
42814938 /*
....@@ -4469,21 +5126,6 @@
44695126 }
44705127 */
44715128
4472
- void ImportGFD()
4473
- {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4475
- browser.show();
4476
- String filename = browser.getFile();
4477
- if (filename != null && filename.length() > 0)
4478
- {
4479
- String fullname = browser.getDirectory() + filename;
4480
-
4481
- //Object3D readobj =
4482
- objEditor.ReadGFD(fullname, objEditor);
4483
- //makeSomething(readobj);
4484
- }
4485
- }
4486
-
44875129 /*
44885130 public void Callback(Object obj)
44895131 {
....@@ -4507,26 +5149,9 @@
45075149 }
45085150 */
45095151
4510
- void ImportVRMLX3D()
4511
- {
4512
- if (GraphreeD.standAlone)
4513
- {
4514
- /**/
4515
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4516
- browser.show();
4517
- String filename = browser.getFile();
4518
- if (filename != null && filename.length() > 0)
4519
- {
4520
- String fullname = browser.getDirectory() + filename;
4521
- LoadVRMLX3D(fullname);
4522
- }
4523
- /**/
4524
- }
4525
- }
4526
-
45275152 String GetFile(String dialogName)
45285153 {
4529
- if (GraphreeD.standAlone)
5154
+ if (Grafreed.standAlone)
45305155 {
45315156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325157 browser.show();
....@@ -4590,10 +5215,15 @@
45905215 cButton flashSelectionButton;
45915216 cButton editButton;
45925217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
45935219 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955220 cButton unselectButton;
45965221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
45975227 cButton screenfitButton;
45985228 cButton screenfitpointButton;
45995229 cButton snapobjectButton;
....@@ -4624,6 +5254,8 @@
46245254 private MenuItem lookFromItem;
46255255 private MenuItem switchItem;
46265256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
46275259 private MenuItem duplicateItem;
46285260 private MenuItem cloneItem;
46295261 private MenuItem cloneSupportItem;
....@@ -4635,8 +5267,9 @@
46355267 private MenuItem resetsupportItem;
46365268 private MenuItem resetreferencesItem;
46375269 private MenuItem linkverticesItem;
5270
+ private MenuItem relinkverticesItem;
46385271 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
46405273 private MenuItem stepAllItem;
46415274 private MenuItem revertMeshItem;
46425275 private MenuItem poseMeshItem;
....@@ -4647,14 +5280,17 @@
46475280 private MenuItem mergeGeometriesItem;
46485281 private MenuItem copyItem;
46495282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
46505284 private MenuItem pasteLinkItem;
46515285 private MenuItem pasteCloneItem;
46525286 private MenuItem pasteExpandItem;
46535287 private MenuItem clearItem;
46545288 private MenuItem clearAllItem;
46555289 private MenuItem genUVItem;
5290
+ private MenuItem genNormalsMESHItem;
46565291 private MenuItem genNormalsCADItem;
46575292 private MenuItem genNormalsORGANItem;
5293
+ private MenuItem genNormalsMINEItem;
46585294 private MenuItem stripifyItem;
46595295 private MenuItem unstripifyItem;
46605296 private MenuItem trimItem;
....@@ -4683,6 +5319,10 @@
46835319 private MenuItem showleavesItem;
46845320 private MenuItem markleavesItem;
46855321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
46865326
46875327 private MenuItem flipVItem;
46885328 private MenuItem unflipVItem;
....@@ -4694,8 +5334,11 @@
46945334 private MenuItem panoTexturesItem;
46955335
46965336 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
46985338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
5341
+ private MenuItem hideItem;
46995342 private MenuItem grabItem;
47005343 private MenuItem backItem;
47015344 private MenuItem frontItem;
....@@ -4716,6 +5359,7 @@
47165359
47175360 private MenuItem resetParentItem;
47185361 private MenuItem repairParentItem;
5362
+ private MenuItem repairShadowItem;
47195363 private MenuItem sortbysizeItem;
47205364 private MenuItem sortbynameItem;
47215365
....@@ -4728,16 +5372,19 @@
47285372 private MenuItem particleItem;
47295373 private MenuItem ragdollItem;
47305374 private MenuItem ragdoll2Item;
5375
+ private MenuItem heightFieldItem;
5376
+ private MenuItem textureFieldItem;
47315377 private MenuItem gridItem;
47325378 private MenuItem rectoidItem;
47335379 private MenuItem ellipsoidItem;
47345380 private MenuItem coneItem;
47355381 private MenuItem torusItem;
47365382 private MenuItem superItem;
5383
+ private MenuItem kleinItem;
47375384 private MenuItem blobItem;
47385385 private MenuItem latheItem;
47395386 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
47415388 private MenuItem meshItem;
47425389 // private MenuItem meshGroupItem;
47435390 private MenuItem springItem;
....@@ -4746,6 +5393,7 @@
47465393 private MenuItem csgItem;
47475394 private MenuItem templateItem;
47485395 private MenuItem textureItem;
5396
+ private MenuItem billboardItem;
47495397 private MenuItem shadowXItem;
47505398 private MenuItem shadowYItem;
47515399 private MenuItem shadowZItem;
....@@ -4758,11 +5406,6 @@
47585406 private MenuItem doubleItem;
47595407 private MenuItem tripleItem;
47605408
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665409 private MenuItem computeAOItem;
47675410 private MenuItem recompileItem;
47685411 private MenuItem editScriptItem;
....@@ -4772,4 +5415,8 @@
47725415 private MenuItem analyzeItem;
47735416 private MenuItem dumpItem;
47745417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
47755422 }