Normand Briere
2019-06-09 c5b599b48b333b34e554b464aefbca0b9bc66275
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,124 @@
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
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
158
+ duplicateItem.addActionListener(this);
159
+ cloneItem = menu.add(new MenuItem("Clone"));
160
+ cloneItem.addActionListener(this);
161
+ if (Globals.ADVANCED)
162
+ {
163
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
164
+ cloneSupportItem.addActionListener(this);
165
+ }
166
+ menu.add("-");
167
+ cutItem = menu.add(new MenuItem("Cut"));
168
+ cutItem.addActionListener(this);
169
+ copyItem = menu.add(new MenuItem("Copy"));
170
+ copyItem.addActionListener(this);
171
+ pasteItem = menu.add(new MenuItem("Paste"));
172
+ pasteItem.addActionListener(this);
173
+ menu.add("-");
174
+
175
+ menu.add("-");
176
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
177
+ pasteIntoItem.addActionListener(this);
178
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
179
+ pasteLinkItem.addActionListener(this);
180
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
181
+ pasteCloneItem.addActionListener(this);
182
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
183
+// pasteExpandItem.addActionListener(this);
184
+ menu.add("-");
185
+ clearItem = menu.add(new MenuItem("Clear"));
186
+ clearItem.addActionListener(this);
187
+
188
+ if (Globals.ADVANCED)
189
+ {
190
+ // Deletes the cameras...
191
+ clearAllItem = menu.add(new MenuItem("Clear All"));
192
+ clearAllItem.addActionListener(this);
193
+ }
194
+
195
+ menuBar.add(cameraMenu = new Menu("View"));
196
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
197
+ //zBufferItem.addActionListener(this);
198
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199
+ //normalLensItem.addActionListener(this);
200
+ cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
+ revertCameraItem.addActionListener(this);
202
+
203
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
+ toggleFullScreenItem.addItemListener(this);
205
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
+ cameraMenu.add("-");
207
+
208
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
+ toggleTextureItem.addItemListener(this);
210
+ toggleTextureItem.setState(CameraPane.textureon);
211
+
212
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
+ toggleSwitchItem.addItemListener(this);
214
+ toggleSwitchItem.setState(CameraPane.SWITCH);
215
+
216
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
217
+ toggleHandleItem.addItemListener(this);
218
+ toggleHandleItem.setState(CameraPane.HANDLES);
219
+
220
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
221
+ togglePaintItem.addItemListener(this);
222
+ togglePaintItem.setState(CameraPane.PAINTMODE);
223
+
224
+ if (Globals.ADVANCED)
225
+ {
226
+ cameraMenu.add("-");
227
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
228
+ toggleLiveItem.addItemListener(this);
229
+ toggleLiveItem.setState(Globals.isLIVE());
230
+
231
+ cameraMenu.add(stepItem = new MenuItem("Step"));
232
+ stepItem.addActionListener(this);
233
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
234
+ // toggleDLItem.addItemListener(this);
235
+ // toggleDLItem.setState(false);
236
+
237
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
238
+ toggleRenderItem.addItemListener(this);
239
+ toggleRenderItem.setState(!CameraPane.frozen);
240
+
241
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242
+ toggleDebugItem.addItemListener(this);
243
+ toggleDebugItem.setState(CameraPane.DEBUG);
244
+
245
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246
+ toggleFrustumItem.addItemListener(this);
247
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
248
+
249
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
250
+ toggleFootContactItem.addItemListener(this);
251
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
252
+
253
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
254
+ toggleTimelineItem.addItemListener(this);
255
+ }
256
+
257
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
258
+// toggleRootItem.addItemListener(this);
259
+// toggleRootItem.setState(false);
260
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
261
+// animationItem.addItemListener(this);
262
+// animationItem.setState(CameraPane.ANIMATION);
263
+ cameraMenu.add("-");
264
+ cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
265
+ editCameraItem.addActionListener(this);
266
+
267
+ if (Globals.ADVANCED)
268
+ {
152269 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153270 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154271 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,44 +277,17 @@
160277 lookAtItem.addActionListener(this);
161278 //lookFromItem.addActinoListener(this);
162279 //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);
280
+ }
281
+
282
+ oe.menuBar.add(menu = new Menu("Setting"));
283
+ if (Globals.ADVANCED)
284
+ {
196285 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197286 revertMeshItem.addActionListener(this);
198287 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199288 resetreferencesItem.addActionListener(this);
200289 menu.add("-");
290
+ }
201291 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202292 overwriteGeoItem.addActionListener(this);
203293 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,47 +299,68 @@
209299 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210300 overwriteUVItem.addActionListener(this);
211301 menu.add("-");
302
+ if (Globals.ADVANCED)
303
+ {
212304 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213305 generateMeshItem.addActionListener(this);
214306 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215307 poseMeshItem.addActionListener(this);
216308 menu.add("-");
309
+ }
217310 resetsupportItem = menu.add(new MenuItem("Reset support"));
218311 resetsupportItem.addActionListener(this);
219312 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220313 linkverticesItem.addActionListener(this);
314
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
315
+ relinkverticesItem.addActionListener(this);
316
+
317
+ if (Globals.ADVANCED)
318
+ {
221319 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222320 setMasterItem.addActionListener(this);
321
+ }
223322
224
- oe.menuBar.add(menu = new Menu("Object"));
323
+ oe.menuBar.add(menu = new Menu("Group"));
225324 grabItem = menu.add(new MenuItem("Grab"));
226325 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229326 backItem = menu.add(new MenuItem("Back"));
230327 backItem.addActionListener(this);
328
+ frontItem = menu.add(new MenuItem("Front"));
329
+ frontItem.addActionListener(this);
231330 compositeItem = menu.add(new MenuItem("Composite"));
232331 compositeItem.addActionListener(this);
332
+ hideItem = menu.add(new MenuItem("Hidden Group"));
333
+ hideItem.addActionListener(this);
334
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
335
+ ungroupItem.addActionListener(this);
233336 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
337
+ randomItem = menu.add(new MenuItem("Switch node"));
235338 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);
240339 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241340 switchGeoItem.addActionListener(this);
242341 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243342 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
343
+ morphItem = menu.add(new MenuItem("Morph Group"));
245344 morphItem.addActionListener(this);
345
+
346
+ if (Globals.ADVANCED)
347
+ {
348
+ menu.add("-");
349
+ physicsItem = menu.add(new MenuItem("Physics"));
350
+ physicsItem.addActionListener(this);
351
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
352
+ frameselectorItem.addActionListener(this);
246353 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247354 scriptNodeItem.addActionListener(this);
248355 cameraItem = menu.add(new MenuItem("Camera"));
249356 cameraItem.addActionListener(this);
250
- menu.add("-");
357
+ }
358
+
359
+ oe.menuBar.add(menu = new Menu("Object"));
251360 textureItem = menu.add(new MenuItem("Texture"));
252361 textureItem.addActionListener(this);
362
+ billboardItem = menu.add(new MenuItem("Billboard"));
363
+ billboardItem.addActionListener(this);
253364 csgItem = menu.add(new MenuItem("CSG"));
254365 csgItem.addActionListener(this);
255366 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -258,23 +369,29 @@
258369 shadowYItem.addActionListener(this);
259370 shadowZItem = menu.add(new MenuItem("Shadow Z"));
260371 shadowZItem.addActionListener(this);
372
+ if (Globals.ADVANCED)
373
+ {
374
+ menu.add("-");
261375 linkerItem = menu.add(new MenuItem("Linker"));
262376 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265377 attributeItem = menu.add(new MenuItem("Attribute"));
266378 attributeItem.addActionListener(this);
379
+ templateItem = menu.add(new MenuItem("Template"));
380
+ templateItem.addActionListener(this);
267381 pointflowItem = menu.add(new MenuItem("Point Flow"));
268382 pointflowItem.addActionListener(this);
383
+ }
269384 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272385 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273386 resetTransformItem.addActionListener(this);
274387 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275388 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
389
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
390
+ resetCentroidXZItem.addActionListener(this);
391
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
392
+ transformGeometryItem.addActionListener(this);
393
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
394
+ transformChildrenItem.addActionListener(this);
278395
279396 oe.menuBar.add(menu = new Menu("Geometry"));
280397 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +400,13 @@
283400 genNormalsORGANItem.addActionListener(this);
284401 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285402 genNormalsCADItem.addActionListener(this);
403
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
404
+ genNormalsMESHItem.addActionListener(this);
405
+ if (Globals.ADVANCED)
406
+ {
407
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
408
+ genNormalsMINEItem.addActionListener(this);
409
+ }
286410 stripifyItem = menu.add(new MenuItem("Stripify"));
287411 stripifyItem.addActionListener(this);
288412 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +416,6 @@
292416 untrimItem = menu.add(new MenuItem("Untrim"));
293417 untrimItem.addActionListener(this);
294418 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297419 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298420 clearColorsItem.addActionListener(this);
299421 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +428,34 @@
306428 reduce34MeshItem.addActionListener(this);
307429 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308430 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311431 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312432 clipMeshItem.addActionListener(this);
433
+
434
+ if (Globals.ADVANCED)
435
+ {
436
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
437
+ smoothMeshItem.addActionListener(this);
438
+ }
439
+
440
+ oe.menuBar.add(menu = new Menu("Attributes"));
441
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
442
+ clearMaterialsItem.addActionListener(this);
443
+ resetAllItem = menu.add(new MenuItem("Reset All"));
444
+ resetAllItem.addActionListener(this);
445
+ stepAllItem = menu.add(new MenuItem("Step All"));
446
+ stepAllItem.addActionListener(this);
313447 menu.add("-");
314448 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315449 liveleavesItem.addActionListener(this);
316450 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317451 unliveleavesItem.addActionListener(this);
452
+ if (Globals.ADVANCED)
453
+ {
318454 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319455 supportleavesItem.addActionListener(this);
320456 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321457 unsupportleavesItem.addActionListener(this);
458
+ }
322459 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323460 hideleavesItem.addActionListener(this);
324461 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -332,27 +469,18 @@
332469 flipVItem.addActionListener(this);
333470 unflipVItem = menu.add(new MenuItem("Unflip V"));
334471 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
472
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336473 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
474
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338475 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
476
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340477 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
478
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342479 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
480
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344481 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
482
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346483 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);
356484
357485 oe.menuBar.add(menu = new Menu("Selection"));
358486 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +498,24 @@
370498 sortbysizeItem.addActionListener(this);
371499 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372500 sortbynameItem.addActionListener(this);
501
+ menu.add("-");
502
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
503
+ shareGeometriesItem.addActionListener(this);
504
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
505
+ mergeGeometriesItem.addActionListener(this);
506
+ if (Globals.ADVANCED)
507
+ {
508
+ // Pretty much the same as duplicate and clone.
509
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
510
+ extractGeometriesItem.addActionListener(this);
511
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
512
+ cloneGeometriesItem.addActionListener(this);
513
+ }
514
+
373515 oe.menuBar.add(menu = new Menu("Insert"));
374516 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
517
+
518
+ oe.menuBar.add(menu = new Menu("Tools"));
376519 buildToolsMenu(menu);
377520 }
378521
....@@ -406,150 +549,98 @@
406549 oe.radioPanel.add(dummyButton);
407550 oe.buttonGroup.add(dummyButton);
408551 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
552
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412553
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
554
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
555
+ liveCB.setToolTipText("Enable animation");
414556 liveCB.addItemListener(this);
415557
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);
558
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559
+ oneStepButton.setToolTipText("Animate one step forward");
560
+ oneStepButton.addActionListener(this);
561
+
562
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
563
+ fastCB.setToolTipText("Fast mode");
434564 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);
565
+
566
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
567
+ trackCB.setToolTipText("Enable tracking");
476568 trackCB.addItemListener(this);
477569
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
+ screenfitButton.setToolTipText("Screen fit");
480572 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
573
+
482574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483575 // 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;
488576
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);
577
+ if (Globals.ADVANCED)
578
+ {
579
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ snapobjectButton.addActionListener(this);
581
+ snapobjectButton.setToolTipText("Snap Object");
582
+ }
583
+
584
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ flashSelectionButton.setToolTipText("Show selection");
495586 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499587
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
589
+
590
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ twoButton.setToolTipText("Show center view only");
502592 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504594 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
595
+ fourButton.setToolTipText("Show left panel only");
596
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ sixButton.setToolTipText("2-column layout left");
506598 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ threeButton.setToolTipText("2-column layout right");
508601 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
602
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ sevenButton.setToolTipText("3-column layout");
510604 sevenButton.addActionListener(this);
511605 //
512606
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ rootButton.setToolTipText("Edit selection in new tab");
514609 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
610
+
611
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ closeButton.setToolTipText("Close tab");
517613 closeButton.addActionListener(this);
518614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519615 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521616
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
617
+ cGridBag commandsPanel = new cGridBag();
618
+
619
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ editButton.setToolTipText("Edit selection");
524621 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528622
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ uneditButton.setToolTipText("Unedit selection");
530625 uneditButton.addActionListener(this);
531626
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);
627
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
+ allParamsButton.setToolTipText("Edit all params");
544629 allParamsButton.addActionListener(this);
545630
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);
631
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ clearPanelButton.setToolTipText("Clear edit panel");
633
+ clearPanelButton.addActionListener(this);
634
+
635
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ unselectButton.setToolTipText("Unselect");
551637 unselectButton.addActionListener(this);
552638
639
+ commandsPanel.preferredHeight = 1;
640
+
641
+ oe.treePanel.add(commandsPanel);
642
+ oe.treePanel.Return();
643
+
553644 // oe.aConstraints.gridx += 1;
554645 // oe.aConstraints.weighty = 0;
555646 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +652,37 @@
561652 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562653 // gcButton.addActionListener(this);
563654
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;
655
+ cGridBag jSPPanel = new cGridBag();
656
+
657
+ JScrollPane jSP;
575658 //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);
659
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577660 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
661
+
662
+ oe.treePanel.add(jSPPanel);
663
+ oe.treePanel.Return();
582664
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);
665
+ cGridBag copyOptionsPanel = new cGridBag();
666
+
667
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
668
+ colorCB.setToolTipText("Copy color when dropped");
587669 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
670
+
671
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
672
+ materialCB.setToolTipText("Copy material when dropped");
590673 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
674
+
675
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
676
+ textureCB.setToolTipText("Copy texture when dropped");
593677 textureCB.addItemListener(this);
594678
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
679
+ copyOptionsPanel.preferredHeight = 1;
680
+ oe.treePanel.add(copyOptionsPanel);
681
+ oe.treePanel.Return();
597682
683
+// mainPanel.setDividerLocation(0.5); //1.0);
684
+// mainPanel.setResizeWeight(0.5);
685
+
598686 //jList.addListSelectionListener(this);
599687 oe.jTree.addTreeSelectionListener(this);
600688 //jTree.setRootVisible(false);
....@@ -616,18 +704,91 @@
616704 radio.layout = sevenButton;
617705 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618706 }
707
+
708
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
709
+ {
710
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
711
+ boxCB.setToolTipText("Display bounding boxes");
712
+ boxCB.addItemListener(this);
713
+
714
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
716
+ zoomBoxCB.addItemListener(this);
717
+
718
+ if (true) // Globals.ADVANCED)
719
+ {
720
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
+ supportCB.setToolTipText("Enable rigging");
722
+ supportCB.addItemListener(this);
723
+
724
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
725
+ // localCB.addItemListener(this);
726
+
727
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
728
+ crowdCB.setToolTipText("Used for crowds");
729
+ crowdCB.addItemListener(this);
730
+
731
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
732
+ smoothCB.setToolTipText("Snapping delay");
733
+ smoothCB.addItemListener(this);
734
+
735
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
736
+ slowCB.setToolTipText("Smooth interpolation");
737
+ slowCB.addItemListener(this);
738
+
739
+// constraints.gridy += 1;
740
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
741
+// speakerMocapCB.addItemListener(this);
742
+
743
+ if (false)
744
+ {
745
+ // handled in scripts
746
+ //constraints.gridy += 1;
747
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
748
+ speakerCameraCB.addItemListener(this);
749
+
750
+ //constraints.gridy += 1;
751
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
752
+ speakerFocusCB.addItemListener(this);
753
+
754
+ //constraints.gridy += 1;
755
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
756
+ smoothfocusCB.addItemListener(this);
757
+ }
758
+
759
+//constraints.gridx += 1;
760
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
761
+// debugCB.addItemListener(this);
762
+
763
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
764
+ oeilCB.addItemListener(this);
765
+
766
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
767
+ lookAtCB.setToolTipText("Look-at target");
768
+ lookAtCB.addItemListener(this);
769
+
770
+ }
771
+
772
+ cGridBag fill = new cGridBag();
773
+
774
+ fill.preferredHeight = 200;
775
+
776
+ panel.add(fill);
777
+
778
+ }
619779
620780 void EditObject(Object3D obj)
621781 {
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();
782
+ cRadio radioButton = new cRadio(obj.name);
783
+ radioButton.SetObject(obj);
784
+ radioButton.layout = sevenButton;
785
+ radioButton.SetCamera(cameraView.renderCamera, false);
786
+ radioButton.addActionListener(this);
787
+ radioPanel.add(radioButton);
788
+ buttonGroup.add(radioButton);
789
+ radioButton.doClick();
630790 }
791
+
631792 void SetupViews(ObjEditor oe)
632793 {
633794 oe.SetupViews();
....@@ -646,6 +807,7 @@
646807 JCheckBox fastCB;
647808 JCheckBox slowCB;
648809 JCheckBox boxCB;
810
+ JCheckBox zoomBoxCB;
649811 JCheckBox trackCB;
650812 JCheckBox smoothfocusCB;
651813 // JCheckBox speakerMocapCB;
....@@ -688,8 +850,7 @@
688850 dropAttributes |= Object3D.TEXTURE;
689851 else
690852 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
853
+ } else if(e.getSource() == liveCB)
693854 {
694855 cameraView.ToggleLive();
695856 }
....@@ -726,6 +887,10 @@
726887 Recompile();
727888 cameraView.repaint();
728889 // refreshContents();
890
+ }
891
+ else if(e.getSource() == zoomBoxCB)
892
+ {
893
+ cameraView.ToggleZoomBoxMode();
729894 }
730895 else if(e.getSource() == smoothfocusCB)
731896 {
....@@ -840,7 +1005,9 @@
8401005 // objEditor.DropFile((java.io.File[]) object, true);
8411006 // return;
8421007 // }
843
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441011 {
8451012 // file(s)
8461013 String[] names = string.split("\n");
....@@ -867,7 +1034,7 @@
8671034
8681035 flashIt = false;
8691036 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721039
8731040 if (group.selection.size() == 1)
....@@ -894,11 +1061,11 @@
8941061 {
8951062 loadClipboard(true);
8961063 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
1064
+ pasteInto(false, false);
8981065 } else {
8991066 loadClipboard(false);
9001067 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9021069 }
9031070 }
9041071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1169,8 @@
10021169
10031170 void buildCreateMenu(Menu menu)
10041171 {
1172
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1173
+ //heightFieldItem.addActionListener(this);
10051174 gridItem = menu.add(new MenuItem("Grid"));
10061175 gridItem.addActionListener(this);
10071176 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1183,37 @@
10141183 torusItem.addActionListener(this);
10151184 superItem = menu.add(new MenuItem("Superellipsoid"));
10161185 superItem.addActionListener(this);
1186
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1187
+ kleinItem.addActionListener(this);
10171188 particleItem = menu.add(new MenuItem("Particle system"));
10181189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10191192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201193 ragdollItem.addActionListener(this);
10211194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221195 ragdoll2Item.addActionListener(this);
1196
+ }
10231197 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251199 meshItem.addActionListener(this);
10261200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10281204 springItem = menu.add(new MenuItem("Spring"));
10291205 springItem.addActionListener(this);
10301206 flagItem = menu.add(new MenuItem("Flag"));
10311207 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);
10361208 blobItem = menu.add(new MenuItem("Blob"));
10371209 blobItem.addActionListener(this);
10381210 latheItem = menu.add(new MenuItem("Lathe"));
10391211 latheItem.addActionListener(this);
1212
+ }
1213
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1214
+ bezierItem.addActionListener(this);
1215
+ overlayItem = menu.add(new MenuItem("Overlay"));
1216
+ overlayItem.addActionListener(this);
10401217 lightItem = menu.add(new MenuItem("Light"));
10411218 lightItem.addActionListener(this);
10421219 menu.add("-");
....@@ -1046,41 +1223,39 @@
10461223 loopItem.addActionListener(this);
10471224 doubleItem = menu.add(new MenuItem("Fork"));
10481225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
10491228 tripleItem = menu.add(new MenuItem("Trident"));
10501229 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);
1230
+ }
10601231 }
10611232
10621233 void buildToolsMenu(Menu menu)
10631234 {
10641235 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651236 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1237
+ animationItem.setState(Globals.ANIMATION);
10671238
10681239 menu.add("-");
10691240 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701241 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1242
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1243
+ textureFieldItem.addActionListener(this);
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721245 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761247 reduceMorphItem.addActionListener(this);
10771248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781249 reduce34MorphItem.addActionListener(this);
1079
-
1250
+ menu.add("-");
10801251 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811252 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
10841259 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851260 memoryItem.addActionListener(this);
10861261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1094,6 +1269,8 @@
10941269 resetParentItem.addActionListener(this);
10951270 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961271 repairParentItem.addActionListener(this);
1272
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1273
+ repairShadowItem.addActionListener(this);
10971274 menu.add(invariantsItem = new MenuItem("Invariants"));
10981275 invariantsItem.addActionListener(this);
10991276 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1278,7 @@
11011278 menu.add("-");
11021279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031280 editScriptItem.addActionListener(this);
1281
+ }
11041282 }
11051283
11061284 void ScreenFit()
....@@ -1429,9 +1607,9 @@
14291607
14301608 void Overwrite(int mask)
14311609 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331611 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14351613
14361614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371615 content = ((cGroup)content).get(0);
....@@ -1454,6 +1632,7 @@
14541632 //
14551633 public void actionPerformed(ActionEvent event) // , Object arg)
14561634 {
1635
+ Object source = event.getSource();
14571636 /*
14581637 if (event.getSource() == nameField)
14591638 {
....@@ -1465,11 +1644,11 @@
14651644 }
14661645 else
14671646 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1647
+ if (source == lookAtItem || source == lookFromItem)
14691648 {
14701649 ScreenFit();
14711650 } else
1472
- if (event.getSource() == switchItem)
1651
+ if (source == switchItem)
14731652 {
14741653 cVector v1 = new cVector();
14751654 cVector v2 = new cVector();
....@@ -1478,11 +1657,11 @@
14781657 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791658 objEditor.cameraView.repaint();
14801659 } else
1481
- if (event.getSource() == rectoidItem)
1660
+ if (source == rectoidItem)
14821661 {
14831662 makeSomething(new Box());
14841663 } else
1485
- if (event.getSource() == particleItem)
1664
+ if (source == particleItem)
14861665 {
14871666 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881667 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1682,9 @@
15031682 applyExample(particleGeom, "SMOKE");
15041683 makeSomething(particleGeom);
15051684 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1685
+ if (source == ragdollItem || source == ragdoll2Item)
15071686 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1687
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091688
15101689 ragdoll.toParent = LA.newMatrix();
15111690 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1700,71 @@
15211700 makeSomething(ragdoll);
15221701 //makeSomething(new VehicleDemo());
15231702 } else
1524
- if (event.getSource() == gridItem)
1703
+ /*
1704
+ */
1705
+ if (source == heightFieldItem)
1706
+ {
1707
+ Object3D obj = new Object3D();
1708
+
1709
+ obj.CreateMaterial();
1710
+ obj.bRep = new BoundaryRep();
1711
+
1712
+ obj.bRep.CreateMesh(new iHeightField()
1713
+ {
1714
+ public double f(double x, double y)
1715
+ {
1716
+ // The Mandelbrot set is represented by coloring
1717
+ // each point (x,y) according to the number of
1718
+ // iterations it takes before the while loop in
1719
+ // this method ends. For points that are actually
1720
+ // in the Mandelbrot set, or very close to it, the
1721
+ // count will reach the maximum value, 80. These
1722
+ // points will be colored purple. All other colors
1723
+ // represent points that are definitely NOT in the set.
1724
+ x -= 600;
1725
+ y -= 500;
1726
+ x /= 200;
1727
+ y /= 200;
1728
+ int count = 0;
1729
+ double zx = x;
1730
+ double zy = y;
1731
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1732
+ double new_zx = zx*zx - zy*zy + x;
1733
+ zy = 2*zx*zy + y;
1734
+ zx = new_zx;
1735
+ count++;
1736
+ }
1737
+ return count; // Math.sqrt(count);
1738
+ }
1739
+ }, 1000,1000);
1740
+
1741
+ makeSomething(obj);
1742
+ } else
1743
+ if (source == gridItem)
15251744 {
15261745 makeSomething(new Grid());
15271746 } else
1528
- if (event.getSource() == ellipsoidItem)
1747
+ if (source == ellipsoidItem)
15291748 {
15301749 makeSomething(new Sphere());
15311750 } else
1532
- if (event.getSource() == coneItem)
1751
+ if (source == coneItem)
15331752 {
15341753 makeSomething(new Cone());
15351754 } else
1536
- if (event.getSource() == torusItem)
1755
+ if (source == torusItem)
15371756 {
15381757 makeSomething(new Torus());
15391758 } else
1540
- if (event.getSource() == superItem)
1759
+ if (source == superItem)
15411760 {
15421761 makeSomething(new Superellipsoid());
15431762 } else
1544
- if (event.getSource() == blobItem)
1763
+ if (source == kleinItem)
1764
+ {
1765
+ makeSomething(new Klein());
1766
+ } else
1767
+ if (source == blobItem)
15451768 {
15461769 Blob blob = new Blob();
15471770 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1772,15 @@
15491772 //blob.retile();
15501773 makeSomething(blob);
15511774 } else
1552
- if (event.getSource() == latheItem)
1775
+ if (source == latheItem)
15531776 {
15541777 makeSomething(new Lathe());
15551778 } else
1556
- if (event.getSource() == bezierItem)
1779
+ if (source == bezierItem)
15571780 {
15581781 makeSomething(new BezierSurface());
15591782 } else
1560
- if (event.getSource() == checkerItem)
1783
+ if (source == overlayItem)
15611784 {
15621785 /*
15631786 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1793,9 @@
15701793 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711794 LA.matInvert(obj.toParent, obj.fromParent);
15721795 */
1573
- makeSomething(new CheckerIG());
1796
+ makeSomething(new Checker());
15741797 } else
1575
- if (event.getSource() == meshItem)
1798
+ if (source == meshItem)
15761799 {
15771800 Object3D itemtomake = new Object3D();
15781801 Object3D child;
....@@ -1593,35 +1816,35 @@
15931816 makeSomething(child);
15941817 }
15951818 } else
1596
- if (event.getSource() == springItem)
1819
+ if (source == springItem)
15971820 {
15981821 cSpring s = new cSpring();
15991822 s.setup();
16001823 makeSomething(s);
16011824 } else
1602
- if (event.getSource() == flagItem)
1825
+ if (source == flagItem)
16031826 {
16041827 cSpring s = new cFlag();
16051828 s.setup();
16061829 makeSomething(s);
16071830 } else
1608
- if (event.getSource() == lightItem)
1831
+ if (source == lightItem)
16091832 {
16101833 makeSomething(new Light());
16111834 } else
1612
- if (event.getSource() == csgItem)
1835
+ if (source == csgItem)
16131836 {
16141837 group(new CSG());
16151838 } else
1616
- if (event.getSource() == templateItem)
1839
+ if (source == templateItem)
16171840 {
16181841 group(new cTemplate());
16191842 } else
1620
- if (event.getSource() == attributeItem)
1843
+ if (source == attributeItem)
16211844 {
16221845 makeSomething(new Attribute());
16231846 } else
1624
- if (event.getSource() == pointflowItem)
1847
+ if (source == pointflowItem)
16251848 {
16261849 makeSomething(new PointFlow());
16271850 } else
....@@ -1633,7 +1856,7 @@
16331856 } else
16341857 */
16351858
1636
- if (event.getSource() == superLoopItem)
1859
+ if (source == superLoopItem)
16371860 {
16381861 Composite g = new cGroup();
16391862 for (int i=0; i<15; i++)
....@@ -1655,7 +1878,7 @@
16551878
16561879 group(g);
16571880 } else
1658
- if (event.getSource() == loopItem)
1881
+ if (source == loopItem)
16591882 {
16601883 Composite csg = new GroupLeaf();
16611884 csg.count = 5;
....@@ -1664,7 +1887,7 @@
16641887 csg.addChild(child);
16651888 child.addChild(csg);
16661889 } else
1667
- if (event.getSource() == doubleItem)
1890
+ if (source == doubleItem)
16681891 {
16691892 Composite csg = new GroupLeaf();
16701893 csg.count = 5;
....@@ -1676,7 +1899,7 @@
16761899 csg.addChild(child);
16771900 child.addChild(csg);
16781901 } else
1679
- if (event.getSource() == tripleItem)
1902
+ if (source == tripleItem)
16801903 {
16811904 Composite csg = new GroupLeaf();
16821905 csg.count = 4;
....@@ -1691,71 +1914,59 @@
16911914 csg.addChild(child);
16921915 child.addChild(csg);
16931916 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
1917
+ if (source == computeAOItem)
16961918 {
1697
- ImportGFD();
1919
+ Globals.drawMode = CameraPane.OCCLUSION;
1920
+ Globals.theRenderer.repaint();
16981921 } 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)
1922
+ if (source == recompileItem)
17171923 {
17181924 Recompile();
17191925 refreshContents();
17201926 } else
1721
- if (event.getSource() == editScriptItem)
1927
+ if (source == editScriptItem)
17221928 {
17231929 OpenDialog();
17241930 refreshContents();
17251931 } else
1726
- if (event.getSource() == invariantsItem)
1932
+ if (source == invariantsItem)
17271933 {
17281934 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
17301936 } else
1731
- if (event.getSource() == memoryItem)
1937
+ if (source == memoryItem)
17321938 {
17331939 //System.out.println("Invariants:");
17341940 PrintMemory();
17351941 } else
1736
- if (event.getSource() == pathItem)
1942
+ if (source == pathItem)
17371943 {
17381944 PrintPath();
17391945 } else
1740
- if (event.getSource() == analyzeItem)
1946
+ if (source == analyzeItem)
17411947 {
17421948 AnalyzeObject();
17431949 } else
1744
- if (event.getSource() == dumpItem)
1950
+ if (source == dumpItem)
17451951 {
17461952 DumpObject();
17471953 } else
1748
- if (event.getSource() == screenfitButton)
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
1958
+ } else
1959
+ if (source == screenfitButton)
17491960 {
17501961 //Reload(lastConverter, lastFilename, true);
17511962 ScreenFit();
17521963 } else
1753
- if (event.getSource() == screenfitpointButton)
1964
+ if (source == screenfitpointButton)
17541965 {
17551966 //Reload(lastConverter, lastFilename, true);
17561967 ScreenFitPoint();
17571968 } else
1758
- if (event.getSource() == snapobjectButton)
1969
+ if (source == snapobjectButton)
17591970 {
17601971 //Reload(lastConverter, lastFilename, true);
17611972 SnapObject();
....@@ -1766,13 +1977,13 @@
17661977 // Recompile();
17671978 // refreshContents();
17681979 // } else
1769
- if (event.getSource() == gcButton)
1980
+ if (source == gcButton)
17701981 {
17711982 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17721983 System.gc();
17731984 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17741985 } else
1775
- if (event.getSource() == editLeafItem)
1986
+ if (source == editLeafItem)
17761987 {
17771988 Object3D obj;
17781989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +1997,70 @@
17861997 }
17871998 refreshContents(true);
17881999 } else
1789
- if (event.getSource() == openWindowItem)
2000
+ if (source == openWindowItem)
17902001 {
17912002 EditSelection(true);
17922003 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2004
+ if (source == cutItem || source == clearButton)
17942005 {
17952006 loadClipboard(true);
17962007 } else
1797
- if (event.getSource() == duplicateItem)
2008
+ if (source == duplicateItem)
17982009 {
1799
- Object3D keep = GraphreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18002011 loadClipboard(false);
18012012 paste(false);
1802
- GraphreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18032014 } else
1804
- if (event.getSource() == cloneItem)
2015
+ if (source == cloneItem)
18052016 {
18062017 CloneSelection(false);
18072018 } else
1808
- if (event.getSource() == cloneSupportItem)
2019
+ if (source == cloneSupportItem)
18092020 {
18102021 CloneSelection(true);
18112022 } else
1812
- if (event.getSource() == copyItem)
2023
+ if (source == copyItem)
18132024 {
18142025 loadClipboard(false);
18152026 } else
1816
- if (event.getSource() == pasteItem)
2027
+ if (source == pasteItem)
18172028 {
18182029 paste(false);
18192030 } else
1820
- if (event.getSource() == pasteLinkItem)
2031
+ if (source == pasteIntoItem)
18212032 {
1822
- pasteInto(false);
2033
+ pasteInto(true, false);
18232034 } else
1824
- if (event.getSource() == pasteCloneItem)
2035
+ if (source == pasteLinkItem)
18252036 {
1826
- pasteInto(true);
2037
+ pasteInto(false, false);
18272038 } else
1828
- if (event.getSource() == pasteExpandItem)
2039
+ if (source == pasteCloneItem)
2040
+ {
2041
+ pasteInto(true, true);
2042
+ } else
2043
+ if (source == pasteExpandItem)
18292044 {
18302045 paste(true);
18312046 } else
1832
- if (event.getSource() == synchronizeItem)
2047
+ if (source == synchronizeItem)
18332048 {
18342049 Overwrite(Object3D.TRANSFORM);
18352050 } else
1836
- if (event.getSource() == overwriteNameItem)
2051
+ if (source == overwriteNameItem)
18372052 {
18382053 Overwrite(Object3D.NAME);
18392054 } else
1840
- if (event.getSource() == overwriteUVItem)
2055
+ if (source == overwriteUVItem)
18412056 {
18422057 Overwrite(Object3D.UV);
18432058 } else
1844
- if (event.getSource() == overwriteMatItem)
2059
+ if (source == overwriteMatItem)
18452060 {
2061
+ /* july 2015
18462062 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2063
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482064 else
18492065 {
18502066 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2072,16 @@
18562072 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572073 }
18582074 }
2075
+ */
2076
+
2077
+ Overwrite(dropAttributes);
18592078 }
1860
- if (event.getSource() == overwriteGeoItem)
2079
+ if (source == overwriteGeoItem)
18612080 {
18622081 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2082
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642083 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2084
+// Object3D content = GrafreeD.clipboard.get(0);
18662085 //
18672086 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682087 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2093,7 @@
18742093 // refreshContents();
18752094 // }
18762095 } else
1877
- if (event.getSource() == generateMeshItem)
2096
+ if (source == generateMeshItem)
18782097 {
18792098 //if (group.selection.size() == 1)
18802099 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2104,7 @@
18852104 ResetModel();
18862105 refreshContents();
18872106 } else
1888
- if (event.getSource() == extractGeometriesItem)
2107
+ if (source == extractGeometriesItem)
18892108 {
18902109 boolean one = false;
18912110
....@@ -1912,7 +2131,7 @@
19122131 ResetModel();
19132132 refreshContents();
19142133 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2134
+ if (source == cloneGeometriesItem)
19162135 {
19172136 boolean one = false;
19182137
....@@ -1938,32 +2157,37 @@
19382157 ResetModel();
19392158 refreshContents();
19402159 } else
1941
- if (event.getSource() == shareGeometriesItem)
2160
+ if (source == shareGeometriesItem)
19422161 {
19432162 boolean one = false;
19442163
19452164 if (group.selection.size() == 1)
19462165 one = true;
19472166
2167
+ Object3D merge = null;
2168
+
19482169 Object3D content = new cGroup();
19492170
19502171 for (int i=0; i<group.selection.size(); i++)
19512172 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2173
+ merge = new Merge(group.selection.get(i));
19532174
19542175 if (one)
1955
- makeSomething(sel, false);
2176
+ makeSomething(merge, false);
19562177 else
1957
- content.addChild(sel);
2178
+ content.addChild(merge);
19582179 }
19592180
19602181 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2182
+ makeSomething(content, true);
2183
+ else
2184
+ {
2185
+ ResetModel();
2186
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2187
+ refreshContents();
2188
+ }
19652189 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2190
+ if (source == mergeGeometriesItem)
19672191 {
19682192 boolean one = false;
19692193
....@@ -1993,11 +2217,11 @@
19932217 ResetModel();
19942218 refreshContents();
19952219 } else
1996
- if (event.getSource() == linkverticesItem)
2220
+ if (source == linkverticesItem)
19972221 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2222
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992223 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2224
+// Object3D content = GrafreeD.clipboard.get(0);
20012225 //
20022226 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032227 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2230,48 @@
20062230 // group.selection.get(0).setMasterThis(content); // should be identity
20072231 // refreshContents();
20082232 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102234 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
20122236
20132237 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142238 content = ((cGroup)content).get(0);
20152239
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2240
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172241 for (int i=0; i<group.selection.size(); i++)
20182242 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
20212245 group.selection.get(i).linkVerticesThis(content);
20222246 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
20242248 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2249
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262250 refreshContents();
20272251 }
20282252 } else
2029
- if (event.getSource() == resetsupportItem)
2253
+ if (source == resetsupportItem)
20302254 {
20312255 for (int i=0; i<group.selection.size(); i++)
20322256 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
20352259 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
20372261 }
20382262
20392263 refreshContents();
20402264 } else
2041
- if (event.getSource() == resetreferencesItem)
2265
+ if (source == relinkverticesItem)
2266
+ {
2267
+ boolean random = CameraPane.SWITCH;
2268
+ CameraPane.SWITCH = false; // parse all random nodes
2269
+ group.selection.RelinkToSupport();
2270
+ CameraPane.SWITCH = random;
2271
+
2272
+ refreshContents();
2273
+ } else
2274
+ if (source == resetreferencesItem)
20422275 {
20432276 for (int i=0; i<group.selection.size(); i++)
20442277 {
....@@ -2047,11 +2280,11 @@
20472280
20482281 refreshContents();
20492282 } else
2050
- if (event.getSource() == setMasterItem)
2283
+ if (source == setMasterItem)
20512284 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532286 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
20552288
20562289 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572290 content = ((cGroup)content).get(0);
....@@ -2060,13 +2293,13 @@
20602293 refreshContents();
20612294 }
20622295 } else
2063
- if (event.getSource() == poseMeshItem)
2296
+ if (source == poseMeshItem)
20642297 {
20652298 if (group.selection.size() == 1)
20662299 {
2067
- if (GraphreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
20682301 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
20702303
20712304 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722305 content = ((cGroup)content).get(0);
....@@ -2079,19 +2312,19 @@
20792312 }
20802313
20812314 } else
2082
- if (event.getSource() == revertMeshItem)
2315
+ if (source == revertMeshItem)
20832316 {
20842317 RevertMeshes();
20852318 } else
2086
- if (event.getSource() == resetMeshItem)
2319
+ if (source == resetAllItem)
20872320 {
20882321 ResetAll();
20892322 } else
2090
- if (event.getSource() == stepAllItem)
2323
+ if (source == stepAllItem)
20912324 {
20922325 StepAll();
20932326 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2327
+ if (source == clearItem) // || event.getSource() == clearButton)
20952328 {
20962329 //int indices[] = jList.getSelectedIndices();
20972330 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2332,46 @@
20992332
21002333 ClearSelection(false);
21012334 } else
2102
- if (event.getSource() == clearAllItem)
2335
+ if (source == clearAllItem)
21032336 {
21042337 ClearSelection(true);
21052338 } else
2106
- if (event.getSource() == grabItem)
2339
+ if (source == grabItem)
21072340 {
21082341 group(new cGroup(), true);
21092342 } else
2110
- if (event.getSource() == frontItem)
2343
+ if (source == hideItem)
2344
+ {
2345
+ group(new HiddenObject());
2346
+ } else
2347
+ if (source == frontItem)
21112348 {
21122349 front();
21132350 } else
2114
- if (event.getSource() == backItem)
2351
+ if (source == backItem)
21152352 {
21162353 back();
21172354 } else
2118
- if (event.getSource() == cameraItem)
2355
+ if (source == cameraItem)
21192356 {
21202357 makeSomething(new Camera());
21212358 } else
2122
- if (event.getSource() == compositeItem)
2359
+ if (source == compositeItem)
21232360 {
21242361 group(new Composite());
21252362 } else
2126
- if (event.getSource() == randomItem)
2363
+ if (source == randomItem)
21272364 {
21282365 RandomNode random = new RandomNode();
21292366 group(random);
21302367 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
21322369 } else
2133
- if (event.getSource() == physicsItem)
2370
+ if (source == physicsItem)
21342371 {
21352372 group(new PhysicsNode());
21362373 } else
2137
- if (event.getSource() == frameselectorItem)
2374
+ if (source == frameselectorItem)
21382375 {
21392376 for (int i=0; i<group.selection.size(); i++)
21402377 {
....@@ -2146,7 +2383,7 @@
21462383 ResetModel();
21472384 refreshContents();
21482385 } else
2149
- if (event.getSource() == switchGeoItem)
2386
+ if (source == switchGeoItem)
21502387 {
21512388 for (int i=0; i<group.selection.size(); i++)
21522389 {
....@@ -2158,7 +2395,7 @@
21582395 ResetModel();
21592396 refreshContents();
21602397 } else
2161
- if (event.getSource() == switchTransfoItem)
2398
+ if (source == switchTransfoItem)
21622399 {
21632400 for (int i=0; i<group.selection.size(); i++)
21642401 {
....@@ -2170,7 +2407,7 @@
21702407 ResetModel();
21712408 refreshContents();
21722409 } else
2173
- if (event.getSource() == morphItem)
2410
+ if (source == morphItem)
21742411 {
21752412 for (int i=0; i<group.selection.size(); i++)
21762413 {
....@@ -2182,7 +2419,7 @@
21822419 ResetModel();
21832420 refreshContents();
21842421 } else
2185
- if (event.getSource() == scriptNodeItem)
2422
+ if (source == scriptNodeItem)
21862423 {
21872424 boolean atleastone = false;
21882425
....@@ -2221,191 +2458,223 @@
22212458 }
22222459 }
22232460 } else
2224
- if (event.getSource() == linkerItem)
2461
+ if (source == linkerItem)
22252462 {
22262463 group(new cLinker());
22272464 } else
2228
- if (event.getSource() == textureItem)
2465
+ if (source == textureItem)
22292466 {
22302467 group(new TextureNode());
22312468 } else
2232
- if (event.getSource() == shadowXItem)
2469
+ if (source == billboardItem)
2470
+ {
2471
+ group(new BillboardNode());
2472
+ } else
2473
+ if (source == shadowXItem)
22332474 {
22342475 CastShadow(0);
22352476 } else
2236
- if (event.getSource() == shadowYItem)
2477
+ if (source == shadowYItem)
22372478 {
22382479 CastShadow(1);
22392480 } else
2240
- if (event.getSource() == shadowZItem)
2481
+ if (source == shadowZItem)
22412482 {
22422483 CastShadow(2);
22432484 } else
2244
- if (event.getSource() == ungroupItem)
2485
+ if (source == ungroupItem)
22452486 {
2246
- ungroup();
2487
+ //ungroup();
2488
+ for (int i=0; i<group.selection.size(); i++)
2489
+ {
2490
+ Ungroup(group.selection.get(i));
2491
+ }
2492
+
2493
+ ClearSelection(false);
2494
+
2495
+ refreshContents();
22472496 } else
2248
- if (event.getSource() == genUVItem)
2497
+ if (source == genUVItem)
22492498 {
22502499 GenUV();
22512500 } else
2252
- if (event.getSource() == genNormalsCADItem)
2501
+ if (source == genNormalsCADItem)
22532502 {
22542503 GenNormals(true);
22552504 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2505
+ if (source == genNormalsMESHItem)
2506
+ {
2507
+ GenNormals(true); // TODO
2508
+ } else
2509
+ if (source == genNormalsORGANItem)
22572510 {
22582511 GenNormals(false);
22592512 } else
2260
- if (event.getSource() == stripifyItem)
2513
+ if (source == genNormalsMINEItem)
2514
+ {
2515
+ GenNormalsMINE();
2516
+ } else
2517
+ if (source == stripifyItem)
22612518 {
22622519 Stripify();
22632520 } else
2264
- if (event.getSource() == unstripifyItem)
2521
+ if (source == unstripifyItem)
22652522 {
22662523 Unstripify();
22672524 } else
2268
- if (event.getSource() == trimItem)
2525
+ if (source == trimItem)
22692526 {
22702527 Trim();
22712528 } else
2272
- if (event.getSource() == untrimItem)
2529
+ if (source == untrimItem)
22732530 {
22742531 Untrim();
22752532 } else
2276
- if (event.getSource() == clearColorsItem)
2533
+ if (source == clearColorsItem)
22772534 {
22782535 ClearColors();
22792536 } else
2280
- if (event.getSource() == clearMaterialsItem)
2537
+ if (source == clearMaterialsItem)
22812538 {
22822539 ClearMaterials();
22832540 } else
2284
- if (event.getSource() == liveleavesItem)
2541
+ if (source == liveleavesItem)
22852542 {
22862543 LiveLeaves(true);
22872544 } else
2288
- if (event.getSource() == unliveleavesItem)
2545
+ if (source == unliveleavesItem)
22892546 {
22902547 LiveLeaves(false);
22912548 } else
2292
- if (event.getSource() == supportleavesItem)
2549
+ if (source == supportleavesItem)
22932550 {
22942551 SupportLeaves(true);
22952552 } else
2296
- if (event.getSource() == unsupportleavesItem)
2553
+ if (source == unsupportleavesItem)
22972554 {
22982555 SupportLeaves(false);
22992556 } else
2300
- if (event.getSource() == hideleavesItem)
2557
+ if (source == hideleavesItem)
23012558 {
23022559 HideLeaves(true);
23032560 } else
2304
- if (event.getSource() == showleavesItem)
2561
+ if (source == showleavesItem)
23052562 {
23062563 HideLeaves(false);
23072564 } else
2308
- if (event.getSource() == markleavesItem)
2565
+ if (source == markleavesItem)
23092566 {
23102567 MarkLeaves(true);
23112568 } else
2312
- if (event.getSource() == unmarkleavesItem)
2569
+ if (source == unmarkleavesItem)
23132570 {
23142571 MarkLeaves(false);
23152572 } else
2316
- if (event.getSource() == flipVItem)
2573
+ if (source == flipVItem)
23172574 {
23182575 FlipV(true);
23192576 } else
2320
- if (event.getSource() == unflipVItem)
2577
+ if (source == unflipVItem)
23212578 {
23222579 FlipV(false);
23232580 } else
2324
- if (event.getSource() == lowTexturesItem)
2581
+ if (source == lowTexturesItem)
23252582 {
23262583 SetTexRes(0);
23272584 } else
2328
- if (event.getSource() == normalTexturesItem)
2585
+ if (source == normalTexturesItem)
23292586 {
23302587 SetTexRes(1);
23312588 } else
2332
- if (event.getSource() == highTexturesItem)
2589
+ if (source == highTexturesItem)
23332590 {
23342591 SetTexRes(2);
23352592 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2593
+ if (source == veryhighTexturesItem)
23372594 {
23382595 SetTexRes(3);
23392596 } else
2340
- if (event.getSource() == maxTexturesItem)
2597
+ if (source == maxTexturesItem)
23412598 {
23422599 SetTexRes(4);
23432600 } else
2344
- if (event.getSource() == panoTexturesItem)
2601
+ if (source == panoTexturesItem)
23452602 {
23462603 SetTexRes(5);
23472604 } else
2348
- if (event.getSource() == reverseNormalsItem)
2605
+ if (source == reverseNormalsItem)
23492606 {
23502607 ReverseNormals();
23512608 } else
2352
- if (event.getSource() == parseverticesItem)
2609
+ if (source == parseverticesItem)
23532610 {
23542611 ParseVertices();
23552612 } else
2356
- if (event.getSource() == alignItem)
2613
+ if (source == textureFieldItem)
2614
+ {
2615
+ TextureVertices();
2616
+ } else
2617
+ if (source == alignItem)
23572618 {
23582619 Align();
23592620 } else
2360
- if (event.getSource() == mirrorItem)
2621
+ if (source == mirrorItem)
23612622 {
23622623 MirrorPoses();
23632624 } else
2364
- if (event.getSource() == reduceMorphItem)
2625
+ if (source == reduceMorphItem)
23652626 {
23662627 MeshReduction(false);
23672628 } else
2368
- if (event.getSource() == reduce34MorphItem)
2629
+ if (source == reduce34MorphItem)
23692630 {
23702631 MeshReduction(true);
23712632 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2633
+ if (source == reverseTrianglesItem)
23732634 {
23742635 ReverseTriangles();
23752636 } else
2376
- if (event.getSource() == reduceMeshItem)
2637
+ if (source == reduceMeshItem)
23772638 {
23782639 ReduceMesh(false);
23792640 } else
2380
- if (event.getSource() == reduce34MeshItem)
2641
+ if (source == reduce34MeshItem)
23812642 {
23822643 ReduceMesh(true);
23832644 } else
2384
- if (event.getSource() == increaseMeshItem)
2645
+ if (source == increaseMeshItem)
23852646 {
23862647 IncreaseMesh();
23872648 } else
2388
- if (event.getSource() == clipMeshItem)
2649
+ if (source == clipMeshItem)
23892650 {
23902651 ClipMesh();
23912652 } else
2392
- if (event.getSource() == smoothMeshItem)
2653
+ if (source == smoothMeshItem)
23932654 {
23942655 SmoothMesh();
23952656 } else
2396
- if (event.getSource() == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
23972658 {
23982659 TransformGeometry();
23992660 } else
2400
- if (event.getSource() == resetTransformItem)
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
2664
+ } else
2665
+ if (source == resetTransformItem)
24012666 {
24022667 ResetTransform();
24032668 } else
2404
- if (event.getSource() == resetCentroidItem)
2669
+ if (source == resetCentroidItem)
24052670 {
2406
- ResetCentroid();
2671
+ ResetCentroid(true);
24072672 } else
2408
- if (event.getSource() == resetParentItem)
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
2676
+ } else
2677
+ if (source == resetParentItem)
24092678 {
24102679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112680 {
....@@ -2415,7 +2684,7 @@
24152684
24162685 refreshContents();
24172686 } else
2418
- if (event.getSource() == repairParentItem)
2687
+ if (source == repairParentItem)
24192688 {
24202689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212690 {
....@@ -2429,7 +2698,21 @@
24292698
24302699 refreshContents();
24312700 } else
2432
- if (event.getSource() == sortbysizeItem)
2701
+ if (source == repairShadowItem)
2702
+ {
2703
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2704
+ {
2705
+ Object3D obj = (Object3D)e.nextElement();
2706
+ obj.RepairShadow();
2707
+// for (int i=0; i<obj.size(); i++)
2708
+// {
2709
+// obj.get(i).parent = obj;
2710
+// }
2711
+ }
2712
+
2713
+ refreshContents();
2714
+ } else
2715
+ if (source == sortbysizeItem)
24332716 {
24342717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352718 {
....@@ -2441,7 +2724,7 @@
24412724 ResetModel();
24422725 refreshContents();
24432726 } else
2444
- if (event.getSource() == sortbynameItem)
2727
+ if (source == sortbynameItem)
24452728 {
24462729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472730 {
....@@ -2453,7 +2736,7 @@
24532736 ResetModel();
24542737 refreshContents();
24552738 } else
2456
- if (event.getSource() == attachPigmentItem)
2739
+ if (source == attachPigmentItem)
24572740 {
24582741 String texture = GetFile("Attach pigment");
24592742 Object3D obj;
....@@ -2465,7 +2748,7 @@
24652748
24662749 refreshContents();
24672750 } else
2468
- if (event.getSource() == detachPigmentItem)
2751
+ if (source == detachPigmentItem)
24692752 {
24702753 Object3D obj;
24712754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2759,7 @@
24762759
24772760 refreshContents();
24782761 } else
2479
- if (event.getSource() == attachBumpItem)
2762
+ if (source == attachBumpItem)
24802763 {
24812764 String texture = GetFile("Attach bump");
24822765 Object3D obj;
....@@ -2488,7 +2771,7 @@
24882771
24892772 refreshContents();
24902773 } else
2491
- if (event.getSource() == detachBumpItem)
2774
+ if (source == detachBumpItem)
24922775 {
24932776 Object3D obj;
24942777 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2782,7 @@
24992782
25002783 refreshContents();
25012784 } else
2502
- if (event.getSource() == pigmentBumpItem)
2785
+ if (source == pigmentBumpItem)
25032786 {
25042787 Object3D obj;
25052788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2793,195 @@
25102793
25112794 refreshContents();
25122795 } else
2513
- if (event.getSource() == flashSelectionButton)
2796
+ if (source == flashSelectionButton)
25142797 {
25152798 CameraPane.flash = true;
25162799 refreshContents();
25172800 } else
2518
- if (event.getSource() == oneButton)
2801
+ if (source == oneButton)
25192802 {
25202803 } else
2521
- if (event.getSource() == twoButton)
2804
+ if (source == twoButton)
25222805 {
25232806 radio.layout = twoButton;
25242807 // bug
25252808 //gridPanel.setDividerLocation(1.0);
25262809 //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();
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// //bigThree.add(XYZPanel, aWindowConstraints);
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(false);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.FlushUI();
25512839 } else
2552
- if (event.getSource() == threeButton)
2840
+ if (source == threeButton)
25532841 {
25542842 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();
2843
+
2844
+// bigThree.remove(scenePanel);
2845
+// bigThree.remove(centralPanel);
2846
+// bigThree.remove(XYZPanel);
2847
+// aWindowConstraints.gridx = 0;
2848
+// aWindowConstraints.gridy = 0;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// aWindowConstraints.weightx = 0;
2853
+// aWindowConstraints.weighty = 1;
2854
+// //bigThree.add(jtp, aWindowConstraints);
2855
+// aWindowConstraints.weightx = 1;
2856
+// aWindowConstraints.gridwidth = 3;
2857
+// // aConstraints.gridheight = 3;
2858
+// aWindowConstraints.gridx = 1;
2859
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2860
+// bigThree.add(centralPanel, aWindowConstraints);
2861
+// aWindowConstraints.weightx = 0;
2862
+// aWindowConstraints.gridx = 4;
2863
+// aWindowConstraints.gridwidth = 1;
2864
+// // aConstraints.gridheight = 3;
2865
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2866
+// bigThree.add(XYZPanel, aWindowConstraints);
2867
+// bigThree.validate();
2868
+// scenePanel.setVisible(false);
2869
+// centralPanel.setVisible(true);
2870
+// XYZPanel.setVisible(true);
2871
+ bigThree.ClearUI();
2872
+ bigThree.add(centralPanel);
2873
+ bigThree.add(XYZPanel);
2874
+ bigThree.FlushUI();
25792875 } else
2580
- if (event.getSource() == fourButton)
2876
+ if (source == fourButton)
25812877 {
25822878 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();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aWindowConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2888
+// aWindowConstraints.weightx = 1;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// //bigThree.add(cameraPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aWindowConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(false);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.FlushUI();
26072910 } else
2608
- if (event.getSource() == sixButton)
2911
+ if (source == sixButton)
26092912 {
26102913 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();
2914
+
2915
+// bigThree.remove(scenePanel);
2916
+// bigThree.remove(centralPanel);
2917
+// bigThree.remove(XYZPanel);
2918
+// aWindowConstraints.gridx = 0;
2919
+// aWindowConstraints.gridy = 0;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// aWindowConstraints.weightx = 0;
2924
+// aWindowConstraints.weighty = 1;
2925
+// bigThree.add(scenePanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.gridwidth = 3;
2928
+// // aWindowConstraints.gridheight = 3;
2929
+// aWindowConstraints.gridx = 1;
2930
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2931
+// bigThree.add(centralPanel, aWindowConstraints);
2932
+// aWindowConstraints.weightx = 0;
2933
+// aWindowConstraints.gridx = 4;
2934
+// aWindowConstraints.gridwidth = 1;
2935
+// // aWindowConstraints.gridheight = 3;
2936
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2937
+// //bigThree.add(XYZPanel, aConstraints);
2938
+// bigThree.validate();
2939
+// scenePanel.setVisible(true);
2940
+// centralPanel.setVisible(true);
2941
+// XYZPanel.setVisible(false);
2942
+ bigThree.ClearUI();
2943
+ bigThree.add(scenePanel);
2944
+ bigThree.add(centralPanel);
2945
+ bigThree.FlushUI();
26352946 } else
2636
- if (event.getSource() == sevenButton)
2947
+ if (source == sevenButton)
26372948 {
26382949 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();
2950
+
2951
+// bigThree.remove(scenePanel);
2952
+// bigThree.remove(centralPanel);
2953
+// bigThree.remove(XYZPanel);
2954
+// aWindowConstraints.gridx = 0;
2955
+// aWindowConstraints.gridy = 0;
2956
+// aWindowConstraints.gridwidth = 1;
2957
+// // aWindowConstraints.gridheight = 3;
2958
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2959
+// aWindowConstraints.weightx = 0;
2960
+// aWindowConstraints.weighty = 1;
2961
+// bigThree.add(scenePanel, aWindowConstraints);
2962
+// aWindowConstraints.weightx = 1;
2963
+// aWindowConstraints.gridwidth = 3;
2964
+// // aWindowConstraints.gridheight = 3;
2965
+// aWindowConstraints.gridx = 1;
2966
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2967
+// bigThree.add(centralPanel, aWindowConstraints);
2968
+// aWindowConstraints.weightx = 0;
2969
+// aWindowConstraints.gridx = 4;
2970
+// aWindowConstraints.gridwidth = 1;
2971
+// // aConstraints.gridheight = 3;
2972
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2973
+// bigThree.add(XYZPanel, aWindowConstraints);
2974
+// bigThree.validate();
2975
+// scenePanel.setVisible(true);
2976
+// centralPanel.setVisible(true);
2977
+// XYZPanel.setVisible(true);
2978
+ bigThree.ClearUI();
2979
+ bigThree.add(scenePanel);
2980
+ bigThree.add(centralPanel);
2981
+ bigThree.add(XYZPanel);
2982
+ bigThree.FlushUI();
26632983 } else
2664
- if (event.getSource() == rootButton)
2984
+ if (source == rootButton)
26652985 {
26662986 Object3D obj;
26672987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +2993,7 @@
26732993
26742994 refreshContents(true);
26752995 } else
2676
- if (event.getSource() == closeButton)
2996
+ if (source == closeButton)
26772997 {
26782998 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26792999 cRadio ab;
....@@ -2694,11 +3014,11 @@
26943014 }
26953015 refreshContents(true);
26963016 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3017
+ if (source == editItem || source == editButton)
26983018 {
26993019 EditSelection(false);
27003020 } else
2701
- if (event.getSource() == uneditButton)
3021
+ if (source == uneditButton)
27023022 {
27033023 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043024 {
....@@ -2710,12 +3030,12 @@
27103030
27113031 child.editWindow = null; // ???????????
27123032 }
2713
- objEditor.ctrlPanel.revalidate();
3033
+ objEditor.ctrlPanel.FlushUI();
27143034 //objEditor.jTree.clearSelection();
27153035 //objEditor.ResetSliders();
27163036 refreshContents(true);
27173037 } else
2718
- if (event.getSource() == clearPanelButton)
3038
+ if (source == clearPanelButton)
27193039 {
27203040 assert(copy == group);
27213041 //copy.ClearUI();
....@@ -2726,7 +3046,7 @@
27263046 listUI.clear();
27273047 refreshContents(true);
27283048 } else
2729
- if (event.getSource() == allParamsButton)
3049
+ if (source == allParamsButton)
27303050 {
27313051 assert(copy == group);
27323052
....@@ -2747,19 +3067,19 @@
27473067
27483068 refreshContents(true);
27493069 } else
2750
- if (event.getSource() == unselectButton)
3070
+ if (source == unselectButton)
27513071 {
27523072 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3073
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543074 objEditor.ResetSliders();
27553075 refreshContents(true);
27563076 } else
2757
- if(event.getSource() instanceof cRadio)
3077
+ if(source instanceof cRadio)
27583078 {
27593079 group.parent = keepparent;
27603080 group.attributes = 0;
27613081 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3082
+ /*cRadio*/ radio = (cRadio)source;
27633083 Object3D obj = radio.GetObject();
27643084 System.out.println("Edit " + obj);
27653085 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3099,7 @@
27793099 }
27803100
27813101 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3102
+ //Globals.theRenderer.object = group;
27833103 if(!useclient)
27843104 {
27853105 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3108,15 @@
27883108 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893109 cameraView.targetLookAt.set(radio.camera.lookAt);
27903110 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3111
+ //cameraView.lighttouched = true;
3112
+ Globals.lighttouched = true;
27923113 topView.object = group;
27933114 frontView.object = group;
27943115 sideView.object = group;
27953116 }
2796
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
27973120 /*
27983121 currentLayout = radio.layout;
27993122 if (currentLayout == null)
....@@ -2806,7 +3129,20 @@
28063129 //group.attributes = -1;
28073130 ResetModel();
28083131 refreshContents(true);
2809
- }
3132
+ } else if (event.getSource() == editCameraItem)
3133
+ {
3134
+ cameraView.ProtectCamera();
3135
+ cameraView.repaint();
3136
+ return;
3137
+ } else if (event.getSource() == revertCameraItem)
3138
+ {
3139
+ cameraView.RevertCamera();
3140
+ cameraView.repaint();
3141
+ return;
3142
+ // } else if (event.getSource() == textureButton)
3143
+ // {
3144
+ // return; // true;
3145
+ }
28103146 else
28113147 {
28123148 //return super.action(event, arg);
....@@ -2824,7 +3160,7 @@
28243160 if (useclient)
28253161 {
28263162 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3163
+ Globals.lighttouched = true;
28283164 //topView.object = client;
28293165 //frontView.object = client;
28303166 //sideView.object = client;
....@@ -2832,7 +3168,7 @@
28323168 else
28333169 {
28343170 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3171
+ Globals.lighttouched = true;
28363172 //topView.object = group;
28373173 //frontView.object = group;
28383174 //sideView.object = group;
....@@ -2867,6 +3203,28 @@
28673203 refreshContents();
28683204 }
28693205
3206
+ void TransformChildren()
3207
+ {
3208
+ Object3D obj;
3209
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3210
+ {
3211
+ obj = (Object3D)e.nextElement();
3212
+ obj.KeepTextureMatrices();
3213
+ obj.TransformChildren();
3214
+ obj.RestoreTextureMatrices();
3215
+
3216
+// if (obj.parent == null)
3217
+// {
3218
+// System.out.println("NULL PARENT!");
3219
+// new Exception().printStackTrace();
3220
+// }
3221
+// else
3222
+// TouchTransform(obj);
3223
+// //obj.parent.Touch();
3224
+ }
3225
+
3226
+ refreshContents();
3227
+ }
28703228
28713229 void ResetTransform()
28723230 {
....@@ -2979,7 +3337,7 @@
29793337 refreshContents();
29803338 }
29813339
2982
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
29833341 {
29843342 Object3D obj;
29853343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3352,16 @@
29943352 LA.matIdentity(Object3D.mat);
29953353 obj.getBounds(minima, maxima, false);
29963354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993358 obj.TransformMesh(Object3D.mat);
3359
+
30003360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
30033365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3065,9 +3427,9 @@
30653427 obj = (Object3D)e.nextElement();
30663428
30673429 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
30693431 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
30713433
30723434 // System.err.println((size/1024) + " KB is the size of " + obj);
30733435 }
....@@ -3109,6 +3471,13 @@
31093471 void GenNormals(boolean crease)
31103472 {
31113473 group.GenNormalsS(crease);
3474
+
3475
+ refreshContents();
3476
+ }
3477
+
3478
+ void GenNormalsMINE()
3479
+ {
3480
+ group.selection.GenNormalsMINE();
31123481
31133482 refreshContents();
31143483 }
....@@ -3157,104 +3526,259 @@
31573526
31583527 //Object3D buffer;
31593528 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
-
3529
+// BoundaryRep temprep;
3530
+// Object3D nodes;
3531
+// Vector<Vertex> vertices;
3532
+//
3533
+// cGroup buffer;
3534
+//
3535
+// public void Vertex(Object3D node, Vertex v)
3536
+// {
3537
+//// vertices.add(v);
3538
+//// nodes.addElement(node);
3539
+////
3540
+//// if (temprep.GetCache(v) != null)
3541
+//// {
3542
+//// temprep.Remove(v);
3543
+//// } else
3544
+//// {
3545
+//// temprep.Remember(v);
3546
+//// }
3547
+//
3548
+// //Object3D node = nodes.get(index);
3549
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3550
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3551
+//
3552
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3553
+//
3554
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3555
+//
3556
+// cGroup g = new cGroup();
3557
+//
3558
+// if (g.toParent == null)
3559
+// {
3560
+// g.toParent = LA.newMatrix();
3561
+// g.fromParent = LA.newMatrix();
3562
+// }
3563
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3564
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3565
+//
3566
+// g.add(GrafreeD.clipboard);
3567
+//
3568
+// buffer.add(g);
3569
+// }
3570
+//
3571
+// public void Face(Object3D node, Face f)
3572
+// {
3573
+//
3574
+// }
3575
+//
3576
+// void ParseVerticesOld() // ??
3577
+// {
3578
+// //if (group.selection.size() != 1)
3579
+// // return;
3580
+//
3581
+// temprep = new BoundaryRep();
3582
+// nodes = new Object3D();
3583
+// vertices = new Vector<Vertex>();
3584
+//
3585
+// boolean epsequal = GrafreeD.epsequal;
3586
+// GrafreeD.epsequal = true;
3587
+//
3588
+// for (int i=0; i<group.selection.size(); i++)
3589
+// {
3590
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3591
+//
3592
+// group.selection.get(i).Parse(
3593
+//this );
3594
+//
3595
+// int repsize = temprep.VertexCount();
3596
+// int tablesize = temprep.vertextable.size();
3597
+// int nodesize = nodes.size();
3598
+//
3599
+// assert(vertices.size() == nodes.size());
3600
+//
3601
+// temprep.vertextable.elements();
3602
+//
3603
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3604
+//
3605
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3606
+// {
3607
+// cGroup g = new cGroup();
3608
+//
3609
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3610
+//
3611
+// Object3D node = nodes.get(index);
3612
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3613
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3614
+//
3615
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3616
+//
3617
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3618
+//
3619
+// if (g.toParent == null)
3620
+// {
3621
+// g.toParent = LA.newMatrix();
3622
+// g.fromParent = LA.newMatrix();
3623
+// }
3624
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3625
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3626
+//
3627
+// g.add(GrafreeD.clipboard);
3628
+//
3629
+// buffer.add(g);
3630
+// }
3631
+//
3632
+// makeSomething(buffer, i==group.selection.size()-1);
3633
+// }
3634
+//
3635
+// GrafreeD.epsequal = epsequal;
3636
+//
3637
+// //buffer = null;
3638
+// temprep = null;
3639
+// nodes = null;
3640
+//
3641
+// refreshContents();
3642
+// }
3643
+
31843644 void ParseVertices()
31853645 {
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;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
31953648
31963649 for (int i=0; i<group.selection.size(); i++)
31973650 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3651
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993652
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3653
+ group.selection.get(i).Parse(
3654
+
3655
+ new iParse()
3656
+ {
3657
+ public void Vertex(Object3D node, Vertex v)
3658
+ {
3659
+ temp.set(v);
3660
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053661
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();
3662
+ cGroup g = new cGroup();
32113663
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3664
+ if (g.toParent == null)
3665
+ {
3666
+ g.toParent = LA.newMatrix();
3667
+ g.fromParent = LA.newMatrix();
3668
+ }
3669
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3670
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153671
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);
3672
+ g.add(Grafreed.clipboard);
32203673
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);
3674
+ buffer.add(g);
3675
+ }
32323676
3233
- g.add(GraphreeD.clipboard);
3677
+ public void Face(Object3D node, Face f)
3678
+ {
32343679
3235
- buffer.add(g);
3236
- }
3680
+ }
3681
+ }
3682
+ );
32373683
32383684 makeSomething(buffer, i==group.selection.size()-1);
32393685 }
32403686
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3687
+ Grafreed.epsequal = epsequal;
32463688
32473689 refreshContents();
32483690 }
3249
-
3691
+
3692
+ void TextureVertices()
3693
+ {
3694
+ for (int i=0; i<group.selection.size(); i++)
3695
+ {
3696
+ group.selection.get(i).Parse(
3697
+ new iParse()
3698
+ {
3699
+ public void Vertex(Object3D node, Vertex v)
3700
+ {
3701
+ cTexture tex = node.GetTextures();
3702
+ String pigment = Object3D.GetPigment(tex);
3703
+ //String bump = Object3D.GetBump(tex);
3704
+
3705
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3706
+
3707
+ try
3708
+ {
3709
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3710
+ }
3711
+ catch (Exception e)
3712
+ {
3713
+ System.err.println("FAIL: " + node);
3714
+ }
3715
+
3716
+ double s = v.s;
3717
+
3718
+ if (s == 1)
3719
+ s = 0;
3720
+
3721
+ double t = v.t;
3722
+
3723
+ if (t == 1)
3724
+ t = 0;
3725
+
3726
+ int indexs = (int) (texturedata.getWidth() * s);
3727
+ int indext = (int) (texturedata.getHeight() * t);
3728
+
3729
+ int index = indext * texturedata.getWidth() + indexs;
3730
+
3731
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3732
+
3733
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3734
+
3735
+ float scale = bytebuf.get(index*slide) & 0xFF;
3736
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3737
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3738
+ scale /= 3;
3739
+
3740
+ scale /= 0xFF;
3741
+ // c'est quoi ca? scale /= 4;
3742
+
3743
+ //v.AO = scale;
3744
+
3745
+ v.x += v.norm.x * scale;
3746
+ v.y += v.norm.y * scale;
3747
+ v.z += v.norm.z * scale;
3748
+ }
3749
+
3750
+ public void Face(Object3D node, Face f)
3751
+ {
3752
+ }
3753
+ }
3754
+ );
3755
+ }
3756
+
3757
+ refreshContents();
3758
+ }
3759
+
32503760 void Align()
32513761 {
3762
+ if (group.selection.size() == 0)
3763
+ return;
3764
+
3765
+ cVector bbmin = new cVector();
3766
+ cVector bbmax = new cVector();
3767
+
3768
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3769
+
3770
+ double dx = bbmax.x - bbmin.x;
3771
+ double dy = bbmax.y - bbmin.y;
3772
+ double dz = bbmax.z - bbmin.z;
3773
+
3774
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3775
+
32523776 for (int i=0; i<group.selection.size(); i++)
32533777 {
32543778 Object3D obj = group.selection.get(i);
32553779
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3780
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3781
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583782 }
32593783
32603784 refreshContents();
....@@ -3267,7 +3791,7 @@
32673791 // ref.SaveSupports();
32683792 // Object3D par = ref.parent;
32693793 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3794
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713795 // ref.parent = par;
32723796 // ref.RestoreSupports();
32733797
....@@ -3275,11 +3799,11 @@
32753799
32763800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773801
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
32803804 lowres.linkVerticesThis(null);
32813805 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
32833807
32843808 System.err.flush();
32853809
....@@ -3297,7 +3821,7 @@
32973821 // lowres.SaveSupports();
32983822 // par = lowres.parent;
32993823 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3824
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013825 Object3D newlow = CloneObject(lowres, false);
33023826 newlow.name = sn.switchobject.get(i).name;
33033827 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3843,7 @@
33193843 return;
33203844
33213845 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
33233847
33243848 Object3D newgroup = new Object3D("Po:" + poses.name);
33253849
....@@ -3488,7 +4012,7 @@
34884012 group.selection.RelinkToSupport(); // july 2014
34894013 System.out.println("DONE.");
34904014 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4015
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924016 }
34934017
34944018 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4037,20 @@
35134037
35144038 void ClipMesh()
35154039 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174041 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
35194043
35204044 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214045 content = ((cGroup)content).get(0);
35224046
35234047 // for (int i=0; i<group.selection.size(); i++)
35244048 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4049
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264050 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
35284052 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4053
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304054 System.out.println("DONE.");
35314055 refreshContents();
35324056 }
....@@ -3659,7 +4183,7 @@
36594183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604184
36614185 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4186
+ if(elem != group || !newWindow)
36634187 {
36644188 // if (!(elem instanceof Composite))
36654189 // newWindow = false;
....@@ -3764,25 +4288,25 @@
37644288 System.err.println("info : " + child.GetPath());
37654289 }
37664290 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4291
+// else
4292
+// {
4293
+// objEditor.SetMaterial(group); // .GetMaterial());
4294
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4295
+// System.err.println("info : " + group.GetPath());
4296
+// }
37734297
37744298 objEditor.SetText(); // jan 2014
37754299
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4300
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
37774301 CameraPane.flash = true;
37784302
37794303 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
37804304 // a camera
37814305 {
37824306 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;
4307
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4308
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4309
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864310 }
37874311
37884312 refreshContents();
....@@ -3864,12 +4388,12 @@
38644388 {
38654389 if (group.selection.isEmpty())
38664390 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
38684392 Composite tGroup = null;
38694393 if (group.selection.size() > 0) // 1)
38704394 {
38714395 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
38734397 }
38744398
38754399 if (cut)
....@@ -3909,16 +4433,16 @@
39094433 //System.out.println("cut " + child);
39104434 //System.out.println("parent = " + child.parent);
39114435 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
39134437 tGroup.add/*Child*/(tmp);
39144438 else
3915
- GraphreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
39164440 }
39174441 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
39194443 tGroup.add/*Child*/(child);
39204444 else
3921
- GraphreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
39224446 }
39234447
39244448 //ResetModel();
....@@ -3950,21 +4474,21 @@
39504474 //System.out.println("cut " + elem);
39514475 //System.out.println("parent = " + elem.parent);
39524476 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
39544478 tGroup.add/*Child*/(tmp);
39554479 else
3956
- GraphreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
39574481 }
39584482 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
39604484 tGroup.add/*Child*/(child);
39614485 else
3962
- GraphreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
39634487 }
39644488
39654489 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
39684492 if (cut)
39694493 {
39704494 ResetModel();
....@@ -3974,11 +4498,11 @@
39744498
39754499 void paste(boolean expand)
39764500 {
3977
- // if (GraphreeD.clipboard == null)
4501
+ // if (GrafreeD.clipboard == null)
39784502 // return;
39794503 boolean first = true;
39804504
3981
- if (GraphreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
39824506 {
39834507 Composite temp;
39844508
....@@ -3989,7 +4513,7 @@
39894513 temp = (Composite)Applet3D.clipboard.deepCopy();
39904514 */
39914515 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4516
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934517 {
39944518 Object3D child = (Object3D)e.nextElement();
39954519
....@@ -4003,7 +4527,7 @@
40034527 else
40044528 elem = child.deepCopy(); // ?
40054529 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4530
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074531 // elem = elem.get(0);
40084532 makeSomething(elem, true); // ?? first);
40094533 //group.addChild(elem);
....@@ -4023,23 +4547,23 @@
40234547 //Object3D cb = Applet3D.clipboard;
40244548 //temp.addChild(cb);
40254549 //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());
4550
+ assert(Grafreed.clipboard.parent == null);
4551
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4552
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4553
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4554
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314555 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
40344558 }
40354559
40364560 ResetModel();
40374561 refreshContents();
40384562 }
40394563
4040
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
40414565 {
4042
-// if (GraphreeD.clipboard == null)
4566
+// if (GrafreeD.clipboard == null)
40434567 // return;
40444568
40454569 if (group.selection.size() != 1)
....@@ -4066,15 +4590,22 @@
40664590 if (copyit)
40674591 {
40684592 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
40704601 }
40714602 else
40724603 {
40734604 boolean first = true;
40744605
4075
- if (GraphreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
40764607 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
40784609 Object3D copy;
40794610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804611 {
....@@ -4084,7 +4615,7 @@
40844615 }
40854616 } else
40864617 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
40884619 }
40894620 }
40904621 }
....@@ -4276,6 +4807,26 @@
42764807 makeSomething(csg);
42774808 }
42784809
4810
+ void Ungroup(Object3D g)
4811
+ {
4812
+ if (g instanceof HiddenObject)
4813
+ {
4814
+ HiddenObject h = (HiddenObject) g;
4815
+
4816
+ for (int i=0; i<h.ActualSize(); i++)
4817
+ {
4818
+ objEditor.makeSomething(h.get(i), false);
4819
+ }
4820
+ }
4821
+ else
4822
+ {
4823
+ for (int i=0; i<g.Size(); i++)
4824
+ {
4825
+ objEditor.makeSomething(g.get(i), false);
4826
+ }
4827
+ }
4828
+ }
4829
+
42794830 void ungroup()
42804831 {
42814832 /*
....@@ -4469,21 +5020,6 @@
44695020 }
44705021 */
44715022
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
-
44875023 /*
44885024 public void Callback(Object obj)
44895025 {
....@@ -4507,26 +5043,9 @@
45075043 }
45085044 */
45095045
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
-
45275046 String GetFile(String dialogName)
45285047 {
4529
- if (GraphreeD.standAlone)
5048
+ if (Grafreed.standAlone)
45305049 {
45315050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325051 browser.show();
....@@ -4590,10 +5109,12 @@
45905109 cButton flashSelectionButton;
45915110 cButton editButton;
45925111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
45935113 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955114 cButton unselectButton;
45965115
5116
+ cButton oneStepButton;
5117
+
45975118 cButton screenfitButton;
45985119 cButton screenfitpointButton;
45995120 cButton snapobjectButton;
....@@ -4635,8 +5156,9 @@
46355156 private MenuItem resetsupportItem;
46365157 private MenuItem resetreferencesItem;
46375158 private MenuItem linkverticesItem;
5159
+ private MenuItem relinkverticesItem;
46385160 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
46405162 private MenuItem stepAllItem;
46415163 private MenuItem revertMeshItem;
46425164 private MenuItem poseMeshItem;
....@@ -4647,14 +5169,17 @@
46475169 private MenuItem mergeGeometriesItem;
46485170 private MenuItem copyItem;
46495171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
46505173 private MenuItem pasteLinkItem;
46515174 private MenuItem pasteCloneItem;
46525175 private MenuItem pasteExpandItem;
46535176 private MenuItem clearItem;
46545177 private MenuItem clearAllItem;
46555178 private MenuItem genUVItem;
5179
+ private MenuItem genNormalsMESHItem;
46565180 private MenuItem genNormalsCADItem;
46575181 private MenuItem genNormalsORGANItem;
5182
+ private MenuItem genNormalsMINEItem;
46585183 private MenuItem stripifyItem;
46595184 private MenuItem unstripifyItem;
46605185 private MenuItem trimItem;
....@@ -4694,8 +5219,11 @@
46945219 private MenuItem panoTexturesItem;
46955220
46965221 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
46985223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
5226
+ private MenuItem hideItem;
46995227 private MenuItem grabItem;
47005228 private MenuItem backItem;
47015229 private MenuItem frontItem;
....@@ -4716,6 +5244,7 @@
47165244
47175245 private MenuItem resetParentItem;
47185246 private MenuItem repairParentItem;
5247
+ private MenuItem repairShadowItem;
47195248 private MenuItem sortbysizeItem;
47205249 private MenuItem sortbynameItem;
47215250
....@@ -4728,16 +5257,19 @@
47285257 private MenuItem particleItem;
47295258 private MenuItem ragdollItem;
47305259 private MenuItem ragdoll2Item;
5260
+ private MenuItem heightFieldItem;
5261
+ private MenuItem textureFieldItem;
47315262 private MenuItem gridItem;
47325263 private MenuItem rectoidItem;
47335264 private MenuItem ellipsoidItem;
47345265 private MenuItem coneItem;
47355266 private MenuItem torusItem;
47365267 private MenuItem superItem;
5268
+ private MenuItem kleinItem;
47375269 private MenuItem blobItem;
47385270 private MenuItem latheItem;
47395271 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
47415273 private MenuItem meshItem;
47425274 // private MenuItem meshGroupItem;
47435275 private MenuItem springItem;
....@@ -4746,6 +5278,7 @@
47465278 private MenuItem csgItem;
47475279 private MenuItem templateItem;
47485280 private MenuItem textureItem;
5281
+ private MenuItem billboardItem;
47495282 private MenuItem shadowXItem;
47505283 private MenuItem shadowYItem;
47515284 private MenuItem shadowZItem;
....@@ -4758,11 +5291,6 @@
47585291 private MenuItem doubleItem;
47595292 private MenuItem tripleItem;
47605293
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665294 private MenuItem computeAOItem;
47675295 private MenuItem recompileItem;
47685296 private MenuItem editScriptItem;
....@@ -4772,4 +5300,8 @@
47725300 private MenuItem analyzeItem;
47735301 private MenuItem dumpItem;
47745302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
47755307 }