Normand Briere
2019-05-05 1e1c7fcdb3d0f8be350c5f6c32b6afa6705168ea
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,17 +163,21 @@
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("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,18 +185,32 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
208
+ }
209
+
210
+ oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
213
+ resetMeshItem = menu.add(new MenuItem("Reset All"));
193214 resetMeshItem.addActionListener(this);
194215 stepAllItem = menu.add(new MenuItem("Step All"));
195216 stepAllItem.addActionListener(this);
....@@ -198,6 +219,7 @@
198219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199220 resetreferencesItem.addActionListener(this);
200221 menu.add("-");
222
+ }
201223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202224 overwriteGeoItem.addActionListener(this);
203225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,47 +231,68 @@
209231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210232 overwriteUVItem.addActionListener(this);
211233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
212236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213237 generateMeshItem.addActionListener(this);
214238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215239 poseMeshItem.addActionListener(this);
216240 menu.add("-");
241
+ }
217242 resetsupportItem = menu.add(new MenuItem("Reset support"));
218243 resetsupportItem.addActionListener(this);
219244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220245 linkverticesItem.addActionListener(this);
246
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
247
+ relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
221251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222252 setMasterItem.addActionListener(this);
253
+ }
223254
224
- oe.menuBar.add(menu = new Menu("Object"));
255
+ oe.menuBar.add(menu = new Menu("Group"));
225256 grabItem = menu.add(new MenuItem("Grab"));
226257 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229258 backItem = menu.add(new MenuItem("Back"));
230259 backItem.addActionListener(this);
260
+ frontItem = menu.add(new MenuItem("Front"));
261
+ frontItem.addActionListener(this);
231262 compositeItem = menu.add(new MenuItem("Composite"));
232263 compositeItem.addActionListener(this);
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
265
+ hideItem.addActionListener(this);
266
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
267
+ ungroupItem.addActionListener(this);
233268 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
235270 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);
240271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241272 switchGeoItem.addActionListener(this);
242273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243274 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
245276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
246285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247286 scriptNodeItem.addActionListener(this);
248287 cameraItem = menu.add(new MenuItem("Camera"));
249288 cameraItem.addActionListener(this);
250
- menu.add("-");
289
+ }
290
+
291
+ oe.menuBar.add(menu = new Menu("Object"));
251292 textureItem = menu.add(new MenuItem("Texture"));
252293 textureItem.addActionListener(this);
294
+ billboardItem = menu.add(new MenuItem("Billboard"));
295
+ billboardItem.addActionListener(this);
253296 csgItem = menu.add(new MenuItem("CSG"));
254297 csgItem.addActionListener(this);
255298 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -258,23 +301,25 @@
258301 shadowYItem.addActionListener(this);
259302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
260303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
261307 linkerItem = menu.add(new MenuItem("Linker"));
262308 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265309 attributeItem = menu.add(new MenuItem("Attribute"));
266310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
267313 pointflowItem = menu.add(new MenuItem("Point Flow"));
268314 pointflowItem.addActionListener(this);
315
+ }
269316 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273318 resetTransformItem.addActionListener(this);
274319 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275320 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
321
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
+ transformgeometryItem.addActionListener(this);
278323
279324 oe.menuBar.add(menu = new Menu("Geometry"));
280325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +328,13 @@
283328 genNormalsORGANItem.addActionListener(this);
284329 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285330 genNormalsCADItem.addActionListener(this);
331
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
332
+ genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
335
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
336
+ genNormalsMINEItem.addActionListener(this);
337
+ }
286338 stripifyItem = menu.add(new MenuItem("Stripify"));
287339 stripifyItem.addActionListener(this);
288340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +344,6 @@
292344 untrimItem = menu.add(new MenuItem("Untrim"));
293345 untrimItem.addActionListener(this);
294346 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297347 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298348 clearColorsItem.addActionListener(this);
299349 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +356,30 @@
306356 reduce34MeshItem.addActionListener(this);
307357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308358 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
367
+
368
+ oe.menuBar.add(menu = new Menu("Attributes"));
369
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370
+ clearMaterialsItem.addActionListener(this);
313371 menu.add("-");
314372 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315373 liveleavesItem.addActionListener(this);
316374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
318378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319379 supportleavesItem.addActionListener(this);
320380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321381 unsupportleavesItem.addActionListener(this);
382
+ }
322383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323384 hideleavesItem.addActionListener(this);
324385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -332,27 +393,18 @@
332393 flipVItem.addActionListener(this);
333394 unflipVItem = menu.add(new MenuItem("Unflip V"));
334395 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
396
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336397 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
398
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338399 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
400
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340401 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
402
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342403 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
404
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344405 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
406
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346407 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);
356408
357409 oe.menuBar.add(menu = new Menu("Selection"));
358410 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +422,36 @@
370422 sortbysizeItem.addActionListener(this);
371423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
427
+ menu.add("-");
428
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429
+ extractGeometriesItem.addActionListener(this);
430
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431
+ cloneGeometriesItem.addActionListener(this);
432
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
+ shareGeometriesItem.addActionListener(this);
434
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
+ mergeGeometriesItem.addActionListener(this);
436
+ }
437
+
373438 oe.menuBar.add(menu = new Menu("Insert"));
374439 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
440
+
441
+ oe.menuBar.add(menu = new Menu("Include"));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
443
+ importOBJItem.addActionListener(this);
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
446
+ import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
453
+
454
+ oe.menuBar.add(menu = new Menu("Tools"));
376455 buildToolsMenu(menu);
377456 }
378457
....@@ -406,150 +485,98 @@
406485 oe.radioPanel.add(dummyButton);
407486 oe.buttonGroup.add(dummyButton);
408487 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
488
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412489
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
490
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
+ liveCB.setToolTipText("Enabled animation");
414492 liveCB.addItemListener(this);
415493
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);
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
495
+ oneStepButton.setToolTipText("Animate one step forward");
496
+ oneStepButton.addActionListener(this);
497
+
498
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
499
+ fastCB.setToolTipText("Fast mode");
434500 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);
501
+
502
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
503
+ trackCB.setToolTipText("Enable tracking");
476504 trackCB.addItemListener(this);
477505
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
507
+ screenfitButton.setToolTipText("Screen fit");
480508 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
509
+
482510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483511 // 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;
488512
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);
513
+ if (Globals.ADVANCED)
514
+ {
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ snapobjectButton.addActionListener(this);
517
+ snapobjectButton.setToolTipText("Snap Object");
518
+ }
519
+
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
+ flashSelectionButton.setToolTipText("Show selection");
495522 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499523
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525
+
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527
+ twoButton.setToolTipText("Show center view only");
502528 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504530 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
531
+ fourButton.setToolTipText("Show left panel only");
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
+ sixButton.setToolTipText("2-column layout left");
506534 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
+ threeButton.setToolTipText("2-column layout right");
508537 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
539
+ sevenButton.setToolTipText("3-column layout");
510540 sevenButton.addActionListener(this);
511541 //
512542
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
+ rootButton.setToolTipText("Edit selection in new tab");
514545 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548
+ closeButton.setToolTipText("Close tab");
517549 closeButton.addActionListener(this);
518550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519551 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521552
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
553
+ cGridBag commandsPanel = new cGridBag();
554
+
555
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
+ editButton.setToolTipText("Edit selection");
524557 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528558
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
530561 uneditButton.addActionListener(this);
531562
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);
563
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
+ allParamsButton.setToolTipText("Edit all params");
544565 allParamsButton.addActionListener(this);
545566
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);
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
568
+ clearPanelButton.setToolTipText("Clear edit panel");
569
+ clearPanelButton.addActionListener(this);
570
+
571
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ unselectButton.setToolTipText("Unselect");
551573 unselectButton.addActionListener(this);
552574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
553580 // oe.aConstraints.gridx += 1;
554581 // oe.aConstraints.weighty = 0;
555582 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +588,37 @@
561588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562589 // gcButton.addActionListener(this);
563590
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;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
575594 //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);
595
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577596 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
582600
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);
601
+ cGridBag copyOptionsPanel = new cGridBag();
602
+
603
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
+ colorCB.setToolTipText("Copy color when dropped");
587605 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
606
+
607
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
+ materialCB.setToolTipText("Copy material when dropped");
590609 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
+
611
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
+ textureCB.setToolTipText("Copy texture when dropped");
593613 textureCB.addItemListener(this);
594614
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
597618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
598622 //jList.addListSelectionListener(this);
599623 oe.jTree.addTreeSelectionListener(this);
600624 //jTree.setRootVisible(false);
....@@ -616,17 +640,89 @@
616640 radio.layout = sevenButton;
617641 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618642 }
643
+
644
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
645
+ {
646
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
647
+ boxCB.setToolTipText("Display bounding boxes");
648
+ boxCB.addItemListener(this);
649
+
650
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
652
+ zoomBoxCB.addItemListener(this);
653
+
654
+ if (Globals.ADVANCED)
655
+ {
656
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
+ supportCB.setToolTipText("Enable rigging");
658
+ supportCB.addItemListener(this);
659
+
660
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661
+ // localCB.addItemListener(this);
662
+
663
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664
+ crowdCB.setToolTipText("Used for crowds");
665
+ crowdCB.addItemListener(this);
666
+
667
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
668
+ smoothCB.setToolTipText("Snapping delay");
669
+ smoothCB.addItemListener(this);
670
+
671
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
672
+ slowCB.setToolTipText("Smooth interpolation");
673
+ slowCB.addItemListener(this);
674
+
675
+// constraints.gridy += 1;
676
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
677
+// speakerMocapCB.addItemListener(this);
678
+
679
+ if (false)
680
+ {
681
+ // handled in scripts
682
+ //constraints.gridy += 1;
683
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
684
+ speakerCameraCB.addItemListener(this);
685
+
686
+ //constraints.gridy += 1;
687
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
688
+ speakerFocusCB.addItemListener(this);
689
+
690
+ //constraints.gridy += 1;
691
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
692
+ smoothfocusCB.addItemListener(this);
693
+ }
694
+
695
+//constraints.gridx += 1;
696
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
697
+// debugCB.addItemListener(this);
698
+
699
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
700
+ oeilCB.addItemListener(this);
701
+
702
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
703
+ lookAtCB.setToolTipText("Look-at target");
704
+ lookAtCB.addItemListener(this);
705
+
706
+ }
707
+
708
+ cGridBag fill = new cGridBag();
709
+
710
+ fill.preferredHeight = 200;
711
+
712
+ panel.add(fill);
713
+
714
+ }
619715
620716 void EditObject(Object3D obj)
621717 {
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();
718
+ cRadio radioButton = new cRadio(obj.name);
719
+ radioButton.SetObject(obj);
720
+ radioButton.layout = sevenButton;
721
+ radioButton.SetCamera(cameraView.renderCamera, false);
722
+ radioButton.addActionListener(this);
723
+ radioPanel.add(radioButton);
724
+ buttonGroup.add(radioButton);
725
+ radioButton.doClick();
630726 }
631727 void SetupViews(ObjEditor oe)
632728 {
....@@ -646,6 +742,7 @@
646742 JCheckBox fastCB;
647743 JCheckBox slowCB;
648744 JCheckBox boxCB;
745
+ JCheckBox zoomBoxCB;
649746 JCheckBox trackCB;
650747 JCheckBox smoothfocusCB;
651748 // JCheckBox speakerMocapCB;
....@@ -688,8 +785,7 @@
688785 dropAttributes |= Object3D.TEXTURE;
689786 else
690787 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
788
+ } else if(e.getSource() == liveCB)
693789 {
694790 cameraView.ToggleLive();
695791 }
....@@ -726,6 +822,10 @@
726822 Recompile();
727823 cameraView.repaint();
728824 // refreshContents();
825
+ }
826
+ else if(e.getSource() == zoomBoxCB)
827
+ {
828
+ cameraView.ToggleZoomBoxMode();
729829 }
730830 else if(e.getSource() == smoothfocusCB)
731831 {
....@@ -894,11 +994,11 @@
894994 {
895995 loadClipboard(true);
896996 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
997
+ pasteInto(false, false);
898998 } else {
899999 loadClipboard(false);
9001000 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
1001
+ pasteInto(false, false); // true); // ???
9021002 }
9031003 }
9041004 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1102,8 @@
10021102
10031103 void buildCreateMenu(Menu menu)
10041104 {
1105
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1106
+ //heightFieldItem.addActionListener(this);
10051107 gridItem = menu.add(new MenuItem("Grid"));
10061108 gridItem.addActionListener(this);
10071109 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1116,37 @@
10141116 torusItem.addActionListener(this);
10151117 superItem = menu.add(new MenuItem("Superellipsoid"));
10161118 superItem.addActionListener(this);
1119
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1120
+ kleinItem.addActionListener(this);
10171121 particleItem = menu.add(new MenuItem("Particle system"));
10181122 particleItem.addActionListener(this);
1123
+ if (Globals.ADVANCED)
1124
+ {
10191125 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201126 ragdollItem.addActionListener(this);
10211127 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221128 ragdoll2Item.addActionListener(this);
1129
+ }
10231130 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1131
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251132 meshItem.addActionListener(this);
10261133 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271134 // meshGroupItem.addActionListener(this);
1135
+ if (Globals.ADVANCED)
1136
+ {
10281137 springItem = menu.add(new MenuItem("Spring"));
10291138 springItem.addActionListener(this);
10301139 flagItem = menu.add(new MenuItem("Flag"));
10311140 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);
10361141 blobItem = menu.add(new MenuItem("Blob"));
10371142 blobItem.addActionListener(this);
10381143 latheItem = menu.add(new MenuItem("Lathe"));
10391144 latheItem.addActionListener(this);
1145
+ }
1146
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1147
+ bezierItem.addActionListener(this);
1148
+ overlayItem = menu.add(new MenuItem("Overlay"));
1149
+ overlayItem.addActionListener(this);
10401150 lightItem = menu.add(new MenuItem("Light"));
10411151 lightItem.addActionListener(this);
10421152 menu.add("-");
....@@ -1046,41 +1156,39 @@
10461156 loopItem.addActionListener(this);
10471157 doubleItem = menu.add(new MenuItem("Fork"));
10481158 doubleItem.addActionListener(this);
1159
+ if (Globals.ADVANCED)
1160
+ {
10491161 tripleItem = menu.add(new MenuItem("Trident"));
10501162 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);
1163
+ }
10601164 }
10611165
10621166 void buildToolsMenu(Menu menu)
10631167 {
10641168 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651169 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1170
+ animationItem.setState(Globals.ANIMATION);
10671171
10681172 menu.add("-");
10691173 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701174 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1175
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1176
+ textureFieldItem.addActionListener(this);
1177
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721178 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751179 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761180 reduceMorphItem.addActionListener(this);
10771181 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781182 reduce34MorphItem.addActionListener(this);
1079
-
1183
+ menu.add("-");
10801184 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811185 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831186
1187
+ if (Globals.ADVANCED)
1188
+ {
1189
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1190
+ mirrorItem.addActionListener(this);
1191
+ menu.add("-");
10841192 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851193 memoryItem.addActionListener(this);
10861194 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1094,6 +1202,8 @@
10941202 resetParentItem.addActionListener(this);
10951203 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961204 repairParentItem.addActionListener(this);
1205
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1206
+ repairShadowItem.addActionListener(this);
10971207 menu.add(invariantsItem = new MenuItem("Invariants"));
10981208 invariantsItem.addActionListener(this);
10991209 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1211,7 @@
11011211 menu.add("-");
11021212 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031213 editScriptItem.addActionListener(this);
1214
+ }
11041215 }
11051216
11061217 void ScreenFit()
....@@ -1429,9 +1540,9 @@
14291540
14301541 void Overwrite(int mask)
14311542 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1543
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14331544 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1545
+ Object3D content = GrafreeD.clipboard.get(0);
14351546
14361547 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371548 content = ((cGroup)content).get(0);
....@@ -1454,6 +1565,7 @@
14541565 //
14551566 public void actionPerformed(ActionEvent event) // , Object arg)
14561567 {
1568
+ Object source = event.getSource();
14571569 /*
14581570 if (event.getSource() == nameField)
14591571 {
....@@ -1465,11 +1577,11 @@
14651577 }
14661578 else
14671579 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1580
+ if (source == lookAtItem || source == lookFromItem)
14691581 {
14701582 ScreenFit();
14711583 } else
1472
- if (event.getSource() == switchItem)
1584
+ if (source == switchItem)
14731585 {
14741586 cVector v1 = new cVector();
14751587 cVector v2 = new cVector();
....@@ -1478,11 +1590,11 @@
14781590 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791591 objEditor.cameraView.repaint();
14801592 } else
1481
- if (event.getSource() == rectoidItem)
1593
+ if (source == rectoidItem)
14821594 {
14831595 makeSomething(new Box());
14841596 } else
1485
- if (event.getSource() == particleItem)
1597
+ if (source == particleItem)
14861598 {
14871599 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881600 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1615,9 @@
15031615 applyExample(particleGeom, "SMOKE");
15041616 makeSomething(particleGeom);
15051617 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1618
+ if (source == ragdollItem || source == ragdoll2Item)
15071619 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1620
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091621
15101622 ragdoll.toParent = LA.newMatrix();
15111623 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1633,71 @@
15211633 makeSomething(ragdoll);
15221634 //makeSomething(new VehicleDemo());
15231635 } else
1524
- if (event.getSource() == gridItem)
1636
+ /*
1637
+ */
1638
+ if (source == heightFieldItem)
1639
+ {
1640
+ Object3D obj = new Object3D();
1641
+
1642
+ obj.CreateMaterial();
1643
+ obj.bRep = new BoundaryRep();
1644
+
1645
+ obj.bRep.CreateMesh(new iHeightField()
1646
+ {
1647
+ public double f(double x, double y)
1648
+ {
1649
+ // The Mandelbrot set is represented by coloring
1650
+ // each point (x,y) according to the number of
1651
+ // iterations it takes before the while loop in
1652
+ // this method ends. For points that are actually
1653
+ // in the Mandelbrot set, or very close to it, the
1654
+ // count will reach the maximum value, 80. These
1655
+ // points will be colored purple. All other colors
1656
+ // represent points that are definitely NOT in the set.
1657
+ x -= 600;
1658
+ y -= 500;
1659
+ x /= 200;
1660
+ y /= 200;
1661
+ int count = 0;
1662
+ double zx = x;
1663
+ double zy = y;
1664
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1665
+ double new_zx = zx*zx - zy*zy + x;
1666
+ zy = 2*zx*zy + y;
1667
+ zx = new_zx;
1668
+ count++;
1669
+ }
1670
+ return count; // Math.sqrt(count);
1671
+ }
1672
+ }, 1000,1000);
1673
+
1674
+ makeSomething(obj);
1675
+ } else
1676
+ if (source == gridItem)
15251677 {
15261678 makeSomething(new Grid());
15271679 } else
1528
- if (event.getSource() == ellipsoidItem)
1680
+ if (source == ellipsoidItem)
15291681 {
15301682 makeSomething(new Sphere());
15311683 } else
1532
- if (event.getSource() == coneItem)
1684
+ if (source == coneItem)
15331685 {
15341686 makeSomething(new Cone());
15351687 } else
1536
- if (event.getSource() == torusItem)
1688
+ if (source == torusItem)
15371689 {
15381690 makeSomething(new Torus());
15391691 } else
1540
- if (event.getSource() == superItem)
1692
+ if (source == superItem)
15411693 {
15421694 makeSomething(new Superellipsoid());
15431695 } else
1544
- if (event.getSource() == blobItem)
1696
+ if (source == kleinItem)
1697
+ {
1698
+ makeSomething(new Klein());
1699
+ } else
1700
+ if (source == blobItem)
15451701 {
15461702 Blob blob = new Blob();
15471703 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1705,15 @@
15491705 //blob.retile();
15501706 makeSomething(blob);
15511707 } else
1552
- if (event.getSource() == latheItem)
1708
+ if (source == latheItem)
15531709 {
15541710 makeSomething(new Lathe());
15551711 } else
1556
- if (event.getSource() == bezierItem)
1712
+ if (source == bezierItem)
15571713 {
15581714 makeSomething(new BezierSurface());
15591715 } else
1560
- if (event.getSource() == checkerItem)
1716
+ if (source == overlayItem)
15611717 {
15621718 /*
15631719 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1726,9 @@
15701726 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711727 LA.matInvert(obj.toParent, obj.fromParent);
15721728 */
1573
- makeSomething(new CheckerIG());
1729
+ makeSomething(new Checker());
15741730 } else
1575
- if (event.getSource() == meshItem)
1731
+ if (source == meshItem)
15761732 {
15771733 Object3D itemtomake = new Object3D();
15781734 Object3D child;
....@@ -1593,35 +1749,35 @@
15931749 makeSomething(child);
15941750 }
15951751 } else
1596
- if (event.getSource() == springItem)
1752
+ if (source == springItem)
15971753 {
15981754 cSpring s = new cSpring();
15991755 s.setup();
16001756 makeSomething(s);
16011757 } else
1602
- if (event.getSource() == flagItem)
1758
+ if (source == flagItem)
16031759 {
16041760 cSpring s = new cFlag();
16051761 s.setup();
16061762 makeSomething(s);
16071763 } else
1608
- if (event.getSource() == lightItem)
1764
+ if (source == lightItem)
16091765 {
16101766 makeSomething(new Light());
16111767 } else
1612
- if (event.getSource() == csgItem)
1768
+ if (source == csgItem)
16131769 {
16141770 group(new CSG());
16151771 } else
1616
- if (event.getSource() == templateItem)
1772
+ if (source == templateItem)
16171773 {
16181774 group(new cTemplate());
16191775 } else
1620
- if (event.getSource() == attributeItem)
1776
+ if (source == attributeItem)
16211777 {
16221778 makeSomething(new Attribute());
16231779 } else
1624
- if (event.getSource() == pointflowItem)
1780
+ if (source == pointflowItem)
16251781 {
16261782 makeSomething(new PointFlow());
16271783 } else
....@@ -1633,7 +1789,7 @@
16331789 } else
16341790 */
16351791
1636
- if (event.getSource() == superLoopItem)
1792
+ if (source == superLoopItem)
16371793 {
16381794 Composite g = new cGroup();
16391795 for (int i=0; i<15; i++)
....@@ -1655,7 +1811,7 @@
16551811
16561812 group(g);
16571813 } else
1658
- if (event.getSource() == loopItem)
1814
+ if (source == loopItem)
16591815 {
16601816 Composite csg = new GroupLeaf();
16611817 csg.count = 5;
....@@ -1664,7 +1820,7 @@
16641820 csg.addChild(child);
16651821 child.addChild(csg);
16661822 } else
1667
- if (event.getSource() == doubleItem)
1823
+ if (source == doubleItem)
16681824 {
16691825 Composite csg = new GroupLeaf();
16701826 csg.count = 5;
....@@ -1676,7 +1832,7 @@
16761832 csg.addChild(child);
16771833 child.addChild(csg);
16781834 } else
1679
- if (event.getSource() == tripleItem)
1835
+ if (source == tripleItem)
16801836 {
16811837 Composite csg = new GroupLeaf();
16821838 csg.count = 4;
....@@ -1692,70 +1848,83 @@
16921848 child.addChild(csg);
16931849 } else
16941850
1695
- if (event.getSource() == importGFDItem)
1851
+ if (source == importGFDItem)
16961852 {
16971853 ImportGFD();
16981854 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1855
+ if (source == importVRMLX3DItem)
17001856 {
17011857 ImportVRMLX3D();
17021858 } else
1703
- if (event.getSource() == import3DSItem)
1859
+ if (source == import3DSItem)
17041860 {
17051861 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17061862 } else
1707
- if (event.getSource() == importOBJItem)
1863
+ if (source == importOBJItem)
17081864 {
1709
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1865
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
+ browser.setVisible(true);
1868
+ String filename = browser.getFile();
1869
+ if (filename != null && filename.length() > 0)
1870
+ {
1871
+ String fullname = browser.getDirectory() + filename;
1872
+ makeSomething(ReadOBJ(fullname), true);
1873
+ }
17101874 } else
1711
- if (event.getSource() == computeAOItem)
1875
+ if (source == computeAOItem)
17121876 {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1877
+ Globals.drawMode = CameraPane.OCCLUSION;
1878
+ Globals.theRenderer.repaint();
17151879 } else
1716
- if (event.getSource() == recompileItem)
1880
+ if (source == recompileItem)
17171881 {
17181882 Recompile();
17191883 refreshContents();
17201884 } else
1721
- if (event.getSource() == editScriptItem)
1885
+ if (source == editScriptItem)
17221886 {
17231887 OpenDialog();
17241888 refreshContents();
17251889 } else
1726
- if (event.getSource() == invariantsItem)
1890
+ if (source == invariantsItem)
17271891 {
17281892 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1893
+ GrafreeD.grafreeD.universe.invariants();
17301894 } else
1731
- if (event.getSource() == memoryItem)
1895
+ if (source == memoryItem)
17321896 {
17331897 //System.out.println("Invariants:");
17341898 PrintMemory();
17351899 } else
1736
- if (event.getSource() == pathItem)
1900
+ if (source == pathItem)
17371901 {
17381902 PrintPath();
17391903 } else
1740
- if (event.getSource() == analyzeItem)
1904
+ if (source == analyzeItem)
17411905 {
17421906 AnalyzeObject();
17431907 } else
1744
- if (event.getSource() == dumpItem)
1908
+ if (source == dumpItem)
17451909 {
17461910 DumpObject();
17471911 } else
1748
- if (event.getSource() == screenfitButton)
1912
+ if (source == oneStepButton)
1913
+ {
1914
+ Globals.ONESTEP = true;
1915
+ cameraView.repaint();
1916
+ } else
1917
+ if (source == screenfitButton)
17491918 {
17501919 //Reload(lastConverter, lastFilename, true);
17511920 ScreenFit();
17521921 } else
1753
- if (event.getSource() == screenfitpointButton)
1922
+ if (source == screenfitpointButton)
17541923 {
17551924 //Reload(lastConverter, lastFilename, true);
17561925 ScreenFitPoint();
17571926 } else
1758
- if (event.getSource() == snapobjectButton)
1927
+ if (source == snapobjectButton)
17591928 {
17601929 //Reload(lastConverter, lastFilename, true);
17611930 SnapObject();
....@@ -1766,13 +1935,13 @@
17661935 // Recompile();
17671936 // refreshContents();
17681937 // } else
1769
- if (event.getSource() == gcButton)
1938
+ if (source == gcButton)
17701939 {
17711940 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17721941 System.gc();
17731942 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17741943 } else
1775
- if (event.getSource() == editLeafItem)
1944
+ if (source == editLeafItem)
17761945 {
17771946 Object3D obj;
17781947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +1955,70 @@
17861955 }
17871956 refreshContents(true);
17881957 } else
1789
- if (event.getSource() == openWindowItem)
1958
+ if (source == openWindowItem)
17901959 {
17911960 EditSelection(true);
17921961 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1962
+ if (source == cutItem || source == clearButton)
17941963 {
17951964 loadClipboard(true);
17961965 } else
1797
- if (event.getSource() == duplicateItem)
1966
+ if (source == duplicateItem)
17981967 {
1799
- Object3D keep = GraphreeD.clipboard;
1968
+ Object3D keep = GrafreeD.clipboard;
18001969 loadClipboard(false);
18011970 paste(false);
1802
- GraphreeD.clipboard = keep;
1971
+ GrafreeD.clipboard = keep;
18031972 } else
1804
- if (event.getSource() == cloneItem)
1973
+ if (source == cloneItem)
18051974 {
18061975 CloneSelection(false);
18071976 } else
1808
- if (event.getSource() == cloneSupportItem)
1977
+ if (source == cloneSupportItem)
18091978 {
18101979 CloneSelection(true);
18111980 } else
1812
- if (event.getSource() == copyItem)
1981
+ if (source == copyItem)
18131982 {
18141983 loadClipboard(false);
18151984 } else
1816
- if (event.getSource() == pasteItem)
1985
+ if (source == pasteItem)
18171986 {
18181987 paste(false);
18191988 } else
1820
- if (event.getSource() == pasteLinkItem)
1989
+ if (source == pasteIntoItem)
18211990 {
1822
- pasteInto(false);
1991
+ pasteInto(true, false);
18231992 } else
1824
- if (event.getSource() == pasteCloneItem)
1993
+ if (source == pasteLinkItem)
18251994 {
1826
- pasteInto(true);
1995
+ pasteInto(false, false);
18271996 } else
1828
- if (event.getSource() == pasteExpandItem)
1997
+ if (source == pasteCloneItem)
1998
+ {
1999
+ pasteInto(true, true);
2000
+ } else
2001
+ if (source == pasteExpandItem)
18292002 {
18302003 paste(true);
18312004 } else
1832
- if (event.getSource() == synchronizeItem)
2005
+ if (source == synchronizeItem)
18332006 {
18342007 Overwrite(Object3D.TRANSFORM);
18352008 } else
1836
- if (event.getSource() == overwriteNameItem)
2009
+ if (source == overwriteNameItem)
18372010 {
18382011 Overwrite(Object3D.NAME);
18392012 } else
1840
- if (event.getSource() == overwriteUVItem)
2013
+ if (source == overwriteUVItem)
18412014 {
18422015 Overwrite(Object3D.UV);
18432016 } else
1844
- if (event.getSource() == overwriteMatItem)
2017
+ if (source == overwriteMatItem)
18452018 {
2019
+ /* july 2015
18462020 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2021
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482022 else
18492023 {
18502024 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2030,16 @@
18562030 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572031 }
18582032 }
2033
+ */
2034
+
2035
+ Overwrite(dropAttributes);
18592036 }
1860
- if (event.getSource() == overwriteGeoItem)
2037
+ if (source == overwriteGeoItem)
18612038 {
18622039 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2040
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642041 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2042
+// Object3D content = GrafreeD.clipboard.get(0);
18662043 //
18672044 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682045 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2051,7 @@
18742051 // refreshContents();
18752052 // }
18762053 } else
1877
- if (event.getSource() == generateMeshItem)
2054
+ if (source == generateMeshItem)
18782055 {
18792056 //if (group.selection.size() == 1)
18802057 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2062,7 @@
18852062 ResetModel();
18862063 refreshContents();
18872064 } else
1888
- if (event.getSource() == extractGeometriesItem)
2065
+ if (source == extractGeometriesItem)
18892066 {
18902067 boolean one = false;
18912068
....@@ -1912,7 +2089,7 @@
19122089 ResetModel();
19132090 refreshContents();
19142091 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2092
+ if (source == cloneGeometriesItem)
19162093 {
19172094 boolean one = false;
19182095
....@@ -1938,32 +2115,37 @@
19382115 ResetModel();
19392116 refreshContents();
19402117 } else
1941
- if (event.getSource() == shareGeometriesItem)
2118
+ if (source == shareGeometriesItem)
19422119 {
19432120 boolean one = false;
19442121
19452122 if (group.selection.size() == 1)
19462123 one = true;
19472124
2125
+ Object3D merge = null;
2126
+
19482127 Object3D content = new cGroup();
19492128
19502129 for (int i=0; i<group.selection.size(); i++)
19512130 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2131
+ merge = new Merge(group.selection.get(i));
19532132
19542133 if (one)
1955
- makeSomething(sel, false);
2134
+ makeSomething(merge, false);
19562135 else
1957
- content.addChild(sel);
2136
+ content.addChild(merge);
19582137 }
19592138
19602139 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2140
+ makeSomething(content, true);
2141
+ else
2142
+ {
2143
+ ResetModel();
2144
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2145
+ refreshContents();
2146
+ }
19652147 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2148
+ if (source == mergeGeometriesItem)
19672149 {
19682150 boolean one = false;
19692151
....@@ -1993,11 +2175,11 @@
19932175 ResetModel();
19942176 refreshContents();
19952177 } else
1996
- if (event.getSource() == linkverticesItem)
2178
+ if (source == linkverticesItem)
19972179 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2180
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992181 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2182
+// Object3D content = GrafreeD.clipboard.get(0);
20012183 //
20022184 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032185 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2188,48 @@
20062188 // group.selection.get(0).setMasterThis(content); // should be identity
20072189 // refreshContents();
20082190 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2191
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20102192 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2193
+ Object3D content = GrafreeD.clipboard.get(0);
20122194
20132195 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142196 content = ((cGroup)content).get(0);
20152197
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2198
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172199 for (int i=0; i<group.selection.size(); i++)
20182200 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2201
+ boolean random = CameraPane.SWITCH;
2202
+ CameraPane.SWITCH = false; // parse all random nodes
20212203 group.selection.get(i).linkVerticesThis(content);
20222204 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2205
+ CameraPane.SWITCH = random;
20242206 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2207
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262208 refreshContents();
20272209 }
20282210 } else
2029
- if (event.getSource() == resetsupportItem)
2211
+ if (source == resetsupportItem)
20302212 {
20312213 for (int i=0; i<group.selection.size(); i++)
20322214 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2215
+ boolean random = CameraPane.SWITCH;
2216
+ CameraPane.SWITCH = false; // parse all random nodes
20352217 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2218
+ CameraPane.SWITCH = random;
20372219 }
20382220
20392221 refreshContents();
20402222 } else
2041
- if (event.getSource() == resetreferencesItem)
2223
+ if (source == relinkverticesItem)
2224
+ {
2225
+ boolean random = CameraPane.SWITCH;
2226
+ CameraPane.SWITCH = false; // parse all random nodes
2227
+ group.selection.RelinkToSupport();
2228
+ CameraPane.SWITCH = random;
2229
+
2230
+ refreshContents();
2231
+ } else
2232
+ if (source == resetreferencesItem)
20422233 {
20432234 for (int i=0; i<group.selection.size(); i++)
20442235 {
....@@ -2047,11 +2238,11 @@
20472238
20482239 refreshContents();
20492240 } else
2050
- if (event.getSource() == setMasterItem)
2241
+ if (source == setMasterItem)
20512242 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2243
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20532244 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2245
+ Object3D content = GrafreeD.clipboard.get(0);
20552246
20562247 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572248 content = ((cGroup)content).get(0);
....@@ -2060,13 +2251,13 @@
20602251 refreshContents();
20612252 }
20622253 } else
2063
- if (event.getSource() == poseMeshItem)
2254
+ if (source == poseMeshItem)
20642255 {
20652256 if (group.selection.size() == 1)
20662257 {
2067
- if (GraphreeD.clipboard.size() == 1)
2258
+ if (GrafreeD.clipboard.size() == 1)
20682259 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2260
+ Object3D content = GrafreeD.clipboard.get(0);
20702261
20712262 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722263 content = ((cGroup)content).get(0);
....@@ -2079,19 +2270,19 @@
20792270 }
20802271
20812272 } else
2082
- if (event.getSource() == revertMeshItem)
2273
+ if (source == revertMeshItem)
20832274 {
20842275 RevertMeshes();
20852276 } else
2086
- if (event.getSource() == resetMeshItem)
2277
+ if (source == resetMeshItem)
20872278 {
20882279 ResetAll();
20892280 } else
2090
- if (event.getSource() == stepAllItem)
2281
+ if (source == stepAllItem)
20912282 {
20922283 StepAll();
20932284 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2285
+ if (source == clearItem) // || event.getSource() == clearButton)
20952286 {
20962287 //int indices[] = jList.getSelectedIndices();
20972288 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2290,46 @@
20992290
21002291 ClearSelection(false);
21012292 } else
2102
- if (event.getSource() == clearAllItem)
2293
+ if (source == clearAllItem)
21032294 {
21042295 ClearSelection(true);
21052296 } else
2106
- if (event.getSource() == grabItem)
2297
+ if (source == grabItem)
21072298 {
21082299 group(new cGroup(), true);
21092300 } else
2110
- if (event.getSource() == frontItem)
2301
+ if (source == hideItem)
2302
+ {
2303
+ group(new HiddenObject());
2304
+ } else
2305
+ if (source == frontItem)
21112306 {
21122307 front();
21132308 } else
2114
- if (event.getSource() == backItem)
2309
+ if (source == backItem)
21152310 {
21162311 back();
21172312 } else
2118
- if (event.getSource() == cameraItem)
2313
+ if (source == cameraItem)
21192314 {
21202315 makeSomething(new Camera());
21212316 } else
2122
- if (event.getSource() == compositeItem)
2317
+ if (source == compositeItem)
21232318 {
21242319 group(new Composite());
21252320 } else
2126
- if (event.getSource() == randomItem)
2321
+ if (source == randomItem)
21272322 {
21282323 RandomNode random = new RandomNode();
21292324 group(random);
21302325 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2326
+ random.name = random.get(0).name + "Switch";
21322327 } else
2133
- if (event.getSource() == physicsItem)
2328
+ if (source == physicsItem)
21342329 {
21352330 group(new PhysicsNode());
21362331 } else
2137
- if (event.getSource() == frameselectorItem)
2332
+ if (source == frameselectorItem)
21382333 {
21392334 for (int i=0; i<group.selection.size(); i++)
21402335 {
....@@ -2146,7 +2341,7 @@
21462341 ResetModel();
21472342 refreshContents();
21482343 } else
2149
- if (event.getSource() == switchGeoItem)
2344
+ if (source == switchGeoItem)
21502345 {
21512346 for (int i=0; i<group.selection.size(); i++)
21522347 {
....@@ -2158,7 +2353,7 @@
21582353 ResetModel();
21592354 refreshContents();
21602355 } else
2161
- if (event.getSource() == switchTransfoItem)
2356
+ if (source == switchTransfoItem)
21622357 {
21632358 for (int i=0; i<group.selection.size(); i++)
21642359 {
....@@ -2170,7 +2365,7 @@
21702365 ResetModel();
21712366 refreshContents();
21722367 } else
2173
- if (event.getSource() == morphItem)
2368
+ if (source == morphItem)
21742369 {
21752370 for (int i=0; i<group.selection.size(); i++)
21762371 {
....@@ -2182,7 +2377,7 @@
21822377 ResetModel();
21832378 refreshContents();
21842379 } else
2185
- if (event.getSource() == scriptNodeItem)
2380
+ if (source == scriptNodeItem)
21862381 {
21872382 boolean atleastone = false;
21882383
....@@ -2221,191 +2416,215 @@
22212416 }
22222417 }
22232418 } else
2224
- if (event.getSource() == linkerItem)
2419
+ if (source == linkerItem)
22252420 {
22262421 group(new cLinker());
22272422 } else
2228
- if (event.getSource() == textureItem)
2423
+ if (source == textureItem)
22292424 {
22302425 group(new TextureNode());
22312426 } else
2232
- if (event.getSource() == shadowXItem)
2427
+ if (source == billboardItem)
2428
+ {
2429
+ group(new BillboardNode());
2430
+ } else
2431
+ if (source == shadowXItem)
22332432 {
22342433 CastShadow(0);
22352434 } else
2236
- if (event.getSource() == shadowYItem)
2435
+ if (source == shadowYItem)
22372436 {
22382437 CastShadow(1);
22392438 } else
2240
- if (event.getSource() == shadowZItem)
2439
+ if (source == shadowZItem)
22412440 {
22422441 CastShadow(2);
22432442 } else
2244
- if (event.getSource() == ungroupItem)
2443
+ if (source == ungroupItem)
22452444 {
2246
- ungroup();
2445
+ //ungroup();
2446
+ for (int i=0; i<group.selection.size(); i++)
2447
+ {
2448
+ Ungroup(group.selection.get(i));
2449
+ }
2450
+
2451
+ ClearSelection(false);
2452
+
2453
+ refreshContents();
22472454 } else
2248
- if (event.getSource() == genUVItem)
2455
+ if (source == genUVItem)
22492456 {
22502457 GenUV();
22512458 } else
2252
- if (event.getSource() == genNormalsCADItem)
2459
+ if (source == genNormalsCADItem)
22532460 {
22542461 GenNormals(true);
22552462 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2463
+ if (source == genNormalsMESHItem)
2464
+ {
2465
+ GenNormals(true); // TODO
2466
+ } else
2467
+ if (source == genNormalsORGANItem)
22572468 {
22582469 GenNormals(false);
22592470 } else
2260
- if (event.getSource() == stripifyItem)
2471
+ if (source == genNormalsMINEItem)
2472
+ {
2473
+ GenNormalsMINE();
2474
+ } else
2475
+ if (source == stripifyItem)
22612476 {
22622477 Stripify();
22632478 } else
2264
- if (event.getSource() == unstripifyItem)
2479
+ if (source == unstripifyItem)
22652480 {
22662481 Unstripify();
22672482 } else
2268
- if (event.getSource() == trimItem)
2483
+ if (source == trimItem)
22692484 {
22702485 Trim();
22712486 } else
2272
- if (event.getSource() == untrimItem)
2487
+ if (source == untrimItem)
22732488 {
22742489 Untrim();
22752490 } else
2276
- if (event.getSource() == clearColorsItem)
2491
+ if (source == clearColorsItem)
22772492 {
22782493 ClearColors();
22792494 } else
2280
- if (event.getSource() == clearMaterialsItem)
2495
+ if (source == clearMaterialsItem)
22812496 {
22822497 ClearMaterials();
22832498 } else
2284
- if (event.getSource() == liveleavesItem)
2499
+ if (source == liveleavesItem)
22852500 {
22862501 LiveLeaves(true);
22872502 } else
2288
- if (event.getSource() == unliveleavesItem)
2503
+ if (source == unliveleavesItem)
22892504 {
22902505 LiveLeaves(false);
22912506 } else
2292
- if (event.getSource() == supportleavesItem)
2507
+ if (source == supportleavesItem)
22932508 {
22942509 SupportLeaves(true);
22952510 } else
2296
- if (event.getSource() == unsupportleavesItem)
2511
+ if (source == unsupportleavesItem)
22972512 {
22982513 SupportLeaves(false);
22992514 } else
2300
- if (event.getSource() == hideleavesItem)
2515
+ if (source == hideleavesItem)
23012516 {
23022517 HideLeaves(true);
23032518 } else
2304
- if (event.getSource() == showleavesItem)
2519
+ if (source == showleavesItem)
23052520 {
23062521 HideLeaves(false);
23072522 } else
2308
- if (event.getSource() == markleavesItem)
2523
+ if (source == markleavesItem)
23092524 {
23102525 MarkLeaves(true);
23112526 } else
2312
- if (event.getSource() == unmarkleavesItem)
2527
+ if (source == unmarkleavesItem)
23132528 {
23142529 MarkLeaves(false);
23152530 } else
2316
- if (event.getSource() == flipVItem)
2531
+ if (source == flipVItem)
23172532 {
23182533 FlipV(true);
23192534 } else
2320
- if (event.getSource() == unflipVItem)
2535
+ if (source == unflipVItem)
23212536 {
23222537 FlipV(false);
23232538 } else
2324
- if (event.getSource() == lowTexturesItem)
2539
+ if (source == lowTexturesItem)
23252540 {
23262541 SetTexRes(0);
23272542 } else
2328
- if (event.getSource() == normalTexturesItem)
2543
+ if (source == normalTexturesItem)
23292544 {
23302545 SetTexRes(1);
23312546 } else
2332
- if (event.getSource() == highTexturesItem)
2547
+ if (source == highTexturesItem)
23332548 {
23342549 SetTexRes(2);
23352550 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2551
+ if (source == veryhighTexturesItem)
23372552 {
23382553 SetTexRes(3);
23392554 } else
2340
- if (event.getSource() == maxTexturesItem)
2555
+ if (source == maxTexturesItem)
23412556 {
23422557 SetTexRes(4);
23432558 } else
2344
- if (event.getSource() == panoTexturesItem)
2559
+ if (source == panoTexturesItem)
23452560 {
23462561 SetTexRes(5);
23472562 } else
2348
- if (event.getSource() == reverseNormalsItem)
2563
+ if (source == reverseNormalsItem)
23492564 {
23502565 ReverseNormals();
23512566 } else
2352
- if (event.getSource() == parseverticesItem)
2567
+ if (source == parseverticesItem)
23532568 {
23542569 ParseVertices();
23552570 } else
2356
- if (event.getSource() == alignItem)
2571
+ if (source == textureFieldItem)
2572
+ {
2573
+ TextureVertices();
2574
+ } else
2575
+ if (source == alignItem)
23572576 {
23582577 Align();
23592578 } else
2360
- if (event.getSource() == mirrorItem)
2579
+ if (source == mirrorItem)
23612580 {
23622581 MirrorPoses();
23632582 } else
2364
- if (event.getSource() == reduceMorphItem)
2583
+ if (source == reduceMorphItem)
23652584 {
23662585 MeshReduction(false);
23672586 } else
2368
- if (event.getSource() == reduce34MorphItem)
2587
+ if (source == reduce34MorphItem)
23692588 {
23702589 MeshReduction(true);
23712590 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2591
+ if (source == reverseTrianglesItem)
23732592 {
23742593 ReverseTriangles();
23752594 } else
2376
- if (event.getSource() == reduceMeshItem)
2595
+ if (source == reduceMeshItem)
23772596 {
23782597 ReduceMesh(false);
23792598 } else
2380
- if (event.getSource() == reduce34MeshItem)
2599
+ if (source == reduce34MeshItem)
23812600 {
23822601 ReduceMesh(true);
23832602 } else
2384
- if (event.getSource() == increaseMeshItem)
2603
+ if (source == increaseMeshItem)
23852604 {
23862605 IncreaseMesh();
23872606 } else
2388
- if (event.getSource() == clipMeshItem)
2607
+ if (source == clipMeshItem)
23892608 {
23902609 ClipMesh();
23912610 } else
2392
- if (event.getSource() == smoothMeshItem)
2611
+ if (source == smoothMeshItem)
23932612 {
23942613 SmoothMesh();
23952614 } else
2396
- if (event.getSource() == transformgeometryItem)
2615
+ if (source == transformgeometryItem)
23972616 {
23982617 TransformGeometry();
23992618 } else
2400
- if (event.getSource() == resetTransformItem)
2619
+ if (source == resetTransformItem)
24012620 {
24022621 ResetTransform();
24032622 } else
2404
- if (event.getSource() == resetCentroidItem)
2623
+ if (source == resetCentroidItem)
24052624 {
24062625 ResetCentroid();
24072626 } else
2408
- if (event.getSource() == resetParentItem)
2627
+ if (source == resetParentItem)
24092628 {
24102629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112630 {
....@@ -2415,7 +2634,7 @@
24152634
24162635 refreshContents();
24172636 } else
2418
- if (event.getSource() == repairParentItem)
2637
+ if (source == repairParentItem)
24192638 {
24202639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212640 {
....@@ -2429,7 +2648,21 @@
24292648
24302649 refreshContents();
24312650 } else
2432
- if (event.getSource() == sortbysizeItem)
2651
+ if (source == repairShadowItem)
2652
+ {
2653
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2654
+ {
2655
+ Object3D obj = (Object3D)e.nextElement();
2656
+ obj.RepairShadow();
2657
+// for (int i=0; i<obj.size(); i++)
2658
+// {
2659
+// obj.get(i).parent = obj;
2660
+// }
2661
+ }
2662
+
2663
+ refreshContents();
2664
+ } else
2665
+ if (source == sortbysizeItem)
24332666 {
24342667 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352668 {
....@@ -2441,7 +2674,7 @@
24412674 ResetModel();
24422675 refreshContents();
24432676 } else
2444
- if (event.getSource() == sortbynameItem)
2677
+ if (source == sortbynameItem)
24452678 {
24462679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472680 {
....@@ -2453,7 +2686,7 @@
24532686 ResetModel();
24542687 refreshContents();
24552688 } else
2456
- if (event.getSource() == attachPigmentItem)
2689
+ if (source == attachPigmentItem)
24572690 {
24582691 String texture = GetFile("Attach pigment");
24592692 Object3D obj;
....@@ -2465,7 +2698,7 @@
24652698
24662699 refreshContents();
24672700 } else
2468
- if (event.getSource() == detachPigmentItem)
2701
+ if (source == detachPigmentItem)
24692702 {
24702703 Object3D obj;
24712704 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2709,7 @@
24762709
24772710 refreshContents();
24782711 } else
2479
- if (event.getSource() == attachBumpItem)
2712
+ if (source == attachBumpItem)
24802713 {
24812714 String texture = GetFile("Attach bump");
24822715 Object3D obj;
....@@ -2488,7 +2721,7 @@
24882721
24892722 refreshContents();
24902723 } else
2491
- if (event.getSource() == detachBumpItem)
2724
+ if (source == detachBumpItem)
24922725 {
24932726 Object3D obj;
24942727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2732,7 @@
24992732
25002733 refreshContents();
25012734 } else
2502
- if (event.getSource() == pigmentBumpItem)
2735
+ if (source == pigmentBumpItem)
25032736 {
25042737 Object3D obj;
25052738 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2743,195 @@
25102743
25112744 refreshContents();
25122745 } else
2513
- if (event.getSource() == flashSelectionButton)
2746
+ if (source == flashSelectionButton)
25142747 {
25152748 CameraPane.flash = true;
25162749 refreshContents();
25172750 } else
2518
- if (event.getSource() == oneButton)
2751
+ if (source == oneButton)
25192752 {
25202753 } else
2521
- if (event.getSource() == twoButton)
2754
+ if (source == twoButton)
25222755 {
25232756 radio.layout = twoButton;
25242757 // bug
25252758 //gridPanel.setDividerLocation(1.0);
25262759 //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();
2760
+// bigThree.remove(scenePanel);
2761
+// bigThree.remove(centralPanel);
2762
+// bigThree.remove(XYZPanel);
2763
+// aWindowConstraints.gridx = 0;
2764
+// aWindowConstraints.gridy = 0;
2765
+// aWindowConstraints.gridwidth = 1;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2768
+// aWindowConstraints.weightx = 0;
2769
+// aWindowConstraints.weighty = 1;
2770
+// //bigThree.add(jtp, aWindowConstraints);
2771
+// aWindowConstraints.weightx = 1;
2772
+// aWindowConstraints.gridwidth = 3;
2773
+// // aConstraints.gridheight = 3;
2774
+// aWindowConstraints.gridx = 1;
2775
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2776
+// bigThree.add(centralPanel, aWindowConstraints);
2777
+// aWindowConstraints.weightx = 0;
2778
+// aWindowConstraints.gridx = 4;
2779
+// aWindowConstraints.gridwidth = 1;
2780
+// // aConstraints.gridheight = 3;
2781
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2782
+// //bigThree.add(XYZPanel, aWindowConstraints);
2783
+// scenePanel.setVisible(false);
2784
+// centralPanel.setVisible(true);
2785
+// XYZPanel.setVisible(false);
2786
+ bigThree.ClearUI();
2787
+ bigThree.add(centralPanel);
2788
+ bigThree.FlushUI();
25512789 } else
2552
- if (event.getSource() == threeButton)
2790
+ if (source == threeButton)
25532791 {
25542792 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();
2793
+
2794
+// bigThree.remove(scenePanel);
2795
+// bigThree.remove(centralPanel);
2796
+// bigThree.remove(XYZPanel);
2797
+// aWindowConstraints.gridx = 0;
2798
+// aWindowConstraints.gridy = 0;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// aWindowConstraints.weightx = 0;
2803
+// aWindowConstraints.weighty = 1;
2804
+// //bigThree.add(jtp, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 1;
2806
+// aWindowConstraints.gridwidth = 3;
2807
+// // aConstraints.gridheight = 3;
2808
+// aWindowConstraints.gridx = 1;
2809
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2810
+// bigThree.add(centralPanel, aWindowConstraints);
2811
+// aWindowConstraints.weightx = 0;
2812
+// aWindowConstraints.gridx = 4;
2813
+// aWindowConstraints.gridwidth = 1;
2814
+// // aConstraints.gridheight = 3;
2815
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2816
+// bigThree.add(XYZPanel, aWindowConstraints);
2817
+// bigThree.validate();
2818
+// scenePanel.setVisible(false);
2819
+// centralPanel.setVisible(true);
2820
+// XYZPanel.setVisible(true);
2821
+ bigThree.ClearUI();
2822
+ bigThree.add(centralPanel);
2823
+ bigThree.add(XYZPanel);
2824
+ bigThree.FlushUI();
25792825 } else
2580
- if (event.getSource() == fourButton)
2826
+ if (source == fourButton)
25812827 {
25822828 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();
2829
+
2830
+// bigThree.remove(scenePanel);
2831
+// bigThree.remove(centralPanel);
2832
+// bigThree.remove(XYZPanel);
2833
+// aWindowConstraints.gridx = 0;
2834
+// aWindowConstraints.gridy = 0;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aWindowConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2838
+// aWindowConstraints.weightx = 1;
2839
+// aWindowConstraints.weighty = 1;
2840
+// bigThree.add(scenePanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 1;
2842
+// aWindowConstraints.gridwidth = 3;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.gridx = 1;
2845
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2846
+// //bigThree.add(cameraPanel, aWindowConstraints);
2847
+// aWindowConstraints.weightx = 0;
2848
+// aWindowConstraints.gridx = 4;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aWindowConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// //bigThree.add(XYZPanel, aWindowConstraints);
2853
+// bigThree.validate();
2854
+// scenePanel.setVisible(true);
2855
+// centralPanel.setVisible(false);
2856
+// XYZPanel.setVisible(false);
2857
+ bigThree.ClearUI();
2858
+ bigThree.add(scenePanel);
2859
+ bigThree.FlushUI();
26072860 } else
2608
- if (event.getSource() == sixButton)
2861
+ if (source == sixButton)
26092862 {
26102863 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();
2864
+
2865
+// bigThree.remove(scenePanel);
2866
+// bigThree.remove(centralPanel);
2867
+// bigThree.remove(XYZPanel);
2868
+// aWindowConstraints.gridx = 0;
2869
+// aWindowConstraints.gridy = 0;
2870
+// aWindowConstraints.gridwidth = 1;
2871
+// // aConstraints.gridheight = 3;
2872
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2873
+// aWindowConstraints.weightx = 0;
2874
+// aWindowConstraints.weighty = 1;
2875
+// bigThree.add(scenePanel, aWindowConstraints);
2876
+// aWindowConstraints.weightx = 1;
2877
+// aWindowConstraints.gridwidth = 3;
2878
+// // aWindowConstraints.gridheight = 3;
2879
+// aWindowConstraints.gridx = 1;
2880
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2881
+// bigThree.add(centralPanel, aWindowConstraints);
2882
+// aWindowConstraints.weightx = 0;
2883
+// aWindowConstraints.gridx = 4;
2884
+// aWindowConstraints.gridwidth = 1;
2885
+// // aWindowConstraints.gridheight = 3;
2886
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2887
+// //bigThree.add(XYZPanel, aConstraints);
2888
+// bigThree.validate();
2889
+// scenePanel.setVisible(true);
2890
+// centralPanel.setVisible(true);
2891
+// XYZPanel.setVisible(false);
2892
+ bigThree.ClearUI();
2893
+ bigThree.add(scenePanel);
2894
+ bigThree.add(centralPanel);
2895
+ bigThree.FlushUI();
26352896 } else
2636
- if (event.getSource() == sevenButton)
2897
+ if (source == sevenButton)
26372898 {
26382899 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();
2900
+
2901
+// bigThree.remove(scenePanel);
2902
+// bigThree.remove(centralPanel);
2903
+// bigThree.remove(XYZPanel);
2904
+// aWindowConstraints.gridx = 0;
2905
+// aWindowConstraints.gridy = 0;
2906
+// aWindowConstraints.gridwidth = 1;
2907
+// // aWindowConstraints.gridheight = 3;
2908
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2909
+// aWindowConstraints.weightx = 0;
2910
+// aWindowConstraints.weighty = 1;
2911
+// bigThree.add(scenePanel, aWindowConstraints);
2912
+// aWindowConstraints.weightx = 1;
2913
+// aWindowConstraints.gridwidth = 3;
2914
+// // aWindowConstraints.gridheight = 3;
2915
+// aWindowConstraints.gridx = 1;
2916
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2917
+// bigThree.add(centralPanel, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 0;
2919
+// aWindowConstraints.gridx = 4;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// bigThree.add(XYZPanel, aWindowConstraints);
2924
+// bigThree.validate();
2925
+// scenePanel.setVisible(true);
2926
+// centralPanel.setVisible(true);
2927
+// XYZPanel.setVisible(true);
2928
+ bigThree.ClearUI();
2929
+ bigThree.add(scenePanel);
2930
+ bigThree.add(centralPanel);
2931
+ bigThree.add(XYZPanel);
2932
+ bigThree.FlushUI();
26632933 } else
2664
- if (event.getSource() == rootButton)
2934
+ if (source == rootButton)
26652935 {
26662936 Object3D obj;
26672937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +2943,7 @@
26732943
26742944 refreshContents(true);
26752945 } else
2676
- if (event.getSource() == closeButton)
2946
+ if (source == closeButton)
26772947 {
26782948 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26792949 cRadio ab;
....@@ -2694,11 +2964,11 @@
26942964 }
26952965 refreshContents(true);
26962966 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
2967
+ if (source == editItem || source == editButton)
26982968 {
26992969 EditSelection(false);
27002970 } else
2701
- if (event.getSource() == uneditButton)
2971
+ if (source == uneditButton)
27022972 {
27032973 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27042974 {
....@@ -2710,12 +2980,12 @@
27102980
27112981 child.editWindow = null; // ???????????
27122982 }
2713
- objEditor.ctrlPanel.revalidate();
2983
+ objEditor.ctrlPanel.FlushUI();
27142984 //objEditor.jTree.clearSelection();
27152985 //objEditor.ResetSliders();
27162986 refreshContents(true);
27172987 } else
2718
- if (event.getSource() == clearPanelButton)
2988
+ if (source == clearPanelButton)
27192989 {
27202990 assert(copy == group);
27212991 //copy.ClearUI();
....@@ -2726,7 +2996,7 @@
27262996 listUI.clear();
27272997 refreshContents(true);
27282998 } else
2729
- if (event.getSource() == allParamsButton)
2999
+ if (source == allParamsButton)
27303000 {
27313001 assert(copy == group);
27323002
....@@ -2747,19 +3017,19 @@
27473017
27483018 refreshContents(true);
27493019 } else
2750
- if (event.getSource() == unselectButton)
3020
+ if (source == unselectButton)
27513021 {
27523022 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3023
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543024 objEditor.ResetSliders();
27553025 refreshContents(true);
27563026 } else
2757
- if(event.getSource() instanceof cRadio)
3027
+ if(source instanceof cRadio)
27583028 {
27593029 group.parent = keepparent;
27603030 group.attributes = 0;
27613031 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3032
+ /*cRadio*/ radio = (cRadio)source;
27633033 Object3D obj = radio.GetObject();
27643034 System.out.println("Edit " + obj);
27653035 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3049,7 @@
27793049 }
27803050
27813051 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3052
+ //Globals.theRenderer.object = group;
27833053 if(!useclient)
27843054 {
27853055 cameraView.renderCamera = radio.camera;
....@@ -2788,7 +3058,8 @@
27883058 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893059 cameraView.targetLookAt.set(radio.camera.lookAt);
27903060 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3061
+ //cameraView.lighttouched = true;
3062
+ Globals.lighttouched = true;
27923063 topView.object = group;
27933064 frontView.object = group;
27943065 sideView.object = group;
....@@ -2824,7 +3095,7 @@
28243095 if (useclient)
28253096 {
28263097 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3098
+ Globals.lighttouched = true;
28283099 //topView.object = client;
28293100 //frontView.object = client;
28303101 //sideView.object = client;
....@@ -2832,7 +3103,7 @@
28323103 else
28333104 {
28343105 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3106
+ Globals.lighttouched = true;
28363107 //topView.object = group;
28373108 //frontView.object = group;
28383109 //sideView.object = group;
....@@ -3065,9 +3336,9 @@
30653336 obj = (Object3D)e.nextElement();
30663337
30673338 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3339
+ GrafreeD.AnalyzeObject(obj);
30693340 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3341
+ GrafreeD.AnalyzeObject(obj.bRep);
30713342
30723343 // System.err.println((size/1024) + " KB is the size of " + obj);
30733344 }
....@@ -3109,6 +3380,13 @@
31093380 void GenNormals(boolean crease)
31103381 {
31113382 group.GenNormalsS(crease);
3383
+
3384
+ refreshContents();
3385
+ }
3386
+
3387
+ void GenNormalsMINE()
3388
+ {
3389
+ group.selection.GenNormalsMINE();
31123390
31133391 refreshContents();
31143392 }
....@@ -3157,104 +3435,250 @@
31573435
31583436 //Object3D buffer;
31593437 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
-
3438
+// BoundaryRep temprep;
3439
+// Object3D nodes;
3440
+// Vector<Vertex> vertices;
3441
+//
3442
+// cGroup buffer;
3443
+//
3444
+// public void Vertex(Object3D node, Vertex v)
3445
+// {
3446
+//// vertices.add(v);
3447
+//// nodes.addElement(node);
3448
+////
3449
+//// if (temprep.GetCache(v) != null)
3450
+//// {
3451
+//// temprep.Remove(v);
3452
+//// } else
3453
+//// {
3454
+//// temprep.Remember(v);
3455
+//// }
3456
+//
3457
+// //Object3D node = nodes.get(index);
3458
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3459
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3460
+//
3461
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3462
+//
3463
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3464
+//
3465
+// cGroup g = new cGroup();
3466
+//
3467
+// if (g.toParent == null)
3468
+// {
3469
+// g.toParent = LA.newMatrix();
3470
+// g.fromParent = LA.newMatrix();
3471
+// }
3472
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3473
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3474
+//
3475
+// g.add(GrafreeD.clipboard);
3476
+//
3477
+// buffer.add(g);
3478
+// }
3479
+//
3480
+// public void Face(Object3D node, Face f)
3481
+// {
3482
+//
3483
+// }
3484
+//
3485
+// void ParseVerticesOld() // ??
3486
+// {
3487
+// //if (group.selection.size() != 1)
3488
+// // return;
3489
+//
3490
+// temprep = new BoundaryRep();
3491
+// nodes = new Object3D();
3492
+// vertices = new Vector<Vertex>();
3493
+//
3494
+// boolean epsequal = GrafreeD.epsequal;
3495
+// GrafreeD.epsequal = true;
3496
+//
3497
+// for (int i=0; i<group.selection.size(); i++)
3498
+// {
3499
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3500
+//
3501
+// group.selection.get(i).Parse(
3502
+//this );
3503
+//
3504
+// int repsize = temprep.VertexCount();
3505
+// int tablesize = temprep.vertextable.size();
3506
+// int nodesize = nodes.size();
3507
+//
3508
+// assert(vertices.size() == nodes.size());
3509
+//
3510
+// temprep.vertextable.elements();
3511
+//
3512
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3513
+//
3514
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3515
+// {
3516
+// cGroup g = new cGroup();
3517
+//
3518
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3519
+//
3520
+// Object3D node = nodes.get(index);
3521
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3522
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3523
+//
3524
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3525
+//
3526
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3527
+//
3528
+// if (g.toParent == null)
3529
+// {
3530
+// g.toParent = LA.newMatrix();
3531
+// g.fromParent = LA.newMatrix();
3532
+// }
3533
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3534
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3535
+//
3536
+// g.add(GrafreeD.clipboard);
3537
+//
3538
+// buffer.add(g);
3539
+// }
3540
+//
3541
+// makeSomething(buffer, i==group.selection.size()-1);
3542
+// }
3543
+//
3544
+// GrafreeD.epsequal = epsequal;
3545
+//
3546
+// //buffer = null;
3547
+// temprep = null;
3548
+// nodes = null;
3549
+//
3550
+// refreshContents();
3551
+// }
3552
+
31843553 void ParseVertices()
31853554 {
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;
3555
+ boolean epsequal = GrafreeD.epsequal;
3556
+ GrafreeD.epsequal = true;
31953557
31963558 for (int i=0; i<group.selection.size(); i++)
31973559 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3560
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993561
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3562
+ group.selection.get(i).Parse(
3563
+
3564
+ new iParse()
3565
+ {
3566
+ public void Vertex(Object3D node, Vertex v)
3567
+ {
3568
+ temp.set(v);
3569
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053570
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();
3571
+ cGroup g = new cGroup();
32113572
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3573
+ if (g.toParent == null)
3574
+ {
3575
+ g.toParent = LA.newMatrix();
3576
+ g.fromParent = LA.newMatrix();
3577
+ }
3578
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3579
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153580
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);
3581
+ g.add(GrafreeD.clipboard);
32203582
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);
3583
+ buffer.add(g);
3584
+ }
32323585
3233
- g.add(GraphreeD.clipboard);
3586
+ public void Face(Object3D node, Face f)
3587
+ {
32343588
3235
- buffer.add(g);
3236
- }
3589
+ }
3590
+ }
3591
+ );
32373592
32383593 makeSomething(buffer, i==group.selection.size()-1);
32393594 }
32403595
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3596
+ GrafreeD.epsequal = epsequal;
32463597
32473598 refreshContents();
32483599 }
3249
-
3600
+
3601
+ void TextureVertices()
3602
+ {
3603
+ for (int i=0; i<group.selection.size(); i++)
3604
+ {
3605
+ group.selection.get(i).Parse(
3606
+ new iParse()
3607
+ {
3608
+ public void Vertex(Object3D node, Vertex v)
3609
+ {
3610
+ cTexture tex = node.GetTextures();
3611
+ String pigment = Object3D.GetPigment(tex);
3612
+ //String bump = Object3D.GetBump(tex);
3613
+
3614
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3615
+
3616
+ double s = v.s;
3617
+
3618
+ if (s == 1)
3619
+ s = 0;
3620
+
3621
+ double t = v.t;
3622
+
3623
+ if (t == 1)
3624
+ t = 0;
3625
+
3626
+ int indexs = (int) (texturedata.getWidth() * s);
3627
+ int indext = (int) (texturedata.getHeight() * t);
3628
+
3629
+ int index = indext * texturedata.getWidth() + indexs;
3630
+
3631
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3632
+
3633
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3634
+
3635
+ float scale = bytebuf.get(index*slide) & 0xFF;
3636
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3637
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3638
+ scale /= 3;
3639
+
3640
+ scale /= 0xFF;
3641
+ // c'est quoi ca? scale /= 4;
3642
+
3643
+ //v.AO = scale;
3644
+
3645
+ v.x += v.norm.x * scale;
3646
+ v.y += v.norm.y * scale;
3647
+ v.z += v.norm.z * scale;
3648
+ }
3649
+
3650
+ public void Face(Object3D node, Face f)
3651
+ {
3652
+ }
3653
+ }
3654
+ );
3655
+ }
3656
+
3657
+ refreshContents();
3658
+ }
3659
+
32503660 void Align()
32513661 {
3662
+ if (group.selection.size() == 0)
3663
+ return;
3664
+
3665
+ cVector bbmin = new cVector();
3666
+ cVector bbmax = new cVector();
3667
+
3668
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3669
+
3670
+ double dx = bbmax.x - bbmin.x;
3671
+ double dy = bbmax.y - bbmin.y;
3672
+ double dz = bbmax.z - bbmin.z;
3673
+
3674
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3675
+
32523676 for (int i=0; i<group.selection.size(); i++)
32533677 {
32543678 Object3D obj = group.selection.get(i);
32553679
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3680
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3681
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583682 }
32593683
32603684 refreshContents();
....@@ -3267,7 +3691,7 @@
32673691 // ref.SaveSupports();
32683692 // Object3D par = ref.parent;
32693693 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3694
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713695 // ref.parent = par;
32723696 // ref.RestoreSupports();
32733697
....@@ -3275,11 +3699,11 @@
32753699
32763700 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773701
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3702
+ boolean random = CameraPane.SWITCH;
3703
+ CameraPane.SWITCH = false; // parse all random nodes
32803704 lowres.linkVerticesThis(null);
32813705 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3706
+ CameraPane.SWITCH = random;
32833707
32843708 System.err.flush();
32853709
....@@ -3297,7 +3721,7 @@
32973721 // lowres.SaveSupports();
32983722 // par = lowres.parent;
32993723 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3724
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013725 Object3D newlow = CloneObject(lowres, false);
33023726 newlow.name = sn.switchobject.get(i).name;
33033727 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3743,7 @@
33193743 return;
33203744
33213745 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3746
+ Object3D ref = GrafreeD.clipboard.get(0);
33233747
33243748 Object3D newgroup = new Object3D("Po:" + poses.name);
33253749
....@@ -3488,7 +3912,7 @@
34883912 group.selection.RelinkToSupport(); // july 2014
34893913 System.out.println("DONE.");
34903914 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3915
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34923916 }
34933917
34943918 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +3937,20 @@
35133937
35143938 void ClipMesh()
35153939 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3940
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
35173941 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
3942
+ Object3D content = GrafreeD.clipboard.get(0);
35193943
35203944 if (content instanceof cGroup && ((cGroup)content).transientlink )
35213945 content = ((cGroup)content).get(0);
35223946
35233947 // for (int i=0; i<group.selection.size(); i++)
35243948 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3949
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35263950 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
3951
+ group.selection.ClipMesh(GrafreeD.clipboard);
35283952 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
3953
+// group.selection.ClipMesh(GrafreeD.clipboard);
35303954 System.out.println("DONE.");
35313955 refreshContents();
35323956 }
....@@ -3764,25 +4188,25 @@
37644188 System.err.println("info : " + child.GetPath());
37654189 }
37664190 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4191
+// else
4192
+// {
4193
+// objEditor.SetMaterial(group); // .GetMaterial());
4194
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4195
+// System.err.println("info : " + group.GetPath());
4196
+// }
37734197
37744198 objEditor.SetText(); // jan 2014
37754199
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4200
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
37774201 CameraPane.flash = true;
37784202
37794203 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
37804204 // a camera
37814205 {
37824206 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;
4207
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4208
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4209
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864210 }
37874211
37884212 refreshContents();
....@@ -3864,12 +4288,12 @@
38644288 {
38654289 if (group.selection.isEmpty())
38664290 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4291
+ GrafreeD.clipboardIsTempGroup = false;
38684292 Composite tGroup = null;
38694293 if (group.selection.size() > 0) // 1)
38704294 {
38714295 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4296
+ GrafreeD.clipboardIsTempGroup = true;
38734297 }
38744298
38754299 if (cut)
....@@ -3909,16 +4333,16 @@
39094333 //System.out.println("cut " + child);
39104334 //System.out.println("parent = " + child.parent);
39114335 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4336
+ if (GrafreeD.clipboardIsTempGroup)
39134337 tGroup.add/*Child*/(tmp);
39144338 else
3915
- GraphreeD.clipboard = tmp;
4339
+ GrafreeD.clipboard = tmp;
39164340 }
39174341 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4342
+ if (GrafreeD.clipboardIsTempGroup)
39194343 tGroup.add/*Child*/(child);
39204344 else
3921
- GraphreeD.clipboard = child;
4345
+ GrafreeD.clipboard = child;
39224346 }
39234347
39244348 //ResetModel();
....@@ -3950,21 +4374,21 @@
39504374 //System.out.println("cut " + elem);
39514375 //System.out.println("parent = " + elem.parent);
39524376 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4377
+ if (GrafreeD.clipboardIsTempGroup)
39544378 tGroup.add/*Child*/(tmp);
39554379 else
3956
- GraphreeD.clipboard = tmp;
4380
+ GrafreeD.clipboard = tmp;
39574381 }
39584382 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4383
+ if (GrafreeD.clipboardIsTempGroup)
39604384 tGroup.add/*Child*/(child);
39614385 else
3962
- GraphreeD.clipboard = child;
4386
+ GrafreeD.clipboard = child;
39634387 }
39644388
39654389 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4390
+ if (GrafreeD.clipboardIsTempGroup)
4391
+ GrafreeD.clipboard = tGroup;
39684392 if (cut)
39694393 {
39704394 ResetModel();
....@@ -3974,11 +4398,11 @@
39744398
39754399 void paste(boolean expand)
39764400 {
3977
- // if (GraphreeD.clipboard == null)
4401
+ // if (GrafreeD.clipboard == null)
39784402 // return;
39794403 boolean first = true;
39804404
3981
- if (GraphreeD.clipboardIsTempGroup)
4405
+ if (GrafreeD.clipboardIsTempGroup)
39824406 {
39834407 Composite temp;
39844408
....@@ -3989,7 +4413,7 @@
39894413 temp = (Composite)Applet3D.clipboard.deepCopy();
39904414 */
39914415 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4416
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934417 {
39944418 Object3D child = (Object3D)e.nextElement();
39954419
....@@ -4003,7 +4427,7 @@
40034427 else
40044428 elem = child.deepCopy(); // ?
40054429 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4430
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074431 // elem = elem.get(0);
40084432 makeSomething(elem, true); // ?? first);
40094433 //group.addChild(elem);
....@@ -4023,23 +4447,23 @@
40234447 //Object3D cb = Applet3D.clipboard;
40244448 //temp.addChild(cb);
40254449 //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());
4450
+ assert(GrafreeD.clipboard.parent == null);
4451
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4452
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4453
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4454
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
40314455 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4456
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4457
+ GrafreeD.clipboard.get(0).parent = keepparent;
40344458 }
40354459
40364460 ResetModel();
40374461 refreshContents();
40384462 }
40394463
4040
- void pasteInto(boolean copyit)
4464
+ void pasteInto(boolean copyit, boolean clone)
40414465 {
4042
-// if (GraphreeD.clipboard == null)
4466
+// if (GrafreeD.clipboard == null)
40434467 // return;
40444468
40454469 if (group.selection.size() != 1)
....@@ -4066,15 +4490,22 @@
40664490 if (copyit)
40674491 {
40684492 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4493
+ if (clone)
4494
+ {
4495
+ CloneClipboard(false); // sept 2014
4496
+ }
4497
+ else
4498
+ {
4499
+ paste(false);
4500
+ }
40704501 }
40714502 else
40724503 {
40734504 boolean first = true;
40744505
4075
- if (GraphreeD.clipboardIsTempGroup)
4506
+ if (GrafreeD.clipboardIsTempGroup)
40764507 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4508
+ Composite temp = (Composite)GrafreeD.clipboard;
40784509 Object3D copy;
40794510 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804511 {
....@@ -4084,7 +4515,7 @@
40844515 }
40854516 } else
40864517 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4518
+ linkSomething(GrafreeD.clipboard); //.get(0));
40884519 }
40894520 }
40904521 }
....@@ -4276,6 +4707,26 @@
42764707 makeSomething(csg);
42774708 }
42784709
4710
+ void Ungroup(Object3D g)
4711
+ {
4712
+ if (g instanceof HiddenObject)
4713
+ {
4714
+ HiddenObject h = (HiddenObject) g;
4715
+
4716
+ for (int i=0; i<h.ActualSize(); i++)
4717
+ {
4718
+ objEditor.makeSomething(h.get(i), false);
4719
+ }
4720
+ }
4721
+ else
4722
+ {
4723
+ for (int i=0; i<g.Size(); i++)
4724
+ {
4725
+ objEditor.makeSomething(g.get(i), false);
4726
+ }
4727
+ }
4728
+ }
4729
+
42794730 void ungroup()
42804731 {
42814732 /*
....@@ -4471,7 +4922,7 @@
44714922
44724923 void ImportGFD()
44734924 {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4925
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
44754926 browser.show();
44764927 String filename = browser.getFile();
44774928 if (filename != null && filename.length() > 0)
....@@ -4509,7 +4960,7 @@
45094960
45104961 void ImportVRMLX3D()
45114962 {
4512
- if (GraphreeD.standAlone)
4963
+ if (GrafreeD.standAlone)
45134964 {
45144965 /**/
45154966 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4526,7 +4977,7 @@
45264977
45274978 String GetFile(String dialogName)
45284979 {
4529
- if (GraphreeD.standAlone)
4980
+ if (GrafreeD.standAlone)
45304981 {
45314982 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45324983 browser.show();
....@@ -4590,10 +5041,12 @@
45905041 cButton flashSelectionButton;
45915042 cButton editButton;
45925043 cButton uneditButton;
5044
+ JCheckBox allParamsButton;
45935045 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955046 cButton unselectButton;
45965047
5048
+ cButton oneStepButton;
5049
+
45975050 cButton screenfitButton;
45985051 cButton screenfitpointButton;
45995052 cButton snapobjectButton;
....@@ -4635,6 +5088,7 @@
46355088 private MenuItem resetsupportItem;
46365089 private MenuItem resetreferencesItem;
46375090 private MenuItem linkverticesItem;
5091
+ private MenuItem relinkverticesItem;
46385092 private MenuItem setMasterItem;
46395093 private MenuItem resetMeshItem;
46405094 private MenuItem stepAllItem;
....@@ -4647,14 +5101,17 @@
46475101 private MenuItem mergeGeometriesItem;
46485102 private MenuItem copyItem;
46495103 private MenuItem pasteItem;
5104
+ private MenuItem pasteIntoItem;
46505105 private MenuItem pasteLinkItem;
46515106 private MenuItem pasteCloneItem;
46525107 private MenuItem pasteExpandItem;
46535108 private MenuItem clearItem;
46545109 private MenuItem clearAllItem;
46555110 private MenuItem genUVItem;
5111
+ private MenuItem genNormalsMESHItem;
46565112 private MenuItem genNormalsCADItem;
46575113 private MenuItem genNormalsORGANItem;
5114
+ private MenuItem genNormalsMINEItem;
46585115 private MenuItem stripifyItem;
46595116 private MenuItem unstripifyItem;
46605117 private MenuItem trimItem;
....@@ -4696,6 +5153,7 @@
46965153 private MenuItem resetCentroidItem;
46975154 private MenuItem transformgeometryItem;
46985155 private MenuItem resetTransformItem;
5156
+ private MenuItem hideItem;
46995157 private MenuItem grabItem;
47005158 private MenuItem backItem;
47015159 private MenuItem frontItem;
....@@ -4716,6 +5174,7 @@
47165174
47175175 private MenuItem resetParentItem;
47185176 private MenuItem repairParentItem;
5177
+ private MenuItem repairShadowItem;
47195178 private MenuItem sortbysizeItem;
47205179 private MenuItem sortbynameItem;
47215180
....@@ -4728,16 +5187,19 @@
47285187 private MenuItem particleItem;
47295188 private MenuItem ragdollItem;
47305189 private MenuItem ragdoll2Item;
5190
+ private MenuItem heightFieldItem;
5191
+ private MenuItem textureFieldItem;
47315192 private MenuItem gridItem;
47325193 private MenuItem rectoidItem;
47335194 private MenuItem ellipsoidItem;
47345195 private MenuItem coneItem;
47355196 private MenuItem torusItem;
47365197 private MenuItem superItem;
5198
+ private MenuItem kleinItem;
47375199 private MenuItem blobItem;
47385200 private MenuItem latheItem;
47395201 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5202
+ private MenuItem overlayItem;
47415203 private MenuItem meshItem;
47425204 // private MenuItem meshGroupItem;
47435205 private MenuItem springItem;
....@@ -4746,6 +5208,7 @@
47465208 private MenuItem csgItem;
47475209 private MenuItem templateItem;
47485210 private MenuItem textureItem;
5211
+ private MenuItem billboardItem;
47495212 private MenuItem shadowXItem;
47505213 private MenuItem shadowYItem;
47515214 private MenuItem shadowZItem;