Normand Briere
2019-05-02 c209bbe1cf788c9af3dcffea7667c830170a3f1f
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,
....@@ -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
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,36 +163,49 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
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("-");
175174 cutItem = menu.add(new MenuItem("Cut"));
176175 cutItem.addActionListener(this);
177176 copyItem = menu.add(new MenuItem("Copy"));
178177 copyItem.addActionListener(this);
179178 pasteItem = menu.add(new MenuItem("Paste"));
180179 pasteItem.addActionListener(this);
180
+ menu.add("-");
181
+ cloneItem = menu.add(new MenuItem("Clone"));
182
+ cloneItem.addActionListener(this);
183
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
+ cloneSupportItem.addActionListener(this);
185
+ menu.add("-");
186
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
187
+ pasteIntoItem.addActionListener(this);
181188 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182189 pasteLinkItem.addActionListener(this);
183190 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184191 pasteCloneItem.addActionListener(this);
185192 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186193 // pasteExpandItem.addActionListener(this);
194
+ menu.add("-");
187195 clearItem = menu.add(new MenuItem("Clear"));
188196 clearItem.addActionListener(this);
197
+
198
+ if (Globals.ADVANCED)
199
+ {
200
+ // Deletes the cameras...
189201 clearAllItem = menu.add(new MenuItem("Clear All"));
190202 clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
203
+ }
204
+
205
+ oe.menuBar.add(menu = new Menu("Setting"));
206
+ if (Globals.ADVANCED)
207
+ {
208
+ resetMeshItem = menu.add(new MenuItem("Reset All"));
193209 resetMeshItem.addActionListener(this);
194210 stepAllItem = menu.add(new MenuItem("Step All"));
195211 stepAllItem.addActionListener(this);
....@@ -198,6 +214,7 @@
198214 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199215 resetreferencesItem.addActionListener(this);
200216 menu.add("-");
217
+ }
201218 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202219 overwriteGeoItem.addActionListener(this);
203220 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,47 +226,67 @@
209226 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210227 overwriteUVItem.addActionListener(this);
211228 menu.add("-");
229
+ if (Globals.ADVANCED)
230
+ {
212231 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213232 generateMeshItem.addActionListener(this);
214233 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215234 poseMeshItem.addActionListener(this);
216235 menu.add("-");
236
+ }
217237 resetsupportItem = menu.add(new MenuItem("Reset support"));
218238 resetsupportItem.addActionListener(this);
219239 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220240 linkverticesItem.addActionListener(this);
241
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
242
+ relinkverticesItem.addActionListener(this);
243
+
244
+ if (Globals.ADVANCED)
245
+ {
221246 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222247 setMasterItem.addActionListener(this);
248
+ }
223249
224
- oe.menuBar.add(menu = new Menu("Object"));
250
+ oe.menuBar.add(menu = new Menu("Group"));
225251 grabItem = menu.add(new MenuItem("Grab"));
226252 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229253 backItem = menu.add(new MenuItem("Back"));
230254 backItem.addActionListener(this);
255
+ frontItem = menu.add(new MenuItem("Front"));
256
+ frontItem.addActionListener(this);
231257 compositeItem = menu.add(new MenuItem("Composite"));
232258 compositeItem.addActionListener(this);
259
+ hideItem = menu.add(new MenuItem("Hidden Group"));
260
+ hideItem.addActionListener(this);
261
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
262
+ ungroupItem.addActionListener(this);
233263 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
264
+ randomItem = menu.add(new MenuItem("Switch node"));
235265 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);
240266 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241267 switchGeoItem.addActionListener(this);
242268 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243269 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
270
+ morphItem = menu.add(new MenuItem("Morph Group"));
245271 morphItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
275
+ physicsItem = menu.add(new MenuItem("Physics"));
276
+ physicsItem.addActionListener(this);
277
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278
+ frameselectorItem.addActionListener(this);
246279 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247280 scriptNodeItem.addActionListener(this);
248281 cameraItem = menu.add(new MenuItem("Camera"));
249282 cameraItem.addActionListener(this);
250
- menu.add("-");
283
+ }
284
+
285
+ oe.menuBar.add(menu = new Menu("Object"));
251286 textureItem = menu.add(new MenuItem("Texture"));
252287 textureItem.addActionListener(this);
288
+ billboardItem = menu.add(new MenuItem("Billboard"));
289
+ billboardItem.addActionListener(this);
253290 csgItem = menu.add(new MenuItem("CSG"));
254291 csgItem.addActionListener(this);
255292 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -258,23 +295,24 @@
258295 shadowYItem.addActionListener(this);
259296 shadowZItem = menu.add(new MenuItem("Shadow Z"));
260297 shadowZItem.addActionListener(this);
298
+ if (Globals.ADVANCED)
299
+ {
261300 linkerItem = menu.add(new MenuItem("Linker"));
262301 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265302 attributeItem = menu.add(new MenuItem("Attribute"));
266303 attributeItem.addActionListener(this);
304
+ templateItem = menu.add(new MenuItem("Template"));
305
+ templateItem.addActionListener(this);
267306 pointflowItem = menu.add(new MenuItem("Point Flow"));
268307 pointflowItem.addActionListener(this);
269308 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
309
+ }
272310 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273311 resetTransformItem.addActionListener(this);
274312 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275313 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
314
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
+ transformgeometryItem.addActionListener(this);
278316
279317 oe.menuBar.add(menu = new Menu("Geometry"));
280318 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +321,13 @@
283321 genNormalsORGANItem.addActionListener(this);
284322 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285323 genNormalsCADItem.addActionListener(this);
324
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
325
+ genNormalsMESHItem.addActionListener(this);
326
+ if (Globals.ADVANCED)
327
+ {
328
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
329
+ genNormalsMINEItem.addActionListener(this);
330
+ }
286331 stripifyItem = menu.add(new MenuItem("Stripify"));
287332 stripifyItem.addActionListener(this);
288333 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +337,6 @@
292337 untrimItem = menu.add(new MenuItem("Untrim"));
293338 untrimItem.addActionListener(this);
294339 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297340 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298341 clearColorsItem.addActionListener(this);
299342 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +349,30 @@
306349 reduce34MeshItem.addActionListener(this);
307350 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308351 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311352 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312353 clipMeshItem.addActionListener(this);
354
+
355
+ if (Globals.ADVANCED)
356
+ {
357
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
358
+ smoothMeshItem.addActionListener(this);
359
+ }
360
+
361
+ oe.menuBar.add(menu = new Menu("Attributes"));
362
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
363
+ clearMaterialsItem.addActionListener(this);
313364 menu.add("-");
314365 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315366 liveleavesItem.addActionListener(this);
316367 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317368 unliveleavesItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
318371 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319372 supportleavesItem.addActionListener(this);
320373 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321374 unsupportleavesItem.addActionListener(this);
375
+ }
322376 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323377 hideleavesItem.addActionListener(this);
324378 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -332,27 +386,18 @@
332386 flipVItem.addActionListener(this);
333387 unflipVItem = menu.add(new MenuItem("Unflip V"));
334388 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
389
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336390 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
391
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338392 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
393
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340394 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
395
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342396 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
397
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344398 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
399
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346400 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);
356401
357402 oe.menuBar.add(menu = new Menu("Selection"));
358403 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +415,33 @@
370415 sortbysizeItem.addActionListener(this);
371416 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372417 sortbynameItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
420
+ menu.add("-");
421
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422
+ extractGeometriesItem.addActionListener(this);
423
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424
+ cloneGeometriesItem.addActionListener(this);
425
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
426
+ shareGeometriesItem.addActionListener(this);
427
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
428
+ mergeGeometriesItem.addActionListener(this);
429
+ }
430
+
373431 oe.menuBar.add(menu = new Menu("Insert"));
374432 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
433
+
434
+ oe.menuBar.add(menu = new Menu("Include"));
435
+ importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
+ importGFDItem.addActionListener(this);
437
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
+ importVRMLX3DItem.addActionListener(this);
439
+ importOBJItem = menu.add(new MenuItem("OBJ Object..."));
440
+ importOBJItem.addActionListener(this);
441
+ import3DSItem = menu.add(new MenuItem("3DS Object..."));
442
+ import3DSItem.addActionListener(this);
443
+
444
+ oe.menuBar.add(menu = new Menu("Tools"));
376445 buildToolsMenu(menu);
377446 }
378447
....@@ -406,150 +475,98 @@
406475 oe.radioPanel.add(dummyButton);
407476 oe.buttonGroup.add(dummyButton);
408477 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
478
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412479
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
480
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
+ liveCB.setToolTipText("Enabled animation");
414482 liveCB.addItemListener(this);
415483
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);
484
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485
+ oneStepButton.setToolTipText("Animate one step forward");
486
+ oneStepButton.addActionListener(this);
487
+
488
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
489
+ fastCB.setToolTipText("Fast mode");
434490 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);
491
+
492
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
493
+ trackCB.setToolTipText("Enable tracking");
476494 trackCB.addItemListener(this);
477495
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
496
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
497
+ screenfitButton.setToolTipText("Screen fit");
480498 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
499
+
482500 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483501 // 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;
488502
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);
503
+ if (Globals.ADVANCED)
504
+ {
505
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
506
+ snapobjectButton.addActionListener(this);
507
+ snapobjectButton.setToolTipText("Snap Object");
508
+ }
509
+
510
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ flashSelectionButton.setToolTipText("Show selection");
495512 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499513
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
514
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515
+
516
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ twoButton.setToolTipText("Show center view only");
502518 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
519
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504520 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
521
+ fourButton.setToolTipText("Show left panel only");
522
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523
+ sixButton.setToolTipText("2-column layout left");
506524 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
+ threeButton.setToolTipText("2-column layout right");
508527 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
528
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
+ sevenButton.setToolTipText("3-column layout");
510530 sevenButton.addActionListener(this);
511531 //
512532
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
533
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ rootButton.setToolTipText("Edit selection in new tab");
514535 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
536
+
537
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
538
+ closeButton.setToolTipText("Close tab");
517539 closeButton.addActionListener(this);
518540 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519541 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521542
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
+ cGridBag commandsPanel = new cGridBag();
544
+
545
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
+ editButton.setToolTipText("Edit selection");
524547 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528548
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
549
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
+ uneditButton.setToolTipText("Unedit selection");
530551 uneditButton.addActionListener(this);
531552
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);
553
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
+ allParamsButton.setToolTipText("Edit all params");
544555 allParamsButton.addActionListener(this);
545556
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);
557
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
558
+ clearPanelButton.setToolTipText("Clear edit panel");
559
+ clearPanelButton.addActionListener(this);
560
+
561
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
562
+ unselectButton.setToolTipText("Unselect");
551563 unselectButton.addActionListener(this);
552564
565
+ commandsPanel.preferredHeight = 1;
566
+
567
+ oe.treePanel.add(commandsPanel);
568
+ oe.treePanel.Return();
569
+
553570 // oe.aConstraints.gridx += 1;
554571 // oe.aConstraints.weighty = 0;
555572 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +578,37 @@
561578 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562579 // gcButton.addActionListener(this);
563580
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;
581
+ cGridBag jSPPanel = new cGridBag();
582
+
583
+ JScrollPane jSP;
575584 //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);
585
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577586 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
587
+
588
+ oe.treePanel.add(jSPPanel);
589
+ oe.treePanel.Return();
582590
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);
591
+ cGridBag copyOptionsPanel = new cGridBag();
592
+
593
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
+ colorCB.setToolTipText("Copy color when dropped");
587595 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
596
+
597
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
+ materialCB.setToolTipText("Copy material when dropped");
590599 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
600
+
601
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
+ textureCB.setToolTipText("Copy texture when dropped");
593603 textureCB.addItemListener(this);
594604
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
605
+ copyOptionsPanel.preferredHeight = 1;
606
+ oe.treePanel.add(copyOptionsPanel);
607
+ oe.treePanel.Return();
597608
609
+// mainPanel.setDividerLocation(0.5); //1.0);
610
+// mainPanel.setResizeWeight(0.5);
611
+
598612 //jList.addListSelectionListener(this);
599613 oe.jTree.addTreeSelectionListener(this);
600614 //jTree.setRootVisible(false);
....@@ -616,17 +630,89 @@
616630 radio.layout = sevenButton;
617631 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618632 }
633
+
634
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
635
+ {
636
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
637
+ boxCB.setToolTipText("Display bounding boxes");
638
+ boxCB.addItemListener(this);
639
+
640
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
641
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642
+ zoomBoxCB.addItemListener(this);
643
+
644
+ if (Globals.ADVANCED)
645
+ {
646
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
+ supportCB.setToolTipText("Enable rigging");
648
+ supportCB.addItemListener(this);
649
+
650
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
651
+ // localCB.addItemListener(this);
652
+
653
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
654
+ crowdCB.setToolTipText("Used for crowds");
655
+ crowdCB.addItemListener(this);
656
+
657
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
658
+ smoothCB.setToolTipText("Snapping delay");
659
+ smoothCB.addItemListener(this);
660
+
661
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
662
+ slowCB.setToolTipText("Smooth interpolation");
663
+ slowCB.addItemListener(this);
664
+
665
+// constraints.gridy += 1;
666
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
667
+// speakerMocapCB.addItemListener(this);
668
+
669
+ if (false)
670
+ {
671
+ // handled in scripts
672
+ //constraints.gridy += 1;
673
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
674
+ speakerCameraCB.addItemListener(this);
675
+
676
+ //constraints.gridy += 1;
677
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
678
+ speakerFocusCB.addItemListener(this);
679
+
680
+ //constraints.gridy += 1;
681
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
682
+ smoothfocusCB.addItemListener(this);
683
+ }
684
+
685
+//constraints.gridx += 1;
686
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
687
+// debugCB.addItemListener(this);
688
+
689
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
690
+ oeilCB.addItemListener(this);
691
+
692
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
693
+ lookAtCB.setToolTipText("Look-at target");
694
+ lookAtCB.addItemListener(this);
695
+
696
+ }
697
+
698
+ cGridBag fill = new cGridBag();
699
+
700
+ fill.preferredHeight = 200;
701
+
702
+ panel.add(fill);
703
+
704
+ }
619705
620706 void EditObject(Object3D obj)
621707 {
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();
708
+ cRadio radioButton = new cRadio(obj.name);
709
+ radioButton.SetObject(obj);
710
+ radioButton.layout = sevenButton;
711
+ radioButton.SetCamera(cameraView.renderCamera, false);
712
+ radioButton.addActionListener(this);
713
+ radioPanel.add(radioButton);
714
+ buttonGroup.add(radioButton);
715
+ radioButton.doClick();
630716 }
631717 void SetupViews(ObjEditor oe)
632718 {
....@@ -646,6 +732,7 @@
646732 JCheckBox fastCB;
647733 JCheckBox slowCB;
648734 JCheckBox boxCB;
735
+ JCheckBox zoomBoxCB;
649736 JCheckBox trackCB;
650737 JCheckBox smoothfocusCB;
651738 // JCheckBox speakerMocapCB;
....@@ -688,8 +775,7 @@
688775 dropAttributes |= Object3D.TEXTURE;
689776 else
690777 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
778
+ } else if(e.getSource() == liveCB)
693779 {
694780 cameraView.ToggleLive();
695781 }
....@@ -726,6 +812,10 @@
726812 Recompile();
727813 cameraView.repaint();
728814 // refreshContents();
815
+ }
816
+ else if(e.getSource() == zoomBoxCB)
817
+ {
818
+ cameraView.ToggleZoomBoxMode();
729819 }
730820 else if(e.getSource() == smoothfocusCB)
731821 {
....@@ -894,11 +984,11 @@
894984 {
895985 loadClipboard(true);
896986 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
987
+ pasteInto(false, false);
898988 } else {
899989 loadClipboard(false);
900990 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
991
+ pasteInto(false, false); // true); // ???
902992 }
903993 }
904994 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1092,8 @@
10021092
10031093 void buildCreateMenu(Menu menu)
10041094 {
1095
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1096
+ //heightFieldItem.addActionListener(this);
10051097 gridItem = menu.add(new MenuItem("Grid"));
10061098 gridItem.addActionListener(this);
10071099 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1106,37 @@
10141106 torusItem.addActionListener(this);
10151107 superItem = menu.add(new MenuItem("Superellipsoid"));
10161108 superItem.addActionListener(this);
1109
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1110
+ kleinItem.addActionListener(this);
10171111 particleItem = menu.add(new MenuItem("Particle system"));
10181112 particleItem.addActionListener(this);
1113
+ if (Globals.ADVANCED)
1114
+ {
10191115 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201116 ragdollItem.addActionListener(this);
10211117 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221118 ragdoll2Item.addActionListener(this);
1119
+ }
10231120 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1121
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251122 meshItem.addActionListener(this);
10261123 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271124 // meshGroupItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10281127 springItem = menu.add(new MenuItem("Spring"));
10291128 springItem.addActionListener(this);
10301129 flagItem = menu.add(new MenuItem("Flag"));
10311130 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);
10361131 blobItem = menu.add(new MenuItem("Blob"));
10371132 blobItem.addActionListener(this);
10381133 latheItem = menu.add(new MenuItem("Lathe"));
10391134 latheItem.addActionListener(this);
1135
+ }
1136
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1137
+ bezierItem.addActionListener(this);
1138
+ overlayItem = menu.add(new MenuItem("Overlay"));
1139
+ overlayItem.addActionListener(this);
10401140 lightItem = menu.add(new MenuItem("Light"));
10411141 lightItem.addActionListener(this);
10421142 menu.add("-");
....@@ -1046,32 +1146,26 @@
10461146 loopItem.addActionListener(this);
10471147 doubleItem = menu.add(new MenuItem("Fork"));
10481148 doubleItem.addActionListener(this);
1149
+ if (Globals.ADVANCED)
1150
+ {
10491151 tripleItem = menu.add(new MenuItem("Trident"));
10501152 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);
1153
+ }
10601154 }
10611155
10621156 void buildToolsMenu(Menu menu)
10631157 {
10641158 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651159 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1160
+ animationItem.setState(Globals.ANIMATION);
10671161
10681162 menu.add("-");
10691163 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701164 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1165
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1166
+ textureFieldItem.addActionListener(this);
1167
+ alignItem = menu.add(new MenuItem("Align Object"));
10721168 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751169 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761170 reduceMorphItem.addActionListener(this);
10771171 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
....@@ -1079,8 +1173,12 @@
10791173
10801174 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811175 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831176
1177
+ if (Globals.ADVANCED)
1178
+ {
1179
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1180
+ mirrorItem.addActionListener(this);
1181
+ menu.add("-");
10841182 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851183 memoryItem.addActionListener(this);
10861184 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1094,6 +1192,8 @@
10941192 resetParentItem.addActionListener(this);
10951193 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961194 repairParentItem.addActionListener(this);
1195
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1196
+ repairShadowItem.addActionListener(this);
10971197 menu.add(invariantsItem = new MenuItem("Invariants"));
10981198 invariantsItem.addActionListener(this);
10991199 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1201,7 @@
11011201 menu.add("-");
11021202 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031203 editScriptItem.addActionListener(this);
1204
+ }
11041205 }
11051206
11061207 void ScreenFit()
....@@ -1429,9 +1530,9 @@
14291530
14301531 void Overwrite(int mask)
14311532 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1533
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14331534 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1535
+ Object3D content = GrafreeD.clipboard.get(0);
14351536
14361537 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371538 content = ((cGroup)content).get(0);
....@@ -1454,6 +1555,7 @@
14541555 //
14551556 public void actionPerformed(ActionEvent event) // , Object arg)
14561557 {
1558
+ Object source = event.getSource();
14571559 /*
14581560 if (event.getSource() == nameField)
14591561 {
....@@ -1465,11 +1567,11 @@
14651567 }
14661568 else
14671569 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1570
+ if (source == lookAtItem || source == lookFromItem)
14691571 {
14701572 ScreenFit();
14711573 } else
1472
- if (event.getSource() == switchItem)
1574
+ if (source == switchItem)
14731575 {
14741576 cVector v1 = new cVector();
14751577 cVector v2 = new cVector();
....@@ -1478,11 +1580,11 @@
14781580 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791581 objEditor.cameraView.repaint();
14801582 } else
1481
- if (event.getSource() == rectoidItem)
1583
+ if (source == rectoidItem)
14821584 {
14831585 makeSomething(new Box());
14841586 } else
1485
- if (event.getSource() == particleItem)
1587
+ if (source == particleItem)
14861588 {
14871589 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881590 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1605,9 @@
15031605 applyExample(particleGeom, "SMOKE");
15041606 makeSomething(particleGeom);
15051607 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1608
+ if (source == ragdollItem || source == ragdoll2Item)
15071609 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1610
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091611
15101612 ragdoll.toParent = LA.newMatrix();
15111613 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1623,71 @@
15211623 makeSomething(ragdoll);
15221624 //makeSomething(new VehicleDemo());
15231625 } else
1524
- if (event.getSource() == gridItem)
1626
+ /*
1627
+ */
1628
+ if (source == heightFieldItem)
1629
+ {
1630
+ Object3D obj = new Object3D();
1631
+
1632
+ obj.CreateMaterial();
1633
+ obj.bRep = new BoundaryRep();
1634
+
1635
+ obj.bRep.CreateMesh(new iHeightField()
1636
+ {
1637
+ public double f(double x, double y)
1638
+ {
1639
+ // The Mandelbrot set is represented by coloring
1640
+ // each point (x,y) according to the number of
1641
+ // iterations it takes before the while loop in
1642
+ // this method ends. For points that are actually
1643
+ // in the Mandelbrot set, or very close to it, the
1644
+ // count will reach the maximum value, 80. These
1645
+ // points will be colored purple. All other colors
1646
+ // represent points that are definitely NOT in the set.
1647
+ x -= 600;
1648
+ y -= 500;
1649
+ x /= 200;
1650
+ y /= 200;
1651
+ int count = 0;
1652
+ double zx = x;
1653
+ double zy = y;
1654
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1655
+ double new_zx = zx*zx - zy*zy + x;
1656
+ zy = 2*zx*zy + y;
1657
+ zx = new_zx;
1658
+ count++;
1659
+ }
1660
+ return count; // Math.sqrt(count);
1661
+ }
1662
+ }, 1000,1000);
1663
+
1664
+ makeSomething(obj);
1665
+ } else
1666
+ if (source == gridItem)
15251667 {
15261668 makeSomething(new Grid());
15271669 } else
1528
- if (event.getSource() == ellipsoidItem)
1670
+ if (source == ellipsoidItem)
15291671 {
15301672 makeSomething(new Sphere());
15311673 } else
1532
- if (event.getSource() == coneItem)
1674
+ if (source == coneItem)
15331675 {
15341676 makeSomething(new Cone());
15351677 } else
1536
- if (event.getSource() == torusItem)
1678
+ if (source == torusItem)
15371679 {
15381680 makeSomething(new Torus());
15391681 } else
1540
- if (event.getSource() == superItem)
1682
+ if (source == superItem)
15411683 {
15421684 makeSomething(new Superellipsoid());
15431685 } else
1544
- if (event.getSource() == blobItem)
1686
+ if (source == kleinItem)
1687
+ {
1688
+ makeSomething(new Klein());
1689
+ } else
1690
+ if (source == blobItem)
15451691 {
15461692 Blob blob = new Blob();
15471693 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1695,15 @@
15491695 //blob.retile();
15501696 makeSomething(blob);
15511697 } else
1552
- if (event.getSource() == latheItem)
1698
+ if (source == latheItem)
15531699 {
15541700 makeSomething(new Lathe());
15551701 } else
1556
- if (event.getSource() == bezierItem)
1702
+ if (source == bezierItem)
15571703 {
15581704 makeSomething(new BezierSurface());
15591705 } else
1560
- if (event.getSource() == checkerItem)
1706
+ if (source == overlayItem)
15611707 {
15621708 /*
15631709 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1716,9 @@
15701716 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711717 LA.matInvert(obj.toParent, obj.fromParent);
15721718 */
1573
- makeSomething(new CheckerIG());
1719
+ makeSomething(new Checker());
15741720 } else
1575
- if (event.getSource() == meshItem)
1721
+ if (source == meshItem)
15761722 {
15771723 Object3D itemtomake = new Object3D();
15781724 Object3D child;
....@@ -1593,35 +1739,35 @@
15931739 makeSomething(child);
15941740 }
15951741 } else
1596
- if (event.getSource() == springItem)
1742
+ if (source == springItem)
15971743 {
15981744 cSpring s = new cSpring();
15991745 s.setup();
16001746 makeSomething(s);
16011747 } else
1602
- if (event.getSource() == flagItem)
1748
+ if (source == flagItem)
16031749 {
16041750 cSpring s = new cFlag();
16051751 s.setup();
16061752 makeSomething(s);
16071753 } else
1608
- if (event.getSource() == lightItem)
1754
+ if (source == lightItem)
16091755 {
16101756 makeSomething(new Light());
16111757 } else
1612
- if (event.getSource() == csgItem)
1758
+ if (source == csgItem)
16131759 {
16141760 group(new CSG());
16151761 } else
1616
- if (event.getSource() == templateItem)
1762
+ if (source == templateItem)
16171763 {
16181764 group(new cTemplate());
16191765 } else
1620
- if (event.getSource() == attributeItem)
1766
+ if (source == attributeItem)
16211767 {
16221768 makeSomething(new Attribute());
16231769 } else
1624
- if (event.getSource() == pointflowItem)
1770
+ if (source == pointflowItem)
16251771 {
16261772 makeSomething(new PointFlow());
16271773 } else
....@@ -1633,7 +1779,7 @@
16331779 } else
16341780 */
16351781
1636
- if (event.getSource() == superLoopItem)
1782
+ if (source == superLoopItem)
16371783 {
16381784 Composite g = new cGroup();
16391785 for (int i=0; i<15; i++)
....@@ -1655,7 +1801,7 @@
16551801
16561802 group(g);
16571803 } else
1658
- if (event.getSource() == loopItem)
1804
+ if (source == loopItem)
16591805 {
16601806 Composite csg = new GroupLeaf();
16611807 csg.count = 5;
....@@ -1664,7 +1810,7 @@
16641810 csg.addChild(child);
16651811 child.addChild(csg);
16661812 } else
1667
- if (event.getSource() == doubleItem)
1813
+ if (source == doubleItem)
16681814 {
16691815 Composite csg = new GroupLeaf();
16701816 csg.count = 5;
....@@ -1676,7 +1822,7 @@
16761822 csg.addChild(child);
16771823 child.addChild(csg);
16781824 } else
1679
- if (event.getSource() == tripleItem)
1825
+ if (source == tripleItem)
16801826 {
16811827 Composite csg = new GroupLeaf();
16821828 csg.count = 4;
....@@ -1692,70 +1838,75 @@
16921838 child.addChild(csg);
16931839 } else
16941840
1695
- if (event.getSource() == importGFDItem)
1841
+ if (source == importGFDItem)
16961842 {
16971843 ImportGFD();
16981844 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1845
+ if (source == importVRMLX3DItem)
17001846 {
17011847 ImportVRMLX3D();
17021848 } else
1703
- if (event.getSource() == import3DSItem)
1849
+ if (source == import3DSItem)
17041850 {
17051851 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17061852 } else
1707
- if (event.getSource() == importOBJItem)
1853
+ if (source == importOBJItem)
17081854 {
17091855 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17101856 } else
1711
- if (event.getSource() == computeAOItem)
1857
+ if (source == computeAOItem)
17121858 {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1859
+ Globals.drawMode = CameraPane.OCCLUSION;
1860
+ Globals.theRenderer.repaint();
17151861 } else
1716
- if (event.getSource() == recompileItem)
1862
+ if (source == recompileItem)
17171863 {
17181864 Recompile();
17191865 refreshContents();
17201866 } else
1721
- if (event.getSource() == editScriptItem)
1867
+ if (source == editScriptItem)
17221868 {
17231869 OpenDialog();
17241870 refreshContents();
17251871 } else
1726
- if (event.getSource() == invariantsItem)
1872
+ if (source == invariantsItem)
17271873 {
17281874 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1875
+ GrafreeD.grafreeD.universe.invariants();
17301876 } else
1731
- if (event.getSource() == memoryItem)
1877
+ if (source == memoryItem)
17321878 {
17331879 //System.out.println("Invariants:");
17341880 PrintMemory();
17351881 } else
1736
- if (event.getSource() == pathItem)
1882
+ if (source == pathItem)
17371883 {
17381884 PrintPath();
17391885 } else
1740
- if (event.getSource() == analyzeItem)
1886
+ if (source == analyzeItem)
17411887 {
17421888 AnalyzeObject();
17431889 } else
1744
- if (event.getSource() == dumpItem)
1890
+ if (source == dumpItem)
17451891 {
17461892 DumpObject();
17471893 } else
1748
- if (event.getSource() == screenfitButton)
1894
+ if (source == oneStepButton)
1895
+ {
1896
+ Globals.ONESTEP = true;
1897
+ cameraView.repaint();
1898
+ } else
1899
+ if (source == screenfitButton)
17491900 {
17501901 //Reload(lastConverter, lastFilename, true);
17511902 ScreenFit();
17521903 } else
1753
- if (event.getSource() == screenfitpointButton)
1904
+ if (source == screenfitpointButton)
17541905 {
17551906 //Reload(lastConverter, lastFilename, true);
17561907 ScreenFitPoint();
17571908 } else
1758
- if (event.getSource() == snapobjectButton)
1909
+ if (source == snapobjectButton)
17591910 {
17601911 //Reload(lastConverter, lastFilename, true);
17611912 SnapObject();
....@@ -1766,13 +1917,13 @@
17661917 // Recompile();
17671918 // refreshContents();
17681919 // } else
1769
- if (event.getSource() == gcButton)
1920
+ if (source == gcButton)
17701921 {
17711922 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17721923 System.gc();
17731924 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17741925 } else
1775
- if (event.getSource() == editLeafItem)
1926
+ if (source == editLeafItem)
17761927 {
17771928 Object3D obj;
17781929 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +1937,70 @@
17861937 }
17871938 refreshContents(true);
17881939 } else
1789
- if (event.getSource() == openWindowItem)
1940
+ if (source == openWindowItem)
17901941 {
17911942 EditSelection(true);
17921943 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1944
+ if (source == cutItem || source == clearButton)
17941945 {
17951946 loadClipboard(true);
17961947 } else
1797
- if (event.getSource() == duplicateItem)
1948
+ if (source == duplicateItem)
17981949 {
1799
- Object3D keep = GraphreeD.clipboard;
1950
+ Object3D keep = GrafreeD.clipboard;
18001951 loadClipboard(false);
18011952 paste(false);
1802
- GraphreeD.clipboard = keep;
1953
+ GrafreeD.clipboard = keep;
18031954 } else
1804
- if (event.getSource() == cloneItem)
1955
+ if (source == cloneItem)
18051956 {
18061957 CloneSelection(false);
18071958 } else
1808
- if (event.getSource() == cloneSupportItem)
1959
+ if (source == cloneSupportItem)
18091960 {
18101961 CloneSelection(true);
18111962 } else
1812
- if (event.getSource() == copyItem)
1963
+ if (source == copyItem)
18131964 {
18141965 loadClipboard(false);
18151966 } else
1816
- if (event.getSource() == pasteItem)
1967
+ if (source == pasteItem)
18171968 {
18181969 paste(false);
18191970 } else
1820
- if (event.getSource() == pasteLinkItem)
1971
+ if (source == pasteIntoItem)
18211972 {
1822
- pasteInto(false);
1973
+ pasteInto(true, false);
18231974 } else
1824
- if (event.getSource() == pasteCloneItem)
1975
+ if (source == pasteLinkItem)
18251976 {
1826
- pasteInto(true);
1977
+ pasteInto(false, false);
18271978 } else
1828
- if (event.getSource() == pasteExpandItem)
1979
+ if (source == pasteCloneItem)
1980
+ {
1981
+ pasteInto(true, true);
1982
+ } else
1983
+ if (source == pasteExpandItem)
18291984 {
18301985 paste(true);
18311986 } else
1832
- if (event.getSource() == synchronizeItem)
1987
+ if (source == synchronizeItem)
18331988 {
18341989 Overwrite(Object3D.TRANSFORM);
18351990 } else
1836
- if (event.getSource() == overwriteNameItem)
1991
+ if (source == overwriteNameItem)
18371992 {
18381993 Overwrite(Object3D.NAME);
18391994 } else
1840
- if (event.getSource() == overwriteUVItem)
1995
+ if (source == overwriteUVItem)
18411996 {
18421997 Overwrite(Object3D.UV);
18431998 } else
1844
- if (event.getSource() == overwriteMatItem)
1999
+ if (source == overwriteMatItem)
18452000 {
2001
+ /* july 2015
18462002 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2003
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482004 else
18492005 {
18502006 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2012,16 @@
18562012 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572013 }
18582014 }
2015
+ */
2016
+
2017
+ Overwrite(dropAttributes);
18592018 }
1860
- if (event.getSource() == overwriteGeoItem)
2019
+ if (source == overwriteGeoItem)
18612020 {
18622021 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2022
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642023 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2024
+// Object3D content = GrafreeD.clipboard.get(0);
18662025 //
18672026 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682027 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2033,7 @@
18742033 // refreshContents();
18752034 // }
18762035 } else
1877
- if (event.getSource() == generateMeshItem)
2036
+ if (source == generateMeshItem)
18782037 {
18792038 //if (group.selection.size() == 1)
18802039 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2044,7 @@
18852044 ResetModel();
18862045 refreshContents();
18872046 } else
1888
- if (event.getSource() == extractGeometriesItem)
2047
+ if (source == extractGeometriesItem)
18892048 {
18902049 boolean one = false;
18912050
....@@ -1912,7 +2071,7 @@
19122071 ResetModel();
19132072 refreshContents();
19142073 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2074
+ if (source == cloneGeometriesItem)
19162075 {
19172076 boolean one = false;
19182077
....@@ -1938,32 +2097,37 @@
19382097 ResetModel();
19392098 refreshContents();
19402099 } else
1941
- if (event.getSource() == shareGeometriesItem)
2100
+ if (source == shareGeometriesItem)
19422101 {
19432102 boolean one = false;
19442103
19452104 if (group.selection.size() == 1)
19462105 one = true;
19472106
2107
+ Object3D merge = null;
2108
+
19482109 Object3D content = new cGroup();
19492110
19502111 for (int i=0; i<group.selection.size(); i++)
19512112 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2113
+ merge = new Merge(group.selection.get(i));
19532114
19542115 if (one)
1955
- makeSomething(sel, false);
2116
+ makeSomething(merge, false);
19562117 else
1957
- content.addChild(sel);
2118
+ content.addChild(merge);
19582119 }
19592120
19602121 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2122
+ makeSomething(content, true);
2123
+ else
2124
+ {
2125
+ ResetModel();
2126
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2127
+ refreshContents();
2128
+ }
19652129 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2130
+ if (source == mergeGeometriesItem)
19672131 {
19682132 boolean one = false;
19692133
....@@ -1993,11 +2157,11 @@
19932157 ResetModel();
19942158 refreshContents();
19952159 } else
1996
- if (event.getSource() == linkverticesItem)
2160
+ if (source == linkverticesItem)
19972161 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2162
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992163 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2164
+// Object3D content = GrafreeD.clipboard.get(0);
20012165 //
20022166 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032167 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2170,48 @@
20062170 // group.selection.get(0).setMasterThis(content); // should be identity
20072171 // refreshContents();
20082172 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2173
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20102174 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2175
+ Object3D content = GrafreeD.clipboard.get(0);
20122176
20132177 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142178 content = ((cGroup)content).get(0);
20152179
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2180
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172181 for (int i=0; i<group.selection.size(); i++)
20182182 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2183
+ boolean random = CameraPane.SWITCH;
2184
+ CameraPane.SWITCH = false; // parse all random nodes
20212185 group.selection.get(i).linkVerticesThis(content);
20222186 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2187
+ CameraPane.SWITCH = random;
20242188 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2189
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262190 refreshContents();
20272191 }
20282192 } else
2029
- if (event.getSource() == resetsupportItem)
2193
+ if (source == resetsupportItem)
20302194 {
20312195 for (int i=0; i<group.selection.size(); i++)
20322196 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2197
+ boolean random = CameraPane.SWITCH;
2198
+ CameraPane.SWITCH = false; // parse all random nodes
20352199 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2200
+ CameraPane.SWITCH = random;
20372201 }
20382202
20392203 refreshContents();
20402204 } else
2041
- if (event.getSource() == resetreferencesItem)
2205
+ if (source == relinkverticesItem)
2206
+ {
2207
+ boolean random = CameraPane.SWITCH;
2208
+ CameraPane.SWITCH = false; // parse all random nodes
2209
+ group.selection.RelinkToSupport();
2210
+ CameraPane.SWITCH = random;
2211
+
2212
+ refreshContents();
2213
+ } else
2214
+ if (source == resetreferencesItem)
20422215 {
20432216 for (int i=0; i<group.selection.size(); i++)
20442217 {
....@@ -2047,11 +2220,11 @@
20472220
20482221 refreshContents();
20492222 } else
2050
- if (event.getSource() == setMasterItem)
2223
+ if (source == setMasterItem)
20512224 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2225
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20532226 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2227
+ Object3D content = GrafreeD.clipboard.get(0);
20552228
20562229 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572230 content = ((cGroup)content).get(0);
....@@ -2060,13 +2233,13 @@
20602233 refreshContents();
20612234 }
20622235 } else
2063
- if (event.getSource() == poseMeshItem)
2236
+ if (source == poseMeshItem)
20642237 {
20652238 if (group.selection.size() == 1)
20662239 {
2067
- if (GraphreeD.clipboard.size() == 1)
2240
+ if (GrafreeD.clipboard.size() == 1)
20682241 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2242
+ Object3D content = GrafreeD.clipboard.get(0);
20702243
20712244 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722245 content = ((cGroup)content).get(0);
....@@ -2079,19 +2252,19 @@
20792252 }
20802253
20812254 } else
2082
- if (event.getSource() == revertMeshItem)
2255
+ if (source == revertMeshItem)
20832256 {
20842257 RevertMeshes();
20852258 } else
2086
- if (event.getSource() == resetMeshItem)
2259
+ if (source == resetMeshItem)
20872260 {
20882261 ResetAll();
20892262 } else
2090
- if (event.getSource() == stepAllItem)
2263
+ if (source == stepAllItem)
20912264 {
20922265 StepAll();
20932266 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2267
+ if (source == clearItem) // || event.getSource() == clearButton)
20952268 {
20962269 //int indices[] = jList.getSelectedIndices();
20972270 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2272,46 @@
20992272
21002273 ClearSelection(false);
21012274 } else
2102
- if (event.getSource() == clearAllItem)
2275
+ if (source == clearAllItem)
21032276 {
21042277 ClearSelection(true);
21052278 } else
2106
- if (event.getSource() == grabItem)
2279
+ if (source == grabItem)
21072280 {
21082281 group(new cGroup(), true);
21092282 } else
2110
- if (event.getSource() == frontItem)
2283
+ if (source == hideItem)
2284
+ {
2285
+ group(new HiddenObject());
2286
+ } else
2287
+ if (source == frontItem)
21112288 {
21122289 front();
21132290 } else
2114
- if (event.getSource() == backItem)
2291
+ if (source == backItem)
21152292 {
21162293 back();
21172294 } else
2118
- if (event.getSource() == cameraItem)
2295
+ if (source == cameraItem)
21192296 {
21202297 makeSomething(new Camera());
21212298 } else
2122
- if (event.getSource() == compositeItem)
2299
+ if (source == compositeItem)
21232300 {
21242301 group(new Composite());
21252302 } else
2126
- if (event.getSource() == randomItem)
2303
+ if (source == randomItem)
21272304 {
21282305 RandomNode random = new RandomNode();
21292306 group(random);
21302307 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2308
+ random.name = random.get(0).name + "Switch";
21322309 } else
2133
- if (event.getSource() == physicsItem)
2310
+ if (source == physicsItem)
21342311 {
21352312 group(new PhysicsNode());
21362313 } else
2137
- if (event.getSource() == frameselectorItem)
2314
+ if (source == frameselectorItem)
21382315 {
21392316 for (int i=0; i<group.selection.size(); i++)
21402317 {
....@@ -2146,7 +2323,7 @@
21462323 ResetModel();
21472324 refreshContents();
21482325 } else
2149
- if (event.getSource() == switchGeoItem)
2326
+ if (source == switchGeoItem)
21502327 {
21512328 for (int i=0; i<group.selection.size(); i++)
21522329 {
....@@ -2158,7 +2335,7 @@
21582335 ResetModel();
21592336 refreshContents();
21602337 } else
2161
- if (event.getSource() == switchTransfoItem)
2338
+ if (source == switchTransfoItem)
21622339 {
21632340 for (int i=0; i<group.selection.size(); i++)
21642341 {
....@@ -2170,7 +2347,7 @@
21702347 ResetModel();
21712348 refreshContents();
21722349 } else
2173
- if (event.getSource() == morphItem)
2350
+ if (source == morphItem)
21742351 {
21752352 for (int i=0; i<group.selection.size(); i++)
21762353 {
....@@ -2182,7 +2359,7 @@
21822359 ResetModel();
21832360 refreshContents();
21842361 } else
2185
- if (event.getSource() == scriptNodeItem)
2362
+ if (source == scriptNodeItem)
21862363 {
21872364 boolean atleastone = false;
21882365
....@@ -2221,191 +2398,215 @@
22212398 }
22222399 }
22232400 } else
2224
- if (event.getSource() == linkerItem)
2401
+ if (source == linkerItem)
22252402 {
22262403 group(new cLinker());
22272404 } else
2228
- if (event.getSource() == textureItem)
2405
+ if (source == textureItem)
22292406 {
22302407 group(new TextureNode());
22312408 } else
2232
- if (event.getSource() == shadowXItem)
2409
+ if (source == billboardItem)
2410
+ {
2411
+ group(new BillboardNode());
2412
+ } else
2413
+ if (source == shadowXItem)
22332414 {
22342415 CastShadow(0);
22352416 } else
2236
- if (event.getSource() == shadowYItem)
2417
+ if (source == shadowYItem)
22372418 {
22382419 CastShadow(1);
22392420 } else
2240
- if (event.getSource() == shadowZItem)
2421
+ if (source == shadowZItem)
22412422 {
22422423 CastShadow(2);
22432424 } else
2244
- if (event.getSource() == ungroupItem)
2425
+ if (source == ungroupItem)
22452426 {
2246
- ungroup();
2427
+ //ungroup();
2428
+ for (int i=0; i<group.selection.size(); i++)
2429
+ {
2430
+ Ungroup(group.selection.get(i));
2431
+ }
2432
+
2433
+ ClearSelection(false);
2434
+
2435
+ refreshContents();
22472436 } else
2248
- if (event.getSource() == genUVItem)
2437
+ if (source == genUVItem)
22492438 {
22502439 GenUV();
22512440 } else
2252
- if (event.getSource() == genNormalsCADItem)
2441
+ if (source == genNormalsCADItem)
22532442 {
22542443 GenNormals(true);
22552444 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2445
+ if (source == genNormalsMESHItem)
2446
+ {
2447
+ GenNormals(true); // TODO
2448
+ } else
2449
+ if (source == genNormalsORGANItem)
22572450 {
22582451 GenNormals(false);
22592452 } else
2260
- if (event.getSource() == stripifyItem)
2453
+ if (source == genNormalsMINEItem)
2454
+ {
2455
+ GenNormalsMINE();
2456
+ } else
2457
+ if (source == stripifyItem)
22612458 {
22622459 Stripify();
22632460 } else
2264
- if (event.getSource() == unstripifyItem)
2461
+ if (source == unstripifyItem)
22652462 {
22662463 Unstripify();
22672464 } else
2268
- if (event.getSource() == trimItem)
2465
+ if (source == trimItem)
22692466 {
22702467 Trim();
22712468 } else
2272
- if (event.getSource() == untrimItem)
2469
+ if (source == untrimItem)
22732470 {
22742471 Untrim();
22752472 } else
2276
- if (event.getSource() == clearColorsItem)
2473
+ if (source == clearColorsItem)
22772474 {
22782475 ClearColors();
22792476 } else
2280
- if (event.getSource() == clearMaterialsItem)
2477
+ if (source == clearMaterialsItem)
22812478 {
22822479 ClearMaterials();
22832480 } else
2284
- if (event.getSource() == liveleavesItem)
2481
+ if (source == liveleavesItem)
22852482 {
22862483 LiveLeaves(true);
22872484 } else
2288
- if (event.getSource() == unliveleavesItem)
2485
+ if (source == unliveleavesItem)
22892486 {
22902487 LiveLeaves(false);
22912488 } else
2292
- if (event.getSource() == supportleavesItem)
2489
+ if (source == supportleavesItem)
22932490 {
22942491 SupportLeaves(true);
22952492 } else
2296
- if (event.getSource() == unsupportleavesItem)
2493
+ if (source == unsupportleavesItem)
22972494 {
22982495 SupportLeaves(false);
22992496 } else
2300
- if (event.getSource() == hideleavesItem)
2497
+ if (source == hideleavesItem)
23012498 {
23022499 HideLeaves(true);
23032500 } else
2304
- if (event.getSource() == showleavesItem)
2501
+ if (source == showleavesItem)
23052502 {
23062503 HideLeaves(false);
23072504 } else
2308
- if (event.getSource() == markleavesItem)
2505
+ if (source == markleavesItem)
23092506 {
23102507 MarkLeaves(true);
23112508 } else
2312
- if (event.getSource() == unmarkleavesItem)
2509
+ if (source == unmarkleavesItem)
23132510 {
23142511 MarkLeaves(false);
23152512 } else
2316
- if (event.getSource() == flipVItem)
2513
+ if (source == flipVItem)
23172514 {
23182515 FlipV(true);
23192516 } else
2320
- if (event.getSource() == unflipVItem)
2517
+ if (source == unflipVItem)
23212518 {
23222519 FlipV(false);
23232520 } else
2324
- if (event.getSource() == lowTexturesItem)
2521
+ if (source == lowTexturesItem)
23252522 {
23262523 SetTexRes(0);
23272524 } else
2328
- if (event.getSource() == normalTexturesItem)
2525
+ if (source == normalTexturesItem)
23292526 {
23302527 SetTexRes(1);
23312528 } else
2332
- if (event.getSource() == highTexturesItem)
2529
+ if (source == highTexturesItem)
23332530 {
23342531 SetTexRes(2);
23352532 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2533
+ if (source == veryhighTexturesItem)
23372534 {
23382535 SetTexRes(3);
23392536 } else
2340
- if (event.getSource() == maxTexturesItem)
2537
+ if (source == maxTexturesItem)
23412538 {
23422539 SetTexRes(4);
23432540 } else
2344
- if (event.getSource() == panoTexturesItem)
2541
+ if (source == panoTexturesItem)
23452542 {
23462543 SetTexRes(5);
23472544 } else
2348
- if (event.getSource() == reverseNormalsItem)
2545
+ if (source == reverseNormalsItem)
23492546 {
23502547 ReverseNormals();
23512548 } else
2352
- if (event.getSource() == parseverticesItem)
2549
+ if (source == parseverticesItem)
23532550 {
23542551 ParseVertices();
23552552 } else
2356
- if (event.getSource() == alignItem)
2553
+ if (source == textureFieldItem)
2554
+ {
2555
+ TextureVertices();
2556
+ } else
2557
+ if (source == alignItem)
23572558 {
23582559 Align();
23592560 } else
2360
- if (event.getSource() == mirrorItem)
2561
+ if (source == mirrorItem)
23612562 {
23622563 MirrorPoses();
23632564 } else
2364
- if (event.getSource() == reduceMorphItem)
2565
+ if (source == reduceMorphItem)
23652566 {
23662567 MeshReduction(false);
23672568 } else
2368
- if (event.getSource() == reduce34MorphItem)
2569
+ if (source == reduce34MorphItem)
23692570 {
23702571 MeshReduction(true);
23712572 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2573
+ if (source == reverseTrianglesItem)
23732574 {
23742575 ReverseTriangles();
23752576 } else
2376
- if (event.getSource() == reduceMeshItem)
2577
+ if (source == reduceMeshItem)
23772578 {
23782579 ReduceMesh(false);
23792580 } else
2380
- if (event.getSource() == reduce34MeshItem)
2581
+ if (source == reduce34MeshItem)
23812582 {
23822583 ReduceMesh(true);
23832584 } else
2384
- if (event.getSource() == increaseMeshItem)
2585
+ if (source == increaseMeshItem)
23852586 {
23862587 IncreaseMesh();
23872588 } else
2388
- if (event.getSource() == clipMeshItem)
2589
+ if (source == clipMeshItem)
23892590 {
23902591 ClipMesh();
23912592 } else
2392
- if (event.getSource() == smoothMeshItem)
2593
+ if (source == smoothMeshItem)
23932594 {
23942595 SmoothMesh();
23952596 } else
2396
- if (event.getSource() == transformgeometryItem)
2597
+ if (source == transformgeometryItem)
23972598 {
23982599 TransformGeometry();
23992600 } else
2400
- if (event.getSource() == resetTransformItem)
2601
+ if (source == resetTransformItem)
24012602 {
24022603 ResetTransform();
24032604 } else
2404
- if (event.getSource() == resetCentroidItem)
2605
+ if (source == resetCentroidItem)
24052606 {
24062607 ResetCentroid();
24072608 } else
2408
- if (event.getSource() == resetParentItem)
2609
+ if (source == resetParentItem)
24092610 {
24102611 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112612 {
....@@ -2415,7 +2616,7 @@
24152616
24162617 refreshContents();
24172618 } else
2418
- if (event.getSource() == repairParentItem)
2619
+ if (source == repairParentItem)
24192620 {
24202621 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212622 {
....@@ -2429,7 +2630,21 @@
24292630
24302631 refreshContents();
24312632 } else
2432
- if (event.getSource() == sortbysizeItem)
2633
+ if (source == repairShadowItem)
2634
+ {
2635
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2636
+ {
2637
+ Object3D obj = (Object3D)e.nextElement();
2638
+ obj.RepairShadow();
2639
+// for (int i=0; i<obj.size(); i++)
2640
+// {
2641
+// obj.get(i).parent = obj;
2642
+// }
2643
+ }
2644
+
2645
+ refreshContents();
2646
+ } else
2647
+ if (source == sortbysizeItem)
24332648 {
24342649 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352650 {
....@@ -2441,7 +2656,7 @@
24412656 ResetModel();
24422657 refreshContents();
24432658 } else
2444
- if (event.getSource() == sortbynameItem)
2659
+ if (source == sortbynameItem)
24452660 {
24462661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472662 {
....@@ -2453,7 +2668,7 @@
24532668 ResetModel();
24542669 refreshContents();
24552670 } else
2456
- if (event.getSource() == attachPigmentItem)
2671
+ if (source == attachPigmentItem)
24572672 {
24582673 String texture = GetFile("Attach pigment");
24592674 Object3D obj;
....@@ -2465,7 +2680,7 @@
24652680
24662681 refreshContents();
24672682 } else
2468
- if (event.getSource() == detachPigmentItem)
2683
+ if (source == detachPigmentItem)
24692684 {
24702685 Object3D obj;
24712686 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2691,7 @@
24762691
24772692 refreshContents();
24782693 } else
2479
- if (event.getSource() == attachBumpItem)
2694
+ if (source == attachBumpItem)
24802695 {
24812696 String texture = GetFile("Attach bump");
24822697 Object3D obj;
....@@ -2488,7 +2703,7 @@
24882703
24892704 refreshContents();
24902705 } else
2491
- if (event.getSource() == detachBumpItem)
2706
+ if (source == detachBumpItem)
24922707 {
24932708 Object3D obj;
24942709 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2714,7 @@
24992714
25002715 refreshContents();
25012716 } else
2502
- if (event.getSource() == pigmentBumpItem)
2717
+ if (source == pigmentBumpItem)
25032718 {
25042719 Object3D obj;
25052720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2725,195 @@
25102725
25112726 refreshContents();
25122727 } else
2513
- if (event.getSource() == flashSelectionButton)
2728
+ if (source == flashSelectionButton)
25142729 {
25152730 CameraPane.flash = true;
25162731 refreshContents();
25172732 } else
2518
- if (event.getSource() == oneButton)
2733
+ if (source == oneButton)
25192734 {
25202735 } else
2521
- if (event.getSource() == twoButton)
2736
+ if (source == twoButton)
25222737 {
25232738 radio.layout = twoButton;
25242739 // bug
25252740 //gridPanel.setDividerLocation(1.0);
25262741 //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();
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2750
+// aWindowConstraints.weightx = 0;
2751
+// aWindowConstraints.weighty = 1;
2752
+// //bigThree.add(jtp, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// bigThree.add(centralPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// scenePanel.setVisible(false);
2766
+// centralPanel.setVisible(true);
2767
+// XYZPanel.setVisible(false);
2768
+ bigThree.ClearUI();
2769
+ bigThree.add(centralPanel);
2770
+ bigThree.FlushUI();
25512771 } else
2552
- if (event.getSource() == threeButton)
2772
+ if (source == threeButton)
25532773 {
25542774 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();
2775
+
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// bigThree.add(XYZPanel, aWindowConstraints);
2799
+// bigThree.validate();
2800
+// scenePanel.setVisible(false);
2801
+// centralPanel.setVisible(true);
2802
+// XYZPanel.setVisible(true);
2803
+ bigThree.ClearUI();
2804
+ bigThree.add(centralPanel);
2805
+ bigThree.add(XYZPanel);
2806
+ bigThree.FlushUI();
25792807 } else
2580
- if (event.getSource() == fourButton)
2808
+ if (source == fourButton)
25812809 {
25822810 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();
2811
+
2812
+// bigThree.remove(scenePanel);
2813
+// bigThree.remove(centralPanel);
2814
+// bigThree.remove(XYZPanel);
2815
+// aWindowConstraints.gridx = 0;
2816
+// aWindowConstraints.gridy = 0;
2817
+// aWindowConstraints.gridwidth = 1;
2818
+// // aWindowConstraints.gridheight = 3;
2819
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.weighty = 1;
2822
+// bigThree.add(scenePanel, aWindowConstraints);
2823
+// aWindowConstraints.weightx = 1;
2824
+// aWindowConstraints.gridwidth = 3;
2825
+// // aConstraints.gridheight = 3;
2826
+// aWindowConstraints.gridx = 1;
2827
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2828
+// //bigThree.add(cameraPanel, aWindowConstraints);
2829
+// aWindowConstraints.weightx = 0;
2830
+// aWindowConstraints.gridx = 4;
2831
+// aWindowConstraints.gridwidth = 1;
2832
+// // aWindowConstraints.gridheight = 3;
2833
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2834
+// //bigThree.add(XYZPanel, aWindowConstraints);
2835
+// bigThree.validate();
2836
+// scenePanel.setVisible(true);
2837
+// centralPanel.setVisible(false);
2838
+// XYZPanel.setVisible(false);
2839
+ bigThree.ClearUI();
2840
+ bigThree.add(scenePanel);
2841
+ bigThree.FlushUI();
26072842 } else
2608
- if (event.getSource() == sixButton)
2843
+ if (source == sixButton)
26092844 {
26102845 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();
2846
+
2847
+// bigThree.remove(scenePanel);
2848
+// bigThree.remove(centralPanel);
2849
+// bigThree.remove(XYZPanel);
2850
+// aWindowConstraints.gridx = 0;
2851
+// aWindowConstraints.gridy = 0;
2852
+// aWindowConstraints.gridwidth = 1;
2853
+// // aConstraints.gridheight = 3;
2854
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2855
+// aWindowConstraints.weightx = 0;
2856
+// aWindowConstraints.weighty = 1;
2857
+// bigThree.add(scenePanel, aWindowConstraints);
2858
+// aWindowConstraints.weightx = 1;
2859
+// aWindowConstraints.gridwidth = 3;
2860
+// // aWindowConstraints.gridheight = 3;
2861
+// aWindowConstraints.gridx = 1;
2862
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2863
+// bigThree.add(centralPanel, aWindowConstraints);
2864
+// aWindowConstraints.weightx = 0;
2865
+// aWindowConstraints.gridx = 4;
2866
+// aWindowConstraints.gridwidth = 1;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2869
+// //bigThree.add(XYZPanel, aConstraints);
2870
+// bigThree.validate();
2871
+// scenePanel.setVisible(true);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(scenePanel);
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
26352878 } else
2636
- if (event.getSource() == sevenButton)
2879
+ if (source == sevenButton)
26372880 {
26382881 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();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aWindowConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// bigThree.add(scenePanel, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(true);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(scenePanel);
2912
+ bigThree.add(centralPanel);
2913
+ bigThree.add(XYZPanel);
2914
+ bigThree.FlushUI();
26632915 } else
2664
- if (event.getSource() == rootButton)
2916
+ if (source == rootButton)
26652917 {
26662918 Object3D obj;
26672919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +2925,7 @@
26732925
26742926 refreshContents(true);
26752927 } else
2676
- if (event.getSource() == closeButton)
2928
+ if (source == closeButton)
26772929 {
26782930 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26792931 cRadio ab;
....@@ -2694,11 +2946,11 @@
26942946 }
26952947 refreshContents(true);
26962948 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
2949
+ if (source == editItem || source == editButton)
26982950 {
26992951 EditSelection(false);
27002952 } else
2701
- if (event.getSource() == uneditButton)
2953
+ if (source == uneditButton)
27022954 {
27032955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27042956 {
....@@ -2710,12 +2962,12 @@
27102962
27112963 child.editWindow = null; // ???????????
27122964 }
2713
- objEditor.ctrlPanel.revalidate();
2965
+ objEditor.ctrlPanel.FlushUI();
27142966 //objEditor.jTree.clearSelection();
27152967 //objEditor.ResetSliders();
27162968 refreshContents(true);
27172969 } else
2718
- if (event.getSource() == clearPanelButton)
2970
+ if (source == clearPanelButton)
27192971 {
27202972 assert(copy == group);
27212973 //copy.ClearUI();
....@@ -2726,7 +2978,7 @@
27262978 listUI.clear();
27272979 refreshContents(true);
27282980 } else
2729
- if (event.getSource() == allParamsButton)
2981
+ if (source == allParamsButton)
27302982 {
27312983 assert(copy == group);
27322984
....@@ -2747,19 +2999,19 @@
27472999
27483000 refreshContents(true);
27493001 } else
2750
- if (event.getSource() == unselectButton)
3002
+ if (source == unselectButton)
27513003 {
27523004 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3005
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543006 objEditor.ResetSliders();
27553007 refreshContents(true);
27563008 } else
2757
- if(event.getSource() instanceof cRadio)
3009
+ if(source instanceof cRadio)
27583010 {
27593011 group.parent = keepparent;
27603012 group.attributes = 0;
27613013 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3014
+ /*cRadio*/ radio = (cRadio)source;
27633015 Object3D obj = radio.GetObject();
27643016 System.out.println("Edit " + obj);
27653017 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3031,7 @@
27793031 }
27803032
27813033 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3034
+ //Globals.theRenderer.object = group;
27833035 if(!useclient)
27843036 {
27853037 cameraView.renderCamera = radio.camera;
....@@ -2788,7 +3040,8 @@
27883040 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893041 cameraView.targetLookAt.set(radio.camera.lookAt);
27903042 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3043
+ //cameraView.lighttouched = true;
3044
+ Globals.lighttouched = true;
27923045 topView.object = group;
27933046 frontView.object = group;
27943047 sideView.object = group;
....@@ -2824,7 +3077,7 @@
28243077 if (useclient)
28253078 {
28263079 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3080
+ Globals.lighttouched = true;
28283081 //topView.object = client;
28293082 //frontView.object = client;
28303083 //sideView.object = client;
....@@ -2832,7 +3085,7 @@
28323085 else
28333086 {
28343087 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3088
+ Globals.lighttouched = true;
28363089 //topView.object = group;
28373090 //frontView.object = group;
28383091 //sideView.object = group;
....@@ -3065,9 +3318,9 @@
30653318 obj = (Object3D)e.nextElement();
30663319
30673320 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3321
+ GrafreeD.AnalyzeObject(obj);
30693322 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3323
+ GrafreeD.AnalyzeObject(obj.bRep);
30713324
30723325 // System.err.println((size/1024) + " KB is the size of " + obj);
30733326 }
....@@ -3109,6 +3362,13 @@
31093362 void GenNormals(boolean crease)
31103363 {
31113364 group.GenNormalsS(crease);
3365
+
3366
+ refreshContents();
3367
+ }
3368
+
3369
+ void GenNormalsMINE()
3370
+ {
3371
+ group.selection.GenNormalsMINE();
31123372
31133373 refreshContents();
31143374 }
....@@ -3157,104 +3417,250 @@
31573417
31583418 //Object3D buffer;
31593419 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
-
3420
+// BoundaryRep temprep;
3421
+// Object3D nodes;
3422
+// Vector<Vertex> vertices;
3423
+//
3424
+// cGroup buffer;
3425
+//
3426
+// public void Vertex(Object3D node, Vertex v)
3427
+// {
3428
+//// vertices.add(v);
3429
+//// nodes.addElement(node);
3430
+////
3431
+//// if (temprep.GetCache(v) != null)
3432
+//// {
3433
+//// temprep.Remove(v);
3434
+//// } else
3435
+//// {
3436
+//// temprep.Remember(v);
3437
+//// }
3438
+//
3439
+// //Object3D node = nodes.get(index);
3440
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3441
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3442
+//
3443
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3444
+//
3445
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3446
+//
3447
+// cGroup g = new cGroup();
3448
+//
3449
+// if (g.toParent == null)
3450
+// {
3451
+// g.toParent = LA.newMatrix();
3452
+// g.fromParent = LA.newMatrix();
3453
+// }
3454
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3455
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3456
+//
3457
+// g.add(GrafreeD.clipboard);
3458
+//
3459
+// buffer.add(g);
3460
+// }
3461
+//
3462
+// public void Face(Object3D node, Face f)
3463
+// {
3464
+//
3465
+// }
3466
+//
3467
+// void ParseVerticesOld() // ??
3468
+// {
3469
+// //if (group.selection.size() != 1)
3470
+// // return;
3471
+//
3472
+// temprep = new BoundaryRep();
3473
+// nodes = new Object3D();
3474
+// vertices = new Vector<Vertex>();
3475
+//
3476
+// boolean epsequal = GrafreeD.epsequal;
3477
+// GrafreeD.epsequal = true;
3478
+//
3479
+// for (int i=0; i<group.selection.size(); i++)
3480
+// {
3481
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3482
+//
3483
+// group.selection.get(i).Parse(
3484
+//this );
3485
+//
3486
+// int repsize = temprep.VertexCount();
3487
+// int tablesize = temprep.vertextable.size();
3488
+// int nodesize = nodes.size();
3489
+//
3490
+// assert(vertices.size() == nodes.size());
3491
+//
3492
+// temprep.vertextable.elements();
3493
+//
3494
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3495
+//
3496
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3497
+// {
3498
+// cGroup g = new cGroup();
3499
+//
3500
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3501
+//
3502
+// Object3D node = nodes.get(index);
3503
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3504
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3505
+//
3506
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3507
+//
3508
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3509
+//
3510
+// if (g.toParent == null)
3511
+// {
3512
+// g.toParent = LA.newMatrix();
3513
+// g.fromParent = LA.newMatrix();
3514
+// }
3515
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3516
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3517
+//
3518
+// g.add(GrafreeD.clipboard);
3519
+//
3520
+// buffer.add(g);
3521
+// }
3522
+//
3523
+// makeSomething(buffer, i==group.selection.size()-1);
3524
+// }
3525
+//
3526
+// GrafreeD.epsequal = epsequal;
3527
+//
3528
+// //buffer = null;
3529
+// temprep = null;
3530
+// nodes = null;
3531
+//
3532
+// refreshContents();
3533
+// }
3534
+
31843535 void ParseVertices()
31853536 {
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;
3537
+ boolean epsequal = GrafreeD.epsequal;
3538
+ GrafreeD.epsequal = true;
31953539
31963540 for (int i=0; i<group.selection.size(); i++)
31973541 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3542
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993543
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3544
+ group.selection.get(i).Parse(
3545
+
3546
+ new iParse()
3547
+ {
3548
+ public void Vertex(Object3D node, Vertex v)
3549
+ {
3550
+ temp.set(v);
3551
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053552
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();
3553
+ cGroup g = new cGroup();
32113554
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3555
+ if (g.toParent == null)
3556
+ {
3557
+ g.toParent = LA.newMatrix();
3558
+ g.fromParent = LA.newMatrix();
3559
+ }
3560
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3561
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153562
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);
3563
+ g.add(GrafreeD.clipboard);
32203564
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);
3565
+ buffer.add(g);
3566
+ }
32323567
3233
- g.add(GraphreeD.clipboard);
3568
+ public void Face(Object3D node, Face f)
3569
+ {
32343570
3235
- buffer.add(g);
3236
- }
3571
+ }
3572
+ }
3573
+ );
32373574
32383575 makeSomething(buffer, i==group.selection.size()-1);
32393576 }
32403577
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3578
+ GrafreeD.epsequal = epsequal;
32463579
32473580 refreshContents();
32483581 }
3249
-
3582
+
3583
+ void TextureVertices()
3584
+ {
3585
+ for (int i=0; i<group.selection.size(); i++)
3586
+ {
3587
+ group.selection.get(i).Parse(
3588
+ new iParse()
3589
+ {
3590
+ public void Vertex(Object3D node, Vertex v)
3591
+ {
3592
+ cTexture tex = node.GetTextures();
3593
+ String pigment = Object3D.GetPigment(tex);
3594
+ //String bump = Object3D.GetBump(tex);
3595
+
3596
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3597
+
3598
+ double s = v.s;
3599
+
3600
+ if (s == 1)
3601
+ s = 0;
3602
+
3603
+ double t = v.t;
3604
+
3605
+ if (t == 1)
3606
+ t = 0;
3607
+
3608
+ int indexs = (int) (texturedata.getWidth() * s);
3609
+ int indext = (int) (texturedata.getHeight() * t);
3610
+
3611
+ int index = indext * texturedata.getWidth() + indexs;
3612
+
3613
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3614
+
3615
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3616
+
3617
+ float scale = bytebuf.get(index*slide) & 0xFF;
3618
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3619
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3620
+ scale /= 3;
3621
+
3622
+ scale /= 0xFF;
3623
+ // c'est quoi ca? scale /= 4;
3624
+
3625
+ //v.AO = scale;
3626
+
3627
+ v.x += v.norm.x * scale;
3628
+ v.y += v.norm.y * scale;
3629
+ v.z += v.norm.z * scale;
3630
+ }
3631
+
3632
+ public void Face(Object3D node, Face f)
3633
+ {
3634
+ }
3635
+ }
3636
+ );
3637
+ }
3638
+
3639
+ refreshContents();
3640
+ }
3641
+
32503642 void Align()
32513643 {
3644
+ if (group.selection.size() == 0)
3645
+ return;
3646
+
3647
+ cVector bbmin = new cVector();
3648
+ cVector bbmax = new cVector();
3649
+
3650
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3651
+
3652
+ double dx = bbmax.x - bbmin.x;
3653
+ double dy = bbmax.y - bbmin.y;
3654
+ double dz = bbmax.z - bbmin.z;
3655
+
3656
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3657
+
32523658 for (int i=0; i<group.selection.size(); i++)
32533659 {
32543660 Object3D obj = group.selection.get(i);
32553661
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3662
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3663
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583664 }
32593665
32603666 refreshContents();
....@@ -3267,7 +3673,7 @@
32673673 // ref.SaveSupports();
32683674 // Object3D par = ref.parent;
32693675 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3676
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713677 // ref.parent = par;
32723678 // ref.RestoreSupports();
32733679
....@@ -3275,11 +3681,11 @@
32753681
32763682 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773683
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3684
+ boolean random = CameraPane.SWITCH;
3685
+ CameraPane.SWITCH = false; // parse all random nodes
32803686 lowres.linkVerticesThis(null);
32813687 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3688
+ CameraPane.SWITCH = random;
32833689
32843690 System.err.flush();
32853691
....@@ -3297,7 +3703,7 @@
32973703 // lowres.SaveSupports();
32983704 // par = lowres.parent;
32993705 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3706
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013707 Object3D newlow = CloneObject(lowres, false);
33023708 newlow.name = sn.switchobject.get(i).name;
33033709 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3725,7 @@
33193725 return;
33203726
33213727 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3728
+ Object3D ref = GrafreeD.clipboard.get(0);
33233729
33243730 Object3D newgroup = new Object3D("Po:" + poses.name);
33253731
....@@ -3488,7 +3894,7 @@
34883894 group.selection.RelinkToSupport(); // july 2014
34893895 System.out.println("DONE.");
34903896 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3897
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34923898 }
34933899
34943900 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +3919,20 @@
35133919
35143920 void ClipMesh()
35153921 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3922
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
35173923 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
3924
+ Object3D content = GrafreeD.clipboard.get(0);
35193925
35203926 if (content instanceof cGroup && ((cGroup)content).transientlink )
35213927 content = ((cGroup)content).get(0);
35223928
35233929 // for (int i=0; i<group.selection.size(); i++)
35243930 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3931
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35263932 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
3933
+ group.selection.ClipMesh(GrafreeD.clipboard);
35283934 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
3935
+// group.selection.ClipMesh(GrafreeD.clipboard);
35303936 System.out.println("DONE.");
35313937 refreshContents();
35323938 }
....@@ -3764,25 +4170,25 @@
37644170 System.err.println("info : " + child.GetPath());
37654171 }
37664172 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4173
+// else
4174
+// {
4175
+// objEditor.SetMaterial(group); // .GetMaterial());
4176
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4177
+// System.err.println("info : " + group.GetPath());
4178
+// }
37734179
37744180 objEditor.SetText(); // jan 2014
37754181
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4182
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
37774183 CameraPane.flash = true;
37784184
37794185 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
37804186 // a camera
37814187 {
37824188 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;
4189
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4190
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4191
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864192 }
37874193
37884194 refreshContents();
....@@ -3864,12 +4270,12 @@
38644270 {
38654271 if (group.selection.isEmpty())
38664272 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4273
+ GrafreeD.clipboardIsTempGroup = false;
38684274 Composite tGroup = null;
38694275 if (group.selection.size() > 0) // 1)
38704276 {
38714277 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4278
+ GrafreeD.clipboardIsTempGroup = true;
38734279 }
38744280
38754281 if (cut)
....@@ -3909,16 +4315,16 @@
39094315 //System.out.println("cut " + child);
39104316 //System.out.println("parent = " + child.parent);
39114317 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4318
+ if (GrafreeD.clipboardIsTempGroup)
39134319 tGroup.add/*Child*/(tmp);
39144320 else
3915
- GraphreeD.clipboard = tmp;
4321
+ GrafreeD.clipboard = tmp;
39164322 }
39174323 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4324
+ if (GrafreeD.clipboardIsTempGroup)
39194325 tGroup.add/*Child*/(child);
39204326 else
3921
- GraphreeD.clipboard = child;
4327
+ GrafreeD.clipboard = child;
39224328 }
39234329
39244330 //ResetModel();
....@@ -3950,21 +4356,21 @@
39504356 //System.out.println("cut " + elem);
39514357 //System.out.println("parent = " + elem.parent);
39524358 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4359
+ if (GrafreeD.clipboardIsTempGroup)
39544360 tGroup.add/*Child*/(tmp);
39554361 else
3956
- GraphreeD.clipboard = tmp;
4362
+ GrafreeD.clipboard = tmp;
39574363 }
39584364 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4365
+ if (GrafreeD.clipboardIsTempGroup)
39604366 tGroup.add/*Child*/(child);
39614367 else
3962
- GraphreeD.clipboard = child;
4368
+ GrafreeD.clipboard = child;
39634369 }
39644370
39654371 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4372
+ if (GrafreeD.clipboardIsTempGroup)
4373
+ GrafreeD.clipboard = tGroup;
39684374 if (cut)
39694375 {
39704376 ResetModel();
....@@ -3974,11 +4380,11 @@
39744380
39754381 void paste(boolean expand)
39764382 {
3977
- // if (GraphreeD.clipboard == null)
4383
+ // if (GrafreeD.clipboard == null)
39784384 // return;
39794385 boolean first = true;
39804386
3981
- if (GraphreeD.clipboardIsTempGroup)
4387
+ if (GrafreeD.clipboardIsTempGroup)
39824388 {
39834389 Composite temp;
39844390
....@@ -3989,7 +4395,7 @@
39894395 temp = (Composite)Applet3D.clipboard.deepCopy();
39904396 */
39914397 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4398
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934399 {
39944400 Object3D child = (Object3D)e.nextElement();
39954401
....@@ -4003,7 +4409,7 @@
40034409 else
40044410 elem = child.deepCopy(); // ?
40054411 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4412
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074413 // elem = elem.get(0);
40084414 makeSomething(elem, true); // ?? first);
40094415 //group.addChild(elem);
....@@ -4023,23 +4429,23 @@
40234429 //Object3D cb = Applet3D.clipboard;
40244430 //temp.addChild(cb);
40254431 //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());
4432
+ assert(GrafreeD.clipboard.parent == null);
4433
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4434
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4435
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4436
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
40314437 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4438
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
+ GrafreeD.clipboard.get(0).parent = keepparent;
40344440 }
40354441
40364442 ResetModel();
40374443 refreshContents();
40384444 }
40394445
4040
- void pasteInto(boolean copyit)
4446
+ void pasteInto(boolean copyit, boolean clone)
40414447 {
4042
-// if (GraphreeD.clipboard == null)
4448
+// if (GrafreeD.clipboard == null)
40434449 // return;
40444450
40454451 if (group.selection.size() != 1)
....@@ -4066,15 +4472,22 @@
40664472 if (copyit)
40674473 {
40684474 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4475
+ if (clone)
4476
+ {
4477
+ CloneClipboard(false); // sept 2014
4478
+ }
4479
+ else
4480
+ {
4481
+ paste(false);
4482
+ }
40704483 }
40714484 else
40724485 {
40734486 boolean first = true;
40744487
4075
- if (GraphreeD.clipboardIsTempGroup)
4488
+ if (GrafreeD.clipboardIsTempGroup)
40764489 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4490
+ Composite temp = (Composite)GrafreeD.clipboard;
40784491 Object3D copy;
40794492 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804493 {
....@@ -4084,7 +4497,7 @@
40844497 }
40854498 } else
40864499 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4500
+ linkSomething(GrafreeD.clipboard); //.get(0));
40884501 }
40894502 }
40904503 }
....@@ -4276,6 +4689,26 @@
42764689 makeSomething(csg);
42774690 }
42784691
4692
+ void Ungroup(Object3D g)
4693
+ {
4694
+ if (g instanceof HiddenObject)
4695
+ {
4696
+ HiddenObject h = (HiddenObject) g;
4697
+
4698
+ for (int i=0; i<h.ActualSize(); i++)
4699
+ {
4700
+ objEditor.makeSomething(h.get(i), false);
4701
+ }
4702
+ }
4703
+ else
4704
+ {
4705
+ for (int i=0; i<g.Size(); i++)
4706
+ {
4707
+ objEditor.makeSomething(g.get(i), false);
4708
+ }
4709
+ }
4710
+ }
4711
+
42794712 void ungroup()
42804713 {
42814714 /*
....@@ -4471,7 +4904,7 @@
44714904
44724905 void ImportGFD()
44734906 {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4907
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
44754908 browser.show();
44764909 String filename = browser.getFile();
44774910 if (filename != null && filename.length() > 0)
....@@ -4509,7 +4942,7 @@
45094942
45104943 void ImportVRMLX3D()
45114944 {
4512
- if (GraphreeD.standAlone)
4945
+ if (GrafreeD.standAlone)
45134946 {
45144947 /**/
45154948 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4526,7 +4959,7 @@
45264959
45274960 String GetFile(String dialogName)
45284961 {
4529
- if (GraphreeD.standAlone)
4962
+ if (GrafreeD.standAlone)
45304963 {
45314964 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45324965 browser.show();
....@@ -4590,10 +5023,12 @@
45905023 cButton flashSelectionButton;
45915024 cButton editButton;
45925025 cButton uneditButton;
5026
+ JCheckBox allParamsButton;
45935027 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955028 cButton unselectButton;
45965029
5030
+ cButton oneStepButton;
5031
+
45975032 cButton screenfitButton;
45985033 cButton screenfitpointButton;
45995034 cButton snapobjectButton;
....@@ -4635,6 +5070,7 @@
46355070 private MenuItem resetsupportItem;
46365071 private MenuItem resetreferencesItem;
46375072 private MenuItem linkverticesItem;
5073
+ private MenuItem relinkverticesItem;
46385074 private MenuItem setMasterItem;
46395075 private MenuItem resetMeshItem;
46405076 private MenuItem stepAllItem;
....@@ -4647,14 +5083,17 @@
46475083 private MenuItem mergeGeometriesItem;
46485084 private MenuItem copyItem;
46495085 private MenuItem pasteItem;
5086
+ private MenuItem pasteIntoItem;
46505087 private MenuItem pasteLinkItem;
46515088 private MenuItem pasteCloneItem;
46525089 private MenuItem pasteExpandItem;
46535090 private MenuItem clearItem;
46545091 private MenuItem clearAllItem;
46555092 private MenuItem genUVItem;
5093
+ private MenuItem genNormalsMESHItem;
46565094 private MenuItem genNormalsCADItem;
46575095 private MenuItem genNormalsORGANItem;
5096
+ private MenuItem genNormalsMINEItem;
46585097 private MenuItem stripifyItem;
46595098 private MenuItem unstripifyItem;
46605099 private MenuItem trimItem;
....@@ -4696,6 +5135,7 @@
46965135 private MenuItem resetCentroidItem;
46975136 private MenuItem transformgeometryItem;
46985137 private MenuItem resetTransformItem;
5138
+ private MenuItem hideItem;
46995139 private MenuItem grabItem;
47005140 private MenuItem backItem;
47015141 private MenuItem frontItem;
....@@ -4716,6 +5156,7 @@
47165156
47175157 private MenuItem resetParentItem;
47185158 private MenuItem repairParentItem;
5159
+ private MenuItem repairShadowItem;
47195160 private MenuItem sortbysizeItem;
47205161 private MenuItem sortbynameItem;
47215162
....@@ -4728,16 +5169,19 @@
47285169 private MenuItem particleItem;
47295170 private MenuItem ragdollItem;
47305171 private MenuItem ragdoll2Item;
5172
+ private MenuItem heightFieldItem;
5173
+ private MenuItem textureFieldItem;
47315174 private MenuItem gridItem;
47325175 private MenuItem rectoidItem;
47335176 private MenuItem ellipsoidItem;
47345177 private MenuItem coneItem;
47355178 private MenuItem torusItem;
47365179 private MenuItem superItem;
5180
+ private MenuItem kleinItem;
47375181 private MenuItem blobItem;
47385182 private MenuItem latheItem;
47395183 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5184
+ private MenuItem overlayItem;
47415185 private MenuItem meshItem;
47425186 // private MenuItem meshGroupItem;
47435187 private MenuItem springItem;
....@@ -4746,6 +5190,7 @@
47465190 private MenuItem csgItem;
47475191 private MenuItem templateItem;
47485192 private MenuItem textureItem;
5193
+ private MenuItem billboardItem;
47495194 private MenuItem shadowXItem;
47505195 private MenuItem shadowYItem;
47515196 private MenuItem shadowZItem;