Normand Briere
2019-06-11 5e6a6f3319f0c4c687fe71952ac9ecc17792b83a
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,129 @@
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
+ undoItem = menu.add(new MenuItem("Undo"));
158
+ undoItem.addActionListener(this);
159
+ redoItem = menu.add(new MenuItem("Redo"));
160
+ redoItem.addActionListener(this);
161
+ menu.add("-");
162
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
163
+ duplicateItem.addActionListener(this);
164
+ cloneItem = menu.add(new MenuItem("Clone"));
165
+ cloneItem.addActionListener(this);
166
+ if (Globals.ADVANCED)
167
+ {
168
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
169
+ cloneSupportItem.addActionListener(this);
170
+ }
171
+ menu.add("-");
172
+ cutItem = menu.add(new MenuItem("Cut"));
173
+ cutItem.addActionListener(this);
174
+ copyItem = menu.add(new MenuItem("Copy"));
175
+ copyItem.addActionListener(this);
176
+ pasteItem = menu.add(new MenuItem("Paste"));
177
+ pasteItem.addActionListener(this);
178
+ menu.add("-");
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(CameraPane.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,44 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //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);
285
+ }
286
+
287
+ oe.menuBar.add(menu = new Menu("Setting"));
288
+ if (Globals.ADVANCED)
289
+ {
196290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197291 revertMeshItem.addActionListener(this);
198292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199293 resetreferencesItem.addActionListener(this);
200294 menu.add("-");
295
+ }
201296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202297 overwriteGeoItem.addActionListener(this);
203298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,47 +304,68 @@
209304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210305 overwriteUVItem.addActionListener(this);
211306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
212309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213310 generateMeshItem.addActionListener(this);
214311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215312 poseMeshItem.addActionListener(this);
216313 menu.add("-");
314
+ }
217315 resetsupportItem = menu.add(new MenuItem("Reset support"));
218316 resetsupportItem.addActionListener(this);
219317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220318 linkverticesItem.addActionListener(this);
319
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
320
+ relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
221324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222325 setMasterItem.addActionListener(this);
326
+ }
223327
224
- oe.menuBar.add(menu = new Menu("Object"));
328
+ oe.menuBar.add(menu = new Menu("Group"));
225329 grabItem = menu.add(new MenuItem("Grab"));
226330 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229331 backItem = menu.add(new MenuItem("Back"));
230332 backItem.addActionListener(this);
333
+ frontItem = menu.add(new MenuItem("Front"));
334
+ frontItem.addActionListener(this);
231335 compositeItem = menu.add(new MenuItem("Composite"));
232336 compositeItem.addActionListener(this);
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
338
+ hideItem.addActionListener(this);
339
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
340
+ ungroupItem.addActionListener(this);
233341 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
235343 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);
240344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241345 switchGeoItem.addActionListener(this);
242346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243347 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
245349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
246358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247359 scriptNodeItem.addActionListener(this);
248360 cameraItem = menu.add(new MenuItem("Camera"));
249361 cameraItem.addActionListener(this);
250
- menu.add("-");
362
+ }
363
+
364
+ oe.menuBar.add(menu = new Menu("Object"));
251365 textureItem = menu.add(new MenuItem("Texture"));
252366 textureItem.addActionListener(this);
367
+ billboardItem = menu.add(new MenuItem("Billboard"));
368
+ billboardItem.addActionListener(this);
253369 csgItem = menu.add(new MenuItem("CSG"));
254370 csgItem.addActionListener(this);
255371 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -258,23 +374,29 @@
258374 shadowYItem.addActionListener(this);
259375 shadowZItem = menu.add(new MenuItem("Shadow Z"));
260376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
261380 linkerItem = menu.add(new MenuItem("Linker"));
262381 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265382 attributeItem = menu.add(new MenuItem("Attribute"));
266383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
267386 pointflowItem = menu.add(new MenuItem("Point Flow"));
268387 pointflowItem.addActionListener(this);
388
+ }
269389 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273391 resetTransformItem.addActionListener(this);
274392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275393 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
278400
279401 oe.menuBar.add(menu = new Menu("Geometry"));
280402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +405,13 @@
283405 genNormalsORGANItem.addActionListener(this);
284406 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285407 genNormalsCADItem.addActionListener(this);
408
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
409
+ genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
412
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
413
+ genNormalsMINEItem.addActionListener(this);
414
+ }
286415 stripifyItem = menu.add(new MenuItem("Stripify"));
287416 stripifyItem.addActionListener(this);
288417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +421,6 @@
292421 untrimItem = menu.add(new MenuItem("Untrim"));
293422 untrimItem.addActionListener(this);
294423 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297424 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298425 clearColorsItem.addActionListener(this);
299426 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +433,34 @@
306433 reduce34MeshItem.addActionListener(this);
307434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308435 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
444
+
445
+ oe.menuBar.add(menu = new Menu("Attributes"));
446
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
447
+ clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
313452 menu.add("-");
314453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315454 liveleavesItem.addActionListener(this);
316455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
318459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319460 supportleavesItem.addActionListener(this);
320461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321462 unsupportleavesItem.addActionListener(this);
463
+ }
322464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323465 hideleavesItem.addActionListener(this);
324466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -332,27 +474,18 @@
332474 flipVItem.addActionListener(this);
333475 unflipVItem = menu.add(new MenuItem("Unflip V"));
334476 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
477
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336478 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
479
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338480 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
481
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340482 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
483
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342484 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
485
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344486 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
487
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346488 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);
356489
357490 oe.menuBar.add(menu = new Menu("Selection"));
358491 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +503,24 @@
370503 sortbysizeItem.addActionListener(this);
371504 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372505 sortbynameItem.addActionListener(this);
506
+ menu.add("-");
507
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
508
+ shareGeometriesItem.addActionListener(this);
509
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
510
+ mergeGeometriesItem.addActionListener(this);
511
+ if (Globals.ADVANCED)
512
+ {
513
+ // Pretty much the same as duplicate and clone.
514
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
515
+ extractGeometriesItem.addActionListener(this);
516
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
517
+ cloneGeometriesItem.addActionListener(this);
518
+ }
519
+
373520 oe.menuBar.add(menu = new Menu("Insert"));
374521 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
522
+
523
+ oe.menuBar.add(menu = new Menu("Tools"));
376524 buildToolsMenu(menu);
377525 }
378526
....@@ -406,150 +554,98 @@
406554 oe.radioPanel.add(dummyButton);
407555 oe.buttonGroup.add(dummyButton);
408556 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
557
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412558
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
559
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
560
+ liveCB.setToolTipText("Enable animation");
414561 liveCB.addItemListener(this);
415562
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);
563
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564
+ oneStepButton.setToolTipText("Animate one step forward");
565
+ oneStepButton.addActionListener(this);
566
+
567
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
568
+ fastCB.setToolTipText("Fast mode");
434569 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);
570
+
571
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
+ trackCB.setToolTipText("Enable tracking");
476573 trackCB.addItemListener(this);
477574
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
575
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576
+ screenfitButton.setToolTipText("Screen fit");
480577 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
578
+
482579 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483580 // 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;
488581
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);
582
+ if (Globals.ADVANCED)
583
+ {
584
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ snapobjectButton.addActionListener(this);
586
+ snapobjectButton.setToolTipText("Snap Object");
587
+ }
588
+
589
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ flashSelectionButton.setToolTipText("Show selection");
495591 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499592
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
+
595
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ twoButton.setToolTipText("Show center view only");
502597 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
598
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504599 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
600
+ fourButton.setToolTipText("Show left panel only");
601
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ sixButton.setToolTipText("2-column layout left");
506603 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
604
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
+ threeButton.setToolTipText("2-column layout right");
508606 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ sevenButton.setToolTipText("3-column layout");
510609 sevenButton.addActionListener(this);
511610 //
512611
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
612
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
+ rootButton.setToolTipText("Edit selection in new tab");
514614 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
615
+
616
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ closeButton.setToolTipText("Close tab");
517618 closeButton.addActionListener(this);
518619 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519620 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521621
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
622
+ cGridBag commandsPanel = new cGridBag();
623
+
624
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
+ editButton.setToolTipText("Edit selection");
524626 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528627
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
628
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ uneditButton.setToolTipText("Unedit selection");
530630 uneditButton.addActionListener(this);
531631
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);
632
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
+ allParamsButton.setToolTipText("Edit all params");
544634 allParamsButton.addActionListener(this);
545635
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);
636
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ clearPanelButton.setToolTipText("Clear edit panel");
638
+ clearPanelButton.addActionListener(this);
639
+
640
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ unselectButton.setToolTipText("Unselect");
551642 unselectButton.addActionListener(this);
552643
644
+ commandsPanel.preferredHeight = 1;
645
+
646
+ oe.treePanel.add(commandsPanel);
647
+ oe.treePanel.Return();
648
+
553649 // oe.aConstraints.gridx += 1;
554650 // oe.aConstraints.weighty = 0;
555651 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +657,37 @@
561657 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562658 // gcButton.addActionListener(this);
563659
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;
660
+ cGridBag jSPPanel = new cGridBag();
661
+
662
+ JScrollPane jSP;
575663 //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);
664
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577665 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
666
+
667
+ oe.treePanel.add(jSPPanel);
668
+ oe.treePanel.Return();
582669
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);
670
+ cGridBag copyOptionsPanel = new cGridBag();
671
+
672
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
+ colorCB.setToolTipText("Copy color when dropped");
587674 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
675
+
676
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
+ materialCB.setToolTipText("Copy material when dropped");
590678 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
679
+
680
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
+ textureCB.setToolTipText("Copy texture when dropped");
593682 textureCB.addItemListener(this);
594683
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
684
+ copyOptionsPanel.preferredHeight = 1;
685
+ oe.treePanel.add(copyOptionsPanel);
686
+ oe.treePanel.Return();
597687
688
+// mainPanel.setDividerLocation(0.5); //1.0);
689
+// mainPanel.setResizeWeight(0.5);
690
+
598691 //jList.addListSelectionListener(this);
599692 oe.jTree.addTreeSelectionListener(this);
600693 //jTree.setRootVisible(false);
....@@ -616,18 +709,91 @@
616709 radio.layout = sevenButton;
617710 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618711 }
712
+
713
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
714
+ {
715
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
716
+ boxCB.setToolTipText("Display bounding boxes");
717
+ boxCB.addItemListener(this);
718
+
719
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
721
+ zoomBoxCB.addItemListener(this);
722
+
723
+ if (true) // Globals.ADVANCED)
724
+ {
725
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
+ supportCB.setToolTipText("Enable rigging");
727
+ supportCB.addItemListener(this);
728
+
729
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730
+ // localCB.addItemListener(this);
731
+
732
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733
+ crowdCB.setToolTipText("Used for crowds");
734
+ crowdCB.addItemListener(this);
735
+
736
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
737
+ smoothCB.setToolTipText("Snapping delay");
738
+ smoothCB.addItemListener(this);
739
+
740
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
741
+ slowCB.setToolTipText("Smooth interpolation");
742
+ slowCB.addItemListener(this);
743
+
744
+// constraints.gridy += 1;
745
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
746
+// speakerMocapCB.addItemListener(this);
747
+
748
+ if (false)
749
+ {
750
+ // handled in scripts
751
+ //constraints.gridy += 1;
752
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
753
+ speakerCameraCB.addItemListener(this);
754
+
755
+ //constraints.gridy += 1;
756
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
757
+ speakerFocusCB.addItemListener(this);
758
+
759
+ //constraints.gridy += 1;
760
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
761
+ smoothfocusCB.addItemListener(this);
762
+ }
763
+
764
+//constraints.gridx += 1;
765
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
766
+// debugCB.addItemListener(this);
767
+
768
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
769
+ oeilCB.addItemListener(this);
770
+
771
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772
+ lookAtCB.setToolTipText("Look-at target");
773
+ lookAtCB.addItemListener(this);
774
+
775
+ }
776
+
777
+ cGridBag fill = new cGridBag();
778
+
779
+ fill.preferredHeight = 200;
780
+
781
+ panel.add(fill);
782
+
783
+ }
619784
620785 void EditObject(Object3D obj)
621786 {
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();
787
+ cRadio radioButton = new cRadio(obj.name);
788
+ radioButton.SetObject(obj);
789
+ radioButton.layout = sevenButton;
790
+ radioButton.SetCamera(cameraView.renderCamera, false);
791
+ radioButton.addActionListener(this);
792
+ radioPanel.add(radioButton);
793
+ buttonGroup.add(radioButton);
794
+ radioButton.doClick();
630795 }
796
+
631797 void SetupViews(ObjEditor oe)
632798 {
633799 oe.SetupViews();
....@@ -646,6 +812,7 @@
646812 JCheckBox fastCB;
647813 JCheckBox slowCB;
648814 JCheckBox boxCB;
815
+ JCheckBox zoomBoxCB;
649816 JCheckBox trackCB;
650817 JCheckBox smoothfocusCB;
651818 // JCheckBox speakerMocapCB;
....@@ -688,8 +855,7 @@
688855 dropAttributes |= Object3D.TEXTURE;
689856 else
690857 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
858
+ } else if(e.getSource() == liveCB)
693859 {
694860 cameraView.ToggleLive();
695861 }
....@@ -726,6 +892,10 @@
726892 Recompile();
727893 cameraView.repaint();
728894 // refreshContents();
895
+ }
896
+ else if(e.getSource() == zoomBoxCB)
897
+ {
898
+ cameraView.ToggleZoomBoxMode();
729899 }
730900 else if(e.getSource() == smoothfocusCB)
731901 {
....@@ -840,7 +1010,9 @@
8401010 // objEditor.DropFile((java.io.File[]) object, true);
8411011 // return;
8421012 // }
843
- if (string.charAt(0) == '/')
1013
+
1014
+ // File path for Mac and Windows
1015
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441016 {
8451017 // file(s)
8461018 String[] names = string.split("\n");
....@@ -867,7 +1039,7 @@
8671039
8681040 flashIt = false;
8691041 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1042
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711043 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721044
8731045 if (group.selection.size() == 1)
....@@ -894,11 +1066,11 @@
8941066 {
8951067 loadClipboard(true);
8961068 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
1069
+ pasteInto(false, false);
8981070 } else {
8991071 loadClipboard(false);
9001072 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
1073
+ pasteInto(false, false); // true); // ???
9021074 }
9031075 }
9041076 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1174,8 @@
10021174
10031175 void buildCreateMenu(Menu menu)
10041176 {
1177
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1178
+ //heightFieldItem.addActionListener(this);
10051179 gridItem = menu.add(new MenuItem("Grid"));
10061180 gridItem.addActionListener(this);
10071181 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1188,37 @@
10141188 torusItem.addActionListener(this);
10151189 superItem = menu.add(new MenuItem("Superellipsoid"));
10161190 superItem.addActionListener(this);
1191
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1192
+ kleinItem.addActionListener(this);
10171193 particleItem = menu.add(new MenuItem("Particle system"));
10181194 particleItem.addActionListener(this);
1195
+ if (Globals.ADVANCED)
1196
+ {
10191197 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201198 ragdollItem.addActionListener(this);
10211199 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221200 ragdoll2Item.addActionListener(this);
1201
+ }
10231202 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1203
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251204 meshItem.addActionListener(this);
10261205 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271206 // meshGroupItem.addActionListener(this);
1207
+ if (Globals.ADVANCED)
1208
+ {
10281209 springItem = menu.add(new MenuItem("Spring"));
10291210 springItem.addActionListener(this);
10301211 flagItem = menu.add(new MenuItem("Flag"));
10311212 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);
10361213 blobItem = menu.add(new MenuItem("Blob"));
10371214 blobItem.addActionListener(this);
10381215 latheItem = menu.add(new MenuItem("Lathe"));
10391216 latheItem.addActionListener(this);
1217
+ }
1218
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1219
+ bezierItem.addActionListener(this);
1220
+ overlayItem = menu.add(new MenuItem("Overlay"));
1221
+ overlayItem.addActionListener(this);
10401222 lightItem = menu.add(new MenuItem("Light"));
10411223 lightItem.addActionListener(this);
10421224 menu.add("-");
....@@ -1046,41 +1228,39 @@
10461228 loopItem.addActionListener(this);
10471229 doubleItem = menu.add(new MenuItem("Fork"));
10481230 doubleItem.addActionListener(this);
1231
+ if (Globals.ADVANCED)
1232
+ {
10491233 tripleItem = menu.add(new MenuItem("Trident"));
10501234 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);
1235
+ }
10601236 }
10611237
10621238 void buildToolsMenu(Menu menu)
10631239 {
10641240 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651241 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1242
+ animationItem.setState(Globals.ANIMATION);
10671243
10681244 menu.add("-");
10691245 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701246 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1247
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1248
+ textureFieldItem.addActionListener(this);
1249
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721250 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751251 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761252 reduceMorphItem.addActionListener(this);
10771253 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781254 reduce34MorphItem.addActionListener(this);
1079
-
1255
+ menu.add("-");
10801256 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811257 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831258
1259
+ if (Globals.ADVANCED)
1260
+ {
1261
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1262
+ mirrorItem.addActionListener(this);
1263
+ menu.add("-");
10841264 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851265 memoryItem.addActionListener(this);
10861266 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1094,6 +1274,8 @@
10941274 resetParentItem.addActionListener(this);
10951275 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961276 repairParentItem.addActionListener(this);
1277
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1278
+ repairShadowItem.addActionListener(this);
10971279 menu.add(invariantsItem = new MenuItem("Invariants"));
10981280 invariantsItem.addActionListener(this);
10991281 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1283,7 @@
11011283 menu.add("-");
11021284 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031285 editScriptItem.addActionListener(this);
1286
+ }
11041287 }
11051288
11061289 void ScreenFit()
....@@ -1429,9 +1612,9 @@
14291612
14301613 void Overwrite(int mask)
14311614 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1615
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331616 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1617
+ Object3D content = Grafreed.clipboard.get(0);
14351618
14361619 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371620 content = ((cGroup)content).get(0);
....@@ -1454,6 +1637,7 @@
14541637 //
14551638 public void actionPerformed(ActionEvent event) // , Object arg)
14561639 {
1640
+ Object source = event.getSource();
14571641 /*
14581642 if (event.getSource() == nameField)
14591643 {
....@@ -1465,11 +1649,11 @@
14651649 }
14661650 else
14671651 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1652
+ if (source == lookAtItem || source == lookFromItem)
14691653 {
14701654 ScreenFit();
14711655 } else
1472
- if (event.getSource() == switchItem)
1656
+ if (source == switchItem)
14731657 {
14741658 cVector v1 = new cVector();
14751659 cVector v2 = new cVector();
....@@ -1478,11 +1662,11 @@
14781662 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791663 objEditor.cameraView.repaint();
14801664 } else
1481
- if (event.getSource() == rectoidItem)
1665
+ if (source == rectoidItem)
14821666 {
14831667 makeSomething(new Box());
14841668 } else
1485
- if (event.getSource() == particleItem)
1669
+ if (source == particleItem)
14861670 {
14871671 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881672 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1687,9 @@
15031687 applyExample(particleGeom, "SMOKE");
15041688 makeSomething(particleGeom);
15051689 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1690
+ if (source == ragdollItem || source == ragdoll2Item)
15071691 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1692
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091693
15101694 ragdoll.toParent = LA.newMatrix();
15111695 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1705,71 @@
15211705 makeSomething(ragdoll);
15221706 //makeSomething(new VehicleDemo());
15231707 } else
1524
- if (event.getSource() == gridItem)
1708
+ /*
1709
+ */
1710
+ if (source == heightFieldItem)
1711
+ {
1712
+ Object3D obj = new Object3D();
1713
+
1714
+ obj.CreateMaterial();
1715
+ obj.bRep = new BoundaryRep();
1716
+
1717
+ obj.bRep.CreateMesh(new iHeightField()
1718
+ {
1719
+ public double f(double x, double y)
1720
+ {
1721
+ // The Mandelbrot set is represented by coloring
1722
+ // each point (x,y) according to the number of
1723
+ // iterations it takes before the while loop in
1724
+ // this method ends. For points that are actually
1725
+ // in the Mandelbrot set, or very close to it, the
1726
+ // count will reach the maximum value, 80. These
1727
+ // points will be colored purple. All other colors
1728
+ // represent points that are definitely NOT in the set.
1729
+ x -= 600;
1730
+ y -= 500;
1731
+ x /= 200;
1732
+ y /= 200;
1733
+ int count = 0;
1734
+ double zx = x;
1735
+ double zy = y;
1736
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1737
+ double new_zx = zx*zx - zy*zy + x;
1738
+ zy = 2*zx*zy + y;
1739
+ zx = new_zx;
1740
+ count++;
1741
+ }
1742
+ return count; // Math.sqrt(count);
1743
+ }
1744
+ }, 1000,1000);
1745
+
1746
+ makeSomething(obj);
1747
+ } else
1748
+ if (source == gridItem)
15251749 {
15261750 makeSomething(new Grid());
15271751 } else
1528
- if (event.getSource() == ellipsoidItem)
1752
+ if (source == ellipsoidItem)
15291753 {
15301754 makeSomething(new Sphere());
15311755 } else
1532
- if (event.getSource() == coneItem)
1756
+ if (source == coneItem)
15331757 {
15341758 makeSomething(new Cone());
15351759 } else
1536
- if (event.getSource() == torusItem)
1760
+ if (source == torusItem)
15371761 {
15381762 makeSomething(new Torus());
15391763 } else
1540
- if (event.getSource() == superItem)
1764
+ if (source == superItem)
15411765 {
15421766 makeSomething(new Superellipsoid());
15431767 } else
1544
- if (event.getSource() == blobItem)
1768
+ if (source == kleinItem)
1769
+ {
1770
+ makeSomething(new Klein());
1771
+ } else
1772
+ if (source == blobItem)
15451773 {
15461774 Blob blob = new Blob();
15471775 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1777,15 @@
15491777 //blob.retile();
15501778 makeSomething(blob);
15511779 } else
1552
- if (event.getSource() == latheItem)
1780
+ if (source == latheItem)
15531781 {
15541782 makeSomething(new Lathe());
15551783 } else
1556
- if (event.getSource() == bezierItem)
1784
+ if (source == bezierItem)
15571785 {
15581786 makeSomething(new BezierSurface());
15591787 } else
1560
- if (event.getSource() == checkerItem)
1788
+ if (source == overlayItem)
15611789 {
15621790 /*
15631791 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1798,9 @@
15701798 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711799 LA.matInvert(obj.toParent, obj.fromParent);
15721800 */
1573
- makeSomething(new CheckerIG());
1801
+ makeSomething(new Checker());
15741802 } else
1575
- if (event.getSource() == meshItem)
1803
+ if (source == meshItem)
15761804 {
15771805 Object3D itemtomake = new Object3D();
15781806 Object3D child;
....@@ -1593,35 +1821,35 @@
15931821 makeSomething(child);
15941822 }
15951823 } else
1596
- if (event.getSource() == springItem)
1824
+ if (source == springItem)
15971825 {
15981826 cSpring s = new cSpring();
15991827 s.setup();
16001828 makeSomething(s);
16011829 } else
1602
- if (event.getSource() == flagItem)
1830
+ if (source == flagItem)
16031831 {
16041832 cSpring s = new cFlag();
16051833 s.setup();
16061834 makeSomething(s);
16071835 } else
1608
- if (event.getSource() == lightItem)
1836
+ if (source == lightItem)
16091837 {
16101838 makeSomething(new Light());
16111839 } else
1612
- if (event.getSource() == csgItem)
1840
+ if (source == csgItem)
16131841 {
16141842 group(new CSG());
16151843 } else
1616
- if (event.getSource() == templateItem)
1844
+ if (source == templateItem)
16171845 {
16181846 group(new cTemplate());
16191847 } else
1620
- if (event.getSource() == attributeItem)
1848
+ if (source == attributeItem)
16211849 {
16221850 makeSomething(new Attribute());
16231851 } else
1624
- if (event.getSource() == pointflowItem)
1852
+ if (source == pointflowItem)
16251853 {
16261854 makeSomething(new PointFlow());
16271855 } else
....@@ -1633,7 +1861,7 @@
16331861 } else
16341862 */
16351863
1636
- if (event.getSource() == superLoopItem)
1864
+ if (source == superLoopItem)
16371865 {
16381866 Composite g = new cGroup();
16391867 for (int i=0; i<15; i++)
....@@ -1655,7 +1883,7 @@
16551883
16561884 group(g);
16571885 } else
1658
- if (event.getSource() == loopItem)
1886
+ if (source == loopItem)
16591887 {
16601888 Composite csg = new GroupLeaf();
16611889 csg.count = 5;
....@@ -1664,7 +1892,7 @@
16641892 csg.addChild(child);
16651893 child.addChild(csg);
16661894 } else
1667
- if (event.getSource() == doubleItem)
1895
+ if (source == doubleItem)
16681896 {
16691897 Composite csg = new GroupLeaf();
16701898 csg.count = 5;
....@@ -1676,7 +1904,7 @@
16761904 csg.addChild(child);
16771905 child.addChild(csg);
16781906 } else
1679
- if (event.getSource() == tripleItem)
1907
+ if (source == tripleItem)
16801908 {
16811909 Composite csg = new GroupLeaf();
16821910 csg.count = 4;
....@@ -1691,71 +1919,59 @@
16911919 csg.addChild(child);
16921920 child.addChild(csg);
16931921 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
1922
+ if (source == computeAOItem)
16961923 {
1697
- ImportGFD();
1924
+ Globals.drawMode = CameraPane.OCCLUSION;
1925
+ Globals.theRenderer.repaint();
16981926 } 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)
1927
+ if (source == recompileItem)
17171928 {
17181929 Recompile();
17191930 refreshContents();
17201931 } else
1721
- if (event.getSource() == editScriptItem)
1932
+ if (source == editScriptItem)
17221933 {
17231934 OpenDialog();
17241935 refreshContents();
17251936 } else
1726
- if (event.getSource() == invariantsItem)
1937
+ if (source == invariantsItem)
17271938 {
17281939 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1940
+ Grafreed.grafreeD.universe.invariants();
17301941 } else
1731
- if (event.getSource() == memoryItem)
1942
+ if (source == memoryItem)
17321943 {
17331944 //System.out.println("Invariants:");
17341945 PrintMemory();
17351946 } else
1736
- if (event.getSource() == pathItem)
1947
+ if (source == pathItem)
17371948 {
17381949 PrintPath();
17391950 } else
1740
- if (event.getSource() == analyzeItem)
1951
+ if (source == analyzeItem)
17411952 {
17421953 AnalyzeObject();
17431954 } else
1744
- if (event.getSource() == dumpItem)
1955
+ if (source == dumpItem)
17451956 {
17461957 DumpObject();
17471958 } else
1748
- if (event.getSource() == screenfitButton)
1959
+ if (source == oneStepButton)
1960
+ {
1961
+ Globals.ONESTEP = true;
1962
+ cameraView.repaint();
1963
+ } else
1964
+ if (source == screenfitButton)
17491965 {
17501966 //Reload(lastConverter, lastFilename, true);
17511967 ScreenFit();
17521968 } else
1753
- if (event.getSource() == screenfitpointButton)
1969
+ if (source == screenfitpointButton)
17541970 {
17551971 //Reload(lastConverter, lastFilename, true);
17561972 ScreenFitPoint();
17571973 } else
1758
- if (event.getSource() == snapobjectButton)
1974
+ if (source == snapobjectButton)
17591975 {
17601976 //Reload(lastConverter, lastFilename, true);
17611977 SnapObject();
....@@ -1766,13 +1982,13 @@
17661982 // Recompile();
17671983 // refreshContents();
17681984 // } else
1769
- if (event.getSource() == gcButton)
1985
+ if (source == gcButton)
17701986 {
17711987 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17721988 System.gc();
17731989 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17741990 } else
1775
- if (event.getSource() == editLeafItem)
1991
+ if (source == editLeafItem)
17761992 {
17771993 Object3D obj;
17781994 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2002,78 @@
17862002 }
17872003 refreshContents(true);
17882004 } else
1789
- if (event.getSource() == openWindowItem)
2005
+ if (source == openWindowItem)
17902006 {
17912007 EditSelection(true);
17922008 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2009
+ if (source == cutItem || source == clearButton)
17942010 {
17952011 loadClipboard(true);
17962012 } else
1797
- if (event.getSource() == duplicateItem)
2013
+ if (source == undoItem)
17982014 {
1799
- Object3D keep = GraphreeD.clipboard;
2015
+ Undo();
2016
+ } else
2017
+ if (source == redoItem)
2018
+ {
2019
+ Redo();
2020
+ } else
2021
+ if (source == duplicateItem)
2022
+ {
2023
+ Object3D keep = Grafreed.clipboard;
18002024 loadClipboard(false);
18012025 paste(false);
1802
- GraphreeD.clipboard = keep;
2026
+ Grafreed.clipboard = keep;
18032027 } else
1804
- if (event.getSource() == cloneItem)
2028
+ if (source == cloneItem)
18052029 {
18062030 CloneSelection(false);
18072031 } else
1808
- if (event.getSource() == cloneSupportItem)
2032
+ if (source == cloneSupportItem)
18092033 {
18102034 CloneSelection(true);
18112035 } else
1812
- if (event.getSource() == copyItem)
2036
+ if (source == copyItem)
18132037 {
18142038 loadClipboard(false);
18152039 } else
1816
- if (event.getSource() == pasteItem)
2040
+ if (source == pasteItem)
18172041 {
18182042 paste(false);
18192043 } else
1820
- if (event.getSource() == pasteLinkItem)
2044
+ if (source == pasteIntoItem)
18212045 {
1822
- pasteInto(false);
2046
+ pasteInto(true, false);
18232047 } else
1824
- if (event.getSource() == pasteCloneItem)
2048
+ if (source == pasteLinkItem)
18252049 {
1826
- pasteInto(true);
2050
+ pasteInto(false, false);
18272051 } else
1828
- if (event.getSource() == pasteExpandItem)
2052
+ if (source == pasteCloneItem)
2053
+ {
2054
+ pasteInto(true, true);
2055
+ } else
2056
+ if (source == pasteExpandItem)
18292057 {
18302058 paste(true);
18312059 } else
1832
- if (event.getSource() == synchronizeItem)
2060
+ if (source == synchronizeItem)
18332061 {
18342062 Overwrite(Object3D.TRANSFORM);
18352063 } else
1836
- if (event.getSource() == overwriteNameItem)
2064
+ if (source == overwriteNameItem)
18372065 {
18382066 Overwrite(Object3D.NAME);
18392067 } else
1840
- if (event.getSource() == overwriteUVItem)
2068
+ if (source == overwriteUVItem)
18412069 {
18422070 Overwrite(Object3D.UV);
18432071 } else
1844
- if (event.getSource() == overwriteMatItem)
2072
+ if (source == overwriteMatItem)
18452073 {
2074
+ /* july 2015
18462075 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2076
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482077 else
18492078 {
18502079 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2085,16 @@
18562085 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572086 }
18582087 }
2088
+ */
2089
+
2090
+ Overwrite(dropAttributes);
18592091 }
1860
- if (event.getSource() == overwriteGeoItem)
2092
+ if (source == overwriteGeoItem)
18612093 {
18622094 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2095
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642096 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2097
+// Object3D content = GrafreeD.clipboard.get(0);
18662098 //
18672099 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682100 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2106,7 @@
18742106 // refreshContents();
18752107 // }
18762108 } else
1877
- if (event.getSource() == generateMeshItem)
2109
+ if (source == generateMeshItem)
18782110 {
18792111 //if (group.selection.size() == 1)
18802112 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2117,7 @@
18852117 ResetModel();
18862118 refreshContents();
18872119 } else
1888
- if (event.getSource() == extractGeometriesItem)
2120
+ if (source == extractGeometriesItem)
18892121 {
18902122 boolean one = false;
18912123
....@@ -1912,7 +2144,7 @@
19122144 ResetModel();
19132145 refreshContents();
19142146 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2147
+ if (source == cloneGeometriesItem)
19162148 {
19172149 boolean one = false;
19182150
....@@ -1938,32 +2170,37 @@
19382170 ResetModel();
19392171 refreshContents();
19402172 } else
1941
- if (event.getSource() == shareGeometriesItem)
2173
+ if (source == shareGeometriesItem)
19422174 {
19432175 boolean one = false;
19442176
19452177 if (group.selection.size() == 1)
19462178 one = true;
19472179
2180
+ Object3D merge = null;
2181
+
19482182 Object3D content = new cGroup();
19492183
19502184 for (int i=0; i<group.selection.size(); i++)
19512185 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2186
+ merge = new Merge(group.selection.get(i));
19532187
19542188 if (one)
1955
- makeSomething(sel, false);
2189
+ makeSomething(merge, false);
19562190 else
1957
- content.addChild(sel);
2191
+ content.addChild(merge);
19582192 }
19592193
19602194 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2195
+ makeSomething(content, true);
2196
+ else
2197
+ {
2198
+ ResetModel();
2199
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2200
+ refreshContents();
2201
+ }
19652202 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2203
+ if (source == mergeGeometriesItem)
19672204 {
19682205 boolean one = false;
19692206
....@@ -1993,11 +2230,11 @@
19932230 ResetModel();
19942231 refreshContents();
19952232 } else
1996
- if (event.getSource() == linkverticesItem)
2233
+ if (source == linkverticesItem)
19972234 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2235
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992236 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2237
+// Object3D content = GrafreeD.clipboard.get(0);
20012238 //
20022239 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032240 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2243,48 @@
20062243 // group.selection.get(0).setMasterThis(content); // should be identity
20072244 // refreshContents();
20082245 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2246
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102247 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2248
+ Object3D content = Grafreed.clipboard.get(0);
20122249
20132250 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142251 content = ((cGroup)content).get(0);
20152252
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2253
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172254 for (int i=0; i<group.selection.size(); i++)
20182255 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2256
+ boolean random = CameraPane.SWITCH;
2257
+ CameraPane.SWITCH = false; // parse all random nodes
20212258 group.selection.get(i).linkVerticesThis(content);
20222259 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
20242261 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2262
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262263 refreshContents();
20272264 }
20282265 } else
2029
- if (event.getSource() == resetsupportItem)
2266
+ if (source == resetsupportItem)
20302267 {
20312268 for (int i=0; i<group.selection.size(); i++)
20322269 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2270
+ boolean random = CameraPane.SWITCH;
2271
+ CameraPane.SWITCH = false; // parse all random nodes
20352272 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2273
+ CameraPane.SWITCH = random;
20372274 }
20382275
20392276 refreshContents();
20402277 } else
2041
- if (event.getSource() == resetreferencesItem)
2278
+ if (source == relinkverticesItem)
2279
+ {
2280
+ boolean random = CameraPane.SWITCH;
2281
+ CameraPane.SWITCH = false; // parse all random nodes
2282
+ group.selection.RelinkToSupport();
2283
+ CameraPane.SWITCH = random;
2284
+
2285
+ refreshContents();
2286
+ } else
2287
+ if (source == resetreferencesItem)
20422288 {
20432289 for (int i=0; i<group.selection.size(); i++)
20442290 {
....@@ -2047,11 +2293,11 @@
20472293
20482294 refreshContents();
20492295 } else
2050
- if (event.getSource() == setMasterItem)
2296
+ if (source == setMasterItem)
20512297 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2298
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532299 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2300
+ Object3D content = Grafreed.clipboard.get(0);
20552301
20562302 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572303 content = ((cGroup)content).get(0);
....@@ -2060,13 +2306,13 @@
20602306 refreshContents();
20612307 }
20622308 } else
2063
- if (event.getSource() == poseMeshItem)
2309
+ if (source == poseMeshItem)
20642310 {
20652311 if (group.selection.size() == 1)
20662312 {
2067
- if (GraphreeD.clipboard.size() == 1)
2313
+ if (Grafreed.clipboard.size() == 1)
20682314 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2315
+ Object3D content = Grafreed.clipboard.get(0);
20702316
20712317 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722318 content = ((cGroup)content).get(0);
....@@ -2079,19 +2325,19 @@
20792325 }
20802326
20812327 } else
2082
- if (event.getSource() == revertMeshItem)
2328
+ if (source == revertMeshItem)
20832329 {
20842330 RevertMeshes();
20852331 } else
2086
- if (event.getSource() == resetMeshItem)
2332
+ if (source == resetAllItem)
20872333 {
20882334 ResetAll();
20892335 } else
2090
- if (event.getSource() == stepAllItem)
2336
+ if (source == stepAllItem)
20912337 {
20922338 StepAll();
20932339 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2340
+ if (source == clearItem) // || event.getSource() == clearButton)
20952341 {
20962342 //int indices[] = jList.getSelectedIndices();
20972343 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2345,46 @@
20992345
21002346 ClearSelection(false);
21012347 } else
2102
- if (event.getSource() == clearAllItem)
2348
+ if (source == clearAllItem)
21032349 {
21042350 ClearSelection(true);
21052351 } else
2106
- if (event.getSource() == grabItem)
2352
+ if (source == grabItem)
21072353 {
21082354 group(new cGroup(), true);
21092355 } else
2110
- if (event.getSource() == frontItem)
2356
+ if (source == hideItem)
2357
+ {
2358
+ group(new HiddenObject());
2359
+ } else
2360
+ if (source == frontItem)
21112361 {
21122362 front();
21132363 } else
2114
- if (event.getSource() == backItem)
2364
+ if (source == backItem)
21152365 {
21162366 back();
21172367 } else
2118
- if (event.getSource() == cameraItem)
2368
+ if (source == cameraItem)
21192369 {
21202370 makeSomething(new Camera());
21212371 } else
2122
- if (event.getSource() == compositeItem)
2372
+ if (source == compositeItem)
21232373 {
21242374 group(new Composite());
21252375 } else
2126
- if (event.getSource() == randomItem)
2376
+ if (source == randomItem)
21272377 {
21282378 RandomNode random = new RandomNode();
21292379 group(random);
21302380 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2381
+ random.name = random.get(0).name + "Switch";
21322382 } else
2133
- if (event.getSource() == physicsItem)
2383
+ if (source == physicsItem)
21342384 {
21352385 group(new PhysicsNode());
21362386 } else
2137
- if (event.getSource() == frameselectorItem)
2387
+ if (source == frameselectorItem)
21382388 {
21392389 for (int i=0; i<group.selection.size(); i++)
21402390 {
....@@ -2146,7 +2396,7 @@
21462396 ResetModel();
21472397 refreshContents();
21482398 } else
2149
- if (event.getSource() == switchGeoItem)
2399
+ if (source == switchGeoItem)
21502400 {
21512401 for (int i=0; i<group.selection.size(); i++)
21522402 {
....@@ -2158,7 +2408,7 @@
21582408 ResetModel();
21592409 refreshContents();
21602410 } else
2161
- if (event.getSource() == switchTransfoItem)
2411
+ if (source == switchTransfoItem)
21622412 {
21632413 for (int i=0; i<group.selection.size(); i++)
21642414 {
....@@ -2170,7 +2420,7 @@
21702420 ResetModel();
21712421 refreshContents();
21722422 } else
2173
- if (event.getSource() == morphItem)
2423
+ if (source == morphItem)
21742424 {
21752425 for (int i=0; i<group.selection.size(); i++)
21762426 {
....@@ -2182,7 +2432,7 @@
21822432 ResetModel();
21832433 refreshContents();
21842434 } else
2185
- if (event.getSource() == scriptNodeItem)
2435
+ if (source == scriptNodeItem)
21862436 {
21872437 boolean atleastone = false;
21882438
....@@ -2221,191 +2471,223 @@
22212471 }
22222472 }
22232473 } else
2224
- if (event.getSource() == linkerItem)
2474
+ if (source == linkerItem)
22252475 {
22262476 group(new cLinker());
22272477 } else
2228
- if (event.getSource() == textureItem)
2478
+ if (source == textureItem)
22292479 {
22302480 group(new TextureNode());
22312481 } else
2232
- if (event.getSource() == shadowXItem)
2482
+ if (source == billboardItem)
2483
+ {
2484
+ group(new BillboardNode());
2485
+ } else
2486
+ if (source == shadowXItem)
22332487 {
22342488 CastShadow(0);
22352489 } else
2236
- if (event.getSource() == shadowYItem)
2490
+ if (source == shadowYItem)
22372491 {
22382492 CastShadow(1);
22392493 } else
2240
- if (event.getSource() == shadowZItem)
2494
+ if (source == shadowZItem)
22412495 {
22422496 CastShadow(2);
22432497 } else
2244
- if (event.getSource() == ungroupItem)
2498
+ if (source == ungroupItem)
22452499 {
2246
- ungroup();
2500
+ //ungroup();
2501
+ for (int i=0; i<group.selection.size(); i++)
2502
+ {
2503
+ Ungroup(group.selection.get(i));
2504
+ }
2505
+
2506
+ ClearSelection(false);
2507
+
2508
+ refreshContents();
22472509 } else
2248
- if (event.getSource() == genUVItem)
2510
+ if (source == genUVItem)
22492511 {
22502512 GenUV();
22512513 } else
2252
- if (event.getSource() == genNormalsCADItem)
2514
+ if (source == genNormalsCADItem)
22532515 {
22542516 GenNormals(true);
22552517 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2518
+ if (source == genNormalsMESHItem)
2519
+ {
2520
+ GenNormals(true); // TODO
2521
+ } else
2522
+ if (source == genNormalsORGANItem)
22572523 {
22582524 GenNormals(false);
22592525 } else
2260
- if (event.getSource() == stripifyItem)
2526
+ if (source == genNormalsMINEItem)
2527
+ {
2528
+ GenNormalsMINE();
2529
+ } else
2530
+ if (source == stripifyItem)
22612531 {
22622532 Stripify();
22632533 } else
2264
- if (event.getSource() == unstripifyItem)
2534
+ if (source == unstripifyItem)
22652535 {
22662536 Unstripify();
22672537 } else
2268
- if (event.getSource() == trimItem)
2538
+ if (source == trimItem)
22692539 {
22702540 Trim();
22712541 } else
2272
- if (event.getSource() == untrimItem)
2542
+ if (source == untrimItem)
22732543 {
22742544 Untrim();
22752545 } else
2276
- if (event.getSource() == clearColorsItem)
2546
+ if (source == clearColorsItem)
22772547 {
22782548 ClearColors();
22792549 } else
2280
- if (event.getSource() == clearMaterialsItem)
2550
+ if (source == clearMaterialsItem)
22812551 {
22822552 ClearMaterials();
22832553 } else
2284
- if (event.getSource() == liveleavesItem)
2554
+ if (source == liveleavesItem)
22852555 {
22862556 LiveLeaves(true);
22872557 } else
2288
- if (event.getSource() == unliveleavesItem)
2558
+ if (source == unliveleavesItem)
22892559 {
22902560 LiveLeaves(false);
22912561 } else
2292
- if (event.getSource() == supportleavesItem)
2562
+ if (source == supportleavesItem)
22932563 {
22942564 SupportLeaves(true);
22952565 } else
2296
- if (event.getSource() == unsupportleavesItem)
2566
+ if (source == unsupportleavesItem)
22972567 {
22982568 SupportLeaves(false);
22992569 } else
2300
- if (event.getSource() == hideleavesItem)
2570
+ if (source == hideleavesItem)
23012571 {
23022572 HideLeaves(true);
23032573 } else
2304
- if (event.getSource() == showleavesItem)
2574
+ if (source == showleavesItem)
23052575 {
23062576 HideLeaves(false);
23072577 } else
2308
- if (event.getSource() == markleavesItem)
2578
+ if (source == markleavesItem)
23092579 {
23102580 MarkLeaves(true);
23112581 } else
2312
- if (event.getSource() == unmarkleavesItem)
2582
+ if (source == unmarkleavesItem)
23132583 {
23142584 MarkLeaves(false);
23152585 } else
2316
- if (event.getSource() == flipVItem)
2586
+ if (source == flipVItem)
23172587 {
23182588 FlipV(true);
23192589 } else
2320
- if (event.getSource() == unflipVItem)
2590
+ if (source == unflipVItem)
23212591 {
23222592 FlipV(false);
23232593 } else
2324
- if (event.getSource() == lowTexturesItem)
2594
+ if (source == lowTexturesItem)
23252595 {
23262596 SetTexRes(0);
23272597 } else
2328
- if (event.getSource() == normalTexturesItem)
2598
+ if (source == normalTexturesItem)
23292599 {
23302600 SetTexRes(1);
23312601 } else
2332
- if (event.getSource() == highTexturesItem)
2602
+ if (source == highTexturesItem)
23332603 {
23342604 SetTexRes(2);
23352605 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2606
+ if (source == veryhighTexturesItem)
23372607 {
23382608 SetTexRes(3);
23392609 } else
2340
- if (event.getSource() == maxTexturesItem)
2610
+ if (source == maxTexturesItem)
23412611 {
23422612 SetTexRes(4);
23432613 } else
2344
- if (event.getSource() == panoTexturesItem)
2614
+ if (source == panoTexturesItem)
23452615 {
23462616 SetTexRes(5);
23472617 } else
2348
- if (event.getSource() == reverseNormalsItem)
2618
+ if (source == reverseNormalsItem)
23492619 {
23502620 ReverseNormals();
23512621 } else
2352
- if (event.getSource() == parseverticesItem)
2622
+ if (source == parseverticesItem)
23532623 {
23542624 ParseVertices();
23552625 } else
2356
- if (event.getSource() == alignItem)
2626
+ if (source == textureFieldItem)
2627
+ {
2628
+ TextureVertices();
2629
+ } else
2630
+ if (source == alignItem)
23572631 {
23582632 Align();
23592633 } else
2360
- if (event.getSource() == mirrorItem)
2634
+ if (source == mirrorItem)
23612635 {
23622636 MirrorPoses();
23632637 } else
2364
- if (event.getSource() == reduceMorphItem)
2638
+ if (source == reduceMorphItem)
23652639 {
23662640 MeshReduction(false);
23672641 } else
2368
- if (event.getSource() == reduce34MorphItem)
2642
+ if (source == reduce34MorphItem)
23692643 {
23702644 MeshReduction(true);
23712645 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2646
+ if (source == reverseTrianglesItem)
23732647 {
23742648 ReverseTriangles();
23752649 } else
2376
- if (event.getSource() == reduceMeshItem)
2650
+ if (source == reduceMeshItem)
23772651 {
23782652 ReduceMesh(false);
23792653 } else
2380
- if (event.getSource() == reduce34MeshItem)
2654
+ if (source == reduce34MeshItem)
23812655 {
23822656 ReduceMesh(true);
23832657 } else
2384
- if (event.getSource() == increaseMeshItem)
2658
+ if (source == increaseMeshItem)
23852659 {
23862660 IncreaseMesh();
23872661 } else
2388
- if (event.getSource() == clipMeshItem)
2662
+ if (source == clipMeshItem)
23892663 {
23902664 ClipMesh();
23912665 } else
2392
- if (event.getSource() == smoothMeshItem)
2666
+ if (source == smoothMeshItem)
23932667 {
23942668 SmoothMesh();
23952669 } else
2396
- if (event.getSource() == transformgeometryItem)
2670
+ if (source == transformGeometryItem)
23972671 {
23982672 TransformGeometry();
23992673 } else
2400
- if (event.getSource() == resetTransformItem)
2674
+ if (source == transformChildrenItem)
2675
+ {
2676
+ TransformChildren();
2677
+ } else
2678
+ if (source == resetTransformItem)
24012679 {
24022680 ResetTransform();
24032681 } else
2404
- if (event.getSource() == resetCentroidItem)
2682
+ if (source == resetCentroidItem)
24052683 {
2406
- ResetCentroid();
2684
+ ResetCentroid(true);
24072685 } else
2408
- if (event.getSource() == resetParentItem)
2686
+ if (source == resetCentroidXZItem)
2687
+ {
2688
+ ResetCentroid(false);
2689
+ } else
2690
+ if (source == resetParentItem)
24092691 {
24102692 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112693 {
....@@ -2415,7 +2697,7 @@
24152697
24162698 refreshContents();
24172699 } else
2418
- if (event.getSource() == repairParentItem)
2700
+ if (source == repairParentItem)
24192701 {
24202702 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212703 {
....@@ -2429,7 +2711,21 @@
24292711
24302712 refreshContents();
24312713 } else
2432
- if (event.getSource() == sortbysizeItem)
2714
+ if (source == repairShadowItem)
2715
+ {
2716
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2717
+ {
2718
+ Object3D obj = (Object3D)e.nextElement();
2719
+ obj.RepairShadow();
2720
+// for (int i=0; i<obj.size(); i++)
2721
+// {
2722
+// obj.get(i).parent = obj;
2723
+// }
2724
+ }
2725
+
2726
+ refreshContents();
2727
+ } else
2728
+ if (source == sortbysizeItem)
24332729 {
24342730 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352731 {
....@@ -2441,7 +2737,7 @@
24412737 ResetModel();
24422738 refreshContents();
24432739 } else
2444
- if (event.getSource() == sortbynameItem)
2740
+ if (source == sortbynameItem)
24452741 {
24462742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472743 {
....@@ -2453,7 +2749,7 @@
24532749 ResetModel();
24542750 refreshContents();
24552751 } else
2456
- if (event.getSource() == attachPigmentItem)
2752
+ if (source == attachPigmentItem)
24572753 {
24582754 String texture = GetFile("Attach pigment");
24592755 Object3D obj;
....@@ -2465,7 +2761,7 @@
24652761
24662762 refreshContents();
24672763 } else
2468
- if (event.getSource() == detachPigmentItem)
2764
+ if (source == detachPigmentItem)
24692765 {
24702766 Object3D obj;
24712767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2772,7 @@
24762772
24772773 refreshContents();
24782774 } else
2479
- if (event.getSource() == attachBumpItem)
2775
+ if (source == attachBumpItem)
24802776 {
24812777 String texture = GetFile("Attach bump");
24822778 Object3D obj;
....@@ -2488,7 +2784,7 @@
24882784
24892785 refreshContents();
24902786 } else
2491
- if (event.getSource() == detachBumpItem)
2787
+ if (source == detachBumpItem)
24922788 {
24932789 Object3D obj;
24942790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2795,7 @@
24992795
25002796 refreshContents();
25012797 } else
2502
- if (event.getSource() == pigmentBumpItem)
2798
+ if (source == pigmentBumpItem)
25032799 {
25042800 Object3D obj;
25052801 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2806,195 @@
25102806
25112807 refreshContents();
25122808 } else
2513
- if (event.getSource() == flashSelectionButton)
2809
+ if (source == flashSelectionButton)
25142810 {
25152811 CameraPane.flash = true;
25162812 refreshContents();
25172813 } else
2518
- if (event.getSource() == oneButton)
2814
+ if (source == oneButton)
25192815 {
25202816 } else
2521
- if (event.getSource() == twoButton)
2817
+ if (source == twoButton)
25222818 {
25232819 radio.layout = twoButton;
25242820 // bug
25252821 //gridPanel.setDividerLocation(1.0);
25262822 //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();
2823
+// bigThree.remove(scenePanel);
2824
+// bigThree.remove(centralPanel);
2825
+// bigThree.remove(XYZPanel);
2826
+// aWindowConstraints.gridx = 0;
2827
+// aWindowConstraints.gridy = 0;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// aWindowConstraints.weightx = 0;
2832
+// aWindowConstraints.weighty = 1;
2833
+// //bigThree.add(jtp, aWindowConstraints);
2834
+// aWindowConstraints.weightx = 1;
2835
+// aWindowConstraints.gridwidth = 3;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.gridx = 1;
2838
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2839
+// bigThree.add(centralPanel, aWindowConstraints);
2840
+// aWindowConstraints.weightx = 0;
2841
+// aWindowConstraints.gridx = 4;
2842
+// aWindowConstraints.gridwidth = 1;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2845
+// //bigThree.add(XYZPanel, aWindowConstraints);
2846
+// scenePanel.setVisible(false);
2847
+// centralPanel.setVisible(true);
2848
+// XYZPanel.setVisible(false);
2849
+ bigThree.ClearUI();
2850
+ bigThree.add(centralPanel);
2851
+ bigThree.FlushUI();
25512852 } else
2552
- if (event.getSource() == threeButton)
2853
+ if (source == threeButton)
25532854 {
25542855 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();
2856
+
2857
+// bigThree.remove(scenePanel);
2858
+// bigThree.remove(centralPanel);
2859
+// bigThree.remove(XYZPanel);
2860
+// aWindowConstraints.gridx = 0;
2861
+// aWindowConstraints.gridy = 0;
2862
+// aWindowConstraints.gridwidth = 1;
2863
+// // aConstraints.gridheight = 3;
2864
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.weighty = 1;
2867
+// //bigThree.add(jtp, aWindowConstraints);
2868
+// aWindowConstraints.weightx = 1;
2869
+// aWindowConstraints.gridwidth = 3;
2870
+// // aConstraints.gridheight = 3;
2871
+// aWindowConstraints.gridx = 1;
2872
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2873
+// bigThree.add(centralPanel, aWindowConstraints);
2874
+// aWindowConstraints.weightx = 0;
2875
+// aWindowConstraints.gridx = 4;
2876
+// aWindowConstraints.gridwidth = 1;
2877
+// // aConstraints.gridheight = 3;
2878
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2879
+// bigThree.add(XYZPanel, aWindowConstraints);
2880
+// bigThree.validate();
2881
+// scenePanel.setVisible(false);
2882
+// centralPanel.setVisible(true);
2883
+// XYZPanel.setVisible(true);
2884
+ bigThree.ClearUI();
2885
+ bigThree.add(centralPanel);
2886
+ bigThree.add(XYZPanel);
2887
+ bigThree.FlushUI();
25792888 } else
2580
- if (event.getSource() == fourButton)
2889
+ if (source == fourButton)
25812890 {
25822891 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();
2892
+
2893
+// bigThree.remove(scenePanel);
2894
+// bigThree.remove(centralPanel);
2895
+// bigThree.remove(XYZPanel);
2896
+// aWindowConstraints.gridx = 0;
2897
+// aWindowConstraints.gridy = 0;
2898
+// aWindowConstraints.gridwidth = 1;
2899
+// // aWindowConstraints.gridheight = 3;
2900
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.weighty = 1;
2903
+// bigThree.add(scenePanel, aWindowConstraints);
2904
+// aWindowConstraints.weightx = 1;
2905
+// aWindowConstraints.gridwidth = 3;
2906
+// // aConstraints.gridheight = 3;
2907
+// aWindowConstraints.gridx = 1;
2908
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2909
+// //bigThree.add(cameraPanel, aWindowConstraints);
2910
+// aWindowConstraints.weightx = 0;
2911
+// aWindowConstraints.gridx = 4;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aWindowConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// //bigThree.add(XYZPanel, aWindowConstraints);
2916
+// bigThree.validate();
2917
+// scenePanel.setVisible(true);
2918
+// centralPanel.setVisible(false);
2919
+// XYZPanel.setVisible(false);
2920
+ bigThree.ClearUI();
2921
+ bigThree.add(scenePanel);
2922
+ bigThree.FlushUI();
26072923 } else
2608
- if (event.getSource() == sixButton)
2924
+ if (source == sixButton)
26092925 {
26102926 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();
2927
+
2928
+// bigThree.remove(scenePanel);
2929
+// bigThree.remove(centralPanel);
2930
+// bigThree.remove(XYZPanel);
2931
+// aWindowConstraints.gridx = 0;
2932
+// aWindowConstraints.gridy = 0;
2933
+// aWindowConstraints.gridwidth = 1;
2934
+// // aConstraints.gridheight = 3;
2935
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.weighty = 1;
2938
+// bigThree.add(scenePanel, aWindowConstraints);
2939
+// aWindowConstraints.weightx = 1;
2940
+// aWindowConstraints.gridwidth = 3;
2941
+// // aWindowConstraints.gridheight = 3;
2942
+// aWindowConstraints.gridx = 1;
2943
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2944
+// bigThree.add(centralPanel, aWindowConstraints);
2945
+// aWindowConstraints.weightx = 0;
2946
+// aWindowConstraints.gridx = 4;
2947
+// aWindowConstraints.gridwidth = 1;
2948
+// // aWindowConstraints.gridheight = 3;
2949
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2950
+// //bigThree.add(XYZPanel, aConstraints);
2951
+// bigThree.validate();
2952
+// scenePanel.setVisible(true);
2953
+// centralPanel.setVisible(true);
2954
+// XYZPanel.setVisible(false);
2955
+ bigThree.ClearUI();
2956
+ bigThree.add(scenePanel);
2957
+ bigThree.add(centralPanel);
2958
+ bigThree.FlushUI();
26352959 } else
2636
- if (event.getSource() == sevenButton)
2960
+ if (source == sevenButton)
26372961 {
26382962 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();
2963
+
2964
+// bigThree.remove(scenePanel);
2965
+// bigThree.remove(centralPanel);
2966
+// bigThree.remove(XYZPanel);
2967
+// aWindowConstraints.gridx = 0;
2968
+// aWindowConstraints.gridy = 0;
2969
+// aWindowConstraints.gridwidth = 1;
2970
+// // aWindowConstraints.gridheight = 3;
2971
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2972
+// aWindowConstraints.weightx = 0;
2973
+// aWindowConstraints.weighty = 1;
2974
+// bigThree.add(scenePanel, aWindowConstraints);
2975
+// aWindowConstraints.weightx = 1;
2976
+// aWindowConstraints.gridwidth = 3;
2977
+// // aWindowConstraints.gridheight = 3;
2978
+// aWindowConstraints.gridx = 1;
2979
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2980
+// bigThree.add(centralPanel, aWindowConstraints);
2981
+// aWindowConstraints.weightx = 0;
2982
+// aWindowConstraints.gridx = 4;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// bigThree.add(XYZPanel, aWindowConstraints);
2987
+// bigThree.validate();
2988
+// scenePanel.setVisible(true);
2989
+// centralPanel.setVisible(true);
2990
+// XYZPanel.setVisible(true);
2991
+ bigThree.ClearUI();
2992
+ bigThree.add(scenePanel);
2993
+ bigThree.add(centralPanel);
2994
+ bigThree.add(XYZPanel);
2995
+ bigThree.FlushUI();
26632996 } else
2664
- if (event.getSource() == rootButton)
2997
+ if (source == rootButton)
26652998 {
26662999 Object3D obj;
26673000 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +3006,7 @@
26733006
26743007 refreshContents(true);
26753008 } else
2676
- if (event.getSource() == closeButton)
3009
+ if (source == closeButton)
26773010 {
26783011 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793012 cRadio ab;
....@@ -2694,11 +3027,11 @@
26943027 }
26953028 refreshContents(true);
26963029 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3030
+ if (source == editItem || source == editButton)
26983031 {
26993032 EditSelection(false);
27003033 } else
2701
- if (event.getSource() == uneditButton)
3034
+ if (source == uneditButton)
27023035 {
27033036 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043037 {
....@@ -2708,14 +3041,14 @@
27083041 child.CloseUI();
27093042 listUI.remove(child);
27103043
2711
- child.editWindow = null; // ???????????
3044
+ //child.editWindow = null; // ???????????
27123045 }
2713
- objEditor.ctrlPanel.revalidate();
3046
+ objEditor.ctrlPanel.FlushUI();
27143047 //objEditor.jTree.clearSelection();
27153048 //objEditor.ResetSliders();
27163049 refreshContents(true);
27173050 } else
2718
- if (event.getSource() == clearPanelButton)
3051
+ if (source == clearPanelButton)
27193052 {
27203053 assert(copy == group);
27213054 //copy.ClearUI();
....@@ -2726,7 +3059,7 @@
27263059 listUI.clear();
27273060 refreshContents(true);
27283061 } else
2729
- if (event.getSource() == allParamsButton)
3062
+ if (source == allParamsButton)
27303063 {
27313064 assert(copy == group);
27323065
....@@ -2747,19 +3080,19 @@
27473080
27483081 refreshContents(true);
27493082 } else
2750
- if (event.getSource() == unselectButton)
3083
+ if (source == unselectButton)
27513084 {
27523085 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3086
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543087 objEditor.ResetSliders();
27553088 refreshContents(true);
27563089 } else
2757
- if(event.getSource() instanceof cRadio)
3090
+ if(source instanceof cRadio)
27583091 {
27593092 group.parent = keepparent;
27603093 group.attributes = 0;
27613094 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3095
+ /*cRadio*/ radio = (cRadio)source;
27633096 Object3D obj = radio.GetObject();
27643097 System.out.println("Edit " + obj);
27653098 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3112,7 @@
27793112 }
27803113
27813114 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3115
+ //Globals.theRenderer.object = group;
27833116 if(!useclient)
27843117 {
27853118 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3121,15 @@
27883121 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893122 cameraView.targetLookAt.set(radio.camera.lookAt);
27903123 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3124
+ //cameraView.lighttouched = true;
3125
+ Globals.lighttouched = true;
27923126 topView.object = group;
27933127 frontView.object = group;
27943128 sideView.object = group;
27953129 }
2796
- group.editWindow = this;
3130
+
3131
+// fix "+" issue group.editWindow = this;
3132
+
27973133 /*
27983134 currentLayout = radio.layout;
27993135 if (currentLayout == null)
....@@ -2806,7 +3142,20 @@
28063142 //group.attributes = -1;
28073143 ResetModel();
28083144 refreshContents(true);
2809
- }
3145
+ } else if (event.getSource() == editCameraItem)
3146
+ {
3147
+ cameraView.ProtectCamera();
3148
+ cameraView.repaint();
3149
+ return;
3150
+ } else if (event.getSource() == revertCameraItem)
3151
+ {
3152
+ cameraView.RevertCamera();
3153
+ cameraView.repaint();
3154
+ return;
3155
+ // } else if (event.getSource() == textureButton)
3156
+ // {
3157
+ // return; // true;
3158
+ }
28103159 else
28113160 {
28123161 //return super.action(event, arg);
....@@ -2824,7 +3173,7 @@
28243173 if (useclient)
28253174 {
28263175 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3176
+ Globals.lighttouched = true;
28283177 //topView.object = client;
28293178 //frontView.object = client;
28303179 //sideView.object = client;
....@@ -2832,7 +3181,7 @@
28323181 else
28333182 {
28343183 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3184
+ Globals.lighttouched = true;
28363185 //topView.object = group;
28373186 //frontView.object = group;
28383187 //sideView.object = group;
....@@ -2867,6 +3216,28 @@
28673216 refreshContents();
28683217 }
28693218
3219
+ void TransformChildren()
3220
+ {
3221
+ Object3D obj;
3222
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3223
+ {
3224
+ obj = (Object3D)e.nextElement();
3225
+ obj.KeepTextureMatrices();
3226
+ obj.TransformChildren();
3227
+ obj.RestoreTextureMatrices();
3228
+
3229
+// if (obj.parent == null)
3230
+// {
3231
+// System.out.println("NULL PARENT!");
3232
+// new Exception().printStackTrace();
3233
+// }
3234
+// else
3235
+// TouchTransform(obj);
3236
+// //obj.parent.Touch();
3237
+ }
3238
+
3239
+ refreshContents();
3240
+ }
28703241
28713242 void ResetTransform()
28723243 {
....@@ -2979,7 +3350,7 @@
29793350 refreshContents();
29803351 }
29813352
2982
- void ResetCentroid()
3353
+ void ResetCentroid(boolean full)
29833354 {
29843355 Object3D obj;
29853356 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3365,16 @@
29943365 LA.matIdentity(Object3D.mat);
29953366 obj.getBounds(minima, maxima, false);
29963367 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3368
+ if (full)
3369
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983370 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993371 obj.TransformMesh(Object3D.mat);
3372
+
30003373 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3374
+ if (full)
3375
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023376 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3377
+
30033378 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043379 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053380 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3065,9 +3440,9 @@
30653440 obj = (Object3D)e.nextElement();
30663441
30673442 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3443
+ Grafreed.AnalyzeObject(obj);
30693444 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3445
+ Grafreed.AnalyzeObject(obj.bRep);
30713446
30723447 // System.err.println((size/1024) + " KB is the size of " + obj);
30733448 }
....@@ -3109,6 +3484,13 @@
31093484 void GenNormals(boolean crease)
31103485 {
31113486 group.GenNormalsS(crease);
3487
+
3488
+ refreshContents();
3489
+ }
3490
+
3491
+ void GenNormalsMINE()
3492
+ {
3493
+ group.selection.GenNormalsMINE();
31123494
31133495 refreshContents();
31143496 }
....@@ -3157,104 +3539,259 @@
31573539
31583540 //Object3D buffer;
31593541 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
-
3542
+// BoundaryRep temprep;
3543
+// Object3D nodes;
3544
+// Vector<Vertex> vertices;
3545
+//
3546
+// cGroup buffer;
3547
+//
3548
+// public void Vertex(Object3D node, Vertex v)
3549
+// {
3550
+//// vertices.add(v);
3551
+//// nodes.addElement(node);
3552
+////
3553
+//// if (temprep.GetCache(v) != null)
3554
+//// {
3555
+//// temprep.Remove(v);
3556
+//// } else
3557
+//// {
3558
+//// temprep.Remember(v);
3559
+//// }
3560
+//
3561
+// //Object3D node = nodes.get(index);
3562
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3563
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3564
+//
3565
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3566
+//
3567
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3568
+//
3569
+// cGroup g = new cGroup();
3570
+//
3571
+// if (g.toParent == null)
3572
+// {
3573
+// g.toParent = LA.newMatrix();
3574
+// g.fromParent = LA.newMatrix();
3575
+// }
3576
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3577
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3578
+//
3579
+// g.add(GrafreeD.clipboard);
3580
+//
3581
+// buffer.add(g);
3582
+// }
3583
+//
3584
+// public void Face(Object3D node, Face f)
3585
+// {
3586
+//
3587
+// }
3588
+//
3589
+// void ParseVerticesOld() // ??
3590
+// {
3591
+// //if (group.selection.size() != 1)
3592
+// // return;
3593
+//
3594
+// temprep = new BoundaryRep();
3595
+// nodes = new Object3D();
3596
+// vertices = new Vector<Vertex>();
3597
+//
3598
+// boolean epsequal = GrafreeD.epsequal;
3599
+// GrafreeD.epsequal = true;
3600
+//
3601
+// for (int i=0; i<group.selection.size(); i++)
3602
+// {
3603
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3604
+//
3605
+// group.selection.get(i).Parse(
3606
+//this );
3607
+//
3608
+// int repsize = temprep.VertexCount();
3609
+// int tablesize = temprep.vertextable.size();
3610
+// int nodesize = nodes.size();
3611
+//
3612
+// assert(vertices.size() == nodes.size());
3613
+//
3614
+// temprep.vertextable.elements();
3615
+//
3616
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3617
+//
3618
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3619
+// {
3620
+// cGroup g = new cGroup();
3621
+//
3622
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3623
+//
3624
+// Object3D node = nodes.get(index);
3625
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3626
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3627
+//
3628
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3629
+//
3630
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3631
+//
3632
+// if (g.toParent == null)
3633
+// {
3634
+// g.toParent = LA.newMatrix();
3635
+// g.fromParent = LA.newMatrix();
3636
+// }
3637
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3638
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3639
+//
3640
+// g.add(GrafreeD.clipboard);
3641
+//
3642
+// buffer.add(g);
3643
+// }
3644
+//
3645
+// makeSomething(buffer, i==group.selection.size()-1);
3646
+// }
3647
+//
3648
+// GrafreeD.epsequal = epsequal;
3649
+//
3650
+// //buffer = null;
3651
+// temprep = null;
3652
+// nodes = null;
3653
+//
3654
+// refreshContents();
3655
+// }
3656
+
31843657 void ParseVertices()
31853658 {
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;
3659
+ boolean epsequal = Grafreed.epsequal;
3660
+ Grafreed.epsequal = true;
31953661
31963662 for (int i=0; i<group.selection.size(); i++)
31973663 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3664
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993665
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3666
+ group.selection.get(i).Parse(
3667
+
3668
+ new iParse()
3669
+ {
3670
+ public void Vertex(Object3D node, Vertex v)
3671
+ {
3672
+ temp.set(v);
3673
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053674
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();
3675
+ cGroup g = new cGroup();
32113676
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3677
+ if (g.toParent == null)
3678
+ {
3679
+ g.toParent = LA.newMatrix();
3680
+ g.fromParent = LA.newMatrix();
3681
+ }
3682
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3683
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153684
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);
3685
+ g.add(Grafreed.clipboard);
32203686
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);
3687
+ buffer.add(g);
3688
+ }
32323689
3233
- g.add(GraphreeD.clipboard);
3690
+ public void Face(Object3D node, Face f)
3691
+ {
32343692
3235
- buffer.add(g);
3236
- }
3693
+ }
3694
+ }
3695
+ );
32373696
32383697 makeSomething(buffer, i==group.selection.size()-1);
32393698 }
32403699
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3700
+ Grafreed.epsequal = epsequal;
32463701
32473702 refreshContents();
32483703 }
3249
-
3704
+
3705
+ void TextureVertices()
3706
+ {
3707
+ for (int i=0; i<group.selection.size(); i++)
3708
+ {
3709
+ group.selection.get(i).Parse(
3710
+ new iParse()
3711
+ {
3712
+ public void Vertex(Object3D node, Vertex v)
3713
+ {
3714
+ cTexture tex = node.GetTextures();
3715
+ String pigment = Object3D.GetPigment(tex);
3716
+ //String bump = Object3D.GetBump(tex);
3717
+
3718
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3719
+
3720
+ try
3721
+ {
3722
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3723
+ }
3724
+ catch (Exception e)
3725
+ {
3726
+ System.err.println("FAIL: " + node);
3727
+ }
3728
+
3729
+ double s = v.s;
3730
+
3731
+ if (s == 1)
3732
+ s = 0;
3733
+
3734
+ double t = v.t;
3735
+
3736
+ if (t == 1)
3737
+ t = 0;
3738
+
3739
+ int indexs = (int) (texturedata.getWidth() * s);
3740
+ int indext = (int) (texturedata.getHeight() * t);
3741
+
3742
+ int index = indext * texturedata.getWidth() + indexs;
3743
+
3744
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3745
+
3746
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3747
+
3748
+ float scale = bytebuf.get(index*slide) & 0xFF;
3749
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3750
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3751
+ scale /= 3;
3752
+
3753
+ scale /= 0xFF;
3754
+ // c'est quoi ca? scale /= 4;
3755
+
3756
+ //v.AO = scale;
3757
+
3758
+ v.x += v.norm.x * scale;
3759
+ v.y += v.norm.y * scale;
3760
+ v.z += v.norm.z * scale;
3761
+ }
3762
+
3763
+ public void Face(Object3D node, Face f)
3764
+ {
3765
+ }
3766
+ }
3767
+ );
3768
+ }
3769
+
3770
+ refreshContents();
3771
+ }
3772
+
32503773 void Align()
32513774 {
3775
+ if (group.selection.size() == 0)
3776
+ return;
3777
+
3778
+ cVector bbmin = new cVector();
3779
+ cVector bbmax = new cVector();
3780
+
3781
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3782
+
3783
+ double dx = bbmax.x - bbmin.x;
3784
+ double dy = bbmax.y - bbmin.y;
3785
+ double dz = bbmax.z - bbmin.z;
3786
+
3787
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3788
+
32523789 for (int i=0; i<group.selection.size(); i++)
32533790 {
32543791 Object3D obj = group.selection.get(i);
32553792
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3793
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3794
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583795 }
32593796
32603797 refreshContents();
....@@ -3267,7 +3804,7 @@
32673804 // ref.SaveSupports();
32683805 // Object3D par = ref.parent;
32693806 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3807
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713808 // ref.parent = par;
32723809 // ref.RestoreSupports();
32733810
....@@ -3275,11 +3812,11 @@
32753812
32763813 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773814
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3815
+ boolean random = CameraPane.SWITCH;
3816
+ CameraPane.SWITCH = false; // parse all random nodes
32803817 lowres.linkVerticesThis(null);
32813818 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3819
+ CameraPane.SWITCH = random;
32833820
32843821 System.err.flush();
32853822
....@@ -3297,7 +3834,7 @@
32973834 // lowres.SaveSupports();
32983835 // par = lowres.parent;
32993836 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3837
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013838 Object3D newlow = CloneObject(lowres, false);
33023839 newlow.name = sn.switchobject.get(i).name;
33033840 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3856,7 @@
33193856 return;
33203857
33213858 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3859
+ Object3D ref = Grafreed.clipboard.get(0);
33233860
33243861 Object3D newgroup = new Object3D("Po:" + poses.name);
33253862
....@@ -3488,7 +4025,7 @@
34884025 group.selection.RelinkToSupport(); // july 2014
34894026 System.out.println("DONE.");
34904027 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4028
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924029 }
34934030
34944031 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4050,20 @@
35134050
35144051 void ClipMesh()
35154052 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4053
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174054 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4055
+ Object3D content = Grafreed.clipboard.get(0);
35194056
35204057 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214058 content = ((cGroup)content).get(0);
35224059
35234060 // for (int i=0; i<group.selection.size(); i++)
35244061 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4062
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264063 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4064
+ group.selection.ClipMesh(Grafreed.clipboard);
35284065 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4066
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304067 System.out.println("DONE.");
35314068 refreshContents();
35324069 }
....@@ -3659,7 +4196,7 @@
36594196 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604197
36614198 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4199
+ if(elem != group || !newWindow)
36634200 {
36644201 // if (!(elem instanceof Composite))
36654202 // newWindow = false;
....@@ -3764,25 +4301,28 @@
37644301 System.err.println("info : " + child.GetPath());
37654302 }
37664303 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4304
+// else
4305
+// {
4306
+// objEditor.SetMaterial(group); // .GetMaterial());
4307
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4308
+// System.err.println("info : " + group.GetPath());
4309
+// }
37734310
37744311 objEditor.SetText(); // jan 2014
37754312
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4313
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774314 CameraPane.flash = true;
37784315
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4316
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804317 // a camera
37814318 {
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;
4319
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4320
+ {
4321
+ CameraPane.camerachangeframe = 0; // don't refuse it
4322
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4323
+ }
4324
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4325
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864326 }
37874327
37884328 refreshContents();
....@@ -3864,12 +4404,12 @@
38644404 {
38654405 if (group.selection.isEmpty())
38664406 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4407
+ Grafreed.clipboardIsTempGroup = false;
38684408 Composite tGroup = null;
38694409 if (group.selection.size() > 0) // 1)
38704410 {
38714411 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4412
+ Grafreed.clipboardIsTempGroup = true;
38734413 }
38744414
38754415 if (cut)
....@@ -3909,16 +4449,16 @@
39094449 //System.out.println("cut " + child);
39104450 //System.out.println("parent = " + child.parent);
39114451 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4452
+ if (Grafreed.clipboardIsTempGroup)
39134453 tGroup.add/*Child*/(tmp);
39144454 else
3915
- GraphreeD.clipboard = tmp;
4455
+ Grafreed.clipboard = tmp;
39164456 }
39174457 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
39194459 tGroup.add/*Child*/(child);
39204460 else
3921
- GraphreeD.clipboard = child;
4461
+ Grafreed.clipboard = child;
39224462 }
39234463
39244464 //ResetModel();
....@@ -3950,21 +4490,21 @@
39504490 //System.out.println("cut " + elem);
39514491 //System.out.println("parent = " + elem.parent);
39524492 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4493
+ if (Grafreed.clipboardIsTempGroup)
39544494 tGroup.add/*Child*/(tmp);
39554495 else
3956
- GraphreeD.clipboard = tmp;
4496
+ Grafreed.clipboard = tmp;
39574497 }
39584498 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4499
+ if (Grafreed.clipboardIsTempGroup)
39604500 tGroup.add/*Child*/(child);
39614501 else
3962
- GraphreeD.clipboard = child;
4502
+ Grafreed.clipboard = child;
39634503 }
39644504
39654505 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4506
+ if (Grafreed.clipboardIsTempGroup)
4507
+ Grafreed.clipboard = tGroup;
39684508 if (cut)
39694509 {
39704510 ResetModel();
....@@ -3974,11 +4514,11 @@
39744514
39754515 void paste(boolean expand)
39764516 {
3977
- // if (GraphreeD.clipboard == null)
4517
+ // if (GrafreeD.clipboard == null)
39784518 // return;
39794519 boolean first = true;
39804520
3981
- if (GraphreeD.clipboardIsTempGroup)
4521
+ if (Grafreed.clipboardIsTempGroup)
39824522 {
39834523 Composite temp;
39844524
....@@ -3989,7 +4529,7 @@
39894529 temp = (Composite)Applet3D.clipboard.deepCopy();
39904530 */
39914531 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4532
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934533 {
39944534 Object3D child = (Object3D)e.nextElement();
39954535
....@@ -4003,7 +4543,7 @@
40034543 else
40044544 elem = child.deepCopy(); // ?
40054545 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4546
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074547 // elem = elem.get(0);
40084548 makeSomething(elem, true); // ?? first);
40094549 //group.addChild(elem);
....@@ -4023,23 +4563,23 @@
40234563 //Object3D cb = Applet3D.clipboard;
40244564 //temp.addChild(cb);
40254565 //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());
4566
+ assert(Grafreed.clipboard.parent == null);
4567
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4568
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4569
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4570
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314571 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4572
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4573
+ Grafreed.clipboard.get(0).parent = keepparent;
40344574 }
40354575
40364576 ResetModel();
40374577 refreshContents();
40384578 }
40394579
4040
- void pasteInto(boolean copyit)
4580
+ void pasteInto(boolean copyit, boolean clone)
40414581 {
4042
-// if (GraphreeD.clipboard == null)
4582
+// if (GrafreeD.clipboard == null)
40434583 // return;
40444584
40454585 if (group.selection.size() != 1)
....@@ -4066,15 +4606,22 @@
40664606 if (copyit)
40674607 {
40684608 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4609
+ if (clone)
4610
+ {
4611
+ CloneClipboard(false); // sept 2014
4612
+ }
4613
+ else
4614
+ {
4615
+ paste(false);
4616
+ }
40704617 }
40714618 else
40724619 {
40734620 boolean first = true;
40744621
4075
- if (GraphreeD.clipboardIsTempGroup)
4622
+ if (Grafreed.clipboardIsTempGroup)
40764623 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4624
+ Composite temp = (Composite)Grafreed.clipboard;
40784625 Object3D copy;
40794626 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804627 {
....@@ -4084,7 +4631,7 @@
40844631 }
40854632 } else
40864633 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4634
+ linkSomething(Grafreed.clipboard); //.get(0));
40884635 }
40894636 }
40904637 }
....@@ -4276,6 +4823,26 @@
42764823 makeSomething(csg);
42774824 }
42784825
4826
+ void Ungroup(Object3D g)
4827
+ {
4828
+ if (g instanceof HiddenObject)
4829
+ {
4830
+ HiddenObject h = (HiddenObject) g;
4831
+
4832
+ for (int i=0; i<h.ActualSize(); i++)
4833
+ {
4834
+ objEditor.makeSomething(h.get(i), false);
4835
+ }
4836
+ }
4837
+ else
4838
+ {
4839
+ for (int i=0; i<g.Size(); i++)
4840
+ {
4841
+ objEditor.makeSomething(g.get(i), false);
4842
+ }
4843
+ }
4844
+ }
4845
+
42794846 void ungroup()
42804847 {
42814848 /*
....@@ -4469,21 +5036,6 @@
44695036 }
44705037 */
44715038
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
-
44875039 /*
44885040 public void Callback(Object obj)
44895041 {
....@@ -4507,26 +5059,9 @@
45075059 }
45085060 */
45095061
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
-
45275062 String GetFile(String dialogName)
45285063 {
4529
- if (GraphreeD.standAlone)
5064
+ if (Grafreed.standAlone)
45305065 {
45315066 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325067 browser.show();
....@@ -4590,10 +5125,12 @@
45905125 cButton flashSelectionButton;
45915126 cButton editButton;
45925127 cButton uneditButton;
5128
+ JCheckBox allParamsButton;
45935129 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955130 cButton unselectButton;
45965131
5132
+ cButton oneStepButton;
5133
+
45975134 cButton screenfitButton;
45985135 cButton screenfitpointButton;
45995136 cButton snapobjectButton;
....@@ -4624,6 +5161,8 @@
46245161 private MenuItem lookFromItem;
46255162 private MenuItem switchItem;
46265163 private MenuItem cutItem;
5164
+ private MenuItem undoItem;
5165
+ private MenuItem redoItem;
46275166 private MenuItem duplicateItem;
46285167 private MenuItem cloneItem;
46295168 private MenuItem cloneSupportItem;
....@@ -4635,8 +5174,9 @@
46355174 private MenuItem resetsupportItem;
46365175 private MenuItem resetreferencesItem;
46375176 private MenuItem linkverticesItem;
5177
+ private MenuItem relinkverticesItem;
46385178 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5179
+ private MenuItem resetAllItem;
46405180 private MenuItem stepAllItem;
46415181 private MenuItem revertMeshItem;
46425182 private MenuItem poseMeshItem;
....@@ -4647,14 +5187,17 @@
46475187 private MenuItem mergeGeometriesItem;
46485188 private MenuItem copyItem;
46495189 private MenuItem pasteItem;
5190
+ private MenuItem pasteIntoItem;
46505191 private MenuItem pasteLinkItem;
46515192 private MenuItem pasteCloneItem;
46525193 private MenuItem pasteExpandItem;
46535194 private MenuItem clearItem;
46545195 private MenuItem clearAllItem;
46555196 private MenuItem genUVItem;
5197
+ private MenuItem genNormalsMESHItem;
46565198 private MenuItem genNormalsCADItem;
46575199 private MenuItem genNormalsORGANItem;
5200
+ private MenuItem genNormalsMINEItem;
46585201 private MenuItem stripifyItem;
46595202 private MenuItem unstripifyItem;
46605203 private MenuItem trimItem;
....@@ -4694,8 +5237,11 @@
46945237 private MenuItem panoTexturesItem;
46955238
46965239 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5240
+ private MenuItem resetCentroidXZItem;
46985241 private MenuItem resetTransformItem;
5242
+ private MenuItem transformGeometryItem;
5243
+ private MenuItem transformChildrenItem;
5244
+ private MenuItem hideItem;
46995245 private MenuItem grabItem;
47005246 private MenuItem backItem;
47015247 private MenuItem frontItem;
....@@ -4716,6 +5262,7 @@
47165262
47175263 private MenuItem resetParentItem;
47185264 private MenuItem repairParentItem;
5265
+ private MenuItem repairShadowItem;
47195266 private MenuItem sortbysizeItem;
47205267 private MenuItem sortbynameItem;
47215268
....@@ -4728,16 +5275,19 @@
47285275 private MenuItem particleItem;
47295276 private MenuItem ragdollItem;
47305277 private MenuItem ragdoll2Item;
5278
+ private MenuItem heightFieldItem;
5279
+ private MenuItem textureFieldItem;
47315280 private MenuItem gridItem;
47325281 private MenuItem rectoidItem;
47335282 private MenuItem ellipsoidItem;
47345283 private MenuItem coneItem;
47355284 private MenuItem torusItem;
47365285 private MenuItem superItem;
5286
+ private MenuItem kleinItem;
47375287 private MenuItem blobItem;
47385288 private MenuItem latheItem;
47395289 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5290
+ private MenuItem overlayItem;
47415291 private MenuItem meshItem;
47425292 // private MenuItem meshGroupItem;
47435293 private MenuItem springItem;
....@@ -4746,6 +5296,7 @@
47465296 private MenuItem csgItem;
47475297 private MenuItem templateItem;
47485298 private MenuItem textureItem;
5299
+ private MenuItem billboardItem;
47495300 private MenuItem shadowXItem;
47505301 private MenuItem shadowYItem;
47515302 private MenuItem shadowZItem;
....@@ -4758,11 +5309,6 @@
47585309 private MenuItem doubleItem;
47595310 private MenuItem tripleItem;
47605311
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665312 private MenuItem computeAOItem;
47675313 private MenuItem recompileItem;
47685314 private MenuItem editScriptItem;
....@@ -4772,4 +5318,8 @@
47725318 private MenuItem analyzeItem;
47735319 private MenuItem dumpItem;
47745320 //boolean freezemodel = false;
5321
+
5322
+ Menu cameraMenu;
5323
+ MenuItem editCameraItem;
5324
+ MenuItem revertCameraItem;
47755325 }