Normand Briere
2019-06-25 ecff440ceef3ad352aa64cedbb913107ec4863a5
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,30 +148,29 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
163155 Menu menu;
164156 oe.menuBar.add(menu = new Menu("Edit"));
165157 //editItem = menu.add(new MenuItem("Edit"));
166158 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168166 duplicateItem.addActionListener(this);
169
- menu.add("-");
170167 cloneItem = menu.add(new MenuItem("Clone"));
171168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
172171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173172 cloneSupportItem.addActionListener(this);
173
+ }
174174 menu.add("-");
175175 cutItem = menu.add(new MenuItem("Cut"));
176176 cutItem.addActionListener(this);
....@@ -178,26 +178,123 @@
178178 copyItem.addActionListener(this);
179179 pasteItem = menu.add(new MenuItem("Paste"));
180180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
181185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182186 pasteLinkItem.addActionListener(this);
183187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184188 pasteCloneItem.addActionListener(this);
185189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
187192 clearItem = menu.add(new MenuItem("Clear"));
188193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
189198 clearAllItem = menu.add(new MenuItem("Clear All"));
190199 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);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209
+
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
237
+
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
289
+ oe.menuBar.add(menu = new Menu("Setting"));
290
+ if (Globals.ADVANCED)
291
+ {
196292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197293 revertMeshItem.addActionListener(this);
198294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199295 resetreferencesItem.addActionListener(this);
200296 menu.add("-");
297
+ }
201298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202299 overwriteGeoItem.addActionListener(this);
203300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +306,103 @@
209306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210307 overwriteUVItem.addActionListener(this);
211308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
212311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213312 generateMeshItem.addActionListener(this);
214313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215314 poseMeshItem.addActionListener(this);
216315 menu.add("-");
316
+ }
217317 resetsupportItem = menu.add(new MenuItem("Reset support"));
218318 resetsupportItem.addActionListener(this);
219319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220320 linkverticesItem.addActionListener(this);
321
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
322
+ relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
221326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222327 setMasterItem.addActionListener(this);
328
+ }
223329
224
- oe.menuBar.add(menu = new Menu("Object"));
225
- grabItem = menu.add(new MenuItem("Grab"));
226
- grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
330
+ oe.menuBar.add(menu = new Menu("Group"));
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
229333 backItem = menu.add(new MenuItem("Back"));
230334 backItem.addActionListener(this);
231
- compositeItem = menu.add(new MenuItem("Composite"));
232
- compositeItem.addActionListener(this);
233
- menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
235
- 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);
335
+ frontItem = menu.add(new MenuItem("Front"));
336
+ frontItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
343
+ hideItem.addActionListener(this);
344
+ }
345
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
346
+ ungroupItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
240354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241355 switchGeoItem.addActionListener(this);
242356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243357 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
245359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
246366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247367 scriptNodeItem.addActionListener(this);
248
- cameraItem = menu.add(new MenuItem("Camera"));
249
- cameraItem.addActionListener(this);
250
- menu.add("-");
251
- textureItem = menu.add(new MenuItem("Texture"));
252
- textureItem.addActionListener(this);
368
+ }
369
+
370
+ oe.menuBar.add(menu = new Menu("Object"));
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
373
+ billboardItem = menu.add(new MenuItem("Billboard"));
374
+ billboardItem.addActionListener(this);
253375 csgItem = menu.add(new MenuItem("CSG"));
254376 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256378 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258380 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
261386 linkerItem = menu.add(new MenuItem("Linker"));
262387 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265388 attributeItem = menu.add(new MenuItem("Attribute"));
266389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
267392 pointflowItem = menu.add(new MenuItem("Point Flow"));
268393 pointflowItem.addActionListener(this);
394
+ }
269395 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273397 resetTransformItem.addActionListener(this);
274398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275399 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
278406
279407 oe.menuBar.add(menu = new Menu("Geometry"));
280408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +411,13 @@
283411 genNormalsORGANItem.addActionListener(this);
284412 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285413 genNormalsCADItem.addActionListener(this);
414
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
415
+ genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
418
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
419
+ genNormalsMINEItem.addActionListener(this);
420
+ }
286421 stripifyItem = menu.add(new MenuItem("Stripify"));
287422 stripifyItem.addActionListener(this);
288423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +427,6 @@
292427 untrimItem = menu.add(new MenuItem("Untrim"));
293428 untrimItem.addActionListener(this);
294429 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297430 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298431 clearColorsItem.addActionListener(this);
299432 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +439,34 @@
306439 reduce34MeshItem.addActionListener(this);
307440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308441 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
450
+
451
+ oe.menuBar.add(menu = new Menu("Attributes"));
452
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
453
+ clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
313458 menu.add("-");
314459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315460 liveleavesItem.addActionListener(this);
316461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
318465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319466 supportleavesItem.addActionListener(this);
320467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321468 unsupportleavesItem.addActionListener(this);
469
+ }
322470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323471 hideleavesItem.addActionListener(this);
324472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +475,31 @@
327475 markleavesItem.addActionListener(this);
328476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
330486 menu.add("-");
331487 flipVItem = menu.add(new MenuItem("Flip V"));
332488 flipVItem.addActionListener(this);
333489 unflipVItem = menu.add(new MenuItem("Unflip V"));
334490 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
491
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336492 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
493
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338494 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
495
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340496 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
497
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342498 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
499
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344500 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
501
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346502 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);
356503
357504 oe.menuBar.add(menu = new Menu("Selection"));
358505 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,14 +517,41 @@
370517 sortbysizeItem.addActionListener(this);
371518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372519 sortbynameItem.addActionListener(this);
520
+ menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
528
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
529
+ extractGeometriesItem.addActionListener(this);
530
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
531
+ cloneGeometriesItem.addActionListener(this);
532
+ }
533
+
373534 oe.menuBar.add(menu = new Menu("Insert"));
374535 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
536
+
537
+ oe.menuBar.add(menu = new Menu("Tools"));
376538 buildToolsMenu(menu);
377539 }
378540
379541 void SetupUI2(ObjEditor oe)
380542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
381555 //new Exception().printStackTrace();
382556
383557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +580,199 @@
406580 oe.radioPanel.add(dummyButton);
407581 oe.buttonGroup.add(dummyButton);
408582 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
412586
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588
+
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ redoButton.setToolTipText("Redo changes");
611
+ redoButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ saveButton.setToolTipText("Save changes");
615
+ saveButton.addActionListener(this);
616
+
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618
+ liveCB.setToolTipText("Enable animation");
414619 liveCB.addItemListener(this);
415620
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);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ oneStepButton.setToolTipText("Animate one step forward");
623
+ oneStepButton.addActionListener(this);
624
+
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626
+ fastCB.setToolTipText("Fast mode");
434627 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);
476
- trackCB.addItemListener(this);
477
-
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
628
+
629
+ //oe.toolboxPanel.Return();
630
+
631
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ screenfitButton.setToolTipText("Screen fit");
480633 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
634
+
635
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636
+// trackCB.setToolTipText("Enable tracking");
637
+// trackCB.addItemListener(this);
638
+
482639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483640 // 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;
488641
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);
495
- flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
642
+ if (Globals.ADVANCED)
643
+ {
644
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ snapobjectButton.addActionListener(this);
646
+ snapobjectButton.setToolTipText("Snap Object");
647
+ }
648
+
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
499650
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ twoButton.setToolTipText("Show center view only");
502653 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
654
+ this.fullscreenLayout = twoButton;
655
+
656
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504657 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
658
+ fourButton.setToolTipText("Show left panel only");
659
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
+ sixButton.setToolTipText("2-column layout left");
506661 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
+ threeButton.setToolTipText("2-column layout right");
508664 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
665
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ sevenButton.setToolTipText("3-column layout");
510667 sevenButton.addActionListener(this);
511668 //
512669
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ rootButton.setToolTipText("Edit selection in new tab");
514672 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
673
+
674
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
675
+ closeButton.setToolTipText("Close tab");
517676 closeButton.addActionListener(this);
518677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519678 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521
-
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
524
- editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528679
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
680
+ // INSERT
681
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ gridButton.setToolTipText("Create grid");
683
+ gridButton.addActionListener(this);
684
+
685
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ boxButton.setToolTipText("Create box");
687
+ boxButton.addActionListener(this);
688
+
689
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ sphereButton.setToolTipText("Create sphere");
691
+ sphereButton.addActionListener(this);
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.Return();
717
+
718
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ groupButton.setToolTipText("Create group");
720
+ groupButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ compositeButton.setToolTipText("Create composite");
724
+ compositeButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ switchButton.setToolTipText("Create switch");
728
+ switchButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ loopButton.setToolTipText("Create loop");
732
+ loopButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ textureButton.setToolTipText("Create texture");
736
+ textureButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ overlayButton.setToolTipText("Create overlay");
740
+ overlayButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ lightButton.setToolTipText("Create light");
744
+ lightButton.addActionListener(this);
745
+
746
+ // EDIT panel
747
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ editButton.setToolTipText("Edit selection");
749
+ editButton.addActionListener(this);
750
+
751
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ uneditButton.setToolTipText("Unedit selection");
530753 uneditButton.addActionListener(this);
531754
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);
755
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
+ allParamsButton.setToolTipText("Edit all params");
544757 allParamsButton.addActionListener(this);
545758
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);
759
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ clearPanelButton.setToolTipText("Clear edit panel");
761
+ clearPanelButton.addActionListener(this);
762
+
763
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ unselectButton.setToolTipText("Unselect");
551765 unselectButton.addActionListener(this);
552766
767
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ flashSelectionButton.setToolTipText("Highlight selection");
769
+ flashSelectionButton.addActionListener(this);
770
+
771
+ editCommandsPanel.preferredHeight = 1;
772
+
773
+// oe.treePanel.add(commandsPanel);
774
+// oe.treePanel.Return();
775
+
553776 // oe.aConstraints.gridx += 1;
554777 // oe.aConstraints.weighty = 0;
555778 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +784,22 @@
561784 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562785 // gcButton.addActionListener(this);
563786
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;
787
+ cGridBag jSPPanel = new cGridBag();
788
+
789
+ JScrollPane jSP;
575790 //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);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
577792 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
582
-
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);
587
- colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
590
- materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
593
- textureCB.addItemListener(this);
594
-
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
597793
794
+ oe.treePanel.add(jSPPanel);
795
+ oe.treePanel.Return();
796
+
797
+ oe.treePanel.add(copyOptionsPanel);
798
+ oe.treePanel.Return();
799
+
800
+// mainPanel.setDividerLocation(0.5); //1.0);
801
+// mainPanel.setResizeWeight(0.5);
802
+
598803 //jList.addListSelectionListener(this);
599804 oe.jTree.addTreeSelectionListener(this);
600805 //jTree.setRootVisible(false);
....@@ -616,20 +821,153 @@
616821 radio.layout = sevenButton;
617822 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618823 }
824
+
825
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
826
+ {
827
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
828
+ colorCB.setToolTipText("Copy color when dropped");
829
+ colorCB.addItemListener(this);
830
+
831
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
832
+ materialCB.setToolTipText("Copy material when dropped");
833
+ materialCB.addItemListener(this);
834
+
835
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
836
+ textureCB.setToolTipText("Copy texture when dropped");
837
+ textureCB.addItemListener(this);
838
+
839
+ panel.Return();
840
+
841
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
842
+ boxCB.setToolTipText("Display bounding boxes");
843
+ boxCB.addItemListener(this);
844
+
845
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
847
+ zoomBoxCB.addItemListener(this);
848
+
849
+ if (true) // Globals.ADVANCED)
850
+ {
851
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
+ supportCB.setToolTipText("Enable rigging");
853
+ supportCB.addItemListener(this);
854
+
855
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
856
+ // localCB.addItemListener(this);
857
+
858
+ panel.Return();
859
+
860
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
861
+ crowdCB.setToolTipText("Used for crowds");
862
+ crowdCB.addItemListener(this);
863
+
864
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
865
+ smoothCB.setToolTipText("Snapping delay");
866
+ smoothCB.addItemListener(this);
867
+
868
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
869
+ slowCB.setToolTipText("Smooth interpolation");
870
+ slowCB.addItemListener(this);
871
+
872
+// constraints.gridy += 1;
873
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
874
+// speakerMocapCB.addItemListener(this);
875
+
876
+ panel.Return();
877
+
878
+ if (false)
879
+ {
880
+ // handled in scripts
881
+ //constraints.gridy += 1;
882
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
883
+ speakerCameraCB.addItemListener(this);
884
+
885
+ //constraints.gridy += 1;
886
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
887
+ speakerFocusCB.addItemListener(this);
888
+
889
+ //constraints.gridy += 1;
890
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
891
+ smoothfocusCB.addItemListener(this);
892
+ panel.Return();
893
+ }
894
+
895
+//constraints.gridx += 1;
896
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
897
+// debugCB.addItemListener(this);
898
+
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
903
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
905
+ oeilCB.addItemListener(this);
906
+
907
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
+ shadowCB.setToolTipText("Compute shadows when live");
909
+ shadowCB.addItemListener(this);
910
+
911
+ panel.Return();
912
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
913
+ toggleTextureCB.setToolTipText("Load textures");
914
+ toggleTextureCB.addItemListener(this);
915
+
916
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
+ toggleSwitchCB.setToolTipText("Use switch");
918
+ toggleSwitchCB.addItemListener(this);
919
+
920
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
+ autosaveCB.setToolTipText("Auto-save on structure change");
922
+ autosaveCB.addItemListener(this);
923
+
924
+ panel.Return();
925
+ if (Globals.ADVANCED)
926
+ {
927
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
928
+ lookAtCB.setToolTipText("Look-at target");
929
+ lookAtCB.addItemListener(this);
930
+ }
931
+
932
+ }
933
+
934
+ cGridBag fill = new cGridBag();
935
+ fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
940
+
941
+ panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
944
+
945
+ }
619946
620947 void EditObject(Object3D obj)
621948 {
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();
949
+ cRadio radioButton = new cRadio(obj.name);
950
+
951
+ // Patch to avoid bug with transparency.
952
+ radioButton.hadMaterial = obj.material != null;
953
+ if (!radioButton.hadMaterial)
954
+ {
955
+ obj.material = new cMaterial();
956
+ }
957
+
958
+ radioButton.SetObject(obj);
959
+ radioButton.layout = sevenButton;
960
+ radioButton.SetCamera(cameraView.renderCamera, false);
961
+ radioButton.addActionListener(this);
962
+ radioPanel.add(radioButton);
963
+ buttonGroup.add(radioButton);
964
+ radioButton.doClick();
630965 }
966
+
631967 void SetupViews(ObjEditor oe)
632968 {
969
+ theFrame = this;
970
+
633971 oe.SetupViews();
634972
635973 System.out.println("SetupViews");
....@@ -638,22 +976,27 @@
638976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
639977 }
640978
641
- JCheckBox liveCB;
642
- JCheckBox supportCB;
643
- JCheckBox localCB;
644
- JCheckBox crowdCB;
645
- JCheckBox smoothCB;
646
- JCheckBox fastCB;
647
- JCheckBox slowCB;
648
- JCheckBox boxCB;
649
- JCheckBox trackCB;
650
- JCheckBox smoothfocusCB;
979
+ cToggleButton liveCB;
980
+ cCheckBox supportCB;
981
+ cCheckBox localCB;
982
+ cCheckBox crowdCB;
983
+ cCheckBox smoothCB;
984
+ cToggleButton fastCB;
985
+ cCheckBox slowCB;
986
+ cCheckBox boxCB;
987
+ cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
989
+ cCheckBox trackCB;
990
+ cCheckBox smoothfocusCB;
651991 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
6571000
6581001 // static int COLOR = 1;
6591002 // static int MATERIAL = 2;
....@@ -661,9 +1004,9 @@
6611004
6621005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631006
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
6671010
6681011 public void itemStateChanged(ItemEvent e)
6691012 {
....@@ -688,10 +1031,10 @@
6881031 dropAttributes |= Object3D.TEXTURE;
6891032 else
6901033 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1034
+ } else if(e.getSource() == liveCB)
6931035 {
6941036 cameraView.ToggleLive();
1037
+ refreshContents(false);
6951038 }
6961039 else if(e.getSource() == supportCB)
6971040 {
....@@ -727,6 +1070,10 @@
7271070 cameraView.repaint();
7281071 // refreshContents();
7291072 }
1073
+ else if(e.getSource() == zoomBoxCB)
1074
+ {
1075
+ cameraView.ToggleZoomBoxMode();
1076
+ }
7301077 else if(e.getSource() == smoothfocusCB)
7311078 {
7321079 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1099,14 @@
7521099 {
7531100 cameraView.ToggleOeil();
7541101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
7551110 else if(e.getSource() == lookAtCB)
7561111 {
7571112 cameraView.ToggleLookAt();
....@@ -768,7 +1123,8 @@
7681123
7691124 /**/
7701125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
7721128 if ((path == null) || (path.getPathCount() <= 1)) {
7731129 // We can't move the root node or an empty selection
7741130 return;
....@@ -840,7 +1196,9 @@
8401196 // objEditor.DropFile((java.io.File[]) object, true);
8411197 // return;
8421198 // }
843
- if (string.charAt(0) == '/')
1199
+
1200
+ // File path for Mac and Windows
1201
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441202 {
8451203 // file(s)
8461204 String[] names = string.split("\n");
....@@ -867,7 +1225,7 @@
8671225
8681226 flashIt = false;
8691227 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1228
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711229 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721230
8731231 if (group.selection.size() == 1)
....@@ -883,23 +1241,33 @@
8831241
8841242 assert target == objEditor.jTree;
8851243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
8861245 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881247 } catch (Exception e) {
8891248 System.out.println("destinationPath : " + destinationPath);
8901249 return;
8911250 }
8921251
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
8941253 {
1254
+ Object3D child = (Object3D)group.selection.elementAt(i);
1255
+
1256
+ // Cannot move into itself
1257
+ if (child == destinationLeaf)
1258
+ return;
1259
+ }
1260
+
1261
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1262
+// {
8951263 loadClipboard(true);
8961264 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1265
+ pasteInto(false, false);
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
9031271 }
9041272 public void dropActionChanged(DropTargetDragEvent dtde)
9051273 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1370,106 @@
10021370
10031371 void buildCreateMenu(Menu menu)
10041372 {
1005
- gridItem = menu.add(new MenuItem("Grid"));
1006
- gridItem.addActionListener(this);
1007
- rectoidItem = menu.add(new MenuItem("Box"));
1008
- rectoidItem.addActionListener(this);
1009
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1010
- ellipsoidItem.addActionListener(this);
1011
- coneItem = menu.add(new MenuItem("Cone"));
1012
- coneItem.addActionListener(this);
1013
- torusItem = menu.add(new MenuItem("Torus"));
1014
- torusItem.addActionListener(this);
1015
- superItem = menu.add(new MenuItem("Superellipsoid"));
1016
- superItem.addActionListener(this);
1017
- particleItem = menu.add(new MenuItem("Particle system"));
1018
- particleItem.addActionListener(this);
1373
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1374
+ //heightFieldItem.addActionListener(this);
1375
+// gridItem = menu.add(new MenuItem("Grid"));
1376
+// gridItem.addActionListener(this);
1377
+// rectoidItem = menu.add(new MenuItem("Box"));
1378
+// rectoidItem.addActionListener(this);
1379
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1380
+// ellipsoidItem.addActionListener(this);
1381
+// coneItem = menu.add(new MenuItem("Cone"));
1382
+// coneItem.addActionListener(this);
1383
+// torusItem = menu.add(new MenuItem("Torus"));
1384
+// torusItem.addActionListener(this);
1385
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1386
+// superItem.addActionListener(this);
1387
+
1388
+ cameraItem = menu.add(new MenuItem("Camera"));
1389
+ cameraItem.addActionListener(this);
1390
+
1391
+ if (!Globals.ADVANCED)
1392
+ {
1393
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1394
+ kleinItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
1399
+ if (Globals.ADVANCED)
1400
+ {
10191401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201402 ragdollItem.addActionListener(this);
10211403 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221404 ragdoll2Item.addActionListener(this);
1405
+ }
10231406 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1407
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251408 meshItem.addActionListener(this);
10261409 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271410 // meshGroupItem.addActionListener(this);
1411
+ if (Globals.ADVANCED)
1412
+ {
10281413 springItem = menu.add(new MenuItem("Spring"));
10291414 springItem.addActionListener(this);
10301415 flagItem = menu.add(new MenuItem("Flag"));
10311416 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);
10361417 blobItem = menu.add(new MenuItem("Blob"));
10371418 blobItem.addActionListener(this);
10381419 latheItem = menu.add(new MenuItem("Lathe"));
10391420 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1421
+ }
1422
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1423
+ bezierItem.addActionListener(this);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
10421428 menu.add("-");
10431429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441430 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
10471433 doubleItem = menu.add(new MenuItem("Fork"));
10481434 doubleItem.addActionListener(this);
1435
+ if (Globals.ADVANCED)
1436
+ {
10491437 tripleItem = menu.add(new MenuItem("Trident"));
10501438 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);
1439
+ }
10601440 }
10611441
10621442 void buildToolsMenu(Menu menu)
10631443 {
10641444 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651445 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1446
+ animationItem.setState(Globals.ANIMATION);
10671447
10681448 menu.add("-");
10691449 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701450 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1451
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1452
+ textureFieldItem.addActionListener(this);
1453
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721454 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751455 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761456 reduceMorphItem.addActionListener(this);
10771457 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781458 reduce34MorphItem.addActionListener(this);
1079
-
1459
+ menu.add("-");
10801460 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811461 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831462
1463
+ if (Globals.ADVANCED)
1464
+ {
1465
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1466
+ mirrorItem.addActionListener(this);
1467
+ menu.add("-");
10841468 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851469 memoryItem.addActionListener(this);
10861470 menu.add(analyzeItem = new MenuItem("Analyze"));
10871471 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1472
+ menu.add(dumpItem = new MenuItem("Print"));
10891473 dumpItem.addActionListener(this);
10901474 // menu.add(pathItem = new MenuItem("From-to path"));
10911475 // pathItem.addActionListener(this);
....@@ -1094,6 +1478,8 @@
10941478 resetParentItem.addActionListener(this);
10951479 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961480 repairParentItem.addActionListener(this);
1481
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1482
+ repairShadowItem.addActionListener(this);
10971483 menu.add(invariantsItem = new MenuItem("Invariants"));
10981484 invariantsItem.addActionListener(this);
10991485 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1487,7 @@
11011487 menu.add("-");
11021488 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031489 editScriptItem.addActionListener(this);
1490
+ }
11041491 }
11051492
11061493 void ScreenFit()
....@@ -1223,6 +1610,7 @@
12231610 shadow.material = new cMaterial(obj.material);
12241611 shadow.material.diffuse = 0.0001f;
12251612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
12261614
12271615 makeSomething(shadow);
12281616 }
....@@ -1429,9 +1817,9 @@
14291817
14301818 void Overwrite(int mask)
14311819 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1820
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331821 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1822
+ Object3D content = Grafreed.clipboard.get(0);
14351823
14361824 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371825 content = ((cGroup)content).get(0);
....@@ -1454,6 +1842,7 @@
14541842 //
14551843 public void actionPerformed(ActionEvent event) // , Object arg)
14561844 {
1845
+ Object source = event.getSource();
14571846 /*
14581847 if (event.getSource() == nameField)
14591848 {
....@@ -1465,11 +1854,11 @@
14651854 }
14661855 else
14671856 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1857
+ if (source == lookAtItem || source == lookFromItem)
14691858 {
14701859 ScreenFit();
14711860 } else
1472
- if (event.getSource() == switchItem)
1861
+ if (source == switchViewItem)
14731862 {
14741863 cVector v1 = new cVector();
14751864 cVector v2 = new cVector();
....@@ -1478,11 +1867,11 @@
14781867 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791868 objEditor.cameraView.repaint();
14801869 } else
1481
- if (event.getSource() == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
14821871 {
14831872 makeSomething(new Box());
14841873 } else
1485
- if (event.getSource() == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
14861875 {
14871876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1892,9 @@
15031892 applyExample(particleGeom, "SMOKE");
15041893 makeSomething(particleGeom);
15051894 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1895
+ if (source == ragdollItem || source == ragdoll2Item)
15071896 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1897
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091898
15101899 ragdoll.toParent = LA.newMatrix();
15111900 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1910,71 @@
15211910 makeSomething(ragdoll);
15221911 //makeSomething(new VehicleDemo());
15231912 } else
1524
- if (event.getSource() == gridItem)
1913
+ /*
1914
+ */
1915
+ if (source == heightFieldItem)
1916
+ {
1917
+ Object3D obj = new Object3D();
1918
+
1919
+ obj.CreateMaterial();
1920
+ obj.bRep = new BoundaryRep();
1921
+
1922
+ obj.bRep.CreateMesh(new iHeightField()
1923
+ {
1924
+ public double f(double x, double y)
1925
+ {
1926
+ // The Mandelbrot set is represented by coloring
1927
+ // each point (x,y) according to the number of
1928
+ // iterations it takes before the while loop in
1929
+ // this method ends. For points that are actually
1930
+ // in the Mandelbrot set, or very close to it, the
1931
+ // count will reach the maximum value, 80. These
1932
+ // points will be colored purple. All other colors
1933
+ // represent points that are definitely NOT in the set.
1934
+ x -= 600;
1935
+ y -= 500;
1936
+ x /= 200;
1937
+ y /= 200;
1938
+ int count = 0;
1939
+ double zx = x;
1940
+ double zy = y;
1941
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1942
+ double new_zx = zx*zx - zy*zy + x;
1943
+ zy = 2*zx*zy + y;
1944
+ zx = new_zx;
1945
+ count++;
1946
+ }
1947
+ return count; // Math.sqrt(count);
1948
+ }
1949
+ }, 1000,1000);
1950
+
1951
+ makeSomething(obj);
1952
+ } else
1953
+ if (source == gridItem || source == gridButton)
15251954 {
15261955 makeSomething(new Grid());
15271956 } else
1528
- if (event.getSource() == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
15291958 {
15301959 makeSomething(new Sphere());
15311960 } else
1532
- if (event.getSource() == coneItem)
1961
+ if (source == coneItem || source == coneButton)
15331962 {
15341963 makeSomething(new Cone());
15351964 } else
1536
- if (event.getSource() == torusItem)
1965
+ if (source == torusItem || source == torusButton)
15371966 {
15381967 makeSomething(new Torus());
15391968 } else
1540
- if (event.getSource() == superItem)
1969
+ if (source == superItem || source == superButton)
15411970 {
15421971 makeSomething(new Superellipsoid());
15431972 } else
1544
- if (event.getSource() == blobItem)
1973
+ if (source == kleinItem || source == kleinButton)
1974
+ {
1975
+ makeSomething(new Klein());
1976
+ } else
1977
+ if (source == blobItem)
15451978 {
15461979 Blob blob = new Blob();
15471980 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1982,15 @@
15491982 //blob.retile();
15501983 makeSomething(blob);
15511984 } else
1552
- if (event.getSource() == latheItem)
1985
+ if (source == latheItem)
15531986 {
15541987 makeSomething(new Lathe());
15551988 } else
1556
- if (event.getSource() == bezierItem)
1989
+ if (source == bezierItem)
15571990 {
15581991 makeSomething(new BezierSurface());
15591992 } else
1560
- if (event.getSource() == checkerItem)
1993
+ if (source == overlayItem || source == overlayButton)
15611994 {
15621995 /*
15631996 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2003,9 @@
15702003 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712004 LA.matInvert(obj.toParent, obj.fromParent);
15722005 */
1573
- makeSomething(new CheckerIG());
2006
+ makeSomething(new Checker());
15742007 } else
1575
- if (event.getSource() == meshItem)
2008
+ if (source == meshItem)
15762009 {
15772010 Object3D itemtomake = new Object3D();
15782011 Object3D child;
....@@ -1593,35 +2026,35 @@
15932026 makeSomething(child);
15942027 }
15952028 } else
1596
- if (event.getSource() == springItem)
2029
+ if (source == springItem)
15972030 {
15982031 cSpring s = new cSpring();
15992032 s.setup();
16002033 makeSomething(s);
16012034 } else
1602
- if (event.getSource() == flagItem)
2035
+ if (source == flagItem)
16032036 {
16042037 cSpring s = new cFlag();
16052038 s.setup();
16062039 makeSomething(s);
16072040 } else
1608
- if (event.getSource() == lightItem)
2041
+ if (source == lightItem || source == lightButton)
16092042 {
16102043 makeSomething(new Light());
16112044 } else
1612
- if (event.getSource() == csgItem)
2045
+ if (source == csgItem)
16132046 {
16142047 group(new CSG());
16152048 } else
1616
- if (event.getSource() == templateItem)
2049
+ if (source == templateItem)
16172050 {
16182051 group(new cTemplate());
16192052 } else
1620
- if (event.getSource() == attributeItem)
2053
+ if (source == attributeItem)
16212054 {
16222055 makeSomething(new Attribute());
16232056 } else
1624
- if (event.getSource() == pointflowItem)
2057
+ if (source == pointflowItem)
16252058 {
16262059 makeSomething(new PointFlow());
16272060 } else
....@@ -1633,7 +2066,7 @@
16332066 } else
16342067 */
16352068
1636
- if (event.getSource() == superLoopItem)
2069
+ if (source == superLoopItem)
16372070 {
16382071 Composite g = new cGroup();
16392072 for (int i=0; i<15; i++)
....@@ -1655,7 +2088,7 @@
16552088
16562089 group(g);
16572090 } else
1658
- if (event.getSource() == loopItem)
2091
+ if (source == loopItem || source == loopButton)
16592092 {
16602093 Composite csg = new GroupLeaf();
16612094 csg.count = 5;
....@@ -1664,7 +2097,7 @@
16642097 csg.addChild(child);
16652098 child.addChild(csg);
16662099 } else
1667
- if (event.getSource() == doubleItem)
2100
+ if (source == doubleItem)
16682101 {
16692102 Composite csg = new GroupLeaf();
16702103 csg.count = 5;
....@@ -1676,7 +2109,7 @@
16762109 csg.addChild(child);
16772110 child.addChild(csg);
16782111 } else
1679
- if (event.getSource() == tripleItem)
2112
+ if (source == tripleItem)
16802113 {
16812114 Composite csg = new GroupLeaf();
16822115 csg.count = 4;
....@@ -1691,71 +2124,83 @@
16912124 csg.addChild(child);
16922125 child.addChild(csg);
16932126 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2127
+ if (source == computeAOItem)
16962128 {
1697
- ImportGFD();
2129
+ Globals.drawMode = CameraPane.OCCLUSION;
2130
+ Globals.theRenderer.repaint();
16982131 } 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)
2132
+ if (source == recompileItem)
17172133 {
17182134 Recompile();
17192135 refreshContents();
17202136 } else
1721
- if (event.getSource() == editScriptItem)
2137
+ if (source == editScriptItem)
17222138 {
17232139 OpenDialog();
17242140 refreshContents();
17252141 } else
1726
- if (event.getSource() == invariantsItem)
2142
+ if (source == invariantsItem)
17272143 {
17282144 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2145
+ Grafreed.grafreeD.universe.invariants();
17302146 } else
1731
- if (event.getSource() == memoryItem)
2147
+ if (source == memoryItem)
17322148 {
17332149 //System.out.println("Invariants:");
17342150 PrintMemory();
17352151 } else
1736
- if (event.getSource() == pathItem)
2152
+ if (source == pathItem)
17372153 {
17382154 PrintPath();
17392155 } else
1740
- if (event.getSource() == analyzeItem)
2156
+ if (source == analyzeItem)
17412157 {
17422158 AnalyzeObject();
17432159 } else
1744
- if (event.getSource() == dumpItem)
2160
+ if (source == dumpItem)
17452161 {
17462162 DumpObject();
17472163 } else
1748
- if (event.getSource() == screenfitButton)
2164
+ if (source == minButton)
2165
+ {
2166
+ Minimize();
2167
+ } else
2168
+ if (source == maxButton)
2169
+ {
2170
+ Maximize();
2171
+ } else
2172
+ if (source == fullButton)
2173
+ {
2174
+ ToggleFullScreen();
2175
+ } else
2176
+ if (source == undoButton)
2177
+ {
2178
+ Undo();
2179
+ } else
2180
+ if (source == redoButton)
2181
+ {
2182
+ Redo();
2183
+ } else
2184
+ if (source == saveButton)
2185
+ {
2186
+ Save();
2187
+ } else
2188
+ if (source == oneStepButton)
2189
+ {
2190
+ Globals.ONESTEP = true;
2191
+ cameraView.repaint();
2192
+ } else
2193
+ if (source == screenfitButton)
17492194 {
17502195 //Reload(lastConverter, lastFilename, true);
17512196 ScreenFit();
17522197 } else
1753
- if (event.getSource() == screenfitpointButton)
2198
+ if (source == screenfitpointButton)
17542199 {
17552200 //Reload(lastConverter, lastFilename, true);
17562201 ScreenFitPoint();
17572202 } else
1758
- if (event.getSource() == snapobjectButton)
2203
+ if (source == snapobjectButton)
17592204 {
17602205 //Reload(lastConverter, lastFilename, true);
17612206 SnapObject();
....@@ -1766,13 +2211,13 @@
17662211 // Recompile();
17672212 // refreshContents();
17682213 // } else
1769
- if (event.getSource() == gcButton)
2214
+ if (source == gcButton)
17702215 {
17712216 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722217 System.gc();
17732218 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742219 } else
1775
- if (event.getSource() == editLeafItem)
2220
+ if (source == editLeafItem)
17762221 {
17772222 Object3D obj;
17782223 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2231,78 @@
17862231 }
17872232 refreshContents(true);
17882233 } else
1789
- if (event.getSource() == openWindowItem)
2234
+ if (source == openWindowItem)
17902235 {
17912236 EditSelection(true);
17922237 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2238
+ if (source == cutItem || source == clearButton)
17942239 {
17952240 loadClipboard(true);
17962241 } else
1797
- if (event.getSource() == duplicateItem)
2242
+ if (source == undoItem)
17982243 {
1799
- Object3D keep = GraphreeD.clipboard;
2244
+ Undo();
2245
+ } else
2246
+ if (source == redoItem)
2247
+ {
2248
+ Redo();
2249
+ } else
2250
+ if (source == duplicateItem)
2251
+ {
2252
+ Object3D keep = Grafreed.clipboard;
18002253 loadClipboard(false);
18012254 paste(false);
1802
- GraphreeD.clipboard = keep;
2255
+ Grafreed.clipboard = keep;
18032256 } else
1804
- if (event.getSource() == cloneItem)
2257
+ if (source == cloneItem)
18052258 {
18062259 CloneSelection(false);
18072260 } else
1808
- if (event.getSource() == cloneSupportItem)
2261
+ if (source == cloneSupportItem)
18092262 {
18102263 CloneSelection(true);
18112264 } else
1812
- if (event.getSource() == copyItem)
2265
+ if (source == copyItem)
18132266 {
18142267 loadClipboard(false);
18152268 } else
1816
- if (event.getSource() == pasteItem)
2269
+ if (source == pasteItem)
18172270 {
18182271 paste(false);
18192272 } else
1820
- if (event.getSource() == pasteLinkItem)
2273
+ if (source == pasteIntoItem)
18212274 {
1822
- pasteInto(false);
2275
+ pasteInto(true, false);
18232276 } else
1824
- if (event.getSource() == pasteCloneItem)
2277
+ if (source == pasteLinkItem)
18252278 {
1826
- pasteInto(true);
2279
+ pasteInto(false, false);
18272280 } else
1828
- if (event.getSource() == pasteExpandItem)
2281
+ if (source == pasteCloneItem)
2282
+ {
2283
+ pasteInto(true, true);
2284
+ } else
2285
+ if (source == pasteExpandItem)
18292286 {
18302287 paste(true);
18312288 } else
1832
- if (event.getSource() == synchronizeItem)
2289
+ if (source == synchronizeItem)
18332290 {
18342291 Overwrite(Object3D.TRANSFORM);
18352292 } else
1836
- if (event.getSource() == overwriteNameItem)
2293
+ if (source == overwriteNameItem)
18372294 {
18382295 Overwrite(Object3D.NAME);
18392296 } else
1840
- if (event.getSource() == overwriteUVItem)
2297
+ if (source == overwriteUVItem)
18412298 {
18422299 Overwrite(Object3D.UV);
18432300 } else
1844
- if (event.getSource() == overwriteMatItem)
2301
+ if (source == overwriteMatItem)
18452302 {
2303
+ /* july 2015
18462304 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2305
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482306 else
18492307 {
18502308 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2314,16 @@
18562314 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572315 }
18582316 }
2317
+ */
2318
+
2319
+ Overwrite(dropAttributes);
18592320 }
1860
- if (event.getSource() == overwriteGeoItem)
2321
+ if (source == overwriteGeoItem)
18612322 {
18622323 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2324
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642325 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2326
+// Object3D content = GrafreeD.clipboard.get(0);
18662327 //
18672328 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682329 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2335,7 @@
18742335 // refreshContents();
18752336 // }
18762337 } else
1877
- if (event.getSource() == generateMeshItem)
2338
+ if (source == generateMeshItem)
18782339 {
18792340 //if (group.selection.size() == 1)
18802341 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2346,7 @@
18852346 ResetModel();
18862347 refreshContents();
18872348 } else
1888
- if (event.getSource() == extractGeometriesItem)
2349
+ if (source == extractGeometriesItem)
18892350 {
18902351 boolean one = false;
18912352
....@@ -1912,7 +2373,7 @@
19122373 ResetModel();
19132374 refreshContents();
19142375 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2376
+ if (source == cloneGeometriesItem)
19162377 {
19172378 boolean one = false;
19182379
....@@ -1938,32 +2399,37 @@
19382399 ResetModel();
19392400 refreshContents();
19402401 } else
1941
- if (event.getSource() == shareGeometriesItem)
2402
+ if (source == shareGeometriesItem)
19422403 {
19432404 boolean one = false;
19442405
19452406 if (group.selection.size() == 1)
19462407 one = true;
19472408
2409
+ Object3D merge = null;
2410
+
19482411 Object3D content = new cGroup();
19492412
19502413 for (int i=0; i<group.selection.size(); i++)
19512414 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2415
+ merge = new Merge(group.selection.get(i));
19532416
19542417 if (one)
1955
- makeSomething(sel, false);
2418
+ makeSomething(merge, false);
19562419 else
1957
- content.addChild(sel);
2420
+ content.addChild(merge);
19582421 }
19592422
19602423 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2424
+ makeSomething(content, true);
2425
+ else
2426
+ {
2427
+ ResetModel();
2428
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2429
+ refreshContents();
2430
+ }
19652431 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2432
+ if (source == mergeGeometriesItem)
19672433 {
19682434 boolean one = false;
19692435
....@@ -1993,11 +2459,11 @@
19932459 ResetModel();
19942460 refreshContents();
19952461 } else
1996
- if (event.getSource() == linkverticesItem)
2462
+ if (source == linkverticesItem)
19972463 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2464
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992465 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2466
+// Object3D content = GrafreeD.clipboard.get(0);
20012467 //
20022468 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032469 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2472,48 @@
20062472 // group.selection.get(0).setMasterThis(content); // should be identity
20072473 // refreshContents();
20082474 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2475
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102476 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2477
+ Object3D content = Grafreed.clipboard.get(0);
20122478
20132479 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142480 content = ((cGroup)content).get(0);
20152481
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2482
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172483 for (int i=0; i<group.selection.size(); i++)
20182484 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2485
+ boolean random = CameraPane.SWITCH;
2486
+ CameraPane.SWITCH = false; // parse all random nodes
20212487 group.selection.get(i).linkVerticesThis(content);
20222488 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2489
+ CameraPane.SWITCH = random;
20242490 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2491
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262492 refreshContents();
20272493 }
20282494 } else
2029
- if (event.getSource() == resetsupportItem)
2495
+ if (source == resetsupportItem)
20302496 {
20312497 for (int i=0; i<group.selection.size(); i++)
20322498 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
20352501 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2502
+ CameraPane.SWITCH = random;
20372503 }
20382504
20392505 refreshContents();
20402506 } else
2041
- if (event.getSource() == resetreferencesItem)
2507
+ if (source == relinkverticesItem)
2508
+ {
2509
+ boolean random = CameraPane.SWITCH;
2510
+ CameraPane.SWITCH = false; // parse all random nodes
2511
+ group.selection.RelinkToSupport();
2512
+ CameraPane.SWITCH = random;
2513
+
2514
+ refreshContents();
2515
+ } else
2516
+ if (source == resetreferencesItem)
20422517 {
20432518 for (int i=0; i<group.selection.size(); i++)
20442519 {
....@@ -2047,11 +2522,11 @@
20472522
20482523 refreshContents();
20492524 } else
2050
- if (event.getSource() == setMasterItem)
2525
+ if (source == setMasterItem)
20512526 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2527
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532528 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2529
+ Object3D content = Grafreed.clipboard.get(0);
20552530
20562531 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572532 content = ((cGroup)content).get(0);
....@@ -2060,13 +2535,13 @@
20602535 refreshContents();
20612536 }
20622537 } else
2063
- if (event.getSource() == poseMeshItem)
2538
+ if (source == poseMeshItem)
20642539 {
20652540 if (group.selection.size() == 1)
20662541 {
2067
- if (GraphreeD.clipboard.size() == 1)
2542
+ if (Grafreed.clipboard.size() == 1)
20682543 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2544
+ Object3D content = Grafreed.clipboard.get(0);
20702545
20712546 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722547 content = ((cGroup)content).get(0);
....@@ -2079,19 +2554,19 @@
20792554 }
20802555
20812556 } else
2082
- if (event.getSource() == revertMeshItem)
2557
+ if (source == revertMeshItem)
20832558 {
20842559 RevertMeshes();
20852560 } else
2086
- if (event.getSource() == resetMeshItem)
2561
+ if (source == resetAllItem)
20872562 {
20882563 ResetAll();
20892564 } else
2090
- if (event.getSource() == stepAllItem)
2565
+ if (source == stepAllItem)
20912566 {
20922567 StepAll();
20932568 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2569
+ if (source == clearItem) // || event.getSource() == clearButton)
20952570 {
20962571 //int indices[] = jList.getSelectedIndices();
20972572 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2574,46 @@
20992574
21002575 ClearSelection(false);
21012576 } else
2102
- if (event.getSource() == clearAllItem)
2577
+ if (source == clearAllItem)
21032578 {
21042579 ClearSelection(true);
21052580 } else
2106
- if (event.getSource() == grabItem)
2581
+ if (source == grabItem || source == groupButton)
21072582 {
2108
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
21092584 } else
2110
- if (event.getSource() == frontItem)
2585
+ if (source == hideItem)
2586
+ {
2587
+ group(new HiddenObject());
2588
+ } else
2589
+ if (source == frontItem)
21112590 {
21122591 front();
21132592 } else
2114
- if (event.getSource() == backItem)
2593
+ if (source == backItem)
21152594 {
21162595 back();
21172596 } else
2118
- if (event.getSource() == cameraItem)
2597
+ if (source == cameraItem)
21192598 {
21202599 makeSomething(new Camera());
21212600 } else
2122
- if (event.getSource() == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
21232602 {
21242603 group(new Composite());
21252604 } else
2126
- if (event.getSource() == randomItem)
2605
+ if (source == switchItem || source == switchButton)
21272606 {
21282607 RandomNode random = new RandomNode();
21292608 group(random);
21302609 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2610
+ random.name = random.get(0).name + "Switch";
21322611 } else
2133
- if (event.getSource() == physicsItem)
2612
+ if (source == physicsItem)
21342613 {
21352614 group(new PhysicsNode());
21362615 } else
2137
- if (event.getSource() == frameselectorItem)
2616
+ if (source == frameselectorItem)
21382617 {
21392618 for (int i=0; i<group.selection.size(); i++)
21402619 {
....@@ -2146,7 +2625,7 @@
21462625 ResetModel();
21472626 refreshContents();
21482627 } else
2149
- if (event.getSource() == switchGeoItem)
2628
+ if (source == switchGeoItem)
21502629 {
21512630 for (int i=0; i<group.selection.size(); i++)
21522631 {
....@@ -2158,7 +2637,7 @@
21582637 ResetModel();
21592638 refreshContents();
21602639 } else
2161
- if (event.getSource() == switchTransfoItem)
2640
+ if (source == switchTransfoItem)
21622641 {
21632642 for (int i=0; i<group.selection.size(); i++)
21642643 {
....@@ -2170,7 +2649,7 @@
21702649 ResetModel();
21712650 refreshContents();
21722651 } else
2173
- if (event.getSource() == morphItem)
2652
+ if (source == morphItem)
21742653 {
21752654 for (int i=0; i<group.selection.size(); i++)
21762655 {
....@@ -2182,7 +2661,7 @@
21822661 ResetModel();
21832662 refreshContents();
21842663 } else
2185
- if (event.getSource() == scriptNodeItem)
2664
+ if (source == scriptNodeItem)
21862665 {
21872666 boolean atleastone = false;
21882667
....@@ -2221,191 +2700,239 @@
22212700 }
22222701 }
22232702 } else
2224
- if (event.getSource() == linkerItem)
2703
+ if (source == linkerItem)
22252704 {
22262705 group(new cLinker());
22272706 } else
2228
- if (event.getSource() == textureItem)
2707
+ if (source == textureItem || source == textureButton)
22292708 {
22302709 group(new TextureNode());
22312710 } else
2232
- if (event.getSource() == shadowXItem)
2711
+ if (source == billboardItem)
2712
+ {
2713
+ group(new BillboardNode());
2714
+ } else
2715
+ if (source == shadowXItem)
22332716 {
22342717 CastShadow(0);
22352718 } else
2236
- if (event.getSource() == shadowYItem)
2719
+ if (source == shadowYItem)
22372720 {
22382721 CastShadow(1);
22392722 } else
2240
- if (event.getSource() == shadowZItem)
2723
+ if (source == shadowZItem)
22412724 {
22422725 CastShadow(2);
22432726 } else
2244
- if (event.getSource() == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
22452728 {
2246
- ungroup();
2729
+ //ungroup();
2730
+ for (int i=0; i<group.selection.size(); i++)
2731
+ {
2732
+ Ungroup(group.selection.get(i));
2733
+ }
2734
+
2735
+ ClearSelection(false);
2736
+
2737
+ refreshContents();
22472738 } else
2248
- if (event.getSource() == genUVItem)
2739
+ if (source == genUVItem)
22492740 {
22502741 GenUV();
22512742 } else
2252
- if (event.getSource() == genNormalsCADItem)
2743
+ if (source == genNormalsCADItem)
22532744 {
22542745 GenNormals(true);
22552746 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2747
+ if (source == genNormalsMESHItem)
2748
+ {
2749
+ GenNormalsMESH();
2750
+ } else
2751
+ if (source == genNormalsORGANItem)
22572752 {
22582753 GenNormals(false);
22592754 } else
2260
- if (event.getSource() == stripifyItem)
2755
+ if (source == genNormalsMINEItem)
2756
+ {
2757
+ GenNormalsMINE();
2758
+ } else
2759
+ if (source == stripifyItem)
22612760 {
22622761 Stripify();
22632762 } else
2264
- if (event.getSource() == unstripifyItem)
2763
+ if (source == unstripifyItem)
22652764 {
22662765 Unstripify();
22672766 } else
2268
- if (event.getSource() == trimItem)
2767
+ if (source == trimItem)
22692768 {
22702769 Trim();
22712770 } else
2272
- if (event.getSource() == untrimItem)
2771
+ if (source == untrimItem)
22732772 {
22742773 Untrim();
22752774 } else
2276
- if (event.getSource() == clearColorsItem)
2775
+ if (source == clearColorsItem)
22772776 {
22782777 ClearColors();
22792778 } else
2280
- if (event.getSource() == clearMaterialsItem)
2779
+ if (source == clearMaterialsItem)
22812780 {
22822781 ClearMaterials();
22832782 } else
2284
- if (event.getSource() == liveleavesItem)
2783
+ if (source == liveleavesItem)
22852784 {
22862785 LiveLeaves(true);
22872786 } else
2288
- if (event.getSource() == unliveleavesItem)
2787
+ if (source == unliveleavesItem)
22892788 {
22902789 LiveLeaves(false);
22912790 } else
2292
- if (event.getSource() == supportleavesItem)
2791
+ if (source == supportleavesItem)
22932792 {
22942793 SupportLeaves(true);
22952794 } else
2296
- if (event.getSource() == unsupportleavesItem)
2795
+ if (source == unsupportleavesItem)
22972796 {
22982797 SupportLeaves(false);
22992798 } else
2300
- if (event.getSource() == hideleavesItem)
2799
+ if (source == hideleavesItem)
23012800 {
23022801 HideLeaves(true);
23032802 } else
2304
- if (event.getSource() == showleavesItem)
2803
+ if (source == showleavesItem)
23052804 {
23062805 HideLeaves(false);
23072806 } else
2308
- if (event.getSource() == markleavesItem)
2807
+ if (source == markleavesItem)
23092808 {
23102809 MarkLeaves(true);
23112810 } else
2312
- if (event.getSource() == unmarkleavesItem)
2811
+ if (source == unmarkleavesItem)
23132812 {
23142813 MarkLeaves(false);
23152814 } else
2316
- if (event.getSource() == flipVItem)
2815
+ if (source == rewindleavesItem)
2816
+ {
2817
+ RewindLeaves(true);
2818
+ } else
2819
+ if (source == unrewindleavesItem)
2820
+ {
2821
+ RewindLeaves(false);
2822
+ } else
2823
+ if (source == randomleavesItem)
2824
+ {
2825
+ RandomLeaves(true);
2826
+ } else
2827
+ if (source == unrandomleavesItem)
2828
+ {
2829
+ RandomLeaves(false);
2830
+ } else
2831
+ if (source == flipVItem)
23172832 {
23182833 FlipV(true);
23192834 } else
2320
- if (event.getSource() == unflipVItem)
2835
+ if (source == unflipVItem)
23212836 {
23222837 FlipV(false);
23232838 } else
2324
- if (event.getSource() == lowTexturesItem)
2839
+ if (source == lowTexturesItem)
23252840 {
23262841 SetTexRes(0);
23272842 } else
2328
- if (event.getSource() == normalTexturesItem)
2843
+ if (source == normalTexturesItem)
23292844 {
23302845 SetTexRes(1);
23312846 } else
2332
- if (event.getSource() == highTexturesItem)
2847
+ if (source == highTexturesItem)
23332848 {
23342849 SetTexRes(2);
23352850 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2851
+ if (source == veryhighTexturesItem)
23372852 {
23382853 SetTexRes(3);
23392854 } else
2340
- if (event.getSource() == maxTexturesItem)
2855
+ if (source == maxTexturesItem)
23412856 {
23422857 SetTexRes(4);
23432858 } else
2344
- if (event.getSource() == panoTexturesItem)
2859
+ if (source == panoTexturesItem)
23452860 {
23462861 SetTexRes(5);
23472862 } else
2348
- if (event.getSource() == reverseNormalsItem)
2863
+ if (source == reverseNormalsItem)
23492864 {
23502865 ReverseNormals();
23512866 } else
2352
- if (event.getSource() == parseverticesItem)
2867
+ if (source == parseverticesItem)
23532868 {
23542869 ParseVertices();
23552870 } else
2356
- if (event.getSource() == alignItem)
2871
+ if (source == textureFieldItem)
2872
+ {
2873
+ TextureVertices();
2874
+ } else
2875
+ if (source == alignItem)
23572876 {
23582877 Align();
23592878 } else
2360
- if (event.getSource() == mirrorItem)
2879
+ if (source == mirrorItem)
23612880 {
23622881 MirrorPoses();
23632882 } else
2364
- if (event.getSource() == reduceMorphItem)
2883
+ if (source == reduceMorphItem)
23652884 {
23662885 MeshReduction(false);
23672886 } else
2368
- if (event.getSource() == reduce34MorphItem)
2887
+ if (source == reduce34MorphItem)
23692888 {
23702889 MeshReduction(true);
23712890 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2891
+ if (source == reverseTrianglesItem)
23732892 {
23742893 ReverseTriangles();
23752894 } else
2376
- if (event.getSource() == reduceMeshItem)
2895
+ if (source == reduceMeshItem)
23772896 {
23782897 ReduceMesh(false);
23792898 } else
2380
- if (event.getSource() == reduce34MeshItem)
2899
+ if (source == reduce34MeshItem)
23812900 {
23822901 ReduceMesh(true);
23832902 } else
2384
- if (event.getSource() == increaseMeshItem)
2903
+ if (source == increaseMeshItem)
23852904 {
23862905 IncreaseMesh();
23872906 } else
2388
- if (event.getSource() == clipMeshItem)
2907
+ if (source == clipMeshItem)
23892908 {
23902909 ClipMesh();
23912910 } else
2392
- if (event.getSource() == smoothMeshItem)
2911
+ if (source == smoothMeshItem)
23932912 {
23942913 SmoothMesh();
23952914 } else
2396
- if (event.getSource() == transformgeometryItem)
2915
+ if (source == transformGeometryItem)
23972916 {
23982917 TransformGeometry();
23992918 } else
2400
- if (event.getSource() == resetTransformItem)
2919
+ if (source == transformChildrenItem)
2920
+ {
2921
+ TransformChildren();
2922
+ } else
2923
+ if (source == resetTransformItem)
24012924 {
24022925 ResetTransform();
24032926 } else
2404
- if (event.getSource() == resetCentroidItem)
2927
+ if (source == resetCentroidItem)
24052928 {
2406
- ResetCentroid();
2929
+ ResetCentroid(true);
24072930 } else
2408
- if (event.getSource() == resetParentItem)
2931
+ if (source == resetCentroidXZItem)
2932
+ {
2933
+ ResetCentroid(false);
2934
+ } else
2935
+ if (source == resetParentItem)
24092936 {
24102937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112938 {
....@@ -2415,7 +2942,7 @@
24152942
24162943 refreshContents();
24172944 } else
2418
- if (event.getSource() == repairParentItem)
2945
+ if (source == repairParentItem)
24192946 {
24202947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212948 {
....@@ -2429,7 +2956,21 @@
24292956
24302957 refreshContents();
24312958 } else
2432
- if (event.getSource() == sortbysizeItem)
2959
+ if (source == repairShadowItem)
2960
+ {
2961
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2962
+ {
2963
+ Object3D obj = (Object3D)e.nextElement();
2964
+ obj.RepairShadow();
2965
+// for (int i=0; i<obj.size(); i++)
2966
+// {
2967
+// obj.get(i).parent = obj;
2968
+// }
2969
+ }
2970
+
2971
+ refreshContents();
2972
+ } else
2973
+ if (source == sortbysizeItem)
24332974 {
24342975 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352976 {
....@@ -2441,7 +2982,7 @@
24412982 ResetModel();
24422983 refreshContents();
24432984 } else
2444
- if (event.getSource() == sortbynameItem)
2985
+ if (source == sortbynameItem)
24452986 {
24462987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472988 {
....@@ -2453,7 +2994,7 @@
24532994 ResetModel();
24542995 refreshContents();
24552996 } else
2456
- if (event.getSource() == attachPigmentItem)
2997
+ if (source == attachPigmentItem)
24572998 {
24582999 String texture = GetFile("Attach pigment");
24593000 Object3D obj;
....@@ -2465,7 +3006,7 @@
24653006
24663007 refreshContents();
24673008 } else
2468
- if (event.getSource() == detachPigmentItem)
3009
+ if (source == detachPigmentItem)
24693010 {
24703011 Object3D obj;
24713012 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3017,7 @@
24763017
24773018 refreshContents();
24783019 } else
2479
- if (event.getSource() == attachBumpItem)
3020
+ if (source == attachBumpItem)
24803021 {
24813022 String texture = GetFile("Attach bump");
24823023 Object3D obj;
....@@ -2488,7 +3029,7 @@
24883029
24893030 refreshContents();
24903031 } else
2491
- if (event.getSource() == detachBumpItem)
3032
+ if (source == detachBumpItem)
24923033 {
24933034 Object3D obj;
24943035 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +3040,7 @@
24993040
25003041 refreshContents();
25013042 } else
2502
- if (event.getSource() == pigmentBumpItem)
3043
+ if (source == pigmentBumpItem)
25033044 {
25043045 Object3D obj;
25053046 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3051,237 @@
25103051
25113052 refreshContents();
25123053 } else
2513
- if (event.getSource() == flashSelectionButton)
3054
+ if (source == flashSelectionButton)
25143055 {
25153056 CameraPane.flash = true;
25163057 refreshContents();
25173058 } else
2518
- if (event.getSource() == oneButton)
3059
+ if (source == oneButton)
25193060 {
25203061 } else
2521
- if (event.getSource() == twoButton)
3062
+ if (source == twoButton)
25223063 {
25233064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
25243069 // bug
25253070 //gridPanel.setDividerLocation(1.0);
25263071 //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();
3072
+// bigThree.remove(scenePanel);
3073
+// bigThree.remove(centralPanel);
3074
+// bigThree.remove(XYZPanel);
3075
+// aWindowConstraints.gridx = 0;
3076
+// aWindowConstraints.gridy = 0;
3077
+// aWindowConstraints.gridwidth = 1;
3078
+// // aConstraints.gridheight = 3;
3079
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3080
+// aWindowConstraints.weightx = 0;
3081
+// aWindowConstraints.weighty = 1;
3082
+// //bigThree.add(jtp, aWindowConstraints);
3083
+// aWindowConstraints.weightx = 1;
3084
+// aWindowConstraints.gridwidth = 3;
3085
+// // aConstraints.gridheight = 3;
3086
+// aWindowConstraints.gridx = 1;
3087
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3088
+// bigThree.add(centralPanel, aWindowConstraints);
3089
+// aWindowConstraints.weightx = 0;
3090
+// aWindowConstraints.gridx = 4;
3091
+// aWindowConstraints.gridwidth = 1;
3092
+// // aConstraints.gridheight = 3;
3093
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3094
+// //bigThree.add(XYZPanel, aWindowConstraints);
3095
+// scenePanel.setVisible(false);
3096
+// centralPanel.setVisible(true);
3097
+// XYZPanel.setVisible(false);
3098
+ bigThree.ClearUI();
3099
+ bigThree.add(centralPanel);
3100
+ bigThree.FlushUI();
3101
+
3102
+ cameraView.requestFocusInWindow();
3103
+
3104
+// refreshContents(true);
3105
+//
3106
+// try
3107
+// {
3108
+// java.awt.Robot bot = new java.awt.Robot();
3109
+// int mask = InputEvent.BUTTON1_MASK;
3110
+// bot.mouseMove(100, 100);
3111
+// bot.mousePress(mask);
3112
+// bot.mouseRelease(mask);
3113
+// }
3114
+// catch (Exception e)
3115
+// {
3116
+//
3117
+// }
3118
+
25513119 } else
2552
- if (event.getSource() == threeButton)
3120
+ if (source == threeButton)
25533121 {
25543122 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();
3123
+
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
3126
+
3127
+// bigThree.remove(scenePanel);
3128
+// bigThree.remove(centralPanel);
3129
+// bigThree.remove(XYZPanel);
3130
+// aWindowConstraints.gridx = 0;
3131
+// aWindowConstraints.gridy = 0;
3132
+// aWindowConstraints.gridwidth = 1;
3133
+// // aConstraints.gridheight = 3;
3134
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3135
+// aWindowConstraints.weightx = 0;
3136
+// aWindowConstraints.weighty = 1;
3137
+// //bigThree.add(jtp, aWindowConstraints);
3138
+// aWindowConstraints.weightx = 1;
3139
+// aWindowConstraints.gridwidth = 3;
3140
+// // aConstraints.gridheight = 3;
3141
+// aWindowConstraints.gridx = 1;
3142
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3143
+// bigThree.add(centralPanel, aWindowConstraints);
3144
+// aWindowConstraints.weightx = 0;
3145
+// aWindowConstraints.gridx = 4;
3146
+// aWindowConstraints.gridwidth = 1;
3147
+// // aConstraints.gridheight = 3;
3148
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3149
+// bigThree.add(XYZPanel, aWindowConstraints);
3150
+// bigThree.validate();
3151
+// scenePanel.setVisible(false);
3152
+// centralPanel.setVisible(true);
3153
+// XYZPanel.setVisible(true);
3154
+ bigThree.ClearUI();
3155
+ bigThree.add(centralPanel);
3156
+ bigThree.add(XYZPanel);
3157
+ bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
25793160 } else
2580
- if (event.getSource() == fourButton)
3161
+ if (source == fourButton)
25813162 {
25823163 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();
3164
+
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
3167
+
3168
+// bigThree.remove(scenePanel);
3169
+// bigThree.remove(centralPanel);
3170
+// bigThree.remove(XYZPanel);
3171
+// aWindowConstraints.gridx = 0;
3172
+// aWindowConstraints.gridy = 0;
3173
+// aWindowConstraints.gridwidth = 1;
3174
+// // aWindowConstraints.gridheight = 3;
3175
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3176
+// aWindowConstraints.weightx = 1;
3177
+// aWindowConstraints.weighty = 1;
3178
+// bigThree.add(scenePanel, aWindowConstraints);
3179
+// aWindowConstraints.weightx = 1;
3180
+// aWindowConstraints.gridwidth = 3;
3181
+// // aConstraints.gridheight = 3;
3182
+// aWindowConstraints.gridx = 1;
3183
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3184
+// //bigThree.add(cameraPanel, aWindowConstraints);
3185
+// aWindowConstraints.weightx = 0;
3186
+// aWindowConstraints.gridx = 4;
3187
+// aWindowConstraints.gridwidth = 1;
3188
+// // aWindowConstraints.gridheight = 3;
3189
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3190
+// //bigThree.add(XYZPanel, aWindowConstraints);
3191
+// bigThree.validate();
3192
+// scenePanel.setVisible(true);
3193
+// centralPanel.setVisible(false);
3194
+// XYZPanel.setVisible(false);
3195
+ bigThree.ClearUI();
3196
+ bigThree.add(scenePanel);
3197
+ bigThree.FlushUI();
3198
+
3199
+ cameraView.requestFocusInWindow();
26073200 } else
2608
- if (event.getSource() == sixButton)
3201
+ if (source == sixButton)
26093202 {
26103203 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();
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
3207
+
3208
+// bigThree.remove(scenePanel);
3209
+// bigThree.remove(centralPanel);
3210
+// bigThree.remove(XYZPanel);
3211
+// aWindowConstraints.gridx = 0;
3212
+// aWindowConstraints.gridy = 0;
3213
+// aWindowConstraints.gridwidth = 1;
3214
+// // aConstraints.gridheight = 3;
3215
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3216
+// aWindowConstraints.weightx = 0;
3217
+// aWindowConstraints.weighty = 1;
3218
+// bigThree.add(scenePanel, aWindowConstraints);
3219
+// aWindowConstraints.weightx = 1;
3220
+// aWindowConstraints.gridwidth = 3;
3221
+// // aWindowConstraints.gridheight = 3;
3222
+// aWindowConstraints.gridx = 1;
3223
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3224
+// bigThree.add(centralPanel, aWindowConstraints);
3225
+// aWindowConstraints.weightx = 0;
3226
+// aWindowConstraints.gridx = 4;
3227
+// aWindowConstraints.gridwidth = 1;
3228
+// // aWindowConstraints.gridheight = 3;
3229
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3230
+// //bigThree.add(XYZPanel, aConstraints);
3231
+// bigThree.validate();
3232
+// scenePanel.setVisible(true);
3233
+// centralPanel.setVisible(true);
3234
+// XYZPanel.setVisible(false);
3235
+ bigThree.ClearUI();
3236
+ bigThree.add(scenePanel);
3237
+ bigThree.add(centralPanel);
3238
+ bigThree.FlushUI();
3239
+
3240
+ cameraView.requestFocusInWindow();
26353241 } else
2636
- if (event.getSource() == sevenButton)
3242
+ if (source == sevenButton)
26373243 {
26383244 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();
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
3248
+
3249
+// bigThree.remove(scenePanel);
3250
+// bigThree.remove(centralPanel);
3251
+// bigThree.remove(XYZPanel);
3252
+// aWindowConstraints.gridx = 0;
3253
+// aWindowConstraints.gridy = 0;
3254
+// aWindowConstraints.gridwidth = 1;
3255
+// // aWindowConstraints.gridheight = 3;
3256
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3257
+// aWindowConstraints.weightx = 0;
3258
+// aWindowConstraints.weighty = 1;
3259
+// bigThree.add(scenePanel, aWindowConstraints);
3260
+// aWindowConstraints.weightx = 1;
3261
+// aWindowConstraints.gridwidth = 3;
3262
+// // aWindowConstraints.gridheight = 3;
3263
+// aWindowConstraints.gridx = 1;
3264
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3265
+// bigThree.add(centralPanel, aWindowConstraints);
3266
+// aWindowConstraints.weightx = 0;
3267
+// aWindowConstraints.gridx = 4;
3268
+// aWindowConstraints.gridwidth = 1;
3269
+// // aConstraints.gridheight = 3;
3270
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3271
+// bigThree.add(XYZPanel, aWindowConstraints);
3272
+// bigThree.validate();
3273
+// scenePanel.setVisible(true);
3274
+// centralPanel.setVisible(true);
3275
+// XYZPanel.setVisible(true);
3276
+ bigThree.ClearUI();
3277
+ bigThree.add(scenePanel);
3278
+ bigThree.add(centralPanel);
3279
+ bigThree.add(XYZPanel);
3280
+ bigThree.FlushUI();
3281
+
3282
+ cameraView.requestFocusInWindow();
26633283 } else
2664
- if (event.getSource() == rootButton)
3284
+ if (source == rootButton)
26653285 {
26663286 Object3D obj;
26673287 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,34 +3291,44 @@
26713291 EditObject(obj);
26723292 }
26733293
3294
+ cameraView.requestFocusInWindow();
26743295 refreshContents(true);
26753296 } else
2676
- if (event.getSource() == closeButton)
3297
+ if (source == closeButton)
26773298 {
26783299 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793300 cRadio ab;
26803301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813302 {
26823303 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
26853312 buttonGroup.remove(ab);
26863313 radioPanel.remove(ab);
26873314
2688
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
26893317 // ab.GetObject().objectUI = null; // ?????????
26903318
26913319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923320 break;
26933321 }
26943322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
26953325 refreshContents(true);
26963326 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3327
+ if (source == editItem || source == editButton)
26983328 {
26993329 EditSelection(false);
27003330 } else
2701
- if (event.getSource() == uneditButton)
3331
+ if (source == uneditButton)
27023332 {
27033333 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043334 {
....@@ -2708,14 +3338,14 @@
27083338 child.CloseUI();
27093339 listUI.remove(child);
27103340
2711
- child.editWindow = null; // ???????????
3341
+ //child.editWindow = null; // ???????????
27123342 }
2713
- objEditor.ctrlPanel.revalidate();
3343
+ objEditor.ctrlPanel.FlushUI();
27143344 //objEditor.jTree.clearSelection();
27153345 //objEditor.ResetSliders();
27163346 refreshContents(true);
27173347 } else
2718
- if (event.getSource() == clearPanelButton)
3348
+ if (source == clearPanelButton)
27193349 {
27203350 assert(copy == group);
27213351 //copy.ClearUI();
....@@ -2726,7 +3356,7 @@
27263356 listUI.clear();
27273357 refreshContents(true);
27283358 } else
2729
- if (event.getSource() == allParamsButton)
3359
+ if (source == allParamsButton)
27303360 {
27313361 assert(copy == group);
27323362
....@@ -2747,19 +3377,19 @@
27473377
27483378 refreshContents(true);
27493379 } else
2750
- if (event.getSource() == unselectButton)
3380
+ if (source == unselectButton)
27513381 {
27523382 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3383
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543384 objEditor.ResetSliders();
27553385 refreshContents(true);
27563386 } else
2757
- if(event.getSource() instanceof cRadio)
3387
+ if(source instanceof cRadio)
27583388 {
27593389 group.parent = keepparent;
27603390 group.attributes = 0;
27613391 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3392
+ /*cRadio*/ radio = (cRadio)source;
27633393 Object3D obj = radio.GetObject();
27643394 System.out.println("Edit " + obj);
27653395 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3409,7 @@
27793409 }
27803410
27813411 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3412
+ //Globals.theRenderer.object = group;
27833413 if(!useclient)
27843414 {
27853415 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3418,17 @@
27883418 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893419 cameraView.targetLookAt.set(radio.camera.lookAt);
27903420 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3421
+ //cameraView.lighttouched = true;
3422
+ Globals.lighttouched = true;
27923423 topView.object = group;
27933424 frontView.object = group;
27943425 sideView.object = group;
27953426 }
2796
- group.editWindow = this;
3427
+
3428
+// fix "+" issue
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
3431
+
27973432 /*
27983433 currentLayout = radio.layout;
27993434 if (currentLayout == null)
....@@ -2805,8 +3440,23 @@
28053440 //group.parent = null; // ROOT
28063441 //group.attributes = -1;
28073442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
28083445 refreshContents(true);
2809
- }
3446
+ } else if (event.getSource() == editCameraItem)
3447
+ {
3448
+ cameraView.ProtectCamera();
3449
+ cameraView.repaint();
3450
+ return;
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3452
+ {
3453
+ cameraView.RevertCamera();
3454
+ cameraView.repaint();
3455
+ return;
3456
+ // } else if (event.getSource() == textureButton)
3457
+ // {
3458
+ // return; // true;
3459
+ }
28103460 else
28113461 {
28123462 //return super.action(event, arg);
....@@ -2815,7 +3465,6 @@
28153465 }
28163466
28173467 boolean useclient = false;
2818
- cRadio radio;
28193468
28203469 void ToggleRoot()
28213470 {
....@@ -2824,7 +3473,7 @@
28243473 if (useclient)
28253474 {
28263475 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3476
+ Globals.lighttouched = true;
28283477 //topView.object = client;
28293478 //frontView.object = client;
28303479 //sideView.object = client;
....@@ -2832,7 +3481,7 @@
28323481 else
28333482 {
28343483 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3484
+ Globals.lighttouched = true;
28363485 //topView.object = group;
28373486 //frontView.object = group;
28383487 //sideView.object = group;
....@@ -2867,6 +3516,28 @@
28673516 refreshContents();
28683517 }
28693518
3519
+ void TransformChildren()
3520
+ {
3521
+ Object3D obj;
3522
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3523
+ {
3524
+ obj = (Object3D)e.nextElement();
3525
+ obj.KeepTextureMatrices();
3526
+ obj.TransformChildren();
3527
+ obj.RestoreTextureMatrices();
3528
+
3529
+// if (obj.parent == null)
3530
+// {
3531
+// System.out.println("NULL PARENT!");
3532
+// new Exception().printStackTrace();
3533
+// }
3534
+// else
3535
+// TouchTransform(obj);
3536
+// //obj.parent.Touch();
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
28703541
28713542 void ResetTransform()
28723543 {
....@@ -2979,7 +3650,7 @@
29793650 refreshContents();
29803651 }
29813652
2982
- void ResetCentroid()
3653
+ void ResetCentroid(boolean full)
29833654 {
29843655 Object3D obj;
29853656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3665,16 @@
29943665 LA.matIdentity(Object3D.mat);
29953666 obj.getBounds(minima, maxima, false);
29963667 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3668
+ if (full)
3669
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983670 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993671 obj.TransformMesh(Object3D.mat);
3672
+
30003673 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3674
+ if (full)
3675
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023676 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3677
+
30033678 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043679 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053680 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3703,8 @@
30283703
30293704 int size = obj.MemorySize();
30303705
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3706
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3707
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323708 }
30333709 }
30343710 catch (Exception e)
....@@ -3065,9 +3741,9 @@
30653741 obj = (Object3D)e.nextElement();
30663742
30673743 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3744
+ Grafreed.AnalyzeObject(obj);
30693745 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3746
+ Grafreed.AnalyzeObject(obj.bRep);
30713747
30723748 // System.err.println((size/1024) + " KB is the size of " + obj);
30733749 }
....@@ -3109,6 +3785,20 @@
31093785 void GenNormals(boolean crease)
31103786 {
31113787 group.GenNormalsS(crease);
3788
+
3789
+ refreshContents();
3790
+ }
3791
+
3792
+ void GenNormalsMESH()
3793
+ {
3794
+ group.GenNormalsMeshS();
3795
+
3796
+ refreshContents();
3797
+ }
3798
+
3799
+ void GenNormalsMINE()
3800
+ {
3801
+ group.selection.GenNormalsMINE();
31123802
31133803 refreshContents();
31143804 }
....@@ -3157,104 +3847,259 @@
31573847
31583848 //Object3D buffer;
31593849 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
-
3850
+// BoundaryRep temprep;
3851
+// Object3D nodes;
3852
+// Vector<Vertex> vertices;
3853
+//
3854
+// cGroup buffer;
3855
+//
3856
+// public void Vertex(Object3D node, Vertex v)
3857
+// {
3858
+//// vertices.add(v);
3859
+//// nodes.addElement(node);
3860
+////
3861
+//// if (temprep.GetCache(v) != null)
3862
+//// {
3863
+//// temprep.Remove(v);
3864
+//// } else
3865
+//// {
3866
+//// temprep.Remember(v);
3867
+//// }
3868
+//
3869
+// //Object3D node = nodes.get(index);
3870
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3871
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3872
+//
3873
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3874
+//
3875
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3876
+//
3877
+// cGroup g = new cGroup();
3878
+//
3879
+// if (g.toParent == null)
3880
+// {
3881
+// g.toParent = LA.newMatrix();
3882
+// g.fromParent = LA.newMatrix();
3883
+// }
3884
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3885
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3886
+//
3887
+// g.add(GrafreeD.clipboard);
3888
+//
3889
+// buffer.add(g);
3890
+// }
3891
+//
3892
+// public void Face(Object3D node, Face f)
3893
+// {
3894
+//
3895
+// }
3896
+//
3897
+// void ParseVerticesOld() // ??
3898
+// {
3899
+// //if (group.selection.size() != 1)
3900
+// // return;
3901
+//
3902
+// temprep = new BoundaryRep();
3903
+// nodes = new Object3D();
3904
+// vertices = new Vector<Vertex>();
3905
+//
3906
+// boolean epsequal = GrafreeD.epsequal;
3907
+// GrafreeD.epsequal = true;
3908
+//
3909
+// for (int i=0; i<group.selection.size(); i++)
3910
+// {
3911
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3912
+//
3913
+// group.selection.get(i).Parse(
3914
+//this );
3915
+//
3916
+// int repsize = temprep.VertexCount();
3917
+// int tablesize = temprep.vertextable.size();
3918
+// int nodesize = nodes.size();
3919
+//
3920
+// assert(vertices.size() == nodes.size());
3921
+//
3922
+// temprep.vertextable.elements();
3923
+//
3924
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3925
+//
3926
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3927
+// {
3928
+// cGroup g = new cGroup();
3929
+//
3930
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3931
+//
3932
+// Object3D node = nodes.get(index);
3933
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3934
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3935
+//
3936
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3937
+//
3938
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3939
+//
3940
+// if (g.toParent == null)
3941
+// {
3942
+// g.toParent = LA.newMatrix();
3943
+// g.fromParent = LA.newMatrix();
3944
+// }
3945
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3946
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3947
+//
3948
+// g.add(GrafreeD.clipboard);
3949
+//
3950
+// buffer.add(g);
3951
+// }
3952
+//
3953
+// makeSomething(buffer, i==group.selection.size()-1);
3954
+// }
3955
+//
3956
+// GrafreeD.epsequal = epsequal;
3957
+//
3958
+// //buffer = null;
3959
+// temprep = null;
3960
+// nodes = null;
3961
+//
3962
+// refreshContents();
3963
+// }
3964
+
31843965 void ParseVertices()
31853966 {
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;
3967
+ boolean epsequal = Grafreed.epsequal;
3968
+ Grafreed.epsequal = true;
31953969
31963970 for (int i=0; i<group.selection.size(); i++)
31973971 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3972
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993973
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3974
+ group.selection.get(i).Parse(
3975
+
3976
+ new iParse()
3977
+ {
3978
+ public void Vertex(Object3D node, Vertex v)
3979
+ {
3980
+ temp.set(v);
3981
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053982
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();
3983
+ cGroup g = new cGroup();
32113984
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3985
+ if (g.toParent == null)
3986
+ {
3987
+ g.toParent = LA.newMatrix();
3988
+ g.fromParent = LA.newMatrix();
3989
+ }
3990
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3991
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153992
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);
3993
+ g.add(Grafreed.clipboard);
32203994
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);
3995
+ buffer.add(g);
3996
+ }
32323997
3233
- g.add(GraphreeD.clipboard);
3998
+ public void Face(Object3D node, Face f)
3999
+ {
32344000
3235
- buffer.add(g);
3236
- }
4001
+ }
4002
+ }
4003
+ );
32374004
32384005 makeSomething(buffer, i==group.selection.size()-1);
32394006 }
32404007
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4008
+ Grafreed.epsequal = epsequal;
32464009
32474010 refreshContents();
32484011 }
3249
-
4012
+
4013
+ void TextureVertices()
4014
+ {
4015
+ for (int i=0; i<group.selection.size(); i++)
4016
+ {
4017
+ group.selection.get(i).Parse(
4018
+ new iParse()
4019
+ {
4020
+ public void Vertex(Object3D node, Vertex v)
4021
+ {
4022
+ cTexture tex = node.GetTextures();
4023
+ String pigment = Object3D.GetPigment(tex);
4024
+ //String bump = Object3D.GetBump(tex);
4025
+
4026
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4027
+
4028
+ try
4029
+ {
4030
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4031
+ }
4032
+ catch (Exception e)
4033
+ {
4034
+ System.err.println("FAIL: " + node);
4035
+ }
4036
+
4037
+ double s = v.s;
4038
+
4039
+ if (s == 1)
4040
+ s = 0;
4041
+
4042
+ double t = v.t;
4043
+
4044
+ if (t == 1)
4045
+ t = 0;
4046
+
4047
+ int indexs = (int) (texturedata.getWidth() * s);
4048
+ int indext = (int) (texturedata.getHeight() * t);
4049
+
4050
+ int index = indext * texturedata.getWidth() + indexs;
4051
+
4052
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4053
+
4054
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4055
+
4056
+ float scale = bytebuf.get(index*slide) & 0xFF;
4057
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4058
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4059
+ scale /= 3;
4060
+
4061
+ scale /= 0xFF;
4062
+ // c'est quoi ca? scale /= 4;
4063
+
4064
+ //v.AO = scale;
4065
+
4066
+ v.x += v.norm.x * scale;
4067
+ v.y += v.norm.y * scale;
4068
+ v.z += v.norm.z * scale;
4069
+ }
4070
+
4071
+ public void Face(Object3D node, Face f)
4072
+ {
4073
+ }
4074
+ }
4075
+ );
4076
+ }
4077
+
4078
+ refreshContents();
4079
+ }
4080
+
32504081 void Align()
32514082 {
4083
+ if (group.selection.size() == 0)
4084
+ return;
4085
+
4086
+ cVector bbmin = new cVector();
4087
+ cVector bbmax = new cVector();
4088
+
4089
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4090
+
4091
+ double dx = bbmax.x - bbmin.x;
4092
+ double dy = bbmax.y - bbmin.y;
4093
+ double dz = bbmax.z - bbmin.z;
4094
+
4095
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4096
+
32524097 for (int i=0; i<group.selection.size(); i++)
32534098 {
32544099 Object3D obj = group.selection.get(i);
32554100
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4101
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4102
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584103 }
32594104
32604105 refreshContents();
....@@ -3267,7 +4112,7 @@
32674112 // ref.SaveSupports();
32684113 // Object3D par = ref.parent;
32694114 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4115
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714116 // ref.parent = par;
32724117 // ref.RestoreSupports();
32734118
....@@ -3275,11 +4120,11 @@
32754120
32764121 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774122
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4123
+ boolean random = CameraPane.SWITCH;
4124
+ CameraPane.SWITCH = false; // parse all random nodes
32804125 lowres.linkVerticesThis(null);
32814126 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4127
+ CameraPane.SWITCH = random;
32834128
32844129 System.err.flush();
32854130
....@@ -3297,7 +4142,7 @@
32974142 // lowres.SaveSupports();
32984143 // par = lowres.parent;
32994144 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4145
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014146 Object3D newlow = CloneObject(lowres, false);
33024147 newlow.name = sn.switchobject.get(i).name;
33034148 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4164,7 @@
33194164 return;
33204165
33214166 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4167
+ Object3D ref = Grafreed.clipboard.get(0);
33234168
33244169 Object3D newgroup = new Object3D("Po:" + poses.name);
33254170
....@@ -3488,7 +4333,7 @@
34884333 group.selection.RelinkToSupport(); // july 2014
34894334 System.out.println("DONE.");
34904335 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4336
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924337 }
34934338
34944339 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4358,20 @@
35134358
35144359 void ClipMesh()
35154360 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4361
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174362 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4363
+ Object3D content = Grafreed.clipboard.get(0);
35194364
35204365 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214366 content = ((cGroup)content).get(0);
35224367
35234368 // for (int i=0; i<group.selection.size(); i++)
35244369 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4370
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264371 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4372
+ group.selection.ClipMesh(Grafreed.clipboard);
35284373 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4374
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304375 System.out.println("DONE.");
35314376 refreshContents();
35324377 }
....@@ -3571,6 +4416,18 @@
35714416 void MarkLeaves(boolean hide)
35724417 {
35734418 group.selection.MarkLeaves(hide);
4419
+ refreshContents();
4420
+ }
4421
+
4422
+ void RewindLeaves(boolean hide)
4423
+ {
4424
+ group.selection.RewindLeaves(hide);
4425
+ refreshContents();
4426
+ }
4427
+
4428
+ void RandomLeaves(boolean hide)
4429
+ {
4430
+ group.selection.RandomLeaves(hide);
35744431 refreshContents();
35754432 }
35764433
....@@ -3656,10 +4513,10 @@
36564513 {
36574514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604517
36614518 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4519
+ if(elem != group || !newWindow)
36634520 {
36644521 // if (!(elem instanceof Composite))
36654522 // newWindow = false;
....@@ -3749,7 +4606,6 @@
37494606 //case 702: // Event.LIST_DESELECT
37504607 group.deselectAll();
37514608 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534609 if (tps != null)
37544610 {
37554611 for (int i=0; i < tps.length; i++)
....@@ -3758,31 +4614,30 @@
37584614
37594615 //if (child.parent != null)
37604616 //child.parent.addSelectee(child);
4617
+ objEditor.SetMaterial(child);
37614618 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654619 }
37664620 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4621
+// else
4622
+// {
4623
+// objEditor.SetMaterial(group); // .GetMaterial());
4624
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4625
+// System.err.println("info : " + group.GetPath());
4626
+// }
37734627
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4628
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774629 CameraPane.flash = true;
37784630
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4631
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804632 // a camera
37814633 {
3782
- CameraPane.camerachangeframe = 0; // don't refuse it
3783
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3784
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3785
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4634
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4635
+ {
4636
+ CameraPane.camerachangeframe = 0; // don't refuse it
4637
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4638
+ }
4639
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4640
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864641 }
37874642
37884643 refreshContents();
....@@ -3793,6 +4648,27 @@
37934648
37944649 freezemodel = false;
37954650 }
4651
+
4652
+ void refreshContents(boolean cp)
4653
+ {
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4656
+ {
4657
+ objEditor.ClearInfo(); // .GetMaterial());
4658
+
4659
+ for (int i=0; i < group.selection.Size(); i++)
4660
+ {
4661
+ Object3D child = (Object3D) group.selection.get(i);
4662
+
4663
+ objEditor.AddInfo(child, this, true);
4664
+ System.err.println("info : " + child.GetPath());
4665
+ }
4666
+
4667
+ objEditor.SetText(); // jan 2014
4668
+ }
4669
+
4670
+ super.refreshContents(cp);
4671
+ }
37964672
37974673 void linkSomething(Object3D thing)
37984674 {
....@@ -3864,16 +4740,19 @@
38644740 {
38654741 if (group.selection.isEmpty())
38664742 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4743
+
4744
+ Grafreed.clipboardIsTempGroup = false;
38684745 Composite tGroup = null;
38694746 if (group.selection.size() > 0) // 1)
38704747 {
38714748 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4749
+ Grafreed.clipboardIsTempGroup = true;
38734750 }
38744751
38754752 if (cut)
38764753 {
4754
+ if (Globals.SAVEONMAKE)
4755
+ Save();
38774756 //int indices[] = jList.getSelectedIndices();
38784757 //for (int i = indices.length - 1; i >= 0; i--)
38794758 //jList.remove(indices[i]);
....@@ -3909,16 +4788,16 @@
39094788 //System.out.println("cut " + child);
39104789 //System.out.println("parent = " + child.parent);
39114790 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4791
+ if (Grafreed.clipboardIsTempGroup)
39134792 tGroup.add/*Child*/(tmp);
39144793 else
3915
- GraphreeD.clipboard = tmp;
4794
+ Grafreed.clipboard = tmp;
39164795 }
39174796 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4797
+ if (Grafreed.clipboardIsTempGroup)
39194798 tGroup.add/*Child*/(child);
39204799 else
3921
- GraphreeD.clipboard = child;
4800
+ Grafreed.clipboard = child;
39224801 }
39234802
39244803 //ResetModel();
....@@ -3950,21 +4829,23 @@
39504829 //System.out.println("cut " + elem);
39514830 //System.out.println("parent = " + elem.parent);
39524831 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4832
+ if (Grafreed.clipboardIsTempGroup)
39544833 tGroup.add/*Child*/(tmp);
39554834 else
3956
- GraphreeD.clipboard = tmp;
4835
+ Grafreed.clipboard = tmp;
39574836 }
39584837 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4838
+ if (Grafreed.clipboardIsTempGroup)
39604839 tGroup.add/*Child*/(child);
39614840 else
3962
- GraphreeD.clipboard = child;
4841
+ Grafreed.clipboard = child;
39634842 }
39644843
39654844 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4845
+
4846
+ if (Grafreed.clipboardIsTempGroup)
4847
+ Grafreed.clipboard = tGroup;
4848
+
39684849 if (cut)
39694850 {
39704851 ResetModel();
....@@ -3974,11 +4855,11 @@
39744855
39754856 void paste(boolean expand)
39764857 {
3977
- // if (GraphreeD.clipboard == null)
4858
+ // if (GrafreeD.clipboard == null)
39784859 // return;
39794860 boolean first = true;
39804861
3981
- if (GraphreeD.clipboardIsTempGroup)
4862
+ if (Grafreed.clipboardIsTempGroup)
39824863 {
39834864 Composite temp;
39844865
....@@ -3989,7 +4870,7 @@
39894870 temp = (Composite)Applet3D.clipboard.deepCopy();
39904871 */
39914872 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4873
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934874 {
39944875 Object3D child = (Object3D)e.nextElement();
39954876
....@@ -4003,7 +4884,7 @@
40034884 else
40044885 elem = child.deepCopy(); // ?
40054886 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4887
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074888 // elem = elem.get(0);
40084889 makeSomething(elem, true); // ?? first);
40094890 //group.addChild(elem);
....@@ -4023,23 +4904,23 @@
40234904 //Object3D cb = Applet3D.clipboard;
40244905 //temp.addChild(cb);
40254906 //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());
4907
+ assert(Grafreed.clipboard.parent == null);
4908
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4909
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4910
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4911
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314912 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4913
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4914
+ Grafreed.clipboard.get(0).parent = keepparent;
40344915 }
40354916
40364917 ResetModel();
40374918 refreshContents();
40384919 }
40394920
4040
- void pasteInto(boolean copyit)
4921
+ void pasteInto(boolean copyit, boolean clone)
40414922 {
4042
-// if (GraphreeD.clipboard == null)
4923
+// if (GrafreeD.clipboard == null)
40434924 // return;
40444925
40454926 if (group.selection.size() != 1)
....@@ -4066,15 +4947,22 @@
40664947 if (copyit)
40674948 {
40684949 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4950
+ if (clone)
4951
+ {
4952
+ CloneClipboard(false); // sept 2014
4953
+ }
4954
+ else
4955
+ {
4956
+ paste(false);
4957
+ }
40704958 }
40714959 else
40724960 {
40734961 boolean first = true;
40744962
4075
- if (GraphreeD.clipboardIsTempGroup)
4963
+ if (Grafreed.clipboardIsTempGroup)
40764964 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4965
+ Composite temp = (Composite)Grafreed.clipboard;
40784966 Object3D copy;
40794967 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804968 {
....@@ -4084,7 +4972,7 @@
40844972 }
40854973 } else
40864974 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4975
+ linkSomething(Grafreed.clipboard); //.get(0));
40884976 }
40894977 }
40904978 }
....@@ -4276,6 +5164,26 @@
42765164 makeSomething(csg);
42775165 }
42785166
5167
+ void Ungroup(Object3D g)
5168
+ {
5169
+ if (g instanceof HiddenObject)
5170
+ {
5171
+ HiddenObject h = (HiddenObject) g;
5172
+
5173
+ for (int i=0; i<h.ActualSize(); i++)
5174
+ {
5175
+ objEditor.makeSomething(h.get(i), false);
5176
+ }
5177
+ }
5178
+ else
5179
+ {
5180
+ for (int i=0; i<g.Size(); i++)
5181
+ {
5182
+ objEditor.makeSomething(g.get(i), false);
5183
+ }
5184
+ }
5185
+ }
5186
+
42795187 void ungroup()
42805188 {
42815189 /*
....@@ -4469,21 +5377,6 @@
44695377 }
44705378 */
44715379
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
-
44875380 /*
44885381 public void Callback(Object obj)
44895382 {
....@@ -4507,26 +5400,9 @@
45075400 }
45085401 */
45095402
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
-
45275403 String GetFile(String dialogName)
45285404 {
4529
- if (GraphreeD.standAlone)
5405
+ if (Grafreed.standAlone)
45305406 {
45315407 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325408 browser.show();
....@@ -4590,10 +5466,38 @@
45905466 cButton flashSelectionButton;
45915467 cButton editButton;
45925468 cButton uneditButton;
5469
+ JCheckBox allParamsButton;
45935470 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955471 cButton unselectButton;
45965472
5473
+ cButton restoreCameraButton;
5474
+
5475
+ cButton minButton;
5476
+ cButton maxButton;
5477
+ cButton fullButton;
5478
+ cButton undoButton;
5479
+ cButton redoButton;
5480
+ cButton saveButton;
5481
+ cButton oneStepButton;
5482
+
5483
+ cButton groupButton;
5484
+ cButton ungroupButton;
5485
+ cButton compositeButton;
5486
+ cButton switchButton;
5487
+ cButton loopButton;
5488
+ cButton textureButton;
5489
+
5490
+ cButton gridButton;
5491
+ cButton boxButton;
5492
+ cButton sphereButton;
5493
+ cButton coneButton;
5494
+ cButton torusButton;
5495
+ cButton superButton;
5496
+ cButton kleinButton;
5497
+ cButton particlesButton;
5498
+ cButton overlayButton;
5499
+ cButton lightButton;
5500
+
45975501 cButton screenfitButton;
45985502 cButton screenfitpointButton;
45995503 cButton snapobjectButton;
....@@ -4605,14 +5509,6 @@
46055509
46065510 cButton setsupportButton;
46075511
4608
- cButton twoButton;
4609
- cButton sixButton;
4610
- cButton threeButton;
4611
- cButton sevenButton;
4612
- cButton fourButton; // full panel
4613
- cButton oneButton; // full XYZ
4614
- //cButton currentLayout;
4615
-
46165512 //
46175513 //Composite
46185514 Object3D // to do !!
....@@ -4622,9 +5518,11 @@
46225518 //JTree jTree;
46235519 private MenuItem lookAtItem;
46245520 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
46265522 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5523
+ private MenuItem undoItem;
5524
+ private MenuItem redoItem;
5525
+ private JMenuItem duplicateItem;
46285526 private MenuItem cloneItem;
46295527 private MenuItem cloneSupportItem;
46305528 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5533,9 @@
46355533 private MenuItem resetsupportItem;
46365534 private MenuItem resetreferencesItem;
46375535 private MenuItem linkverticesItem;
5536
+ private MenuItem relinkverticesItem;
46385537 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5538
+ private MenuItem resetAllItem;
46405539 private MenuItem stepAllItem;
46415540 private MenuItem revertMeshItem;
46425541 private MenuItem poseMeshItem;
....@@ -4647,14 +5546,17 @@
46475546 private MenuItem mergeGeometriesItem;
46485547 private MenuItem copyItem;
46495548 private MenuItem pasteItem;
5549
+ private MenuItem pasteIntoItem;
46505550 private MenuItem pasteLinkItem;
46515551 private MenuItem pasteCloneItem;
46525552 private MenuItem pasteExpandItem;
46535553 private MenuItem clearItem;
46545554 private MenuItem clearAllItem;
46555555 private MenuItem genUVItem;
5556
+ private MenuItem genNormalsMESHItem;
46565557 private MenuItem genNormalsCADItem;
46575558 private MenuItem genNormalsORGANItem;
5559
+ private MenuItem genNormalsMINEItem;
46585560 private MenuItem stripifyItem;
46595561 private MenuItem unstripifyItem;
46605562 private MenuItem trimItem;
....@@ -4683,6 +5585,10 @@
46835585 private MenuItem showleavesItem;
46845586 private MenuItem markleavesItem;
46855587 private MenuItem unmarkleavesItem;
5588
+ private MenuItem rewindleavesItem;
5589
+ private MenuItem unrewindleavesItem;
5590
+ private MenuItem randomleavesItem;
5591
+ private MenuItem unrandomleavesItem;
46865592
46875593 private MenuItem flipVItem;
46885594 private MenuItem unflipVItem;
....@@ -4694,14 +5600,17 @@
46945600 private MenuItem panoTexturesItem;
46955601
46965602 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5603
+ private MenuItem resetCentroidXZItem;
46985604 private MenuItem resetTransformItem;
5605
+ private MenuItem transformGeometryItem;
5606
+ private MenuItem transformChildrenItem;
5607
+ private MenuItem hideItem;
46995608 private MenuItem grabItem;
47005609 private MenuItem backItem;
47015610 private MenuItem frontItem;
47025611 private MenuItem cameraItem;
47035612 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
47055614 private MenuItem physicsItem;
47065615 private MenuItem frameselectorItem;
47075616 private MenuItem scriptNodeItem;
....@@ -4716,6 +5625,7 @@
47165625
47175626 private MenuItem resetParentItem;
47185627 private MenuItem repairParentItem;
5628
+ private MenuItem repairShadowItem;
47195629 private MenuItem sortbysizeItem;
47205630 private MenuItem sortbynameItem;
47215631
....@@ -4728,16 +5638,19 @@
47285638 private MenuItem particleItem;
47295639 private MenuItem ragdollItem;
47305640 private MenuItem ragdoll2Item;
5641
+ private MenuItem heightFieldItem;
5642
+ private MenuItem textureFieldItem;
47315643 private MenuItem gridItem;
47325644 private MenuItem rectoidItem;
47335645 private MenuItem ellipsoidItem;
47345646 private MenuItem coneItem;
47355647 private MenuItem torusItem;
47365648 private MenuItem superItem;
5649
+ private MenuItem kleinItem;
47375650 private MenuItem blobItem;
47385651 private MenuItem latheItem;
47395652 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5653
+ private MenuItem overlayItem;
47415654 private MenuItem meshItem;
47425655 // private MenuItem meshGroupItem;
47435656 private MenuItem springItem;
....@@ -4746,6 +5659,7 @@
47465659 private MenuItem csgItem;
47475660 private MenuItem templateItem;
47485661 private MenuItem textureItem;
5662
+ private MenuItem billboardItem;
47495663 private MenuItem shadowXItem;
47505664 private MenuItem shadowYItem;
47515665 private MenuItem shadowZItem;
....@@ -4758,11 +5672,6 @@
47585672 private MenuItem doubleItem;
47595673 private MenuItem tripleItem;
47605674
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665675 private MenuItem computeAOItem;
47675676 private MenuItem recompileItem;
47685677 private MenuItem editScriptItem;
....@@ -4772,4 +5681,8 @@
47725681 private MenuItem analyzeItem;
47735682 private MenuItem dumpItem;
47745683 //boolean freezemodel = false;
5684
+
5685
+ Menu cameraMenu;
5686
+ MenuItem editCameraItem;
5687
+ MenuItem restoreCameraItem;
47755688 }