.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row3) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + skyboxButton.setToolTipText(s); |
---|
| 33 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 34 | + { |
---|
| 35 | + @Override |
---|
| 36 | + public void actionPerformed(ActionEvent e) |
---|
| 37 | + { |
---|
| 38 | + ChangeSkybox(path); |
---|
| 39 | + } |
---|
| 40 | + }); |
---|
| 41 | + } |
---|
| 42 | + |
---|
| 43 | + public void ChangeSkybox(String name) |
---|
| 44 | + { |
---|
| 45 | + cameraView.envyoff = false; |
---|
| 46 | + cameraView.skyboxname = name; |
---|
| 47 | + cameraView.skyboxext = "jpg"; |
---|
| 48 | + cameraView.repaint(); |
---|
| 49 | + } |
---|
| 50 | + |
---|
26 | 51 | //ObjEditor objEditor; |
---|
27 | 52 | public void closeUI2() |
---|
28 | 53 | { |
---|
.. | .. |
---|
60 | 85 | this.copy = this.group = group; |
---|
61 | 86 | //selectees = this.group.selectees; |
---|
62 | 87 | |
---|
| 88 | + if (copy.versions == null) |
---|
| 89 | + { |
---|
| 90 | + copy.versions = new byte[100][]; |
---|
| 91 | + copy.versionindex = -1; |
---|
| 92 | + } |
---|
| 93 | + |
---|
63 | 94 | if(ui) |
---|
64 | 95 | SetupUI(objEditor); |
---|
65 | 96 | } |
---|
.. | .. |
---|
74 | 105 | this.copy = this.group = copy; |
---|
75 | 106 | //selectees = this.group.selectees; |
---|
76 | 107 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 108 | + SetupMenu2(this); //objEditor); |
---|
78 | 109 | SetupUI2(objEditor); |
---|
79 | 110 | objEditor.SetupUI(true); |
---|
80 | 111 | SetupViews(objEditor); |
---|
81 | 112 | |
---|
82 | 113 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 114 | + |
---|
| 115 | + if (copy.versions == null) |
---|
| 116 | + { |
---|
| 117 | + copy.versions = new byte[100][]; |
---|
| 118 | + copy.versionindex = -1; |
---|
| 119 | + |
---|
| 120 | + Save(true); |
---|
| 121 | + } |
---|
83 | 122 | } |
---|
84 | 123 | |
---|
85 | 124 | void CloneSelection(boolean supports) |
---|
86 | 125 | { |
---|
| 126 | + if (Globals.REPLACEONMAKE) |
---|
| 127 | + Save(); |
---|
| 128 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 129 | + Globals.REPLACEONMAKE = false; |
---|
87 | 130 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 131 | //Object3D obj; |
---|
89 | 132 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 137 | |
---|
95 | 138 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 139 | } |
---|
| 140 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 141 | } |
---|
98 | 142 | |
---|
99 | 143 | void CloneClipboard(boolean supports) |
---|
100 | 144 | { |
---|
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)); |
---|
| 145 | + assert(Grafreed.clipboard.parent == null); |
---|
| 146 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 147 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 148 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 149 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 150 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 151 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 152 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 153 | } |
---|
110 | 154 | |
---|
111 | 155 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 163 | // obj.support = null; |
---|
120 | 164 | if (!supports) |
---|
121 | 165 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 166 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 167 | obj.parent = parent; |
---|
124 | 168 | // obj.support = support; |
---|
125 | 169 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 192 | |
---|
149 | 193 | //JTextField nameField; |
---|
150 | 194 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 195 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 196 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
| 197 | + oe.jTree = new cTree(); |
---|
| 198 | + |
---|
168 | 199 | Menu menu; |
---|
169 | 200 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 201 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 202 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 203 | + |
---|
| 204 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 205 | +// undoItem.addActionListener(this); |
---|
| 206 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 207 | +// redoItem.addActionListener(this); |
---|
| 208 | +// menu.add("-"); |
---|
| 209 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 210 | duplicateItem.addActionListener(this); |
---|
174 | 211 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 212 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 222 | copyItem.addActionListener(this); |
---|
186 | 223 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 224 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 225 | |
---|
190 | 226 | menu.add("-"); |
---|
191 | 227 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
197 | 233 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
198 | 234 | // pasteExpandItem.addActionListener(this); |
---|
199 | 235 | menu.add("-"); |
---|
200 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
201 | | - clearItem.addActionListener(this); |
---|
| 236 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 237 | + deleteItem.addActionListener(this); |
---|
202 | 238 | |
---|
203 | 239 | if (Globals.ADVANCED) |
---|
204 | 240 | { |
---|
.. | .. |
---|
206 | 242 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 243 | clearAllItem.addActionListener(this); |
---|
208 | 244 | } |
---|
| 245 | + |
---|
| 246 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 247 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 248 | + //zBufferItem.addActionListener(this); |
---|
| 249 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 250 | + //normalLensItem.addActionListener(this); |
---|
| 251 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 252 | + restoreCameraItem.addActionListener(this); |
---|
| 253 | + |
---|
| 254 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 255 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 256 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 257 | +// cameraMenu.add("-"); |
---|
| 258 | +// |
---|
| 259 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 260 | +// toggleTextureItem.addItemListener(this); |
---|
| 261 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 262 | +// |
---|
| 263 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 264 | +// toggleSwitchItem.addItemListener(this); |
---|
| 265 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 266 | + |
---|
| 267 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 268 | + toggleHandleItem.addItemListener(this); |
---|
| 269 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 270 | + |
---|
| 271 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 272 | + togglePaintItem.addItemListener(this); |
---|
| 273 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 274 | + |
---|
| 275 | + if (Globals.ADVANCED) |
---|
| 276 | + { |
---|
| 277 | + cameraMenu.add("-"); |
---|
| 278 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 279 | + toggleLiveItem.addItemListener(this); |
---|
| 280 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 281 | |
---|
| 282 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 283 | + stepItem.addActionListener(this); |
---|
| 284 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 285 | + // toggleDLItem.addItemListener(this); |
---|
| 286 | + // toggleDLItem.setState(false); |
---|
| 287 | + |
---|
| 288 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 289 | + toggleRenderItem.addItemListener(this); |
---|
| 290 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 291 | + |
---|
| 292 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 293 | + toggleDebugItem.addItemListener(this); |
---|
| 294 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 295 | + |
---|
| 296 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 297 | + toggleFrustumItem.addItemListener(this); |
---|
| 298 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 299 | + |
---|
| 300 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 301 | + toggleFootContactItem.addItemListener(this); |
---|
| 302 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 303 | + |
---|
| 304 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 305 | + toggleTimelineItem.addItemListener(this); |
---|
| 306 | + } |
---|
| 307 | + |
---|
| 308 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 309 | +// toggleRootItem.addItemListener(this); |
---|
| 310 | +// toggleRootItem.setState(false); |
---|
| 311 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 312 | +// animationItem.addItemListener(this); |
---|
| 313 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 314 | + cameraMenu.add("-"); |
---|
| 315 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 316 | + editCameraItem.addActionListener(this); |
---|
| 317 | + |
---|
| 318 | + if (Globals.ADVANCED) |
---|
| 319 | + { |
---|
| 320 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 321 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 322 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 323 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 324 | + oe.cameraMenu.add("-"); |
---|
| 325 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 326 | + openWindowItem.addActionListener(this); |
---|
| 327 | + editLeafItem.addActionListener(this); |
---|
| 328 | + lookAtItem.addActionListener(this); |
---|
| 329 | + //lookFromItem.addActinoListener(this); |
---|
| 330 | + //switchViewItem.addActionListener(this); |
---|
| 331 | + } |
---|
| 332 | + |
---|
210 | 333 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 334 | if (Globals.ADVANCED) |
---|
212 | 335 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 336 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 337 | revertMeshItem.addActionListener(this); |
---|
219 | 338 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
253 | 372 | } |
---|
254 | 373 | |
---|
255 | 374 | oe.menuBar.add(menu = new Menu("Group")); |
---|
256 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
257 | | - grabItem.addActionListener(this); |
---|
| 375 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 376 | +// grabItem.addActionListener(this); |
---|
258 | 377 | backItem = menu.add(new MenuItem("Back")); |
---|
259 | 378 | backItem.addActionListener(this); |
---|
260 | 379 | frontItem = menu.add(new MenuItem("Front")); |
---|
261 | 380 | frontItem.addActionListener(this); |
---|
262 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
263 | | - compositeItem.addActionListener(this); |
---|
| 381 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 382 | +// compositeItem.addActionListener(this); |
---|
| 383 | + |
---|
| 384 | + if (Globals.ADVANCED) |
---|
| 385 | + { |
---|
264 | 386 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
265 | 387 | hideItem.addActionListener(this); |
---|
| 388 | + } |
---|
266 | 389 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
267 | 390 | ungroupItem.addActionListener(this); |
---|
268 | | - menu.add("-"); |
---|
269 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
270 | | - randomItem.addActionListener(this); |
---|
| 391 | + |
---|
| 392 | +// menu.add("-"); |
---|
| 393 | +// |
---|
| 394 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 395 | +// switchItem.addActionListener(this); |
---|
| 396 | + if (Globals.ADVANCED) |
---|
| 397 | + { |
---|
271 | 398 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
272 | 399 | switchGeoItem.addActionListener(this); |
---|
273 | 400 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
275 | 402 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
276 | 403 | morphItem.addActionListener(this); |
---|
277 | 404 | |
---|
278 | | - if (Globals.ADVANCED) |
---|
279 | | - { |
---|
280 | 405 | menu.add("-"); |
---|
281 | 406 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
282 | 407 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
284 | 409 | frameselectorItem.addActionListener(this); |
---|
285 | 410 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
286 | 411 | scriptNodeItem.addActionListener(this); |
---|
287 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
288 | | - cameraItem.addActionListener(this); |
---|
289 | 412 | } |
---|
290 | 413 | |
---|
291 | 414 | oe.menuBar.add(menu = new Menu("Object")); |
---|
292 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
293 | | - textureItem.addActionListener(this); |
---|
| 415 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 416 | +// textureItem.addActionListener(this); |
---|
294 | 417 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
295 | 418 | billboardItem.addActionListener(this); |
---|
296 | 419 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 420 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 421 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 422 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 423 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 424 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 425 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 426 | shadowZItem.addActionListener(this); |
---|
| 427 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 428 | + attributeItem.addActionListener(this); |
---|
| 429 | + |
---|
304 | 430 | if (Globals.ADVANCED) |
---|
305 | 431 | { |
---|
306 | 432 | menu.add("-"); |
---|
307 | 433 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
308 | 434 | linkerItem.addActionListener(this); |
---|
309 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
310 | | - attributeItem.addActionListener(this); |
---|
311 | 435 | templateItem = menu.add(new MenuItem("Template")); |
---|
312 | 436 | templateItem.addActionListener(this); |
---|
313 | 437 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
318 | 442 | resetTransformItem.addActionListener(this); |
---|
319 | 443 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 444 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 445 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 446 | + resetCentroidXZItem.addActionListener(this); |
---|
| 447 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 448 | + transformGeometryItem.addActionListener(this); |
---|
| 449 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 450 | + transformChildrenItem.addActionListener(this); |
---|
323 | 451 | |
---|
324 | 452 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 453 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
332 | 460 | genNormalsMESHItem.addActionListener(this); |
---|
333 | 461 | if (Globals.ADVANCED) |
---|
334 | 462 | { |
---|
335 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 463 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
336 | 464 | genNormalsMINEItem.addActionListener(this); |
---|
337 | 465 | } |
---|
338 | 466 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
368 | 496 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 497 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 498 | clearMaterialsItem.addActionListener(this); |
---|
| 499 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 500 | + resetAllItem.addActionListener(this); |
---|
| 501 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 502 | + stepAllItem.addActionListener(this); |
---|
371 | 503 | menu.add("-"); |
---|
372 | 504 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 505 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
388 | 520 | markleavesItem.addActionListener(this); |
---|
389 | 521 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 522 | unmarkleavesItem.addActionListener(this); |
---|
| 523 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 524 | + rewindleavesItem.addActionListener(this); |
---|
| 525 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 526 | + unrewindleavesItem.addActionListener(this); |
---|
| 527 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 528 | + randomleavesItem.addActionListener(this); |
---|
| 529 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 530 | + unrandomleavesItem.addActionListener(this); |
---|
391 | 531 | menu.add("-"); |
---|
392 | 532 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 533 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
413 | 553 | attachBumpItem.addActionListener(this); |
---|
414 | 554 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
415 | 555 | pigmentBumpItem.addActionListener(this); |
---|
| 556 | + //embedTexturesItem |
---|
416 | 557 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
417 | 558 | detachPigmentItem.addActionListener(this); |
---|
418 | 559 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
419 | 560 | detachBumpItem.addActionListener(this); |
---|
| 561 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 562 | + embedTexturesItem.addActionListener(this); |
---|
| 563 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 564 | + deEmbedTexturesItem.addActionListener(this); |
---|
420 | 565 | menu.add("-"); |
---|
421 | 566 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
422 | 567 | sortbysizeItem.addActionListener(this); |
---|
423 | 568 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 569 | sortbynameItem.addActionListener(this); |
---|
| 570 | + menu.add("-"); |
---|
| 571 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 572 | + shareGeometriesItem.addActionListener(this); |
---|
| 573 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 574 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 575 | if (Globals.ADVANCED) |
---|
426 | 576 | { |
---|
427 | | - menu.add("-"); |
---|
| 577 | + // Pretty much the same as duplicate and clone. |
---|
428 | 578 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 579 | extractGeometriesItem.addActionListener(this); |
---|
430 | 580 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 581 | cloneGeometriesItem.addActionListener(this); |
---|
432 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
433 | | - shareGeometriesItem.addActionListener(this); |
---|
434 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
435 | | - mergeGeometriesItem.addActionListener(this); |
---|
436 | 582 | } |
---|
437 | 583 | |
---|
438 | 584 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 585 | buildCreateMenu(menu); |
---|
440 | 586 | |
---|
441 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
442 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
443 | | - importOBJItem.addActionListener(this); |
---|
444 | | - menu.add("-"); |
---|
445 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
446 | | - import3DSItem.addActionListener(this); |
---|
447 | | - menu.add("-"); |
---|
448 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | | - importVRMLX3DItem.addActionListener(this); |
---|
450 | | - menu.add("-"); |
---|
451 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
452 | | - importGFDItem.addActionListener(this); |
---|
453 | | - |
---|
454 | 587 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 588 | buildToolsMenu(menu); |
---|
456 | 589 | } |
---|
457 | 590 | |
---|
| 591 | + |
---|
458 | 592 | void SetupUI2(ObjEditor oe) |
---|
459 | 593 | { |
---|
| 594 | + // June 2019 |
---|
| 595 | + if (oe == null) |
---|
| 596 | + { |
---|
| 597 | + //super.SetupUI2(this); |
---|
| 598 | + //return; |
---|
| 599 | + } |
---|
| 600 | + |
---|
| 601 | + if (copy != group) |
---|
| 602 | + { |
---|
| 603 | + //super.SetupUI2(this); |
---|
| 604 | + } |
---|
| 605 | + |
---|
460 | 606 | //new Exception().printStackTrace(); |
---|
461 | 607 | |
---|
462 | 608 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
485 | 631 | oe.radioPanel.add(dummyButton); |
---|
486 | 632 | oe.buttonGroup.add(dummyButton); |
---|
487 | 633 | */ |
---|
| 634 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 635 | + |
---|
| 636 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 637 | + |
---|
488 | 638 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 639 | |
---|
490 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 640 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 641 | + //minButton.setToolTipText("Minimize window"); |
---|
| 642 | + //minButton.addActionListener(this); |
---|
| 643 | + |
---|
| 644 | + if (Globals.ADVANCED) |
---|
| 645 | + { |
---|
| 646 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + maxButton.setToolTipText("Maximize window"); |
---|
| 648 | + maxButton.addActionListener(this); |
---|
| 649 | + } |
---|
| 650 | + |
---|
| 651 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 652 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 653 | + fullButton.addActionListener(this); |
---|
| 654 | + |
---|
| 655 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 657 | + screenfitButton.addActionListener(this); |
---|
| 658 | + |
---|
| 659 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 661 | + restoreCameraButton.addActionListener(this); |
---|
| 662 | + |
---|
| 663 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + saveButton.setToolTipText("New version"); |
---|
| 665 | + saveButton.addActionListener(this); |
---|
| 666 | + |
---|
| 667 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 668 | + undoButton.setToolTipText("Previous version"); |
---|
| 669 | + undoButton.addActionListener(this); |
---|
| 670 | + undoButton.setEnabled(false); |
---|
| 671 | + |
---|
| 672 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 673 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 674 | + restoreButton.setToolTipText("Restore current"); |
---|
| 675 | + restoreButton.addActionListener(this); |
---|
| 676 | + restoreButton.setEnabled(false); |
---|
| 677 | + |
---|
| 678 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + replaceButton.setToolTipText("Replace current"); |
---|
| 680 | + replaceButton.addActionListener(this); |
---|
| 681 | + replaceButton.setEnabled(false); |
---|
| 682 | + |
---|
| 683 | + copyOptionsPanel.add(updown); |
---|
| 684 | + |
---|
| 685 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 686 | + redoButton.setToolTipText("Next version"); |
---|
| 687 | + redoButton.addActionListener(this); |
---|
| 688 | + redoButton.setEnabled(false); |
---|
| 689 | + |
---|
| 690 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 691 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 692 | liveCB.addItemListener(this); |
---|
493 | 693 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 695 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 696 | oneStepButton.addActionListener(this); |
---|
497 | 697 | |
---|
498 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 698 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
499 | 699 | fastCB.setToolTipText("Fast mode"); |
---|
500 | 700 | fastCB.addItemListener(this); |
---|
501 | 701 | |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
503 | | - trackCB.setToolTipText("Enable tracking"); |
---|
504 | | - trackCB.addItemListener(this); |
---|
505 | | - |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
508 | | - screenfitButton.addActionListener(this); |
---|
| 702 | + //oe.toolboxPanel.Return(); |
---|
| 703 | + |
---|
| 704 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 705 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 706 | +// trackCB.addItemListener(this); |
---|
509 | 707 | |
---|
510 | 708 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
511 | 709 | // screenfitpointButton.addActionListener(this); |
---|
512 | 710 | |
---|
513 | 711 | if (Globals.ADVANCED) |
---|
514 | 712 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 714 | snapobjectButton.addActionListener(this); |
---|
517 | 715 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 716 | + |
---|
| 717 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 718 | + fourButton.addActionListener(this); |
---|
| 719 | + fourButton.setToolTipText("Show control panel only"); |
---|
518 | 720 | } |
---|
519 | 721 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | | - flashSelectionButton.addActionListener(this); |
---|
| 722 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
523 | 723 | |
---|
524 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | | - |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 724 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 725 | + twoButton.setToolTipText("Show 3D view only"); |
---|
528 | 726 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | | - fourButton.addActionListener(this); |
---|
531 | | - fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | | - sixButton.setToolTipText("2-column layout left"); |
---|
534 | | - sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 727 | + this.fullscreenLayout = twoButton; |
---|
| 728 | + |
---|
| 729 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
537 | 731 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | | - sevenButton.setToolTipText("3-column layout"); |
---|
540 | | - sevenButton.addActionListener(this); |
---|
| 732 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 734 | + sixButton.addActionListener(this); |
---|
| 735 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 737 | +// sevenButton.addActionListener(this); |
---|
541 | 738 | // |
---|
542 | 739 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 740 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 741 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
545 | 742 | rootButton.addActionListener(this); |
---|
546 | 743 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 745 | closeButton.setToolTipText("Close tab"); |
---|
549 | 746 | closeButton.addActionListener(this); |
---|
550 | 747 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
551 | 748 | //clearButton.addActionListener(this); |
---|
552 | | - |
---|
553 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 749 | + |
---|
| 750 | + cGridBag row1 = new cGridBag(); |
---|
554 | 751 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | | - editButton.setToolTipText("Edit selection"); |
---|
| 752 | + // INSERT |
---|
| 753 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 754 | + gridButton.setToolTipText("Create grid"); |
---|
| 755 | + gridButton.addActionListener(this); |
---|
| 756 | + |
---|
| 757 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 758 | + boxButton.setToolTipText("Create box"); |
---|
| 759 | + boxButton.addActionListener(this); |
---|
| 760 | + |
---|
| 761 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 762 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 763 | + sphereButton.addActionListener(this); |
---|
| 764 | + |
---|
| 765 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 766 | + coneButton.setToolTipText("Create cone"); |
---|
| 767 | + coneButton.addActionListener(this); |
---|
| 768 | + |
---|
| 769 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 770 | + torusButton.setToolTipText("Create torus"); |
---|
| 771 | + torusButton.addActionListener(this); |
---|
| 772 | + |
---|
| 773 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 774 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 775 | + superButton.addActionListener(this); |
---|
| 776 | + |
---|
| 777 | + if (Globals.ADVANCED) |
---|
| 778 | + { |
---|
| 779 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 781 | + kleinButton.addActionListener(this); |
---|
| 782 | + } |
---|
| 783 | + |
---|
| 784 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 786 | + particlesButton.addActionListener(this); |
---|
| 787 | + |
---|
| 788 | + oe.toolboxPanel.add(row1); |
---|
| 789 | + |
---|
| 790 | + cGridBag row2 = new cGridBag(); |
---|
| 791 | + |
---|
| 792 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 793 | + groupButton.setToolTipText("Create group"); |
---|
| 794 | + groupButton.addActionListener(this); |
---|
| 795 | + |
---|
| 796 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + compositeButton.setToolTipText("Create composite"); |
---|
| 798 | + compositeButton.addActionListener(this); |
---|
| 799 | + |
---|
| 800 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 802 | + switchButton.addActionListener(this); |
---|
| 803 | + |
---|
| 804 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + loopButton.setToolTipText("Create loop"); |
---|
| 806 | + loopButton.addActionListener(this); |
---|
| 807 | + |
---|
| 808 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + textureButton.setToolTipText("Create texture"); |
---|
| 810 | + textureButton.addActionListener(this); |
---|
| 811 | + |
---|
| 812 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 813 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 814 | + overlayButton.addActionListener(this); |
---|
| 815 | + |
---|
| 816 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + lightButton.setToolTipText("Create light"); |
---|
| 818 | + lightButton.addActionListener(this); |
---|
| 819 | + |
---|
| 820 | + oe.toolboxPanel.add(row2); |
---|
| 821 | + |
---|
| 822 | + // ENVYMAPS |
---|
| 823 | + cGridBag row3 = new cGridBag(); |
---|
| 824 | + row3.preferredHeight = 20; |
---|
| 825 | + |
---|
| 826 | + AddSkyboxButton("default", "rgb", row3); |
---|
| 827 | + AddSkyboxButton("default", "cornell", row3); |
---|
| 828 | + AddSkyboxButton("default", "uffizi", row3); |
---|
| 829 | + AddSkyboxButton("default", "CloudyHills", row3); |
---|
| 830 | + AddSkyboxButton("default", "skycube", row3); |
---|
| 831 | + |
---|
| 832 | + oe.toolboxPanel.add(row3); |
---|
| 833 | + |
---|
| 834 | + cGridBag row4 = new cGridBag(); |
---|
| 835 | + row4.preferredHeight = 20; |
---|
| 836 | + |
---|
| 837 | + AddSkyboxButton("bridge", "Bridge2", row4); |
---|
| 838 | + AddSkyboxButton("urban", "GamlaStan2", row4); |
---|
| 839 | + AddSkyboxButton("urban", "Parliament", row4); |
---|
| 840 | + AddSkyboxButton("urban", "Roundabout", row4); |
---|
| 841 | + |
---|
| 842 | + oe.toolboxPanel.add(row4); |
---|
| 843 | + |
---|
| 844 | + cGridBag row5 = new cGridBag(); |
---|
| 845 | + row5.preferredHeight = 20; |
---|
| 846 | + |
---|
| 847 | + AddSkyboxButton("urban", "SaintLazarusChurch", row5); |
---|
| 848 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row5); |
---|
| 849 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row5); |
---|
| 850 | + AddSkyboxButton("urban", "UnionSquare", row5); |
---|
| 851 | + |
---|
| 852 | + oe.toolboxPanel.add(row5); |
---|
| 853 | + |
---|
| 854 | + cGridBag row6 = new cGridBag(); |
---|
| 855 | + row6.preferredHeight = 20; |
---|
| 856 | + |
---|
| 857 | + AddSkyboxButton("park", "BerzeliiPark", row6); |
---|
| 858 | + AddSkyboxButton("park", "Buddha", row6); |
---|
| 859 | + AddSkyboxButton("park", "CNTower2", row6); |
---|
| 860 | + //AddSkyboxButton("park", "Fatbursparken", row6); |
---|
| 861 | + AddSkyboxButton("park", "NiagaraFalls1", row6); |
---|
| 862 | + |
---|
| 863 | + oe.toolboxPanel.add(row6); |
---|
| 864 | + |
---|
| 865 | + cGridBag row7 = new cGridBag(); |
---|
| 866 | + row7.preferredHeight = 20; |
---|
| 867 | + |
---|
| 868 | + AddSkyboxButton("park", "NiagaraFalls3", row7); |
---|
| 869 | + AddSkyboxButton("park", "Park", row7); |
---|
| 870 | + //AddSkyboxButton("park", "Park2", row6); |
---|
| 871 | + //AddSkyboxButton("park", "Path", row6); |
---|
| 872 | + AddSkyboxButton("park", "Pond", row7); |
---|
| 873 | + AddSkyboxButton("park", "Skansen", row7); |
---|
| 874 | + |
---|
| 875 | + oe.toolboxPanel.add(row7); |
---|
| 876 | + |
---|
| 877 | + cGridBag row8 = new cGridBag(); |
---|
| 878 | + row8.preferredHeight = 20; |
---|
| 879 | + |
---|
| 880 | + AddSkyboxButton("park", "Skansen2", row8); |
---|
| 881 | + AddSkyboxButton("park", "Skansen3", row8); |
---|
| 882 | + AddSkyboxButton("park", "Skansen4", row8); |
---|
| 883 | + AddSkyboxButton("park", "Skansen5", row8); |
---|
| 884 | + |
---|
| 885 | + oe.toolboxPanel.add(row8); |
---|
| 886 | + |
---|
| 887 | + cGridBag row9 = new cGridBag(); |
---|
| 888 | + row9.preferredHeight = 20; |
---|
| 889 | + |
---|
| 890 | + AddSkyboxButton("park", "Stairs", row9); |
---|
| 891 | + //AddSkyboxButton("park", "Tantolunden", row6); |
---|
| 892 | + //AddSkyboxButton("park", "Tantolunden3", row6); |
---|
| 893 | + AddSkyboxButton("park", "Tantolunden4", row9); |
---|
| 894 | + |
---|
| 895 | + oe.toolboxPanel.add(row9); |
---|
| 896 | +/* |
---|
| 897 | +BerzeliiPark |
---|
| 898 | +Buddha |
---|
| 899 | +CNTower2 |
---|
| 900 | +Fatbursparken |
---|
| 901 | +NiagaraFalls1 |
---|
| 902 | +NiagaraFalls3 |
---|
| 903 | +Park |
---|
| 904 | +Park2 |
---|
| 905 | +Path |
---|
| 906 | +Pond |
---|
| 907 | +Skansen |
---|
| 908 | +Skansen2 |
---|
| 909 | +Skansen3 |
---|
| 910 | +Skansen4 |
---|
| 911 | +Skansen5 |
---|
| 912 | +Stairs |
---|
| 913 | +Tantolunden |
---|
| 914 | +Tantolunden3 |
---|
| 915 | +Tantolunden4 |
---|
| 916 | + */ |
---|
| 917 | + |
---|
| 918 | + for (int i=1; --i>=0;) |
---|
| 919 | + { |
---|
| 920 | + //oe.toolboxPanel.Return(); |
---|
| 921 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 922 | + } |
---|
| 923 | + |
---|
| 924 | + // EDIT panel |
---|
| 925 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 926 | + editButton.setToolTipText("Pin selection controls"); |
---|
557 | 927 | editButton.addActionListener(this); |
---|
558 | 928 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 929 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 930 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
561 | 931 | uneditButton.addActionListener(this); |
---|
562 | 932 | |
---|
563 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
564 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 933 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 934 | + allParamsButton.setToolTipText("Show all controle"); |
---|
565 | 935 | allParamsButton.addActionListener(this); |
---|
566 | 936 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 937 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 938 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 939 | clearPanelButton.addActionListener(this); |
---|
570 | 940 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 941 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 942 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 943 | unselectButton.addActionListener(this); |
---|
574 | 944 | |
---|
575 | | - commandsPanel.preferredHeight = 1; |
---|
| 945 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 946 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 947 | + flashSelectionButton.addActionListener(this); |
---|
576 | 948 | |
---|
577 | | - oe.treePanel.add(commandsPanel); |
---|
578 | | - oe.treePanel.Return(); |
---|
| 949 | + editCommandsPanel.preferredHeight = 1; |
---|
| 950 | + |
---|
| 951 | + SetPinStates(false); |
---|
| 952 | +// oe.treePanel.add(commandsPanel); |
---|
| 953 | +// oe.treePanel.Return(); |
---|
579 | 954 | |
---|
580 | 955 | // oe.aConstraints.gridx += 1; |
---|
581 | 956 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
592 | 967 | |
---|
593 | 968 | JScrollPane jSP; |
---|
594 | 969 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
595 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 970 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
596 | 971 | ResetModel(); |
---|
597 | 972 | |
---|
598 | 973 | oe.treePanel.add(jSPPanel); |
---|
599 | 974 | oe.treePanel.Return(); |
---|
600 | 975 | |
---|
601 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
602 | | - |
---|
603 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
604 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
605 | | - colorCB.addItemListener(this); |
---|
606 | | - |
---|
607 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
608 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
609 | | - materialCB.addItemListener(this); |
---|
610 | | - |
---|
611 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
612 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
613 | | - textureCB.addItemListener(this); |
---|
614 | | - |
---|
615 | | - copyOptionsPanel.preferredHeight = 1; |
---|
616 | 976 | oe.treePanel.add(copyOptionsPanel); |
---|
617 | 977 | oe.treePanel.Return(); |
---|
| 978 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 979 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 980 | + sliderPane.preferredHeight = 1; |
---|
618 | 981 | |
---|
619 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
620 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 982 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 983 | + mainPanel.setResizeWeight(0.4); |
---|
621 | 984 | |
---|
622 | 985 | //jList.addListSelectionListener(this); |
---|
623 | 986 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
625 | 988 | //jTree.setEditable(true); |
---|
626 | 989 | oe.jTree.setDragEnabled(true); |
---|
627 | 990 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
628 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 991 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
629 | 992 | |
---|
630 | 993 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
631 | 994 | |
---|
.. | .. |
---|
637 | 1000 | dgr.addDragGestureListener(this); |
---|
638 | 1001 | }catch(Exception e) {} |
---|
639 | 1002 | */ |
---|
640 | | - radio.layout = sevenButton; |
---|
| 1003 | + radio.layout = sixButton; // sevenButton; |
---|
641 | 1004 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
642 | 1005 | } |
---|
643 | 1006 | |
---|
644 | 1007 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
645 | 1008 | { |
---|
| 1009 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1010 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1011 | + colorCB.addItemListener(this); |
---|
| 1012 | + |
---|
| 1013 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1014 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1015 | + materialCB.addItemListener(this); |
---|
| 1016 | + |
---|
| 1017 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1018 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1019 | + textureCB.addItemListener(this); |
---|
| 1020 | + |
---|
| 1021 | + panel.Return(); |
---|
| 1022 | + |
---|
646 | 1023 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
647 | 1024 | boxCB.setToolTipText("Display bounding boxes"); |
---|
648 | 1025 | boxCB.addItemListener(this); |
---|
649 | 1026 | |
---|
650 | 1027 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
651 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1028 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
652 | 1029 | zoomBoxCB.addItemListener(this); |
---|
653 | 1030 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 1031 | + if (true) // Globals.ADVANCED) |
---|
655 | 1032 | { |
---|
656 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | | - supportCB.setToolTipText("Enable rigging"); |
---|
658 | | - supportCB.addItemListener(this); |
---|
| 1033 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1034 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1035 | +// supportCB.addItemListener(this); |
---|
| 1036 | + |
---|
| 1037 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1038 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1039 | + freezeCB.addItemListener(this); |
---|
659 | 1040 | |
---|
660 | 1041 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
661 | 1042 | // localCB.addItemListener(this); |
---|
662 | 1043 | |
---|
| 1044 | + panel.Return(); |
---|
| 1045 | + |
---|
663 | 1046 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
664 | 1047 | crowdCB.setToolTipText("Used for crowds"); |
---|
665 | 1048 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
676 | 1059 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
677 | 1060 | // speakerMocapCB.addItemListener(this); |
---|
678 | 1061 | |
---|
| 1062 | + panel.Return(); |
---|
| 1063 | + |
---|
679 | 1064 | if (false) |
---|
680 | 1065 | { |
---|
681 | 1066 | // handled in scripts |
---|
.. | .. |
---|
690 | 1075 | //constraints.gridy += 1; |
---|
691 | 1076 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
692 | 1077 | smoothfocusCB.addItemListener(this); |
---|
| 1078 | + panel.Return(); |
---|
693 | 1079 | } |
---|
694 | 1080 | |
---|
695 | 1081 | //constraints.gridx += 1; |
---|
696 | 1082 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
697 | 1083 | // debugCB.addItemListener(this); |
---|
698 | 1084 | |
---|
| 1085 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1086 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1087 | + trackCB.addItemListener(this); |
---|
| 1088 | + |
---|
699 | 1089 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1090 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
700 | 1091 | oeilCB.addItemListener(this); |
---|
701 | 1092 | |
---|
| 1093 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1094 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1095 | + shadowCB.addItemListener(this); |
---|
| 1096 | + |
---|
| 1097 | + panel.Return(); |
---|
| 1098 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1099 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1100 | + toggleTextureCB.addItemListener(this); |
---|
| 1101 | + |
---|
| 1102 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1103 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1104 | + toggleSwitchCB.addItemListener(this); |
---|
| 1105 | + |
---|
| 1106 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1107 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1108 | + autokeepCB.addItemListener(this); |
---|
| 1109 | + |
---|
| 1110 | + panel.Return(); |
---|
| 1111 | + if (Globals.ADVANCED) |
---|
| 1112 | + { |
---|
702 | 1113 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
703 | 1114 | lookAtCB.setToolTipText("Look-at target"); |
---|
704 | 1115 | lookAtCB.addItemListener(this); |
---|
| 1116 | + } |
---|
705 | 1117 | |
---|
706 | 1118 | } |
---|
707 | 1119 | |
---|
708 | 1120 | cGridBag fill = new cGridBag(); |
---|
709 | | - |
---|
710 | 1121 | fill.preferredHeight = 200; |
---|
| 1122 | + cGridBag fill2 = new cGridBag(); |
---|
| 1123 | + fill2.preferredHeight = 200; |
---|
| 1124 | + cGridBag fill3 = new cGridBag(); |
---|
| 1125 | + fill3.preferredHeight = 200; |
---|
711 | 1126 | |
---|
712 | 1127 | panel.add(fill); |
---|
| 1128 | + panel.add(fill2); |
---|
| 1129 | + panel.add(fill3); |
---|
713 | 1130 | |
---|
714 | 1131 | } |
---|
715 | 1132 | |
---|
716 | 1133 | void EditObject(Object3D obj) |
---|
717 | 1134 | { |
---|
718 | 1135 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1136 | + |
---|
| 1137 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1138 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1139 | + if (!radioButton.hadMaterial) |
---|
| 1140 | + { |
---|
| 1141 | + obj.material = new cMaterial(); |
---|
| 1142 | + } |
---|
| 1143 | + |
---|
719 | 1144 | radioButton.SetObject(obj); |
---|
720 | | - radioButton.layout = sevenButton; |
---|
| 1145 | + radioButton.layout = sixButton; // sevenButton; |
---|
721 | 1146 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
722 | 1147 | radioButton.addActionListener(this); |
---|
723 | 1148 | radioPanel.add(radioButton); |
---|
724 | 1149 | buttonGroup.add(radioButton); |
---|
725 | 1150 | radioButton.doClick(); |
---|
726 | 1151 | } |
---|
| 1152 | + |
---|
727 | 1153 | void SetupViews(ObjEditor oe) |
---|
728 | 1154 | { |
---|
| 1155 | + theFrame = this; |
---|
| 1156 | + |
---|
729 | 1157 | oe.SetupViews(); |
---|
730 | 1158 | |
---|
731 | 1159 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
734 | 1162 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
735 | 1163 | } |
---|
736 | 1164 | |
---|
737 | | - JCheckBox liveCB; |
---|
738 | | - JCheckBox supportCB; |
---|
739 | | - JCheckBox localCB; |
---|
740 | | - JCheckBox crowdCB; |
---|
741 | | - JCheckBox smoothCB; |
---|
742 | | - JCheckBox fastCB; |
---|
743 | | - JCheckBox slowCB; |
---|
744 | | - JCheckBox boxCB; |
---|
745 | | - JCheckBox zoomBoxCB; |
---|
746 | | - JCheckBox trackCB; |
---|
747 | | - JCheckBox smoothfocusCB; |
---|
| 1165 | + cToggleButton liveCB; |
---|
| 1166 | + cCheckBox supportCB; |
---|
| 1167 | + cCheckBox localCB; |
---|
| 1168 | + cCheckBox crowdCB; |
---|
| 1169 | + cCheckBox smoothCB; |
---|
| 1170 | + cToggleButton fastCB; |
---|
| 1171 | + cCheckBox slowCB; |
---|
| 1172 | + cCheckBox boxCB; |
---|
| 1173 | + cCheckBox zoomBoxCB; |
---|
| 1174 | + cCheckBox freezeCB; |
---|
| 1175 | + //cToggleButton trackCB; |
---|
| 1176 | + cCheckBox trackCB; |
---|
| 1177 | + cCheckBox smoothfocusCB; |
---|
748 | 1178 | // JCheckBox speakerMocapCB; |
---|
749 | | - JCheckBox speakerCameraCB; |
---|
750 | | - JCheckBox speakerFocusCB; |
---|
751 | | - JCheckBox debugCB; |
---|
752 | | - JCheckBox oeilCB; |
---|
753 | | - JCheckBox lookAtCB; |
---|
| 1179 | + cCheckBox speakerCameraCB; |
---|
| 1180 | + cCheckBox speakerFocusCB; |
---|
| 1181 | + cCheckBox debugCB; |
---|
| 1182 | + |
---|
| 1183 | + cCheckBox oeilCB; |
---|
| 1184 | + cCheckBox shadowCB; |
---|
| 1185 | + cCheckBox autokeepCB; |
---|
| 1186 | + cCheckBox lookAtCB; |
---|
754 | 1187 | |
---|
755 | 1188 | // static int COLOR = 1; |
---|
756 | 1189 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
758 | 1191 | |
---|
759 | 1192 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
760 | 1193 | |
---|
761 | | - JCheckBox colorCB; |
---|
762 | | - JCheckBox materialCB; |
---|
763 | | - JCheckBox textureCB; |
---|
| 1194 | + cCheckBox colorCB; |
---|
| 1195 | + cCheckBox materialCB; |
---|
| 1196 | + cCheckBox textureCB; |
---|
764 | 1197 | |
---|
765 | 1198 | public void itemStateChanged(ItemEvent e) |
---|
766 | 1199 | { |
---|
.. | .. |
---|
788 | 1221 | } else if(e.getSource() == liveCB) |
---|
789 | 1222 | { |
---|
790 | 1223 | cameraView.ToggleLive(); |
---|
| 1224 | + refreshContents(false); |
---|
791 | 1225 | } |
---|
792 | 1226 | else if(e.getSource() == supportCB) |
---|
793 | 1227 | { |
---|
.. | .. |
---|
852 | 1286 | { |
---|
853 | 1287 | cameraView.ToggleOeil(); |
---|
854 | 1288 | } |
---|
| 1289 | + else if(e.getSource() == shadowCB) |
---|
| 1290 | + { |
---|
| 1291 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1292 | + } |
---|
| 1293 | + else if(e.getSource() == freezeCB) |
---|
| 1294 | + { |
---|
| 1295 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1296 | + } |
---|
| 1297 | + else if(e.getSource() == autokeepCB) |
---|
| 1298 | + { |
---|
| 1299 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1300 | + } |
---|
855 | 1301 | else if(e.getSource() == lookAtCB) |
---|
856 | 1302 | { |
---|
857 | 1303 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
868 | 1314 | |
---|
869 | 1315 | /**/ |
---|
870 | 1316 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
871 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1317 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1318 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
872 | 1319 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
873 | 1320 | // We can't move the root node or an empty selection |
---|
874 | 1321 | return; |
---|
.. | .. |
---|
931 | 1378 | } |
---|
932 | 1379 | } |
---|
933 | 1380 | |
---|
934 | | - String string = (String) object; |
---|
935 | | - |
---|
936 | 1381 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
937 | 1382 | // if( object instanceof java.io.File[]) |
---|
938 | 1383 | // { |
---|
.. | .. |
---|
940 | 1385 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
941 | 1386 | // return; |
---|
942 | 1387 | // } |
---|
943 | | - if (string.charAt(0) == '/') |
---|
| 1388 | + |
---|
| 1389 | + String string = object.toString(); |
---|
| 1390 | + |
---|
| 1391 | + // File path for Mac and Windows |
---|
| 1392 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
944 | 1393 | { |
---|
945 | 1394 | // file(s) |
---|
946 | 1395 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
967 | 1416 | |
---|
968 | 1417 | flashIt = false; |
---|
969 | 1418 | CameraPane pane = (CameraPane) target; |
---|
970 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1419 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
971 | 1420 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
972 | 1421 | |
---|
973 | 1422 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
983 | 1432 | |
---|
984 | 1433 | assert target == objEditor.jTree; |
---|
985 | 1434 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1435 | + Object3D destinationLeaf; |
---|
986 | 1436 | try { |
---|
987 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1437 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
988 | 1438 | } catch (Exception e) { |
---|
989 | 1439 | System.out.println("destinationPath : " + destinationPath); |
---|
990 | 1440 | return; |
---|
991 | 1441 | } |
---|
992 | 1442 | |
---|
993 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1443 | + for (int i=group.selection.size(); --i>=0;) |
---|
994 | 1444 | { |
---|
| 1445 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1446 | + |
---|
| 1447 | + // Cannot move into itself |
---|
| 1448 | + if (child == destinationLeaf) |
---|
| 1449 | + return; |
---|
| 1450 | + } |
---|
| 1451 | + |
---|
| 1452 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1453 | +// { |
---|
995 | 1454 | loadClipboard(true); |
---|
996 | 1455 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
997 | 1456 | pasteInto(false, false); |
---|
998 | | - } else { |
---|
999 | | - loadClipboard(false); |
---|
1000 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1001 | | - pasteInto(false, false); // true); // ??? |
---|
1002 | | - } |
---|
| 1457 | +// } else { |
---|
| 1458 | +// loadClipboard(false); |
---|
| 1459 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1460 | +// pasteInto(false, false); // true); // ??? |
---|
| 1461 | +// } |
---|
1003 | 1462 | } |
---|
1004 | 1463 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1005 | 1464 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1104 | 1563 | { |
---|
1105 | 1564 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1106 | 1565 | //heightFieldItem.addActionListener(this); |
---|
1107 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1108 | | - gridItem.addActionListener(this); |
---|
1109 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1110 | | - rectoidItem.addActionListener(this); |
---|
1111 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1112 | | - ellipsoidItem.addActionListener(this); |
---|
1113 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1114 | | - coneItem.addActionListener(this); |
---|
1115 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1116 | | - torusItem.addActionListener(this); |
---|
1117 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1118 | | - superItem.addActionListener(this); |
---|
| 1566 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1567 | +// gridItem.addActionListener(this); |
---|
| 1568 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1569 | +// rectoidItem.addActionListener(this); |
---|
| 1570 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1571 | +// ellipsoidItem.addActionListener(this); |
---|
| 1572 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1573 | +// coneItem.addActionListener(this); |
---|
| 1574 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1575 | +// torusItem.addActionListener(this); |
---|
| 1576 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1577 | +// superItem.addActionListener(this); |
---|
| 1578 | + |
---|
| 1579 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1580 | + cameraItem.addActionListener(this); |
---|
| 1581 | + |
---|
| 1582 | + if (!Globals.ADVANCED) |
---|
| 1583 | + { |
---|
1119 | 1584 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1120 | 1585 | kleinItem.addActionListener(this); |
---|
1121 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1122 | | - particleItem.addActionListener(this); |
---|
| 1586 | + } |
---|
| 1587 | + |
---|
| 1588 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1589 | +// particleItem.addActionListener(this); |
---|
1123 | 1590 | if (Globals.ADVANCED) |
---|
1124 | 1591 | { |
---|
1125 | 1592 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1145 | 1612 | } |
---|
1146 | 1613 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1147 | 1614 | bezierItem.addActionListener(this); |
---|
1148 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1149 | | - overlayItem.addActionListener(this); |
---|
1150 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1151 | | - lightItem.addActionListener(this); |
---|
| 1615 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1616 | +// overlayItem.addActionListener(this); |
---|
| 1617 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1618 | +// lightItem.addActionListener(this); |
---|
1152 | 1619 | menu.add("-"); |
---|
1153 | 1620 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1154 | 1621 | //superLoopItem.addActionListener(this); |
---|
1155 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1156 | | - loopItem.addActionListener(this); |
---|
| 1622 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1623 | +// loopItem.addActionListener(this); |
---|
1157 | 1624 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1158 | 1625 | doubleItem.addActionListener(this); |
---|
1159 | 1626 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1169 | 1636 | animationItem.addItemListener(this); |
---|
1170 | 1637 | animationItem.setState(Globals.ANIMATION); |
---|
1171 | 1638 | |
---|
| 1639 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1640 | + archiveItem.addActionListener(this); |
---|
| 1641 | + |
---|
1172 | 1642 | menu.add("-"); |
---|
1173 | 1643 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1174 | 1644 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1181 | 1651 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1182 | 1652 | reduce34MorphItem.addActionListener(this); |
---|
1183 | 1653 | menu.add("-"); |
---|
| 1654 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1655 | + memoryItem.addActionListener(this); |
---|
1184 | 1656 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1185 | 1657 | computeAOItem.addActionListener(this); |
---|
1186 | 1658 | |
---|
.. | .. |
---|
1189 | 1661 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1190 | 1662 | mirrorItem.addActionListener(this); |
---|
1191 | 1663 | menu.add("-"); |
---|
1192 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1193 | | - memoryItem.addActionListener(this); |
---|
1194 | 1664 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1195 | 1665 | analyzeItem.addActionListener(this); |
---|
1196 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1666 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1197 | 1667 | dumpItem.addActionListener(this); |
---|
1198 | 1668 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1199 | 1669 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1334 | 1804 | shadow.material = new cMaterial(obj.material); |
---|
1335 | 1805 | shadow.material.diffuse = 0.0001f; |
---|
1336 | 1806 | shadow.material.specular = 0.0001f; |
---|
| 1807 | + //shadow.projectedVertices[1].x = 300; |
---|
1337 | 1808 | |
---|
1338 | 1809 | makeSomething(shadow); |
---|
1339 | 1810 | } |
---|
| 1811 | + |
---|
| 1812 | + private void ClearUnpinned() |
---|
| 1813 | + { |
---|
| 1814 | + //for (Object3D obj : listUI) |
---|
| 1815 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1816 | + { |
---|
| 1817 | + Object3D obj = listUI.elementAt(i); |
---|
| 1818 | + if (!obj.pinned) |
---|
| 1819 | + { |
---|
| 1820 | + obj.CloseUI(); |
---|
| 1821 | + listUI.remove(i); |
---|
| 1822 | + } |
---|
| 1823 | + } |
---|
| 1824 | + } |
---|
| 1825 | + |
---|
| 1826 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1827 | + { |
---|
| 1828 | + // if (!(elem instanceof Composite)) |
---|
| 1829 | + // newWindow = false; |
---|
| 1830 | + listUI.add(elem); |
---|
| 1831 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1832 | + System.out.println("edit : " + elem); |
---|
| 1833 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1834 | + } |
---|
1340 | 1835 | |
---|
1341 | 1836 | /** |
---|
1342 | 1837 | * applyExample |
---|
.. | .. |
---|
1540 | 2035 | |
---|
1541 | 2036 | void Overwrite(int mask) |
---|
1542 | 2037 | { |
---|
1543 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2038 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1544 | 2039 | { |
---|
1545 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2040 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1546 | 2041 | |
---|
1547 | 2042 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1548 | 2043 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1581 | 2076 | { |
---|
1582 | 2077 | ScreenFit(); |
---|
1583 | 2078 | } else |
---|
1584 | | - if (source == switchItem) |
---|
| 2079 | + if (source == switchViewItem) |
---|
1585 | 2080 | { |
---|
1586 | 2081 | cVector v1 = new cVector(); |
---|
1587 | 2082 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1590 | 2085 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1591 | 2086 | objEditor.cameraView.repaint(); |
---|
1592 | 2087 | } else |
---|
1593 | | - if (source == rectoidItem) |
---|
| 2088 | + if (source == rectoidItem || source == boxButton) |
---|
1594 | 2089 | { |
---|
1595 | 2090 | makeSomething(new Box()); |
---|
1596 | 2091 | } else |
---|
1597 | | - if (source == particleItem) |
---|
| 2092 | + if (source == particleItem || source == particlesButton) |
---|
1598 | 2093 | { |
---|
1599 | 2094 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1600 | 2095 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1673 | 2168 | |
---|
1674 | 2169 | makeSomething(obj); |
---|
1675 | 2170 | } else |
---|
1676 | | - if (source == gridItem) |
---|
| 2171 | + if (source == gridItem || source == gridButton) |
---|
1677 | 2172 | { |
---|
1678 | 2173 | makeSomething(new Grid()); |
---|
1679 | 2174 | } else |
---|
1680 | | - if (source == ellipsoidItem) |
---|
| 2175 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1681 | 2176 | { |
---|
1682 | 2177 | makeSomething(new Sphere()); |
---|
1683 | 2178 | } else |
---|
1684 | | - if (source == coneItem) |
---|
| 2179 | + if (source == coneItem || source == coneButton) |
---|
1685 | 2180 | { |
---|
1686 | 2181 | makeSomething(new Cone()); |
---|
1687 | 2182 | } else |
---|
1688 | | - if (source == torusItem) |
---|
| 2183 | + if (source == torusItem || source == torusButton) |
---|
1689 | 2184 | { |
---|
1690 | 2185 | makeSomething(new Torus()); |
---|
1691 | 2186 | } else |
---|
1692 | | - if (source == superItem) |
---|
| 2187 | + if (source == superItem || source == superButton) |
---|
1693 | 2188 | { |
---|
1694 | 2189 | makeSomething(new Superellipsoid()); |
---|
1695 | 2190 | } else |
---|
1696 | | - if (source == kleinItem) |
---|
| 2191 | + if (source == kleinItem || source == kleinButton) |
---|
1697 | 2192 | { |
---|
1698 | 2193 | makeSomething(new Klein()); |
---|
1699 | 2194 | } else |
---|
.. | .. |
---|
1713 | 2208 | { |
---|
1714 | 2209 | makeSomething(new BezierSurface()); |
---|
1715 | 2210 | } else |
---|
1716 | | - if (source == overlayItem) |
---|
| 2211 | + if (source == overlayItem || source == overlayButton) |
---|
1717 | 2212 | { |
---|
1718 | 2213 | /* |
---|
1719 | 2214 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1761 | 2256 | s.setup(); |
---|
1762 | 2257 | makeSomething(s); |
---|
1763 | 2258 | } else |
---|
1764 | | - if (source == lightItem) |
---|
| 2259 | + if (source == lightItem || source == lightButton) |
---|
1765 | 2260 | { |
---|
1766 | 2261 | makeSomething(new Light()); |
---|
1767 | 2262 | } else |
---|
| 2263 | +// if (source == skybox1Button || |
---|
| 2264 | +// source == skybox2Button || |
---|
| 2265 | +// source == skybox3Button || |
---|
| 2266 | +// source == skybox4Button || |
---|
| 2267 | +// source == skybox5Button || |
---|
| 2268 | +// source == skybox6Button || |
---|
| 2269 | +// source == skybox7Button || |
---|
| 2270 | +// source == skybox11Button || |
---|
| 2271 | +// source == skybox12Button || |
---|
| 2272 | +// source == skybox13Button || |
---|
| 2273 | +// source == skybox14Button || |
---|
| 2274 | +// source == skybox15Button || |
---|
| 2275 | +// source == skybox16Button || |
---|
| 2276 | +// source == skybox17Button) |
---|
| 2277 | +// { |
---|
| 2278 | +// ChangeSkybox(source); |
---|
| 2279 | +// } else |
---|
1768 | 2280 | if (source == csgItem) |
---|
1769 | 2281 | { |
---|
1770 | 2282 | group(new CSG()); |
---|
.. | .. |
---|
1811 | 2323 | |
---|
1812 | 2324 | group(g); |
---|
1813 | 2325 | } else |
---|
1814 | | - if (source == loopItem) |
---|
| 2326 | + if (source == loopItem || source == loopButton) |
---|
1815 | 2327 | { |
---|
1816 | 2328 | Composite csg = new GroupLeaf(); |
---|
1817 | 2329 | csg.count = 5; |
---|
1818 | 2330 | group(csg); |
---|
1819 | | - Composite child = new cGroup(); |
---|
| 2331 | + Composite child = new cGroup("Branch"); |
---|
1820 | 2332 | csg.addChild(child); |
---|
1821 | 2333 | child.addChild(csg); |
---|
1822 | 2334 | } else |
---|
1823 | 2335 | if (source == doubleItem) |
---|
1824 | 2336 | { |
---|
1825 | | - Composite csg = new GroupLeaf(); |
---|
| 2337 | + Composite csg = new GroupLeaf("Fork"); |
---|
1826 | 2338 | csg.count = 5; |
---|
1827 | 2339 | group(csg); |
---|
1828 | | - Composite child = new cGroup(); |
---|
| 2340 | + Composite child = new cGroup("Branch A"); |
---|
1829 | 2341 | csg.addChild(child); |
---|
1830 | 2342 | child.addChild(csg); |
---|
1831 | | - child = new cGroup(); |
---|
| 2343 | + child = new cGroup("Branch B"); |
---|
1832 | 2344 | csg.addChild(child); |
---|
1833 | 2345 | child.addChild(csg); |
---|
1834 | 2346 | } else |
---|
1835 | 2347 | if (source == tripleItem) |
---|
1836 | 2348 | { |
---|
1837 | | - Composite csg = new GroupLeaf(); |
---|
| 2349 | + Composite csg = new GroupLeaf("Trident"); |
---|
1838 | 2350 | csg.count = 4; |
---|
1839 | 2351 | group(csg); |
---|
1840 | 2352 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1847 | 2359 | csg.addChild(child); |
---|
1848 | 2360 | child.addChild(csg); |
---|
1849 | 2361 | } else |
---|
1850 | | - |
---|
1851 | | - if (source == importGFDItem) |
---|
1852 | | - { |
---|
1853 | | - ImportGFD(); |
---|
1854 | | - } else |
---|
1855 | | - if (source == importVRMLX3DItem) |
---|
1856 | | - { |
---|
1857 | | - ImportVRMLX3D(); |
---|
1858 | | - } else |
---|
1859 | | - if (source == import3DSItem) |
---|
1860 | | - { |
---|
1861 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1862 | | - } else |
---|
1863 | | - if (source == importOBJItem) |
---|
1864 | | - { |
---|
1865 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1866 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1867 | | - browser.setVisible(true); |
---|
1868 | | - String filename = browser.getFile(); |
---|
1869 | | - if (filename != null && filename.length() > 0) |
---|
1870 | | - { |
---|
1871 | | - String fullname = browser.getDirectory() + filename; |
---|
1872 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1873 | | - } |
---|
1874 | | - } else |
---|
1875 | 2362 | if (source == computeAOItem) |
---|
1876 | 2363 | { |
---|
1877 | 2364 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1878 | | - Globals.theRenderer.repaint(); |
---|
| 2365 | + cameraView.repaint(); |
---|
1879 | 2366 | } else |
---|
1880 | 2367 | if (source == recompileItem) |
---|
1881 | 2368 | { |
---|
.. | .. |
---|
1890 | 2377 | if (source == invariantsItem) |
---|
1891 | 2378 | { |
---|
1892 | 2379 | System.out.println("Invariants:"); |
---|
1893 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2380 | + Grafreed.grafreeD.universe.invariants(); |
---|
1894 | 2381 | } else |
---|
1895 | 2382 | if (source == memoryItem) |
---|
1896 | 2383 | { |
---|
.. | .. |
---|
1909 | 2396 | { |
---|
1910 | 2397 | DumpObject(); |
---|
1911 | 2398 | } else |
---|
| 2399 | + if (source == minButton) |
---|
| 2400 | + { |
---|
| 2401 | + Minimize(); |
---|
| 2402 | + } else |
---|
| 2403 | + if (source == maxButton) |
---|
| 2404 | + { |
---|
| 2405 | + Maximize(); |
---|
| 2406 | + } else |
---|
| 2407 | + if (source == fullButton) |
---|
| 2408 | + { |
---|
| 2409 | + ToggleFullScreen(); |
---|
| 2410 | + } else |
---|
| 2411 | + if (source == undoButton) |
---|
| 2412 | + { |
---|
| 2413 | + // Go to previous version |
---|
| 2414 | + //if (!Undo()) |
---|
| 2415 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2416 | + Undo(); |
---|
| 2417 | + } else |
---|
| 2418 | + if (source == restoreButton) |
---|
| 2419 | + { |
---|
| 2420 | + // Restore current version |
---|
| 2421 | + Restore(); |
---|
| 2422 | + } else |
---|
| 2423 | + if (source == replaceButton) |
---|
| 2424 | + { |
---|
| 2425 | + // Overwrite current version |
---|
| 2426 | + Replace(); |
---|
| 2427 | + } else |
---|
| 2428 | + if (source == redoButton) |
---|
| 2429 | + { |
---|
| 2430 | + // Go to next version |
---|
| 2431 | + Redo(); |
---|
| 2432 | + } else |
---|
| 2433 | + if (source == saveButton) |
---|
| 2434 | + { |
---|
| 2435 | + // Save a new version |
---|
| 2436 | + if (!Save(true)) |
---|
| 2437 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2438 | + } else |
---|
1912 | 2439 | if (source == oneStepButton) |
---|
1913 | 2440 | { |
---|
1914 | 2441 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1916 | 2443 | } else |
---|
1917 | 2444 | if (source == screenfitButton) |
---|
1918 | 2445 | { |
---|
1919 | | - //Reload(lastConverter, lastFilename, true); |
---|
1920 | 2446 | ScreenFit(); |
---|
1921 | 2447 | } else |
---|
1922 | 2448 | if (source == screenfitpointButton) |
---|
1923 | 2449 | { |
---|
1924 | | - //Reload(lastConverter, lastFilename, true); |
---|
1925 | 2450 | ScreenFitPoint(); |
---|
1926 | 2451 | } else |
---|
1927 | 2452 | if (source == snapobjectButton) |
---|
1928 | 2453 | { |
---|
1929 | | - //Reload(lastConverter, lastFilename, true); |
---|
1930 | 2454 | SnapObject(); |
---|
1931 | 2455 | } else |
---|
1932 | 2456 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1963 | 2487 | { |
---|
1964 | 2488 | loadClipboard(true); |
---|
1965 | 2489 | } else |
---|
| 2490 | + if (source == undoItem) |
---|
| 2491 | + { |
---|
| 2492 | + Undo(); |
---|
| 2493 | + } else |
---|
| 2494 | + if (source == redoItem) |
---|
| 2495 | + { |
---|
| 2496 | + Redo(); |
---|
| 2497 | + } else |
---|
1966 | 2498 | if (source == duplicateItem) |
---|
1967 | 2499 | { |
---|
1968 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2500 | + Object3D keep = Grafreed.clipboard; |
---|
1969 | 2501 | loadClipboard(false); |
---|
1970 | 2502 | paste(false); |
---|
1971 | | - GrafreeD.clipboard = keep; |
---|
| 2503 | + Grafreed.clipboard = keep; |
---|
1972 | 2504 | } else |
---|
1973 | 2505 | if (source == cloneItem) |
---|
1974 | 2506 | { |
---|
.. | .. |
---|
2188 | 2720 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2189 | 2721 | // refreshContents(); |
---|
2190 | 2722 | // } |
---|
2191 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2723 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2192 | 2724 | { |
---|
2193 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2725 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2194 | 2726 | |
---|
2195 | 2727 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2196 | 2728 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2240 | 2772 | } else |
---|
2241 | 2773 | if (source == setMasterItem) |
---|
2242 | 2774 | { |
---|
2243 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2775 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2244 | 2776 | { |
---|
2245 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2777 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2246 | 2778 | |
---|
2247 | 2779 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2248 | 2780 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2255 | 2787 | { |
---|
2256 | 2788 | if (group.selection.size() == 1) |
---|
2257 | 2789 | { |
---|
2258 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2790 | + if (Grafreed.clipboard.size() == 1) |
---|
2259 | 2791 | { |
---|
2260 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2792 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2261 | 2793 | |
---|
2262 | 2794 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2263 | 2795 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2274 | 2806 | { |
---|
2275 | 2807 | RevertMeshes(); |
---|
2276 | 2808 | } else |
---|
2277 | | - if (source == resetMeshItem) |
---|
| 2809 | + if (source == resetAllItem) |
---|
2278 | 2810 | { |
---|
2279 | 2811 | ResetAll(); |
---|
2280 | 2812 | } else |
---|
.. | .. |
---|
2282 | 2814 | { |
---|
2283 | 2815 | StepAll(); |
---|
2284 | 2816 | } else |
---|
2285 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2817 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2286 | 2818 | { |
---|
2287 | 2819 | //int indices[] = jList.getSelectedIndices(); |
---|
2288 | 2820 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2294 | 2826 | { |
---|
2295 | 2827 | ClearSelection(true); |
---|
2296 | 2828 | } else |
---|
2297 | | - if (source == grabItem) |
---|
| 2829 | + if (source == grabItem || source == groupButton) |
---|
2298 | 2830 | { |
---|
2299 | | - group(new cGroup(), true); |
---|
| 2831 | + group(new cGroup(), false); // true); |
---|
2300 | 2832 | } else |
---|
2301 | 2833 | if (source == hideItem) |
---|
2302 | 2834 | { |
---|
.. | .. |
---|
2314 | 2846 | { |
---|
2315 | 2847 | makeSomething(new Camera()); |
---|
2316 | 2848 | } else |
---|
2317 | | - if (source == compositeItem) |
---|
| 2849 | + if (source == compositeItem || source == compositeButton) |
---|
2318 | 2850 | { |
---|
2319 | 2851 | group(new Composite()); |
---|
2320 | 2852 | } else |
---|
2321 | | - if (source == randomItem) |
---|
| 2853 | + if (source == switchItem || source == switchButton) |
---|
2322 | 2854 | { |
---|
2323 | 2855 | RandomNode random = new RandomNode(); |
---|
2324 | 2856 | group(random); |
---|
.. | .. |
---|
2420 | 2952 | { |
---|
2421 | 2953 | group(new cLinker()); |
---|
2422 | 2954 | } else |
---|
2423 | | - if (source == textureItem) |
---|
| 2955 | + if (source == textureItem || source == textureButton) |
---|
2424 | 2956 | { |
---|
2425 | 2957 | group(new TextureNode()); |
---|
2426 | 2958 | } else |
---|
.. | .. |
---|
2440 | 2972 | { |
---|
2441 | 2973 | CastShadow(2); |
---|
2442 | 2974 | } else |
---|
2443 | | - if (source == ungroupItem) |
---|
| 2975 | + if (source == ungroupItem || source == ungroupButton) |
---|
2444 | 2976 | { |
---|
2445 | | - //ungroup(); |
---|
| 2977 | + boolean hasRoot = false; |
---|
| 2978 | + |
---|
2446 | 2979 | for (int i=0; i<group.selection.size(); i++) |
---|
2447 | 2980 | { |
---|
2448 | | - Ungroup(group.selection.get(i)); |
---|
| 2981 | + if (group.selection.get(i) == group) |
---|
| 2982 | + { |
---|
| 2983 | + hasRoot = true; |
---|
| 2984 | + break; |
---|
| 2985 | + } |
---|
2449 | 2986 | } |
---|
2450 | 2987 | |
---|
2451 | | - ClearSelection(false); |
---|
2452 | | - |
---|
2453 | | - refreshContents(); |
---|
| 2988 | + if (!hasRoot) |
---|
| 2989 | + { |
---|
| 2990 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2991 | + { |
---|
| 2992 | + Ungroup(group.selection.get(i)); |
---|
| 2993 | + } |
---|
| 2994 | + |
---|
| 2995 | + ClearSelection(false); |
---|
| 2996 | + |
---|
| 2997 | + refreshContents(); |
---|
| 2998 | + } |
---|
2454 | 2999 | } else |
---|
2455 | 3000 | if (source == genUVItem) |
---|
2456 | 3001 | { |
---|
.. | .. |
---|
2462 | 3007 | } else |
---|
2463 | 3008 | if (source == genNormalsMESHItem) |
---|
2464 | 3009 | { |
---|
2465 | | - GenNormals(true); // TODO |
---|
| 3010 | + GenNormalsMESH(); |
---|
2466 | 3011 | } else |
---|
2467 | 3012 | if (source == genNormalsORGANItem) |
---|
2468 | 3013 | { |
---|
.. | .. |
---|
2527 | 3072 | if (source == unmarkleavesItem) |
---|
2528 | 3073 | { |
---|
2529 | 3074 | MarkLeaves(false); |
---|
| 3075 | + } else |
---|
| 3076 | + if (source == rewindleavesItem) |
---|
| 3077 | + { |
---|
| 3078 | + RewindLeaves(true); |
---|
| 3079 | + } else |
---|
| 3080 | + if (source == unrewindleavesItem) |
---|
| 3081 | + { |
---|
| 3082 | + RewindLeaves(false); |
---|
| 3083 | + } else |
---|
| 3084 | + if (source == randomleavesItem) |
---|
| 3085 | + { |
---|
| 3086 | + RandomLeaves(true); |
---|
| 3087 | + } else |
---|
| 3088 | + if (source == unrandomleavesItem) |
---|
| 3089 | + { |
---|
| 3090 | + RandomLeaves(false); |
---|
2530 | 3091 | } else |
---|
2531 | 3092 | if (source == flipVItem) |
---|
2532 | 3093 | { |
---|
.. | .. |
---|
2612 | 3173 | { |
---|
2613 | 3174 | SmoothMesh(); |
---|
2614 | 3175 | } else |
---|
2615 | | - if (source == transformgeometryItem) |
---|
| 3176 | + if (source == transformGeometryItem) |
---|
2616 | 3177 | { |
---|
2617 | 3178 | TransformGeometry(); |
---|
| 3179 | + } else |
---|
| 3180 | + if (source == transformChildrenItem) |
---|
| 3181 | + { |
---|
| 3182 | + TransformChildren(); |
---|
2618 | 3183 | } else |
---|
2619 | 3184 | if (source == resetTransformItem) |
---|
2620 | 3185 | { |
---|
.. | .. |
---|
2622 | 3187 | } else |
---|
2623 | 3188 | if (source == resetCentroidItem) |
---|
2624 | 3189 | { |
---|
2625 | | - ResetCentroid(); |
---|
| 3190 | + ResetCentroid(true); |
---|
| 3191 | + } else |
---|
| 3192 | + if (source == resetCentroidXZItem) |
---|
| 3193 | + { |
---|
| 3194 | + ResetCentroid(false); |
---|
2626 | 3195 | } else |
---|
2627 | 3196 | if (source == resetParentItem) |
---|
2628 | 3197 | { |
---|
.. | .. |
---|
2727 | 3296 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2728 | 3297 | { |
---|
2729 | 3298 | obj = (Object3D)e.nextElement(); |
---|
2730 | | - obj.SetBumpTexture(null); |
---|
| 3299 | + obj.ResetBumpTexture(); |
---|
2731 | 3300 | } |
---|
2732 | 3301 | |
---|
2733 | 3302 | refreshContents(); |
---|
.. | .. |
---|
2743 | 3312 | |
---|
2744 | 3313 | refreshContents(); |
---|
2745 | 3314 | } else |
---|
| 3315 | + if (source == embedTexturesItem) |
---|
| 3316 | + { |
---|
| 3317 | + Object3D obj; |
---|
| 3318 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3319 | + { |
---|
| 3320 | + obj = (Object3D)e.nextElement(); |
---|
| 3321 | + obj.EmbedTextures(true); |
---|
| 3322 | + } |
---|
| 3323 | + |
---|
| 3324 | + refreshContents(); |
---|
| 3325 | + } else |
---|
| 3326 | + if (source == deEmbedTexturesItem) |
---|
| 3327 | + { |
---|
| 3328 | + Object3D obj; |
---|
| 3329 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3330 | + { |
---|
| 3331 | + obj = (Object3D)e.nextElement(); |
---|
| 3332 | + obj.EmbedTextures(false); |
---|
| 3333 | + } |
---|
| 3334 | + |
---|
| 3335 | + CameraPane.texturepigment.clear(); |
---|
| 3336 | + CameraPane.texturebump.clear(); |
---|
| 3337 | + |
---|
| 3338 | + refreshContents(); |
---|
| 3339 | + } else |
---|
2746 | 3340 | if (source == flashSelectionButton) |
---|
2747 | 3341 | { |
---|
2748 | 3342 | CameraPane.flash = true; |
---|
.. | .. |
---|
2754 | 3348 | if (source == twoButton) |
---|
2755 | 3349 | { |
---|
2756 | 3350 | radio.layout = twoButton; |
---|
| 3351 | + |
---|
| 3352 | + if (CameraPane.FULLSCREEN) |
---|
| 3353 | + fullscreenLayout = radio.layout; |
---|
| 3354 | + |
---|
2757 | 3355 | // bug |
---|
2758 | 3356 | //gridPanel.setDividerLocation(1.0); |
---|
2759 | 3357 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2786 | 3384 | bigThree.ClearUI(); |
---|
2787 | 3385 | bigThree.add(centralPanel); |
---|
2788 | 3386 | bigThree.FlushUI(); |
---|
| 3387 | + |
---|
| 3388 | + cameraView.requestFocusInWindow(); |
---|
| 3389 | + |
---|
| 3390 | +// refreshContents(true); |
---|
| 3391 | +// |
---|
| 3392 | +// try |
---|
| 3393 | +// { |
---|
| 3394 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3395 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3396 | +// bot.mouseMove(100, 100); |
---|
| 3397 | +// bot.mousePress(mask); |
---|
| 3398 | +// bot.mouseRelease(mask); |
---|
| 3399 | +// } |
---|
| 3400 | +// catch (Exception e) |
---|
| 3401 | +// { |
---|
| 3402 | +// |
---|
| 3403 | +// } |
---|
| 3404 | + |
---|
2789 | 3405 | } else |
---|
2790 | 3406 | if (source == threeButton) |
---|
2791 | 3407 | { |
---|
2792 | 3408 | radio.layout = threeButton; |
---|
| 3409 | + |
---|
| 3410 | + if (CameraPane.FULLSCREEN) |
---|
| 3411 | + fullscreenLayout = radio.layout; |
---|
2793 | 3412 | |
---|
2794 | 3413 | // bigThree.remove(scenePanel); |
---|
2795 | 3414 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2819 | 3438 | // centralPanel.setVisible(true); |
---|
2820 | 3439 | // XYZPanel.setVisible(true); |
---|
2821 | 3440 | bigThree.ClearUI(); |
---|
| 3441 | + bigThree.add(scenePanel); |
---|
2822 | 3442 | bigThree.add(centralPanel); |
---|
2823 | | - bigThree.add(XYZPanel); |
---|
2824 | 3443 | bigThree.FlushUI(); |
---|
| 3444 | + |
---|
| 3445 | + cameraView.requestFocusInWindow(); |
---|
2825 | 3446 | } else |
---|
2826 | 3447 | if (source == fourButton) |
---|
2827 | 3448 | { |
---|
2828 | 3449 | radio.layout = fourButton; |
---|
| 3450 | + |
---|
| 3451 | + if (CameraPane.FULLSCREEN) |
---|
| 3452 | + fullscreenLayout = radio.layout; |
---|
2829 | 3453 | |
---|
2830 | 3454 | // bigThree.remove(scenePanel); |
---|
2831 | 3455 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2857 | 3481 | bigThree.ClearUI(); |
---|
2858 | 3482 | bigThree.add(scenePanel); |
---|
2859 | 3483 | bigThree.FlushUI(); |
---|
| 3484 | + |
---|
| 3485 | + cameraView.requestFocusInWindow(); |
---|
2860 | 3486 | } else |
---|
2861 | 3487 | if (source == sixButton) |
---|
2862 | 3488 | { |
---|
2863 | 3489 | radio.layout = sixButton; |
---|
| 3490 | + |
---|
| 3491 | + if (CameraPane.FULLSCREEN) |
---|
| 3492 | + fullscreenLayout = radio.layout; |
---|
2864 | 3493 | |
---|
2865 | 3494 | // bigThree.remove(scenePanel); |
---|
2866 | 3495 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2890 | 3519 | // centralPanel.setVisible(true); |
---|
2891 | 3520 | // XYZPanel.setVisible(false); |
---|
2892 | 3521 | bigThree.ClearUI(); |
---|
2893 | | - bigThree.add(scenePanel); |
---|
2894 | 3522 | bigThree.add(centralPanel); |
---|
| 3523 | + bigThree.add(scenePanel); |
---|
2895 | 3524 | bigThree.FlushUI(); |
---|
| 3525 | + |
---|
| 3526 | + cameraView.requestFocusInWindow(); |
---|
2896 | 3527 | } else |
---|
2897 | 3528 | if (source == sevenButton) |
---|
2898 | 3529 | { |
---|
2899 | 3530 | radio.layout = sevenButton; |
---|
| 3531 | + |
---|
| 3532 | + if (CameraPane.FULLSCREEN) |
---|
| 3533 | + fullscreenLayout = radio.layout; |
---|
2900 | 3534 | |
---|
2901 | 3535 | // bigThree.remove(scenePanel); |
---|
2902 | 3536 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2930 | 3564 | bigThree.add(centralPanel); |
---|
2931 | 3565 | bigThree.add(XYZPanel); |
---|
2932 | 3566 | bigThree.FlushUI(); |
---|
| 3567 | + |
---|
| 3568 | + cameraView.requestFocusInWindow(); |
---|
2933 | 3569 | } else |
---|
2934 | 3570 | if (source == rootButton) |
---|
2935 | 3571 | { |
---|
.. | .. |
---|
2941 | 3577 | EditObject(obj); |
---|
2942 | 3578 | } |
---|
2943 | 3579 | |
---|
| 3580 | + cameraView.requestFocusInWindow(); |
---|
2944 | 3581 | refreshContents(true); |
---|
2945 | 3582 | } else |
---|
2946 | 3583 | if (source == closeButton) |
---|
.. | .. |
---|
2950 | 3587 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2951 | 3588 | { |
---|
2952 | 3589 | ab = (cRadio)e.nextElement(); |
---|
2953 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3590 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2954 | 3591 | { |
---|
| 3592 | + // Patch to avoid bug with transparency. |
---|
| 3593 | + if (!ab.hadMaterial) |
---|
| 3594 | + { |
---|
| 3595 | + ab.object.material = null; |
---|
| 3596 | + } |
---|
| 3597 | + |
---|
2955 | 3598 | buttonGroup.remove(ab); |
---|
2956 | 3599 | radioPanel.remove(ab); |
---|
2957 | 3600 | |
---|
2958 | | - ab.GetObject().editWindow = null; |
---|
| 3601 | + //ab.GetObject().editWindow = null; |
---|
| 3602 | + ab.GetObject().manipWindow = null; |
---|
2959 | 3603 | // ab.GetObject().objectUI = null; // ????????? |
---|
2960 | 3604 | |
---|
2961 | 3605 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2962 | 3606 | break; |
---|
2963 | 3607 | } |
---|
2964 | 3608 | } |
---|
| 3609 | + |
---|
| 3610 | + cameraView.requestFocusInWindow(); |
---|
2965 | 3611 | refreshContents(true); |
---|
2966 | 3612 | } else |
---|
2967 | 3613 | if (source == editItem || source == editButton) |
---|
2968 | 3614 | { |
---|
| 3615 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3616 | + { |
---|
| 3617 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3618 | + child.pinned = true; |
---|
| 3619 | + } |
---|
| 3620 | + |
---|
2969 | 3621 | EditSelection(false); |
---|
2970 | 3622 | } else |
---|
2971 | 3623 | if (source == uneditButton) |
---|
.. | .. |
---|
2975 | 3627 | Object3D child = (Object3D)e.nextElement(); |
---|
2976 | 3628 | if(child.editWindow != null) |
---|
2977 | 3629 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3630 | + child.pinned = false; |
---|
2978 | 3631 | child.CloseUI(); |
---|
2979 | 3632 | listUI.remove(child); |
---|
2980 | 3633 | |
---|
2981 | | - child.editWindow = null; // ??????????? |
---|
| 3634 | + //child.editWindow = null; // ??????????? |
---|
2982 | 3635 | } |
---|
2983 | 3636 | objEditor.ctrlPanel.FlushUI(); |
---|
2984 | 3637 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
2991 | 3644 | //copy.ClearUI(); |
---|
2992 | 3645 | for (Object3D obj : listUI) |
---|
2993 | 3646 | { |
---|
| 3647 | + obj.pinned = false; |
---|
2994 | 3648 | obj.CloseUI(); |
---|
2995 | 3649 | } |
---|
2996 | 3650 | listUI.clear(); |
---|
.. | .. |
---|
3000 | 3654 | { |
---|
3001 | 3655 | assert(copy == group); |
---|
3002 | 3656 | |
---|
3003 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3657 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3004 | 3658 | |
---|
3005 | 3659 | for (Object3D obj : listUI) |
---|
3006 | 3660 | { |
---|
.. | .. |
---|
3049 | 3703 | } |
---|
3050 | 3704 | |
---|
3051 | 3705 | copy = group; |
---|
| 3706 | + |
---|
| 3707 | + SetUndoStates(); |
---|
| 3708 | + |
---|
3052 | 3709 | //Globals.theRenderer.object = group; |
---|
3053 | 3710 | if(!useclient) |
---|
3054 | 3711 | { |
---|
.. | .. |
---|
3064 | 3721 | frontView.object = group; |
---|
3065 | 3722 | sideView.object = group; |
---|
3066 | 3723 | } |
---|
3067 | | - group.editWindow = this; |
---|
| 3724 | + |
---|
| 3725 | +// fix "+" issue |
---|
| 3726 | + //group.editWindow = this; |
---|
| 3727 | + group.manipWindow = this; |
---|
| 3728 | + |
---|
3068 | 3729 | /* |
---|
3069 | 3730 | currentLayout = radio.layout; |
---|
3070 | 3731 | if (currentLayout == null) |
---|
3071 | 3732 | currentLayout = sevenButton; |
---|
3072 | 3733 | */ |
---|
3073 | 3734 | radio.layout.doClick(); |
---|
| 3735 | + |
---|
| 3736 | + ClearUnpinned(); |
---|
| 3737 | + //Grafreed.Assert(group != null); |
---|
| 3738 | + //Grafreed.Assert(group.selection != null); |
---|
| 3739 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3740 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3741 | + EditSelection(false); |
---|
3074 | 3742 | keepparent = group.parent; |
---|
3075 | 3743 | // PARENT = NULL or not??? |
---|
3076 | 3744 | //group.parent = null; // ROOT |
---|
3077 | 3745 | //group.attributes = -1; |
---|
3078 | 3746 | ResetModel(); |
---|
| 3747 | + |
---|
| 3748 | + cameraView.requestFocusInWindow(); |
---|
3079 | 3749 | refreshContents(true); |
---|
3080 | | - } |
---|
| 3750 | + } else if (event.getSource() == editCameraItem) |
---|
| 3751 | + { |
---|
| 3752 | + cameraView.ProtectCamera(); |
---|
| 3753 | + cameraView.repaint(); |
---|
| 3754 | + return; |
---|
| 3755 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3756 | + { |
---|
| 3757 | + cameraView.RevertCamera(); |
---|
| 3758 | + cameraView.repaint(); |
---|
| 3759 | + return; |
---|
| 3760 | + // } else if (event.getSource() == textureButton) |
---|
| 3761 | + // { |
---|
| 3762 | + // return; // true; |
---|
| 3763 | + } |
---|
3081 | 3764 | else |
---|
3082 | 3765 | { |
---|
3083 | 3766 | //return super.action(event, arg); |
---|
.. | .. |
---|
3086 | 3769 | } |
---|
3087 | 3770 | |
---|
3088 | 3771 | boolean useclient = false; |
---|
3089 | | - cRadio radio; |
---|
3090 | 3772 | |
---|
3091 | 3773 | void ToggleRoot() |
---|
3092 | 3774 | { |
---|
.. | .. |
---|
3138 | 3820 | refreshContents(); |
---|
3139 | 3821 | } |
---|
3140 | 3822 | |
---|
| 3823 | + void TransformChildren() |
---|
| 3824 | + { |
---|
| 3825 | + Object3D obj; |
---|
| 3826 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3827 | + { |
---|
| 3828 | + obj = (Object3D)e.nextElement(); |
---|
| 3829 | + obj.KeepTextureMatrices(); |
---|
| 3830 | + obj.TransformChildren(); |
---|
| 3831 | + obj.RestoreTextureMatrices(); |
---|
| 3832 | + |
---|
| 3833 | +// if (obj.parent == null) |
---|
| 3834 | +// { |
---|
| 3835 | +// System.out.println("NULL PARENT!"); |
---|
| 3836 | +// new Exception().printStackTrace(); |
---|
| 3837 | +// } |
---|
| 3838 | +// else |
---|
| 3839 | +// TouchTransform(obj); |
---|
| 3840 | +// //obj.parent.Touch(); |
---|
| 3841 | + } |
---|
| 3842 | + |
---|
| 3843 | + refreshContents(); |
---|
| 3844 | + } |
---|
3141 | 3845 | |
---|
3142 | 3846 | void ResetTransform() |
---|
3143 | 3847 | { |
---|
.. | .. |
---|
3250 | 3954 | refreshContents(); |
---|
3251 | 3955 | } |
---|
3252 | 3956 | |
---|
3253 | | - void ResetCentroid() |
---|
| 3957 | + void ResetCentroid(boolean full) |
---|
3254 | 3958 | { |
---|
3255 | 3959 | Object3D obj; |
---|
3256 | 3960 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3265 | 3969 | LA.matIdentity(Object3D.mat); |
---|
3266 | 3970 | obj.getBounds(minima, maxima, false); |
---|
3267 | 3971 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3268 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3972 | + if (full) |
---|
| 3973 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3269 | 3974 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3270 | 3975 | obj.TransformMesh(Object3D.mat); |
---|
| 3976 | + |
---|
3271 | 3977 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3272 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3978 | + if (full) |
---|
| 3979 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3273 | 3980 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3981 | + |
---|
3274 | 3982 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3275 | 3983 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3276 | 3984 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3299 | 4007 | |
---|
3300 | 4008 | int size = obj.MemorySize(); |
---|
3301 | 4009 | |
---|
3302 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4010 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4011 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3303 | 4012 | } |
---|
3304 | 4013 | } |
---|
3305 | 4014 | catch (Exception e) |
---|
.. | .. |
---|
3336 | 4045 | obj = (Object3D)e.nextElement(); |
---|
3337 | 4046 | |
---|
3338 | 4047 | System.out.println("Object is: " + obj); |
---|
3339 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 4048 | + Grafreed.AnalyzeObject(obj); |
---|
3340 | 4049 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 4050 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3342 | 4051 | |
---|
3343 | 4052 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3344 | 4053 | } |
---|
.. | .. |
---|
3380 | 4089 | void GenNormals(boolean crease) |
---|
3381 | 4090 | { |
---|
3382 | 4091 | group.GenNormalsS(crease); |
---|
| 4092 | + |
---|
| 4093 | + refreshContents(); |
---|
| 4094 | + } |
---|
| 4095 | + |
---|
| 4096 | + void GenNormalsMESH() |
---|
| 4097 | + { |
---|
| 4098 | + group.GenNormalsMeshS(); |
---|
3383 | 4099 | |
---|
3384 | 4100 | refreshContents(); |
---|
3385 | 4101 | } |
---|
.. | .. |
---|
3552 | 4268 | |
---|
3553 | 4269 | void ParseVertices() |
---|
3554 | 4270 | { |
---|
3555 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3556 | | - GrafreeD.epsequal = true; |
---|
| 4271 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4272 | + Grafreed.epsequal = true; |
---|
3557 | 4273 | |
---|
3558 | 4274 | for (int i=0; i<group.selection.size(); i++) |
---|
3559 | 4275 | { |
---|
.. | .. |
---|
3578 | 4294 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3579 | 4295 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3580 | 4296 | |
---|
3581 | | - g.add(GrafreeD.clipboard); |
---|
| 4297 | + g.add(Grafreed.clipboard); |
---|
3582 | 4298 | |
---|
3583 | 4299 | buffer.add(g); |
---|
3584 | 4300 | } |
---|
.. | .. |
---|
3593 | 4309 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3594 | 4310 | } |
---|
3595 | 4311 | |
---|
3596 | | - GrafreeD.epsequal = epsequal; |
---|
| 4312 | + Grafreed.epsequal = epsequal; |
---|
3597 | 4313 | |
---|
3598 | 4314 | refreshContents(); |
---|
3599 | 4315 | } |
---|
.. | .. |
---|
3611 | 4327 | String pigment = Object3D.GetPigment(tex); |
---|
3612 | 4328 | //String bump = Object3D.GetBump(tex); |
---|
3613 | 4329 | |
---|
3614 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4330 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4331 | + |
---|
| 4332 | + try |
---|
| 4333 | + { |
---|
| 4334 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4335 | + } |
---|
| 4336 | + catch (Exception e) |
---|
| 4337 | + { |
---|
| 4338 | + System.err.println("FAIL: " + node); |
---|
| 4339 | + } |
---|
3615 | 4340 | |
---|
3616 | 4341 | double s = v.s; |
---|
3617 | 4342 | |
---|
.. | .. |
---|
3743 | 4468 | return; |
---|
3744 | 4469 | |
---|
3745 | 4470 | Object3D poses = group.selection.get(0); |
---|
3746 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4471 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3747 | 4472 | |
---|
3748 | 4473 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3749 | 4474 | |
---|
.. | .. |
---|
3937 | 4662 | |
---|
3938 | 4663 | void ClipMesh() |
---|
3939 | 4664 | { |
---|
3940 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4665 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3941 | 4666 | { |
---|
3942 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4667 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3943 | 4668 | |
---|
3944 | 4669 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3945 | 4670 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3948 | 4673 | // { |
---|
3949 | 4674 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3950 | 4675 | // } |
---|
3951 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4676 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3952 | 4677 | } |
---|
3953 | 4678 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3954 | 4679 | System.out.println("DONE."); |
---|
.. | .. |
---|
3995 | 4720 | void MarkLeaves(boolean hide) |
---|
3996 | 4721 | { |
---|
3997 | 4722 | group.selection.MarkLeaves(hide); |
---|
| 4723 | + refreshContents(); |
---|
| 4724 | + } |
---|
| 4725 | + |
---|
| 4726 | + void RewindLeaves(boolean hide) |
---|
| 4727 | + { |
---|
| 4728 | + group.selection.RewindLeaves(hide); |
---|
| 4729 | + refreshContents(); |
---|
| 4730 | + } |
---|
| 4731 | + |
---|
| 4732 | + void RandomLeaves(boolean hide) |
---|
| 4733 | + { |
---|
| 4734 | + group.selection.RandomLeaves(hide); |
---|
3998 | 4735 | refreshContents(); |
---|
3999 | 4736 | } |
---|
4000 | 4737 | |
---|
.. | .. |
---|
4069 | 4806 | // } |
---|
4070 | 4807 | // } |
---|
4071 | 4808 | |
---|
4072 | | - static boolean allparams = true; |
---|
4073 | | - |
---|
4074 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4075 | | - |
---|
4076 | 4809 | void EditSelection(boolean newWindow) |
---|
4077 | 4810 | { |
---|
| 4811 | + if (group.selection == null) |
---|
| 4812 | + { |
---|
| 4813 | + EditElement(group, newWindow); // ? new |
---|
| 4814 | + return; |
---|
| 4815 | + } |
---|
| 4816 | + |
---|
4078 | 4817 | // aConstraints.gridy = 0; |
---|
4079 | 4818 | for (int i=0; i<group.selection.size(); i++) |
---|
4080 | 4819 | { |
---|
4081 | 4820 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4082 | 4821 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4083 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4822 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4084 | 4823 | |
---|
4085 | 4824 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4086 | | - if(elem != group) |
---|
| 4825 | + if(elem != group || !newWindow) |
---|
4087 | 4826 | { |
---|
4088 | | - // if (!(elem instanceof Composite)) |
---|
4089 | | - // newWindow = false; |
---|
4090 | | - listUI.add(elem); |
---|
4091 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4092 | | - System.out.println("edit : " + elem); |
---|
4093 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4827 | + EditElement(elem, newWindow); // ? new |
---|
4094 | 4828 | } |
---|
4095 | 4829 | } |
---|
4096 | 4830 | } |
---|
.. | .. |
---|
4165 | 4899 | //new Exception().printStackTrace(); |
---|
4166 | 4900 | |
---|
4167 | 4901 | freezemodel = true; |
---|
4168 | | - |
---|
| 4902 | + ClearUnpinned(); |
---|
| 4903 | + |
---|
4169 | 4904 | /**/ |
---|
4170 | 4905 | //switch (event.id) |
---|
4171 | 4906 | { |
---|
.. | .. |
---|
4173 | 4908 | //case 702: // Event.LIST_DESELECT |
---|
4174 | 4909 | group.deselectAll(); |
---|
4175 | 4910 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4176 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4177 | 4911 | if (tps != null) |
---|
4178 | 4912 | { |
---|
4179 | 4913 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4182 | 4916 | |
---|
4183 | 4917 | //if (child.parent != null) |
---|
4184 | 4918 | //child.parent.addSelectee(child); |
---|
| 4919 | + objEditor.SetMaterial(child); |
---|
4185 | 4920 | group.addSelectee(child); |
---|
4186 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4187 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4188 | | - System.err.println("info : " + child.GetPath()); |
---|
4189 | 4921 | } |
---|
4190 | 4922 | } |
---|
4191 | 4923 | // else |
---|
.. | .. |
---|
4195 | 4927 | // System.err.println("info : " + group.GetPath()); |
---|
4196 | 4928 | // } |
---|
4197 | 4929 | |
---|
4198 | | - objEditor.SetText(); // jan 2014 |
---|
4199 | | - |
---|
4200 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4930 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4201 | 4931 | CameraPane.flash = true; |
---|
4202 | 4932 | |
---|
4203 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4933 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4204 | 4934 | // a camera |
---|
4205 | 4935 | { |
---|
4206 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4207 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4936 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4937 | + { |
---|
| 4938 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4939 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4940 | + } |
---|
4208 | 4941 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4209 | 4942 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4210 | 4943 | } |
---|
4211 | 4944 | |
---|
| 4945 | + if (tps != null && tps.length == 1) |
---|
| 4946 | + { |
---|
| 4947 | + EditSelection(false); |
---|
| 4948 | + } |
---|
| 4949 | + |
---|
| 4950 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4951 | + |
---|
4212 | 4952 | refreshContents(); |
---|
4213 | 4953 | //return true; |
---|
4214 | 4954 | } |
---|
.. | .. |
---|
4217 | 4957 | |
---|
4218 | 4958 | freezemodel = false; |
---|
4219 | 4959 | } |
---|
| 4960 | + |
---|
| 4961 | + void SetPinStates(boolean enabled) |
---|
| 4962 | + { |
---|
| 4963 | + editButton.setEnabled(enabled); |
---|
| 4964 | + uneditButton.setEnabled(enabled); |
---|
| 4965 | + unselectButton.setEnabled(enabled); |
---|
| 4966 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4967 | + } |
---|
| 4968 | + |
---|
| 4969 | + void refreshContents(boolean cp) |
---|
| 4970 | + { |
---|
| 4971 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4972 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4973 | + { |
---|
| 4974 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4975 | + |
---|
| 4976 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4977 | + { |
---|
| 4978 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4979 | + |
---|
| 4980 | + objEditor.AddInfo(child, this, true); |
---|
| 4981 | + System.err.println("info : " + child.GetPath()); |
---|
| 4982 | + } |
---|
| 4983 | + |
---|
| 4984 | + objEditor.SetText(); // jan 2014 |
---|
| 4985 | + } |
---|
| 4986 | + |
---|
| 4987 | + super.refreshContents(cp); |
---|
| 4988 | + } |
---|
4220 | 4989 | |
---|
4221 | 4990 | void linkSomething(Object3D thing) |
---|
4222 | 4991 | { |
---|
.. | .. |
---|
4288 | 5057 | { |
---|
4289 | 5058 | if (group.selection.isEmpty()) |
---|
4290 | 5059 | return; |
---|
4291 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 5060 | + |
---|
| 5061 | + Grafreed.clipboardIsTempGroup = false; |
---|
4292 | 5062 | Composite tGroup = null; |
---|
4293 | 5063 | if (group.selection.size() > 0) // 1) |
---|
4294 | 5064 | { |
---|
4295 | 5065 | tGroup = new cGroup(); |
---|
4296 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 5066 | + Grafreed.clipboardIsTempGroup = true; |
---|
4297 | 5067 | } |
---|
4298 | 5068 | |
---|
4299 | 5069 | if (cut) |
---|
4300 | 5070 | { |
---|
| 5071 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5072 | +// Save(); |
---|
4301 | 5073 | //int indices[] = jList.getSelectedIndices(); |
---|
4302 | 5074 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4303 | 5075 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4333 | 5105 | //System.out.println("cut " + child); |
---|
4334 | 5106 | //System.out.println("parent = " + child.parent); |
---|
4335 | 5107 | // tmp.addChild(child); |
---|
4336 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5108 | + if (Grafreed.clipboardIsTempGroup) |
---|
4337 | 5109 | tGroup.add/*Child*/(tmp); |
---|
4338 | 5110 | else |
---|
4339 | | - GrafreeD.clipboard = tmp; |
---|
| 5111 | + Grafreed.clipboard = tmp; |
---|
4340 | 5112 | } |
---|
4341 | 5113 | else |
---|
4342 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5114 | + if (Grafreed.clipboardIsTempGroup) |
---|
4343 | 5115 | tGroup.add/*Child*/(child); |
---|
4344 | 5116 | else |
---|
4345 | | - GrafreeD.clipboard = child; |
---|
| 5117 | + Grafreed.clipboard = child; |
---|
4346 | 5118 | } |
---|
4347 | 5119 | |
---|
4348 | 5120 | //ResetModel(); |
---|
.. | .. |
---|
4374 | 5146 | //System.out.println("cut " + elem); |
---|
4375 | 5147 | //System.out.println("parent = " + elem.parent); |
---|
4376 | 5148 | // tmp.addChild(elem); |
---|
4377 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5149 | + if (Grafreed.clipboardIsTempGroup) |
---|
4378 | 5150 | tGroup.add/*Child*/(tmp); |
---|
4379 | 5151 | else |
---|
4380 | | - GrafreeD.clipboard = tmp; |
---|
| 5152 | + Grafreed.clipboard = tmp; |
---|
4381 | 5153 | } |
---|
4382 | 5154 | else |
---|
4383 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5155 | + if (Grafreed.clipboardIsTempGroup) |
---|
4384 | 5156 | tGroup.add/*Child*/(child); |
---|
4385 | 5157 | else |
---|
4386 | | - GrafreeD.clipboard = child; |
---|
| 5158 | + Grafreed.clipboard = child; |
---|
4387 | 5159 | } |
---|
4388 | 5160 | |
---|
4389 | 5161 | } |
---|
4390 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4391 | | - GrafreeD.clipboard = tGroup; |
---|
| 5162 | + |
---|
| 5163 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 5164 | + Grafreed.clipboard = tGroup; |
---|
| 5165 | + |
---|
4392 | 5166 | if (cut) |
---|
4393 | 5167 | { |
---|
4394 | 5168 | ResetModel(); |
---|
.. | .. |
---|
4398 | 5172 | |
---|
4399 | 5173 | void paste(boolean expand) |
---|
4400 | 5174 | { |
---|
| 5175 | + if (Globals.REPLACEONMAKE) |
---|
| 5176 | + Save(); |
---|
| 5177 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5178 | + Globals.REPLACEONMAKE = false; |
---|
4401 | 5179 | // if (GrafreeD.clipboard == null) |
---|
4402 | 5180 | // return; |
---|
4403 | 5181 | boolean first = true; |
---|
4404 | 5182 | |
---|
4405 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5183 | + if (Grafreed.clipboardIsTempGroup) |
---|
4406 | 5184 | { |
---|
4407 | 5185 | Composite temp; |
---|
4408 | 5186 | |
---|
.. | .. |
---|
4413 | 5191 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4414 | 5192 | */ |
---|
4415 | 5193 | Object3D elem; |
---|
4416 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5194 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4417 | 5195 | { |
---|
4418 | 5196 | Object3D child = (Object3D)e.nextElement(); |
---|
4419 | 5197 | |
---|
.. | .. |
---|
4447 | 5225 | //Object3D cb = Applet3D.clipboard; |
---|
4448 | 5226 | //temp.addChild(cb); |
---|
4449 | 5227 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4450 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4451 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4452 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4453 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4454 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5228 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5229 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5230 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5231 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5232 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4455 | 5233 | else |
---|
4456 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4457 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5234 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5235 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4458 | 5236 | } |
---|
4459 | 5237 | |
---|
| 5238 | + Globals.REPLACEONMAKE = keep; |
---|
4460 | 5239 | ResetModel(); |
---|
4461 | 5240 | refreshContents(); |
---|
4462 | 5241 | } |
---|
.. | .. |
---|
4503 | 5282 | { |
---|
4504 | 5283 | boolean first = true; |
---|
4505 | 5284 | |
---|
4506 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5285 | + if (Grafreed.clipboardIsTempGroup) |
---|
4507 | 5286 | { |
---|
4508 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5287 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4509 | 5288 | Object3D copy; |
---|
4510 | 5289 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4511 | 5290 | { |
---|
.. | .. |
---|
4515 | 5294 | } |
---|
4516 | 5295 | } else |
---|
4517 | 5296 | { |
---|
4518 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5297 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4519 | 5298 | } |
---|
4520 | 5299 | } |
---|
4521 | 5300 | } |
---|
.. | .. |
---|
4592 | 5371 | |
---|
4593 | 5372 | void group(Object3D csg, boolean grab) |
---|
4594 | 5373 | { |
---|
| 5374 | + if (Globals.REPLACEONMAKE) |
---|
| 5375 | + Save(); |
---|
| 5376 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5377 | + Globals.REPLACEONMAKE = false; |
---|
4595 | 5378 | if (//false) // why?? |
---|
4596 | 5379 | !group.selection.isEmpty()) |
---|
4597 | 5380 | { |
---|
.. | .. |
---|
4705 | 5488 | //node.add(csg); |
---|
4706 | 5489 | //makeSomething(node); |
---|
4707 | 5490 | makeSomething(csg); |
---|
| 5491 | + Globals.REPLACEONMAKE = keep; |
---|
4708 | 5492 | } |
---|
4709 | 5493 | |
---|
4710 | 5494 | void Ungroup(Object3D g) |
---|
4711 | 5495 | { |
---|
| 5496 | + if (Globals.REPLACEONMAKE) |
---|
| 5497 | + Save(); |
---|
| 5498 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5499 | + Globals.REPLACEONMAKE = false; |
---|
4712 | 5500 | if (g instanceof HiddenObject) |
---|
4713 | 5501 | { |
---|
4714 | 5502 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4725 | 5513 | objEditor.makeSomething(g.get(i), false); |
---|
4726 | 5514 | } |
---|
4727 | 5515 | } |
---|
| 5516 | + Globals.REPLACEONMAKE = keep; |
---|
4728 | 5517 | } |
---|
4729 | 5518 | |
---|
4730 | 5519 | void ungroup() |
---|
.. | .. |
---|
4920 | 5709 | } |
---|
4921 | 5710 | */ |
---|
4922 | 5711 | |
---|
4923 | | - void ImportGFD() |
---|
4924 | | - { |
---|
4925 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4926 | | - browser.show(); |
---|
4927 | | - String filename = browser.getFile(); |
---|
4928 | | - if (filename != null && filename.length() > 0) |
---|
4929 | | - { |
---|
4930 | | - String fullname = browser.getDirectory() + filename; |
---|
4931 | | - |
---|
4932 | | - //Object3D readobj = |
---|
4933 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4934 | | - //makeSomething(readobj); |
---|
4935 | | - } |
---|
4936 | | - } |
---|
4937 | | - |
---|
4938 | 5712 | /* |
---|
4939 | 5713 | public void Callback(Object obj) |
---|
4940 | 5714 | { |
---|
.. | .. |
---|
4958 | 5732 | } |
---|
4959 | 5733 | */ |
---|
4960 | 5734 | |
---|
4961 | | - void ImportVRMLX3D() |
---|
4962 | | - { |
---|
4963 | | - if (GrafreeD.standAlone) |
---|
4964 | | - { |
---|
4965 | | - /**/ |
---|
4966 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4967 | | - browser.show(); |
---|
4968 | | - String filename = browser.getFile(); |
---|
4969 | | - if (filename != null && filename.length() > 0) |
---|
4970 | | - { |
---|
4971 | | - String fullname = browser.getDirectory() + filename; |
---|
4972 | | - LoadVRMLX3D(fullname); |
---|
4973 | | - } |
---|
4974 | | - /**/ |
---|
4975 | | - } |
---|
4976 | | - } |
---|
4977 | | - |
---|
4978 | 5735 | String GetFile(String dialogName) |
---|
4979 | 5736 | { |
---|
4980 | | - if (GrafreeD.standAlone) |
---|
| 5737 | + if (Grafreed.standAlone) |
---|
4981 | 5738 | { |
---|
4982 | 5739 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4983 | 5740 | browser.show(); |
---|
.. | .. |
---|
5045 | 5802 | cButton clearpanelButton; |
---|
5046 | 5803 | cButton unselectButton; |
---|
5047 | 5804 | |
---|
| 5805 | + cButton restoreCameraButton; |
---|
| 5806 | + |
---|
| 5807 | + cButton saveButton; |
---|
5048 | 5808 | cButton oneStepButton; |
---|
| 5809 | + |
---|
| 5810 | + cButton groupButton; |
---|
| 5811 | + cButton ungroupButton; |
---|
| 5812 | + cButton compositeButton; |
---|
| 5813 | + cButton switchButton; |
---|
| 5814 | + cButton loopButton; |
---|
| 5815 | + cButton textureButton; |
---|
| 5816 | + |
---|
| 5817 | + cButton skybox1Button; |
---|
| 5818 | + cButton skybox2Button; |
---|
| 5819 | + cButton skybox3Button; |
---|
| 5820 | + cButton skybox4Button; |
---|
| 5821 | + cButton skybox5Button; |
---|
| 5822 | + cButton skybox6Button; |
---|
| 5823 | + cButton skybox7Button; |
---|
| 5824 | + |
---|
| 5825 | + cButton skybox11Button; |
---|
| 5826 | + cButton skybox12Button; |
---|
| 5827 | + cButton skybox13Button; |
---|
| 5828 | + cButton skybox14Button; |
---|
| 5829 | + cButton skybox15Button; |
---|
| 5830 | + cButton skybox16Button; |
---|
| 5831 | + cButton skybox17Button; |
---|
| 5832 | + |
---|
| 5833 | + cButton gridButton; |
---|
| 5834 | + cButton boxButton; |
---|
| 5835 | + cButton sphereButton; |
---|
| 5836 | + cButton coneButton; |
---|
| 5837 | + cButton torusButton; |
---|
| 5838 | + cButton superButton; |
---|
| 5839 | + cButton kleinButton; |
---|
| 5840 | + cButton particlesButton; |
---|
| 5841 | + cButton overlayButton; |
---|
| 5842 | + cButton lightButton; |
---|
5049 | 5843 | |
---|
5050 | 5844 | cButton screenfitButton; |
---|
5051 | 5845 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5058 | 5852 | |
---|
5059 | 5853 | cButton setsupportButton; |
---|
5060 | 5854 | |
---|
5061 | | - cButton twoButton; |
---|
5062 | | - cButton sixButton; |
---|
5063 | | - cButton threeButton; |
---|
5064 | | - cButton sevenButton; |
---|
5065 | | - cButton fourButton; // full panel |
---|
5066 | | - cButton oneButton; // full XYZ |
---|
5067 | | - //cButton currentLayout; |
---|
5068 | | - |
---|
5069 | 5855 | // |
---|
5070 | 5856 | //Composite |
---|
5071 | 5857 | Object3D // to do !! |
---|
.. | .. |
---|
5075 | 5861 | //JTree jTree; |
---|
5076 | 5862 | private MenuItem lookAtItem; |
---|
5077 | 5863 | private MenuItem lookFromItem; |
---|
5078 | | - private MenuItem switchItem; |
---|
| 5864 | + private MenuItem switchViewItem; |
---|
5079 | 5865 | private MenuItem cutItem; |
---|
5080 | | - private MenuItem duplicateItem; |
---|
| 5866 | + private MenuItem undoItem; |
---|
| 5867 | + private MenuItem redoItem; |
---|
| 5868 | + private JMenuItem duplicateItem; |
---|
5081 | 5869 | private MenuItem cloneItem; |
---|
5082 | 5870 | private MenuItem cloneSupportItem; |
---|
5083 | 5871 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5090 | 5878 | private MenuItem linkverticesItem; |
---|
5091 | 5879 | private MenuItem relinkverticesItem; |
---|
5092 | 5880 | private MenuItem setMasterItem; |
---|
5093 | | - private MenuItem resetMeshItem; |
---|
| 5881 | + private MenuItem resetAllItem; |
---|
5094 | 5882 | private MenuItem stepAllItem; |
---|
5095 | 5883 | private MenuItem revertMeshItem; |
---|
5096 | 5884 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5105 | 5893 | private MenuItem pasteLinkItem; |
---|
5106 | 5894 | private MenuItem pasteCloneItem; |
---|
5107 | 5895 | private MenuItem pasteExpandItem; |
---|
5108 | | - private MenuItem clearItem; |
---|
| 5896 | + private MenuItem deleteItem; |
---|
5109 | 5897 | private MenuItem clearAllItem; |
---|
5110 | 5898 | private MenuItem genUVItem; |
---|
5111 | 5899 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5140 | 5928 | private MenuItem showleavesItem; |
---|
5141 | 5929 | private MenuItem markleavesItem; |
---|
5142 | 5930 | private MenuItem unmarkleavesItem; |
---|
| 5931 | + private MenuItem rewindleavesItem; |
---|
| 5932 | + private MenuItem unrewindleavesItem; |
---|
| 5933 | + private MenuItem randomleavesItem; |
---|
| 5934 | + private MenuItem unrandomleavesItem; |
---|
5143 | 5935 | |
---|
5144 | 5936 | private MenuItem flipVItem; |
---|
5145 | 5937 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5151 | 5943 | private MenuItem panoTexturesItem; |
---|
5152 | 5944 | |
---|
5153 | 5945 | private MenuItem resetCentroidItem; |
---|
5154 | | - private MenuItem transformgeometryItem; |
---|
| 5946 | + private MenuItem resetCentroidXZItem; |
---|
5155 | 5947 | private MenuItem resetTransformItem; |
---|
| 5948 | + private MenuItem transformGeometryItem; |
---|
| 5949 | + private MenuItem transformChildrenItem; |
---|
5156 | 5950 | private MenuItem hideItem; |
---|
5157 | 5951 | private MenuItem grabItem; |
---|
5158 | 5952 | private MenuItem backItem; |
---|
5159 | 5953 | private MenuItem frontItem; |
---|
5160 | 5954 | private MenuItem cameraItem; |
---|
5161 | 5955 | private MenuItem compositeItem; |
---|
5162 | | - private MenuItem randomItem; |
---|
| 5956 | + private MenuItem switchItem; |
---|
5163 | 5957 | private MenuItem physicsItem; |
---|
5164 | 5958 | private MenuItem frameselectorItem; |
---|
5165 | 5959 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5183 | 5977 | private MenuItem attachBumpItem; |
---|
5184 | 5978 | private MenuItem detachBumpItem; |
---|
5185 | 5979 | private MenuItem pigmentBumpItem; |
---|
| 5980 | + private MenuItem embedTexturesItem; |
---|
| 5981 | + private MenuItem deEmbedTexturesItem; |
---|
5186 | 5982 | |
---|
5187 | 5983 | private MenuItem particleItem; |
---|
5188 | 5984 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5221 | 6017 | private MenuItem doubleItem; |
---|
5222 | 6018 | private MenuItem tripleItem; |
---|
5223 | 6019 | |
---|
5224 | | - private MenuItem importGFDItem; |
---|
5225 | | - private MenuItem importVRMLX3DItem; |
---|
5226 | | - private MenuItem import3DSItem; |
---|
5227 | | - private MenuItem importOBJItem; |
---|
5228 | | - |
---|
5229 | 6020 | private MenuItem computeAOItem; |
---|
5230 | 6021 | private MenuItem recompileItem; |
---|
5231 | 6022 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5235 | 6026 | private MenuItem analyzeItem; |
---|
5236 | 6027 | private MenuItem dumpItem; |
---|
5237 | 6028 | //boolean freezemodel = false; |
---|
| 6029 | + |
---|
| 6030 | + Menu cameraMenu; |
---|
| 6031 | + MenuItem editCameraItem; |
---|
| 6032 | + MenuItem restoreCameraItem; |
---|
5238 | 6033 | } |
---|