Normand Briere
2019-06-11 1d909ffa0c2beb51d453b53b845c4f3a749ca5f0
GroupEditor.java
....@@ -12,9 +12,10 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
17
-class GroupEditor extends ObjEditor implements iParse, //iCallBack,
18
+class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
1819 ObjectUI,
1920 Runnable,
2021 ActionListener,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,130 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,44 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
193
- resetMeshItem.addActionListener(this);
194
- stepAllItem = menu.add(new MenuItem("Step All"));
195
- stepAllItem.addActionListener(this);
286
+ }
287
+
288
+ oe.menuBar.add(menu = new Menu("Setting"));
289
+ if (Globals.ADVANCED)
290
+ {
196291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197292 revertMeshItem.addActionListener(this);
198293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199294 resetreferencesItem.addActionListener(this);
200295 menu.add("-");
296
+ }
201297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202298 overwriteGeoItem.addActionListener(this);
203299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,47 +305,68 @@
209305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210306 overwriteUVItem.addActionListener(this);
211307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
212310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213311 generateMeshItem.addActionListener(this);
214312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215313 poseMeshItem.addActionListener(this);
216314 menu.add("-");
315
+ }
217316 resetsupportItem = menu.add(new MenuItem("Reset support"));
218317 resetsupportItem.addActionListener(this);
219318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
221325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222326 setMasterItem.addActionListener(this);
327
+ }
223328
224
- oe.menuBar.add(menu = new Menu("Object"));
329
+ oe.menuBar.add(menu = new Menu("Group"));
225330 grabItem = menu.add(new MenuItem("Grab"));
226331 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229332 backItem = menu.add(new MenuItem("Back"));
230333 backItem.addActionListener(this);
334
+ frontItem = menu.add(new MenuItem("Front"));
335
+ frontItem.addActionListener(this);
231336 compositeItem = menu.add(new MenuItem("Composite"));
232337 compositeItem.addActionListener(this);
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
339
+ hideItem.addActionListener(this);
340
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
341
+ ungroupItem.addActionListener(this);
233342 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
235344 randomItem.addActionListener(this);
236
- physicsItem = menu.add(new MenuItem("Physics"));
237
- physicsItem.addActionListener(this);
238
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
239
- frameselectorItem.addActionListener(this);
240345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241346 switchGeoItem.addActionListener(this);
242347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243348 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
245350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
246359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247360 scriptNodeItem.addActionListener(this);
248361 cameraItem = menu.add(new MenuItem("Camera"));
249362 cameraItem.addActionListener(this);
250
- menu.add("-");
363
+ }
364
+
365
+ oe.menuBar.add(menu = new Menu("Object"));
251366 textureItem = menu.add(new MenuItem("Texture"));
252367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
253370 csgItem = menu.add(new MenuItem("CSG"));
254371 csgItem.addActionListener(this);
255372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -258,23 +375,29 @@
258375 shadowYItem.addActionListener(this);
259376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
260377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
261381 linkerItem = menu.add(new MenuItem("Linker"));
262382 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265383 attributeItem = menu.add(new MenuItem("Attribute"));
266384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
267387 pointflowItem = menu.add(new MenuItem("Point Flow"));
268388 pointflowItem.addActionListener(this);
389
+ }
269390 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273392 resetTransformItem.addActionListener(this);
274393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275394 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
278401
279402 oe.menuBar.add(menu = new Menu("Geometry"));
280403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +406,13 @@
283406 genNormalsORGANItem.addActionListener(this);
284407 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285408 genNormalsCADItem.addActionListener(this);
409
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
410
+ genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
286416 stripifyItem = menu.add(new MenuItem("Stripify"));
287417 stripifyItem.addActionListener(this);
288418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +422,6 @@
292422 untrimItem = menu.add(new MenuItem("Untrim"));
293423 untrimItem.addActionListener(this);
294424 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297425 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298426 clearColorsItem.addActionListener(this);
299427 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +434,34 @@
306434 reduce34MeshItem.addActionListener(this);
307435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308436 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
445
+
446
+ oe.menuBar.add(menu = new Menu("Attributes"));
447
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
448
+ clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
313453 menu.add("-");
314454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315455 liveleavesItem.addActionListener(this);
316456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
318460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319461 supportleavesItem.addActionListener(this);
320462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321463 unsupportleavesItem.addActionListener(this);
464
+ }
322465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323466 hideleavesItem.addActionListener(this);
324467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -332,27 +475,18 @@
332475 flipVItem.addActionListener(this);
333476 unflipVItem = menu.add(new MenuItem("Unflip V"));
334477 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
478
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336479 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
480
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338481 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
482
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340483 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
484
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342485 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
486
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344487 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
488
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346489 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);
356490
357491 oe.menuBar.add(menu = new Menu("Selection"));
358492 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +504,24 @@
370504 sortbysizeItem.addActionListener(this);
371505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372506 sortbynameItem.addActionListener(this);
507
+ menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
515
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
516
+ extractGeometriesItem.addActionListener(this);
517
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
518
+ cloneGeometriesItem.addActionListener(this);
519
+ }
520
+
373521 oe.menuBar.add(menu = new Menu("Insert"));
374522 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
523
+
524
+ oe.menuBar.add(menu = new Menu("Tools"));
376525 buildToolsMenu(menu);
377526 }
378527
....@@ -406,150 +555,110 @@
406555 oe.radioPanel.add(dummyButton);
407556 oe.buttonGroup.add(dummyButton);
408557 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412559
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
414574 liveCB.addItemListener(this);
415575
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);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
434582 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);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
476586 trackCB.addItemListener(this);
477587
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
480590 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
591
+
482592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483593 // 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;
488594
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);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ flashSelectionButton.setToolTipText("Show selection");
495604 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499605
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607
+
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ twoButton.setToolTipText("Show center view only");
502610 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504612 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
613
+ fourButton.setToolTipText("Show left panel only");
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ sixButton.setToolTipText("2-column layout left");
506616 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618
+ threeButton.setToolTipText("2-column layout right");
508619 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ sevenButton.setToolTipText("3-column layout");
510622 sevenButton.addActionListener(this);
511623 //
512624
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
514627 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ closeButton.setToolTipText("Close tab");
517631 closeButton.addActionListener(this);
518632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519633 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521634
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
524639 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528640
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
530643 uneditButton.addActionListener(this);
531644
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);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
544647 allParamsButton.addActionListener(this);
545648
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);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
551655 unselectButton.addActionListener(this);
552656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
553662 // oe.aConstraints.gridx += 1;
554663 // oe.aConstraints.weighty = 0;
555664 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +670,37 @@
561670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562671 // gcButton.addActionListener(this);
563672
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;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
575676 //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);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577678 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
582682
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);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
587687 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
590691 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
593695 textureCB.addItemListener(this);
594696
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
597700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
598704 //jList.addListSelectionListener(this);
599705 oe.jTree.addTreeSelectionListener(this);
600706 //jTree.setRootVisible(false);
....@@ -616,18 +722,91 @@
616722 radio.layout = sevenButton;
617723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618724 }
725
+
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727
+ {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
757
+// constraints.gridy += 1;
758
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759
+// speakerMocapCB.addItemListener(this);
760
+
761
+ if (false)
762
+ {
763
+ // handled in scripts
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
766
+ speakerCameraCB.addItemListener(this);
767
+
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
770
+ speakerFocusCB.addItemListener(this);
771
+
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774
+ smoothfocusCB.addItemListener(this);
775
+ }
776
+
777
+//constraints.gridx += 1;
778
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779
+// debugCB.addItemListener(this);
780
+
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
782
+ oeilCB.addItemListener(this);
783
+
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785
+ lookAtCB.setToolTipText("Look-at target");
786
+ lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
795
+
796
+ }
619797
620798 void EditObject(Object3D obj)
621799 {
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();
800
+ cRadio radioButton = new cRadio(obj.name);
801
+ radioButton.SetObject(obj);
802
+ radioButton.layout = sevenButton;
803
+ radioButton.SetCamera(cameraView.renderCamera, false);
804
+ radioButton.addActionListener(this);
805
+ radioPanel.add(radioButton);
806
+ buttonGroup.add(radioButton);
807
+ radioButton.doClick();
630808 }
809
+
631810 void SetupViews(ObjEditor oe)
632811 {
633812 oe.SetupViews();
....@@ -646,6 +825,7 @@
646825 JCheckBox fastCB;
647826 JCheckBox slowCB;
648827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
649829 JCheckBox trackCB;
650830 JCheckBox smoothfocusCB;
651831 // JCheckBox speakerMocapCB;
....@@ -688,8 +868,7 @@
688868 dropAttributes |= Object3D.TEXTURE;
689869 else
690870 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
693872 {
694873 cameraView.ToggleLive();
695874 }
....@@ -726,6 +905,10 @@
726905 Recompile();
727906 cameraView.repaint();
728907 // refreshContents();
908
+ }
909
+ else if(e.getSource() == zoomBoxCB)
910
+ {
911
+ cameraView.ToggleZoomBoxMode();
729912 }
730913 else if(e.getSource() == smoothfocusCB)
731914 {
....@@ -840,7 +1023,9 @@
8401023 // objEditor.DropFile((java.io.File[]) object, true);
8411024 // return;
8421025 // }
843
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441029 {
8451030 // file(s)
8461031 String[] names = string.split("\n");
....@@ -867,7 +1052,7 @@
8671052
8681053 flashIt = false;
8691054 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721057
8731058 if (group.selection.size() == 1)
....@@ -894,11 +1079,11 @@
8941079 {
8951080 loadClipboard(true);
8961081 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
1082
+ pasteInto(false, false);
8981083 } else {
8991084 loadClipboard(false);
9001085 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9021087 }
9031088 }
9041089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1187,8 @@
10021187
10031188 void buildCreateMenu(Menu menu)
10041189 {
1190
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1191
+ //heightFieldItem.addActionListener(this);
10051192 gridItem = menu.add(new MenuItem("Grid"));
10061193 gridItem.addActionListener(this);
10071194 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1201,37 @@
10141201 torusItem.addActionListener(this);
10151202 superItem = menu.add(new MenuItem("Superellipsoid"));
10161203 superItem.addActionListener(this);
1204
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1205
+ kleinItem.addActionListener(this);
10171206 particleItem = menu.add(new MenuItem("Particle system"));
10181207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10191210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201211 ragdollItem.addActionListener(this);
10211212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221213 ragdoll2Item.addActionListener(this);
1214
+ }
10231215 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251217 meshItem.addActionListener(this);
10261218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10281222 springItem = menu.add(new MenuItem("Spring"));
10291223 springItem.addActionListener(this);
10301224 flagItem = menu.add(new MenuItem("Flag"));
10311225 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);
10361226 blobItem = menu.add(new MenuItem("Blob"));
10371227 blobItem.addActionListener(this);
10381228 latheItem = menu.add(new MenuItem("Lathe"));
10391229 latheItem.addActionListener(this);
1230
+ }
1231
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1232
+ bezierItem.addActionListener(this);
1233
+ overlayItem = menu.add(new MenuItem("Overlay"));
1234
+ overlayItem.addActionListener(this);
10401235 lightItem = menu.add(new MenuItem("Light"));
10411236 lightItem.addActionListener(this);
10421237 menu.add("-");
....@@ -1046,41 +1241,39 @@
10461241 loopItem.addActionListener(this);
10471242 doubleItem = menu.add(new MenuItem("Fork"));
10481243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
10491246 tripleItem = menu.add(new MenuItem("Trident"));
10501247 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);
1248
+ }
10601249 }
10611250
10621251 void buildToolsMenu(Menu menu)
10631252 {
10641253 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651254 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1255
+ animationItem.setState(Globals.ANIMATION);
10671256
10681257 menu.add("-");
10691258 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701259 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1260
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1261
+ textureFieldItem.addActionListener(this);
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721263 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761265 reduceMorphItem.addActionListener(this);
10771266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781267 reduce34MorphItem.addActionListener(this);
1079
-
1268
+ menu.add("-");
10801269 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811270 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
10841277 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851278 memoryItem.addActionListener(this);
10861279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1094,6 +1287,8 @@
10941287 resetParentItem.addActionListener(this);
10951288 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961289 repairParentItem.addActionListener(this);
1290
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1291
+ repairShadowItem.addActionListener(this);
10971292 menu.add(invariantsItem = new MenuItem("Invariants"));
10981293 invariantsItem.addActionListener(this);
10991294 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1296,7 @@
11011296 menu.add("-");
11021297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031298 editScriptItem.addActionListener(this);
1299
+ }
11041300 }
11051301
11061302 void ScreenFit()
....@@ -1429,9 +1625,9 @@
14291625
14301626 void Overwrite(int mask)
14311627 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331629 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14351631
14361632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371633 content = ((cGroup)content).get(0);
....@@ -1454,6 +1650,7 @@
14541650 //
14551651 public void actionPerformed(ActionEvent event) // , Object arg)
14561652 {
1653
+ Object source = event.getSource();
14571654 /*
14581655 if (event.getSource() == nameField)
14591656 {
....@@ -1465,11 +1662,11 @@
14651662 }
14661663 else
14671664 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1665
+ if (source == lookAtItem || source == lookFromItem)
14691666 {
14701667 ScreenFit();
14711668 } else
1472
- if (event.getSource() == switchItem)
1669
+ if (source == switchItem)
14731670 {
14741671 cVector v1 = new cVector();
14751672 cVector v2 = new cVector();
....@@ -1478,11 +1675,11 @@
14781675 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791676 objEditor.cameraView.repaint();
14801677 } else
1481
- if (event.getSource() == rectoidItem)
1678
+ if (source == rectoidItem)
14821679 {
14831680 makeSomething(new Box());
14841681 } else
1485
- if (event.getSource() == particleItem)
1682
+ if (source == particleItem)
14861683 {
14871684 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881685 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1700,9 @@
15031700 applyExample(particleGeom, "SMOKE");
15041701 makeSomething(particleGeom);
15051702 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1703
+ if (source == ragdollItem || source == ragdoll2Item)
15071704 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1705
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091706
15101707 ragdoll.toParent = LA.newMatrix();
15111708 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1718,71 @@
15211718 makeSomething(ragdoll);
15221719 //makeSomething(new VehicleDemo());
15231720 } else
1524
- if (event.getSource() == gridItem)
1721
+ /*
1722
+ */
1723
+ if (source == heightFieldItem)
1724
+ {
1725
+ Object3D obj = new Object3D();
1726
+
1727
+ obj.CreateMaterial();
1728
+ obj.bRep = new BoundaryRep();
1729
+
1730
+ obj.bRep.CreateMesh(new iHeightField()
1731
+ {
1732
+ public double f(double x, double y)
1733
+ {
1734
+ // The Mandelbrot set is represented by coloring
1735
+ // each point (x,y) according to the number of
1736
+ // iterations it takes before the while loop in
1737
+ // this method ends. For points that are actually
1738
+ // in the Mandelbrot set, or very close to it, the
1739
+ // count will reach the maximum value, 80. These
1740
+ // points will be colored purple. All other colors
1741
+ // represent points that are definitely NOT in the set.
1742
+ x -= 600;
1743
+ y -= 500;
1744
+ x /= 200;
1745
+ y /= 200;
1746
+ int count = 0;
1747
+ double zx = x;
1748
+ double zy = y;
1749
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1750
+ double new_zx = zx*zx - zy*zy + x;
1751
+ zy = 2*zx*zy + y;
1752
+ zx = new_zx;
1753
+ count++;
1754
+ }
1755
+ return count; // Math.sqrt(count);
1756
+ }
1757
+ }, 1000,1000);
1758
+
1759
+ makeSomething(obj);
1760
+ } else
1761
+ if (source == gridItem)
15251762 {
15261763 makeSomething(new Grid());
15271764 } else
1528
- if (event.getSource() == ellipsoidItem)
1765
+ if (source == ellipsoidItem)
15291766 {
15301767 makeSomething(new Sphere());
15311768 } else
1532
- if (event.getSource() == coneItem)
1769
+ if (source == coneItem)
15331770 {
15341771 makeSomething(new Cone());
15351772 } else
1536
- if (event.getSource() == torusItem)
1773
+ if (source == torusItem)
15371774 {
15381775 makeSomething(new Torus());
15391776 } else
1540
- if (event.getSource() == superItem)
1777
+ if (source == superItem)
15411778 {
15421779 makeSomething(new Superellipsoid());
15431780 } else
1544
- if (event.getSource() == blobItem)
1781
+ if (source == kleinItem)
1782
+ {
1783
+ makeSomething(new Klein());
1784
+ } else
1785
+ if (source == blobItem)
15451786 {
15461787 Blob blob = new Blob();
15471788 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1790,15 @@
15491790 //blob.retile();
15501791 makeSomething(blob);
15511792 } else
1552
- if (event.getSource() == latheItem)
1793
+ if (source == latheItem)
15531794 {
15541795 makeSomething(new Lathe());
15551796 } else
1556
- if (event.getSource() == bezierItem)
1797
+ if (source == bezierItem)
15571798 {
15581799 makeSomething(new BezierSurface());
15591800 } else
1560
- if (event.getSource() == checkerItem)
1801
+ if (source == overlayItem)
15611802 {
15621803 /*
15631804 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1811,9 @@
15701811 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711812 LA.matInvert(obj.toParent, obj.fromParent);
15721813 */
1573
- makeSomething(new CheckerIG());
1814
+ makeSomething(new Checker());
15741815 } else
1575
- if (event.getSource() == meshItem)
1816
+ if (source == meshItem)
15761817 {
15771818 Object3D itemtomake = new Object3D();
15781819 Object3D child;
....@@ -1593,35 +1834,35 @@
15931834 makeSomething(child);
15941835 }
15951836 } else
1596
- if (event.getSource() == springItem)
1837
+ if (source == springItem)
15971838 {
15981839 cSpring s = new cSpring();
15991840 s.setup();
16001841 makeSomething(s);
16011842 } else
1602
- if (event.getSource() == flagItem)
1843
+ if (source == flagItem)
16031844 {
16041845 cSpring s = new cFlag();
16051846 s.setup();
16061847 makeSomething(s);
16071848 } else
1608
- if (event.getSource() == lightItem)
1849
+ if (source == lightItem)
16091850 {
16101851 makeSomething(new Light());
16111852 } else
1612
- if (event.getSource() == csgItem)
1853
+ if (source == csgItem)
16131854 {
16141855 group(new CSG());
16151856 } else
1616
- if (event.getSource() == templateItem)
1857
+ if (source == templateItem)
16171858 {
16181859 group(new cTemplate());
16191860 } else
1620
- if (event.getSource() == attributeItem)
1861
+ if (source == attributeItem)
16211862 {
16221863 makeSomething(new Attribute());
16231864 } else
1624
- if (event.getSource() == pointflowItem)
1865
+ if (source == pointflowItem)
16251866 {
16261867 makeSomething(new PointFlow());
16271868 } else
....@@ -1633,7 +1874,7 @@
16331874 } else
16341875 */
16351876
1636
- if (event.getSource() == superLoopItem)
1877
+ if (source == superLoopItem)
16371878 {
16381879 Composite g = new cGroup();
16391880 for (int i=0; i<15; i++)
....@@ -1655,7 +1896,7 @@
16551896
16561897 group(g);
16571898 } else
1658
- if (event.getSource() == loopItem)
1899
+ if (source == loopItem)
16591900 {
16601901 Composite csg = new GroupLeaf();
16611902 csg.count = 5;
....@@ -1664,7 +1905,7 @@
16641905 csg.addChild(child);
16651906 child.addChild(csg);
16661907 } else
1667
- if (event.getSource() == doubleItem)
1908
+ if (source == doubleItem)
16681909 {
16691910 Composite csg = new GroupLeaf();
16701911 csg.count = 5;
....@@ -1676,7 +1917,7 @@
16761917 csg.addChild(child);
16771918 child.addChild(csg);
16781919 } else
1679
- if (event.getSource() == tripleItem)
1920
+ if (source == tripleItem)
16801921 {
16811922 Composite csg = new GroupLeaf();
16821923 csg.count = 4;
....@@ -1691,71 +1932,71 @@
16911932 csg.addChild(child);
16921933 child.addChild(csg);
16931934 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
1935
+ if (source == computeAOItem)
16961936 {
1697
- ImportGFD();
1937
+ Globals.drawMode = CameraPane.OCCLUSION;
1938
+ Globals.theRenderer.repaint();
16981939 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1700
- {
1701
- ImportVRMLX3D();
1702
- } else
1703
- if (event.getSource() == import3DSItem)
1704
- {
1705
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1706
- } else
1707
- if (event.getSource() == importOBJItem)
1708
- {
1709
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1710
- } else
1711
- if (event.getSource() == computeAOItem)
1712
- {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1715
- } else
1716
- if (event.getSource() == recompileItem)
1940
+ if (source == recompileItem)
17171941 {
17181942 Recompile();
17191943 refreshContents();
17201944 } else
1721
- if (event.getSource() == editScriptItem)
1945
+ if (source == editScriptItem)
17221946 {
17231947 OpenDialog();
17241948 refreshContents();
17251949 } else
1726
- if (event.getSource() == invariantsItem)
1950
+ if (source == invariantsItem)
17271951 {
17281952 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
17301954 } else
1731
- if (event.getSource() == memoryItem)
1955
+ if (source == memoryItem)
17321956 {
17331957 //System.out.println("Invariants:");
17341958 PrintMemory();
17351959 } else
1736
- if (event.getSource() == pathItem)
1960
+ if (source == pathItem)
17371961 {
17381962 PrintPath();
17391963 } else
1740
- if (event.getSource() == analyzeItem)
1964
+ if (source == analyzeItem)
17411965 {
17421966 AnalyzeObject();
17431967 } else
1744
- if (event.getSource() == dumpItem)
1968
+ if (source == dumpItem)
17451969 {
17461970 DumpObject();
17471971 } else
1748
- if (event.getSource() == screenfitButton)
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
1984
+ if (source == oneStepButton)
1985
+ {
1986
+ Globals.ONESTEP = true;
1987
+ cameraView.repaint();
1988
+ } else
1989
+ if (source == screenfitButton)
17491990 {
17501991 //Reload(lastConverter, lastFilename, true);
17511992 ScreenFit();
17521993 } else
1753
- if (event.getSource() == screenfitpointButton)
1994
+ if (source == screenfitpointButton)
17541995 {
17551996 //Reload(lastConverter, lastFilename, true);
17561997 ScreenFitPoint();
17571998 } else
1758
- if (event.getSource() == snapobjectButton)
1999
+ if (source == snapobjectButton)
17592000 {
17602001 //Reload(lastConverter, lastFilename, true);
17612002 SnapObject();
....@@ -1766,13 +2007,13 @@
17662007 // Recompile();
17672008 // refreshContents();
17682009 // } else
1769
- if (event.getSource() == gcButton)
2010
+ if (source == gcButton)
17702011 {
17712012 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722013 System.gc();
17732014 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742015 } else
1775
- if (event.getSource() == editLeafItem)
2016
+ if (source == editLeafItem)
17762017 {
17772018 Object3D obj;
17782019 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2027,78 @@
17862027 }
17872028 refreshContents(true);
17882029 } else
1789
- if (event.getSource() == openWindowItem)
2030
+ if (source == openWindowItem)
17902031 {
17912032 EditSelection(true);
17922033 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2034
+ if (source == cutItem || source == clearButton)
17942035 {
17952036 loadClipboard(true);
17962037 } else
1797
- if (event.getSource() == duplicateItem)
2038
+ if (source == undoItem)
17982039 {
1799
- Object3D keep = GraphreeD.clipboard;
2040
+ Undo();
2041
+ } else
2042
+ if (source == redoItem)
2043
+ {
2044
+ Redo();
2045
+ } else
2046
+ if (source == duplicateItem)
2047
+ {
2048
+ Object3D keep = Grafreed.clipboard;
18002049 loadClipboard(false);
18012050 paste(false);
1802
- GraphreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
18032052 } else
1804
- if (event.getSource() == cloneItem)
2053
+ if (source == cloneItem)
18052054 {
18062055 CloneSelection(false);
18072056 } else
1808
- if (event.getSource() == cloneSupportItem)
2057
+ if (source == cloneSupportItem)
18092058 {
18102059 CloneSelection(true);
18112060 } else
1812
- if (event.getSource() == copyItem)
2061
+ if (source == copyItem)
18132062 {
18142063 loadClipboard(false);
18152064 } else
1816
- if (event.getSource() == pasteItem)
2065
+ if (source == pasteItem)
18172066 {
18182067 paste(false);
18192068 } else
1820
- if (event.getSource() == pasteLinkItem)
2069
+ if (source == pasteIntoItem)
18212070 {
1822
- pasteInto(false);
2071
+ pasteInto(true, false);
18232072 } else
1824
- if (event.getSource() == pasteCloneItem)
2073
+ if (source == pasteLinkItem)
18252074 {
1826
- pasteInto(true);
2075
+ pasteInto(false, false);
18272076 } else
1828
- if (event.getSource() == pasteExpandItem)
2077
+ if (source == pasteCloneItem)
2078
+ {
2079
+ pasteInto(true, true);
2080
+ } else
2081
+ if (source == pasteExpandItem)
18292082 {
18302083 paste(true);
18312084 } else
1832
- if (event.getSource() == synchronizeItem)
2085
+ if (source == synchronizeItem)
18332086 {
18342087 Overwrite(Object3D.TRANSFORM);
18352088 } else
1836
- if (event.getSource() == overwriteNameItem)
2089
+ if (source == overwriteNameItem)
18372090 {
18382091 Overwrite(Object3D.NAME);
18392092 } else
1840
- if (event.getSource() == overwriteUVItem)
2093
+ if (source == overwriteUVItem)
18412094 {
18422095 Overwrite(Object3D.UV);
18432096 } else
1844
- if (event.getSource() == overwriteMatItem)
2097
+ if (source == overwriteMatItem)
18452098 {
2099
+ /* july 2015
18462100 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2101
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482102 else
18492103 {
18502104 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2110,16 @@
18562110 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572111 }
18582112 }
2113
+ */
2114
+
2115
+ Overwrite(dropAttributes);
18592116 }
1860
- if (event.getSource() == overwriteGeoItem)
2117
+ if (source == overwriteGeoItem)
18612118 {
18622119 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2120
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642121 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2122
+// Object3D content = GrafreeD.clipboard.get(0);
18662123 //
18672124 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682125 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2131,7 @@
18742131 // refreshContents();
18752132 // }
18762133 } else
1877
- if (event.getSource() == generateMeshItem)
2134
+ if (source == generateMeshItem)
18782135 {
18792136 //if (group.selection.size() == 1)
18802137 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2142,7 @@
18852142 ResetModel();
18862143 refreshContents();
18872144 } else
1888
- if (event.getSource() == extractGeometriesItem)
2145
+ if (source == extractGeometriesItem)
18892146 {
18902147 boolean one = false;
18912148
....@@ -1912,7 +2169,7 @@
19122169 ResetModel();
19132170 refreshContents();
19142171 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2172
+ if (source == cloneGeometriesItem)
19162173 {
19172174 boolean one = false;
19182175
....@@ -1938,32 +2195,37 @@
19382195 ResetModel();
19392196 refreshContents();
19402197 } else
1941
- if (event.getSource() == shareGeometriesItem)
2198
+ if (source == shareGeometriesItem)
19422199 {
19432200 boolean one = false;
19442201
19452202 if (group.selection.size() == 1)
19462203 one = true;
19472204
2205
+ Object3D merge = null;
2206
+
19482207 Object3D content = new cGroup();
19492208
19502209 for (int i=0; i<group.selection.size(); i++)
19512210 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2211
+ merge = new Merge(group.selection.get(i));
19532212
19542213 if (one)
1955
- makeSomething(sel, false);
2214
+ makeSomething(merge, false);
19562215 else
1957
- content.addChild(sel);
2216
+ content.addChild(merge);
19582217 }
19592218
19602219 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2220
+ makeSomething(content, true);
2221
+ else
2222
+ {
2223
+ ResetModel();
2224
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2225
+ refreshContents();
2226
+ }
19652227 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2228
+ if (source == mergeGeometriesItem)
19672229 {
19682230 boolean one = false;
19692231
....@@ -1993,11 +2255,11 @@
19932255 ResetModel();
19942256 refreshContents();
19952257 } else
1996
- if (event.getSource() == linkverticesItem)
2258
+ if (source == linkverticesItem)
19972259 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2260
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992261 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2262
+// Object3D content = GrafreeD.clipboard.get(0);
20012263 //
20022264 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032265 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2268,48 @@
20062268 // group.selection.get(0).setMasterThis(content); // should be identity
20072269 // refreshContents();
20082270 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102272 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
20122274
20132275 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142276 content = ((cGroup)content).get(0);
20152277
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2278
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172279 for (int i=0; i<group.selection.size(); i++)
20182280 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
20212283 group.selection.get(i).linkVerticesThis(content);
20222284 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
20242286 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2287
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262288 refreshContents();
20272289 }
20282290 } else
2029
- if (event.getSource() == resetsupportItem)
2291
+ if (source == resetsupportItem)
20302292 {
20312293 for (int i=0; i<group.selection.size(); i++)
20322294 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
20352297 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
20372299 }
20382300
20392301 refreshContents();
20402302 } else
2041
- if (event.getSource() == resetreferencesItem)
2303
+ if (source == relinkverticesItem)
2304
+ {
2305
+ boolean random = CameraPane.SWITCH;
2306
+ CameraPane.SWITCH = false; // parse all random nodes
2307
+ group.selection.RelinkToSupport();
2308
+ CameraPane.SWITCH = random;
2309
+
2310
+ refreshContents();
2311
+ } else
2312
+ if (source == resetreferencesItem)
20422313 {
20432314 for (int i=0; i<group.selection.size(); i++)
20442315 {
....@@ -2047,11 +2318,11 @@
20472318
20482319 refreshContents();
20492320 } else
2050
- if (event.getSource() == setMasterItem)
2321
+ if (source == setMasterItem)
20512322 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532324 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
20552326
20562327 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572328 content = ((cGroup)content).get(0);
....@@ -2060,13 +2331,13 @@
20602331 refreshContents();
20612332 }
20622333 } else
2063
- if (event.getSource() == poseMeshItem)
2334
+ if (source == poseMeshItem)
20642335 {
20652336 if (group.selection.size() == 1)
20662337 {
2067
- if (GraphreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
20682339 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
20702341
20712342 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722343 content = ((cGroup)content).get(0);
....@@ -2079,19 +2350,19 @@
20792350 }
20802351
20812352 } else
2082
- if (event.getSource() == revertMeshItem)
2353
+ if (source == revertMeshItem)
20832354 {
20842355 RevertMeshes();
20852356 } else
2086
- if (event.getSource() == resetMeshItem)
2357
+ if (source == resetAllItem)
20872358 {
20882359 ResetAll();
20892360 } else
2090
- if (event.getSource() == stepAllItem)
2361
+ if (source == stepAllItem)
20912362 {
20922363 StepAll();
20932364 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2365
+ if (source == clearItem) // || event.getSource() == clearButton)
20952366 {
20962367 //int indices[] = jList.getSelectedIndices();
20972368 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2370,46 @@
20992370
21002371 ClearSelection(false);
21012372 } else
2102
- if (event.getSource() == clearAllItem)
2373
+ if (source == clearAllItem)
21032374 {
21042375 ClearSelection(true);
21052376 } else
2106
- if (event.getSource() == grabItem)
2377
+ if (source == grabItem)
21072378 {
21082379 group(new cGroup(), true);
21092380 } else
2110
- if (event.getSource() == frontItem)
2381
+ if (source == hideItem)
2382
+ {
2383
+ group(new HiddenObject());
2384
+ } else
2385
+ if (source == frontItem)
21112386 {
21122387 front();
21132388 } else
2114
- if (event.getSource() == backItem)
2389
+ if (source == backItem)
21152390 {
21162391 back();
21172392 } else
2118
- if (event.getSource() == cameraItem)
2393
+ if (source == cameraItem)
21192394 {
21202395 makeSomething(new Camera());
21212396 } else
2122
- if (event.getSource() == compositeItem)
2397
+ if (source == compositeItem)
21232398 {
21242399 group(new Composite());
21252400 } else
2126
- if (event.getSource() == randomItem)
2401
+ if (source == randomItem)
21272402 {
21282403 RandomNode random = new RandomNode();
21292404 group(random);
21302405 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
21322407 } else
2133
- if (event.getSource() == physicsItem)
2408
+ if (source == physicsItem)
21342409 {
21352410 group(new PhysicsNode());
21362411 } else
2137
- if (event.getSource() == frameselectorItem)
2412
+ if (source == frameselectorItem)
21382413 {
21392414 for (int i=0; i<group.selection.size(); i++)
21402415 {
....@@ -2146,7 +2421,7 @@
21462421 ResetModel();
21472422 refreshContents();
21482423 } else
2149
- if (event.getSource() == switchGeoItem)
2424
+ if (source == switchGeoItem)
21502425 {
21512426 for (int i=0; i<group.selection.size(); i++)
21522427 {
....@@ -2158,7 +2433,7 @@
21582433 ResetModel();
21592434 refreshContents();
21602435 } else
2161
- if (event.getSource() == switchTransfoItem)
2436
+ if (source == switchTransfoItem)
21622437 {
21632438 for (int i=0; i<group.selection.size(); i++)
21642439 {
....@@ -2170,7 +2445,7 @@
21702445 ResetModel();
21712446 refreshContents();
21722447 } else
2173
- if (event.getSource() == morphItem)
2448
+ if (source == morphItem)
21742449 {
21752450 for (int i=0; i<group.selection.size(); i++)
21762451 {
....@@ -2182,7 +2457,7 @@
21822457 ResetModel();
21832458 refreshContents();
21842459 } else
2185
- if (event.getSource() == scriptNodeItem)
2460
+ if (source == scriptNodeItem)
21862461 {
21872462 boolean atleastone = false;
21882463
....@@ -2221,191 +2496,223 @@
22212496 }
22222497 }
22232498 } else
2224
- if (event.getSource() == linkerItem)
2499
+ if (source == linkerItem)
22252500 {
22262501 group(new cLinker());
22272502 } else
2228
- if (event.getSource() == textureItem)
2503
+ if (source == textureItem)
22292504 {
22302505 group(new TextureNode());
22312506 } else
2232
- if (event.getSource() == shadowXItem)
2507
+ if (source == billboardItem)
2508
+ {
2509
+ group(new BillboardNode());
2510
+ } else
2511
+ if (source == shadowXItem)
22332512 {
22342513 CastShadow(0);
22352514 } else
2236
- if (event.getSource() == shadowYItem)
2515
+ if (source == shadowYItem)
22372516 {
22382517 CastShadow(1);
22392518 } else
2240
- if (event.getSource() == shadowZItem)
2519
+ if (source == shadowZItem)
22412520 {
22422521 CastShadow(2);
22432522 } else
2244
- if (event.getSource() == ungroupItem)
2523
+ if (source == ungroupItem)
22452524 {
2246
- ungroup();
2525
+ //ungroup();
2526
+ for (int i=0; i<group.selection.size(); i++)
2527
+ {
2528
+ Ungroup(group.selection.get(i));
2529
+ }
2530
+
2531
+ ClearSelection(false);
2532
+
2533
+ refreshContents();
22472534 } else
2248
- if (event.getSource() == genUVItem)
2535
+ if (source == genUVItem)
22492536 {
22502537 GenUV();
22512538 } else
2252
- if (event.getSource() == genNormalsCADItem)
2539
+ if (source == genNormalsCADItem)
22532540 {
22542541 GenNormals(true);
22552542 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2543
+ if (source == genNormalsMESHItem)
2544
+ {
2545
+ GenNormals(true); // TODO
2546
+ } else
2547
+ if (source == genNormalsORGANItem)
22572548 {
22582549 GenNormals(false);
22592550 } else
2260
- if (event.getSource() == stripifyItem)
2551
+ if (source == genNormalsMINEItem)
2552
+ {
2553
+ GenNormalsMINE();
2554
+ } else
2555
+ if (source == stripifyItem)
22612556 {
22622557 Stripify();
22632558 } else
2264
- if (event.getSource() == unstripifyItem)
2559
+ if (source == unstripifyItem)
22652560 {
22662561 Unstripify();
22672562 } else
2268
- if (event.getSource() == trimItem)
2563
+ if (source == trimItem)
22692564 {
22702565 Trim();
22712566 } else
2272
- if (event.getSource() == untrimItem)
2567
+ if (source == untrimItem)
22732568 {
22742569 Untrim();
22752570 } else
2276
- if (event.getSource() == clearColorsItem)
2571
+ if (source == clearColorsItem)
22772572 {
22782573 ClearColors();
22792574 } else
2280
- if (event.getSource() == clearMaterialsItem)
2575
+ if (source == clearMaterialsItem)
22812576 {
22822577 ClearMaterials();
22832578 } else
2284
- if (event.getSource() == liveleavesItem)
2579
+ if (source == liveleavesItem)
22852580 {
22862581 LiveLeaves(true);
22872582 } else
2288
- if (event.getSource() == unliveleavesItem)
2583
+ if (source == unliveleavesItem)
22892584 {
22902585 LiveLeaves(false);
22912586 } else
2292
- if (event.getSource() == supportleavesItem)
2587
+ if (source == supportleavesItem)
22932588 {
22942589 SupportLeaves(true);
22952590 } else
2296
- if (event.getSource() == unsupportleavesItem)
2591
+ if (source == unsupportleavesItem)
22972592 {
22982593 SupportLeaves(false);
22992594 } else
2300
- if (event.getSource() == hideleavesItem)
2595
+ if (source == hideleavesItem)
23012596 {
23022597 HideLeaves(true);
23032598 } else
2304
- if (event.getSource() == showleavesItem)
2599
+ if (source == showleavesItem)
23052600 {
23062601 HideLeaves(false);
23072602 } else
2308
- if (event.getSource() == markleavesItem)
2603
+ if (source == markleavesItem)
23092604 {
23102605 MarkLeaves(true);
23112606 } else
2312
- if (event.getSource() == unmarkleavesItem)
2607
+ if (source == unmarkleavesItem)
23132608 {
23142609 MarkLeaves(false);
23152610 } else
2316
- if (event.getSource() == flipVItem)
2611
+ if (source == flipVItem)
23172612 {
23182613 FlipV(true);
23192614 } else
2320
- if (event.getSource() == unflipVItem)
2615
+ if (source == unflipVItem)
23212616 {
23222617 FlipV(false);
23232618 } else
2324
- if (event.getSource() == lowTexturesItem)
2619
+ if (source == lowTexturesItem)
23252620 {
23262621 SetTexRes(0);
23272622 } else
2328
- if (event.getSource() == normalTexturesItem)
2623
+ if (source == normalTexturesItem)
23292624 {
23302625 SetTexRes(1);
23312626 } else
2332
- if (event.getSource() == highTexturesItem)
2627
+ if (source == highTexturesItem)
23332628 {
23342629 SetTexRes(2);
23352630 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2631
+ if (source == veryhighTexturesItem)
23372632 {
23382633 SetTexRes(3);
23392634 } else
2340
- if (event.getSource() == maxTexturesItem)
2635
+ if (source == maxTexturesItem)
23412636 {
23422637 SetTexRes(4);
23432638 } else
2344
- if (event.getSource() == panoTexturesItem)
2639
+ if (source == panoTexturesItem)
23452640 {
23462641 SetTexRes(5);
23472642 } else
2348
- if (event.getSource() == reverseNormalsItem)
2643
+ if (source == reverseNormalsItem)
23492644 {
23502645 ReverseNormals();
23512646 } else
2352
- if (event.getSource() == parseverticesItem)
2647
+ if (source == parseverticesItem)
23532648 {
23542649 ParseVertices();
23552650 } else
2356
- if (event.getSource() == alignItem)
2651
+ if (source == textureFieldItem)
2652
+ {
2653
+ TextureVertices();
2654
+ } else
2655
+ if (source == alignItem)
23572656 {
23582657 Align();
23592658 } else
2360
- if (event.getSource() == mirrorItem)
2659
+ if (source == mirrorItem)
23612660 {
23622661 MirrorPoses();
23632662 } else
2364
- if (event.getSource() == reduceMorphItem)
2663
+ if (source == reduceMorphItem)
23652664 {
23662665 MeshReduction(false);
23672666 } else
2368
- if (event.getSource() == reduce34MorphItem)
2667
+ if (source == reduce34MorphItem)
23692668 {
23702669 MeshReduction(true);
23712670 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2671
+ if (source == reverseTrianglesItem)
23732672 {
23742673 ReverseTriangles();
23752674 } else
2376
- if (event.getSource() == reduceMeshItem)
2675
+ if (source == reduceMeshItem)
23772676 {
23782677 ReduceMesh(false);
23792678 } else
2380
- if (event.getSource() == reduce34MeshItem)
2679
+ if (source == reduce34MeshItem)
23812680 {
23822681 ReduceMesh(true);
23832682 } else
2384
- if (event.getSource() == increaseMeshItem)
2683
+ if (source == increaseMeshItem)
23852684 {
23862685 IncreaseMesh();
23872686 } else
2388
- if (event.getSource() == clipMeshItem)
2687
+ if (source == clipMeshItem)
23892688 {
23902689 ClipMesh();
23912690 } else
2392
- if (event.getSource() == smoothMeshItem)
2691
+ if (source == smoothMeshItem)
23932692 {
23942693 SmoothMesh();
23952694 } else
2396
- if (event.getSource() == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
23972696 {
23982697 TransformGeometry();
23992698 } else
2400
- if (event.getSource() == resetTransformItem)
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
2702
+ } else
2703
+ if (source == resetTransformItem)
24012704 {
24022705 ResetTransform();
24032706 } else
2404
- if (event.getSource() == resetCentroidItem)
2707
+ if (source == resetCentroidItem)
24052708 {
2406
- ResetCentroid();
2709
+ ResetCentroid(true);
24072710 } else
2408
- if (event.getSource() == resetParentItem)
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
2714
+ } else
2715
+ if (source == resetParentItem)
24092716 {
24102717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112718 {
....@@ -2415,7 +2722,7 @@
24152722
24162723 refreshContents();
24172724 } else
2418
- if (event.getSource() == repairParentItem)
2725
+ if (source == repairParentItem)
24192726 {
24202727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212728 {
....@@ -2429,7 +2736,21 @@
24292736
24302737 refreshContents();
24312738 } else
2432
- if (event.getSource() == sortbysizeItem)
2739
+ if (source == repairShadowItem)
2740
+ {
2741
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2742
+ {
2743
+ Object3D obj = (Object3D)e.nextElement();
2744
+ obj.RepairShadow();
2745
+// for (int i=0; i<obj.size(); i++)
2746
+// {
2747
+// obj.get(i).parent = obj;
2748
+// }
2749
+ }
2750
+
2751
+ refreshContents();
2752
+ } else
2753
+ if (source == sortbysizeItem)
24332754 {
24342755 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352756 {
....@@ -2441,7 +2762,7 @@
24412762 ResetModel();
24422763 refreshContents();
24432764 } else
2444
- if (event.getSource() == sortbynameItem)
2765
+ if (source == sortbynameItem)
24452766 {
24462767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472768 {
....@@ -2453,7 +2774,7 @@
24532774 ResetModel();
24542775 refreshContents();
24552776 } else
2456
- if (event.getSource() == attachPigmentItem)
2777
+ if (source == attachPigmentItem)
24572778 {
24582779 String texture = GetFile("Attach pigment");
24592780 Object3D obj;
....@@ -2465,7 +2786,7 @@
24652786
24662787 refreshContents();
24672788 } else
2468
- if (event.getSource() == detachPigmentItem)
2789
+ if (source == detachPigmentItem)
24692790 {
24702791 Object3D obj;
24712792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2797,7 @@
24762797
24772798 refreshContents();
24782799 } else
2479
- if (event.getSource() == attachBumpItem)
2800
+ if (source == attachBumpItem)
24802801 {
24812802 String texture = GetFile("Attach bump");
24822803 Object3D obj;
....@@ -2488,7 +2809,7 @@
24882809
24892810 refreshContents();
24902811 } else
2491
- if (event.getSource() == detachBumpItem)
2812
+ if (source == detachBumpItem)
24922813 {
24932814 Object3D obj;
24942815 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2820,7 @@
24992820
25002821 refreshContents();
25012822 } else
2502
- if (event.getSource() == pigmentBumpItem)
2823
+ if (source == pigmentBumpItem)
25032824 {
25042825 Object3D obj;
25052826 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2831,195 @@
25102831
25112832 refreshContents();
25122833 } else
2513
- if (event.getSource() == flashSelectionButton)
2834
+ if (source == flashSelectionButton)
25142835 {
25152836 CameraPane.flash = true;
25162837 refreshContents();
25172838 } else
2518
- if (event.getSource() == oneButton)
2839
+ if (source == oneButton)
25192840 {
25202841 } else
2521
- if (event.getSource() == twoButton)
2842
+ if (source == twoButton)
25222843 {
25232844 radio.layout = twoButton;
25242845 // bug
25252846 //gridPanel.setDividerLocation(1.0);
25262847 //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();
2848
+// bigThree.remove(scenePanel);
2849
+// bigThree.remove(centralPanel);
2850
+// bigThree.remove(XYZPanel);
2851
+// aWindowConstraints.gridx = 0;
2852
+// aWindowConstraints.gridy = 0;
2853
+// aWindowConstraints.gridwidth = 1;
2854
+// // aConstraints.gridheight = 3;
2855
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2856
+// aWindowConstraints.weightx = 0;
2857
+// aWindowConstraints.weighty = 1;
2858
+// //bigThree.add(jtp, aWindowConstraints);
2859
+// aWindowConstraints.weightx = 1;
2860
+// aWindowConstraints.gridwidth = 3;
2861
+// // aConstraints.gridheight = 3;
2862
+// aWindowConstraints.gridx = 1;
2863
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2864
+// bigThree.add(centralPanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.gridx = 4;
2867
+// aWindowConstraints.gridwidth = 1;
2868
+// // aConstraints.gridheight = 3;
2869
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2870
+// //bigThree.add(XYZPanel, aWindowConstraints);
2871
+// scenePanel.setVisible(false);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(centralPanel);
2876
+ bigThree.FlushUI();
25512877 } else
2552
- if (event.getSource() == threeButton)
2878
+ if (source == threeButton)
25532879 {
25542880 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();
2881
+
2882
+// bigThree.remove(scenePanel);
2883
+// bigThree.remove(centralPanel);
2884
+// bigThree.remove(XYZPanel);
2885
+// aWindowConstraints.gridx = 0;
2886
+// aWindowConstraints.gridy = 0;
2887
+// aWindowConstraints.gridwidth = 1;
2888
+// // aConstraints.gridheight = 3;
2889
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.weighty = 1;
2892
+// //bigThree.add(jtp, aWindowConstraints);
2893
+// aWindowConstraints.weightx = 1;
2894
+// aWindowConstraints.gridwidth = 3;
2895
+// // aConstraints.gridheight = 3;
2896
+// aWindowConstraints.gridx = 1;
2897
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2898
+// bigThree.add(centralPanel, aWindowConstraints);
2899
+// aWindowConstraints.weightx = 0;
2900
+// aWindowConstraints.gridx = 4;
2901
+// aWindowConstraints.gridwidth = 1;
2902
+// // aConstraints.gridheight = 3;
2903
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2904
+// bigThree.add(XYZPanel, aWindowConstraints);
2905
+// bigThree.validate();
2906
+// scenePanel.setVisible(false);
2907
+// centralPanel.setVisible(true);
2908
+// XYZPanel.setVisible(true);
2909
+ bigThree.ClearUI();
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.add(XYZPanel);
2912
+ bigThree.FlushUI();
25792913 } else
2580
- if (event.getSource() == fourButton)
2914
+ if (source == fourButton)
25812915 {
25822916 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();
2917
+
2918
+// bigThree.remove(scenePanel);
2919
+// bigThree.remove(centralPanel);
2920
+// bigThree.remove(XYZPanel);
2921
+// aWindowConstraints.gridx = 0;
2922
+// aWindowConstraints.gridy = 0;
2923
+// aWindowConstraints.gridwidth = 1;
2924
+// // aWindowConstraints.gridheight = 3;
2925
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.weighty = 1;
2928
+// bigThree.add(scenePanel, aWindowConstraints);
2929
+// aWindowConstraints.weightx = 1;
2930
+// aWindowConstraints.gridwidth = 3;
2931
+// // aConstraints.gridheight = 3;
2932
+// aWindowConstraints.gridx = 1;
2933
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2934
+// //bigThree.add(cameraPanel, aWindowConstraints);
2935
+// aWindowConstraints.weightx = 0;
2936
+// aWindowConstraints.gridx = 4;
2937
+// aWindowConstraints.gridwidth = 1;
2938
+// // aWindowConstraints.gridheight = 3;
2939
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2940
+// //bigThree.add(XYZPanel, aWindowConstraints);
2941
+// bigThree.validate();
2942
+// scenePanel.setVisible(true);
2943
+// centralPanel.setVisible(false);
2944
+// XYZPanel.setVisible(false);
2945
+ bigThree.ClearUI();
2946
+ bigThree.add(scenePanel);
2947
+ bigThree.FlushUI();
26072948 } else
2608
- if (event.getSource() == sixButton)
2949
+ if (source == sixButton)
26092950 {
26102951 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();
2952
+
2953
+// bigThree.remove(scenePanel);
2954
+// bigThree.remove(centralPanel);
2955
+// bigThree.remove(XYZPanel);
2956
+// aWindowConstraints.gridx = 0;
2957
+// aWindowConstraints.gridy = 0;
2958
+// aWindowConstraints.gridwidth = 1;
2959
+// // aConstraints.gridheight = 3;
2960
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2961
+// aWindowConstraints.weightx = 0;
2962
+// aWindowConstraints.weighty = 1;
2963
+// bigThree.add(scenePanel, aWindowConstraints);
2964
+// aWindowConstraints.weightx = 1;
2965
+// aWindowConstraints.gridwidth = 3;
2966
+// // aWindowConstraints.gridheight = 3;
2967
+// aWindowConstraints.gridx = 1;
2968
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2969
+// bigThree.add(centralPanel, aWindowConstraints);
2970
+// aWindowConstraints.weightx = 0;
2971
+// aWindowConstraints.gridx = 4;
2972
+// aWindowConstraints.gridwidth = 1;
2973
+// // aWindowConstraints.gridheight = 3;
2974
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2975
+// //bigThree.add(XYZPanel, aConstraints);
2976
+// bigThree.validate();
2977
+// scenePanel.setVisible(true);
2978
+// centralPanel.setVisible(true);
2979
+// XYZPanel.setVisible(false);
2980
+ bigThree.ClearUI();
2981
+ bigThree.add(scenePanel);
2982
+ bigThree.add(centralPanel);
2983
+ bigThree.FlushUI();
26352984 } else
2636
- if (event.getSource() == sevenButton)
2985
+ if (source == sevenButton)
26372986 {
26382987 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();
2988
+
2989
+// bigThree.remove(scenePanel);
2990
+// bigThree.remove(centralPanel);
2991
+// bigThree.remove(XYZPanel);
2992
+// aWindowConstraints.gridx = 0;
2993
+// aWindowConstraints.gridy = 0;
2994
+// aWindowConstraints.gridwidth = 1;
2995
+// // aWindowConstraints.gridheight = 3;
2996
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2997
+// aWindowConstraints.weightx = 0;
2998
+// aWindowConstraints.weighty = 1;
2999
+// bigThree.add(scenePanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 1;
3001
+// aWindowConstraints.gridwidth = 3;
3002
+// // aWindowConstraints.gridheight = 3;
3003
+// aWindowConstraints.gridx = 1;
3004
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3005
+// bigThree.add(centralPanel, aWindowConstraints);
3006
+// aWindowConstraints.weightx = 0;
3007
+// aWindowConstraints.gridx = 4;
3008
+// aWindowConstraints.gridwidth = 1;
3009
+// // aConstraints.gridheight = 3;
3010
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3011
+// bigThree.add(XYZPanel, aWindowConstraints);
3012
+// bigThree.validate();
3013
+// scenePanel.setVisible(true);
3014
+// centralPanel.setVisible(true);
3015
+// XYZPanel.setVisible(true);
3016
+ bigThree.ClearUI();
3017
+ bigThree.add(scenePanel);
3018
+ bigThree.add(centralPanel);
3019
+ bigThree.add(XYZPanel);
3020
+ bigThree.FlushUI();
26633021 } else
2664
- if (event.getSource() == rootButton)
3022
+ if (source == rootButton)
26653023 {
26663024 Object3D obj;
26673025 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +3031,7 @@
26733031
26743032 refreshContents(true);
26753033 } else
2676
- if (event.getSource() == closeButton)
3034
+ if (source == closeButton)
26773035 {
26783036 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793037 cRadio ab;
....@@ -2694,11 +3052,11 @@
26943052 }
26953053 refreshContents(true);
26963054 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3055
+ if (source == editItem || source == editButton)
26983056 {
26993057 EditSelection(false);
27003058 } else
2701
- if (event.getSource() == uneditButton)
3059
+ if (source == uneditButton)
27023060 {
27033061 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043062 {
....@@ -2708,14 +3066,14 @@
27083066 child.CloseUI();
27093067 listUI.remove(child);
27103068
2711
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
27123070 }
2713
- objEditor.ctrlPanel.revalidate();
3071
+ objEditor.ctrlPanel.FlushUI();
27143072 //objEditor.jTree.clearSelection();
27153073 //objEditor.ResetSliders();
27163074 refreshContents(true);
27173075 } else
2718
- if (event.getSource() == clearPanelButton)
3076
+ if (source == clearPanelButton)
27193077 {
27203078 assert(copy == group);
27213079 //copy.ClearUI();
....@@ -2726,7 +3084,7 @@
27263084 listUI.clear();
27273085 refreshContents(true);
27283086 } else
2729
- if (event.getSource() == allParamsButton)
3087
+ if (source == allParamsButton)
27303088 {
27313089 assert(copy == group);
27323090
....@@ -2747,19 +3105,19 @@
27473105
27483106 refreshContents(true);
27493107 } else
2750
- if (event.getSource() == unselectButton)
3108
+ if (source == unselectButton)
27513109 {
27523110 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3111
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543112 objEditor.ResetSliders();
27553113 refreshContents(true);
27563114 } else
2757
- if(event.getSource() instanceof cRadio)
3115
+ if(source instanceof cRadio)
27583116 {
27593117 group.parent = keepparent;
27603118 group.attributes = 0;
27613119 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3120
+ /*cRadio*/ radio = (cRadio)source;
27633121 Object3D obj = radio.GetObject();
27643122 System.out.println("Edit " + obj);
27653123 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3137,7 @@
27793137 }
27803138
27813139 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3140
+ //Globals.theRenderer.object = group;
27833141 if(!useclient)
27843142 {
27853143 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3146,16 @@
27883146 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893147 cameraView.targetLookAt.set(radio.camera.lookAt);
27903148 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3149
+ //cameraView.lighttouched = true;
3150
+ Globals.lighttouched = true;
27923151 topView.object = group;
27933152 frontView.object = group;
27943153 sideView.object = group;
27953154 }
3155
+
3156
+// fix "+" issue
27963157 group.editWindow = this;
3158
+
27973159 /*
27983160 currentLayout = radio.layout;
27993161 if (currentLayout == null)
....@@ -2806,7 +3168,20 @@
28063168 //group.attributes = -1;
28073169 ResetModel();
28083170 refreshContents(true);
2809
- }
3171
+ } else if (event.getSource() == editCameraItem)
3172
+ {
3173
+ cameraView.ProtectCamera();
3174
+ cameraView.repaint();
3175
+ return;
3176
+ } else if (event.getSource() == revertCameraItem)
3177
+ {
3178
+ cameraView.RevertCamera();
3179
+ cameraView.repaint();
3180
+ return;
3181
+ // } else if (event.getSource() == textureButton)
3182
+ // {
3183
+ // return; // true;
3184
+ }
28103185 else
28113186 {
28123187 //return super.action(event, arg);
....@@ -2824,7 +3199,7 @@
28243199 if (useclient)
28253200 {
28263201 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3202
+ Globals.lighttouched = true;
28283203 //topView.object = client;
28293204 //frontView.object = client;
28303205 //sideView.object = client;
....@@ -2832,7 +3207,7 @@
28323207 else
28333208 {
28343209 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3210
+ Globals.lighttouched = true;
28363211 //topView.object = group;
28373212 //frontView.object = group;
28383213 //sideView.object = group;
....@@ -2867,6 +3242,28 @@
28673242 refreshContents();
28683243 }
28693244
3245
+ void TransformChildren()
3246
+ {
3247
+ Object3D obj;
3248
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3249
+ {
3250
+ obj = (Object3D)e.nextElement();
3251
+ obj.KeepTextureMatrices();
3252
+ obj.TransformChildren();
3253
+ obj.RestoreTextureMatrices();
3254
+
3255
+// if (obj.parent == null)
3256
+// {
3257
+// System.out.println("NULL PARENT!");
3258
+// new Exception().printStackTrace();
3259
+// }
3260
+// else
3261
+// TouchTransform(obj);
3262
+// //obj.parent.Touch();
3263
+ }
3264
+
3265
+ refreshContents();
3266
+ }
28703267
28713268 void ResetTransform()
28723269 {
....@@ -2979,7 +3376,7 @@
29793376 refreshContents();
29803377 }
29813378
2982
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
29833380 {
29843381 Object3D obj;
29853382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3391,16 @@
29943391 LA.matIdentity(Object3D.mat);
29953392 obj.getBounds(minima, maxima, false);
29963393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993397 obj.TransformMesh(Object3D.mat);
3398
+
30003399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
30033404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3065,9 +3466,9 @@
30653466 obj = (Object3D)e.nextElement();
30663467
30673468 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3469
+ Grafreed.AnalyzeObject(obj);
30693470 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3471
+ Grafreed.AnalyzeObject(obj.bRep);
30713472
30723473 // System.err.println((size/1024) + " KB is the size of " + obj);
30733474 }
....@@ -3109,6 +3510,13 @@
31093510 void GenNormals(boolean crease)
31103511 {
31113512 group.GenNormalsS(crease);
3513
+
3514
+ refreshContents();
3515
+ }
3516
+
3517
+ void GenNormalsMINE()
3518
+ {
3519
+ group.selection.GenNormalsMINE();
31123520
31133521 refreshContents();
31143522 }
....@@ -3157,104 +3565,259 @@
31573565
31583566 //Object3D buffer;
31593567 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
-
3568
+// BoundaryRep temprep;
3569
+// Object3D nodes;
3570
+// Vector<Vertex> vertices;
3571
+//
3572
+// cGroup buffer;
3573
+//
3574
+// public void Vertex(Object3D node, Vertex v)
3575
+// {
3576
+//// vertices.add(v);
3577
+//// nodes.addElement(node);
3578
+////
3579
+//// if (temprep.GetCache(v) != null)
3580
+//// {
3581
+//// temprep.Remove(v);
3582
+//// } else
3583
+//// {
3584
+//// temprep.Remember(v);
3585
+//// }
3586
+//
3587
+// //Object3D node = nodes.get(index);
3588
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3589
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3590
+//
3591
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3592
+//
3593
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3594
+//
3595
+// cGroup g = new cGroup();
3596
+//
3597
+// if (g.toParent == null)
3598
+// {
3599
+// g.toParent = LA.newMatrix();
3600
+// g.fromParent = LA.newMatrix();
3601
+// }
3602
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3603
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3604
+//
3605
+// g.add(GrafreeD.clipboard);
3606
+//
3607
+// buffer.add(g);
3608
+// }
3609
+//
3610
+// public void Face(Object3D node, Face f)
3611
+// {
3612
+//
3613
+// }
3614
+//
3615
+// void ParseVerticesOld() // ??
3616
+// {
3617
+// //if (group.selection.size() != 1)
3618
+// // return;
3619
+//
3620
+// temprep = new BoundaryRep();
3621
+// nodes = new Object3D();
3622
+// vertices = new Vector<Vertex>();
3623
+//
3624
+// boolean epsequal = GrafreeD.epsequal;
3625
+// GrafreeD.epsequal = true;
3626
+//
3627
+// for (int i=0; i<group.selection.size(); i++)
3628
+// {
3629
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3630
+//
3631
+// group.selection.get(i).Parse(
3632
+//this );
3633
+//
3634
+// int repsize = temprep.VertexCount();
3635
+// int tablesize = temprep.vertextable.size();
3636
+// int nodesize = nodes.size();
3637
+//
3638
+// assert(vertices.size() == nodes.size());
3639
+//
3640
+// temprep.vertextable.elements();
3641
+//
3642
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3643
+//
3644
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3645
+// {
3646
+// cGroup g = new cGroup();
3647
+//
3648
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3649
+//
3650
+// Object3D node = nodes.get(index);
3651
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3652
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3653
+//
3654
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3655
+//
3656
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3657
+//
3658
+// if (g.toParent == null)
3659
+// {
3660
+// g.toParent = LA.newMatrix();
3661
+// g.fromParent = LA.newMatrix();
3662
+// }
3663
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3664
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3665
+//
3666
+// g.add(GrafreeD.clipboard);
3667
+//
3668
+// buffer.add(g);
3669
+// }
3670
+//
3671
+// makeSomething(buffer, i==group.selection.size()-1);
3672
+// }
3673
+//
3674
+// GrafreeD.epsequal = epsequal;
3675
+//
3676
+// //buffer = null;
3677
+// temprep = null;
3678
+// nodes = null;
3679
+//
3680
+// refreshContents();
3681
+// }
3682
+
31843683 void ParseVertices()
31853684 {
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;
3685
+ boolean epsequal = Grafreed.epsequal;
3686
+ Grafreed.epsequal = true;
31953687
31963688 for (int i=0; i<group.selection.size(); i++)
31973689 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3690
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993691
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3692
+ group.selection.get(i).Parse(
3693
+
3694
+ new iParse()
3695
+ {
3696
+ public void Vertex(Object3D node, Vertex v)
3697
+ {
3698
+ temp.set(v);
3699
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053700
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();
3701
+ cGroup g = new cGroup();
32113702
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3703
+ if (g.toParent == null)
3704
+ {
3705
+ g.toParent = LA.newMatrix();
3706
+ g.fromParent = LA.newMatrix();
3707
+ }
3708
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3709
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153710
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);
3711
+ g.add(Grafreed.clipboard);
32203712
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);
3713
+ buffer.add(g);
3714
+ }
32323715
3233
- g.add(GraphreeD.clipboard);
3716
+ public void Face(Object3D node, Face f)
3717
+ {
32343718
3235
- buffer.add(g);
3236
- }
3719
+ }
3720
+ }
3721
+ );
32373722
32383723 makeSomething(buffer, i==group.selection.size()-1);
32393724 }
32403725
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3726
+ Grafreed.epsequal = epsequal;
32463727
32473728 refreshContents();
32483729 }
3249
-
3730
+
3731
+ void TextureVertices()
3732
+ {
3733
+ for (int i=0; i<group.selection.size(); i++)
3734
+ {
3735
+ group.selection.get(i).Parse(
3736
+ new iParse()
3737
+ {
3738
+ public void Vertex(Object3D node, Vertex v)
3739
+ {
3740
+ cTexture tex = node.GetTextures();
3741
+ String pigment = Object3D.GetPigment(tex);
3742
+ //String bump = Object3D.GetBump(tex);
3743
+
3744
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3745
+
3746
+ try
3747
+ {
3748
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3749
+ }
3750
+ catch (Exception e)
3751
+ {
3752
+ System.err.println("FAIL: " + node);
3753
+ }
3754
+
3755
+ double s = v.s;
3756
+
3757
+ if (s == 1)
3758
+ s = 0;
3759
+
3760
+ double t = v.t;
3761
+
3762
+ if (t == 1)
3763
+ t = 0;
3764
+
3765
+ int indexs = (int) (texturedata.getWidth() * s);
3766
+ int indext = (int) (texturedata.getHeight() * t);
3767
+
3768
+ int index = indext * texturedata.getWidth() + indexs;
3769
+
3770
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3771
+
3772
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3773
+
3774
+ float scale = bytebuf.get(index*slide) & 0xFF;
3775
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3776
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3777
+ scale /= 3;
3778
+
3779
+ scale /= 0xFF;
3780
+ // c'est quoi ca? scale /= 4;
3781
+
3782
+ //v.AO = scale;
3783
+
3784
+ v.x += v.norm.x * scale;
3785
+ v.y += v.norm.y * scale;
3786
+ v.z += v.norm.z * scale;
3787
+ }
3788
+
3789
+ public void Face(Object3D node, Face f)
3790
+ {
3791
+ }
3792
+ }
3793
+ );
3794
+ }
3795
+
3796
+ refreshContents();
3797
+ }
3798
+
32503799 void Align()
32513800 {
3801
+ if (group.selection.size() == 0)
3802
+ return;
3803
+
3804
+ cVector bbmin = new cVector();
3805
+ cVector bbmax = new cVector();
3806
+
3807
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3808
+
3809
+ double dx = bbmax.x - bbmin.x;
3810
+ double dy = bbmax.y - bbmin.y;
3811
+ double dz = bbmax.z - bbmin.z;
3812
+
3813
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3814
+
32523815 for (int i=0; i<group.selection.size(); i++)
32533816 {
32543817 Object3D obj = group.selection.get(i);
32553818
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3819
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3820
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583821 }
32593822
32603823 refreshContents();
....@@ -3267,7 +3830,7 @@
32673830 // ref.SaveSupports();
32683831 // Object3D par = ref.parent;
32693832 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3833
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713834 // ref.parent = par;
32723835 // ref.RestoreSupports();
32733836
....@@ -3275,11 +3838,11 @@
32753838
32763839 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773840
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3841
+ boolean random = CameraPane.SWITCH;
3842
+ CameraPane.SWITCH = false; // parse all random nodes
32803843 lowres.linkVerticesThis(null);
32813844 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3845
+ CameraPane.SWITCH = random;
32833846
32843847 System.err.flush();
32853848
....@@ -3297,7 +3860,7 @@
32973860 // lowres.SaveSupports();
32983861 // par = lowres.parent;
32993862 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3863
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013864 Object3D newlow = CloneObject(lowres, false);
33023865 newlow.name = sn.switchobject.get(i).name;
33033866 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3882,7 @@
33193882 return;
33203883
33213884 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3885
+ Object3D ref = Grafreed.clipboard.get(0);
33233886
33243887 Object3D newgroup = new Object3D("Po:" + poses.name);
33253888
....@@ -3488,7 +4051,7 @@
34884051 group.selection.RelinkToSupport(); // july 2014
34894052 System.out.println("DONE.");
34904053 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4054
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924055 }
34934056
34944057 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4076,20 @@
35134076
35144077 void ClipMesh()
35154078 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4079
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174080 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4081
+ Object3D content = Grafreed.clipboard.get(0);
35194082
35204083 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214084 content = ((cGroup)content).get(0);
35224085
35234086 // for (int i=0; i<group.selection.size(); i++)
35244087 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4088
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264089 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4090
+ group.selection.ClipMesh(Grafreed.clipboard);
35284091 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4092
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304093 System.out.println("DONE.");
35314094 refreshContents();
35324095 }
....@@ -3659,7 +4222,7 @@
36594222 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604223
36614224 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4225
+ if(elem != group || !newWindow)
36634226 {
36644227 // if (!(elem instanceof Composite))
36654228 // newWindow = false;
....@@ -3764,25 +4327,28 @@
37644327 System.err.println("info : " + child.GetPath());
37654328 }
37664329 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4330
+// else
4331
+// {
4332
+// objEditor.SetMaterial(group); // .GetMaterial());
4333
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4334
+// System.err.println("info : " + group.GetPath());
4335
+// }
37734336
37744337 objEditor.SetText(); // jan 2014
37754338
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4339
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774340 CameraPane.flash = true;
37784341
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4342
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804343 // a camera
37814344 {
3782
- CameraPane.camerachangeframe = 0; // don't refuse it
3783
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3784
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3785
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4345
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4346
+ {
4347
+ CameraPane.camerachangeframe = 0; // don't refuse it
4348
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4349
+ }
4350
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4351
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864352 }
37874353
37884354 refreshContents();
....@@ -3864,16 +4430,18 @@
38644430 {
38654431 if (group.selection.isEmpty())
38664432 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4433
+
4434
+ Grafreed.clipboardIsTempGroup = false;
38684435 Composite tGroup = null;
38694436 if (group.selection.size() > 0) // 1)
38704437 {
38714438 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4439
+ Grafreed.clipboardIsTempGroup = true;
38734440 }
38744441
38754442 if (cut)
38764443 {
4444
+ Save();
38774445 //int indices[] = jList.getSelectedIndices();
38784446 //for (int i = indices.length - 1; i >= 0; i--)
38794447 //jList.remove(indices[i]);
....@@ -3909,16 +4477,16 @@
39094477 //System.out.println("cut " + child);
39104478 //System.out.println("parent = " + child.parent);
39114479 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4480
+ if (Grafreed.clipboardIsTempGroup)
39134481 tGroup.add/*Child*/(tmp);
39144482 else
3915
- GraphreeD.clipboard = tmp;
4483
+ Grafreed.clipboard = tmp;
39164484 }
39174485 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4486
+ if (Grafreed.clipboardIsTempGroup)
39194487 tGroup.add/*Child*/(child);
39204488 else
3921
- GraphreeD.clipboard = child;
4489
+ Grafreed.clipboard = child;
39224490 }
39234491
39244492 //ResetModel();
....@@ -3950,21 +4518,23 @@
39504518 //System.out.println("cut " + elem);
39514519 //System.out.println("parent = " + elem.parent);
39524520 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4521
+ if (Grafreed.clipboardIsTempGroup)
39544522 tGroup.add/*Child*/(tmp);
39554523 else
3956
- GraphreeD.clipboard = tmp;
4524
+ Grafreed.clipboard = tmp;
39574525 }
39584526 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4527
+ if (Grafreed.clipboardIsTempGroup)
39604528 tGroup.add/*Child*/(child);
39614529 else
3962
- GraphreeD.clipboard = child;
4530
+ Grafreed.clipboard = child;
39634531 }
39644532
39654533 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4534
+
4535
+ if (Grafreed.clipboardIsTempGroup)
4536
+ Grafreed.clipboard = tGroup;
4537
+
39684538 if (cut)
39694539 {
39704540 ResetModel();
....@@ -3974,11 +4544,11 @@
39744544
39754545 void paste(boolean expand)
39764546 {
3977
- // if (GraphreeD.clipboard == null)
4547
+ // if (GrafreeD.clipboard == null)
39784548 // return;
39794549 boolean first = true;
39804550
3981
- if (GraphreeD.clipboardIsTempGroup)
4551
+ if (Grafreed.clipboardIsTempGroup)
39824552 {
39834553 Composite temp;
39844554
....@@ -3989,7 +4559,7 @@
39894559 temp = (Composite)Applet3D.clipboard.deepCopy();
39904560 */
39914561 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4562
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934563 {
39944564 Object3D child = (Object3D)e.nextElement();
39954565
....@@ -4003,7 +4573,7 @@
40034573 else
40044574 elem = child.deepCopy(); // ?
40054575 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4576
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074577 // elem = elem.get(0);
40084578 makeSomething(elem, true); // ?? first);
40094579 //group.addChild(elem);
....@@ -4023,23 +4593,23 @@
40234593 //Object3D cb = Applet3D.clipboard;
40244594 //temp.addChild(cb);
40254595 //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());
4596
+ assert(Grafreed.clipboard.parent == null);
4597
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4598
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4599
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4600
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314601 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4602
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4603
+ Grafreed.clipboard.get(0).parent = keepparent;
40344604 }
40354605
40364606 ResetModel();
40374607 refreshContents();
40384608 }
40394609
4040
- void pasteInto(boolean copyit)
4610
+ void pasteInto(boolean copyit, boolean clone)
40414611 {
4042
-// if (GraphreeD.clipboard == null)
4612
+// if (GrafreeD.clipboard == null)
40434613 // return;
40444614
40454615 if (group.selection.size() != 1)
....@@ -4066,15 +4636,22 @@
40664636 if (copyit)
40674637 {
40684638 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4639
+ if (clone)
4640
+ {
4641
+ CloneClipboard(false); // sept 2014
4642
+ }
4643
+ else
4644
+ {
4645
+ paste(false);
4646
+ }
40704647 }
40714648 else
40724649 {
40734650 boolean first = true;
40744651
4075
- if (GraphreeD.clipboardIsTempGroup)
4652
+ if (Grafreed.clipboardIsTempGroup)
40764653 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4654
+ Composite temp = (Composite)Grafreed.clipboard;
40784655 Object3D copy;
40794656 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804657 {
....@@ -4084,7 +4661,7 @@
40844661 }
40854662 } else
40864663 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4664
+ linkSomething(Grafreed.clipboard); //.get(0));
40884665 }
40894666 }
40904667 }
....@@ -4276,6 +4853,26 @@
42764853 makeSomething(csg);
42774854 }
42784855
4856
+ void Ungroup(Object3D g)
4857
+ {
4858
+ if (g instanceof HiddenObject)
4859
+ {
4860
+ HiddenObject h = (HiddenObject) g;
4861
+
4862
+ for (int i=0; i<h.ActualSize(); i++)
4863
+ {
4864
+ objEditor.makeSomething(h.get(i), false);
4865
+ }
4866
+ }
4867
+ else
4868
+ {
4869
+ for (int i=0; i<g.Size(); i++)
4870
+ {
4871
+ objEditor.makeSomething(g.get(i), false);
4872
+ }
4873
+ }
4874
+ }
4875
+
42794876 void ungroup()
42804877 {
42814878 /*
....@@ -4469,21 +5066,6 @@
44695066 }
44705067 */
44715068
4472
- void ImportGFD()
4473
- {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4475
- browser.show();
4476
- String filename = browser.getFile();
4477
- if (filename != null && filename.length() > 0)
4478
- {
4479
- String fullname = browser.getDirectory() + filename;
4480
-
4481
- //Object3D readobj =
4482
- objEditor.ReadGFD(fullname, objEditor);
4483
- //makeSomething(readobj);
4484
- }
4485
- }
4486
-
44875069 /*
44885070 public void Callback(Object obj)
44895071 {
....@@ -4507,26 +5089,9 @@
45075089 }
45085090 */
45095091
4510
- void ImportVRMLX3D()
4511
- {
4512
- if (GraphreeD.standAlone)
4513
- {
4514
- /**/
4515
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4516
- browser.show();
4517
- String filename = browser.getFile();
4518
- if (filename != null && filename.length() > 0)
4519
- {
4520
- String fullname = browser.getDirectory() + filename;
4521
- LoadVRMLX3D(fullname);
4522
- }
4523
- /**/
4524
- }
4525
- }
4526
-
45275092 String GetFile(String dialogName)
45285093 {
4529
- if (GraphreeD.standAlone)
5094
+ if (Grafreed.standAlone)
45305095 {
45315096 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325097 browser.show();
....@@ -4590,10 +5155,15 @@
45905155 cButton flashSelectionButton;
45915156 cButton editButton;
45925157 cButton uneditButton;
5158
+ JCheckBox allParamsButton;
45935159 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955160 cButton unselectButton;
45965161
5162
+ cButton saveButton;
5163
+ cButton undoButton;
5164
+ cButton redoButton;
5165
+ cButton oneStepButton;
5166
+
45975167 cButton screenfitButton;
45985168 cButton screenfitpointButton;
45995169 cButton snapobjectButton;
....@@ -4624,6 +5194,8 @@
46245194 private MenuItem lookFromItem;
46255195 private MenuItem switchItem;
46265196 private MenuItem cutItem;
5197
+ private MenuItem undoItem;
5198
+ private MenuItem redoItem;
46275199 private MenuItem duplicateItem;
46285200 private MenuItem cloneItem;
46295201 private MenuItem cloneSupportItem;
....@@ -4635,8 +5207,9 @@
46355207 private MenuItem resetsupportItem;
46365208 private MenuItem resetreferencesItem;
46375209 private MenuItem linkverticesItem;
5210
+ private MenuItem relinkverticesItem;
46385211 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5212
+ private MenuItem resetAllItem;
46405213 private MenuItem stepAllItem;
46415214 private MenuItem revertMeshItem;
46425215 private MenuItem poseMeshItem;
....@@ -4647,14 +5220,17 @@
46475220 private MenuItem mergeGeometriesItem;
46485221 private MenuItem copyItem;
46495222 private MenuItem pasteItem;
5223
+ private MenuItem pasteIntoItem;
46505224 private MenuItem pasteLinkItem;
46515225 private MenuItem pasteCloneItem;
46525226 private MenuItem pasteExpandItem;
46535227 private MenuItem clearItem;
46545228 private MenuItem clearAllItem;
46555229 private MenuItem genUVItem;
5230
+ private MenuItem genNormalsMESHItem;
46565231 private MenuItem genNormalsCADItem;
46575232 private MenuItem genNormalsORGANItem;
5233
+ private MenuItem genNormalsMINEItem;
46585234 private MenuItem stripifyItem;
46595235 private MenuItem unstripifyItem;
46605236 private MenuItem trimItem;
....@@ -4694,8 +5270,11 @@
46945270 private MenuItem panoTexturesItem;
46955271
46965272 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5273
+ private MenuItem resetCentroidXZItem;
46985274 private MenuItem resetTransformItem;
5275
+ private MenuItem transformGeometryItem;
5276
+ private MenuItem transformChildrenItem;
5277
+ private MenuItem hideItem;
46995278 private MenuItem grabItem;
47005279 private MenuItem backItem;
47015280 private MenuItem frontItem;
....@@ -4716,6 +5295,7 @@
47165295
47175296 private MenuItem resetParentItem;
47185297 private MenuItem repairParentItem;
5298
+ private MenuItem repairShadowItem;
47195299 private MenuItem sortbysizeItem;
47205300 private MenuItem sortbynameItem;
47215301
....@@ -4728,16 +5308,19 @@
47285308 private MenuItem particleItem;
47295309 private MenuItem ragdollItem;
47305310 private MenuItem ragdoll2Item;
5311
+ private MenuItem heightFieldItem;
5312
+ private MenuItem textureFieldItem;
47315313 private MenuItem gridItem;
47325314 private MenuItem rectoidItem;
47335315 private MenuItem ellipsoidItem;
47345316 private MenuItem coneItem;
47355317 private MenuItem torusItem;
47365318 private MenuItem superItem;
5319
+ private MenuItem kleinItem;
47375320 private MenuItem blobItem;
47385321 private MenuItem latheItem;
47395322 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5323
+ private MenuItem overlayItem;
47415324 private MenuItem meshItem;
47425325 // private MenuItem meshGroupItem;
47435326 private MenuItem springItem;
....@@ -4746,6 +5329,7 @@
47465329 private MenuItem csgItem;
47475330 private MenuItem templateItem;
47485331 private MenuItem textureItem;
5332
+ private MenuItem billboardItem;
47495333 private MenuItem shadowXItem;
47505334 private MenuItem shadowYItem;
47515335 private MenuItem shadowZItem;
....@@ -4758,11 +5342,6 @@
47585342 private MenuItem doubleItem;
47595343 private MenuItem tripleItem;
47605344
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665345 private MenuItem computeAOItem;
47675346 private MenuItem recompileItem;
47685347 private MenuItem editScriptItem;
....@@ -4772,4 +5351,8 @@
47725351 private MenuItem analyzeItem;
47735352 private MenuItem dumpItem;
47745353 //boolean freezemodel = false;
5354
+
5355
+ Menu cameraMenu;
5356
+ MenuItem editCameraItem;
5357
+ MenuItem revertCameraItem;
47755358 }