Normand Briere
2019-06-27 f78dd18c66d607b693c0bf5937fc59181bf5a26b
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,214 @@
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 = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Pin selection controls");
763
+ editButton.addActionListener(this);
764
+
765
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Remove selection controls");
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("Show all controle");
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
+ SetPinStates(false);
788
+// oe.treePanel.add(commandsPanel);
789
+// oe.treePanel.Return();
790
+
553791 // oe.aConstraints.gridx += 1;
554792 // oe.aConstraints.weighty = 0;
555793 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +799,22 @@
561799 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562800 // gcButton.addActionListener(this);
563801
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;
802
+ cGridBag jSPPanel = new cGridBag();
803
+
804
+ JScrollPane jSP;
575805 //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);
806
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
577807 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;
597808
809
+ oe.treePanel.add(jSPPanel);
810
+ oe.treePanel.Return();
811
+
812
+ oe.treePanel.add(copyOptionsPanel);
813
+ oe.treePanel.Return();
814
+
815
+// mainPanel.setDividerLocation(0.5); //1.0);
816
+// mainPanel.setResizeWeight(0.5);
817
+
598818 //jList.addListSelectionListener(this);
599819 oe.jTree.addTreeSelectionListener(this);
600820 //jTree.setRootVisible(false);
....@@ -616,20 +836,153 @@
616836 radio.layout = sevenButton;
617837 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618838 }
839
+
840
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
841
+ {
842
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
843
+ colorCB.setToolTipText("Copy color when dropped");
844
+ colorCB.addItemListener(this);
845
+
846
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
847
+ materialCB.setToolTipText("Copy material when dropped");
848
+ materialCB.addItemListener(this);
849
+
850
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
851
+ textureCB.setToolTipText("Copy texture when dropped");
852
+ textureCB.addItemListener(this);
853
+
854
+ panel.Return();
855
+
856
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
857
+ boxCB.setToolTipText("Display bounding boxes");
858
+ boxCB.addItemListener(this);
859
+
860
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
861
+ zoomBoxCB.setToolTipText("Display only for wheel");
862
+ zoomBoxCB.addItemListener(this);
863
+
864
+ if (true) // Globals.ADVANCED)
865
+ {
866
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
867
+ supportCB.setToolTipText("Enable rigging");
868
+ supportCB.addItemListener(this);
869
+
870
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
871
+ // localCB.addItemListener(this);
872
+
873
+ panel.Return();
874
+
875
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
876
+ crowdCB.setToolTipText("Used for crowds");
877
+ crowdCB.addItemListener(this);
878
+
879
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
880
+ smoothCB.setToolTipText("Snapping delay");
881
+ smoothCB.addItemListener(this);
882
+
883
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
884
+ slowCB.setToolTipText("Smooth interpolation");
885
+ slowCB.addItemListener(this);
886
+
887
+// constraints.gridy += 1;
888
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
889
+// speakerMocapCB.addItemListener(this);
890
+
891
+ panel.Return();
892
+
893
+ if (false)
894
+ {
895
+ // handled in scripts
896
+ //constraints.gridy += 1;
897
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
898
+ speakerCameraCB.addItemListener(this);
899
+
900
+ //constraints.gridy += 1;
901
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
902
+ speakerFocusCB.addItemListener(this);
903
+
904
+ //constraints.gridy += 1;
905
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
906
+ smoothfocusCB.addItemListener(this);
907
+ panel.Return();
908
+ }
909
+
910
+//constraints.gridx += 1;
911
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
912
+// debugCB.addItemListener(this);
913
+
914
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
915
+ trackCB.setToolTipText("Enable tracking target");
916
+ trackCB.addItemListener(this);
917
+
918
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
919
+ oeilCB.setToolTipText("Move camera when tracking");
920
+ oeilCB.addItemListener(this);
921
+
922
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
923
+ shadowCB.setToolTipText("When live compute shadows");
924
+ shadowCB.addItemListener(this);
925
+
926
+ panel.Return();
927
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
928
+ toggleTextureCB.setToolTipText("Load textures");
929
+ toggleTextureCB.addItemListener(this);
930
+
931
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
932
+ toggleSwitchCB.setToolTipText("Use switch");
933
+ toggleSwitchCB.addItemListener(this);
934
+
935
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
936
+ autosaveCB.setToolTipText("On structure change");
937
+ autosaveCB.addItemListener(this);
938
+
939
+ panel.Return();
940
+ if (Globals.ADVANCED)
941
+ {
942
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
943
+ lookAtCB.setToolTipText("Look-at target");
944
+ lookAtCB.addItemListener(this);
945
+ }
946
+
947
+ }
948
+
949
+ cGridBag fill = new cGridBag();
950
+ fill.preferredHeight = 200;
951
+ cGridBag fill2 = new cGridBag();
952
+ fill2.preferredHeight = 200;
953
+ cGridBag fill3 = new cGridBag();
954
+ fill3.preferredHeight = 200;
955
+
956
+ panel.add(fill);
957
+ panel.add(fill2);
958
+ panel.add(fill3);
959
+
960
+ }
619961
620962 void EditObject(Object3D obj)
621963 {
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();
964
+ cRadio radioButton = new cRadio(obj.name);
965
+
966
+ // Patch to avoid bug with transparency.
967
+ radioButton.hadMaterial = obj.material != null;
968
+ if (!radioButton.hadMaterial)
969
+ {
970
+ obj.material = new cMaterial();
971
+ }
972
+
973
+ radioButton.SetObject(obj);
974
+ radioButton.layout = sevenButton;
975
+ radioButton.SetCamera(cameraView.renderCamera, false);
976
+ radioButton.addActionListener(this);
977
+ radioPanel.add(radioButton);
978
+ buttonGroup.add(radioButton);
979
+ radioButton.doClick();
630980 }
981
+
631982 void SetupViews(ObjEditor oe)
632983 {
984
+ theFrame = this;
985
+
633986 oe.SetupViews();
634987
635988 System.out.println("SetupViews");
....@@ -638,22 +991,27 @@
638991 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
639992 }
640993
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;
994
+ cToggleButton liveCB;
995
+ cCheckBox supportCB;
996
+ cCheckBox localCB;
997
+ cCheckBox crowdCB;
998
+ cCheckBox smoothCB;
999
+ cToggleButton fastCB;
1000
+ cCheckBox slowCB;
1001
+ cCheckBox boxCB;
1002
+ cCheckBox zoomBoxCB;
1003
+ //cToggleButton trackCB;
1004
+ cCheckBox trackCB;
1005
+ cCheckBox smoothfocusCB;
6511006 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1007
+ cCheckBox speakerCameraCB;
1008
+ cCheckBox speakerFocusCB;
1009
+ cCheckBox debugCB;
1010
+
1011
+ cCheckBox oeilCB;
1012
+ cCheckBox shadowCB;
1013
+ cCheckBox autosaveCB;
1014
+ cCheckBox lookAtCB;
6571015
6581016 // static int COLOR = 1;
6591017 // static int MATERIAL = 2;
....@@ -661,9 +1019,9 @@
6611019
6621020 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631021
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1022
+ cCheckBox colorCB;
1023
+ cCheckBox materialCB;
1024
+ cCheckBox textureCB;
6671025
6681026 public void itemStateChanged(ItemEvent e)
6691027 {
....@@ -688,10 +1046,10 @@
6881046 dropAttributes |= Object3D.TEXTURE;
6891047 else
6901048 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1049
+ } else if(e.getSource() == liveCB)
6931050 {
6941051 cameraView.ToggleLive();
1052
+ refreshContents(false);
6951053 }
6961054 else if(e.getSource() == supportCB)
6971055 {
....@@ -727,6 +1085,10 @@
7271085 cameraView.repaint();
7281086 // refreshContents();
7291087 }
1088
+ else if(e.getSource() == zoomBoxCB)
1089
+ {
1090
+ cameraView.ToggleZoomBoxMode();
1091
+ }
7301092 else if(e.getSource() == smoothfocusCB)
7311093 {
7321094 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1114,14 @@
7521114 {
7531115 cameraView.ToggleOeil();
7541116 }
1117
+ else if(e.getSource() == shadowCB)
1118
+ {
1119
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1120
+ }
1121
+ else if(e.getSource() == autosaveCB)
1122
+ {
1123
+ Globals.SAVEONMAKE ^= true;
1124
+ }
7551125 else if(e.getSource() == lookAtCB)
7561126 {
7571127 cameraView.ToggleLookAt();
....@@ -768,7 +1138,8 @@
7681138
7691139 /**/
7701140 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1142
+ TreePath path = objEditor.jTree.getSelectionPath();
7721143 if ((path == null) || (path.getPathCount() <= 1)) {
7731144 // We can't move the root node or an empty selection
7741145 return;
....@@ -840,7 +1211,9 @@
8401211 // objEditor.DropFile((java.io.File[]) object, true);
8411212 // return;
8421213 // }
843
- if (string.charAt(0) == '/')
1214
+
1215
+ // File path for Mac and Windows
1216
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441217 {
8451218 // file(s)
8461219 String[] names = string.split("\n");
....@@ -867,7 +1240,7 @@
8671240
8681241 flashIt = false;
8691242 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1243
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711244 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721245
8731246 if (group.selection.size() == 1)
....@@ -883,23 +1256,33 @@
8831256
8841257 assert target == objEditor.jTree;
8851258 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1259
+ Object3D destinationLeaf;
8861260 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1261
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881262 } catch (Exception e) {
8891263 System.out.println("destinationPath : " + destinationPath);
8901264 return;
8911265 }
8921266
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1267
+ for (int i=group.selection.size(); --i>=0;)
8941268 {
1269
+ Object3D child = (Object3D)group.selection.elementAt(i);
1270
+
1271
+ // Cannot move into itself
1272
+ if (child == destinationLeaf)
1273
+ return;
1274
+ }
1275
+
1276
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1277
+// {
8951278 loadClipboard(true);
8961279 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1280
+ pasteInto(false, false);
1281
+// } else {
1282
+// loadClipboard(false);
1283
+// objEditor.jTree.setSelectionPath(destinationPath);
1284
+// pasteInto(false, false); // true); // ???
1285
+// }
9031286 }
9041287 public void dropActionChanged(DropTargetDragEvent dtde)
9051288 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1385,106 @@
10021385
10031386 void buildCreateMenu(Menu menu)
10041387 {
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);
1388
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1389
+ //heightFieldItem.addActionListener(this);
1390
+// gridItem = menu.add(new MenuItem("Grid"));
1391
+// gridItem.addActionListener(this);
1392
+// rectoidItem = menu.add(new MenuItem("Box"));
1393
+// rectoidItem.addActionListener(this);
1394
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1395
+// ellipsoidItem.addActionListener(this);
1396
+// coneItem = menu.add(new MenuItem("Cone"));
1397
+// coneItem.addActionListener(this);
1398
+// torusItem = menu.add(new MenuItem("Torus"));
1399
+// torusItem.addActionListener(this);
1400
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1401
+// superItem.addActionListener(this);
1402
+
1403
+ cameraItem = menu.add(new MenuItem("Camera"));
1404
+ cameraItem.addActionListener(this);
1405
+
1406
+ if (!Globals.ADVANCED)
1407
+ {
1408
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1409
+ kleinItem.addActionListener(this);
1410
+ }
1411
+
1412
+// particleItem = menu.add(new MenuItem("Particle system"));
1413
+// particleItem.addActionListener(this);
1414
+ if (Globals.ADVANCED)
1415
+ {
10191416 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201417 ragdollItem.addActionListener(this);
10211418 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221419 ragdoll2Item.addActionListener(this);
1420
+ }
10231421 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1422
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251423 meshItem.addActionListener(this);
10261424 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271425 // meshGroupItem.addActionListener(this);
1426
+ if (Globals.ADVANCED)
1427
+ {
10281428 springItem = menu.add(new MenuItem("Spring"));
10291429 springItem.addActionListener(this);
10301430 flagItem = menu.add(new MenuItem("Flag"));
10311431 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);
10361432 blobItem = menu.add(new MenuItem("Blob"));
10371433 blobItem.addActionListener(this);
10381434 latheItem = menu.add(new MenuItem("Lathe"));
10391435 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1436
+ }
1437
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1438
+ bezierItem.addActionListener(this);
1439
+// overlayItem = menu.add(new MenuItem("Overlay"));
1440
+// overlayItem.addActionListener(this);
1441
+// lightItem = menu.add(new MenuItem("Light"));
1442
+// lightItem.addActionListener(this);
10421443 menu.add("-");
10431444 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441445 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1446
+// loopItem = menu.add(new MenuItem("Loop"));
1447
+// loopItem.addActionListener(this);
10471448 doubleItem = menu.add(new MenuItem("Fork"));
10481449 doubleItem.addActionListener(this);
1450
+ if (Globals.ADVANCED)
1451
+ {
10491452 tripleItem = menu.add(new MenuItem("Trident"));
10501453 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);
1454
+ }
10601455 }
10611456
10621457 void buildToolsMenu(Menu menu)
10631458 {
10641459 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651460 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1461
+ animationItem.setState(Globals.ANIMATION);
10671462
10681463 menu.add("-");
10691464 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701465 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1466
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1467
+ textureFieldItem.addActionListener(this);
1468
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721469 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751470 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761471 reduceMorphItem.addActionListener(this);
10771472 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781473 reduce34MorphItem.addActionListener(this);
1079
-
1474
+ menu.add("-");
10801475 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811476 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831477
1478
+ if (Globals.ADVANCED)
1479
+ {
1480
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1481
+ mirrorItem.addActionListener(this);
1482
+ menu.add("-");
10841483 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851484 memoryItem.addActionListener(this);
10861485 menu.add(analyzeItem = new MenuItem("Analyze"));
10871486 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1487
+ menu.add(dumpItem = new MenuItem("Print"));
10891488 dumpItem.addActionListener(this);
10901489 // menu.add(pathItem = new MenuItem("From-to path"));
10911490 // pathItem.addActionListener(this);
....@@ -1094,6 +1493,8 @@
10941493 resetParentItem.addActionListener(this);
10951494 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961495 repairParentItem.addActionListener(this);
1496
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1497
+ repairShadowItem.addActionListener(this);
10971498 menu.add(invariantsItem = new MenuItem("Invariants"));
10981499 invariantsItem.addActionListener(this);
10991500 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1502,7 @@
11011502 menu.add("-");
11021503 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031504 editScriptItem.addActionListener(this);
1505
+ }
11041506 }
11051507
11061508 void ScreenFit()
....@@ -1223,9 +1625,24 @@
12231625 shadow.material = new cMaterial(obj.material);
12241626 shadow.material.diffuse = 0.0001f;
12251627 shadow.material.specular = 0.0001f;
1628
+ //shadow.projectedVertices[1].x = 300;
12261629
12271630 makeSomething(shadow);
12281631 }
1632
+
1633
+ private void ClearUnpinned()
1634
+ {
1635
+ //for (Object3D obj : listUI)
1636
+ for (int i=listUI.size(); --i>=0;)
1637
+ {
1638
+ Object3D obj = listUI.elementAt(i);
1639
+ if (!obj.pinned)
1640
+ {
1641
+ obj.CloseUI();
1642
+ listUI.remove(i);
1643
+ }
1644
+ }
1645
+ }
12291646
12301647 /**
12311648 * applyExample
....@@ -1429,9 +1846,9 @@
14291846
14301847 void Overwrite(int mask)
14311848 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1849
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331850 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1851
+ Object3D content = Grafreed.clipboard.get(0);
14351852
14361853 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371854 content = ((cGroup)content).get(0);
....@@ -1454,6 +1871,7 @@
14541871 //
14551872 public void actionPerformed(ActionEvent event) // , Object arg)
14561873 {
1874
+ Object source = event.getSource();
14571875 /*
14581876 if (event.getSource() == nameField)
14591877 {
....@@ -1465,11 +1883,11 @@
14651883 }
14661884 else
14671885 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1886
+ if (source == lookAtItem || source == lookFromItem)
14691887 {
14701888 ScreenFit();
14711889 } else
1472
- if (event.getSource() == switchItem)
1890
+ if (source == switchViewItem)
14731891 {
14741892 cVector v1 = new cVector();
14751893 cVector v2 = new cVector();
....@@ -1478,11 +1896,11 @@
14781896 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791897 objEditor.cameraView.repaint();
14801898 } else
1481
- if (event.getSource() == rectoidItem)
1899
+ if (source == rectoidItem || source == boxButton)
14821900 {
14831901 makeSomething(new Box());
14841902 } else
1485
- if (event.getSource() == particleItem)
1903
+ if (source == particleItem || source == particlesButton)
14861904 {
14871905 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881906 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1921,9 @@
15031921 applyExample(particleGeom, "SMOKE");
15041922 makeSomething(particleGeom);
15051923 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1924
+ if (source == ragdollItem || source == ragdoll2Item)
15071925 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1926
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091927
15101928 ragdoll.toParent = LA.newMatrix();
15111929 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1939,71 @@
15211939 makeSomething(ragdoll);
15221940 //makeSomething(new VehicleDemo());
15231941 } else
1524
- if (event.getSource() == gridItem)
1942
+ /*
1943
+ */
1944
+ if (source == heightFieldItem)
1945
+ {
1946
+ Object3D obj = new Object3D();
1947
+
1948
+ obj.CreateMaterial();
1949
+ obj.bRep = new BoundaryRep();
1950
+
1951
+ obj.bRep.CreateMesh(new iHeightField()
1952
+ {
1953
+ public double f(double x, double y)
1954
+ {
1955
+ // The Mandelbrot set is represented by coloring
1956
+ // each point (x,y) according to the number of
1957
+ // iterations it takes before the while loop in
1958
+ // this method ends. For points that are actually
1959
+ // in the Mandelbrot set, or very close to it, the
1960
+ // count will reach the maximum value, 80. These
1961
+ // points will be colored purple. All other colors
1962
+ // represent points that are definitely NOT in the set.
1963
+ x -= 600;
1964
+ y -= 500;
1965
+ x /= 200;
1966
+ y /= 200;
1967
+ int count = 0;
1968
+ double zx = x;
1969
+ double zy = y;
1970
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1971
+ double new_zx = zx*zx - zy*zy + x;
1972
+ zy = 2*zx*zy + y;
1973
+ zx = new_zx;
1974
+ count++;
1975
+ }
1976
+ return count; // Math.sqrt(count);
1977
+ }
1978
+ }, 1000,1000);
1979
+
1980
+ makeSomething(obj);
1981
+ } else
1982
+ if (source == gridItem || source == gridButton)
15251983 {
15261984 makeSomething(new Grid());
15271985 } else
1528
- if (event.getSource() == ellipsoidItem)
1986
+ if (source == ellipsoidItem || source == sphereButton)
15291987 {
15301988 makeSomething(new Sphere());
15311989 } else
1532
- if (event.getSource() == coneItem)
1990
+ if (source == coneItem || source == coneButton)
15331991 {
15341992 makeSomething(new Cone());
15351993 } else
1536
- if (event.getSource() == torusItem)
1994
+ if (source == torusItem || source == torusButton)
15371995 {
15381996 makeSomething(new Torus());
15391997 } else
1540
- if (event.getSource() == superItem)
1998
+ if (source == superItem || source == superButton)
15411999 {
15422000 makeSomething(new Superellipsoid());
15432001 } else
1544
- if (event.getSource() == blobItem)
2002
+ if (source == kleinItem || source == kleinButton)
2003
+ {
2004
+ makeSomething(new Klein());
2005
+ } else
2006
+ if (source == blobItem)
15452007 {
15462008 Blob blob = new Blob();
15472009 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +2011,15 @@
15492011 //blob.retile();
15502012 makeSomething(blob);
15512013 } else
1552
- if (event.getSource() == latheItem)
2014
+ if (source == latheItem)
15532015 {
15542016 makeSomething(new Lathe());
15552017 } else
1556
- if (event.getSource() == bezierItem)
2018
+ if (source == bezierItem)
15572019 {
15582020 makeSomething(new BezierSurface());
15592021 } else
1560
- if (event.getSource() == checkerItem)
2022
+ if (source == overlayItem || source == overlayButton)
15612023 {
15622024 /*
15632025 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2032,9 @@
15702032 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712033 LA.matInvert(obj.toParent, obj.fromParent);
15722034 */
1573
- makeSomething(new CheckerIG());
2035
+ makeSomething(new Checker());
15742036 } else
1575
- if (event.getSource() == meshItem)
2037
+ if (source == meshItem)
15762038 {
15772039 Object3D itemtomake = new Object3D();
15782040 Object3D child;
....@@ -1593,35 +2055,35 @@
15932055 makeSomething(child);
15942056 }
15952057 } else
1596
- if (event.getSource() == springItem)
2058
+ if (source == springItem)
15972059 {
15982060 cSpring s = new cSpring();
15992061 s.setup();
16002062 makeSomething(s);
16012063 } else
1602
- if (event.getSource() == flagItem)
2064
+ if (source == flagItem)
16032065 {
16042066 cSpring s = new cFlag();
16052067 s.setup();
16062068 makeSomething(s);
16072069 } else
1608
- if (event.getSource() == lightItem)
2070
+ if (source == lightItem || source == lightButton)
16092071 {
16102072 makeSomething(new Light());
16112073 } else
1612
- if (event.getSource() == csgItem)
2074
+ if (source == csgItem)
16132075 {
16142076 group(new CSG());
16152077 } else
1616
- if (event.getSource() == templateItem)
2078
+ if (source == templateItem)
16172079 {
16182080 group(new cTemplate());
16192081 } else
1620
- if (event.getSource() == attributeItem)
2082
+ if (source == attributeItem)
16212083 {
16222084 makeSomething(new Attribute());
16232085 } else
1624
- if (event.getSource() == pointflowItem)
2086
+ if (source == pointflowItem)
16252087 {
16262088 makeSomething(new PointFlow());
16272089 } else
....@@ -1633,7 +2095,7 @@
16332095 } else
16342096 */
16352097
1636
- if (event.getSource() == superLoopItem)
2098
+ if (source == superLoopItem)
16372099 {
16382100 Composite g = new cGroup();
16392101 for (int i=0; i<15; i++)
....@@ -1655,7 +2117,7 @@
16552117
16562118 group(g);
16572119 } else
1658
- if (event.getSource() == loopItem)
2120
+ if (source == loopItem || source == loopButton)
16592121 {
16602122 Composite csg = new GroupLeaf();
16612123 csg.count = 5;
....@@ -1664,7 +2126,7 @@
16642126 csg.addChild(child);
16652127 child.addChild(csg);
16662128 } else
1667
- if (event.getSource() == doubleItem)
2129
+ if (source == doubleItem)
16682130 {
16692131 Composite csg = new GroupLeaf();
16702132 csg.count = 5;
....@@ -1676,7 +2138,7 @@
16762138 csg.addChild(child);
16772139 child.addChild(csg);
16782140 } else
1679
- if (event.getSource() == tripleItem)
2141
+ if (source == tripleItem)
16802142 {
16812143 Composite csg = new GroupLeaf();
16822144 csg.count = 4;
....@@ -1691,71 +2153,83 @@
16912153 csg.addChild(child);
16922154 child.addChild(csg);
16932155 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2156
+ if (source == computeAOItem)
16962157 {
1697
- ImportGFD();
2158
+ Globals.drawMode = CameraPane.OCCLUSION;
2159
+ Globals.theRenderer.repaint();
16982160 } 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)
2161
+ if (source == recompileItem)
17172162 {
17182163 Recompile();
17192164 refreshContents();
17202165 } else
1721
- if (event.getSource() == editScriptItem)
2166
+ if (source == editScriptItem)
17222167 {
17232168 OpenDialog();
17242169 refreshContents();
17252170 } else
1726
- if (event.getSource() == invariantsItem)
2171
+ if (source == invariantsItem)
17272172 {
17282173 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2174
+ Grafreed.grafreeD.universe.invariants();
17302175 } else
1731
- if (event.getSource() == memoryItem)
2176
+ if (source == memoryItem)
17322177 {
17332178 //System.out.println("Invariants:");
17342179 PrintMemory();
17352180 } else
1736
- if (event.getSource() == pathItem)
2181
+ if (source == pathItem)
17372182 {
17382183 PrintPath();
17392184 } else
1740
- if (event.getSource() == analyzeItem)
2185
+ if (source == analyzeItem)
17412186 {
17422187 AnalyzeObject();
17432188 } else
1744
- if (event.getSource() == dumpItem)
2189
+ if (source == dumpItem)
17452190 {
17462191 DumpObject();
17472192 } else
1748
- if (event.getSource() == screenfitButton)
2193
+ if (source == minButton)
2194
+ {
2195
+ Minimize();
2196
+ } else
2197
+ if (source == maxButton)
2198
+ {
2199
+ Maximize();
2200
+ } else
2201
+ if (source == fullButton)
2202
+ {
2203
+ ToggleFullScreen();
2204
+ } else
2205
+ if (source == undoButton)
2206
+ {
2207
+ Undo();
2208
+ } else
2209
+ if (source == redoButton)
2210
+ {
2211
+ Redo();
2212
+ } else
2213
+ if (source == saveButton)
2214
+ {
2215
+ Save();
2216
+ } else
2217
+ if (source == oneStepButton)
2218
+ {
2219
+ Globals.ONESTEP = true;
2220
+ cameraView.repaint();
2221
+ } else
2222
+ if (source == screenfitButton)
17492223 {
17502224 //Reload(lastConverter, lastFilename, true);
17512225 ScreenFit();
17522226 } else
1753
- if (event.getSource() == screenfitpointButton)
2227
+ if (source == screenfitpointButton)
17542228 {
17552229 //Reload(lastConverter, lastFilename, true);
17562230 ScreenFitPoint();
17572231 } else
1758
- if (event.getSource() == snapobjectButton)
2232
+ if (source == snapobjectButton)
17592233 {
17602234 //Reload(lastConverter, lastFilename, true);
17612235 SnapObject();
....@@ -1766,13 +2240,13 @@
17662240 // Recompile();
17672241 // refreshContents();
17682242 // } else
1769
- if (event.getSource() == gcButton)
2243
+ if (source == gcButton)
17702244 {
17712245 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722246 System.gc();
17732247 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742248 } else
1775
- if (event.getSource() == editLeafItem)
2249
+ if (source == editLeafItem)
17762250 {
17772251 Object3D obj;
17782252 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2260,78 @@
17862260 }
17872261 refreshContents(true);
17882262 } else
1789
- if (event.getSource() == openWindowItem)
2263
+ if (source == openWindowItem)
17902264 {
17912265 EditSelection(true);
17922266 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2267
+ if (source == cutItem || source == clearButton)
17942268 {
17952269 loadClipboard(true);
17962270 } else
1797
- if (event.getSource() == duplicateItem)
2271
+ if (source == undoItem)
17982272 {
1799
- Object3D keep = GraphreeD.clipboard;
2273
+ Undo();
2274
+ } else
2275
+ if (source == redoItem)
2276
+ {
2277
+ Redo();
2278
+ } else
2279
+ if (source == duplicateItem)
2280
+ {
2281
+ Object3D keep = Grafreed.clipboard;
18002282 loadClipboard(false);
18012283 paste(false);
1802
- GraphreeD.clipboard = keep;
2284
+ Grafreed.clipboard = keep;
18032285 } else
1804
- if (event.getSource() == cloneItem)
2286
+ if (source == cloneItem)
18052287 {
18062288 CloneSelection(false);
18072289 } else
1808
- if (event.getSource() == cloneSupportItem)
2290
+ if (source == cloneSupportItem)
18092291 {
18102292 CloneSelection(true);
18112293 } else
1812
- if (event.getSource() == copyItem)
2294
+ if (source == copyItem)
18132295 {
18142296 loadClipboard(false);
18152297 } else
1816
- if (event.getSource() == pasteItem)
2298
+ if (source == pasteItem)
18172299 {
18182300 paste(false);
18192301 } else
1820
- if (event.getSource() == pasteLinkItem)
2302
+ if (source == pasteIntoItem)
18212303 {
1822
- pasteInto(false);
2304
+ pasteInto(true, false);
18232305 } else
1824
- if (event.getSource() == pasteCloneItem)
2306
+ if (source == pasteLinkItem)
18252307 {
1826
- pasteInto(true);
2308
+ pasteInto(false, false);
18272309 } else
1828
- if (event.getSource() == pasteExpandItem)
2310
+ if (source == pasteCloneItem)
2311
+ {
2312
+ pasteInto(true, true);
2313
+ } else
2314
+ if (source == pasteExpandItem)
18292315 {
18302316 paste(true);
18312317 } else
1832
- if (event.getSource() == synchronizeItem)
2318
+ if (source == synchronizeItem)
18332319 {
18342320 Overwrite(Object3D.TRANSFORM);
18352321 } else
1836
- if (event.getSource() == overwriteNameItem)
2322
+ if (source == overwriteNameItem)
18372323 {
18382324 Overwrite(Object3D.NAME);
18392325 } else
1840
- if (event.getSource() == overwriteUVItem)
2326
+ if (source == overwriteUVItem)
18412327 {
18422328 Overwrite(Object3D.UV);
18432329 } else
1844
- if (event.getSource() == overwriteMatItem)
2330
+ if (source == overwriteMatItem)
18452331 {
2332
+ /* july 2015
18462333 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2334
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482335 else
18492336 {
18502337 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2343,16 @@
18562343 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572344 }
18582345 }
2346
+ */
2347
+
2348
+ Overwrite(dropAttributes);
18592349 }
1860
- if (event.getSource() == overwriteGeoItem)
2350
+ if (source == overwriteGeoItem)
18612351 {
18622352 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2353
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642354 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2355
+// Object3D content = GrafreeD.clipboard.get(0);
18662356 //
18672357 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682358 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2364,7 @@
18742364 // refreshContents();
18752365 // }
18762366 } else
1877
- if (event.getSource() == generateMeshItem)
2367
+ if (source == generateMeshItem)
18782368 {
18792369 //if (group.selection.size() == 1)
18802370 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2375,7 @@
18852375 ResetModel();
18862376 refreshContents();
18872377 } else
1888
- if (event.getSource() == extractGeometriesItem)
2378
+ if (source == extractGeometriesItem)
18892379 {
18902380 boolean one = false;
18912381
....@@ -1912,7 +2402,7 @@
19122402 ResetModel();
19132403 refreshContents();
19142404 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2405
+ if (source == cloneGeometriesItem)
19162406 {
19172407 boolean one = false;
19182408
....@@ -1938,32 +2428,37 @@
19382428 ResetModel();
19392429 refreshContents();
19402430 } else
1941
- if (event.getSource() == shareGeometriesItem)
2431
+ if (source == shareGeometriesItem)
19422432 {
19432433 boolean one = false;
19442434
19452435 if (group.selection.size() == 1)
19462436 one = true;
19472437
2438
+ Object3D merge = null;
2439
+
19482440 Object3D content = new cGroup();
19492441
19502442 for (int i=0; i<group.selection.size(); i++)
19512443 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2444
+ merge = new Merge(group.selection.get(i));
19532445
19542446 if (one)
1955
- makeSomething(sel, false);
2447
+ makeSomething(merge, false);
19562448 else
1957
- content.addChild(sel);
2449
+ content.addChild(merge);
19582450 }
19592451
19602452 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2453
+ makeSomething(content, true);
2454
+ else
2455
+ {
2456
+ ResetModel();
2457
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2458
+ refreshContents();
2459
+ }
19652460 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2461
+ if (source == mergeGeometriesItem)
19672462 {
19682463 boolean one = false;
19692464
....@@ -1993,11 +2488,11 @@
19932488 ResetModel();
19942489 refreshContents();
19952490 } else
1996
- if (event.getSource() == linkverticesItem)
2491
+ if (source == linkverticesItem)
19972492 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2493
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992494 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2495
+// Object3D content = GrafreeD.clipboard.get(0);
20012496 //
20022497 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032498 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2501,48 @@
20062501 // group.selection.get(0).setMasterThis(content); // should be identity
20072502 // refreshContents();
20082503 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2504
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102505 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2506
+ Object3D content = Grafreed.clipboard.get(0);
20122507
20132508 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142509 content = ((cGroup)content).get(0);
20152510
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2511
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172512 for (int i=0; i<group.selection.size(); i++)
20182513 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2514
+ boolean random = CameraPane.SWITCH;
2515
+ CameraPane.SWITCH = false; // parse all random nodes
20212516 group.selection.get(i).linkVerticesThis(content);
20222517 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2518
+ CameraPane.SWITCH = random;
20242519 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2520
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262521 refreshContents();
20272522 }
20282523 } else
2029
- if (event.getSource() == resetsupportItem)
2524
+ if (source == resetsupportItem)
20302525 {
20312526 for (int i=0; i<group.selection.size(); i++)
20322527 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2528
+ boolean random = CameraPane.SWITCH;
2529
+ CameraPane.SWITCH = false; // parse all random nodes
20352530 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2531
+ CameraPane.SWITCH = random;
20372532 }
20382533
20392534 refreshContents();
20402535 } else
2041
- if (event.getSource() == resetreferencesItem)
2536
+ if (source == relinkverticesItem)
2537
+ {
2538
+ boolean random = CameraPane.SWITCH;
2539
+ CameraPane.SWITCH = false; // parse all random nodes
2540
+ group.selection.RelinkToSupport();
2541
+ CameraPane.SWITCH = random;
2542
+
2543
+ refreshContents();
2544
+ } else
2545
+ if (source == resetreferencesItem)
20422546 {
20432547 for (int i=0; i<group.selection.size(); i++)
20442548 {
....@@ -2047,11 +2551,11 @@
20472551
20482552 refreshContents();
20492553 } else
2050
- if (event.getSource() == setMasterItem)
2554
+ if (source == setMasterItem)
20512555 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2556
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532557 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
20552559
20562560 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572561 content = ((cGroup)content).get(0);
....@@ -2060,13 +2564,13 @@
20602564 refreshContents();
20612565 }
20622566 } else
2063
- if (event.getSource() == poseMeshItem)
2567
+ if (source == poseMeshItem)
20642568 {
20652569 if (group.selection.size() == 1)
20662570 {
2067
- if (GraphreeD.clipboard.size() == 1)
2571
+ if (Grafreed.clipboard.size() == 1)
20682572 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2573
+ Object3D content = Grafreed.clipboard.get(0);
20702574
20712575 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722576 content = ((cGroup)content).get(0);
....@@ -2079,19 +2583,19 @@
20792583 }
20802584
20812585 } else
2082
- if (event.getSource() == revertMeshItem)
2586
+ if (source == revertMeshItem)
20832587 {
20842588 RevertMeshes();
20852589 } else
2086
- if (event.getSource() == resetMeshItem)
2590
+ if (source == resetAllItem)
20872591 {
20882592 ResetAll();
20892593 } else
2090
- if (event.getSource() == stepAllItem)
2594
+ if (source == stepAllItem)
20912595 {
20922596 StepAll();
20932597 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2598
+ if (source == clearItem) // || event.getSource() == clearButton)
20952599 {
20962600 //int indices[] = jList.getSelectedIndices();
20972601 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2603,46 @@
20992603
21002604 ClearSelection(false);
21012605 } else
2102
- if (event.getSource() == clearAllItem)
2606
+ if (source == clearAllItem)
21032607 {
21042608 ClearSelection(true);
21052609 } else
2106
- if (event.getSource() == grabItem)
2610
+ if (source == grabItem || source == groupButton)
21072611 {
2108
- group(new cGroup(), true);
2612
+ group(new cGroup(), false); // true);
21092613 } else
2110
- if (event.getSource() == frontItem)
2614
+ if (source == hideItem)
2615
+ {
2616
+ group(new HiddenObject());
2617
+ } else
2618
+ if (source == frontItem)
21112619 {
21122620 front();
21132621 } else
2114
- if (event.getSource() == backItem)
2622
+ if (source == backItem)
21152623 {
21162624 back();
21172625 } else
2118
- if (event.getSource() == cameraItem)
2626
+ if (source == cameraItem)
21192627 {
21202628 makeSomething(new Camera());
21212629 } else
2122
- if (event.getSource() == compositeItem)
2630
+ if (source == compositeItem || source == compositeButton)
21232631 {
21242632 group(new Composite());
21252633 } else
2126
- if (event.getSource() == randomItem)
2634
+ if (source == switchItem || source == switchButton)
21272635 {
21282636 RandomNode random = new RandomNode();
21292637 group(random);
21302638 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2639
+ random.name = random.get(0).name + "Switch";
21322640 } else
2133
- if (event.getSource() == physicsItem)
2641
+ if (source == physicsItem)
21342642 {
21352643 group(new PhysicsNode());
21362644 } else
2137
- if (event.getSource() == frameselectorItem)
2645
+ if (source == frameselectorItem)
21382646 {
21392647 for (int i=0; i<group.selection.size(); i++)
21402648 {
....@@ -2146,7 +2654,7 @@
21462654 ResetModel();
21472655 refreshContents();
21482656 } else
2149
- if (event.getSource() == switchGeoItem)
2657
+ if (source == switchGeoItem)
21502658 {
21512659 for (int i=0; i<group.selection.size(); i++)
21522660 {
....@@ -2158,7 +2666,7 @@
21582666 ResetModel();
21592667 refreshContents();
21602668 } else
2161
- if (event.getSource() == switchTransfoItem)
2669
+ if (source == switchTransfoItem)
21622670 {
21632671 for (int i=0; i<group.selection.size(); i++)
21642672 {
....@@ -2170,7 +2678,7 @@
21702678 ResetModel();
21712679 refreshContents();
21722680 } else
2173
- if (event.getSource() == morphItem)
2681
+ if (source == morphItem)
21742682 {
21752683 for (int i=0; i<group.selection.size(); i++)
21762684 {
....@@ -2182,7 +2690,7 @@
21822690 ResetModel();
21832691 refreshContents();
21842692 } else
2185
- if (event.getSource() == scriptNodeItem)
2693
+ if (source == scriptNodeItem)
21862694 {
21872695 boolean atleastone = false;
21882696
....@@ -2221,191 +2729,239 @@
22212729 }
22222730 }
22232731 } else
2224
- if (event.getSource() == linkerItem)
2732
+ if (source == linkerItem)
22252733 {
22262734 group(new cLinker());
22272735 } else
2228
- if (event.getSource() == textureItem)
2736
+ if (source == textureItem || source == textureButton)
22292737 {
22302738 group(new TextureNode());
22312739 } else
2232
- if (event.getSource() == shadowXItem)
2740
+ if (source == billboardItem)
2741
+ {
2742
+ group(new BillboardNode());
2743
+ } else
2744
+ if (source == shadowXItem)
22332745 {
22342746 CastShadow(0);
22352747 } else
2236
- if (event.getSource() == shadowYItem)
2748
+ if (source == shadowYItem)
22372749 {
22382750 CastShadow(1);
22392751 } else
2240
- if (event.getSource() == shadowZItem)
2752
+ if (source == shadowZItem)
22412753 {
22422754 CastShadow(2);
22432755 } else
2244
- if (event.getSource() == ungroupItem)
2756
+ if (source == ungroupItem || source == ungroupButton)
22452757 {
2246
- ungroup();
2758
+ //ungroup();
2759
+ for (int i=0; i<group.selection.size(); i++)
2760
+ {
2761
+ Ungroup(group.selection.get(i));
2762
+ }
2763
+
2764
+ ClearSelection(false);
2765
+
2766
+ refreshContents();
22472767 } else
2248
- if (event.getSource() == genUVItem)
2768
+ if (source == genUVItem)
22492769 {
22502770 GenUV();
22512771 } else
2252
- if (event.getSource() == genNormalsCADItem)
2772
+ if (source == genNormalsCADItem)
22532773 {
22542774 GenNormals(true);
22552775 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2776
+ if (source == genNormalsMESHItem)
2777
+ {
2778
+ GenNormalsMESH();
2779
+ } else
2780
+ if (source == genNormalsORGANItem)
22572781 {
22582782 GenNormals(false);
22592783 } else
2260
- if (event.getSource() == stripifyItem)
2784
+ if (source == genNormalsMINEItem)
2785
+ {
2786
+ GenNormalsMINE();
2787
+ } else
2788
+ if (source == stripifyItem)
22612789 {
22622790 Stripify();
22632791 } else
2264
- if (event.getSource() == unstripifyItem)
2792
+ if (source == unstripifyItem)
22652793 {
22662794 Unstripify();
22672795 } else
2268
- if (event.getSource() == trimItem)
2796
+ if (source == trimItem)
22692797 {
22702798 Trim();
22712799 } else
2272
- if (event.getSource() == untrimItem)
2800
+ if (source == untrimItem)
22732801 {
22742802 Untrim();
22752803 } else
2276
- if (event.getSource() == clearColorsItem)
2804
+ if (source == clearColorsItem)
22772805 {
22782806 ClearColors();
22792807 } else
2280
- if (event.getSource() == clearMaterialsItem)
2808
+ if (source == clearMaterialsItem)
22812809 {
22822810 ClearMaterials();
22832811 } else
2284
- if (event.getSource() == liveleavesItem)
2812
+ if (source == liveleavesItem)
22852813 {
22862814 LiveLeaves(true);
22872815 } else
2288
- if (event.getSource() == unliveleavesItem)
2816
+ if (source == unliveleavesItem)
22892817 {
22902818 LiveLeaves(false);
22912819 } else
2292
- if (event.getSource() == supportleavesItem)
2820
+ if (source == supportleavesItem)
22932821 {
22942822 SupportLeaves(true);
22952823 } else
2296
- if (event.getSource() == unsupportleavesItem)
2824
+ if (source == unsupportleavesItem)
22972825 {
22982826 SupportLeaves(false);
22992827 } else
2300
- if (event.getSource() == hideleavesItem)
2828
+ if (source == hideleavesItem)
23012829 {
23022830 HideLeaves(true);
23032831 } else
2304
- if (event.getSource() == showleavesItem)
2832
+ if (source == showleavesItem)
23052833 {
23062834 HideLeaves(false);
23072835 } else
2308
- if (event.getSource() == markleavesItem)
2836
+ if (source == markleavesItem)
23092837 {
23102838 MarkLeaves(true);
23112839 } else
2312
- if (event.getSource() == unmarkleavesItem)
2840
+ if (source == unmarkleavesItem)
23132841 {
23142842 MarkLeaves(false);
23152843 } else
2316
- if (event.getSource() == flipVItem)
2844
+ if (source == rewindleavesItem)
2845
+ {
2846
+ RewindLeaves(true);
2847
+ } else
2848
+ if (source == unrewindleavesItem)
2849
+ {
2850
+ RewindLeaves(false);
2851
+ } else
2852
+ if (source == randomleavesItem)
2853
+ {
2854
+ RandomLeaves(true);
2855
+ } else
2856
+ if (source == unrandomleavesItem)
2857
+ {
2858
+ RandomLeaves(false);
2859
+ } else
2860
+ if (source == flipVItem)
23172861 {
23182862 FlipV(true);
23192863 } else
2320
- if (event.getSource() == unflipVItem)
2864
+ if (source == unflipVItem)
23212865 {
23222866 FlipV(false);
23232867 } else
2324
- if (event.getSource() == lowTexturesItem)
2868
+ if (source == lowTexturesItem)
23252869 {
23262870 SetTexRes(0);
23272871 } else
2328
- if (event.getSource() == normalTexturesItem)
2872
+ if (source == normalTexturesItem)
23292873 {
23302874 SetTexRes(1);
23312875 } else
2332
- if (event.getSource() == highTexturesItem)
2876
+ if (source == highTexturesItem)
23332877 {
23342878 SetTexRes(2);
23352879 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2880
+ if (source == veryhighTexturesItem)
23372881 {
23382882 SetTexRes(3);
23392883 } else
2340
- if (event.getSource() == maxTexturesItem)
2884
+ if (source == maxTexturesItem)
23412885 {
23422886 SetTexRes(4);
23432887 } else
2344
- if (event.getSource() == panoTexturesItem)
2888
+ if (source == panoTexturesItem)
23452889 {
23462890 SetTexRes(5);
23472891 } else
2348
- if (event.getSource() == reverseNormalsItem)
2892
+ if (source == reverseNormalsItem)
23492893 {
23502894 ReverseNormals();
23512895 } else
2352
- if (event.getSource() == parseverticesItem)
2896
+ if (source == parseverticesItem)
23532897 {
23542898 ParseVertices();
23552899 } else
2356
- if (event.getSource() == alignItem)
2900
+ if (source == textureFieldItem)
2901
+ {
2902
+ TextureVertices();
2903
+ } else
2904
+ if (source == alignItem)
23572905 {
23582906 Align();
23592907 } else
2360
- if (event.getSource() == mirrorItem)
2908
+ if (source == mirrorItem)
23612909 {
23622910 MirrorPoses();
23632911 } else
2364
- if (event.getSource() == reduceMorphItem)
2912
+ if (source == reduceMorphItem)
23652913 {
23662914 MeshReduction(false);
23672915 } else
2368
- if (event.getSource() == reduce34MorphItem)
2916
+ if (source == reduce34MorphItem)
23692917 {
23702918 MeshReduction(true);
23712919 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2920
+ if (source == reverseTrianglesItem)
23732921 {
23742922 ReverseTriangles();
23752923 } else
2376
- if (event.getSource() == reduceMeshItem)
2924
+ if (source == reduceMeshItem)
23772925 {
23782926 ReduceMesh(false);
23792927 } else
2380
- if (event.getSource() == reduce34MeshItem)
2928
+ if (source == reduce34MeshItem)
23812929 {
23822930 ReduceMesh(true);
23832931 } else
2384
- if (event.getSource() == increaseMeshItem)
2932
+ if (source == increaseMeshItem)
23852933 {
23862934 IncreaseMesh();
23872935 } else
2388
- if (event.getSource() == clipMeshItem)
2936
+ if (source == clipMeshItem)
23892937 {
23902938 ClipMesh();
23912939 } else
2392
- if (event.getSource() == smoothMeshItem)
2940
+ if (source == smoothMeshItem)
23932941 {
23942942 SmoothMesh();
23952943 } else
2396
- if (event.getSource() == transformgeometryItem)
2944
+ if (source == transformGeometryItem)
23972945 {
23982946 TransformGeometry();
23992947 } else
2400
- if (event.getSource() == resetTransformItem)
2948
+ if (source == transformChildrenItem)
2949
+ {
2950
+ TransformChildren();
2951
+ } else
2952
+ if (source == resetTransformItem)
24012953 {
24022954 ResetTransform();
24032955 } else
2404
- if (event.getSource() == resetCentroidItem)
2956
+ if (source == resetCentroidItem)
24052957 {
2406
- ResetCentroid();
2958
+ ResetCentroid(true);
24072959 } else
2408
- if (event.getSource() == resetParentItem)
2960
+ if (source == resetCentroidXZItem)
2961
+ {
2962
+ ResetCentroid(false);
2963
+ } else
2964
+ if (source == resetParentItem)
24092965 {
24102966 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112967 {
....@@ -2415,7 +2971,7 @@
24152971
24162972 refreshContents();
24172973 } else
2418
- if (event.getSource() == repairParentItem)
2974
+ if (source == repairParentItem)
24192975 {
24202976 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212977 {
....@@ -2429,7 +2985,21 @@
24292985
24302986 refreshContents();
24312987 } else
2432
- if (event.getSource() == sortbysizeItem)
2988
+ if (source == repairShadowItem)
2989
+ {
2990
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2991
+ {
2992
+ Object3D obj = (Object3D)e.nextElement();
2993
+ obj.RepairShadow();
2994
+// for (int i=0; i<obj.size(); i++)
2995
+// {
2996
+// obj.get(i).parent = obj;
2997
+// }
2998
+ }
2999
+
3000
+ refreshContents();
3001
+ } else
3002
+ if (source == sortbysizeItem)
24333003 {
24343004 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24353005 {
....@@ -2441,7 +3011,7 @@
24413011 ResetModel();
24423012 refreshContents();
24433013 } else
2444
- if (event.getSource() == sortbynameItem)
3014
+ if (source == sortbynameItem)
24453015 {
24463016 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473017 {
....@@ -2453,7 +3023,7 @@
24533023 ResetModel();
24543024 refreshContents();
24553025 } else
2456
- if (event.getSource() == attachPigmentItem)
3026
+ if (source == attachPigmentItem)
24573027 {
24583028 String texture = GetFile("Attach pigment");
24593029 Object3D obj;
....@@ -2465,7 +3035,7 @@
24653035
24663036 refreshContents();
24673037 } else
2468
- if (event.getSource() == detachPigmentItem)
3038
+ if (source == detachPigmentItem)
24693039 {
24703040 Object3D obj;
24713041 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3046,7 @@
24763046
24773047 refreshContents();
24783048 } else
2479
- if (event.getSource() == attachBumpItem)
3049
+ if (source == attachBumpItem)
24803050 {
24813051 String texture = GetFile("Attach bump");
24823052 Object3D obj;
....@@ -2488,7 +3058,7 @@
24883058
24893059 refreshContents();
24903060 } else
2491
- if (event.getSource() == detachBumpItem)
3061
+ if (source == detachBumpItem)
24923062 {
24933063 Object3D obj;
24943064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +3069,7 @@
24993069
25003070 refreshContents();
25013071 } else
2502
- if (event.getSource() == pigmentBumpItem)
3072
+ if (source == pigmentBumpItem)
25033073 {
25043074 Object3D obj;
25053075 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3080,237 @@
25103080
25113081 refreshContents();
25123082 } else
2513
- if (event.getSource() == flashSelectionButton)
3083
+ if (source == flashSelectionButton)
25143084 {
25153085 CameraPane.flash = true;
25163086 refreshContents();
25173087 } else
2518
- if (event.getSource() == oneButton)
3088
+ if (source == oneButton)
25193089 {
25203090 } else
2521
- if (event.getSource() == twoButton)
3091
+ if (source == twoButton)
25223092 {
25233093 radio.layout = twoButton;
3094
+
3095
+ if (CameraPane.FULLSCREEN)
3096
+ fullscreenLayout = radio.layout;
3097
+
25243098 // bug
25253099 //gridPanel.setDividerLocation(1.0);
25263100 //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();
3101
+// bigThree.remove(scenePanel);
3102
+// bigThree.remove(centralPanel);
3103
+// bigThree.remove(XYZPanel);
3104
+// aWindowConstraints.gridx = 0;
3105
+// aWindowConstraints.gridy = 0;
3106
+// aWindowConstraints.gridwidth = 1;
3107
+// // aConstraints.gridheight = 3;
3108
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3109
+// aWindowConstraints.weightx = 0;
3110
+// aWindowConstraints.weighty = 1;
3111
+// //bigThree.add(jtp, aWindowConstraints);
3112
+// aWindowConstraints.weightx = 1;
3113
+// aWindowConstraints.gridwidth = 3;
3114
+// // aConstraints.gridheight = 3;
3115
+// aWindowConstraints.gridx = 1;
3116
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3117
+// bigThree.add(centralPanel, aWindowConstraints);
3118
+// aWindowConstraints.weightx = 0;
3119
+// aWindowConstraints.gridx = 4;
3120
+// aWindowConstraints.gridwidth = 1;
3121
+// // aConstraints.gridheight = 3;
3122
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3123
+// //bigThree.add(XYZPanel, aWindowConstraints);
3124
+// scenePanel.setVisible(false);
3125
+// centralPanel.setVisible(true);
3126
+// XYZPanel.setVisible(false);
3127
+ bigThree.ClearUI();
3128
+ bigThree.add(centralPanel);
3129
+ bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
3132
+
3133
+// refreshContents(true);
3134
+//
3135
+// try
3136
+// {
3137
+// java.awt.Robot bot = new java.awt.Robot();
3138
+// int mask = InputEvent.BUTTON1_MASK;
3139
+// bot.mouseMove(100, 100);
3140
+// bot.mousePress(mask);
3141
+// bot.mouseRelease(mask);
3142
+// }
3143
+// catch (Exception e)
3144
+// {
3145
+//
3146
+// }
3147
+
25513148 } else
2552
- if (event.getSource() == threeButton)
3149
+ if (source == threeButton)
25533150 {
25543151 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();
3152
+
3153
+ if (CameraPane.FULLSCREEN)
3154
+ fullscreenLayout = radio.layout;
3155
+
3156
+// bigThree.remove(scenePanel);
3157
+// bigThree.remove(centralPanel);
3158
+// bigThree.remove(XYZPanel);
3159
+// aWindowConstraints.gridx = 0;
3160
+// aWindowConstraints.gridy = 0;
3161
+// aWindowConstraints.gridwidth = 1;
3162
+// // aConstraints.gridheight = 3;
3163
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3164
+// aWindowConstraints.weightx = 0;
3165
+// aWindowConstraints.weighty = 1;
3166
+// //bigThree.add(jtp, aWindowConstraints);
3167
+// aWindowConstraints.weightx = 1;
3168
+// aWindowConstraints.gridwidth = 3;
3169
+// // aConstraints.gridheight = 3;
3170
+// aWindowConstraints.gridx = 1;
3171
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3172
+// bigThree.add(centralPanel, aWindowConstraints);
3173
+// aWindowConstraints.weightx = 0;
3174
+// aWindowConstraints.gridx = 4;
3175
+// aWindowConstraints.gridwidth = 1;
3176
+// // aConstraints.gridheight = 3;
3177
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3178
+// bigThree.add(XYZPanel, aWindowConstraints);
3179
+// bigThree.validate();
3180
+// scenePanel.setVisible(false);
3181
+// centralPanel.setVisible(true);
3182
+// XYZPanel.setVisible(true);
3183
+ bigThree.ClearUI();
3184
+ bigThree.add(centralPanel);
3185
+ bigThree.add(XYZPanel);
3186
+ bigThree.FlushUI();
3187
+
3188
+ cameraView.requestFocusInWindow();
25793189 } else
2580
- if (event.getSource() == fourButton)
3190
+ if (source == fourButton)
25813191 {
25823192 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();
3193
+
3194
+ if (CameraPane.FULLSCREEN)
3195
+ fullscreenLayout = radio.layout;
3196
+
3197
+// bigThree.remove(scenePanel);
3198
+// bigThree.remove(centralPanel);
3199
+// bigThree.remove(XYZPanel);
3200
+// aWindowConstraints.gridx = 0;
3201
+// aWindowConstraints.gridy = 0;
3202
+// aWindowConstraints.gridwidth = 1;
3203
+// // aWindowConstraints.gridheight = 3;
3204
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3205
+// aWindowConstraints.weightx = 1;
3206
+// aWindowConstraints.weighty = 1;
3207
+// bigThree.add(scenePanel, aWindowConstraints);
3208
+// aWindowConstraints.weightx = 1;
3209
+// aWindowConstraints.gridwidth = 3;
3210
+// // aConstraints.gridheight = 3;
3211
+// aWindowConstraints.gridx = 1;
3212
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3213
+// //bigThree.add(cameraPanel, aWindowConstraints);
3214
+// aWindowConstraints.weightx = 0;
3215
+// aWindowConstraints.gridx = 4;
3216
+// aWindowConstraints.gridwidth = 1;
3217
+// // aWindowConstraints.gridheight = 3;
3218
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3219
+// //bigThree.add(XYZPanel, aWindowConstraints);
3220
+// bigThree.validate();
3221
+// scenePanel.setVisible(true);
3222
+// centralPanel.setVisible(false);
3223
+// XYZPanel.setVisible(false);
3224
+ bigThree.ClearUI();
3225
+ bigThree.add(scenePanel);
3226
+ bigThree.FlushUI();
3227
+
3228
+ cameraView.requestFocusInWindow();
26073229 } else
2608
- if (event.getSource() == sixButton)
3230
+ if (source == sixButton)
26093231 {
26103232 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();
3233
+
3234
+ if (CameraPane.FULLSCREEN)
3235
+ fullscreenLayout = radio.layout;
3236
+
3237
+// bigThree.remove(scenePanel);
3238
+// bigThree.remove(centralPanel);
3239
+// bigThree.remove(XYZPanel);
3240
+// aWindowConstraints.gridx = 0;
3241
+// aWindowConstraints.gridy = 0;
3242
+// aWindowConstraints.gridwidth = 1;
3243
+// // aConstraints.gridheight = 3;
3244
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3245
+// aWindowConstraints.weightx = 0;
3246
+// aWindowConstraints.weighty = 1;
3247
+// bigThree.add(scenePanel, aWindowConstraints);
3248
+// aWindowConstraints.weightx = 1;
3249
+// aWindowConstraints.gridwidth = 3;
3250
+// // aWindowConstraints.gridheight = 3;
3251
+// aWindowConstraints.gridx = 1;
3252
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3253
+// bigThree.add(centralPanel, aWindowConstraints);
3254
+// aWindowConstraints.weightx = 0;
3255
+// aWindowConstraints.gridx = 4;
3256
+// aWindowConstraints.gridwidth = 1;
3257
+// // aWindowConstraints.gridheight = 3;
3258
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3259
+// //bigThree.add(XYZPanel, aConstraints);
3260
+// bigThree.validate();
3261
+// scenePanel.setVisible(true);
3262
+// centralPanel.setVisible(true);
3263
+// XYZPanel.setVisible(false);
3264
+ bigThree.ClearUI();
3265
+ bigThree.add(scenePanel);
3266
+ bigThree.add(centralPanel);
3267
+ bigThree.FlushUI();
3268
+
3269
+ cameraView.requestFocusInWindow();
26353270 } else
2636
- if (event.getSource() == sevenButton)
3271
+ if (source == sevenButton)
26373272 {
26383273 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();
3274
+
3275
+ if (CameraPane.FULLSCREEN)
3276
+ fullscreenLayout = radio.layout;
3277
+
3278
+// bigThree.remove(scenePanel);
3279
+// bigThree.remove(centralPanel);
3280
+// bigThree.remove(XYZPanel);
3281
+// aWindowConstraints.gridx = 0;
3282
+// aWindowConstraints.gridy = 0;
3283
+// aWindowConstraints.gridwidth = 1;
3284
+// // aWindowConstraints.gridheight = 3;
3285
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3286
+// aWindowConstraints.weightx = 0;
3287
+// aWindowConstraints.weighty = 1;
3288
+// bigThree.add(scenePanel, aWindowConstraints);
3289
+// aWindowConstraints.weightx = 1;
3290
+// aWindowConstraints.gridwidth = 3;
3291
+// // aWindowConstraints.gridheight = 3;
3292
+// aWindowConstraints.gridx = 1;
3293
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3294
+// bigThree.add(centralPanel, aWindowConstraints);
3295
+// aWindowConstraints.weightx = 0;
3296
+// aWindowConstraints.gridx = 4;
3297
+// aWindowConstraints.gridwidth = 1;
3298
+// // aConstraints.gridheight = 3;
3299
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3300
+// bigThree.add(XYZPanel, aWindowConstraints);
3301
+// bigThree.validate();
3302
+// scenePanel.setVisible(true);
3303
+// centralPanel.setVisible(true);
3304
+// XYZPanel.setVisible(true);
3305
+ bigThree.ClearUI();
3306
+ bigThree.add(scenePanel);
3307
+ bigThree.add(centralPanel);
3308
+ bigThree.add(XYZPanel);
3309
+ bigThree.FlushUI();
3310
+
3311
+ cameraView.requestFocusInWindow();
26633312 } else
2664
- if (event.getSource() == rootButton)
3313
+ if (source == rootButton)
26653314 {
26663315 Object3D obj;
26673316 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3320,84 @@
26713320 EditObject(obj);
26723321 }
26733322
3323
+ cameraView.requestFocusInWindow();
26743324 refreshContents(true);
26753325 } else
2676
- if (event.getSource() == closeButton)
3326
+ if (source == closeButton)
26773327 {
26783328 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793329 cRadio ab;
26803330 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813331 {
26823332 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3333
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843334 {
3335
+ // Patch to avoid bug with transparency.
3336
+ if (!ab.hadMaterial)
3337
+ {
3338
+ ab.object.material = null;
3339
+ }
3340
+
26853341 buttonGroup.remove(ab);
26863342 radioPanel.remove(ab);
26873343
2688
- ab.GetObject().editWindow = null;
3344
+ //ab.GetObject().editWindow = null;
3345
+ ab.GetObject().manipWindow = null;
26893346 // ab.GetObject().objectUI = null; // ?????????
26903347
26913348 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923349 break;
26933350 }
26943351 }
3352
+
3353
+ cameraView.requestFocusInWindow();
26953354 refreshContents(true);
26963355 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3356
+ if (source == editItem || source == editButton)
26983357 {
3358
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3359
+ {
3360
+ Object3D child = (Object3D)e.nextElement();
3361
+ child.pinned = true;
3362
+ }
3363
+
26993364 EditSelection(false);
27003365 } else
2701
- if (event.getSource() == uneditButton)
3366
+ if (source == uneditButton)
27023367 {
27033368 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043369 {
27053370 Object3D child = (Object3D)e.nextElement();
27063371 if(child.editWindow != null)
27073372 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3373
+ child.pinned = false;
27083374 child.CloseUI();
27093375 listUI.remove(child);
27103376
2711
- child.editWindow = null; // ???????????
3377
+ //child.editWindow = null; // ???????????
27123378 }
2713
- objEditor.ctrlPanel.revalidate();
3379
+ objEditor.ctrlPanel.FlushUI();
27143380 //objEditor.jTree.clearSelection();
27153381 //objEditor.ResetSliders();
27163382 refreshContents(true);
27173383 } else
2718
- if (event.getSource() == clearPanelButton)
3384
+ if (source == clearPanelButton)
27193385 {
27203386 assert(copy == group);
27213387 //copy.ClearUI();
27223388 for (Object3D obj : listUI)
27233389 {
3390
+ obj.pinned = false;
27243391 obj.CloseUI();
27253392 }
27263393 listUI.clear();
27273394 refreshContents(true);
27283395 } else
2729
- if (event.getSource() == allParamsButton)
3396
+ if (source == allParamsButton)
27303397 {
27313398 assert(copy == group);
27323399
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3400
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343401
27353402 for (Object3D obj : listUI)
27363403 {
....@@ -2747,19 +3414,19 @@
27473414
27483415 refreshContents(true);
27493416 } else
2750
- if (event.getSource() == unselectButton)
3417
+ if (source == unselectButton)
27513418 {
27523419 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3420
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543421 objEditor.ResetSliders();
27553422 refreshContents(true);
27563423 } else
2757
- if(event.getSource() instanceof cRadio)
3424
+ if(source instanceof cRadio)
27583425 {
27593426 group.parent = keepparent;
27603427 group.attributes = 0;
27613428 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3429
+ /*cRadio*/ radio = (cRadio)source;
27633430 Object3D obj = radio.GetObject();
27643431 System.out.println("Edit " + obj);
27653432 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3446,7 @@
27793446 }
27803447
27813448 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3449
+ //Globals.theRenderer.object = group;
27833450 if(!useclient)
27843451 {
27853452 cameraView.renderCamera = radio.camera;
....@@ -2788,25 +3455,50 @@
27883455 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893456 cameraView.targetLookAt.set(radio.camera.lookAt);
27903457 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3458
+ //cameraView.lighttouched = true;
3459
+ Globals.lighttouched = true;
27923460 topView.object = group;
27933461 frontView.object = group;
27943462 sideView.object = group;
27953463 }
2796
- group.editWindow = this;
3464
+
3465
+// fix "+" issue
3466
+ //group.editWindow = this;
3467
+ group.manipWindow = this;
3468
+
27973469 /*
27983470 currentLayout = radio.layout;
27993471 if (currentLayout == null)
28003472 currentLayout = sevenButton;
28013473 */
28023474 radio.layout.doClick();
3475
+
3476
+ ClearUnpinned();
3477
+ SetPinStates(group.selection.size() > 0);
3478
+ if (group.selection.size() == 1)
3479
+ EditSelection(false);
28033480 keepparent = group.parent;
28043481 // PARENT = NULL or not???
28053482 //group.parent = null; // ROOT
28063483 //group.attributes = -1;
28073484 ResetModel();
3485
+
3486
+ cameraView.requestFocusInWindow();
28083487 refreshContents(true);
2809
- }
3488
+ } else if (event.getSource() == editCameraItem)
3489
+ {
3490
+ cameraView.ProtectCamera();
3491
+ cameraView.repaint();
3492
+ return;
3493
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3494
+ {
3495
+ cameraView.RevertCamera();
3496
+ cameraView.repaint();
3497
+ return;
3498
+ // } else if (event.getSource() == textureButton)
3499
+ // {
3500
+ // return; // true;
3501
+ }
28103502 else
28113503 {
28123504 //return super.action(event, arg);
....@@ -2815,7 +3507,6 @@
28153507 }
28163508
28173509 boolean useclient = false;
2818
- cRadio radio;
28193510
28203511 void ToggleRoot()
28213512 {
....@@ -2824,7 +3515,7 @@
28243515 if (useclient)
28253516 {
28263517 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3518
+ Globals.lighttouched = true;
28283519 //topView.object = client;
28293520 //frontView.object = client;
28303521 //sideView.object = client;
....@@ -2832,7 +3523,7 @@
28323523 else
28333524 {
28343525 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3526
+ Globals.lighttouched = true;
28363527 //topView.object = group;
28373528 //frontView.object = group;
28383529 //sideView.object = group;
....@@ -2867,6 +3558,28 @@
28673558 refreshContents();
28683559 }
28693560
3561
+ void TransformChildren()
3562
+ {
3563
+ Object3D obj;
3564
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3565
+ {
3566
+ obj = (Object3D)e.nextElement();
3567
+ obj.KeepTextureMatrices();
3568
+ obj.TransformChildren();
3569
+ obj.RestoreTextureMatrices();
3570
+
3571
+// if (obj.parent == null)
3572
+// {
3573
+// System.out.println("NULL PARENT!");
3574
+// new Exception().printStackTrace();
3575
+// }
3576
+// else
3577
+// TouchTransform(obj);
3578
+// //obj.parent.Touch();
3579
+ }
3580
+
3581
+ refreshContents();
3582
+ }
28703583
28713584 void ResetTransform()
28723585 {
....@@ -2979,7 +3692,7 @@
29793692 refreshContents();
29803693 }
29813694
2982
- void ResetCentroid()
3695
+ void ResetCentroid(boolean full)
29833696 {
29843697 Object3D obj;
29853698 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3707,16 @@
29943707 LA.matIdentity(Object3D.mat);
29953708 obj.getBounds(minima, maxima, false);
29963709 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3710
+ if (full)
3711
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983712 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993713 obj.TransformMesh(Object3D.mat);
3714
+
30003715 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3716
+ if (full)
3717
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023718 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3719
+
30033720 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043721 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053722 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3745,8 @@
30283745
30293746 int size = obj.MemorySize();
30303747
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3748
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3749
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323750 }
30333751 }
30343752 catch (Exception e)
....@@ -3065,9 +3783,9 @@
30653783 obj = (Object3D)e.nextElement();
30663784
30673785 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3786
+ Grafreed.AnalyzeObject(obj);
30693787 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3788
+ Grafreed.AnalyzeObject(obj.bRep);
30713789
30723790 // System.err.println((size/1024) + " KB is the size of " + obj);
30733791 }
....@@ -3109,6 +3827,20 @@
31093827 void GenNormals(boolean crease)
31103828 {
31113829 group.GenNormalsS(crease);
3830
+
3831
+ refreshContents();
3832
+ }
3833
+
3834
+ void GenNormalsMESH()
3835
+ {
3836
+ group.GenNormalsMeshS();
3837
+
3838
+ refreshContents();
3839
+ }
3840
+
3841
+ void GenNormalsMINE()
3842
+ {
3843
+ group.selection.GenNormalsMINE();
31123844
31133845 refreshContents();
31143846 }
....@@ -3157,104 +3889,259 @@
31573889
31583890 //Object3D buffer;
31593891 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
-
3892
+// BoundaryRep temprep;
3893
+// Object3D nodes;
3894
+// Vector<Vertex> vertices;
3895
+//
3896
+// cGroup buffer;
3897
+//
3898
+// public void Vertex(Object3D node, Vertex v)
3899
+// {
3900
+//// vertices.add(v);
3901
+//// nodes.addElement(node);
3902
+////
3903
+//// if (temprep.GetCache(v) != null)
3904
+//// {
3905
+//// temprep.Remove(v);
3906
+//// } else
3907
+//// {
3908
+//// temprep.Remember(v);
3909
+//// }
3910
+//
3911
+// //Object3D node = nodes.get(index);
3912
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3913
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3914
+//
3915
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3916
+//
3917
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3918
+//
3919
+// cGroup g = new cGroup();
3920
+//
3921
+// if (g.toParent == null)
3922
+// {
3923
+// g.toParent = LA.newMatrix();
3924
+// g.fromParent = LA.newMatrix();
3925
+// }
3926
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3927
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3928
+//
3929
+// g.add(GrafreeD.clipboard);
3930
+//
3931
+// buffer.add(g);
3932
+// }
3933
+//
3934
+// public void Face(Object3D node, Face f)
3935
+// {
3936
+//
3937
+// }
3938
+//
3939
+// void ParseVerticesOld() // ??
3940
+// {
3941
+// //if (group.selection.size() != 1)
3942
+// // return;
3943
+//
3944
+// temprep = new BoundaryRep();
3945
+// nodes = new Object3D();
3946
+// vertices = new Vector<Vertex>();
3947
+//
3948
+// boolean epsequal = GrafreeD.epsequal;
3949
+// GrafreeD.epsequal = true;
3950
+//
3951
+// for (int i=0; i<group.selection.size(); i++)
3952
+// {
3953
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3954
+//
3955
+// group.selection.get(i).Parse(
3956
+//this );
3957
+//
3958
+// int repsize = temprep.VertexCount();
3959
+// int tablesize = temprep.vertextable.size();
3960
+// int nodesize = nodes.size();
3961
+//
3962
+// assert(vertices.size() == nodes.size());
3963
+//
3964
+// temprep.vertextable.elements();
3965
+//
3966
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3967
+//
3968
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3969
+// {
3970
+// cGroup g = new cGroup();
3971
+//
3972
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3973
+//
3974
+// Object3D node = nodes.get(index);
3975
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3976
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3977
+//
3978
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3979
+//
3980
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3981
+//
3982
+// if (g.toParent == null)
3983
+// {
3984
+// g.toParent = LA.newMatrix();
3985
+// g.fromParent = LA.newMatrix();
3986
+// }
3987
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3988
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3989
+//
3990
+// g.add(GrafreeD.clipboard);
3991
+//
3992
+// buffer.add(g);
3993
+// }
3994
+//
3995
+// makeSomething(buffer, i==group.selection.size()-1);
3996
+// }
3997
+//
3998
+// GrafreeD.epsequal = epsequal;
3999
+//
4000
+// //buffer = null;
4001
+// temprep = null;
4002
+// nodes = null;
4003
+//
4004
+// refreshContents();
4005
+// }
4006
+
31844007 void ParseVertices()
31854008 {
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;
4009
+ boolean epsequal = Grafreed.epsequal;
4010
+ Grafreed.epsequal = true;
31954011
31964012 for (int i=0; i<group.selection.size(); i++)
31974013 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4014
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31994015
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
4016
+ group.selection.get(i).Parse(
4017
+
4018
+ new iParse()
4019
+ {
4020
+ public void Vertex(Object3D node, Vertex v)
4021
+ {
4022
+ temp.set(v);
4023
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054024
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();
4025
+ cGroup g = new cGroup();
32114026
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4027
+ if (g.toParent == null)
4028
+ {
4029
+ g.toParent = LA.newMatrix();
4030
+ g.fromParent = LA.newMatrix();
4031
+ }
4032
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4033
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154034
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);
4035
+ g.add(Grafreed.clipboard);
32204036
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);
4037
+ buffer.add(g);
4038
+ }
32324039
3233
- g.add(GraphreeD.clipboard);
4040
+ public void Face(Object3D node, Face f)
4041
+ {
32344042
3235
- buffer.add(g);
3236
- }
4043
+ }
4044
+ }
4045
+ );
32374046
32384047 makeSomething(buffer, i==group.selection.size()-1);
32394048 }
32404049
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4050
+ Grafreed.epsequal = epsequal;
32464051
32474052 refreshContents();
32484053 }
3249
-
4054
+
4055
+ void TextureVertices()
4056
+ {
4057
+ for (int i=0; i<group.selection.size(); i++)
4058
+ {
4059
+ group.selection.get(i).Parse(
4060
+ new iParse()
4061
+ {
4062
+ public void Vertex(Object3D node, Vertex v)
4063
+ {
4064
+ cTexture tex = node.GetTextures();
4065
+ String pigment = Object3D.GetPigment(tex);
4066
+ //String bump = Object3D.GetBump(tex);
4067
+
4068
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4069
+
4070
+ try
4071
+ {
4072
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4073
+ }
4074
+ catch (Exception e)
4075
+ {
4076
+ System.err.println("FAIL: " + node);
4077
+ }
4078
+
4079
+ double s = v.s;
4080
+
4081
+ if (s == 1)
4082
+ s = 0;
4083
+
4084
+ double t = v.t;
4085
+
4086
+ if (t == 1)
4087
+ t = 0;
4088
+
4089
+ int indexs = (int) (texturedata.getWidth() * s);
4090
+ int indext = (int) (texturedata.getHeight() * t);
4091
+
4092
+ int index = indext * texturedata.getWidth() + indexs;
4093
+
4094
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4095
+
4096
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4097
+
4098
+ float scale = bytebuf.get(index*slide) & 0xFF;
4099
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4100
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4101
+ scale /= 3;
4102
+
4103
+ scale /= 0xFF;
4104
+ // c'est quoi ca? scale /= 4;
4105
+
4106
+ //v.AO = scale;
4107
+
4108
+ v.x += v.norm.x * scale;
4109
+ v.y += v.norm.y * scale;
4110
+ v.z += v.norm.z * scale;
4111
+ }
4112
+
4113
+ public void Face(Object3D node, Face f)
4114
+ {
4115
+ }
4116
+ }
4117
+ );
4118
+ }
4119
+
4120
+ refreshContents();
4121
+ }
4122
+
32504123 void Align()
32514124 {
4125
+ if (group.selection.size() == 0)
4126
+ return;
4127
+
4128
+ cVector bbmin = new cVector();
4129
+ cVector bbmax = new cVector();
4130
+
4131
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4132
+
4133
+ double dx = bbmax.x - bbmin.x;
4134
+ double dy = bbmax.y - bbmin.y;
4135
+ double dz = bbmax.z - bbmin.z;
4136
+
4137
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4138
+
32524139 for (int i=0; i<group.selection.size(); i++)
32534140 {
32544141 Object3D obj = group.selection.get(i);
32554142
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4143
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4144
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584145 }
32594146
32604147 refreshContents();
....@@ -3267,7 +4154,7 @@
32674154 // ref.SaveSupports();
32684155 // Object3D par = ref.parent;
32694156 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4157
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714158 // ref.parent = par;
32724159 // ref.RestoreSupports();
32734160
....@@ -3275,11 +4162,11 @@
32754162
32764163 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774164
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4165
+ boolean random = CameraPane.SWITCH;
4166
+ CameraPane.SWITCH = false; // parse all random nodes
32804167 lowres.linkVerticesThis(null);
32814168 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4169
+ CameraPane.SWITCH = random;
32834170
32844171 System.err.flush();
32854172
....@@ -3297,7 +4184,7 @@
32974184 // lowres.SaveSupports();
32984185 // par = lowres.parent;
32994186 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4187
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014188 Object3D newlow = CloneObject(lowres, false);
33024189 newlow.name = sn.switchobject.get(i).name;
33034190 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4206,7 @@
33194206 return;
33204207
33214208 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4209
+ Object3D ref = Grafreed.clipboard.get(0);
33234210
33244211 Object3D newgroup = new Object3D("Po:" + poses.name);
33254212
....@@ -3488,7 +4375,7 @@
34884375 group.selection.RelinkToSupport(); // july 2014
34894376 System.out.println("DONE.");
34904377 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4378
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924379 }
34934380
34944381 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4400,20 @@
35134400
35144401 void ClipMesh()
35154402 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4403
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174404 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4405
+ Object3D content = Grafreed.clipboard.get(0);
35194406
35204407 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214408 content = ((cGroup)content).get(0);
35224409
35234410 // for (int i=0; i<group.selection.size(); i++)
35244411 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4412
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264413 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4414
+ group.selection.ClipMesh(Grafreed.clipboard);
35284415 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4416
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304417 System.out.println("DONE.");
35314418 refreshContents();
35324419 }
....@@ -3571,6 +4458,18 @@
35714458 void MarkLeaves(boolean hide)
35724459 {
35734460 group.selection.MarkLeaves(hide);
4461
+ refreshContents();
4462
+ }
4463
+
4464
+ void RewindLeaves(boolean hide)
4465
+ {
4466
+ group.selection.RewindLeaves(hide);
4467
+ refreshContents();
4468
+ }
4469
+
4470
+ void RandomLeaves(boolean hide)
4471
+ {
4472
+ group.selection.RandomLeaves(hide);
35744473 refreshContents();
35754474 }
35764475
....@@ -3645,10 +4544,6 @@
36454544 // }
36464545 // }
36474546
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36524547 void EditSelection(boolean newWindow)
36534548 {
36544549 // aConstraints.gridy = 0;
....@@ -3656,10 +4551,10 @@
36564551 {
36574552 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584553 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4554
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604555
36614556 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4557
+ if(elem != group || !newWindow)
36634558 {
36644559 // if (!(elem instanceof Composite))
36654560 // newWindow = false;
....@@ -3741,7 +4636,8 @@
37414636 //new Exception().printStackTrace();
37424637
37434638 freezemodel = true;
3744
-
4639
+ ClearUnpinned();
4640
+
37454641 /**/
37464642 //switch (event.id)
37474643 {
....@@ -3749,7 +4645,6 @@
37494645 //case 702: // Event.LIST_DESELECT
37504646 group.deselectAll();
37514647 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534648 if (tps != null)
37544649 {
37554650 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +4653,39 @@
37584653
37594654 //if (child.parent != null)
37604655 //child.parent.addSelectee(child);
4656
+ objEditor.SetMaterial(child);
37614657 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654658 }
37664659 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4660
+// else
4661
+// {
4662
+// objEditor.SetMaterial(group); // .GetMaterial());
4663
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4664
+// System.err.println("info : " + group.GetPath());
4665
+// }
37734666
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4667
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774668 CameraPane.flash = true;
37784669
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4670
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804671 // a camera
37814672 {
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;
4673
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4674
+ {
4675
+ CameraPane.camerachangeframe = 0; // don't refuse it
4676
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4677
+ }
4678
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4679
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864680 }
37874681
4682
+ if (tps != null && tps.length == 1)
4683
+ {
4684
+ EditSelection(false);
4685
+ }
4686
+
4687
+ SetPinStates(tps != null && tps.length > 0);
4688
+
37884689 refreshContents();
37894690 //return true;
37904691 }
....@@ -3793,6 +4694,35 @@
37934694
37944695 freezemodel = false;
37954696 }
4697
+
4698
+ void SetPinStates(boolean enabled)
4699
+ {
4700
+ editButton.setEnabled(enabled);
4701
+ uneditButton.setEnabled(enabled);
4702
+ unselectButton.setEnabled(enabled);
4703
+ flashSelectionButton.setEnabled(enabled);
4704
+ }
4705
+
4706
+ void refreshContents(boolean cp)
4707
+ {
4708
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4709
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4710
+ {
4711
+ objEditor.ClearInfo(); // .GetMaterial());
4712
+
4713
+ for (int i=0; i < group.selection.Size(); i++)
4714
+ {
4715
+ Object3D child = (Object3D) group.selection.get(i);
4716
+
4717
+ objEditor.AddInfo(child, this, true);
4718
+ System.err.println("info : " + child.GetPath());
4719
+ }
4720
+
4721
+ objEditor.SetText(); // jan 2014
4722
+ }
4723
+
4724
+ super.refreshContents(cp);
4725
+ }
37964726
37974727 void linkSomething(Object3D thing)
37984728 {
....@@ -3864,16 +4794,19 @@
38644794 {
38654795 if (group.selection.isEmpty())
38664796 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4797
+
4798
+ Grafreed.clipboardIsTempGroup = false;
38684799 Composite tGroup = null;
38694800 if (group.selection.size() > 0) // 1)
38704801 {
38714802 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4803
+ Grafreed.clipboardIsTempGroup = true;
38734804 }
38744805
38754806 if (cut)
38764807 {
4808
+ if (Globals.SAVEONMAKE)
4809
+ Save();
38774810 //int indices[] = jList.getSelectedIndices();
38784811 //for (int i = indices.length - 1; i >= 0; i--)
38794812 //jList.remove(indices[i]);
....@@ -3909,16 +4842,16 @@
39094842 //System.out.println("cut " + child);
39104843 //System.out.println("parent = " + child.parent);
39114844 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4845
+ if (Grafreed.clipboardIsTempGroup)
39134846 tGroup.add/*Child*/(tmp);
39144847 else
3915
- GraphreeD.clipboard = tmp;
4848
+ Grafreed.clipboard = tmp;
39164849 }
39174850 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4851
+ if (Grafreed.clipboardIsTempGroup)
39194852 tGroup.add/*Child*/(child);
39204853 else
3921
- GraphreeD.clipboard = child;
4854
+ Grafreed.clipboard = child;
39224855 }
39234856
39244857 //ResetModel();
....@@ -3950,21 +4883,23 @@
39504883 //System.out.println("cut " + elem);
39514884 //System.out.println("parent = " + elem.parent);
39524885 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4886
+ if (Grafreed.clipboardIsTempGroup)
39544887 tGroup.add/*Child*/(tmp);
39554888 else
3956
- GraphreeD.clipboard = tmp;
4889
+ Grafreed.clipboard = tmp;
39574890 }
39584891 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4892
+ if (Grafreed.clipboardIsTempGroup)
39604893 tGroup.add/*Child*/(child);
39614894 else
3962
- GraphreeD.clipboard = child;
4895
+ Grafreed.clipboard = child;
39634896 }
39644897
39654898 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4899
+
4900
+ if (Grafreed.clipboardIsTempGroup)
4901
+ Grafreed.clipboard = tGroup;
4902
+
39684903 if (cut)
39694904 {
39704905 ResetModel();
....@@ -3974,11 +4909,11 @@
39744909
39754910 void paste(boolean expand)
39764911 {
3977
- // if (GraphreeD.clipboard == null)
4912
+ // if (GrafreeD.clipboard == null)
39784913 // return;
39794914 boolean first = true;
39804915
3981
- if (GraphreeD.clipboardIsTempGroup)
4916
+ if (Grafreed.clipboardIsTempGroup)
39824917 {
39834918 Composite temp;
39844919
....@@ -3989,7 +4924,7 @@
39894924 temp = (Composite)Applet3D.clipboard.deepCopy();
39904925 */
39914926 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4927
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934928 {
39944929 Object3D child = (Object3D)e.nextElement();
39954930
....@@ -4003,7 +4938,7 @@
40034938 else
40044939 elem = child.deepCopy(); // ?
40054940 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4941
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074942 // elem = elem.get(0);
40084943 makeSomething(elem, true); // ?? first);
40094944 //group.addChild(elem);
....@@ -4023,23 +4958,23 @@
40234958 //Object3D cb = Applet3D.clipboard;
40244959 //temp.addChild(cb);
40254960 //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());
4961
+ assert(Grafreed.clipboard.parent == null);
4962
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4963
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4964
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4965
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314966 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4967
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4968
+ Grafreed.clipboard.get(0).parent = keepparent;
40344969 }
40354970
40364971 ResetModel();
40374972 refreshContents();
40384973 }
40394974
4040
- void pasteInto(boolean copyit)
4975
+ void pasteInto(boolean copyit, boolean clone)
40414976 {
4042
-// if (GraphreeD.clipboard == null)
4977
+// if (GrafreeD.clipboard == null)
40434978 // return;
40444979
40454980 if (group.selection.size() != 1)
....@@ -4066,15 +5001,22 @@
40665001 if (copyit)
40675002 {
40685003 // paste(false);
4069
- CloneClipboard(false); // sept 2014
5004
+ if (clone)
5005
+ {
5006
+ CloneClipboard(false); // sept 2014
5007
+ }
5008
+ else
5009
+ {
5010
+ paste(false);
5011
+ }
40705012 }
40715013 else
40725014 {
40735015 boolean first = true;
40745016
4075
- if (GraphreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
40765018 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5019
+ Composite temp = (Composite)Grafreed.clipboard;
40785020 Object3D copy;
40795021 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805022 {
....@@ -4084,7 +5026,7 @@
40845026 }
40855027 } else
40865028 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5029
+ linkSomething(Grafreed.clipboard); //.get(0));
40885030 }
40895031 }
40905032 }
....@@ -4276,6 +5218,26 @@
42765218 makeSomething(csg);
42775219 }
42785220
5221
+ void Ungroup(Object3D g)
5222
+ {
5223
+ if (g instanceof HiddenObject)
5224
+ {
5225
+ HiddenObject h = (HiddenObject) g;
5226
+
5227
+ for (int i=0; i<h.ActualSize(); i++)
5228
+ {
5229
+ objEditor.makeSomething(h.get(i), false);
5230
+ }
5231
+ }
5232
+ else
5233
+ {
5234
+ for (int i=0; i<g.Size(); i++)
5235
+ {
5236
+ objEditor.makeSomething(g.get(i), false);
5237
+ }
5238
+ }
5239
+ }
5240
+
42795241 void ungroup()
42805242 {
42815243 /*
....@@ -4469,21 +5431,6 @@
44695431 }
44705432 */
44715433
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
-
44875434 /*
44885435 public void Callback(Object obj)
44895436 {
....@@ -4507,26 +5454,9 @@
45075454 }
45085455 */
45095456
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
-
45275457 String GetFile(String dialogName)
45285458 {
4529
- if (GraphreeD.standAlone)
5459
+ if (Grafreed.standAlone)
45305460 {
45315461 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325462 browser.show();
....@@ -4590,10 +5520,36 @@
45905520 cButton flashSelectionButton;
45915521 cButton editButton;
45925522 cButton uneditButton;
5523
+ JCheckBox allParamsButton;
45935524 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955525 cButton unselectButton;
45965526
5527
+ cButton restoreCameraButton;
5528
+
5529
+ cButton minButton;
5530
+ cButton maxButton;
5531
+ cButton fullButton;
5532
+ cButton saveButton;
5533
+ cButton oneStepButton;
5534
+
5535
+ cButton groupButton;
5536
+ cButton ungroupButton;
5537
+ cButton compositeButton;
5538
+ cButton switchButton;
5539
+ cButton loopButton;
5540
+ cButton textureButton;
5541
+
5542
+ cButton gridButton;
5543
+ cButton boxButton;
5544
+ cButton sphereButton;
5545
+ cButton coneButton;
5546
+ cButton torusButton;
5547
+ cButton superButton;
5548
+ cButton kleinButton;
5549
+ cButton particlesButton;
5550
+ cButton overlayButton;
5551
+ cButton lightButton;
5552
+
45975553 cButton screenfitButton;
45985554 cButton screenfitpointButton;
45995555 cButton snapobjectButton;
....@@ -4605,14 +5561,6 @@
46055561
46065562 cButton setsupportButton;
46075563
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
-
46165564 //
46175565 //Composite
46185566 Object3D // to do !!
....@@ -4622,9 +5570,11 @@
46225570 //JTree jTree;
46235571 private MenuItem lookAtItem;
46245572 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
5573
+ private MenuItem switchViewItem;
46265574 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5575
+ private MenuItem undoItem;
5576
+ private MenuItem redoItem;
5577
+ private JMenuItem duplicateItem;
46285578 private MenuItem cloneItem;
46295579 private MenuItem cloneSupportItem;
46305580 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5585,9 @@
46355585 private MenuItem resetsupportItem;
46365586 private MenuItem resetreferencesItem;
46375587 private MenuItem linkverticesItem;
5588
+ private MenuItem relinkverticesItem;
46385589 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5590
+ private MenuItem resetAllItem;
46405591 private MenuItem stepAllItem;
46415592 private MenuItem revertMeshItem;
46425593 private MenuItem poseMeshItem;
....@@ -4647,14 +5598,17 @@
46475598 private MenuItem mergeGeometriesItem;
46485599 private MenuItem copyItem;
46495600 private MenuItem pasteItem;
5601
+ private MenuItem pasteIntoItem;
46505602 private MenuItem pasteLinkItem;
46515603 private MenuItem pasteCloneItem;
46525604 private MenuItem pasteExpandItem;
46535605 private MenuItem clearItem;
46545606 private MenuItem clearAllItem;
46555607 private MenuItem genUVItem;
5608
+ private MenuItem genNormalsMESHItem;
46565609 private MenuItem genNormalsCADItem;
46575610 private MenuItem genNormalsORGANItem;
5611
+ private MenuItem genNormalsMINEItem;
46585612 private MenuItem stripifyItem;
46595613 private MenuItem unstripifyItem;
46605614 private MenuItem trimItem;
....@@ -4683,6 +5637,10 @@
46835637 private MenuItem showleavesItem;
46845638 private MenuItem markleavesItem;
46855639 private MenuItem unmarkleavesItem;
5640
+ private MenuItem rewindleavesItem;
5641
+ private MenuItem unrewindleavesItem;
5642
+ private MenuItem randomleavesItem;
5643
+ private MenuItem unrandomleavesItem;
46865644
46875645 private MenuItem flipVItem;
46885646 private MenuItem unflipVItem;
....@@ -4694,14 +5652,17 @@
46945652 private MenuItem panoTexturesItem;
46955653
46965654 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5655
+ private MenuItem resetCentroidXZItem;
46985656 private MenuItem resetTransformItem;
5657
+ private MenuItem transformGeometryItem;
5658
+ private MenuItem transformChildrenItem;
5659
+ private MenuItem hideItem;
46995660 private MenuItem grabItem;
47005661 private MenuItem backItem;
47015662 private MenuItem frontItem;
47025663 private MenuItem cameraItem;
47035664 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
5665
+ private MenuItem switchItem;
47055666 private MenuItem physicsItem;
47065667 private MenuItem frameselectorItem;
47075668 private MenuItem scriptNodeItem;
....@@ -4716,6 +5677,7 @@
47165677
47175678 private MenuItem resetParentItem;
47185679 private MenuItem repairParentItem;
5680
+ private MenuItem repairShadowItem;
47195681 private MenuItem sortbysizeItem;
47205682 private MenuItem sortbynameItem;
47215683
....@@ -4728,16 +5690,19 @@
47285690 private MenuItem particleItem;
47295691 private MenuItem ragdollItem;
47305692 private MenuItem ragdoll2Item;
5693
+ private MenuItem heightFieldItem;
5694
+ private MenuItem textureFieldItem;
47315695 private MenuItem gridItem;
47325696 private MenuItem rectoidItem;
47335697 private MenuItem ellipsoidItem;
47345698 private MenuItem coneItem;
47355699 private MenuItem torusItem;
47365700 private MenuItem superItem;
5701
+ private MenuItem kleinItem;
47375702 private MenuItem blobItem;
47385703 private MenuItem latheItem;
47395704 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5705
+ private MenuItem overlayItem;
47415706 private MenuItem meshItem;
47425707 // private MenuItem meshGroupItem;
47435708 private MenuItem springItem;
....@@ -4746,6 +5711,7 @@
47465711 private MenuItem csgItem;
47475712 private MenuItem templateItem;
47485713 private MenuItem textureItem;
5714
+ private MenuItem billboardItem;
47495715 private MenuItem shadowXItem;
47505716 private MenuItem shadowYItem;
47515717 private MenuItem shadowZItem;
....@@ -4758,11 +5724,6 @@
47585724 private MenuItem doubleItem;
47595725 private MenuItem tripleItem;
47605726
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665727 private MenuItem computeAOItem;
47675728 private MenuItem recompileItem;
47685729 private MenuItem editScriptItem;
....@@ -4772,4 +5733,8 @@
47725733 private MenuItem analyzeItem;
47735734 private MenuItem dumpItem;
47745735 //boolean freezemodel = false;
5736
+
5737
+ Menu cameraMenu;
5738
+ MenuItem editCameraItem;
5739
+ MenuItem restoreCameraItem;
47755740 }