Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
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,213 @@
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
+ undoButton.setEnabled(false);
609
+
610
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ redoButton.setToolTipText("Redo changes");
612
+ redoButton.addActionListener(this);
613
+ redoButton.setEnabled(false);
614
+
615
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ saveButton.setToolTipText("Save changes");
617
+ saveButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
620
+ liveCB.setToolTipText("Enable animation");
414621 liveCB.addItemListener(this);
415622
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);
623
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ oneStepButton.setToolTipText("Animate one step forward");
625
+ oneStepButton.addActionListener(this);
626
+
627
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
628
+ fastCB.setToolTipText("Fast mode");
434629 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);
630
+
631
+ //oe.toolboxPanel.Return();
632
+
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ screenfitButton.setToolTipText("Screen fit");
480635 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
636
+
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
640
+
482641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483642 // 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;
488643
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;
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ snapobjectButton.addActionListener(this);
648
+ snapobjectButton.setToolTipText("Snap Object");
649
+ }
650
+
651
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
499652
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ twoButton.setToolTipText("Show center view only");
502655 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
656
+ this.fullscreenLayout = twoButton;
657
+
658
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504659 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
660
+ fourButton.setToolTipText("Show left panel only");
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ sixButton.setToolTipText("2-column layout left");
506663 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ threeButton.setToolTipText("2-column layout right");
508666 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
+ sevenButton.setToolTipText("3-column layout");
510669 sevenButton.addActionListener(this);
511670 //
512671
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
672
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ rootButton.setToolTipText("Edit selection in new tab");
514674 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
675
+
676
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
+ closeButton.setToolTipText("Close tab");
517678 closeButton.addActionListener(this);
518679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519680 //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;
528681
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
682
+ // INSERT
683
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ gridButton.setToolTipText("Create grid");
685
+ gridButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ boxButton.setToolTipText("Create box");
689
+ boxButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
692
+ sphereButton.setToolTipText("Create sphere");
693
+ sphereButton.addActionListener(this);
694
+
695
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ coneButton.setToolTipText("Create cone");
697
+ coneButton.addActionListener(this);
698
+
699
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ torusButton.setToolTipText("Create torus");
701
+ torusButton.addActionListener(this);
702
+
703
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+ superButton.setToolTipText("Create superellipsoid");
705
+ superButton.addActionListener(this);
706
+
707
+ if (Globals.ADVANCED)
708
+ {
709
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
710
+ kleinButton.setToolTipText("Create Klein bottle");
711
+ kleinButton.addActionListener(this);
712
+ }
713
+
714
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ particlesButton.setToolTipText("Create particle system");
716
+ particlesButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.Return();
719
+
720
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ groupButton.setToolTipText("Create group");
722
+ groupButton.addActionListener(this);
723
+
724
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ compositeButton.setToolTipText("Create composite");
726
+ compositeButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ switchButton.setToolTipText("Create switch");
730
+ switchButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ loopButton.setToolTipText("Create loop");
734
+ loopButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ textureButton.setToolTipText("Create texture");
738
+ textureButton.addActionListener(this);
739
+
740
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ overlayButton.setToolTipText("Create overlay");
742
+ overlayButton.addActionListener(this);
743
+
744
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ lightButton.setToolTipText("Create light");
746
+ lightButton.addActionListener(this);
747
+
748
+ for (int i=6; --i>=0;)
749
+ {
750
+ oe.toolboxPanel.Return();
751
+ oe.toolboxPanel.add(new cGridBag());
752
+ oe.toolboxPanel.add(new cGridBag());
753
+ oe.toolboxPanel.add(new cGridBag());
754
+ oe.toolboxPanel.add(new cGridBag());
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ }
759
+
760
+ // EDIT panel
761
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Edit selection");
763
+ editButton.addActionListener(this);
764
+
765
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Unedit selection");
530767 uneditButton.addActionListener(this);
531768
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);
769
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
+ allParamsButton.setToolTipText("Edit all params");
544771 allParamsButton.addActionListener(this);
545772
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);
773
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
774
+ clearPanelButton.setToolTipText("Clear edit panel");
775
+ clearPanelButton.addActionListener(this);
776
+
777
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
778
+ unselectButton.setToolTipText("Unselect");
551779 unselectButton.addActionListener(this);
552780
781
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ flashSelectionButton.setToolTipText("Highlight selection");
783
+ flashSelectionButton.addActionListener(this);
784
+
785
+ editCommandsPanel.preferredHeight = 1;
786
+
787
+// oe.treePanel.add(commandsPanel);
788
+// oe.treePanel.Return();
789
+
553790 // oe.aConstraints.gridx += 1;
554791 // oe.aConstraints.weighty = 0;
555792 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +798,22 @@
561798 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562799 // gcButton.addActionListener(this);
563800
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;
801
+ cGridBag jSPPanel = new cGridBag();
802
+
803
+ JScrollPane jSP;
575804 //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);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
577806 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;
597807
808
+ oe.treePanel.add(jSPPanel);
809
+ oe.treePanel.Return();
810
+
811
+ oe.treePanel.add(copyOptionsPanel);
812
+ oe.treePanel.Return();
813
+
814
+// mainPanel.setDividerLocation(0.5); //1.0);
815
+// mainPanel.setResizeWeight(0.5);
816
+
598817 //jList.addListSelectionListener(this);
599818 oe.jTree.addTreeSelectionListener(this);
600819 //jTree.setRootVisible(false);
....@@ -616,20 +835,153 @@
616835 radio.layout = sevenButton;
617836 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618837 }
838
+
839
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
840
+ {
841
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
842
+ colorCB.setToolTipText("Copy color when dropped");
843
+ colorCB.addItemListener(this);
844
+
845
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
846
+ materialCB.setToolTipText("Copy material when dropped");
847
+ materialCB.addItemListener(this);
848
+
849
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
850
+ textureCB.setToolTipText("Copy texture when dropped");
851
+ textureCB.addItemListener(this);
852
+
853
+ panel.Return();
854
+
855
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
856
+ boxCB.setToolTipText("Display bounding boxes");
857
+ boxCB.addItemListener(this);
858
+
859
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
861
+ zoomBoxCB.addItemListener(this);
862
+
863
+ if (true) // Globals.ADVANCED)
864
+ {
865
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
+ supportCB.setToolTipText("Enable rigging");
867
+ supportCB.addItemListener(this);
868
+
869
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870
+ // localCB.addItemListener(this);
871
+
872
+ panel.Return();
873
+
874
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
875
+ crowdCB.setToolTipText("Used for crowds");
876
+ crowdCB.addItemListener(this);
877
+
878
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
879
+ smoothCB.setToolTipText("Snapping delay");
880
+ smoothCB.addItemListener(this);
881
+
882
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
883
+ slowCB.setToolTipText("Smooth interpolation");
884
+ slowCB.addItemListener(this);
885
+
886
+// constraints.gridy += 1;
887
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
888
+// speakerMocapCB.addItemListener(this);
889
+
890
+ panel.Return();
891
+
892
+ if (false)
893
+ {
894
+ // handled in scripts
895
+ //constraints.gridy += 1;
896
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
897
+ speakerCameraCB.addItemListener(this);
898
+
899
+ //constraints.gridy += 1;
900
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
901
+ speakerFocusCB.addItemListener(this);
902
+
903
+ //constraints.gridy += 1;
904
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
905
+ smoothfocusCB.addItemListener(this);
906
+ panel.Return();
907
+ }
908
+
909
+//constraints.gridx += 1;
910
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
911
+// debugCB.addItemListener(this);
912
+
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
917
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
919
+ oeilCB.addItemListener(this);
920
+
921
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
+ shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.addItemListener(this);
924
+
925
+ panel.Return();
926
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
927
+ toggleTextureCB.setToolTipText("Load textures");
928
+ toggleTextureCB.addItemListener(this);
929
+
930
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
+ toggleSwitchCB.setToolTipText("Use switch");
932
+ toggleSwitchCB.addItemListener(this);
933
+
934
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
+ autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.addItemListener(this);
937
+
938
+ panel.Return();
939
+ if (Globals.ADVANCED)
940
+ {
941
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
942
+ lookAtCB.setToolTipText("Look-at target");
943
+ lookAtCB.addItemListener(this);
944
+ }
945
+
946
+ }
947
+
948
+ cGridBag fill = new cGridBag();
949
+ fill.preferredHeight = 200;
950
+ cGridBag fill2 = new cGridBag();
951
+ fill2.preferredHeight = 200;
952
+ cGridBag fill3 = new cGridBag();
953
+ fill3.preferredHeight = 200;
954
+
955
+ panel.add(fill);
956
+ panel.add(fill2);
957
+ panel.add(fill3);
958
+
959
+ }
619960
620961 void EditObject(Object3D obj)
621962 {
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();
963
+ cRadio radioButton = new cRadio(obj.name);
964
+
965
+ // Patch to avoid bug with transparency.
966
+ radioButton.hadMaterial = obj.material != null;
967
+ if (!radioButton.hadMaterial)
968
+ {
969
+ obj.material = new cMaterial();
970
+ }
971
+
972
+ radioButton.SetObject(obj);
973
+ radioButton.layout = sevenButton;
974
+ radioButton.SetCamera(cameraView.renderCamera, false);
975
+ radioButton.addActionListener(this);
976
+ radioPanel.add(radioButton);
977
+ buttonGroup.add(radioButton);
978
+ radioButton.doClick();
630979 }
980
+
631981 void SetupViews(ObjEditor oe)
632982 {
983
+ theFrame = this;
984
+
633985 oe.SetupViews();
634986
635987 System.out.println("SetupViews");
....@@ -638,22 +990,27 @@
638990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
639991 }
640992
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;
993
+ cToggleButton liveCB;
994
+ cCheckBox supportCB;
995
+ cCheckBox localCB;
996
+ cCheckBox crowdCB;
997
+ cCheckBox smoothCB;
998
+ cToggleButton fastCB;
999
+ cCheckBox slowCB;
1000
+ cCheckBox boxCB;
1001
+ cCheckBox zoomBoxCB;
1002
+ //cToggleButton trackCB;
1003
+ cCheckBox trackCB;
1004
+ cCheckBox smoothfocusCB;
6511005 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
6571014
6581015 // static int COLOR = 1;
6591016 // static int MATERIAL = 2;
....@@ -661,9 +1018,9 @@
6611018
6621019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631020
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
6671024
6681025 public void itemStateChanged(ItemEvent e)
6691026 {
....@@ -688,10 +1045,10 @@
6881045 dropAttributes |= Object3D.TEXTURE;
6891046 else
6901047 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1048
+ } else if(e.getSource() == liveCB)
6931049 {
6941050 cameraView.ToggleLive();
1051
+ refreshContents(false);
6951052 }
6961053 else if(e.getSource() == supportCB)
6971054 {
....@@ -727,6 +1084,10 @@
7271084 cameraView.repaint();
7281085 // refreshContents();
7291086 }
1087
+ else if(e.getSource() == zoomBoxCB)
1088
+ {
1089
+ cameraView.ToggleZoomBoxMode();
1090
+ }
7301091 else if(e.getSource() == smoothfocusCB)
7311092 {
7321093 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1113,14 @@
7521113 {
7531114 cameraView.ToggleOeil();
7541115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
7551124 else if(e.getSource() == lookAtCB)
7561125 {
7571126 cameraView.ToggleLookAt();
....@@ -768,7 +1137,8 @@
7681137
7691138 /**/
7701139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
7721142 if ((path == null) || (path.getPathCount() <= 1)) {
7731143 // We can't move the root node or an empty selection
7741144 return;
....@@ -840,7 +1210,9 @@
8401210 // objEditor.DropFile((java.io.File[]) object, true);
8411211 // return;
8421212 // }
843
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441216 {
8451217 // file(s)
8461218 String[] names = string.split("\n");
....@@ -867,7 +1239,7 @@
8671239
8681240 flashIt = false;
8691241 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721244
8731245 if (group.selection.size() == 1)
....@@ -883,23 +1255,33 @@
8831255
8841256 assert target == objEditor.jTree;
8851257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
8861259 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881261 } catch (Exception e) {
8891262 System.out.println("destinationPath : " + destinationPath);
8901263 return;
8911264 }
8921265
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
8941267 {
1268
+ Object3D child = (Object3D)group.selection.elementAt(i);
1269
+
1270
+ // Cannot move into itself
1271
+ if (child == destinationLeaf)
1272
+ return;
1273
+ }
1274
+
1275
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1276
+// {
8951277 loadClipboard(true);
8961278 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9031285 }
9041286 public void dropActionChanged(DropTargetDragEvent dtde)
9051287 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1384,106 @@
10021384
10031385 void buildCreateMenu(Menu menu)
10041386 {
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);
1387
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1388
+ //heightFieldItem.addActionListener(this);
1389
+// gridItem = menu.add(new MenuItem("Grid"));
1390
+// gridItem.addActionListener(this);
1391
+// rectoidItem = menu.add(new MenuItem("Box"));
1392
+// rectoidItem.addActionListener(this);
1393
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1394
+// ellipsoidItem.addActionListener(this);
1395
+// coneItem = menu.add(new MenuItem("Cone"));
1396
+// coneItem.addActionListener(this);
1397
+// torusItem = menu.add(new MenuItem("Torus"));
1398
+// torusItem.addActionListener(this);
1399
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1400
+// superItem.addActionListener(this);
1401
+
1402
+ cameraItem = menu.add(new MenuItem("Camera"));
1403
+ cameraItem.addActionListener(this);
1404
+
1405
+ if (!Globals.ADVANCED)
1406
+ {
1407
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1408
+ kleinItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10191415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201416 ragdollItem.addActionListener(this);
10211417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221418 ragdoll2Item.addActionListener(this);
1419
+ }
10231420 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251422 meshItem.addActionListener(this);
10261423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10281427 springItem = menu.add(new MenuItem("Spring"));
10291428 springItem.addActionListener(this);
10301429 flagItem = menu.add(new MenuItem("Flag"));
10311430 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);
10361431 blobItem = menu.add(new MenuItem("Blob"));
10371432 blobItem.addActionListener(this);
10381433 latheItem = menu.add(new MenuItem("Lathe"));
10391434 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1435
+ }
1436
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1437
+ bezierItem.addActionListener(this);
1438
+// overlayItem = menu.add(new MenuItem("Overlay"));
1439
+// overlayItem.addActionListener(this);
1440
+// lightItem = menu.add(new MenuItem("Light"));
1441
+// lightItem.addActionListener(this);
10421442 menu.add("-");
10431443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441444 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
10471447 doubleItem = menu.add(new MenuItem("Fork"));
10481448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
10491451 tripleItem = menu.add(new MenuItem("Trident"));
10501452 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);
1453
+ }
10601454 }
10611455
10621456 void buildToolsMenu(Menu menu)
10631457 {
10641458 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651459 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1460
+ animationItem.setState(Globals.ANIMATION);
10671461
10681462 menu.add("-");
10691463 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701464 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1465
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1466
+ textureFieldItem.addActionListener(this);
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721468 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761470 reduceMorphItem.addActionListener(this);
10771471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781472 reduce34MorphItem.addActionListener(this);
1079
-
1473
+ menu.add("-");
10801474 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811475 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
10841482 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851483 memoryItem.addActionListener(this);
10861484 menu.add(analyzeItem = new MenuItem("Analyze"));
10871485 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
10891487 dumpItem.addActionListener(this);
10901488 // menu.add(pathItem = new MenuItem("From-to path"));
10911489 // pathItem.addActionListener(this);
....@@ -1094,6 +1492,8 @@
10941492 resetParentItem.addActionListener(this);
10951493 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961494 repairParentItem.addActionListener(this);
1495
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1496
+ repairShadowItem.addActionListener(this);
10971497 menu.add(invariantsItem = new MenuItem("Invariants"));
10981498 invariantsItem.addActionListener(this);
10991499 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1501,7 @@
11011501 menu.add("-");
11021502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031503 editScriptItem.addActionListener(this);
1504
+ }
11041505 }
11051506
11061507 void ScreenFit()
....@@ -1223,6 +1624,7 @@
12231624 shadow.material = new cMaterial(obj.material);
12241625 shadow.material.diffuse = 0.0001f;
12251626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12261628
12271629 makeSomething(shadow);
12281630 }
....@@ -1429,9 +1831,9 @@
14291831
14301832 void Overwrite(int mask)
14311833 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331835 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
14351837
14361838 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371839 content = ((cGroup)content).get(0);
....@@ -1454,6 +1856,7 @@
14541856 //
14551857 public void actionPerformed(ActionEvent event) // , Object arg)
14561858 {
1859
+ Object source = event.getSource();
14571860 /*
14581861 if (event.getSource() == nameField)
14591862 {
....@@ -1465,11 +1868,11 @@
14651868 }
14661869 else
14671870 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1871
+ if (source == lookAtItem || source == lookFromItem)
14691872 {
14701873 ScreenFit();
14711874 } else
1472
- if (event.getSource() == switchItem)
1875
+ if (source == switchViewItem)
14731876 {
14741877 cVector v1 = new cVector();
14751878 cVector v2 = new cVector();
....@@ -1478,11 +1881,11 @@
14781881 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791882 objEditor.cameraView.repaint();
14801883 } else
1481
- if (event.getSource() == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
14821885 {
14831886 makeSomething(new Box());
14841887 } else
1485
- if (event.getSource() == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
14861889 {
14871890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1906,9 @@
15031906 applyExample(particleGeom, "SMOKE");
15041907 makeSomething(particleGeom);
15051908 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1909
+ if (source == ragdollItem || source == ragdoll2Item)
15071910 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1911
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091912
15101913 ragdoll.toParent = LA.newMatrix();
15111914 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1924,71 @@
15211924 makeSomething(ragdoll);
15221925 //makeSomething(new VehicleDemo());
15231926 } else
1524
- if (event.getSource() == gridItem)
1927
+ /*
1928
+ */
1929
+ if (source == heightFieldItem)
1930
+ {
1931
+ Object3D obj = new Object3D();
1932
+
1933
+ obj.CreateMaterial();
1934
+ obj.bRep = new BoundaryRep();
1935
+
1936
+ obj.bRep.CreateMesh(new iHeightField()
1937
+ {
1938
+ public double f(double x, double y)
1939
+ {
1940
+ // The Mandelbrot set is represented by coloring
1941
+ // each point (x,y) according to the number of
1942
+ // iterations it takes before the while loop in
1943
+ // this method ends. For points that are actually
1944
+ // in the Mandelbrot set, or very close to it, the
1945
+ // count will reach the maximum value, 80. These
1946
+ // points will be colored purple. All other colors
1947
+ // represent points that are definitely NOT in the set.
1948
+ x -= 600;
1949
+ y -= 500;
1950
+ x /= 200;
1951
+ y /= 200;
1952
+ int count = 0;
1953
+ double zx = x;
1954
+ double zy = y;
1955
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1956
+ double new_zx = zx*zx - zy*zy + x;
1957
+ zy = 2*zx*zy + y;
1958
+ zx = new_zx;
1959
+ count++;
1960
+ }
1961
+ return count; // Math.sqrt(count);
1962
+ }
1963
+ }, 1000,1000);
1964
+
1965
+ makeSomething(obj);
1966
+ } else
1967
+ if (source == gridItem || source == gridButton)
15251968 {
15261969 makeSomething(new Grid());
15271970 } else
1528
- if (event.getSource() == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
15291972 {
15301973 makeSomething(new Sphere());
15311974 } else
1532
- if (event.getSource() == coneItem)
1975
+ if (source == coneItem || source == coneButton)
15331976 {
15341977 makeSomething(new Cone());
15351978 } else
1536
- if (event.getSource() == torusItem)
1979
+ if (source == torusItem || source == torusButton)
15371980 {
15381981 makeSomething(new Torus());
15391982 } else
1540
- if (event.getSource() == superItem)
1983
+ if (source == superItem || source == superButton)
15411984 {
15421985 makeSomething(new Superellipsoid());
15431986 } else
1544
- if (event.getSource() == blobItem)
1987
+ if (source == kleinItem || source == kleinButton)
1988
+ {
1989
+ makeSomething(new Klein());
1990
+ } else
1991
+ if (source == blobItem)
15451992 {
15461993 Blob blob = new Blob();
15471994 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1996,15 @@
15491996 //blob.retile();
15501997 makeSomething(blob);
15511998 } else
1552
- if (event.getSource() == latheItem)
1999
+ if (source == latheItem)
15532000 {
15542001 makeSomething(new Lathe());
15552002 } else
1556
- if (event.getSource() == bezierItem)
2003
+ if (source == bezierItem)
15572004 {
15582005 makeSomething(new BezierSurface());
15592006 } else
1560
- if (event.getSource() == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
15612008 {
15622009 /*
15632010 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2017,9 @@
15702017 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712018 LA.matInvert(obj.toParent, obj.fromParent);
15722019 */
1573
- makeSomething(new CheckerIG());
2020
+ makeSomething(new Checker());
15742021 } else
1575
- if (event.getSource() == meshItem)
2022
+ if (source == meshItem)
15762023 {
15772024 Object3D itemtomake = new Object3D();
15782025 Object3D child;
....@@ -1593,35 +2040,35 @@
15932040 makeSomething(child);
15942041 }
15952042 } else
1596
- if (event.getSource() == springItem)
2043
+ if (source == springItem)
15972044 {
15982045 cSpring s = new cSpring();
15992046 s.setup();
16002047 makeSomething(s);
16012048 } else
1602
- if (event.getSource() == flagItem)
2049
+ if (source == flagItem)
16032050 {
16042051 cSpring s = new cFlag();
16052052 s.setup();
16062053 makeSomething(s);
16072054 } else
1608
- if (event.getSource() == lightItem)
2055
+ if (source == lightItem || source == lightButton)
16092056 {
16102057 makeSomething(new Light());
16112058 } else
1612
- if (event.getSource() == csgItem)
2059
+ if (source == csgItem)
16132060 {
16142061 group(new CSG());
16152062 } else
1616
- if (event.getSource() == templateItem)
2063
+ if (source == templateItem)
16172064 {
16182065 group(new cTemplate());
16192066 } else
1620
- if (event.getSource() == attributeItem)
2067
+ if (source == attributeItem)
16212068 {
16222069 makeSomething(new Attribute());
16232070 } else
1624
- if (event.getSource() == pointflowItem)
2071
+ if (source == pointflowItem)
16252072 {
16262073 makeSomething(new PointFlow());
16272074 } else
....@@ -1633,7 +2080,7 @@
16332080 } else
16342081 */
16352082
1636
- if (event.getSource() == superLoopItem)
2083
+ if (source == superLoopItem)
16372084 {
16382085 Composite g = new cGroup();
16392086 for (int i=0; i<15; i++)
....@@ -1655,7 +2102,7 @@
16552102
16562103 group(g);
16572104 } else
1658
- if (event.getSource() == loopItem)
2105
+ if (source == loopItem || source == loopButton)
16592106 {
16602107 Composite csg = new GroupLeaf();
16612108 csg.count = 5;
....@@ -1664,7 +2111,7 @@
16642111 csg.addChild(child);
16652112 child.addChild(csg);
16662113 } else
1667
- if (event.getSource() == doubleItem)
2114
+ if (source == doubleItem)
16682115 {
16692116 Composite csg = new GroupLeaf();
16702117 csg.count = 5;
....@@ -1676,7 +2123,7 @@
16762123 csg.addChild(child);
16772124 child.addChild(csg);
16782125 } else
1679
- if (event.getSource() == tripleItem)
2126
+ if (source == tripleItem)
16802127 {
16812128 Composite csg = new GroupLeaf();
16822129 csg.count = 4;
....@@ -1691,71 +2138,83 @@
16912138 csg.addChild(child);
16922139 child.addChild(csg);
16932140 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2141
+ if (source == computeAOItem)
16962142 {
1697
- ImportGFD();
2143
+ Globals.drawMode = CameraPane.OCCLUSION;
2144
+ Globals.theRenderer.repaint();
16982145 } 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)
2146
+ if (source == recompileItem)
17172147 {
17182148 Recompile();
17192149 refreshContents();
17202150 } else
1721
- if (event.getSource() == editScriptItem)
2151
+ if (source == editScriptItem)
17222152 {
17232153 OpenDialog();
17242154 refreshContents();
17252155 } else
1726
- if (event.getSource() == invariantsItem)
2156
+ if (source == invariantsItem)
17272157 {
17282158 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
17302160 } else
1731
- if (event.getSource() == memoryItem)
2161
+ if (source == memoryItem)
17322162 {
17332163 //System.out.println("Invariants:");
17342164 PrintMemory();
17352165 } else
1736
- if (event.getSource() == pathItem)
2166
+ if (source == pathItem)
17372167 {
17382168 PrintPath();
17392169 } else
1740
- if (event.getSource() == analyzeItem)
2170
+ if (source == analyzeItem)
17412171 {
17422172 AnalyzeObject();
17432173 } else
1744
- if (event.getSource() == dumpItem)
2174
+ if (source == dumpItem)
17452175 {
17462176 DumpObject();
17472177 } else
1748
- if (event.getSource() == screenfitButton)
2178
+ if (source == minButton)
2179
+ {
2180
+ Minimize();
2181
+ } else
2182
+ if (source == maxButton)
2183
+ {
2184
+ Maximize();
2185
+ } else
2186
+ if (source == fullButton)
2187
+ {
2188
+ ToggleFullScreen();
2189
+ } else
2190
+ if (source == undoButton)
2191
+ {
2192
+ Undo();
2193
+ } else
2194
+ if (source == redoButton)
2195
+ {
2196
+ Redo();
2197
+ } else
2198
+ if (source == saveButton)
2199
+ {
2200
+ Save();
2201
+ } else
2202
+ if (source == oneStepButton)
2203
+ {
2204
+ Globals.ONESTEP = true;
2205
+ cameraView.repaint();
2206
+ } else
2207
+ if (source == screenfitButton)
17492208 {
17502209 //Reload(lastConverter, lastFilename, true);
17512210 ScreenFit();
17522211 } else
1753
- if (event.getSource() == screenfitpointButton)
2212
+ if (source == screenfitpointButton)
17542213 {
17552214 //Reload(lastConverter, lastFilename, true);
17562215 ScreenFitPoint();
17572216 } else
1758
- if (event.getSource() == snapobjectButton)
2217
+ if (source == snapobjectButton)
17592218 {
17602219 //Reload(lastConverter, lastFilename, true);
17612220 SnapObject();
....@@ -1766,13 +2225,13 @@
17662225 // Recompile();
17672226 // refreshContents();
17682227 // } else
1769
- if (event.getSource() == gcButton)
2228
+ if (source == gcButton)
17702229 {
17712230 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722231 System.gc();
17732232 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742233 } else
1775
- if (event.getSource() == editLeafItem)
2234
+ if (source == editLeafItem)
17762235 {
17772236 Object3D obj;
17782237 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2245,78 @@
17862245 }
17872246 refreshContents(true);
17882247 } else
1789
- if (event.getSource() == openWindowItem)
2248
+ if (source == openWindowItem)
17902249 {
17912250 EditSelection(true);
17922251 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2252
+ if (source == cutItem || source == clearButton)
17942253 {
17952254 loadClipboard(true);
17962255 } else
1797
- if (event.getSource() == duplicateItem)
2256
+ if (source == undoItem)
17982257 {
1799
- Object3D keep = GraphreeD.clipboard;
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
2264
+ if (source == duplicateItem)
2265
+ {
2266
+ Object3D keep = Grafreed.clipboard;
18002267 loadClipboard(false);
18012268 paste(false);
1802
- GraphreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
18032270 } else
1804
- if (event.getSource() == cloneItem)
2271
+ if (source == cloneItem)
18052272 {
18062273 CloneSelection(false);
18072274 } else
1808
- if (event.getSource() == cloneSupportItem)
2275
+ if (source == cloneSupportItem)
18092276 {
18102277 CloneSelection(true);
18112278 } else
1812
- if (event.getSource() == copyItem)
2279
+ if (source == copyItem)
18132280 {
18142281 loadClipboard(false);
18152282 } else
1816
- if (event.getSource() == pasteItem)
2283
+ if (source == pasteItem)
18172284 {
18182285 paste(false);
18192286 } else
1820
- if (event.getSource() == pasteLinkItem)
2287
+ if (source == pasteIntoItem)
18212288 {
1822
- pasteInto(false);
2289
+ pasteInto(true, false);
18232290 } else
1824
- if (event.getSource() == pasteCloneItem)
2291
+ if (source == pasteLinkItem)
18252292 {
1826
- pasteInto(true);
2293
+ pasteInto(false, false);
18272294 } else
1828
- if (event.getSource() == pasteExpandItem)
2295
+ if (source == pasteCloneItem)
2296
+ {
2297
+ pasteInto(true, true);
2298
+ } else
2299
+ if (source == pasteExpandItem)
18292300 {
18302301 paste(true);
18312302 } else
1832
- if (event.getSource() == synchronizeItem)
2303
+ if (source == synchronizeItem)
18332304 {
18342305 Overwrite(Object3D.TRANSFORM);
18352306 } else
1836
- if (event.getSource() == overwriteNameItem)
2307
+ if (source == overwriteNameItem)
18372308 {
18382309 Overwrite(Object3D.NAME);
18392310 } else
1840
- if (event.getSource() == overwriteUVItem)
2311
+ if (source == overwriteUVItem)
18412312 {
18422313 Overwrite(Object3D.UV);
18432314 } else
1844
- if (event.getSource() == overwriteMatItem)
2315
+ if (source == overwriteMatItem)
18452316 {
2317
+ /* july 2015
18462318 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2319
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482320 else
18492321 {
18502322 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2328,16 @@
18562328 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572329 }
18582330 }
2331
+ */
2332
+
2333
+ Overwrite(dropAttributes);
18592334 }
1860
- if (event.getSource() == overwriteGeoItem)
2335
+ if (source == overwriteGeoItem)
18612336 {
18622337 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2338
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642339 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2340
+// Object3D content = GrafreeD.clipboard.get(0);
18662341 //
18672342 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682343 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2349,7 @@
18742349 // refreshContents();
18752350 // }
18762351 } else
1877
- if (event.getSource() == generateMeshItem)
2352
+ if (source == generateMeshItem)
18782353 {
18792354 //if (group.selection.size() == 1)
18802355 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2360,7 @@
18852360 ResetModel();
18862361 refreshContents();
18872362 } else
1888
- if (event.getSource() == extractGeometriesItem)
2363
+ if (source == extractGeometriesItem)
18892364 {
18902365 boolean one = false;
18912366
....@@ -1912,7 +2387,7 @@
19122387 ResetModel();
19132388 refreshContents();
19142389 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2390
+ if (source == cloneGeometriesItem)
19162391 {
19172392 boolean one = false;
19182393
....@@ -1938,32 +2413,37 @@
19382413 ResetModel();
19392414 refreshContents();
19402415 } else
1941
- if (event.getSource() == shareGeometriesItem)
2416
+ if (source == shareGeometriesItem)
19422417 {
19432418 boolean one = false;
19442419
19452420 if (group.selection.size() == 1)
19462421 one = true;
19472422
2423
+ Object3D merge = null;
2424
+
19482425 Object3D content = new cGroup();
19492426
19502427 for (int i=0; i<group.selection.size(); i++)
19512428 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2429
+ merge = new Merge(group.selection.get(i));
19532430
19542431 if (one)
1955
- makeSomething(sel, false);
2432
+ makeSomething(merge, false);
19562433 else
1957
- content.addChild(sel);
2434
+ content.addChild(merge);
19582435 }
19592436
19602437 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2438
+ makeSomething(content, true);
2439
+ else
2440
+ {
2441
+ ResetModel();
2442
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2443
+ refreshContents();
2444
+ }
19652445 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2446
+ if (source == mergeGeometriesItem)
19672447 {
19682448 boolean one = false;
19692449
....@@ -1993,11 +2473,11 @@
19932473 ResetModel();
19942474 refreshContents();
19952475 } else
1996
- if (event.getSource() == linkverticesItem)
2476
+ if (source == linkverticesItem)
19972477 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2478
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992479 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2480
+// Object3D content = GrafreeD.clipboard.get(0);
20012481 //
20022482 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032483 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2486,48 @@
20062486 // group.selection.get(0).setMasterThis(content); // should be identity
20072487 // refreshContents();
20082488 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102490 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
20122492
20132493 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142494 content = ((cGroup)content).get(0);
20152495
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2496
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172497 for (int i=0; i<group.selection.size(); i++)
20182498 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
20212501 group.selection.get(i).linkVerticesThis(content);
20222502 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
20242504 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2505
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262506 refreshContents();
20272507 }
20282508 } else
2029
- if (event.getSource() == resetsupportItem)
2509
+ if (source == resetsupportItem)
20302510 {
20312511 for (int i=0; i<group.selection.size(); i++)
20322512 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
20352515 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
20372517 }
20382518
20392519 refreshContents();
20402520 } else
2041
- if (event.getSource() == resetreferencesItem)
2521
+ if (source == relinkverticesItem)
2522
+ {
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
2525
+ group.selection.RelinkToSupport();
2526
+ CameraPane.SWITCH = random;
2527
+
2528
+ refreshContents();
2529
+ } else
2530
+ if (source == resetreferencesItem)
20422531 {
20432532 for (int i=0; i<group.selection.size(); i++)
20442533 {
....@@ -2047,11 +2536,11 @@
20472536
20482537 refreshContents();
20492538 } else
2050
- if (event.getSource() == setMasterItem)
2539
+ if (source == setMasterItem)
20512540 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532542 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
20552544
20562545 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572546 content = ((cGroup)content).get(0);
....@@ -2060,13 +2549,13 @@
20602549 refreshContents();
20612550 }
20622551 } else
2063
- if (event.getSource() == poseMeshItem)
2552
+ if (source == poseMeshItem)
20642553 {
20652554 if (group.selection.size() == 1)
20662555 {
2067
- if (GraphreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
20682557 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
20702559
20712560 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722561 content = ((cGroup)content).get(0);
....@@ -2079,19 +2568,19 @@
20792568 }
20802569
20812570 } else
2082
- if (event.getSource() == revertMeshItem)
2571
+ if (source == revertMeshItem)
20832572 {
20842573 RevertMeshes();
20852574 } else
2086
- if (event.getSource() == resetMeshItem)
2575
+ if (source == resetAllItem)
20872576 {
20882577 ResetAll();
20892578 } else
2090
- if (event.getSource() == stepAllItem)
2579
+ if (source == stepAllItem)
20912580 {
20922581 StepAll();
20932582 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2583
+ if (source == clearItem) // || event.getSource() == clearButton)
20952584 {
20962585 //int indices[] = jList.getSelectedIndices();
20972586 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2588,46 @@
20992588
21002589 ClearSelection(false);
21012590 } else
2102
- if (event.getSource() == clearAllItem)
2591
+ if (source == clearAllItem)
21032592 {
21042593 ClearSelection(true);
21052594 } else
2106
- if (event.getSource() == grabItem)
2595
+ if (source == grabItem || source == groupButton)
21072596 {
2108
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
21092598 } else
2110
- if (event.getSource() == frontItem)
2599
+ if (source == hideItem)
2600
+ {
2601
+ group(new HiddenObject());
2602
+ } else
2603
+ if (source == frontItem)
21112604 {
21122605 front();
21132606 } else
2114
- if (event.getSource() == backItem)
2607
+ if (source == backItem)
21152608 {
21162609 back();
21172610 } else
2118
- if (event.getSource() == cameraItem)
2611
+ if (source == cameraItem)
21192612 {
21202613 makeSomething(new Camera());
21212614 } else
2122
- if (event.getSource() == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
21232616 {
21242617 group(new Composite());
21252618 } else
2126
- if (event.getSource() == randomItem)
2619
+ if (source == switchItem || source == switchButton)
21272620 {
21282621 RandomNode random = new RandomNode();
21292622 group(random);
21302623 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2624
+ random.name = random.get(0).name + "Switch";
21322625 } else
2133
- if (event.getSource() == physicsItem)
2626
+ if (source == physicsItem)
21342627 {
21352628 group(new PhysicsNode());
21362629 } else
2137
- if (event.getSource() == frameselectorItem)
2630
+ if (source == frameselectorItem)
21382631 {
21392632 for (int i=0; i<group.selection.size(); i++)
21402633 {
....@@ -2146,7 +2639,7 @@
21462639 ResetModel();
21472640 refreshContents();
21482641 } else
2149
- if (event.getSource() == switchGeoItem)
2642
+ if (source == switchGeoItem)
21502643 {
21512644 for (int i=0; i<group.selection.size(); i++)
21522645 {
....@@ -2158,7 +2651,7 @@
21582651 ResetModel();
21592652 refreshContents();
21602653 } else
2161
- if (event.getSource() == switchTransfoItem)
2654
+ if (source == switchTransfoItem)
21622655 {
21632656 for (int i=0; i<group.selection.size(); i++)
21642657 {
....@@ -2170,7 +2663,7 @@
21702663 ResetModel();
21712664 refreshContents();
21722665 } else
2173
- if (event.getSource() == morphItem)
2666
+ if (source == morphItem)
21742667 {
21752668 for (int i=0; i<group.selection.size(); i++)
21762669 {
....@@ -2182,7 +2675,7 @@
21822675 ResetModel();
21832676 refreshContents();
21842677 } else
2185
- if (event.getSource() == scriptNodeItem)
2678
+ if (source == scriptNodeItem)
21862679 {
21872680 boolean atleastone = false;
21882681
....@@ -2221,191 +2714,239 @@
22212714 }
22222715 }
22232716 } else
2224
- if (event.getSource() == linkerItem)
2717
+ if (source == linkerItem)
22252718 {
22262719 group(new cLinker());
22272720 } else
2228
- if (event.getSource() == textureItem)
2721
+ if (source == textureItem || source == textureButton)
22292722 {
22302723 group(new TextureNode());
22312724 } else
2232
- if (event.getSource() == shadowXItem)
2725
+ if (source == billboardItem)
2726
+ {
2727
+ group(new BillboardNode());
2728
+ } else
2729
+ if (source == shadowXItem)
22332730 {
22342731 CastShadow(0);
22352732 } else
2236
- if (event.getSource() == shadowYItem)
2733
+ if (source == shadowYItem)
22372734 {
22382735 CastShadow(1);
22392736 } else
2240
- if (event.getSource() == shadowZItem)
2737
+ if (source == shadowZItem)
22412738 {
22422739 CastShadow(2);
22432740 } else
2244
- if (event.getSource() == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
22452742 {
2246
- ungroup();
2743
+ //ungroup();
2744
+ for (int i=0; i<group.selection.size(); i++)
2745
+ {
2746
+ Ungroup(group.selection.get(i));
2747
+ }
2748
+
2749
+ ClearSelection(false);
2750
+
2751
+ refreshContents();
22472752 } else
2248
- if (event.getSource() == genUVItem)
2753
+ if (source == genUVItem)
22492754 {
22502755 GenUV();
22512756 } else
2252
- if (event.getSource() == genNormalsCADItem)
2757
+ if (source == genNormalsCADItem)
22532758 {
22542759 GenNormals(true);
22552760 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2761
+ if (source == genNormalsMESHItem)
2762
+ {
2763
+ GenNormalsMESH();
2764
+ } else
2765
+ if (source == genNormalsORGANItem)
22572766 {
22582767 GenNormals(false);
22592768 } else
2260
- if (event.getSource() == stripifyItem)
2769
+ if (source == genNormalsMINEItem)
2770
+ {
2771
+ GenNormalsMINE();
2772
+ } else
2773
+ if (source == stripifyItem)
22612774 {
22622775 Stripify();
22632776 } else
2264
- if (event.getSource() == unstripifyItem)
2777
+ if (source == unstripifyItem)
22652778 {
22662779 Unstripify();
22672780 } else
2268
- if (event.getSource() == trimItem)
2781
+ if (source == trimItem)
22692782 {
22702783 Trim();
22712784 } else
2272
- if (event.getSource() == untrimItem)
2785
+ if (source == untrimItem)
22732786 {
22742787 Untrim();
22752788 } else
2276
- if (event.getSource() == clearColorsItem)
2789
+ if (source == clearColorsItem)
22772790 {
22782791 ClearColors();
22792792 } else
2280
- if (event.getSource() == clearMaterialsItem)
2793
+ if (source == clearMaterialsItem)
22812794 {
22822795 ClearMaterials();
22832796 } else
2284
- if (event.getSource() == liveleavesItem)
2797
+ if (source == liveleavesItem)
22852798 {
22862799 LiveLeaves(true);
22872800 } else
2288
- if (event.getSource() == unliveleavesItem)
2801
+ if (source == unliveleavesItem)
22892802 {
22902803 LiveLeaves(false);
22912804 } else
2292
- if (event.getSource() == supportleavesItem)
2805
+ if (source == supportleavesItem)
22932806 {
22942807 SupportLeaves(true);
22952808 } else
2296
- if (event.getSource() == unsupportleavesItem)
2809
+ if (source == unsupportleavesItem)
22972810 {
22982811 SupportLeaves(false);
22992812 } else
2300
- if (event.getSource() == hideleavesItem)
2813
+ if (source == hideleavesItem)
23012814 {
23022815 HideLeaves(true);
23032816 } else
2304
- if (event.getSource() == showleavesItem)
2817
+ if (source == showleavesItem)
23052818 {
23062819 HideLeaves(false);
23072820 } else
2308
- if (event.getSource() == markleavesItem)
2821
+ if (source == markleavesItem)
23092822 {
23102823 MarkLeaves(true);
23112824 } else
2312
- if (event.getSource() == unmarkleavesItem)
2825
+ if (source == unmarkleavesItem)
23132826 {
23142827 MarkLeaves(false);
23152828 } else
2316
- if (event.getSource() == flipVItem)
2829
+ if (source == rewindleavesItem)
2830
+ {
2831
+ RewindLeaves(true);
2832
+ } else
2833
+ if (source == unrewindleavesItem)
2834
+ {
2835
+ RewindLeaves(false);
2836
+ } else
2837
+ if (source == randomleavesItem)
2838
+ {
2839
+ RandomLeaves(true);
2840
+ } else
2841
+ if (source == unrandomleavesItem)
2842
+ {
2843
+ RandomLeaves(false);
2844
+ } else
2845
+ if (source == flipVItem)
23172846 {
23182847 FlipV(true);
23192848 } else
2320
- if (event.getSource() == unflipVItem)
2849
+ if (source == unflipVItem)
23212850 {
23222851 FlipV(false);
23232852 } else
2324
- if (event.getSource() == lowTexturesItem)
2853
+ if (source == lowTexturesItem)
23252854 {
23262855 SetTexRes(0);
23272856 } else
2328
- if (event.getSource() == normalTexturesItem)
2857
+ if (source == normalTexturesItem)
23292858 {
23302859 SetTexRes(1);
23312860 } else
2332
- if (event.getSource() == highTexturesItem)
2861
+ if (source == highTexturesItem)
23332862 {
23342863 SetTexRes(2);
23352864 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2865
+ if (source == veryhighTexturesItem)
23372866 {
23382867 SetTexRes(3);
23392868 } else
2340
- if (event.getSource() == maxTexturesItem)
2869
+ if (source == maxTexturesItem)
23412870 {
23422871 SetTexRes(4);
23432872 } else
2344
- if (event.getSource() == panoTexturesItem)
2873
+ if (source == panoTexturesItem)
23452874 {
23462875 SetTexRes(5);
23472876 } else
2348
- if (event.getSource() == reverseNormalsItem)
2877
+ if (source == reverseNormalsItem)
23492878 {
23502879 ReverseNormals();
23512880 } else
2352
- if (event.getSource() == parseverticesItem)
2881
+ if (source == parseverticesItem)
23532882 {
23542883 ParseVertices();
23552884 } else
2356
- if (event.getSource() == alignItem)
2885
+ if (source == textureFieldItem)
2886
+ {
2887
+ TextureVertices();
2888
+ } else
2889
+ if (source == alignItem)
23572890 {
23582891 Align();
23592892 } else
2360
- if (event.getSource() == mirrorItem)
2893
+ if (source == mirrorItem)
23612894 {
23622895 MirrorPoses();
23632896 } else
2364
- if (event.getSource() == reduceMorphItem)
2897
+ if (source == reduceMorphItem)
23652898 {
23662899 MeshReduction(false);
23672900 } else
2368
- if (event.getSource() == reduce34MorphItem)
2901
+ if (source == reduce34MorphItem)
23692902 {
23702903 MeshReduction(true);
23712904 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2905
+ if (source == reverseTrianglesItem)
23732906 {
23742907 ReverseTriangles();
23752908 } else
2376
- if (event.getSource() == reduceMeshItem)
2909
+ if (source == reduceMeshItem)
23772910 {
23782911 ReduceMesh(false);
23792912 } else
2380
- if (event.getSource() == reduce34MeshItem)
2913
+ if (source == reduce34MeshItem)
23812914 {
23822915 ReduceMesh(true);
23832916 } else
2384
- if (event.getSource() == increaseMeshItem)
2917
+ if (source == increaseMeshItem)
23852918 {
23862919 IncreaseMesh();
23872920 } else
2388
- if (event.getSource() == clipMeshItem)
2921
+ if (source == clipMeshItem)
23892922 {
23902923 ClipMesh();
23912924 } else
2392
- if (event.getSource() == smoothMeshItem)
2925
+ if (source == smoothMeshItem)
23932926 {
23942927 SmoothMesh();
23952928 } else
2396
- if (event.getSource() == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
23972930 {
23982931 TransformGeometry();
23992932 } else
2400
- if (event.getSource() == resetTransformItem)
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
2936
+ } else
2937
+ if (source == resetTransformItem)
24012938 {
24022939 ResetTransform();
24032940 } else
2404
- if (event.getSource() == resetCentroidItem)
2941
+ if (source == resetCentroidItem)
24052942 {
2406
- ResetCentroid();
2943
+ ResetCentroid(true);
24072944 } else
2408
- if (event.getSource() == resetParentItem)
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
2948
+ } else
2949
+ if (source == resetParentItem)
24092950 {
24102951 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112952 {
....@@ -2415,7 +2956,7 @@
24152956
24162957 refreshContents();
24172958 } else
2418
- if (event.getSource() == repairParentItem)
2959
+ if (source == repairParentItem)
24192960 {
24202961 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212962 {
....@@ -2429,7 +2970,21 @@
24292970
24302971 refreshContents();
24312972 } else
2432
- if (event.getSource() == sortbysizeItem)
2973
+ if (source == repairShadowItem)
2974
+ {
2975
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2976
+ {
2977
+ Object3D obj = (Object3D)e.nextElement();
2978
+ obj.RepairShadow();
2979
+// for (int i=0; i<obj.size(); i++)
2980
+// {
2981
+// obj.get(i).parent = obj;
2982
+// }
2983
+ }
2984
+
2985
+ refreshContents();
2986
+ } else
2987
+ if (source == sortbysizeItem)
24332988 {
24342989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352990 {
....@@ -2441,7 +2996,7 @@
24412996 ResetModel();
24422997 refreshContents();
24432998 } else
2444
- if (event.getSource() == sortbynameItem)
2999
+ if (source == sortbynameItem)
24453000 {
24463001 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473002 {
....@@ -2453,7 +3008,7 @@
24533008 ResetModel();
24543009 refreshContents();
24553010 } else
2456
- if (event.getSource() == attachPigmentItem)
3011
+ if (source == attachPigmentItem)
24573012 {
24583013 String texture = GetFile("Attach pigment");
24593014 Object3D obj;
....@@ -2465,7 +3020,7 @@
24653020
24663021 refreshContents();
24673022 } else
2468
- if (event.getSource() == detachPigmentItem)
3023
+ if (source == detachPigmentItem)
24693024 {
24703025 Object3D obj;
24713026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3031,7 @@
24763031
24773032 refreshContents();
24783033 } else
2479
- if (event.getSource() == attachBumpItem)
3034
+ if (source == attachBumpItem)
24803035 {
24813036 String texture = GetFile("Attach bump");
24823037 Object3D obj;
....@@ -2488,7 +3043,7 @@
24883043
24893044 refreshContents();
24903045 } else
2491
- if (event.getSource() == detachBumpItem)
3046
+ if (source == detachBumpItem)
24923047 {
24933048 Object3D obj;
24943049 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +3054,7 @@
24993054
25003055 refreshContents();
25013056 } else
2502
- if (event.getSource() == pigmentBumpItem)
3057
+ if (source == pigmentBumpItem)
25033058 {
25043059 Object3D obj;
25053060 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3065,237 @@
25103065
25113066 refreshContents();
25123067 } else
2513
- if (event.getSource() == flashSelectionButton)
3068
+ if (source == flashSelectionButton)
25143069 {
25153070 CameraPane.flash = true;
25163071 refreshContents();
25173072 } else
2518
- if (event.getSource() == oneButton)
3073
+ if (source == oneButton)
25193074 {
25203075 } else
2521
- if (event.getSource() == twoButton)
3076
+ if (source == twoButton)
25223077 {
25233078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
25243083 // bug
25253084 //gridPanel.setDividerLocation(1.0);
25263085 //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();
3086
+// bigThree.remove(scenePanel);
3087
+// bigThree.remove(centralPanel);
3088
+// bigThree.remove(XYZPanel);
3089
+// aWindowConstraints.gridx = 0;
3090
+// aWindowConstraints.gridy = 0;
3091
+// aWindowConstraints.gridwidth = 1;
3092
+// // aConstraints.gridheight = 3;
3093
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3094
+// aWindowConstraints.weightx = 0;
3095
+// aWindowConstraints.weighty = 1;
3096
+// //bigThree.add(jtp, aWindowConstraints);
3097
+// aWindowConstraints.weightx = 1;
3098
+// aWindowConstraints.gridwidth = 3;
3099
+// // aConstraints.gridheight = 3;
3100
+// aWindowConstraints.gridx = 1;
3101
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3102
+// bigThree.add(centralPanel, aWindowConstraints);
3103
+// aWindowConstraints.weightx = 0;
3104
+// aWindowConstraints.gridx = 4;
3105
+// aWindowConstraints.gridwidth = 1;
3106
+// // aConstraints.gridheight = 3;
3107
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3108
+// //bigThree.add(XYZPanel, aWindowConstraints);
3109
+// scenePanel.setVisible(false);
3110
+// centralPanel.setVisible(true);
3111
+// XYZPanel.setVisible(false);
3112
+ bigThree.ClearUI();
3113
+ bigThree.add(centralPanel);
3114
+ bigThree.FlushUI();
3115
+
3116
+ cameraView.requestFocusInWindow();
3117
+
3118
+// refreshContents(true);
3119
+//
3120
+// try
3121
+// {
3122
+// java.awt.Robot bot = new java.awt.Robot();
3123
+// int mask = InputEvent.BUTTON1_MASK;
3124
+// bot.mouseMove(100, 100);
3125
+// bot.mousePress(mask);
3126
+// bot.mouseRelease(mask);
3127
+// }
3128
+// catch (Exception e)
3129
+// {
3130
+//
3131
+// }
3132
+
25513133 } else
2552
- if (event.getSource() == threeButton)
3134
+ if (source == threeButton)
25533135 {
25543136 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();
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
3140
+
3141
+// bigThree.remove(scenePanel);
3142
+// bigThree.remove(centralPanel);
3143
+// bigThree.remove(XYZPanel);
3144
+// aWindowConstraints.gridx = 0;
3145
+// aWindowConstraints.gridy = 0;
3146
+// aWindowConstraints.gridwidth = 1;
3147
+// // aConstraints.gridheight = 3;
3148
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3149
+// aWindowConstraints.weightx = 0;
3150
+// aWindowConstraints.weighty = 1;
3151
+// //bigThree.add(jtp, aWindowConstraints);
3152
+// aWindowConstraints.weightx = 1;
3153
+// aWindowConstraints.gridwidth = 3;
3154
+// // aConstraints.gridheight = 3;
3155
+// aWindowConstraints.gridx = 1;
3156
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3157
+// bigThree.add(centralPanel, aWindowConstraints);
3158
+// aWindowConstraints.weightx = 0;
3159
+// aWindowConstraints.gridx = 4;
3160
+// aWindowConstraints.gridwidth = 1;
3161
+// // aConstraints.gridheight = 3;
3162
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3163
+// bigThree.add(XYZPanel, aWindowConstraints);
3164
+// bigThree.validate();
3165
+// scenePanel.setVisible(false);
3166
+// centralPanel.setVisible(true);
3167
+// XYZPanel.setVisible(true);
3168
+ bigThree.ClearUI();
3169
+ bigThree.add(centralPanel);
3170
+ bigThree.add(XYZPanel);
3171
+ bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
25793174 } else
2580
- if (event.getSource() == fourButton)
3175
+ if (source == fourButton)
25813176 {
25823177 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();
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
3181
+
3182
+// bigThree.remove(scenePanel);
3183
+// bigThree.remove(centralPanel);
3184
+// bigThree.remove(XYZPanel);
3185
+// aWindowConstraints.gridx = 0;
3186
+// aWindowConstraints.gridy = 0;
3187
+// aWindowConstraints.gridwidth = 1;
3188
+// // aWindowConstraints.gridheight = 3;
3189
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3190
+// aWindowConstraints.weightx = 1;
3191
+// aWindowConstraints.weighty = 1;
3192
+// bigThree.add(scenePanel, aWindowConstraints);
3193
+// aWindowConstraints.weightx = 1;
3194
+// aWindowConstraints.gridwidth = 3;
3195
+// // aConstraints.gridheight = 3;
3196
+// aWindowConstraints.gridx = 1;
3197
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3198
+// //bigThree.add(cameraPanel, aWindowConstraints);
3199
+// aWindowConstraints.weightx = 0;
3200
+// aWindowConstraints.gridx = 4;
3201
+// aWindowConstraints.gridwidth = 1;
3202
+// // aWindowConstraints.gridheight = 3;
3203
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3204
+// //bigThree.add(XYZPanel, aWindowConstraints);
3205
+// bigThree.validate();
3206
+// scenePanel.setVisible(true);
3207
+// centralPanel.setVisible(false);
3208
+// XYZPanel.setVisible(false);
3209
+ bigThree.ClearUI();
3210
+ bigThree.add(scenePanel);
3211
+ bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
26073214 } else
2608
- if (event.getSource() == sixButton)
3215
+ if (source == sixButton)
26093216 {
26103217 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();
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
3221
+
3222
+// bigThree.remove(scenePanel);
3223
+// bigThree.remove(centralPanel);
3224
+// bigThree.remove(XYZPanel);
3225
+// aWindowConstraints.gridx = 0;
3226
+// aWindowConstraints.gridy = 0;
3227
+// aWindowConstraints.gridwidth = 1;
3228
+// // aConstraints.gridheight = 3;
3229
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3230
+// aWindowConstraints.weightx = 0;
3231
+// aWindowConstraints.weighty = 1;
3232
+// bigThree.add(scenePanel, aWindowConstraints);
3233
+// aWindowConstraints.weightx = 1;
3234
+// aWindowConstraints.gridwidth = 3;
3235
+// // aWindowConstraints.gridheight = 3;
3236
+// aWindowConstraints.gridx = 1;
3237
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3238
+// bigThree.add(centralPanel, aWindowConstraints);
3239
+// aWindowConstraints.weightx = 0;
3240
+// aWindowConstraints.gridx = 4;
3241
+// aWindowConstraints.gridwidth = 1;
3242
+// // aWindowConstraints.gridheight = 3;
3243
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3244
+// //bigThree.add(XYZPanel, aConstraints);
3245
+// bigThree.validate();
3246
+// scenePanel.setVisible(true);
3247
+// centralPanel.setVisible(true);
3248
+// XYZPanel.setVisible(false);
3249
+ bigThree.ClearUI();
3250
+ bigThree.add(scenePanel);
3251
+ bigThree.add(centralPanel);
3252
+ bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
26353255 } else
2636
- if (event.getSource() == sevenButton)
3256
+ if (source == sevenButton)
26373257 {
26383258 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();
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
3262
+
3263
+// bigThree.remove(scenePanel);
3264
+// bigThree.remove(centralPanel);
3265
+// bigThree.remove(XYZPanel);
3266
+// aWindowConstraints.gridx = 0;
3267
+// aWindowConstraints.gridy = 0;
3268
+// aWindowConstraints.gridwidth = 1;
3269
+// // aWindowConstraints.gridheight = 3;
3270
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3271
+// aWindowConstraints.weightx = 0;
3272
+// aWindowConstraints.weighty = 1;
3273
+// bigThree.add(scenePanel, aWindowConstraints);
3274
+// aWindowConstraints.weightx = 1;
3275
+// aWindowConstraints.gridwidth = 3;
3276
+// // aWindowConstraints.gridheight = 3;
3277
+// aWindowConstraints.gridx = 1;
3278
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3279
+// bigThree.add(centralPanel, aWindowConstraints);
3280
+// aWindowConstraints.weightx = 0;
3281
+// aWindowConstraints.gridx = 4;
3282
+// aWindowConstraints.gridwidth = 1;
3283
+// // aConstraints.gridheight = 3;
3284
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3285
+// bigThree.add(XYZPanel, aWindowConstraints);
3286
+// bigThree.validate();
3287
+// scenePanel.setVisible(true);
3288
+// centralPanel.setVisible(true);
3289
+// XYZPanel.setVisible(true);
3290
+ bigThree.ClearUI();
3291
+ bigThree.add(scenePanel);
3292
+ bigThree.add(centralPanel);
3293
+ bigThree.add(XYZPanel);
3294
+ bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
26633297 } else
2664
- if (event.getSource() == rootButton)
3298
+ if (source == rootButton)
26653299 {
26663300 Object3D obj;
26673301 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3305,84 @@
26713305 EditObject(obj);
26723306 }
26733307
3308
+ cameraView.requestFocusInWindow();
26743309 refreshContents(true);
26753310 } else
2676
- if (event.getSource() == closeButton)
3311
+ if (source == closeButton)
26773312 {
26783313 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793314 cRadio ab;
26803315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813316 {
26823317 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
26853326 buttonGroup.remove(ab);
26863327 radioPanel.remove(ab);
26873328
2688
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
26893331 // ab.GetObject().objectUI = null; // ?????????
26903332
26913333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923334 break;
26933335 }
26943336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
26953339 refreshContents(true);
26963340 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3341
+ if (source == editItem || source == editButton)
26983342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
26993349 EditSelection(false);
27003350 } else
2701
- if (event.getSource() == uneditButton)
3351
+ if (source == uneditButton)
27023352 {
27033353 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043354 {
27053355 Object3D child = (Object3D)e.nextElement();
27063356 if(child.editWindow != null)
27073357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
27083359 child.CloseUI();
27093360 listUI.remove(child);
27103361
2711
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
27123363 }
2713
- objEditor.ctrlPanel.revalidate();
3364
+ objEditor.ctrlPanel.FlushUI();
27143365 //objEditor.jTree.clearSelection();
27153366 //objEditor.ResetSliders();
27163367 refreshContents(true);
27173368 } else
2718
- if (event.getSource() == clearPanelButton)
3369
+ if (source == clearPanelButton)
27193370 {
27203371 assert(copy == group);
27213372 //copy.ClearUI();
27223373 for (Object3D obj : listUI)
27233374 {
3375
+ obj.pinned = true;
27243376 obj.CloseUI();
27253377 }
27263378 listUI.clear();
27273379 refreshContents(true);
27283380 } else
2729
- if (event.getSource() == allParamsButton)
3381
+ if (source == allParamsButton)
27303382 {
27313383 assert(copy == group);
27323384
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343386
27353387 for (Object3D obj : listUI)
27363388 {
....@@ -2747,19 +3399,19 @@
27473399
27483400 refreshContents(true);
27493401 } else
2750
- if (event.getSource() == unselectButton)
3402
+ if (source == unselectButton)
27513403 {
27523404 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3405
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543406 objEditor.ResetSliders();
27553407 refreshContents(true);
27563408 } else
2757
- if(event.getSource() instanceof cRadio)
3409
+ if(source instanceof cRadio)
27583410 {
27593411 group.parent = keepparent;
27603412 group.attributes = 0;
27613413 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3414
+ /*cRadio*/ radio = (cRadio)source;
27633415 Object3D obj = radio.GetObject();
27643416 System.out.println("Edit " + obj);
27653417 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3431,7 @@
27793431 }
27803432
27813433 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3434
+ //Globals.theRenderer.object = group;
27833435 if(!useclient)
27843436 {
27853437 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3440,17 @@
27883440 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893441 cameraView.targetLookAt.set(radio.camera.lookAt);
27903442 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3443
+ //cameraView.lighttouched = true;
3444
+ Globals.lighttouched = true;
27923445 topView.object = group;
27933446 frontView.object = group;
27943447 sideView.object = group;
27953448 }
2796
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
27973454 /*
27983455 currentLayout = radio.layout;
27993456 if (currentLayout == null)
....@@ -2805,8 +3462,23 @@
28053462 //group.parent = null; // ROOT
28063463 //group.attributes = -1;
28073464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
28083467 refreshContents(true);
2809
- }
3468
+ } else if (event.getSource() == editCameraItem)
3469
+ {
3470
+ cameraView.ProtectCamera();
3471
+ cameraView.repaint();
3472
+ return;
3473
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3474
+ {
3475
+ cameraView.RevertCamera();
3476
+ cameraView.repaint();
3477
+ return;
3478
+ // } else if (event.getSource() == textureButton)
3479
+ // {
3480
+ // return; // true;
3481
+ }
28103482 else
28113483 {
28123484 //return super.action(event, arg);
....@@ -2815,7 +3487,6 @@
28153487 }
28163488
28173489 boolean useclient = false;
2818
- cRadio radio;
28193490
28203491 void ToggleRoot()
28213492 {
....@@ -2824,7 +3495,7 @@
28243495 if (useclient)
28253496 {
28263497 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3498
+ Globals.lighttouched = true;
28283499 //topView.object = client;
28293500 //frontView.object = client;
28303501 //sideView.object = client;
....@@ -2832,7 +3503,7 @@
28323503 else
28333504 {
28343505 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3506
+ Globals.lighttouched = true;
28363507 //topView.object = group;
28373508 //frontView.object = group;
28383509 //sideView.object = group;
....@@ -2867,6 +3538,28 @@
28673538 refreshContents();
28683539 }
28693540
3541
+ void TransformChildren()
3542
+ {
3543
+ Object3D obj;
3544
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3545
+ {
3546
+ obj = (Object3D)e.nextElement();
3547
+ obj.KeepTextureMatrices();
3548
+ obj.TransformChildren();
3549
+ obj.RestoreTextureMatrices();
3550
+
3551
+// if (obj.parent == null)
3552
+// {
3553
+// System.out.println("NULL PARENT!");
3554
+// new Exception().printStackTrace();
3555
+// }
3556
+// else
3557
+// TouchTransform(obj);
3558
+// //obj.parent.Touch();
3559
+ }
3560
+
3561
+ refreshContents();
3562
+ }
28703563
28713564 void ResetTransform()
28723565 {
....@@ -2979,7 +3672,7 @@
29793672 refreshContents();
29803673 }
29813674
2982
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
29833676 {
29843677 Object3D obj;
29853678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3687,16 @@
29943687 LA.matIdentity(Object3D.mat);
29953688 obj.getBounds(minima, maxima, false);
29963689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993693 obj.TransformMesh(Object3D.mat);
3694
+
30003695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
30033700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3725,8 @@
30283725
30293726 int size = obj.MemorySize();
30303727
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3728
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3729
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323730 }
30333731 }
30343732 catch (Exception e)
....@@ -3065,9 +3763,9 @@
30653763 obj = (Object3D)e.nextElement();
30663764
30673765 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
30693767 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
30713769
30723770 // System.err.println((size/1024) + " KB is the size of " + obj);
30733771 }
....@@ -3109,6 +3807,20 @@
31093807 void GenNormals(boolean crease)
31103808 {
31113809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
3817
+
3818
+ refreshContents();
3819
+ }
3820
+
3821
+ void GenNormalsMINE()
3822
+ {
3823
+ group.selection.GenNormalsMINE();
31123824
31133825 refreshContents();
31143826 }
....@@ -3157,104 +3869,259 @@
31573869
31583870 //Object3D buffer;
31593871 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
-
3872
+// BoundaryRep temprep;
3873
+// Object3D nodes;
3874
+// Vector<Vertex> vertices;
3875
+//
3876
+// cGroup buffer;
3877
+//
3878
+// public void Vertex(Object3D node, Vertex v)
3879
+// {
3880
+//// vertices.add(v);
3881
+//// nodes.addElement(node);
3882
+////
3883
+//// if (temprep.GetCache(v) != null)
3884
+//// {
3885
+//// temprep.Remove(v);
3886
+//// } else
3887
+//// {
3888
+//// temprep.Remember(v);
3889
+//// }
3890
+//
3891
+// //Object3D node = nodes.get(index);
3892
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3893
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3894
+//
3895
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3896
+//
3897
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3898
+//
3899
+// cGroup g = new cGroup();
3900
+//
3901
+// if (g.toParent == null)
3902
+// {
3903
+// g.toParent = LA.newMatrix();
3904
+// g.fromParent = LA.newMatrix();
3905
+// }
3906
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3907
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3908
+//
3909
+// g.add(GrafreeD.clipboard);
3910
+//
3911
+// buffer.add(g);
3912
+// }
3913
+//
3914
+// public void Face(Object3D node, Face f)
3915
+// {
3916
+//
3917
+// }
3918
+//
3919
+// void ParseVerticesOld() // ??
3920
+// {
3921
+// //if (group.selection.size() != 1)
3922
+// // return;
3923
+//
3924
+// temprep = new BoundaryRep();
3925
+// nodes = new Object3D();
3926
+// vertices = new Vector<Vertex>();
3927
+//
3928
+// boolean epsequal = GrafreeD.epsequal;
3929
+// GrafreeD.epsequal = true;
3930
+//
3931
+// for (int i=0; i<group.selection.size(); i++)
3932
+// {
3933
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3934
+//
3935
+// group.selection.get(i).Parse(
3936
+//this );
3937
+//
3938
+// int repsize = temprep.VertexCount();
3939
+// int tablesize = temprep.vertextable.size();
3940
+// int nodesize = nodes.size();
3941
+//
3942
+// assert(vertices.size() == nodes.size());
3943
+//
3944
+// temprep.vertextable.elements();
3945
+//
3946
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3947
+//
3948
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3949
+// {
3950
+// cGroup g = new cGroup();
3951
+//
3952
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3953
+//
3954
+// Object3D node = nodes.get(index);
3955
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3956
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3957
+//
3958
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3959
+//
3960
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3961
+//
3962
+// if (g.toParent == null)
3963
+// {
3964
+// g.toParent = LA.newMatrix();
3965
+// g.fromParent = LA.newMatrix();
3966
+// }
3967
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3968
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3969
+//
3970
+// g.add(GrafreeD.clipboard);
3971
+//
3972
+// buffer.add(g);
3973
+// }
3974
+//
3975
+// makeSomething(buffer, i==group.selection.size()-1);
3976
+// }
3977
+//
3978
+// GrafreeD.epsequal = epsequal;
3979
+//
3980
+// //buffer = null;
3981
+// temprep = null;
3982
+// nodes = null;
3983
+//
3984
+// refreshContents();
3985
+// }
3986
+
31843987 void ParseVertices()
31853988 {
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;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
31953991
31963992 for (int i=0; i<group.selection.size(); i++)
31973993 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3994
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993995
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3996
+ group.selection.get(i).Parse(
3997
+
3998
+ new iParse()
3999
+ {
4000
+ public void Vertex(Object3D node, Vertex v)
4001
+ {
4002
+ temp.set(v);
4003
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054004
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();
4005
+ cGroup g = new cGroup();
32114006
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4007
+ if (g.toParent == null)
4008
+ {
4009
+ g.toParent = LA.newMatrix();
4010
+ g.fromParent = LA.newMatrix();
4011
+ }
4012
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4013
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154014
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);
4015
+ g.add(Grafreed.clipboard);
32204016
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);
4017
+ buffer.add(g);
4018
+ }
32324019
3233
- g.add(GraphreeD.clipboard);
4020
+ public void Face(Object3D node, Face f)
4021
+ {
32344022
3235
- buffer.add(g);
3236
- }
4023
+ }
4024
+ }
4025
+ );
32374026
32384027 makeSomething(buffer, i==group.selection.size()-1);
32394028 }
32404029
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4030
+ Grafreed.epsequal = epsequal;
32464031
32474032 refreshContents();
32484033 }
3249
-
4034
+
4035
+ void TextureVertices()
4036
+ {
4037
+ for (int i=0; i<group.selection.size(); i++)
4038
+ {
4039
+ group.selection.get(i).Parse(
4040
+ new iParse()
4041
+ {
4042
+ public void Vertex(Object3D node, Vertex v)
4043
+ {
4044
+ cTexture tex = node.GetTextures();
4045
+ String pigment = Object3D.GetPigment(tex);
4046
+ //String bump = Object3D.GetBump(tex);
4047
+
4048
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4049
+
4050
+ try
4051
+ {
4052
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4053
+ }
4054
+ catch (Exception e)
4055
+ {
4056
+ System.err.println("FAIL: " + node);
4057
+ }
4058
+
4059
+ double s = v.s;
4060
+
4061
+ if (s == 1)
4062
+ s = 0;
4063
+
4064
+ double t = v.t;
4065
+
4066
+ if (t == 1)
4067
+ t = 0;
4068
+
4069
+ int indexs = (int) (texturedata.getWidth() * s);
4070
+ int indext = (int) (texturedata.getHeight() * t);
4071
+
4072
+ int index = indext * texturedata.getWidth() + indexs;
4073
+
4074
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4075
+
4076
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4077
+
4078
+ float scale = bytebuf.get(index*slide) & 0xFF;
4079
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4080
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4081
+ scale /= 3;
4082
+
4083
+ scale /= 0xFF;
4084
+ // c'est quoi ca? scale /= 4;
4085
+
4086
+ //v.AO = scale;
4087
+
4088
+ v.x += v.norm.x * scale;
4089
+ v.y += v.norm.y * scale;
4090
+ v.z += v.norm.z * scale;
4091
+ }
4092
+
4093
+ public void Face(Object3D node, Face f)
4094
+ {
4095
+ }
4096
+ }
4097
+ );
4098
+ }
4099
+
4100
+ refreshContents();
4101
+ }
4102
+
32504103 void Align()
32514104 {
4105
+ if (group.selection.size() == 0)
4106
+ return;
4107
+
4108
+ cVector bbmin = new cVector();
4109
+ cVector bbmax = new cVector();
4110
+
4111
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4112
+
4113
+ double dx = bbmax.x - bbmin.x;
4114
+ double dy = bbmax.y - bbmin.y;
4115
+ double dz = bbmax.z - bbmin.z;
4116
+
4117
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4118
+
32524119 for (int i=0; i<group.selection.size(); i++)
32534120 {
32544121 Object3D obj = group.selection.get(i);
32554122
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4123
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4124
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584125 }
32594126
32604127 refreshContents();
....@@ -3267,7 +4134,7 @@
32674134 // ref.SaveSupports();
32684135 // Object3D par = ref.parent;
32694136 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4137
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714138 // ref.parent = par;
32724139 // ref.RestoreSupports();
32734140
....@@ -3275,11 +4142,11 @@
32754142
32764143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774144
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
32804147 lowres.linkVerticesThis(null);
32814148 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
32834150
32844151 System.err.flush();
32854152
....@@ -3297,7 +4164,7 @@
32974164 // lowres.SaveSupports();
32984165 // par = lowres.parent;
32994166 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4167
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014168 Object3D newlow = CloneObject(lowres, false);
33024169 newlow.name = sn.switchobject.get(i).name;
33034170 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4186,7 @@
33194186 return;
33204187
33214188 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
33234190
33244191 Object3D newgroup = new Object3D("Po:" + poses.name);
33254192
....@@ -3488,7 +4355,7 @@
34884355 group.selection.RelinkToSupport(); // july 2014
34894356 System.out.println("DONE.");
34904357 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4358
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924359 }
34934360
34944361 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4380,20 @@
35134380
35144381 void ClipMesh()
35154382 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174384 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
35194386
35204387 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214388 content = ((cGroup)content).get(0);
35224389
35234390 // for (int i=0; i<group.selection.size(); i++)
35244391 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4392
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264393 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
35284395 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4396
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304397 System.out.println("DONE.");
35314398 refreshContents();
35324399 }
....@@ -3571,6 +4438,18 @@
35714438 void MarkLeaves(boolean hide)
35724439 {
35734440 group.selection.MarkLeaves(hide);
4441
+ refreshContents();
4442
+ }
4443
+
4444
+ void RewindLeaves(boolean hide)
4445
+ {
4446
+ group.selection.RewindLeaves(hide);
4447
+ refreshContents();
4448
+ }
4449
+
4450
+ void RandomLeaves(boolean hide)
4451
+ {
4452
+ group.selection.RandomLeaves(hide);
35744453 refreshContents();
35754454 }
35764455
....@@ -3645,10 +4524,6 @@
36454524 // }
36464525 // }
36474526
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36524527 void EditSelection(boolean newWindow)
36534528 {
36544529 // aConstraints.gridy = 0;
....@@ -3656,10 +4531,10 @@
36564531 {
36574532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604535
36614536 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4537
+ if(elem != group || !newWindow)
36634538 {
36644539 // if (!(elem instanceof Composite))
36654540 // newWindow = false;
....@@ -3742,6 +4617,17 @@
37424617
37434618 freezemodel = true;
37444619
4620
+ //for (Object3D obj : listUI)
4621
+ for (int i=listUI.size(); --i>=0;)
4622
+ {
4623
+ Object3D obj = listUI.elementAt(i);
4624
+ if (!obj.pinned)
4625
+ {
4626
+ obj.CloseUI();
4627
+ listUI.remove(i);
4628
+ }
4629
+ }
4630
+
37454631 /**/
37464632 //switch (event.id)
37474633 {
....@@ -3749,7 +4635,6 @@
37494635 //case 702: // Event.LIST_DESELECT
37504636 group.deselectAll();
37514637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534638 if (tps != null)
37544639 {
37554640 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +4643,39 @@
37584643
37594644 //if (child.parent != null)
37604645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
37614647 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654648 }
37664649 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4650
+// else
4651
+// {
4652
+// objEditor.SetMaterial(group); // .GetMaterial());
4653
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4654
+// System.err.println("info : " + group.GetPath());
4655
+// }
37734656
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4657
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774658 CameraPane.flash = true;
37784659
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804661 // a camera
37814662 {
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;
4663
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4664
+ {
4665
+ CameraPane.camerachangeframe = 0; // don't refuse it
4666
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4667
+ }
4668
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4669
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864670 }
37874671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
37884679 refreshContents();
37894680 //return true;
37904681 }
....@@ -3793,6 +4684,33 @@
37934684
37944685 freezemodel = false;
37954686 }
4687
+
4688
+ void SetPinStates(boolean enabled)
4689
+ {
4690
+ editButton.setEnabled(enabled);
4691
+ uneditButton.setEnabled(enabled);
4692
+ }
4693
+
4694
+ void refreshContents(boolean cp)
4695
+ {
4696
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4698
+ {
4699
+ objEditor.ClearInfo(); // .GetMaterial());
4700
+
4701
+ for (int i=0; i < group.selection.Size(); i++)
4702
+ {
4703
+ Object3D child = (Object3D) group.selection.get(i);
4704
+
4705
+ objEditor.AddInfo(child, this, true);
4706
+ System.err.println("info : " + child.GetPath());
4707
+ }
4708
+
4709
+ objEditor.SetText(); // jan 2014
4710
+ }
4711
+
4712
+ super.refreshContents(cp);
4713
+ }
37964714
37974715 void linkSomething(Object3D thing)
37984716 {
....@@ -3864,16 +4782,19 @@
38644782 {
38654783 if (group.selection.isEmpty())
38664784 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
38684787 Composite tGroup = null;
38694788 if (group.selection.size() > 0) // 1)
38704789 {
38714790 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
38734792 }
38744793
38754794 if (cut)
38764795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
38774798 //int indices[] = jList.getSelectedIndices();
38784799 //for (int i = indices.length - 1; i >= 0; i--)
38794800 //jList.remove(indices[i]);
....@@ -3909,16 +4830,16 @@
39094830 //System.out.println("cut " + child);
39104831 //System.out.println("parent = " + child.parent);
39114832 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
39134834 tGroup.add/*Child*/(tmp);
39144835 else
3915
- GraphreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
39164837 }
39174838 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
39194840 tGroup.add/*Child*/(child);
39204841 else
3921
- GraphreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
39224843 }
39234844
39244845 //ResetModel();
....@@ -3950,21 +4871,23 @@
39504871 //System.out.println("cut " + elem);
39514872 //System.out.println("parent = " + elem.parent);
39524873 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
39544875 tGroup.add/*Child*/(tmp);
39554876 else
3956
- GraphreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
39574878 }
39584879 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
39604881 tGroup.add/*Child*/(child);
39614882 else
3962
- GraphreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
39634884 }
39644885
39654886 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
39684891 if (cut)
39694892 {
39704893 ResetModel();
....@@ -3974,11 +4897,11 @@
39744897
39754898 void paste(boolean expand)
39764899 {
3977
- // if (GraphreeD.clipboard == null)
4900
+ // if (GrafreeD.clipboard == null)
39784901 // return;
39794902 boolean first = true;
39804903
3981
- if (GraphreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
39824905 {
39834906 Composite temp;
39844907
....@@ -3989,7 +4912,7 @@
39894912 temp = (Composite)Applet3D.clipboard.deepCopy();
39904913 */
39914914 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4915
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934916 {
39944917 Object3D child = (Object3D)e.nextElement();
39954918
....@@ -4003,7 +4926,7 @@
40034926 else
40044927 elem = child.deepCopy(); // ?
40054928 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4929
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074930 // elem = elem.get(0);
40084931 makeSomething(elem, true); // ?? first);
40094932 //group.addChild(elem);
....@@ -4023,23 +4946,23 @@
40234946 //Object3D cb = Applet3D.clipboard;
40244947 //temp.addChild(cb);
40254948 //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());
4949
+ assert(Grafreed.clipboard.parent == null);
4950
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4951
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4952
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4953
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314954 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
40344957 }
40354958
40364959 ResetModel();
40374960 refreshContents();
40384961 }
40394962
4040
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
40414964 {
4042
-// if (GraphreeD.clipboard == null)
4965
+// if (GrafreeD.clipboard == null)
40434966 // return;
40444967
40454968 if (group.selection.size() != 1)
....@@ -4066,15 +4989,22 @@
40664989 if (copyit)
40674990 {
40684991 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
40705000 }
40715001 else
40725002 {
40735003 boolean first = true;
40745004
4075
- if (GraphreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
40765006 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
40785008 Object3D copy;
40795009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805010 {
....@@ -4084,7 +5014,7 @@
40845014 }
40855015 } else
40865016 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
40885018 }
40895019 }
40905020 }
....@@ -4276,6 +5206,26 @@
42765206 makeSomething(csg);
42775207 }
42785208
5209
+ void Ungroup(Object3D g)
5210
+ {
5211
+ if (g instanceof HiddenObject)
5212
+ {
5213
+ HiddenObject h = (HiddenObject) g;
5214
+
5215
+ for (int i=0; i<h.ActualSize(); i++)
5216
+ {
5217
+ objEditor.makeSomething(h.get(i), false);
5218
+ }
5219
+ }
5220
+ else
5221
+ {
5222
+ for (int i=0; i<g.Size(); i++)
5223
+ {
5224
+ objEditor.makeSomething(g.get(i), false);
5225
+ }
5226
+ }
5227
+ }
5228
+
42795229 void ungroup()
42805230 {
42815231 /*
....@@ -4469,21 +5419,6 @@
44695419 }
44705420 */
44715421
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
-
44875422 /*
44885423 public void Callback(Object obj)
44895424 {
....@@ -4507,26 +5442,9 @@
45075442 }
45085443 */
45095444
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
-
45275445 String GetFile(String dialogName)
45285446 {
4529
- if (GraphreeD.standAlone)
5447
+ if (Grafreed.standAlone)
45305448 {
45315449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325450 browser.show();
....@@ -4590,10 +5508,36 @@
45905508 cButton flashSelectionButton;
45915509 cButton editButton;
45925510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
45935512 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955513 cButton unselectButton;
45965514
5515
+ cButton restoreCameraButton;
5516
+
5517
+ cButton minButton;
5518
+ cButton maxButton;
5519
+ cButton fullButton;
5520
+ cButton saveButton;
5521
+ cButton oneStepButton;
5522
+
5523
+ cButton groupButton;
5524
+ cButton ungroupButton;
5525
+ cButton compositeButton;
5526
+ cButton switchButton;
5527
+ cButton loopButton;
5528
+ cButton textureButton;
5529
+
5530
+ cButton gridButton;
5531
+ cButton boxButton;
5532
+ cButton sphereButton;
5533
+ cButton coneButton;
5534
+ cButton torusButton;
5535
+ cButton superButton;
5536
+ cButton kleinButton;
5537
+ cButton particlesButton;
5538
+ cButton overlayButton;
5539
+ cButton lightButton;
5540
+
45975541 cButton screenfitButton;
45985542 cButton screenfitpointButton;
45995543 cButton snapobjectButton;
....@@ -4605,14 +5549,6 @@
46055549
46065550 cButton setsupportButton;
46075551
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
-
46165552 //
46175553 //Composite
46185554 Object3D // to do !!
....@@ -4622,9 +5558,11 @@
46225558 //JTree jTree;
46235559 private MenuItem lookAtItem;
46245560 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
46265562 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
46285566 private MenuItem cloneItem;
46295567 private MenuItem cloneSupportItem;
46305568 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5573,9 @@
46355573 private MenuItem resetsupportItem;
46365574 private MenuItem resetreferencesItem;
46375575 private MenuItem linkverticesItem;
5576
+ private MenuItem relinkverticesItem;
46385577 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
46405579 private MenuItem stepAllItem;
46415580 private MenuItem revertMeshItem;
46425581 private MenuItem poseMeshItem;
....@@ -4647,14 +5586,17 @@
46475586 private MenuItem mergeGeometriesItem;
46485587 private MenuItem copyItem;
46495588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
46505590 private MenuItem pasteLinkItem;
46515591 private MenuItem pasteCloneItem;
46525592 private MenuItem pasteExpandItem;
46535593 private MenuItem clearItem;
46545594 private MenuItem clearAllItem;
46555595 private MenuItem genUVItem;
5596
+ private MenuItem genNormalsMESHItem;
46565597 private MenuItem genNormalsCADItem;
46575598 private MenuItem genNormalsORGANItem;
5599
+ private MenuItem genNormalsMINEItem;
46585600 private MenuItem stripifyItem;
46595601 private MenuItem unstripifyItem;
46605602 private MenuItem trimItem;
....@@ -4683,6 +5625,10 @@
46835625 private MenuItem showleavesItem;
46845626 private MenuItem markleavesItem;
46855627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
46865632
46875633 private MenuItem flipVItem;
46885634 private MenuItem unflipVItem;
....@@ -4694,14 +5640,17 @@
46945640 private MenuItem panoTexturesItem;
46955641
46965642 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
46985644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
5647
+ private MenuItem hideItem;
46995648 private MenuItem grabItem;
47005649 private MenuItem backItem;
47015650 private MenuItem frontItem;
47025651 private MenuItem cameraItem;
47035652 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
47055654 private MenuItem physicsItem;
47065655 private MenuItem frameselectorItem;
47075656 private MenuItem scriptNodeItem;
....@@ -4716,6 +5665,7 @@
47165665
47175666 private MenuItem resetParentItem;
47185667 private MenuItem repairParentItem;
5668
+ private MenuItem repairShadowItem;
47195669 private MenuItem sortbysizeItem;
47205670 private MenuItem sortbynameItem;
47215671
....@@ -4728,16 +5678,19 @@
47285678 private MenuItem particleItem;
47295679 private MenuItem ragdollItem;
47305680 private MenuItem ragdoll2Item;
5681
+ private MenuItem heightFieldItem;
5682
+ private MenuItem textureFieldItem;
47315683 private MenuItem gridItem;
47325684 private MenuItem rectoidItem;
47335685 private MenuItem ellipsoidItem;
47345686 private MenuItem coneItem;
47355687 private MenuItem torusItem;
47365688 private MenuItem superItem;
5689
+ private MenuItem kleinItem;
47375690 private MenuItem blobItem;
47385691 private MenuItem latheItem;
47395692 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
47415694 private MenuItem meshItem;
47425695 // private MenuItem meshGroupItem;
47435696 private MenuItem springItem;
....@@ -4746,6 +5699,7 @@
47465699 private MenuItem csgItem;
47475700 private MenuItem templateItem;
47485701 private MenuItem textureItem;
5702
+ private MenuItem billboardItem;
47495703 private MenuItem shadowXItem;
47505704 private MenuItem shadowYItem;
47515705 private MenuItem shadowZItem;
....@@ -4758,11 +5712,6 @@
47585712 private MenuItem doubleItem;
47595713 private MenuItem tripleItem;
47605714
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665715 private MenuItem computeAOItem;
47675716 private MenuItem recompileItem;
47685717 private MenuItem editScriptItem;
....@@ -4772,4 +5721,8 @@
47725721 private MenuItem analyzeItem;
47735722 private MenuItem dumpItem;
47745723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
47755728 }