Normand Briere
2019-05-02 a7277e6c6381e55761f7fa87276260fac1c94d5e
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,33 @@
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
+ importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
443
+ importGFDItem.addActionListener(this);
444
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
445
+ importVRMLX3DItem.addActionListener(this);
446
+ importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem.addActionListener(this);
448
+ import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ import3DSItem.addActionListener(this);
450
+
451
+ oe.menuBar.add(menu = new Menu("Tools"));
376452 buildToolsMenu(menu);
377453 }
378454
....@@ -406,150 +482,98 @@
406482 oe.radioPanel.add(dummyButton);
407483 oe.buttonGroup.add(dummyButton);
408484 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
485
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412486
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
487
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
+ liveCB.setToolTipText("Enabled animation");
414489 liveCB.addItemListener(this);
415490
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);
491
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ oneStepButton.setToolTipText("Animate one step forward");
493
+ oneStepButton.addActionListener(this);
494
+
495
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
496
+ fastCB.setToolTipText("Fast mode");
434497 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);
498
+
499
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
500
+ trackCB.setToolTipText("Enable tracking");
476501 trackCB.addItemListener(this);
477502
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
503
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ screenfitButton.setToolTipText("Screen fit");
480505 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
506
+
482507 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483508 // 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;
488509
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);
510
+ if (Globals.ADVANCED)
511
+ {
512
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ snapobjectButton.addActionListener(this);
514
+ snapobjectButton.setToolTipText("Snap Object");
515
+ }
516
+
517
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
518
+ flashSelectionButton.setToolTipText("Show selection");
495519 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499520
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
521
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522
+
523
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
524
+ twoButton.setToolTipText("Show center view only");
502525 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504527 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
528
+ fourButton.setToolTipText("Show left panel only");
529
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
530
+ sixButton.setToolTipText("2-column layout left");
506531 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
+ threeButton.setToolTipText("2-column layout right");
508534 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
+ sevenButton.setToolTipText("3-column layout");
510537 sevenButton.addActionListener(this);
511538 //
512539
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
541
+ rootButton.setToolTipText("Edit selection in new tab");
514542 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
543
+
544
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
545
+ closeButton.setToolTipText("Close tab");
517546 closeButton.addActionListener(this);
518547 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519548 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521549
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
550
+ cGridBag commandsPanel = new cGridBag();
551
+
552
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
553
+ editButton.setToolTipText("Edit selection");
524554 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528555
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
556
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
+ uneditButton.setToolTipText("Unedit selection");
530558 uneditButton.addActionListener(this);
531559
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);
560
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561
+ allParamsButton.setToolTipText("Edit all params");
544562 allParamsButton.addActionListener(this);
545563
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);
564
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
565
+ clearPanelButton.setToolTipText("Clear edit panel");
566
+ clearPanelButton.addActionListener(this);
567
+
568
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569
+ unselectButton.setToolTipText("Unselect");
551570 unselectButton.addActionListener(this);
552571
572
+ commandsPanel.preferredHeight = 1;
573
+
574
+ oe.treePanel.add(commandsPanel);
575
+ oe.treePanel.Return();
576
+
553577 // oe.aConstraints.gridx += 1;
554578 // oe.aConstraints.weighty = 0;
555579 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +585,37 @@
561585 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562586 // gcButton.addActionListener(this);
563587
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;
588
+ cGridBag jSPPanel = new cGridBag();
589
+
590
+ JScrollPane jSP;
575591 //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);
592
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577593 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
594
+
595
+ oe.treePanel.add(jSPPanel);
596
+ oe.treePanel.Return();
582597
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);
598
+ cGridBag copyOptionsPanel = new cGridBag();
599
+
600
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
601
+ colorCB.setToolTipText("Copy color when dropped");
587602 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
603
+
604
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
605
+ materialCB.setToolTipText("Copy material when dropped");
590606 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
607
+
608
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
609
+ textureCB.setToolTipText("Copy texture when dropped");
593610 textureCB.addItemListener(this);
594611
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
612
+ copyOptionsPanel.preferredHeight = 1;
613
+ oe.treePanel.add(copyOptionsPanel);
614
+ oe.treePanel.Return();
597615
616
+// mainPanel.setDividerLocation(0.5); //1.0);
617
+// mainPanel.setResizeWeight(0.5);
618
+
598619 //jList.addListSelectionListener(this);
599620 oe.jTree.addTreeSelectionListener(this);
600621 //jTree.setRootVisible(false);
....@@ -616,17 +637,89 @@
616637 radio.layout = sevenButton;
617638 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618639 }
640
+
641
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
642
+ {
643
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
644
+ boxCB.setToolTipText("Display bounding boxes");
645
+ boxCB.addItemListener(this);
646
+
647
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
648
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649
+ zoomBoxCB.addItemListener(this);
650
+
651
+ if (Globals.ADVANCED)
652
+ {
653
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654
+ supportCB.setToolTipText("Enable rigging");
655
+ supportCB.addItemListener(this);
656
+
657
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
658
+ // localCB.addItemListener(this);
659
+
660
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
661
+ crowdCB.setToolTipText("Used for crowds");
662
+ crowdCB.addItemListener(this);
663
+
664
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
665
+ smoothCB.setToolTipText("Snapping delay");
666
+ smoothCB.addItemListener(this);
667
+
668
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
669
+ slowCB.setToolTipText("Smooth interpolation");
670
+ slowCB.addItemListener(this);
671
+
672
+// constraints.gridy += 1;
673
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
674
+// speakerMocapCB.addItemListener(this);
675
+
676
+ if (false)
677
+ {
678
+ // handled in scripts
679
+ //constraints.gridy += 1;
680
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
681
+ speakerCameraCB.addItemListener(this);
682
+
683
+ //constraints.gridy += 1;
684
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
685
+ speakerFocusCB.addItemListener(this);
686
+
687
+ //constraints.gridy += 1;
688
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
689
+ smoothfocusCB.addItemListener(this);
690
+ }
691
+
692
+//constraints.gridx += 1;
693
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
694
+// debugCB.addItemListener(this);
695
+
696
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
697
+ oeilCB.addItemListener(this);
698
+
699
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
700
+ lookAtCB.setToolTipText("Look-at target");
701
+ lookAtCB.addItemListener(this);
702
+
703
+ }
704
+
705
+ cGridBag fill = new cGridBag();
706
+
707
+ fill.preferredHeight = 200;
708
+
709
+ panel.add(fill);
710
+
711
+ }
619712
620713 void EditObject(Object3D obj)
621714 {
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();
715
+ cRadio radioButton = new cRadio(obj.name);
716
+ radioButton.SetObject(obj);
717
+ radioButton.layout = sevenButton;
718
+ radioButton.SetCamera(cameraView.renderCamera, false);
719
+ radioButton.addActionListener(this);
720
+ radioPanel.add(radioButton);
721
+ buttonGroup.add(radioButton);
722
+ radioButton.doClick();
630723 }
631724 void SetupViews(ObjEditor oe)
632725 {
....@@ -646,6 +739,7 @@
646739 JCheckBox fastCB;
647740 JCheckBox slowCB;
648741 JCheckBox boxCB;
742
+ JCheckBox zoomBoxCB;
649743 JCheckBox trackCB;
650744 JCheckBox smoothfocusCB;
651745 // JCheckBox speakerMocapCB;
....@@ -688,8 +782,7 @@
688782 dropAttributes |= Object3D.TEXTURE;
689783 else
690784 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
785
+ } else if(e.getSource() == liveCB)
693786 {
694787 cameraView.ToggleLive();
695788 }
....@@ -726,6 +819,10 @@
726819 Recompile();
727820 cameraView.repaint();
728821 // refreshContents();
822
+ }
823
+ else if(e.getSource() == zoomBoxCB)
824
+ {
825
+ cameraView.ToggleZoomBoxMode();
729826 }
730827 else if(e.getSource() == smoothfocusCB)
731828 {
....@@ -894,11 +991,11 @@
894991 {
895992 loadClipboard(true);
896993 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
994
+ pasteInto(false, false);
898995 } else {
899996 loadClipboard(false);
900997 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
998
+ pasteInto(false, false); // true); // ???
902999 }
9031000 }
9041001 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1099,8 @@
10021099
10031100 void buildCreateMenu(Menu menu)
10041101 {
1102
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1103
+ //heightFieldItem.addActionListener(this);
10051104 gridItem = menu.add(new MenuItem("Grid"));
10061105 gridItem.addActionListener(this);
10071106 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1113,37 @@
10141113 torusItem.addActionListener(this);
10151114 superItem = menu.add(new MenuItem("Superellipsoid"));
10161115 superItem.addActionListener(this);
1116
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1117
+ kleinItem.addActionListener(this);
10171118 particleItem = menu.add(new MenuItem("Particle system"));
10181119 particleItem.addActionListener(this);
1120
+ if (Globals.ADVANCED)
1121
+ {
10191122 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201123 ragdollItem.addActionListener(this);
10211124 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221125 ragdoll2Item.addActionListener(this);
1126
+ }
10231127 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1128
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251129 meshItem.addActionListener(this);
10261130 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271131 // meshGroupItem.addActionListener(this);
1132
+ if (Globals.ADVANCED)
1133
+ {
10281134 springItem = menu.add(new MenuItem("Spring"));
10291135 springItem.addActionListener(this);
10301136 flagItem = menu.add(new MenuItem("Flag"));
10311137 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);
10361138 blobItem = menu.add(new MenuItem("Blob"));
10371139 blobItem.addActionListener(this);
10381140 latheItem = menu.add(new MenuItem("Lathe"));
10391141 latheItem.addActionListener(this);
1142
+ }
1143
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1144
+ bezierItem.addActionListener(this);
1145
+ overlayItem = menu.add(new MenuItem("Overlay"));
1146
+ overlayItem.addActionListener(this);
10401147 lightItem = menu.add(new MenuItem("Light"));
10411148 lightItem.addActionListener(this);
10421149 menu.add("-");
....@@ -1046,41 +1153,39 @@
10461153 loopItem.addActionListener(this);
10471154 doubleItem = menu.add(new MenuItem("Fork"));
10481155 doubleItem.addActionListener(this);
1156
+ if (Globals.ADVANCED)
1157
+ {
10491158 tripleItem = menu.add(new MenuItem("Trident"));
10501159 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);
1160
+ }
10601161 }
10611162
10621163 void buildToolsMenu(Menu menu)
10631164 {
10641165 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651166 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1167
+ animationItem.setState(Globals.ANIMATION);
10671168
10681169 menu.add("-");
10691170 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701171 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1172
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1173
+ textureFieldItem.addActionListener(this);
1174
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721175 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751176 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761177 reduceMorphItem.addActionListener(this);
10771178 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781179 reduce34MorphItem.addActionListener(this);
1079
-
1180
+ menu.add("-");
10801181 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811182 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831183
1184
+ if (Globals.ADVANCED)
1185
+ {
1186
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1187
+ mirrorItem.addActionListener(this);
1188
+ menu.add("-");
10841189 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851190 memoryItem.addActionListener(this);
10861191 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1094,6 +1199,8 @@
10941199 resetParentItem.addActionListener(this);
10951200 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961201 repairParentItem.addActionListener(this);
1202
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1203
+ repairShadowItem.addActionListener(this);
10971204 menu.add(invariantsItem = new MenuItem("Invariants"));
10981205 invariantsItem.addActionListener(this);
10991206 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1208,7 @@
11011208 menu.add("-");
11021209 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031210 editScriptItem.addActionListener(this);
1211
+ }
11041212 }
11051213
11061214 void ScreenFit()
....@@ -1429,9 +1537,9 @@
14291537
14301538 void Overwrite(int mask)
14311539 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1540
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14331541 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1542
+ Object3D content = GrafreeD.clipboard.get(0);
14351543
14361544 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371545 content = ((cGroup)content).get(0);
....@@ -1454,6 +1562,7 @@
14541562 //
14551563 public void actionPerformed(ActionEvent event) // , Object arg)
14561564 {
1565
+ Object source = event.getSource();
14571566 /*
14581567 if (event.getSource() == nameField)
14591568 {
....@@ -1465,11 +1574,11 @@
14651574 }
14661575 else
14671576 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1577
+ if (source == lookAtItem || source == lookFromItem)
14691578 {
14701579 ScreenFit();
14711580 } else
1472
- if (event.getSource() == switchItem)
1581
+ if (source == switchItem)
14731582 {
14741583 cVector v1 = new cVector();
14751584 cVector v2 = new cVector();
....@@ -1478,11 +1587,11 @@
14781587 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791588 objEditor.cameraView.repaint();
14801589 } else
1481
- if (event.getSource() == rectoidItem)
1590
+ if (source == rectoidItem)
14821591 {
14831592 makeSomething(new Box());
14841593 } else
1485
- if (event.getSource() == particleItem)
1594
+ if (source == particleItem)
14861595 {
14871596 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881597 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1612,9 @@
15031612 applyExample(particleGeom, "SMOKE");
15041613 makeSomething(particleGeom);
15051614 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1615
+ if (source == ragdollItem || source == ragdoll2Item)
15071616 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1617
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091618
15101619 ragdoll.toParent = LA.newMatrix();
15111620 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1630,71 @@
15211630 makeSomething(ragdoll);
15221631 //makeSomething(new VehicleDemo());
15231632 } else
1524
- if (event.getSource() == gridItem)
1633
+ /*
1634
+ */
1635
+ if (source == heightFieldItem)
1636
+ {
1637
+ Object3D obj = new Object3D();
1638
+
1639
+ obj.CreateMaterial();
1640
+ obj.bRep = new BoundaryRep();
1641
+
1642
+ obj.bRep.CreateMesh(new iHeightField()
1643
+ {
1644
+ public double f(double x, double y)
1645
+ {
1646
+ // The Mandelbrot set is represented by coloring
1647
+ // each point (x,y) according to the number of
1648
+ // iterations it takes before the while loop in
1649
+ // this method ends. For points that are actually
1650
+ // in the Mandelbrot set, or very close to it, the
1651
+ // count will reach the maximum value, 80. These
1652
+ // points will be colored purple. All other colors
1653
+ // represent points that are definitely NOT in the set.
1654
+ x -= 600;
1655
+ y -= 500;
1656
+ x /= 200;
1657
+ y /= 200;
1658
+ int count = 0;
1659
+ double zx = x;
1660
+ double zy = y;
1661
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1662
+ double new_zx = zx*zx - zy*zy + x;
1663
+ zy = 2*zx*zy + y;
1664
+ zx = new_zx;
1665
+ count++;
1666
+ }
1667
+ return count; // Math.sqrt(count);
1668
+ }
1669
+ }, 1000,1000);
1670
+
1671
+ makeSomething(obj);
1672
+ } else
1673
+ if (source == gridItem)
15251674 {
15261675 makeSomething(new Grid());
15271676 } else
1528
- if (event.getSource() == ellipsoidItem)
1677
+ if (source == ellipsoidItem)
15291678 {
15301679 makeSomething(new Sphere());
15311680 } else
1532
- if (event.getSource() == coneItem)
1681
+ if (source == coneItem)
15331682 {
15341683 makeSomething(new Cone());
15351684 } else
1536
- if (event.getSource() == torusItem)
1685
+ if (source == torusItem)
15371686 {
15381687 makeSomething(new Torus());
15391688 } else
1540
- if (event.getSource() == superItem)
1689
+ if (source == superItem)
15411690 {
15421691 makeSomething(new Superellipsoid());
15431692 } else
1544
- if (event.getSource() == blobItem)
1693
+ if (source == kleinItem)
1694
+ {
1695
+ makeSomething(new Klein());
1696
+ } else
1697
+ if (source == blobItem)
15451698 {
15461699 Blob blob = new Blob();
15471700 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1702,15 @@
15491702 //blob.retile();
15501703 makeSomething(blob);
15511704 } else
1552
- if (event.getSource() == latheItem)
1705
+ if (source == latheItem)
15531706 {
15541707 makeSomething(new Lathe());
15551708 } else
1556
- if (event.getSource() == bezierItem)
1709
+ if (source == bezierItem)
15571710 {
15581711 makeSomething(new BezierSurface());
15591712 } else
1560
- if (event.getSource() == checkerItem)
1713
+ if (source == overlayItem)
15611714 {
15621715 /*
15631716 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1723,9 @@
15701723 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711724 LA.matInvert(obj.toParent, obj.fromParent);
15721725 */
1573
- makeSomething(new CheckerIG());
1726
+ makeSomething(new Checker());
15741727 } else
1575
- if (event.getSource() == meshItem)
1728
+ if (source == meshItem)
15761729 {
15771730 Object3D itemtomake = new Object3D();
15781731 Object3D child;
....@@ -1593,35 +1746,35 @@
15931746 makeSomething(child);
15941747 }
15951748 } else
1596
- if (event.getSource() == springItem)
1749
+ if (source == springItem)
15971750 {
15981751 cSpring s = new cSpring();
15991752 s.setup();
16001753 makeSomething(s);
16011754 } else
1602
- if (event.getSource() == flagItem)
1755
+ if (source == flagItem)
16031756 {
16041757 cSpring s = new cFlag();
16051758 s.setup();
16061759 makeSomething(s);
16071760 } else
1608
- if (event.getSource() == lightItem)
1761
+ if (source == lightItem)
16091762 {
16101763 makeSomething(new Light());
16111764 } else
1612
- if (event.getSource() == csgItem)
1765
+ if (source == csgItem)
16131766 {
16141767 group(new CSG());
16151768 } else
1616
- if (event.getSource() == templateItem)
1769
+ if (source == templateItem)
16171770 {
16181771 group(new cTemplate());
16191772 } else
1620
- if (event.getSource() == attributeItem)
1773
+ if (source == attributeItem)
16211774 {
16221775 makeSomething(new Attribute());
16231776 } else
1624
- if (event.getSource() == pointflowItem)
1777
+ if (source == pointflowItem)
16251778 {
16261779 makeSomething(new PointFlow());
16271780 } else
....@@ -1633,7 +1786,7 @@
16331786 } else
16341787 */
16351788
1636
- if (event.getSource() == superLoopItem)
1789
+ if (source == superLoopItem)
16371790 {
16381791 Composite g = new cGroup();
16391792 for (int i=0; i<15; i++)
....@@ -1655,7 +1808,7 @@
16551808
16561809 group(g);
16571810 } else
1658
- if (event.getSource() == loopItem)
1811
+ if (source == loopItem)
16591812 {
16601813 Composite csg = new GroupLeaf();
16611814 csg.count = 5;
....@@ -1664,7 +1817,7 @@
16641817 csg.addChild(child);
16651818 child.addChild(csg);
16661819 } else
1667
- if (event.getSource() == doubleItem)
1820
+ if (source == doubleItem)
16681821 {
16691822 Composite csg = new GroupLeaf();
16701823 csg.count = 5;
....@@ -1676,7 +1829,7 @@
16761829 csg.addChild(child);
16771830 child.addChild(csg);
16781831 } else
1679
- if (event.getSource() == tripleItem)
1832
+ if (source == tripleItem)
16801833 {
16811834 Composite csg = new GroupLeaf();
16821835 csg.count = 4;
....@@ -1692,70 +1845,75 @@
16921845 child.addChild(csg);
16931846 } else
16941847
1695
- if (event.getSource() == importGFDItem)
1848
+ if (source == importGFDItem)
16961849 {
16971850 ImportGFD();
16981851 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1852
+ if (source == importVRMLX3DItem)
17001853 {
17011854 ImportVRMLX3D();
17021855 } else
1703
- if (event.getSource() == import3DSItem)
1856
+ if (source == import3DSItem)
17041857 {
17051858 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17061859 } else
1707
- if (event.getSource() == importOBJItem)
1860
+ if (source == importOBJItem)
17081861 {
17091862 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17101863 } else
1711
- if (event.getSource() == computeAOItem)
1864
+ if (source == computeAOItem)
17121865 {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1866
+ Globals.drawMode = CameraPane.OCCLUSION;
1867
+ Globals.theRenderer.repaint();
17151868 } else
1716
- if (event.getSource() == recompileItem)
1869
+ if (source == recompileItem)
17171870 {
17181871 Recompile();
17191872 refreshContents();
17201873 } else
1721
- if (event.getSource() == editScriptItem)
1874
+ if (source == editScriptItem)
17221875 {
17231876 OpenDialog();
17241877 refreshContents();
17251878 } else
1726
- if (event.getSource() == invariantsItem)
1879
+ if (source == invariantsItem)
17271880 {
17281881 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1882
+ GrafreeD.grafreeD.universe.invariants();
17301883 } else
1731
- if (event.getSource() == memoryItem)
1884
+ if (source == memoryItem)
17321885 {
17331886 //System.out.println("Invariants:");
17341887 PrintMemory();
17351888 } else
1736
- if (event.getSource() == pathItem)
1889
+ if (source == pathItem)
17371890 {
17381891 PrintPath();
17391892 } else
1740
- if (event.getSource() == analyzeItem)
1893
+ if (source == analyzeItem)
17411894 {
17421895 AnalyzeObject();
17431896 } else
1744
- if (event.getSource() == dumpItem)
1897
+ if (source == dumpItem)
17451898 {
17461899 DumpObject();
17471900 } else
1748
- if (event.getSource() == screenfitButton)
1901
+ if (source == oneStepButton)
1902
+ {
1903
+ Globals.ONESTEP = true;
1904
+ cameraView.repaint();
1905
+ } else
1906
+ if (source == screenfitButton)
17491907 {
17501908 //Reload(lastConverter, lastFilename, true);
17511909 ScreenFit();
17521910 } else
1753
- if (event.getSource() == screenfitpointButton)
1911
+ if (source == screenfitpointButton)
17541912 {
17551913 //Reload(lastConverter, lastFilename, true);
17561914 ScreenFitPoint();
17571915 } else
1758
- if (event.getSource() == snapobjectButton)
1916
+ if (source == snapobjectButton)
17591917 {
17601918 //Reload(lastConverter, lastFilename, true);
17611919 SnapObject();
....@@ -1766,13 +1924,13 @@
17661924 // Recompile();
17671925 // refreshContents();
17681926 // } else
1769
- if (event.getSource() == gcButton)
1927
+ if (source == gcButton)
17701928 {
17711929 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17721930 System.gc();
17731931 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17741932 } else
1775
- if (event.getSource() == editLeafItem)
1933
+ if (source == editLeafItem)
17761934 {
17771935 Object3D obj;
17781936 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +1944,70 @@
17861944 }
17871945 refreshContents(true);
17881946 } else
1789
- if (event.getSource() == openWindowItem)
1947
+ if (source == openWindowItem)
17901948 {
17911949 EditSelection(true);
17921950 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1951
+ if (source == cutItem || source == clearButton)
17941952 {
17951953 loadClipboard(true);
17961954 } else
1797
- if (event.getSource() == duplicateItem)
1955
+ if (source == duplicateItem)
17981956 {
1799
- Object3D keep = GraphreeD.clipboard;
1957
+ Object3D keep = GrafreeD.clipboard;
18001958 loadClipboard(false);
18011959 paste(false);
1802
- GraphreeD.clipboard = keep;
1960
+ GrafreeD.clipboard = keep;
18031961 } else
1804
- if (event.getSource() == cloneItem)
1962
+ if (source == cloneItem)
18051963 {
18061964 CloneSelection(false);
18071965 } else
1808
- if (event.getSource() == cloneSupportItem)
1966
+ if (source == cloneSupportItem)
18091967 {
18101968 CloneSelection(true);
18111969 } else
1812
- if (event.getSource() == copyItem)
1970
+ if (source == copyItem)
18131971 {
18141972 loadClipboard(false);
18151973 } else
1816
- if (event.getSource() == pasteItem)
1974
+ if (source == pasteItem)
18171975 {
18181976 paste(false);
18191977 } else
1820
- if (event.getSource() == pasteLinkItem)
1978
+ if (source == pasteIntoItem)
18211979 {
1822
- pasteInto(false);
1980
+ pasteInto(true, false);
18231981 } else
1824
- if (event.getSource() == pasteCloneItem)
1982
+ if (source == pasteLinkItem)
18251983 {
1826
- pasteInto(true);
1984
+ pasteInto(false, false);
18271985 } else
1828
- if (event.getSource() == pasteExpandItem)
1986
+ if (source == pasteCloneItem)
1987
+ {
1988
+ pasteInto(true, true);
1989
+ } else
1990
+ if (source == pasteExpandItem)
18291991 {
18301992 paste(true);
18311993 } else
1832
- if (event.getSource() == synchronizeItem)
1994
+ if (source == synchronizeItem)
18331995 {
18341996 Overwrite(Object3D.TRANSFORM);
18351997 } else
1836
- if (event.getSource() == overwriteNameItem)
1998
+ if (source == overwriteNameItem)
18371999 {
18382000 Overwrite(Object3D.NAME);
18392001 } else
1840
- if (event.getSource() == overwriteUVItem)
2002
+ if (source == overwriteUVItem)
18412003 {
18422004 Overwrite(Object3D.UV);
18432005 } else
1844
- if (event.getSource() == overwriteMatItem)
2006
+ if (source == overwriteMatItem)
18452007 {
2008
+ /* july 2015
18462009 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2010
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482011 else
18492012 {
18502013 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2019,16 @@
18562019 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572020 }
18582021 }
2022
+ */
2023
+
2024
+ Overwrite(dropAttributes);
18592025 }
1860
- if (event.getSource() == overwriteGeoItem)
2026
+ if (source == overwriteGeoItem)
18612027 {
18622028 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2029
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642030 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2031
+// Object3D content = GrafreeD.clipboard.get(0);
18662032 //
18672033 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682034 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2040,7 @@
18742040 // refreshContents();
18752041 // }
18762042 } else
1877
- if (event.getSource() == generateMeshItem)
2043
+ if (source == generateMeshItem)
18782044 {
18792045 //if (group.selection.size() == 1)
18802046 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2051,7 @@
18852051 ResetModel();
18862052 refreshContents();
18872053 } else
1888
- if (event.getSource() == extractGeometriesItem)
2054
+ if (source == extractGeometriesItem)
18892055 {
18902056 boolean one = false;
18912057
....@@ -1912,7 +2078,7 @@
19122078 ResetModel();
19132079 refreshContents();
19142080 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2081
+ if (source == cloneGeometriesItem)
19162082 {
19172083 boolean one = false;
19182084
....@@ -1938,32 +2104,37 @@
19382104 ResetModel();
19392105 refreshContents();
19402106 } else
1941
- if (event.getSource() == shareGeometriesItem)
2107
+ if (source == shareGeometriesItem)
19422108 {
19432109 boolean one = false;
19442110
19452111 if (group.selection.size() == 1)
19462112 one = true;
19472113
2114
+ Object3D merge = null;
2115
+
19482116 Object3D content = new cGroup();
19492117
19502118 for (int i=0; i<group.selection.size(); i++)
19512119 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2120
+ merge = new Merge(group.selection.get(i));
19532121
19542122 if (one)
1955
- makeSomething(sel, false);
2123
+ makeSomething(merge, false);
19562124 else
1957
- content.addChild(sel);
2125
+ content.addChild(merge);
19582126 }
19592127
19602128 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2129
+ makeSomething(content, true);
2130
+ else
2131
+ {
2132
+ ResetModel();
2133
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2134
+ refreshContents();
2135
+ }
19652136 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2137
+ if (source == mergeGeometriesItem)
19672138 {
19682139 boolean one = false;
19692140
....@@ -1993,11 +2164,11 @@
19932164 ResetModel();
19942165 refreshContents();
19952166 } else
1996
- if (event.getSource() == linkverticesItem)
2167
+ if (source == linkverticesItem)
19972168 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2169
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992170 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2171
+// Object3D content = GrafreeD.clipboard.get(0);
20012172 //
20022173 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032174 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2177,48 @@
20062177 // group.selection.get(0).setMasterThis(content); // should be identity
20072178 // refreshContents();
20082179 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2180
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20102181 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2182
+ Object3D content = GrafreeD.clipboard.get(0);
20122183
20132184 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142185 content = ((cGroup)content).get(0);
20152186
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2187
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172188 for (int i=0; i<group.selection.size(); i++)
20182189 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2190
+ boolean random = CameraPane.SWITCH;
2191
+ CameraPane.SWITCH = false; // parse all random nodes
20212192 group.selection.get(i).linkVerticesThis(content);
20222193 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2194
+ CameraPane.SWITCH = random;
20242195 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2196
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262197 refreshContents();
20272198 }
20282199 } else
2029
- if (event.getSource() == resetsupportItem)
2200
+ if (source == resetsupportItem)
20302201 {
20312202 for (int i=0; i<group.selection.size(); i++)
20322203 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2204
+ boolean random = CameraPane.SWITCH;
2205
+ CameraPane.SWITCH = false; // parse all random nodes
20352206 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
20372208 }
20382209
20392210 refreshContents();
20402211 } else
2041
- if (event.getSource() == resetreferencesItem)
2212
+ if (source == relinkverticesItem)
2213
+ {
2214
+ boolean random = CameraPane.SWITCH;
2215
+ CameraPane.SWITCH = false; // parse all random nodes
2216
+ group.selection.RelinkToSupport();
2217
+ CameraPane.SWITCH = random;
2218
+
2219
+ refreshContents();
2220
+ } else
2221
+ if (source == resetreferencesItem)
20422222 {
20432223 for (int i=0; i<group.selection.size(); i++)
20442224 {
....@@ -2047,11 +2227,11 @@
20472227
20482228 refreshContents();
20492229 } else
2050
- if (event.getSource() == setMasterItem)
2230
+ if (source == setMasterItem)
20512231 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2232
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20532233 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2234
+ Object3D content = GrafreeD.clipboard.get(0);
20552235
20562236 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572237 content = ((cGroup)content).get(0);
....@@ -2060,13 +2240,13 @@
20602240 refreshContents();
20612241 }
20622242 } else
2063
- if (event.getSource() == poseMeshItem)
2243
+ if (source == poseMeshItem)
20642244 {
20652245 if (group.selection.size() == 1)
20662246 {
2067
- if (GraphreeD.clipboard.size() == 1)
2247
+ if (GrafreeD.clipboard.size() == 1)
20682248 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2249
+ Object3D content = GrafreeD.clipboard.get(0);
20702250
20712251 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722252 content = ((cGroup)content).get(0);
....@@ -2079,19 +2259,19 @@
20792259 }
20802260
20812261 } else
2082
- if (event.getSource() == revertMeshItem)
2262
+ if (source == revertMeshItem)
20832263 {
20842264 RevertMeshes();
20852265 } else
2086
- if (event.getSource() == resetMeshItem)
2266
+ if (source == resetMeshItem)
20872267 {
20882268 ResetAll();
20892269 } else
2090
- if (event.getSource() == stepAllItem)
2270
+ if (source == stepAllItem)
20912271 {
20922272 StepAll();
20932273 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2274
+ if (source == clearItem) // || event.getSource() == clearButton)
20952275 {
20962276 //int indices[] = jList.getSelectedIndices();
20972277 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2279,46 @@
20992279
21002280 ClearSelection(false);
21012281 } else
2102
- if (event.getSource() == clearAllItem)
2282
+ if (source == clearAllItem)
21032283 {
21042284 ClearSelection(true);
21052285 } else
2106
- if (event.getSource() == grabItem)
2286
+ if (source == grabItem)
21072287 {
21082288 group(new cGroup(), true);
21092289 } else
2110
- if (event.getSource() == frontItem)
2290
+ if (source == hideItem)
2291
+ {
2292
+ group(new HiddenObject());
2293
+ } else
2294
+ if (source == frontItem)
21112295 {
21122296 front();
21132297 } else
2114
- if (event.getSource() == backItem)
2298
+ if (source == backItem)
21152299 {
21162300 back();
21172301 } else
2118
- if (event.getSource() == cameraItem)
2302
+ if (source == cameraItem)
21192303 {
21202304 makeSomething(new Camera());
21212305 } else
2122
- if (event.getSource() == compositeItem)
2306
+ if (source == compositeItem)
21232307 {
21242308 group(new Composite());
21252309 } else
2126
- if (event.getSource() == randomItem)
2310
+ if (source == randomItem)
21272311 {
21282312 RandomNode random = new RandomNode();
21292313 group(random);
21302314 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2315
+ random.name = random.get(0).name + "Switch";
21322316 } else
2133
- if (event.getSource() == physicsItem)
2317
+ if (source == physicsItem)
21342318 {
21352319 group(new PhysicsNode());
21362320 } else
2137
- if (event.getSource() == frameselectorItem)
2321
+ if (source == frameselectorItem)
21382322 {
21392323 for (int i=0; i<group.selection.size(); i++)
21402324 {
....@@ -2146,7 +2330,7 @@
21462330 ResetModel();
21472331 refreshContents();
21482332 } else
2149
- if (event.getSource() == switchGeoItem)
2333
+ if (source == switchGeoItem)
21502334 {
21512335 for (int i=0; i<group.selection.size(); i++)
21522336 {
....@@ -2158,7 +2342,7 @@
21582342 ResetModel();
21592343 refreshContents();
21602344 } else
2161
- if (event.getSource() == switchTransfoItem)
2345
+ if (source == switchTransfoItem)
21622346 {
21632347 for (int i=0; i<group.selection.size(); i++)
21642348 {
....@@ -2170,7 +2354,7 @@
21702354 ResetModel();
21712355 refreshContents();
21722356 } else
2173
- if (event.getSource() == morphItem)
2357
+ if (source == morphItem)
21742358 {
21752359 for (int i=0; i<group.selection.size(); i++)
21762360 {
....@@ -2182,7 +2366,7 @@
21822366 ResetModel();
21832367 refreshContents();
21842368 } else
2185
- if (event.getSource() == scriptNodeItem)
2369
+ if (source == scriptNodeItem)
21862370 {
21872371 boolean atleastone = false;
21882372
....@@ -2221,191 +2405,215 @@
22212405 }
22222406 }
22232407 } else
2224
- if (event.getSource() == linkerItem)
2408
+ if (source == linkerItem)
22252409 {
22262410 group(new cLinker());
22272411 } else
2228
- if (event.getSource() == textureItem)
2412
+ if (source == textureItem)
22292413 {
22302414 group(new TextureNode());
22312415 } else
2232
- if (event.getSource() == shadowXItem)
2416
+ if (source == billboardItem)
2417
+ {
2418
+ group(new BillboardNode());
2419
+ } else
2420
+ if (source == shadowXItem)
22332421 {
22342422 CastShadow(0);
22352423 } else
2236
- if (event.getSource() == shadowYItem)
2424
+ if (source == shadowYItem)
22372425 {
22382426 CastShadow(1);
22392427 } else
2240
- if (event.getSource() == shadowZItem)
2428
+ if (source == shadowZItem)
22412429 {
22422430 CastShadow(2);
22432431 } else
2244
- if (event.getSource() == ungroupItem)
2432
+ if (source == ungroupItem)
22452433 {
2246
- ungroup();
2434
+ //ungroup();
2435
+ for (int i=0; i<group.selection.size(); i++)
2436
+ {
2437
+ Ungroup(group.selection.get(i));
2438
+ }
2439
+
2440
+ ClearSelection(false);
2441
+
2442
+ refreshContents();
22472443 } else
2248
- if (event.getSource() == genUVItem)
2444
+ if (source == genUVItem)
22492445 {
22502446 GenUV();
22512447 } else
2252
- if (event.getSource() == genNormalsCADItem)
2448
+ if (source == genNormalsCADItem)
22532449 {
22542450 GenNormals(true);
22552451 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2452
+ if (source == genNormalsMESHItem)
2453
+ {
2454
+ GenNormals(true); // TODO
2455
+ } else
2456
+ if (source == genNormalsORGANItem)
22572457 {
22582458 GenNormals(false);
22592459 } else
2260
- if (event.getSource() == stripifyItem)
2460
+ if (source == genNormalsMINEItem)
2461
+ {
2462
+ GenNormalsMINE();
2463
+ } else
2464
+ if (source == stripifyItem)
22612465 {
22622466 Stripify();
22632467 } else
2264
- if (event.getSource() == unstripifyItem)
2468
+ if (source == unstripifyItem)
22652469 {
22662470 Unstripify();
22672471 } else
2268
- if (event.getSource() == trimItem)
2472
+ if (source == trimItem)
22692473 {
22702474 Trim();
22712475 } else
2272
- if (event.getSource() == untrimItem)
2476
+ if (source == untrimItem)
22732477 {
22742478 Untrim();
22752479 } else
2276
- if (event.getSource() == clearColorsItem)
2480
+ if (source == clearColorsItem)
22772481 {
22782482 ClearColors();
22792483 } else
2280
- if (event.getSource() == clearMaterialsItem)
2484
+ if (source == clearMaterialsItem)
22812485 {
22822486 ClearMaterials();
22832487 } else
2284
- if (event.getSource() == liveleavesItem)
2488
+ if (source == liveleavesItem)
22852489 {
22862490 LiveLeaves(true);
22872491 } else
2288
- if (event.getSource() == unliveleavesItem)
2492
+ if (source == unliveleavesItem)
22892493 {
22902494 LiveLeaves(false);
22912495 } else
2292
- if (event.getSource() == supportleavesItem)
2496
+ if (source == supportleavesItem)
22932497 {
22942498 SupportLeaves(true);
22952499 } else
2296
- if (event.getSource() == unsupportleavesItem)
2500
+ if (source == unsupportleavesItem)
22972501 {
22982502 SupportLeaves(false);
22992503 } else
2300
- if (event.getSource() == hideleavesItem)
2504
+ if (source == hideleavesItem)
23012505 {
23022506 HideLeaves(true);
23032507 } else
2304
- if (event.getSource() == showleavesItem)
2508
+ if (source == showleavesItem)
23052509 {
23062510 HideLeaves(false);
23072511 } else
2308
- if (event.getSource() == markleavesItem)
2512
+ if (source == markleavesItem)
23092513 {
23102514 MarkLeaves(true);
23112515 } else
2312
- if (event.getSource() == unmarkleavesItem)
2516
+ if (source == unmarkleavesItem)
23132517 {
23142518 MarkLeaves(false);
23152519 } else
2316
- if (event.getSource() == flipVItem)
2520
+ if (source == flipVItem)
23172521 {
23182522 FlipV(true);
23192523 } else
2320
- if (event.getSource() == unflipVItem)
2524
+ if (source == unflipVItem)
23212525 {
23222526 FlipV(false);
23232527 } else
2324
- if (event.getSource() == lowTexturesItem)
2528
+ if (source == lowTexturesItem)
23252529 {
23262530 SetTexRes(0);
23272531 } else
2328
- if (event.getSource() == normalTexturesItem)
2532
+ if (source == normalTexturesItem)
23292533 {
23302534 SetTexRes(1);
23312535 } else
2332
- if (event.getSource() == highTexturesItem)
2536
+ if (source == highTexturesItem)
23332537 {
23342538 SetTexRes(2);
23352539 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2540
+ if (source == veryhighTexturesItem)
23372541 {
23382542 SetTexRes(3);
23392543 } else
2340
- if (event.getSource() == maxTexturesItem)
2544
+ if (source == maxTexturesItem)
23412545 {
23422546 SetTexRes(4);
23432547 } else
2344
- if (event.getSource() == panoTexturesItem)
2548
+ if (source == panoTexturesItem)
23452549 {
23462550 SetTexRes(5);
23472551 } else
2348
- if (event.getSource() == reverseNormalsItem)
2552
+ if (source == reverseNormalsItem)
23492553 {
23502554 ReverseNormals();
23512555 } else
2352
- if (event.getSource() == parseverticesItem)
2556
+ if (source == parseverticesItem)
23532557 {
23542558 ParseVertices();
23552559 } else
2356
- if (event.getSource() == alignItem)
2560
+ if (source == textureFieldItem)
2561
+ {
2562
+ TextureVertices();
2563
+ } else
2564
+ if (source == alignItem)
23572565 {
23582566 Align();
23592567 } else
2360
- if (event.getSource() == mirrorItem)
2568
+ if (source == mirrorItem)
23612569 {
23622570 MirrorPoses();
23632571 } else
2364
- if (event.getSource() == reduceMorphItem)
2572
+ if (source == reduceMorphItem)
23652573 {
23662574 MeshReduction(false);
23672575 } else
2368
- if (event.getSource() == reduce34MorphItem)
2576
+ if (source == reduce34MorphItem)
23692577 {
23702578 MeshReduction(true);
23712579 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2580
+ if (source == reverseTrianglesItem)
23732581 {
23742582 ReverseTriangles();
23752583 } else
2376
- if (event.getSource() == reduceMeshItem)
2584
+ if (source == reduceMeshItem)
23772585 {
23782586 ReduceMesh(false);
23792587 } else
2380
- if (event.getSource() == reduce34MeshItem)
2588
+ if (source == reduce34MeshItem)
23812589 {
23822590 ReduceMesh(true);
23832591 } else
2384
- if (event.getSource() == increaseMeshItem)
2592
+ if (source == increaseMeshItem)
23852593 {
23862594 IncreaseMesh();
23872595 } else
2388
- if (event.getSource() == clipMeshItem)
2596
+ if (source == clipMeshItem)
23892597 {
23902598 ClipMesh();
23912599 } else
2392
- if (event.getSource() == smoothMeshItem)
2600
+ if (source == smoothMeshItem)
23932601 {
23942602 SmoothMesh();
23952603 } else
2396
- if (event.getSource() == transformgeometryItem)
2604
+ if (source == transformgeometryItem)
23972605 {
23982606 TransformGeometry();
23992607 } else
2400
- if (event.getSource() == resetTransformItem)
2608
+ if (source == resetTransformItem)
24012609 {
24022610 ResetTransform();
24032611 } else
2404
- if (event.getSource() == resetCentroidItem)
2612
+ if (source == resetCentroidItem)
24052613 {
24062614 ResetCentroid();
24072615 } else
2408
- if (event.getSource() == resetParentItem)
2616
+ if (source == resetParentItem)
24092617 {
24102618 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112619 {
....@@ -2415,7 +2623,7 @@
24152623
24162624 refreshContents();
24172625 } else
2418
- if (event.getSource() == repairParentItem)
2626
+ if (source == repairParentItem)
24192627 {
24202628 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212629 {
....@@ -2429,7 +2637,21 @@
24292637
24302638 refreshContents();
24312639 } else
2432
- if (event.getSource() == sortbysizeItem)
2640
+ if (source == repairShadowItem)
2641
+ {
2642
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2643
+ {
2644
+ Object3D obj = (Object3D)e.nextElement();
2645
+ obj.RepairShadow();
2646
+// for (int i=0; i<obj.size(); i++)
2647
+// {
2648
+// obj.get(i).parent = obj;
2649
+// }
2650
+ }
2651
+
2652
+ refreshContents();
2653
+ } else
2654
+ if (source == sortbysizeItem)
24332655 {
24342656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352657 {
....@@ -2441,7 +2663,7 @@
24412663 ResetModel();
24422664 refreshContents();
24432665 } else
2444
- if (event.getSource() == sortbynameItem)
2666
+ if (source == sortbynameItem)
24452667 {
24462668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472669 {
....@@ -2453,7 +2675,7 @@
24532675 ResetModel();
24542676 refreshContents();
24552677 } else
2456
- if (event.getSource() == attachPigmentItem)
2678
+ if (source == attachPigmentItem)
24572679 {
24582680 String texture = GetFile("Attach pigment");
24592681 Object3D obj;
....@@ -2465,7 +2687,7 @@
24652687
24662688 refreshContents();
24672689 } else
2468
- if (event.getSource() == detachPigmentItem)
2690
+ if (source == detachPigmentItem)
24692691 {
24702692 Object3D obj;
24712693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2698,7 @@
24762698
24772699 refreshContents();
24782700 } else
2479
- if (event.getSource() == attachBumpItem)
2701
+ if (source == attachBumpItem)
24802702 {
24812703 String texture = GetFile("Attach bump");
24822704 Object3D obj;
....@@ -2488,7 +2710,7 @@
24882710
24892711 refreshContents();
24902712 } else
2491
- if (event.getSource() == detachBumpItem)
2713
+ if (source == detachBumpItem)
24922714 {
24932715 Object3D obj;
24942716 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2721,7 @@
24992721
25002722 refreshContents();
25012723 } else
2502
- if (event.getSource() == pigmentBumpItem)
2724
+ if (source == pigmentBumpItem)
25032725 {
25042726 Object3D obj;
25052727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2732,195 @@
25102732
25112733 refreshContents();
25122734 } else
2513
- if (event.getSource() == flashSelectionButton)
2735
+ if (source == flashSelectionButton)
25142736 {
25152737 CameraPane.flash = true;
25162738 refreshContents();
25172739 } else
2518
- if (event.getSource() == oneButton)
2740
+ if (source == oneButton)
25192741 {
25202742 } else
2521
- if (event.getSource() == twoButton)
2743
+ if (source == twoButton)
25222744 {
25232745 radio.layout = twoButton;
25242746 // bug
25252747 //gridPanel.setDividerLocation(1.0);
25262748 //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();
2749
+// bigThree.remove(scenePanel);
2750
+// bigThree.remove(centralPanel);
2751
+// bigThree.remove(XYZPanel);
2752
+// aWindowConstraints.gridx = 0;
2753
+// aWindowConstraints.gridy = 0;
2754
+// aWindowConstraints.gridwidth = 1;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2757
+// aWindowConstraints.weightx = 0;
2758
+// aWindowConstraints.weighty = 1;
2759
+// //bigThree.add(jtp, aWindowConstraints);
2760
+// aWindowConstraints.weightx = 1;
2761
+// aWindowConstraints.gridwidth = 3;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.gridx = 1;
2764
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2765
+// bigThree.add(centralPanel, aWindowConstraints);
2766
+// aWindowConstraints.weightx = 0;
2767
+// aWindowConstraints.gridx = 4;
2768
+// aWindowConstraints.gridwidth = 1;
2769
+// // aConstraints.gridheight = 3;
2770
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2771
+// //bigThree.add(XYZPanel, aWindowConstraints);
2772
+// scenePanel.setVisible(false);
2773
+// centralPanel.setVisible(true);
2774
+// XYZPanel.setVisible(false);
2775
+ bigThree.ClearUI();
2776
+ bigThree.add(centralPanel);
2777
+ bigThree.FlushUI();
25512778 } else
2552
- if (event.getSource() == threeButton)
2779
+ if (source == threeButton)
25532780 {
25542781 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();
2782
+
2783
+// bigThree.remove(scenePanel);
2784
+// bigThree.remove(centralPanel);
2785
+// bigThree.remove(XYZPanel);
2786
+// aWindowConstraints.gridx = 0;
2787
+// aWindowConstraints.gridy = 0;
2788
+// aWindowConstraints.gridwidth = 1;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2791
+// aWindowConstraints.weightx = 0;
2792
+// aWindowConstraints.weighty = 1;
2793
+// //bigThree.add(jtp, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 1;
2795
+// aWindowConstraints.gridwidth = 3;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.gridx = 1;
2798
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2799
+// bigThree.add(centralPanel, aWindowConstraints);
2800
+// aWindowConstraints.weightx = 0;
2801
+// aWindowConstraints.gridx = 4;
2802
+// aWindowConstraints.gridwidth = 1;
2803
+// // aConstraints.gridheight = 3;
2804
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2805
+// bigThree.add(XYZPanel, aWindowConstraints);
2806
+// bigThree.validate();
2807
+// scenePanel.setVisible(false);
2808
+// centralPanel.setVisible(true);
2809
+// XYZPanel.setVisible(true);
2810
+ bigThree.ClearUI();
2811
+ bigThree.add(centralPanel);
2812
+ bigThree.add(XYZPanel);
2813
+ bigThree.FlushUI();
25792814 } else
2580
- if (event.getSource() == fourButton)
2815
+ if (source == fourButton)
25812816 {
25822817 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();
2818
+
2819
+// bigThree.remove(scenePanel);
2820
+// bigThree.remove(centralPanel);
2821
+// bigThree.remove(XYZPanel);
2822
+// aWindowConstraints.gridx = 0;
2823
+// aWindowConstraints.gridy = 0;
2824
+// aWindowConstraints.gridwidth = 1;
2825
+// // aWindowConstraints.gridheight = 3;
2826
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.weighty = 1;
2829
+// bigThree.add(scenePanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 1;
2831
+// aWindowConstraints.gridwidth = 3;
2832
+// // aConstraints.gridheight = 3;
2833
+// aWindowConstraints.gridx = 1;
2834
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2835
+// //bigThree.add(cameraPanel, aWindowConstraints);
2836
+// aWindowConstraints.weightx = 0;
2837
+// aWindowConstraints.gridx = 4;
2838
+// aWindowConstraints.gridwidth = 1;
2839
+// // aWindowConstraints.gridheight = 3;
2840
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2841
+// //bigThree.add(XYZPanel, aWindowConstraints);
2842
+// bigThree.validate();
2843
+// scenePanel.setVisible(true);
2844
+// centralPanel.setVisible(false);
2845
+// XYZPanel.setVisible(false);
2846
+ bigThree.ClearUI();
2847
+ bigThree.add(scenePanel);
2848
+ bigThree.FlushUI();
26072849 } else
2608
- if (event.getSource() == sixButton)
2850
+ if (source == sixButton)
26092851 {
26102852 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();
2853
+
2854
+// bigThree.remove(scenePanel);
2855
+// bigThree.remove(centralPanel);
2856
+// bigThree.remove(XYZPanel);
2857
+// aWindowConstraints.gridx = 0;
2858
+// aWindowConstraints.gridy = 0;
2859
+// aWindowConstraints.gridwidth = 1;
2860
+// // aConstraints.gridheight = 3;
2861
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.weighty = 1;
2864
+// bigThree.add(scenePanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 1;
2866
+// aWindowConstraints.gridwidth = 3;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.gridx = 1;
2869
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2870
+// bigThree.add(centralPanel, aWindowConstraints);
2871
+// aWindowConstraints.weightx = 0;
2872
+// aWindowConstraints.gridx = 4;
2873
+// aWindowConstraints.gridwidth = 1;
2874
+// // aWindowConstraints.gridheight = 3;
2875
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2876
+// //bigThree.add(XYZPanel, aConstraints);
2877
+// bigThree.validate();
2878
+// scenePanel.setVisible(true);
2879
+// centralPanel.setVisible(true);
2880
+// XYZPanel.setVisible(false);
2881
+ bigThree.ClearUI();
2882
+ bigThree.add(scenePanel);
2883
+ bigThree.add(centralPanel);
2884
+ bigThree.FlushUI();
26352885 } else
2636
- if (event.getSource() == sevenButton)
2886
+ if (source == sevenButton)
26372887 {
26382888 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();
2889
+
2890
+// bigThree.remove(scenePanel);
2891
+// bigThree.remove(centralPanel);
2892
+// bigThree.remove(XYZPanel);
2893
+// aWindowConstraints.gridx = 0;
2894
+// aWindowConstraints.gridy = 0;
2895
+// aWindowConstraints.gridwidth = 1;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.weighty = 1;
2900
+// bigThree.add(scenePanel, aWindowConstraints);
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.gridwidth = 3;
2903
+// // aWindowConstraints.gridheight = 3;
2904
+// aWindowConstraints.gridx = 1;
2905
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2906
+// bigThree.add(centralPanel, aWindowConstraints);
2907
+// aWindowConstraints.weightx = 0;
2908
+// aWindowConstraints.gridx = 4;
2909
+// aWindowConstraints.gridwidth = 1;
2910
+// // aConstraints.gridheight = 3;
2911
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2912
+// bigThree.add(XYZPanel, aWindowConstraints);
2913
+// bigThree.validate();
2914
+// scenePanel.setVisible(true);
2915
+// centralPanel.setVisible(true);
2916
+// XYZPanel.setVisible(true);
2917
+ bigThree.ClearUI();
2918
+ bigThree.add(scenePanel);
2919
+ bigThree.add(centralPanel);
2920
+ bigThree.add(XYZPanel);
2921
+ bigThree.FlushUI();
26632922 } else
2664
- if (event.getSource() == rootButton)
2923
+ if (source == rootButton)
26652924 {
26662925 Object3D obj;
26672926 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +2932,7 @@
26732932
26742933 refreshContents(true);
26752934 } else
2676
- if (event.getSource() == closeButton)
2935
+ if (source == closeButton)
26772936 {
26782937 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26792938 cRadio ab;
....@@ -2694,11 +2953,11 @@
26942953 }
26952954 refreshContents(true);
26962955 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
2956
+ if (source == editItem || source == editButton)
26982957 {
26992958 EditSelection(false);
27002959 } else
2701
- if (event.getSource() == uneditButton)
2960
+ if (source == uneditButton)
27022961 {
27032962 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27042963 {
....@@ -2710,12 +2969,12 @@
27102969
27112970 child.editWindow = null; // ???????????
27122971 }
2713
- objEditor.ctrlPanel.revalidate();
2972
+ objEditor.ctrlPanel.FlushUI();
27142973 //objEditor.jTree.clearSelection();
27152974 //objEditor.ResetSliders();
27162975 refreshContents(true);
27172976 } else
2718
- if (event.getSource() == clearPanelButton)
2977
+ if (source == clearPanelButton)
27192978 {
27202979 assert(copy == group);
27212980 //copy.ClearUI();
....@@ -2726,7 +2985,7 @@
27262985 listUI.clear();
27272986 refreshContents(true);
27282987 } else
2729
- if (event.getSource() == allParamsButton)
2988
+ if (source == allParamsButton)
27302989 {
27312990 assert(copy == group);
27322991
....@@ -2747,19 +3006,19 @@
27473006
27483007 refreshContents(true);
27493008 } else
2750
- if (event.getSource() == unselectButton)
3009
+ if (source == unselectButton)
27513010 {
27523011 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3012
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543013 objEditor.ResetSliders();
27553014 refreshContents(true);
27563015 } else
2757
- if(event.getSource() instanceof cRadio)
3016
+ if(source instanceof cRadio)
27583017 {
27593018 group.parent = keepparent;
27603019 group.attributes = 0;
27613020 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3021
+ /*cRadio*/ radio = (cRadio)source;
27633022 Object3D obj = radio.GetObject();
27643023 System.out.println("Edit " + obj);
27653024 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3038,7 @@
27793038 }
27803039
27813040 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3041
+ //Globals.theRenderer.object = group;
27833042 if(!useclient)
27843043 {
27853044 cameraView.renderCamera = radio.camera;
....@@ -2788,7 +3047,8 @@
27883047 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893048 cameraView.targetLookAt.set(radio.camera.lookAt);
27903049 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3050
+ //cameraView.lighttouched = true;
3051
+ Globals.lighttouched = true;
27923052 topView.object = group;
27933053 frontView.object = group;
27943054 sideView.object = group;
....@@ -2824,7 +3084,7 @@
28243084 if (useclient)
28253085 {
28263086 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3087
+ Globals.lighttouched = true;
28283088 //topView.object = client;
28293089 //frontView.object = client;
28303090 //sideView.object = client;
....@@ -2832,7 +3092,7 @@
28323092 else
28333093 {
28343094 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3095
+ Globals.lighttouched = true;
28363096 //topView.object = group;
28373097 //frontView.object = group;
28383098 //sideView.object = group;
....@@ -3065,9 +3325,9 @@
30653325 obj = (Object3D)e.nextElement();
30663326
30673327 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3328
+ GrafreeD.AnalyzeObject(obj);
30693329 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3330
+ GrafreeD.AnalyzeObject(obj.bRep);
30713331
30723332 // System.err.println((size/1024) + " KB is the size of " + obj);
30733333 }
....@@ -3109,6 +3369,13 @@
31093369 void GenNormals(boolean crease)
31103370 {
31113371 group.GenNormalsS(crease);
3372
+
3373
+ refreshContents();
3374
+ }
3375
+
3376
+ void GenNormalsMINE()
3377
+ {
3378
+ group.selection.GenNormalsMINE();
31123379
31133380 refreshContents();
31143381 }
....@@ -3157,104 +3424,250 @@
31573424
31583425 //Object3D buffer;
31593426 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
-
3427
+// BoundaryRep temprep;
3428
+// Object3D nodes;
3429
+// Vector<Vertex> vertices;
3430
+//
3431
+// cGroup buffer;
3432
+//
3433
+// public void Vertex(Object3D node, Vertex v)
3434
+// {
3435
+//// vertices.add(v);
3436
+//// nodes.addElement(node);
3437
+////
3438
+//// if (temprep.GetCache(v) != null)
3439
+//// {
3440
+//// temprep.Remove(v);
3441
+//// } else
3442
+//// {
3443
+//// temprep.Remember(v);
3444
+//// }
3445
+//
3446
+// //Object3D node = nodes.get(index);
3447
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3448
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3449
+//
3450
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3451
+//
3452
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3453
+//
3454
+// cGroup g = new cGroup();
3455
+//
3456
+// if (g.toParent == null)
3457
+// {
3458
+// g.toParent = LA.newMatrix();
3459
+// g.fromParent = LA.newMatrix();
3460
+// }
3461
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3462
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3463
+//
3464
+// g.add(GrafreeD.clipboard);
3465
+//
3466
+// buffer.add(g);
3467
+// }
3468
+//
3469
+// public void Face(Object3D node, Face f)
3470
+// {
3471
+//
3472
+// }
3473
+//
3474
+// void ParseVerticesOld() // ??
3475
+// {
3476
+// //if (group.selection.size() != 1)
3477
+// // return;
3478
+//
3479
+// temprep = new BoundaryRep();
3480
+// nodes = new Object3D();
3481
+// vertices = new Vector<Vertex>();
3482
+//
3483
+// boolean epsequal = GrafreeD.epsequal;
3484
+// GrafreeD.epsequal = true;
3485
+//
3486
+// for (int i=0; i<group.selection.size(); i++)
3487
+// {
3488
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3489
+//
3490
+// group.selection.get(i).Parse(
3491
+//this );
3492
+//
3493
+// int repsize = temprep.VertexCount();
3494
+// int tablesize = temprep.vertextable.size();
3495
+// int nodesize = nodes.size();
3496
+//
3497
+// assert(vertices.size() == nodes.size());
3498
+//
3499
+// temprep.vertextable.elements();
3500
+//
3501
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3502
+//
3503
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3504
+// {
3505
+// cGroup g = new cGroup();
3506
+//
3507
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3508
+//
3509
+// Object3D node = nodes.get(index);
3510
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3511
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3512
+//
3513
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3514
+//
3515
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3516
+//
3517
+// if (g.toParent == null)
3518
+// {
3519
+// g.toParent = LA.newMatrix();
3520
+// g.fromParent = LA.newMatrix();
3521
+// }
3522
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3523
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3524
+//
3525
+// g.add(GrafreeD.clipboard);
3526
+//
3527
+// buffer.add(g);
3528
+// }
3529
+//
3530
+// makeSomething(buffer, i==group.selection.size()-1);
3531
+// }
3532
+//
3533
+// GrafreeD.epsequal = epsequal;
3534
+//
3535
+// //buffer = null;
3536
+// temprep = null;
3537
+// nodes = null;
3538
+//
3539
+// refreshContents();
3540
+// }
3541
+
31843542 void ParseVertices()
31853543 {
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;
3544
+ boolean epsequal = GrafreeD.epsequal;
3545
+ GrafreeD.epsequal = true;
31953546
31963547 for (int i=0; i<group.selection.size(); i++)
31973548 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3549
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993550
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3551
+ group.selection.get(i).Parse(
3552
+
3553
+ new iParse()
3554
+ {
3555
+ public void Vertex(Object3D node, Vertex v)
3556
+ {
3557
+ temp.set(v);
3558
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053559
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();
3560
+ cGroup g = new cGroup();
32113561
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3562
+ if (g.toParent == null)
3563
+ {
3564
+ g.toParent = LA.newMatrix();
3565
+ g.fromParent = LA.newMatrix();
3566
+ }
3567
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3568
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153569
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);
3570
+ g.add(GrafreeD.clipboard);
32203571
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);
3572
+ buffer.add(g);
3573
+ }
32323574
3233
- g.add(GraphreeD.clipboard);
3575
+ public void Face(Object3D node, Face f)
3576
+ {
32343577
3235
- buffer.add(g);
3236
- }
3578
+ }
3579
+ }
3580
+ );
32373581
32383582 makeSomething(buffer, i==group.selection.size()-1);
32393583 }
32403584
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3585
+ GrafreeD.epsequal = epsequal;
32463586
32473587 refreshContents();
32483588 }
3249
-
3589
+
3590
+ void TextureVertices()
3591
+ {
3592
+ for (int i=0; i<group.selection.size(); i++)
3593
+ {
3594
+ group.selection.get(i).Parse(
3595
+ new iParse()
3596
+ {
3597
+ public void Vertex(Object3D node, Vertex v)
3598
+ {
3599
+ cTexture tex = node.GetTextures();
3600
+ String pigment = Object3D.GetPigment(tex);
3601
+ //String bump = Object3D.GetBump(tex);
3602
+
3603
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3604
+
3605
+ double s = v.s;
3606
+
3607
+ if (s == 1)
3608
+ s = 0;
3609
+
3610
+ double t = v.t;
3611
+
3612
+ if (t == 1)
3613
+ t = 0;
3614
+
3615
+ int indexs = (int) (texturedata.getWidth() * s);
3616
+ int indext = (int) (texturedata.getHeight() * t);
3617
+
3618
+ int index = indext * texturedata.getWidth() + indexs;
3619
+
3620
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3621
+
3622
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3623
+
3624
+ float scale = bytebuf.get(index*slide) & 0xFF;
3625
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3626
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3627
+ scale /= 3;
3628
+
3629
+ scale /= 0xFF;
3630
+ // c'est quoi ca? scale /= 4;
3631
+
3632
+ //v.AO = scale;
3633
+
3634
+ v.x += v.norm.x * scale;
3635
+ v.y += v.norm.y * scale;
3636
+ v.z += v.norm.z * scale;
3637
+ }
3638
+
3639
+ public void Face(Object3D node, Face f)
3640
+ {
3641
+ }
3642
+ }
3643
+ );
3644
+ }
3645
+
3646
+ refreshContents();
3647
+ }
3648
+
32503649 void Align()
32513650 {
3651
+ if (group.selection.size() == 0)
3652
+ return;
3653
+
3654
+ cVector bbmin = new cVector();
3655
+ cVector bbmax = new cVector();
3656
+
3657
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3658
+
3659
+ double dx = bbmax.x - bbmin.x;
3660
+ double dy = bbmax.y - bbmin.y;
3661
+ double dz = bbmax.z - bbmin.z;
3662
+
3663
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3664
+
32523665 for (int i=0; i<group.selection.size(); i++)
32533666 {
32543667 Object3D obj = group.selection.get(i);
32553668
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3669
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3670
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583671 }
32593672
32603673 refreshContents();
....@@ -3267,7 +3680,7 @@
32673680 // ref.SaveSupports();
32683681 // Object3D par = ref.parent;
32693682 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3683
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713684 // ref.parent = par;
32723685 // ref.RestoreSupports();
32733686
....@@ -3275,11 +3688,11 @@
32753688
32763689 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773690
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3691
+ boolean random = CameraPane.SWITCH;
3692
+ CameraPane.SWITCH = false; // parse all random nodes
32803693 lowres.linkVerticesThis(null);
32813694 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3695
+ CameraPane.SWITCH = random;
32833696
32843697 System.err.flush();
32853698
....@@ -3297,7 +3710,7 @@
32973710 // lowres.SaveSupports();
32983711 // par = lowres.parent;
32993712 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3713
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013714 Object3D newlow = CloneObject(lowres, false);
33023715 newlow.name = sn.switchobject.get(i).name;
33033716 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3732,7 @@
33193732 return;
33203733
33213734 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3735
+ Object3D ref = GrafreeD.clipboard.get(0);
33233736
33243737 Object3D newgroup = new Object3D("Po:" + poses.name);
33253738
....@@ -3488,7 +3901,7 @@
34883901 group.selection.RelinkToSupport(); // july 2014
34893902 System.out.println("DONE.");
34903903 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3904
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34923905 }
34933906
34943907 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +3926,20 @@
35133926
35143927 void ClipMesh()
35153928 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3929
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
35173930 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
3931
+ Object3D content = GrafreeD.clipboard.get(0);
35193932
35203933 if (content instanceof cGroup && ((cGroup)content).transientlink )
35213934 content = ((cGroup)content).get(0);
35223935
35233936 // for (int i=0; i<group.selection.size(); i++)
35243937 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3938
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35263939 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
3940
+ group.selection.ClipMesh(GrafreeD.clipboard);
35283941 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
3942
+// group.selection.ClipMesh(GrafreeD.clipboard);
35303943 System.out.println("DONE.");
35313944 refreshContents();
35323945 }
....@@ -3764,25 +4177,25 @@
37644177 System.err.println("info : " + child.GetPath());
37654178 }
37664179 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4180
+// else
4181
+// {
4182
+// objEditor.SetMaterial(group); // .GetMaterial());
4183
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4184
+// System.err.println("info : " + group.GetPath());
4185
+// }
37734186
37744187 objEditor.SetText(); // jan 2014
37754188
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4189
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
37774190 CameraPane.flash = true;
37784191
37794192 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
37804193 // a camera
37814194 {
37824195 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;
4196
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4197
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4198
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864199 }
37874200
37884201 refreshContents();
....@@ -3864,12 +4277,12 @@
38644277 {
38654278 if (group.selection.isEmpty())
38664279 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4280
+ GrafreeD.clipboardIsTempGroup = false;
38684281 Composite tGroup = null;
38694282 if (group.selection.size() > 0) // 1)
38704283 {
38714284 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4285
+ GrafreeD.clipboardIsTempGroup = true;
38734286 }
38744287
38754288 if (cut)
....@@ -3909,16 +4322,16 @@
39094322 //System.out.println("cut " + child);
39104323 //System.out.println("parent = " + child.parent);
39114324 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4325
+ if (GrafreeD.clipboardIsTempGroup)
39134326 tGroup.add/*Child*/(tmp);
39144327 else
3915
- GraphreeD.clipboard = tmp;
4328
+ GrafreeD.clipboard = tmp;
39164329 }
39174330 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4331
+ if (GrafreeD.clipboardIsTempGroup)
39194332 tGroup.add/*Child*/(child);
39204333 else
3921
- GraphreeD.clipboard = child;
4334
+ GrafreeD.clipboard = child;
39224335 }
39234336
39244337 //ResetModel();
....@@ -3950,21 +4363,21 @@
39504363 //System.out.println("cut " + elem);
39514364 //System.out.println("parent = " + elem.parent);
39524365 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4366
+ if (GrafreeD.clipboardIsTempGroup)
39544367 tGroup.add/*Child*/(tmp);
39554368 else
3956
- GraphreeD.clipboard = tmp;
4369
+ GrafreeD.clipboard = tmp;
39574370 }
39584371 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4372
+ if (GrafreeD.clipboardIsTempGroup)
39604373 tGroup.add/*Child*/(child);
39614374 else
3962
- GraphreeD.clipboard = child;
4375
+ GrafreeD.clipboard = child;
39634376 }
39644377
39654378 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4379
+ if (GrafreeD.clipboardIsTempGroup)
4380
+ GrafreeD.clipboard = tGroup;
39684381 if (cut)
39694382 {
39704383 ResetModel();
....@@ -3974,11 +4387,11 @@
39744387
39754388 void paste(boolean expand)
39764389 {
3977
- // if (GraphreeD.clipboard == null)
4390
+ // if (GrafreeD.clipboard == null)
39784391 // return;
39794392 boolean first = true;
39804393
3981
- if (GraphreeD.clipboardIsTempGroup)
4394
+ if (GrafreeD.clipboardIsTempGroup)
39824395 {
39834396 Composite temp;
39844397
....@@ -3989,7 +4402,7 @@
39894402 temp = (Composite)Applet3D.clipboard.deepCopy();
39904403 */
39914404 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4405
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934406 {
39944407 Object3D child = (Object3D)e.nextElement();
39954408
....@@ -4003,7 +4416,7 @@
40034416 else
40044417 elem = child.deepCopy(); // ?
40054418 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4419
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074420 // elem = elem.get(0);
40084421 makeSomething(elem, true); // ?? first);
40094422 //group.addChild(elem);
....@@ -4023,23 +4436,23 @@
40234436 //Object3D cb = Applet3D.clipboard;
40244437 //temp.addChild(cb);
40254438 //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());
4439
+ assert(GrafreeD.clipboard.parent == null);
4440
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4441
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4442
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4443
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
40314444 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4445
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4446
+ GrafreeD.clipboard.get(0).parent = keepparent;
40344447 }
40354448
40364449 ResetModel();
40374450 refreshContents();
40384451 }
40394452
4040
- void pasteInto(boolean copyit)
4453
+ void pasteInto(boolean copyit, boolean clone)
40414454 {
4042
-// if (GraphreeD.clipboard == null)
4455
+// if (GrafreeD.clipboard == null)
40434456 // return;
40444457
40454458 if (group.selection.size() != 1)
....@@ -4066,15 +4479,22 @@
40664479 if (copyit)
40674480 {
40684481 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4482
+ if (clone)
4483
+ {
4484
+ CloneClipboard(false); // sept 2014
4485
+ }
4486
+ else
4487
+ {
4488
+ paste(false);
4489
+ }
40704490 }
40714491 else
40724492 {
40734493 boolean first = true;
40744494
4075
- if (GraphreeD.clipboardIsTempGroup)
4495
+ if (GrafreeD.clipboardIsTempGroup)
40764496 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4497
+ Composite temp = (Composite)GrafreeD.clipboard;
40784498 Object3D copy;
40794499 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804500 {
....@@ -4084,7 +4504,7 @@
40844504 }
40854505 } else
40864506 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4507
+ linkSomething(GrafreeD.clipboard); //.get(0));
40884508 }
40894509 }
40904510 }
....@@ -4276,6 +4696,26 @@
42764696 makeSomething(csg);
42774697 }
42784698
4699
+ void Ungroup(Object3D g)
4700
+ {
4701
+ if (g instanceof HiddenObject)
4702
+ {
4703
+ HiddenObject h = (HiddenObject) g;
4704
+
4705
+ for (int i=0; i<h.ActualSize(); i++)
4706
+ {
4707
+ objEditor.makeSomething(h.get(i), false);
4708
+ }
4709
+ }
4710
+ else
4711
+ {
4712
+ for (int i=0; i<g.Size(); i++)
4713
+ {
4714
+ objEditor.makeSomething(g.get(i), false);
4715
+ }
4716
+ }
4717
+ }
4718
+
42794719 void ungroup()
42804720 {
42814721 /*
....@@ -4471,7 +4911,7 @@
44714911
44724912 void ImportGFD()
44734913 {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4914
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
44754915 browser.show();
44764916 String filename = browser.getFile();
44774917 if (filename != null && filename.length() > 0)
....@@ -4509,7 +4949,7 @@
45094949
45104950 void ImportVRMLX3D()
45114951 {
4512
- if (GraphreeD.standAlone)
4952
+ if (GrafreeD.standAlone)
45134953 {
45144954 /**/
45154955 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4526,7 +4966,7 @@
45264966
45274967 String GetFile(String dialogName)
45284968 {
4529
- if (GraphreeD.standAlone)
4969
+ if (GrafreeD.standAlone)
45304970 {
45314971 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45324972 browser.show();
....@@ -4590,10 +5030,12 @@
45905030 cButton flashSelectionButton;
45915031 cButton editButton;
45925032 cButton uneditButton;
5033
+ JCheckBox allParamsButton;
45935034 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955035 cButton unselectButton;
45965036
5037
+ cButton oneStepButton;
5038
+
45975039 cButton screenfitButton;
45985040 cButton screenfitpointButton;
45995041 cButton snapobjectButton;
....@@ -4635,6 +5077,7 @@
46355077 private MenuItem resetsupportItem;
46365078 private MenuItem resetreferencesItem;
46375079 private MenuItem linkverticesItem;
5080
+ private MenuItem relinkverticesItem;
46385081 private MenuItem setMasterItem;
46395082 private MenuItem resetMeshItem;
46405083 private MenuItem stepAllItem;
....@@ -4647,14 +5090,17 @@
46475090 private MenuItem mergeGeometriesItem;
46485091 private MenuItem copyItem;
46495092 private MenuItem pasteItem;
5093
+ private MenuItem pasteIntoItem;
46505094 private MenuItem pasteLinkItem;
46515095 private MenuItem pasteCloneItem;
46525096 private MenuItem pasteExpandItem;
46535097 private MenuItem clearItem;
46545098 private MenuItem clearAllItem;
46555099 private MenuItem genUVItem;
5100
+ private MenuItem genNormalsMESHItem;
46565101 private MenuItem genNormalsCADItem;
46575102 private MenuItem genNormalsORGANItem;
5103
+ private MenuItem genNormalsMINEItem;
46585104 private MenuItem stripifyItem;
46595105 private MenuItem unstripifyItem;
46605106 private MenuItem trimItem;
....@@ -4696,6 +5142,7 @@
46965142 private MenuItem resetCentroidItem;
46975143 private MenuItem transformgeometryItem;
46985144 private MenuItem resetTransformItem;
5145
+ private MenuItem hideItem;
46995146 private MenuItem grabItem;
47005147 private MenuItem backItem;
47015148 private MenuItem frontItem;
....@@ -4716,6 +5163,7 @@
47165163
47175164 private MenuItem resetParentItem;
47185165 private MenuItem repairParentItem;
5166
+ private MenuItem repairShadowItem;
47195167 private MenuItem sortbysizeItem;
47205168 private MenuItem sortbynameItem;
47215169
....@@ -4728,16 +5176,19 @@
47285176 private MenuItem particleItem;
47295177 private MenuItem ragdollItem;
47305178 private MenuItem ragdoll2Item;
5179
+ private MenuItem heightFieldItem;
5180
+ private MenuItem textureFieldItem;
47315181 private MenuItem gridItem;
47325182 private MenuItem rectoidItem;
47335183 private MenuItem ellipsoidItem;
47345184 private MenuItem coneItem;
47355185 private MenuItem torusItem;
47365186 private MenuItem superItem;
5187
+ private MenuItem kleinItem;
47375188 private MenuItem blobItem;
47385189 private MenuItem latheItem;
47395190 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5191
+ private MenuItem overlayItem;
47415192 private MenuItem meshItem;
47425193 // private MenuItem meshGroupItem;
47435194 private MenuItem springItem;
....@@ -4746,6 +5197,7 @@
47465197 private MenuItem csgItem;
47475198 private MenuItem templateItem;
47485199 private MenuItem textureItem;
5200
+ private MenuItem billboardItem;
47495201 private MenuItem shadowXItem;
47505202 private MenuItem shadowYItem;
47515203 private MenuItem shadowZItem;