.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 83 | + SetupMenu2(this); //objEditor); |
---|
78 | 84 | SetupUI2(objEditor); |
---|
79 | 85 | objEditor.SetupUI(true); |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
86 | 100 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
87 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 106 | //Object3D obj; |
---|
89 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 112 | |
---|
95 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 116 | } |
---|
98 | 117 | |
---|
99 | 118 | void CloneClipboard(boolean supports) |
---|
100 | 119 | { |
---|
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)); |
---|
| 120 | + assert(Grafreed.clipboard.parent == null); |
---|
| 121 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 122 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 123 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 124 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 125 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 126 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 127 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 128 | } |
---|
110 | 129 | |
---|
111 | 130 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 138 | // obj.support = null; |
---|
120 | 139 | if (!supports) |
---|
121 | 140 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 141 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 142 | obj.parent = parent; |
---|
124 | 143 | // obj.support = support; |
---|
125 | 144 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 167 | |
---|
149 | 168 | //JTextField nameField; |
---|
150 | 169 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 170 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 171 | { |
---|
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 | | - |
---|
| 172 | + oe.jTree = new cTree(); |
---|
| 173 | + |
---|
168 | 174 | Menu menu; |
---|
169 | 175 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 176 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 177 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 178 | + |
---|
| 179 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 180 | +// undoItem.addActionListener(this); |
---|
| 181 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 182 | +// redoItem.addActionListener(this); |
---|
| 183 | +// menu.add("-"); |
---|
| 184 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 185 | duplicateItem.addActionListener(this); |
---|
| 186 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 187 | + cloneItem.addActionListener(this); |
---|
| 188 | + if (Globals.ADVANCED) |
---|
| 189 | + { |
---|
| 190 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 191 | + cloneSupportItem.addActionListener(this); |
---|
| 192 | + } |
---|
| 193 | + menu.add("-"); |
---|
174 | 194 | cutItem = menu.add(new MenuItem("Cut")); |
---|
175 | 195 | cutItem.addActionListener(this); |
---|
176 | 196 | copyItem = menu.add(new MenuItem("Copy")); |
---|
177 | 197 | copyItem.addActionListener(this); |
---|
178 | 198 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
179 | 199 | pasteItem.addActionListener(this); |
---|
180 | | - menu.add("-"); |
---|
181 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
182 | | - cloneItem.addActionListener(this); |
---|
183 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
184 | | - cloneSupportItem.addActionListener(this); |
---|
| 200 | + |
---|
185 | 201 | menu.add("-"); |
---|
186 | 202 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
187 | 203 | pasteIntoItem.addActionListener(this); |
---|
.. | .. |
---|
192 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
193 | 209 | // pasteExpandItem.addActionListener(this); |
---|
194 | 210 | menu.add("-"); |
---|
195 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
196 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
197 | 213 | |
---|
198 | 214 | if (Globals.ADVANCED) |
---|
199 | 215 | { |
---|
.. | .. |
---|
201 | 217 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
202 | 218 | clearAllItem.addActionListener(this); |
---|
203 | 219 | } |
---|
| 220 | + |
---|
| 221 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 222 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 223 | + //zBufferItem.addActionListener(this); |
---|
| 224 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 225 | + //normalLensItem.addActionListener(this); |
---|
| 226 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 227 | + restoreCameraItem.addActionListener(this); |
---|
| 228 | + |
---|
| 229 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 230 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 231 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 232 | +// cameraMenu.add("-"); |
---|
| 233 | +// |
---|
| 234 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 235 | +// toggleTextureItem.addItemListener(this); |
---|
| 236 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 237 | +// |
---|
| 238 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 239 | +// toggleSwitchItem.addItemListener(this); |
---|
| 240 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 243 | + toggleHandleItem.addItemListener(this); |
---|
| 244 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 247 | + togglePaintItem.addItemListener(this); |
---|
| 248 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 249 | + |
---|
| 250 | + if (Globals.ADVANCED) |
---|
| 251 | + { |
---|
| 252 | + cameraMenu.add("-"); |
---|
| 253 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 254 | + toggleLiveItem.addItemListener(this); |
---|
| 255 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
204 | 256 | |
---|
| 257 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 258 | + stepItem.addActionListener(this); |
---|
| 259 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 260 | + // toggleDLItem.addItemListener(this); |
---|
| 261 | + // toggleDLItem.setState(false); |
---|
| 262 | + |
---|
| 263 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 264 | + toggleRenderItem.addItemListener(this); |
---|
| 265 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 266 | + |
---|
| 267 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 268 | + toggleDebugItem.addItemListener(this); |
---|
| 269 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 270 | + |
---|
| 271 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 272 | + toggleFrustumItem.addItemListener(this); |
---|
| 273 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 274 | + |
---|
| 275 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 276 | + toggleFootContactItem.addItemListener(this); |
---|
| 277 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 278 | + |
---|
| 279 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 280 | + toggleTimelineItem.addItemListener(this); |
---|
| 281 | + } |
---|
| 282 | + |
---|
| 283 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 284 | +// toggleRootItem.addItemListener(this); |
---|
| 285 | +// toggleRootItem.setState(false); |
---|
| 286 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 287 | +// animationItem.addItemListener(this); |
---|
| 288 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 289 | + cameraMenu.add("-"); |
---|
| 290 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 291 | + editCameraItem.addActionListener(this); |
---|
| 292 | + |
---|
| 293 | + if (Globals.ADVANCED) |
---|
| 294 | + { |
---|
| 295 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 296 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 297 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 298 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 299 | + oe.cameraMenu.add("-"); |
---|
| 300 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 301 | + openWindowItem.addActionListener(this); |
---|
| 302 | + editLeafItem.addActionListener(this); |
---|
| 303 | + lookAtItem.addActionListener(this); |
---|
| 304 | + //lookFromItem.addActinoListener(this); |
---|
| 305 | + //switchViewItem.addActionListener(this); |
---|
| 306 | + } |
---|
| 307 | + |
---|
205 | 308 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
206 | 309 | if (Globals.ADVANCED) |
---|
207 | 310 | { |
---|
208 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
209 | | - resetMeshItem.addActionListener(this); |
---|
210 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
211 | | - stepAllItem.addActionListener(this); |
---|
212 | 311 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
213 | 312 | revertMeshItem.addActionListener(this); |
---|
214 | 313 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
248 | 347 | } |
---|
249 | 348 | |
---|
250 | 349 | oe.menuBar.add(menu = new Menu("Group")); |
---|
251 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
252 | | - grabItem.addActionListener(this); |
---|
| 350 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 351 | +// grabItem.addActionListener(this); |
---|
253 | 352 | backItem = menu.add(new MenuItem("Back")); |
---|
254 | 353 | backItem.addActionListener(this); |
---|
255 | 354 | frontItem = menu.add(new MenuItem("Front")); |
---|
256 | 355 | frontItem.addActionListener(this); |
---|
257 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
258 | | - compositeItem.addActionListener(this); |
---|
| 356 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 357 | +// compositeItem.addActionListener(this); |
---|
| 358 | + |
---|
| 359 | + if (Globals.ADVANCED) |
---|
| 360 | + { |
---|
259 | 361 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
260 | 362 | hideItem.addActionListener(this); |
---|
| 363 | + } |
---|
261 | 364 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
262 | 365 | ungroupItem.addActionListener(this); |
---|
263 | | - menu.add("-"); |
---|
264 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
265 | | - randomItem.addActionListener(this); |
---|
| 366 | + |
---|
| 367 | +// menu.add("-"); |
---|
| 368 | +// |
---|
| 369 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 370 | +// switchItem.addActionListener(this); |
---|
| 371 | + if (Globals.ADVANCED) |
---|
| 372 | + { |
---|
266 | 373 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
267 | 374 | switchGeoItem.addActionListener(this); |
---|
268 | 375 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
270 | 377 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
271 | 378 | morphItem.addActionListener(this); |
---|
272 | 379 | |
---|
273 | | - if (Globals.ADVANCED) |
---|
274 | | - { |
---|
| 380 | + menu.add("-"); |
---|
275 | 381 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
276 | 382 | physicsItem.addActionListener(this); |
---|
277 | 383 | frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
278 | 384 | frameselectorItem.addActionListener(this); |
---|
279 | 385 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
280 | 386 | scriptNodeItem.addActionListener(this); |
---|
281 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
282 | | - cameraItem.addActionListener(this); |
---|
283 | 387 | } |
---|
284 | 388 | |
---|
285 | 389 | oe.menuBar.add(menu = new Menu("Object")); |
---|
286 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
287 | | - textureItem.addActionListener(this); |
---|
| 390 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 391 | +// textureItem.addActionListener(this); |
---|
288 | 392 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
289 | 393 | billboardItem.addActionListener(this); |
---|
290 | 394 | csgItem = menu.add(new MenuItem("CSG")); |
---|
291 | 395 | csgItem.addActionListener(this); |
---|
292 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 396 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
293 | 397 | shadowXItem.addActionListener(this); |
---|
294 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 398 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
295 | 399 | shadowYItem.addActionListener(this); |
---|
296 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 400 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
297 | 401 | shadowZItem.addActionListener(this); |
---|
298 | | - if (Globals.ADVANCED) |
---|
299 | | - { |
---|
300 | | - linkerItem = menu.add(new MenuItem("Linker")); |
---|
301 | | - linkerItem.addActionListener(this); |
---|
302 | 402 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
303 | 403 | attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
| 405 | + if (Globals.ADVANCED) |
---|
| 406 | + { |
---|
| 407 | + menu.add("-"); |
---|
| 408 | + linkerItem = menu.add(new MenuItem("Linker")); |
---|
| 409 | + linkerItem.addActionListener(this); |
---|
304 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
305 | 411 | templateItem.addActionListener(this); |
---|
306 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
307 | 413 | pointflowItem.addActionListener(this); |
---|
308 | | - menu.add("-"); |
---|
309 | 414 | } |
---|
| 415 | + menu.add("-"); |
---|
310 | 416 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
311 | 417 | resetTransformItem.addActionListener(this); |
---|
312 | 418 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
313 | 419 | resetCentroidItem.addActionListener(this); |
---|
314 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
315 | | - transformgeometryItem.addActionListener(this); |
---|
| 420 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 421 | + resetCentroidXZItem.addActionListener(this); |
---|
| 422 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 423 | + transformGeometryItem.addActionListener(this); |
---|
| 424 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 425 | + transformChildrenItem.addActionListener(this); |
---|
316 | 426 | |
---|
317 | 427 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
318 | 428 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
325 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
326 | 436 | if (Globals.ADVANCED) |
---|
327 | 437 | { |
---|
328 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
329 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
330 | 440 | } |
---|
331 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
361 | 471 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
362 | 472 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
363 | 473 | clearMaterialsItem.addActionListener(this); |
---|
| 474 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 475 | + resetAllItem.addActionListener(this); |
---|
| 476 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 477 | + stepAllItem.addActionListener(this); |
---|
364 | 478 | menu.add("-"); |
---|
365 | 479 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
366 | 480 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
381 | 495 | markleavesItem.addActionListener(this); |
---|
382 | 496 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
383 | 497 | unmarkleavesItem.addActionListener(this); |
---|
| 498 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 499 | + rewindleavesItem.addActionListener(this); |
---|
| 500 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 501 | + unrewindleavesItem.addActionListener(this); |
---|
| 502 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 503 | + randomleavesItem.addActionListener(this); |
---|
| 504 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 505 | + unrandomleavesItem.addActionListener(this); |
---|
384 | 506 | menu.add("-"); |
---|
385 | 507 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
386 | 508 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
406 | 528 | attachBumpItem.addActionListener(this); |
---|
407 | 529 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
408 | 530 | pigmentBumpItem.addActionListener(this); |
---|
| 531 | + //embedTexturesItem |
---|
409 | 532 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
410 | 533 | detachPigmentItem.addActionListener(this); |
---|
411 | 534 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
412 | 535 | detachBumpItem.addActionListener(this); |
---|
| 536 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 537 | + embedTexturesItem.addActionListener(this); |
---|
| 538 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 539 | + deEmbedTexturesItem.addActionListener(this); |
---|
413 | 540 | menu.add("-"); |
---|
414 | 541 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
415 | 542 | sortbysizeItem.addActionListener(this); |
---|
416 | 543 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
417 | 544 | sortbynameItem.addActionListener(this); |
---|
| 545 | + menu.add("-"); |
---|
| 546 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 547 | + shareGeometriesItem.addActionListener(this); |
---|
| 548 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 549 | + mergeGeometriesItem.addActionListener(this); |
---|
418 | 550 | if (Globals.ADVANCED) |
---|
419 | 551 | { |
---|
420 | | - menu.add("-"); |
---|
| 552 | + // Pretty much the same as duplicate and clone. |
---|
421 | 553 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
422 | 554 | extractGeometriesItem.addActionListener(this); |
---|
423 | 555 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
424 | 556 | cloneGeometriesItem.addActionListener(this); |
---|
425 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
426 | | - shareGeometriesItem.addActionListener(this); |
---|
427 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
428 | | - mergeGeometriesItem.addActionListener(this); |
---|
429 | 557 | } |
---|
430 | 558 | |
---|
431 | 559 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
432 | 560 | buildCreateMenu(menu); |
---|
433 | 561 | |
---|
434 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
435 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
436 | | - importGFDItem.addActionListener(this); |
---|
437 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
438 | | - importVRMLX3DItem.addActionListener(this); |
---|
439 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
440 | | - importOBJItem.addActionListener(this); |
---|
441 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
442 | | - import3DSItem.addActionListener(this); |
---|
443 | | - |
---|
444 | 562 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
445 | 563 | buildToolsMenu(menu); |
---|
446 | 564 | } |
---|
447 | 565 | |
---|
| 566 | + |
---|
448 | 567 | void SetupUI2(ObjEditor oe) |
---|
449 | 568 | { |
---|
| 569 | + // June 2019 |
---|
| 570 | + if (oe == null) |
---|
| 571 | + { |
---|
| 572 | + //super.SetupUI2(this); |
---|
| 573 | + //return; |
---|
| 574 | + } |
---|
| 575 | + |
---|
| 576 | + if (copy != group) |
---|
| 577 | + { |
---|
| 578 | + //super.SetupUI2(this); |
---|
| 579 | + } |
---|
| 580 | + |
---|
450 | 581 | //new Exception().printStackTrace(); |
---|
451 | 582 | |
---|
452 | 583 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
475 | 606 | oe.radioPanel.add(dummyButton); |
---|
476 | 607 | oe.buttonGroup.add(dummyButton); |
---|
477 | 608 | */ |
---|
| 609 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 610 | + |
---|
| 611 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 612 | + |
---|
478 | 613 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
479 | 614 | |
---|
480 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
481 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 615 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + //minButton.setToolTipText("Minimize window"); |
---|
| 617 | + //minButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + if (Globals.ADVANCED) |
---|
| 620 | + { |
---|
| 621 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + maxButton.setToolTipText("Maximize window"); |
---|
| 623 | + maxButton.addActionListener(this); |
---|
| 624 | + } |
---|
| 625 | + |
---|
| 626 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 627 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 628 | + fullButton.addActionListener(this); |
---|
| 629 | + |
---|
| 630 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 631 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 632 | + screenfitButton.addActionListener(this); |
---|
| 633 | + |
---|
| 634 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 636 | + restoreCameraButton.addActionListener(this); |
---|
| 637 | + |
---|
| 638 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + saveButton.setToolTipText("New version"); |
---|
| 640 | + saveButton.addActionListener(this); |
---|
| 641 | + |
---|
| 642 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 643 | + undoButton.setToolTipText("Previous version"); |
---|
| 644 | + undoButton.addActionListener(this); |
---|
| 645 | + undoButton.setEnabled(false); |
---|
| 646 | + |
---|
| 647 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 648 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + restoreButton.setToolTipText("Restore current"); |
---|
| 650 | + restoreButton.addActionListener(this); |
---|
| 651 | + restoreButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + replaceButton.setToolTipText("Replace current"); |
---|
| 655 | + replaceButton.addActionListener(this); |
---|
| 656 | + replaceButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + copyOptionsPanel.add(updown); |
---|
| 659 | + |
---|
| 660 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + redoButton.setToolTipText("Next version"); |
---|
| 662 | + redoButton.addActionListener(this); |
---|
| 663 | + redoButton.setEnabled(false); |
---|
| 664 | + |
---|
| 665 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 666 | + liveCB.setToolTipText("Enable animation"); |
---|
482 | 667 | liveCB.addItemListener(this); |
---|
483 | 668 | |
---|
484 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 670 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
486 | 671 | oneStepButton.addActionListener(this); |
---|
487 | 672 | |
---|
488 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 673 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
489 | 674 | fastCB.setToolTipText("Fast mode"); |
---|
490 | 675 | fastCB.addItemListener(this); |
---|
491 | 676 | |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
493 | | - trackCB.setToolTipText("Enable tracking"); |
---|
494 | | - trackCB.addItemListener(this); |
---|
495 | | - |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
497 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
498 | | - screenfitButton.addActionListener(this); |
---|
| 677 | + //oe.toolboxPanel.Return(); |
---|
| 678 | + |
---|
| 679 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 680 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 681 | +// trackCB.addItemListener(this); |
---|
499 | 682 | |
---|
500 | 683 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
501 | 684 | // screenfitpointButton.addActionListener(this); |
---|
502 | 685 | |
---|
503 | 686 | if (Globals.ADVANCED) |
---|
504 | 687 | { |
---|
505 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
506 | 689 | snapobjectButton.addActionListener(this); |
---|
507 | 690 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + fourButton.addActionListener(this); |
---|
| 694 | + fourButton.setToolTipText("Show control panel only"); |
---|
508 | 695 | } |
---|
509 | 696 | |
---|
510 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
511 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | | - flashSelectionButton.addActionListener(this); |
---|
| 697 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
513 | 698 | |
---|
514 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
515 | | - |
---|
516 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
517 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 699 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + twoButton.setToolTipText("Show 3D view only"); |
---|
518 | 701 | twoButton.addActionListener(this); |
---|
519 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | | - fourButton.addActionListener(this); |
---|
521 | | - fourButton.setToolTipText("Show left panel only"); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
523 | | - sixButton.setToolTipText("2-column layout left"); |
---|
524 | | - sixButton.addActionListener(this); |
---|
525 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 702 | + this.fullscreenLayout = twoButton; |
---|
| 703 | + |
---|
| 704 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 705 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
527 | 706 | threeButton.addActionListener(this); |
---|
528 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
529 | | - sevenButton.setToolTipText("3-column layout"); |
---|
530 | | - sevenButton.addActionListener(this); |
---|
| 707 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 709 | + sixButton.addActionListener(this); |
---|
| 710 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 712 | +// sevenButton.addActionListener(this); |
---|
531 | 713 | // |
---|
532 | 714 | |
---|
533 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 715 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 716 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
535 | 717 | rootButton.addActionListener(this); |
---|
536 | 718 | |
---|
537 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 720 | closeButton.setToolTipText("Close tab"); |
---|
539 | 721 | closeButton.addActionListener(this); |
---|
540 | 722 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
541 | 723 | //clearButton.addActionListener(this); |
---|
542 | | - |
---|
543 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 724 | + |
---|
| 725 | + // INSERT |
---|
| 726 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + gridButton.setToolTipText("Create grid"); |
---|
| 728 | + gridButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + boxButton.setToolTipText("Create box"); |
---|
| 732 | + boxButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 736 | + sphereButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + coneButton.setToolTipText("Create cone"); |
---|
| 740 | + coneButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 743 | + torusButton.setToolTipText("Create torus"); |
---|
| 744 | + torusButton.addActionListener(this); |
---|
| 745 | + |
---|
| 746 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 747 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 748 | + superButton.addActionListener(this); |
---|
| 749 | + |
---|
| 750 | + if (Globals.ADVANCED) |
---|
| 751 | + { |
---|
| 752 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 754 | + kleinButton.addActionListener(this); |
---|
| 755 | + } |
---|
544 | 756 | |
---|
545 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
546 | | - editButton.setToolTipText("Edit selection"); |
---|
| 757 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 758 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 759 | + particlesButton.addActionListener(this); |
---|
| 760 | + |
---|
| 761 | + oe.toolboxPanel.Return(); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + groupButton.setToolTipText("Create group"); |
---|
| 765 | + groupButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + compositeButton.setToolTipText("Create composite"); |
---|
| 769 | + compositeButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 773 | + switchButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + loopButton.setToolTipText("Create loop"); |
---|
| 777 | + loopButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + textureButton.setToolTipText("Create texture"); |
---|
| 781 | + textureButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 784 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 785 | + overlayButton.addActionListener(this); |
---|
| 786 | + |
---|
| 787 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 788 | + lightButton.setToolTipText("Create light"); |
---|
| 789 | + lightButton.addActionListener(this); |
---|
| 790 | + |
---|
| 791 | + for (int i=6; --i>=0;) |
---|
| 792 | + { |
---|
| 793 | + oe.toolboxPanel.Return(); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 797 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 798 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 799 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 800 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 801 | + } |
---|
| 802 | + |
---|
| 803 | + // EDIT panel |
---|
| 804 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + editButton.setToolTipText("Pin selection controls"); |
---|
547 | 806 | editButton.addActionListener(this); |
---|
548 | 807 | |
---|
549 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
550 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 808 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
551 | 810 | uneditButton.addActionListener(this); |
---|
552 | 811 | |
---|
553 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
554 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 812 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 813 | + allParamsButton.setToolTipText("Show all controle"); |
---|
555 | 814 | allParamsButton.addActionListener(this); |
---|
556 | 815 | |
---|
557 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 816 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
558 | 817 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
559 | 818 | clearPanelButton.addActionListener(this); |
---|
560 | 819 | |
---|
561 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 820 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
562 | 821 | unselectButton.setToolTipText("Unselect"); |
---|
563 | 822 | unselectButton.addActionListener(this); |
---|
564 | 823 | |
---|
565 | | - commandsPanel.preferredHeight = 1; |
---|
| 824 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 825 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 826 | + flashSelectionButton.addActionListener(this); |
---|
566 | 827 | |
---|
567 | | - oe.treePanel.add(commandsPanel); |
---|
568 | | - oe.treePanel.Return(); |
---|
| 828 | + editCommandsPanel.preferredHeight = 1; |
---|
| 829 | + |
---|
| 830 | + SetPinStates(false); |
---|
| 831 | +// oe.treePanel.add(commandsPanel); |
---|
| 832 | +// oe.treePanel.Return(); |
---|
569 | 833 | |
---|
570 | 834 | // oe.aConstraints.gridx += 1; |
---|
571 | 835 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
582 | 846 | |
---|
583 | 847 | JScrollPane jSP; |
---|
584 | 848 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
585 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 849 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
586 | 850 | ResetModel(); |
---|
587 | 851 | |
---|
588 | 852 | oe.treePanel.add(jSPPanel); |
---|
589 | 853 | oe.treePanel.Return(); |
---|
590 | 854 | |
---|
591 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
592 | | - |
---|
593 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
594 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
595 | | - colorCB.addItemListener(this); |
---|
596 | | - |
---|
597 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
598 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
599 | | - materialCB.addItemListener(this); |
---|
600 | | - |
---|
601 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
602 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
603 | | - textureCB.addItemListener(this); |
---|
604 | | - |
---|
605 | | - copyOptionsPanel.preferredHeight = 1; |
---|
606 | 855 | oe.treePanel.add(copyOptionsPanel); |
---|
607 | 856 | oe.treePanel.Return(); |
---|
| 857 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 858 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 859 | + sliderPane.preferredHeight = 1; |
---|
608 | 860 | |
---|
609 | 861 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
610 | 862 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
627 | 879 | dgr.addDragGestureListener(this); |
---|
628 | 880 | }catch(Exception e) {} |
---|
629 | 881 | */ |
---|
630 | | - radio.layout = sevenButton; |
---|
| 882 | + radio.layout = sixButton; // sevenButton; |
---|
631 | 883 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
632 | 884 | } |
---|
633 | 885 | |
---|
634 | 886 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
635 | 887 | { |
---|
| 888 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 889 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 890 | + colorCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 893 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 894 | + materialCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 897 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 898 | + textureCB.addItemListener(this); |
---|
| 899 | + |
---|
| 900 | + panel.Return(); |
---|
| 901 | + |
---|
636 | 902 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
637 | 903 | boxCB.setToolTipText("Display bounding boxes"); |
---|
638 | 904 | boxCB.addItemListener(this); |
---|
639 | 905 | |
---|
640 | 906 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
641 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 907 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
642 | 908 | zoomBoxCB.addItemListener(this); |
---|
643 | 909 | |
---|
644 | | - if (Globals.ADVANCED) |
---|
| 910 | + if (true) // Globals.ADVANCED) |
---|
645 | 911 | { |
---|
646 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
647 | | - supportCB.setToolTipText("Enable rigging"); |
---|
648 | | - supportCB.addItemListener(this); |
---|
| 912 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 913 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 914 | +// supportCB.addItemListener(this); |
---|
| 915 | + |
---|
| 916 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 917 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 918 | + freezeCB.addItemListener(this); |
---|
649 | 919 | |
---|
650 | 920 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
651 | 921 | // localCB.addItemListener(this); |
---|
652 | 922 | |
---|
| 923 | + panel.Return(); |
---|
| 924 | + |
---|
653 | 925 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
654 | 926 | crowdCB.setToolTipText("Used for crowds"); |
---|
655 | 927 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
666 | 938 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
667 | 939 | // speakerMocapCB.addItemListener(this); |
---|
668 | 940 | |
---|
| 941 | + panel.Return(); |
---|
| 942 | + |
---|
669 | 943 | if (false) |
---|
670 | 944 | { |
---|
671 | 945 | // handled in scripts |
---|
.. | .. |
---|
680 | 954 | //constraints.gridy += 1; |
---|
681 | 955 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
682 | 956 | smoothfocusCB.addItemListener(this); |
---|
| 957 | + panel.Return(); |
---|
683 | 958 | } |
---|
684 | 959 | |
---|
685 | 960 | //constraints.gridx += 1; |
---|
686 | 961 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
687 | 962 | // debugCB.addItemListener(this); |
---|
688 | 963 | |
---|
| 964 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 965 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 966 | + trackCB.addItemListener(this); |
---|
| 967 | + |
---|
689 | 968 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 969 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
690 | 970 | oeilCB.addItemListener(this); |
---|
691 | 971 | |
---|
| 972 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 973 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 974 | + shadowCB.addItemListener(this); |
---|
| 975 | + |
---|
| 976 | + panel.Return(); |
---|
| 977 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 978 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 979 | + toggleTextureCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 982 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 983 | + toggleSwitchCB.addItemListener(this); |
---|
| 984 | + |
---|
| 985 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 986 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 987 | + autokeepCB.addItemListener(this); |
---|
| 988 | + |
---|
| 989 | + panel.Return(); |
---|
| 990 | + if (Globals.ADVANCED) |
---|
| 991 | + { |
---|
692 | 992 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
693 | 993 | lookAtCB.setToolTipText("Look-at target"); |
---|
694 | 994 | lookAtCB.addItemListener(this); |
---|
| 995 | + } |
---|
695 | 996 | |
---|
696 | 997 | } |
---|
697 | 998 | |
---|
698 | 999 | cGridBag fill = new cGridBag(); |
---|
699 | | - |
---|
700 | 1000 | fill.preferredHeight = 200; |
---|
| 1001 | + cGridBag fill2 = new cGridBag(); |
---|
| 1002 | + fill2.preferredHeight = 200; |
---|
| 1003 | + cGridBag fill3 = new cGridBag(); |
---|
| 1004 | + fill3.preferredHeight = 200; |
---|
701 | 1005 | |
---|
702 | 1006 | panel.add(fill); |
---|
| 1007 | + panel.add(fill2); |
---|
| 1008 | + panel.add(fill3); |
---|
703 | 1009 | |
---|
704 | 1010 | } |
---|
705 | 1011 | |
---|
706 | 1012 | void EditObject(Object3D obj) |
---|
707 | 1013 | { |
---|
708 | 1014 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1015 | + |
---|
| 1016 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1017 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1018 | + if (!radioButton.hadMaterial) |
---|
| 1019 | + { |
---|
| 1020 | + obj.material = new cMaterial(); |
---|
| 1021 | + } |
---|
| 1022 | + |
---|
709 | 1023 | radioButton.SetObject(obj); |
---|
710 | | - radioButton.layout = sevenButton; |
---|
| 1024 | + radioButton.layout = sixButton; // sevenButton; |
---|
711 | 1025 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
712 | 1026 | radioButton.addActionListener(this); |
---|
713 | 1027 | radioPanel.add(radioButton); |
---|
714 | 1028 | buttonGroup.add(radioButton); |
---|
715 | 1029 | radioButton.doClick(); |
---|
716 | 1030 | } |
---|
| 1031 | + |
---|
717 | 1032 | void SetupViews(ObjEditor oe) |
---|
718 | 1033 | { |
---|
| 1034 | + theFrame = this; |
---|
| 1035 | + |
---|
719 | 1036 | oe.SetupViews(); |
---|
720 | 1037 | |
---|
721 | 1038 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
724 | 1041 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
725 | 1042 | } |
---|
726 | 1043 | |
---|
727 | | - JCheckBox liveCB; |
---|
728 | | - JCheckBox supportCB; |
---|
729 | | - JCheckBox localCB; |
---|
730 | | - JCheckBox crowdCB; |
---|
731 | | - JCheckBox smoothCB; |
---|
732 | | - JCheckBox fastCB; |
---|
733 | | - JCheckBox slowCB; |
---|
734 | | - JCheckBox boxCB; |
---|
735 | | - JCheckBox zoomBoxCB; |
---|
736 | | - JCheckBox trackCB; |
---|
737 | | - JCheckBox smoothfocusCB; |
---|
| 1044 | + cToggleButton liveCB; |
---|
| 1045 | + cCheckBox supportCB; |
---|
| 1046 | + cCheckBox localCB; |
---|
| 1047 | + cCheckBox crowdCB; |
---|
| 1048 | + cCheckBox smoothCB; |
---|
| 1049 | + cToggleButton fastCB; |
---|
| 1050 | + cCheckBox slowCB; |
---|
| 1051 | + cCheckBox boxCB; |
---|
| 1052 | + cCheckBox zoomBoxCB; |
---|
| 1053 | + cCheckBox freezeCB; |
---|
| 1054 | + //cToggleButton trackCB; |
---|
| 1055 | + cCheckBox trackCB; |
---|
| 1056 | + cCheckBox smoothfocusCB; |
---|
738 | 1057 | // JCheckBox speakerMocapCB; |
---|
739 | | - JCheckBox speakerCameraCB; |
---|
740 | | - JCheckBox speakerFocusCB; |
---|
741 | | - JCheckBox debugCB; |
---|
742 | | - JCheckBox oeilCB; |
---|
743 | | - JCheckBox lookAtCB; |
---|
| 1058 | + cCheckBox speakerCameraCB; |
---|
| 1059 | + cCheckBox speakerFocusCB; |
---|
| 1060 | + cCheckBox debugCB; |
---|
| 1061 | + |
---|
| 1062 | + cCheckBox oeilCB; |
---|
| 1063 | + cCheckBox shadowCB; |
---|
| 1064 | + cCheckBox autokeepCB; |
---|
| 1065 | + cCheckBox lookAtCB; |
---|
744 | 1066 | |
---|
745 | 1067 | // static int COLOR = 1; |
---|
746 | 1068 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
748 | 1070 | |
---|
749 | 1071 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
750 | 1072 | |
---|
751 | | - JCheckBox colorCB; |
---|
752 | | - JCheckBox materialCB; |
---|
753 | | - JCheckBox textureCB; |
---|
| 1073 | + cCheckBox colorCB; |
---|
| 1074 | + cCheckBox materialCB; |
---|
| 1075 | + cCheckBox textureCB; |
---|
754 | 1076 | |
---|
755 | 1077 | public void itemStateChanged(ItemEvent e) |
---|
756 | 1078 | { |
---|
.. | .. |
---|
778 | 1100 | } else if(e.getSource() == liveCB) |
---|
779 | 1101 | { |
---|
780 | 1102 | cameraView.ToggleLive(); |
---|
| 1103 | + refreshContents(false); |
---|
781 | 1104 | } |
---|
782 | 1105 | else if(e.getSource() == supportCB) |
---|
783 | 1106 | { |
---|
.. | .. |
---|
842 | 1165 | { |
---|
843 | 1166 | cameraView.ToggleOeil(); |
---|
844 | 1167 | } |
---|
| 1168 | + else if(e.getSource() == shadowCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1171 | + } |
---|
| 1172 | + else if(e.getSource() == freezeCB) |
---|
| 1173 | + { |
---|
| 1174 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1175 | + } |
---|
| 1176 | + else if(e.getSource() == autokeepCB) |
---|
| 1177 | + { |
---|
| 1178 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1179 | + } |
---|
845 | 1180 | else if(e.getSource() == lookAtCB) |
---|
846 | 1181 | { |
---|
847 | 1182 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
858 | 1193 | |
---|
859 | 1194 | /**/ |
---|
860 | 1195 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
861 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1196 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1197 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
862 | 1198 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
863 | 1199 | // We can't move the root node or an empty selection |
---|
864 | 1200 | return; |
---|
.. | .. |
---|
921 | 1257 | } |
---|
922 | 1258 | } |
---|
923 | 1259 | |
---|
924 | | - String string = (String) object; |
---|
925 | | - |
---|
926 | 1260 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
927 | 1261 | // if( object instanceof java.io.File[]) |
---|
928 | 1262 | // { |
---|
.. | .. |
---|
930 | 1264 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
931 | 1265 | // return; |
---|
932 | 1266 | // } |
---|
933 | | - if (string.charAt(0) == '/') |
---|
| 1267 | + |
---|
| 1268 | + String string = object.toString(); |
---|
| 1269 | + |
---|
| 1270 | + // File path for Mac and Windows |
---|
| 1271 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
934 | 1272 | { |
---|
935 | 1273 | // file(s) |
---|
936 | 1274 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
957 | 1295 | |
---|
958 | 1296 | flashIt = false; |
---|
959 | 1297 | CameraPane pane = (CameraPane) target; |
---|
960 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1298 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
961 | 1299 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
962 | 1300 | |
---|
963 | 1301 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
973 | 1311 | |
---|
974 | 1312 | assert target == objEditor.jTree; |
---|
975 | 1313 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1314 | + Object3D destinationLeaf; |
---|
976 | 1315 | try { |
---|
977 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1316 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
978 | 1317 | } catch (Exception e) { |
---|
979 | 1318 | System.out.println("destinationPath : " + destinationPath); |
---|
980 | 1319 | return; |
---|
981 | 1320 | } |
---|
982 | 1321 | |
---|
983 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1322 | + for (int i=group.selection.size(); --i>=0;) |
---|
984 | 1323 | { |
---|
| 1324 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1325 | + |
---|
| 1326 | + // Cannot move into itself |
---|
| 1327 | + if (child == destinationLeaf) |
---|
| 1328 | + return; |
---|
| 1329 | + } |
---|
| 1330 | + |
---|
| 1331 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1332 | +// { |
---|
985 | 1333 | loadClipboard(true); |
---|
986 | 1334 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
987 | 1335 | pasteInto(false, false); |
---|
988 | | - } else { |
---|
989 | | - loadClipboard(false); |
---|
990 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
991 | | - pasteInto(false, false); // true); // ??? |
---|
992 | | - } |
---|
| 1336 | +// } else { |
---|
| 1337 | +// loadClipboard(false); |
---|
| 1338 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1339 | +// pasteInto(false, false); // true); // ??? |
---|
| 1340 | +// } |
---|
993 | 1341 | } |
---|
994 | 1342 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
995 | 1343 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1094 | 1442 | { |
---|
1095 | 1443 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1096 | 1444 | //heightFieldItem.addActionListener(this); |
---|
1097 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1098 | | - gridItem.addActionListener(this); |
---|
1099 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1100 | | - rectoidItem.addActionListener(this); |
---|
1101 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1102 | | - ellipsoidItem.addActionListener(this); |
---|
1103 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1104 | | - coneItem.addActionListener(this); |
---|
1105 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1106 | | - torusItem.addActionListener(this); |
---|
1107 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1108 | | - superItem.addActionListener(this); |
---|
| 1445 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1446 | +// gridItem.addActionListener(this); |
---|
| 1447 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1448 | +// rectoidItem.addActionListener(this); |
---|
| 1449 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1450 | +// ellipsoidItem.addActionListener(this); |
---|
| 1451 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1452 | +// coneItem.addActionListener(this); |
---|
| 1453 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1454 | +// torusItem.addActionListener(this); |
---|
| 1455 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1456 | +// superItem.addActionListener(this); |
---|
| 1457 | + |
---|
| 1458 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1459 | + cameraItem.addActionListener(this); |
---|
| 1460 | + |
---|
| 1461 | + if (!Globals.ADVANCED) |
---|
| 1462 | + { |
---|
1109 | 1463 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1110 | 1464 | kleinItem.addActionListener(this); |
---|
1111 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1112 | | - particleItem.addActionListener(this); |
---|
| 1465 | + } |
---|
| 1466 | + |
---|
| 1467 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1468 | +// particleItem.addActionListener(this); |
---|
1113 | 1469 | if (Globals.ADVANCED) |
---|
1114 | 1470 | { |
---|
1115 | 1471 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1135 | 1491 | } |
---|
1136 | 1492 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1137 | 1493 | bezierItem.addActionListener(this); |
---|
1138 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1139 | | - overlayItem.addActionListener(this); |
---|
1140 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1141 | | - lightItem.addActionListener(this); |
---|
| 1494 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1495 | +// overlayItem.addActionListener(this); |
---|
| 1496 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1497 | +// lightItem.addActionListener(this); |
---|
1142 | 1498 | menu.add("-"); |
---|
1143 | 1499 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1144 | 1500 | //superLoopItem.addActionListener(this); |
---|
1145 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1146 | | - loopItem.addActionListener(this); |
---|
| 1501 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1502 | +// loopItem.addActionListener(this); |
---|
1147 | 1503 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1148 | 1504 | doubleItem.addActionListener(this); |
---|
1149 | 1505 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1159 | 1515 | animationItem.addItemListener(this); |
---|
1160 | 1516 | animationItem.setState(Globals.ANIMATION); |
---|
1161 | 1517 | |
---|
| 1518 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1519 | + archiveItem.addActionListener(this); |
---|
| 1520 | + |
---|
1162 | 1521 | menu.add("-"); |
---|
1163 | 1522 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1164 | 1523 | parseverticesItem.addActionListener(this); |
---|
1165 | 1524 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1166 | 1525 | textureFieldItem.addActionListener(this); |
---|
1167 | | - alignItem = menu.add(new MenuItem("Align Object")); |
---|
| 1526 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1168 | 1527 | alignItem.addActionListener(this); |
---|
1169 | 1528 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1170 | 1529 | reduceMorphItem.addActionListener(this); |
---|
1171 | 1530 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1172 | 1531 | reduce34MorphItem.addActionListener(this); |
---|
1173 | | - |
---|
| 1532 | + menu.add("-"); |
---|
| 1533 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1534 | + memoryItem.addActionListener(this); |
---|
1174 | 1535 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1175 | 1536 | computeAOItem.addActionListener(this); |
---|
1176 | 1537 | |
---|
.. | .. |
---|
1179 | 1540 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1180 | 1541 | mirrorItem.addActionListener(this); |
---|
1181 | 1542 | menu.add("-"); |
---|
1182 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1183 | | - memoryItem.addActionListener(this); |
---|
1184 | 1543 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1185 | 1544 | analyzeItem.addActionListener(this); |
---|
1186 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1545 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1187 | 1546 | dumpItem.addActionListener(this); |
---|
1188 | 1547 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1189 | 1548 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1324 | 1683 | shadow.material = new cMaterial(obj.material); |
---|
1325 | 1684 | shadow.material.diffuse = 0.0001f; |
---|
1326 | 1685 | shadow.material.specular = 0.0001f; |
---|
| 1686 | + //shadow.projectedVertices[1].x = 300; |
---|
1327 | 1687 | |
---|
1328 | 1688 | makeSomething(shadow); |
---|
1329 | 1689 | } |
---|
| 1690 | + |
---|
| 1691 | + private void ClearUnpinned() |
---|
| 1692 | + { |
---|
| 1693 | + //for (Object3D obj : listUI) |
---|
| 1694 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1695 | + { |
---|
| 1696 | + Object3D obj = listUI.elementAt(i); |
---|
| 1697 | + if (!obj.pinned) |
---|
| 1698 | + { |
---|
| 1699 | + obj.CloseUI(); |
---|
| 1700 | + listUI.remove(i); |
---|
| 1701 | + } |
---|
| 1702 | + } |
---|
| 1703 | + } |
---|
| 1704 | + |
---|
| 1705 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1706 | + { |
---|
| 1707 | + // if (!(elem instanceof Composite)) |
---|
| 1708 | + // newWindow = false; |
---|
| 1709 | + listUI.add(elem); |
---|
| 1710 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1711 | + System.out.println("edit : " + elem); |
---|
| 1712 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1713 | + } |
---|
1330 | 1714 | |
---|
1331 | 1715 | /** |
---|
1332 | 1716 | * applyExample |
---|
.. | .. |
---|
1530 | 1914 | |
---|
1531 | 1915 | void Overwrite(int mask) |
---|
1532 | 1916 | { |
---|
1533 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1917 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1534 | 1918 | { |
---|
1535 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1919 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1536 | 1920 | |
---|
1537 | 1921 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1538 | 1922 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1571 | 1955 | { |
---|
1572 | 1956 | ScreenFit(); |
---|
1573 | 1957 | } else |
---|
1574 | | - if (source == switchItem) |
---|
| 1958 | + if (source == switchViewItem) |
---|
1575 | 1959 | { |
---|
1576 | 1960 | cVector v1 = new cVector(); |
---|
1577 | 1961 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1580 | 1964 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1581 | 1965 | objEditor.cameraView.repaint(); |
---|
1582 | 1966 | } else |
---|
1583 | | - if (source == rectoidItem) |
---|
| 1967 | + if (source == rectoidItem || source == boxButton) |
---|
1584 | 1968 | { |
---|
1585 | 1969 | makeSomething(new Box()); |
---|
1586 | 1970 | } else |
---|
1587 | | - if (source == particleItem) |
---|
| 1971 | + if (source == particleItem || source == particlesButton) |
---|
1588 | 1972 | { |
---|
1589 | 1973 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1590 | 1974 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1663 | 2047 | |
---|
1664 | 2048 | makeSomething(obj); |
---|
1665 | 2049 | } else |
---|
1666 | | - if (source == gridItem) |
---|
| 2050 | + if (source == gridItem || source == gridButton) |
---|
1667 | 2051 | { |
---|
1668 | 2052 | makeSomething(new Grid()); |
---|
1669 | 2053 | } else |
---|
1670 | | - if (source == ellipsoidItem) |
---|
| 2054 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1671 | 2055 | { |
---|
1672 | 2056 | makeSomething(new Sphere()); |
---|
1673 | 2057 | } else |
---|
1674 | | - if (source == coneItem) |
---|
| 2058 | + if (source == coneItem || source == coneButton) |
---|
1675 | 2059 | { |
---|
1676 | 2060 | makeSomething(new Cone()); |
---|
1677 | 2061 | } else |
---|
1678 | | - if (source == torusItem) |
---|
| 2062 | + if (source == torusItem || source == torusButton) |
---|
1679 | 2063 | { |
---|
1680 | 2064 | makeSomething(new Torus()); |
---|
1681 | 2065 | } else |
---|
1682 | | - if (source == superItem) |
---|
| 2066 | + if (source == superItem || source == superButton) |
---|
1683 | 2067 | { |
---|
1684 | 2068 | makeSomething(new Superellipsoid()); |
---|
1685 | 2069 | } else |
---|
1686 | | - if (source == kleinItem) |
---|
| 2070 | + if (source == kleinItem || source == kleinButton) |
---|
1687 | 2071 | { |
---|
1688 | 2072 | makeSomething(new Klein()); |
---|
1689 | 2073 | } else |
---|
.. | .. |
---|
1703 | 2087 | { |
---|
1704 | 2088 | makeSomething(new BezierSurface()); |
---|
1705 | 2089 | } else |
---|
1706 | | - if (source == overlayItem) |
---|
| 2090 | + if (source == overlayItem || source == overlayButton) |
---|
1707 | 2091 | { |
---|
1708 | 2092 | /* |
---|
1709 | 2093 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1751 | 2135 | s.setup(); |
---|
1752 | 2136 | makeSomething(s); |
---|
1753 | 2137 | } else |
---|
1754 | | - if (source == lightItem) |
---|
| 2138 | + if (source == lightItem || source == lightButton) |
---|
1755 | 2139 | { |
---|
1756 | 2140 | makeSomething(new Light()); |
---|
1757 | 2141 | } else |
---|
.. | .. |
---|
1801 | 2185 | |
---|
1802 | 2186 | group(g); |
---|
1803 | 2187 | } else |
---|
1804 | | - if (source == loopItem) |
---|
| 2188 | + if (source == loopItem || source == loopButton) |
---|
1805 | 2189 | { |
---|
1806 | 2190 | Composite csg = new GroupLeaf(); |
---|
1807 | 2191 | csg.count = 5; |
---|
1808 | 2192 | group(csg); |
---|
1809 | | - Composite child = new cGroup(); |
---|
| 2193 | + Composite child = new cGroup("Branch"); |
---|
1810 | 2194 | csg.addChild(child); |
---|
1811 | 2195 | child.addChild(csg); |
---|
1812 | 2196 | } else |
---|
1813 | 2197 | if (source == doubleItem) |
---|
1814 | 2198 | { |
---|
1815 | | - Composite csg = new GroupLeaf(); |
---|
| 2199 | + Composite csg = new GroupLeaf("Fork"); |
---|
1816 | 2200 | csg.count = 5; |
---|
1817 | 2201 | group(csg); |
---|
1818 | | - Composite child = new cGroup(); |
---|
| 2202 | + Composite child = new cGroup("Branch A"); |
---|
1819 | 2203 | csg.addChild(child); |
---|
1820 | 2204 | child.addChild(csg); |
---|
1821 | | - child = new cGroup(); |
---|
| 2205 | + child = new cGroup("Branch B"); |
---|
1822 | 2206 | csg.addChild(child); |
---|
1823 | 2207 | child.addChild(csg); |
---|
1824 | 2208 | } else |
---|
1825 | 2209 | if (source == tripleItem) |
---|
1826 | 2210 | { |
---|
1827 | | - Composite csg = new GroupLeaf(); |
---|
| 2211 | + Composite csg = new GroupLeaf("Trident"); |
---|
1828 | 2212 | csg.count = 4; |
---|
1829 | 2213 | group(csg); |
---|
1830 | 2214 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1836 | 2220 | child = new cGroup(); |
---|
1837 | 2221 | csg.addChild(child); |
---|
1838 | 2222 | child.addChild(csg); |
---|
1839 | | - } else |
---|
1840 | | - |
---|
1841 | | - if (source == importGFDItem) |
---|
1842 | | - { |
---|
1843 | | - ImportGFD(); |
---|
1844 | | - } else |
---|
1845 | | - if (source == importVRMLX3DItem) |
---|
1846 | | - { |
---|
1847 | | - ImportVRMLX3D(); |
---|
1848 | | - } else |
---|
1849 | | - if (source == import3DSItem) |
---|
1850 | | - { |
---|
1851 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1852 | | - } else |
---|
1853 | | - if (source == importOBJItem) |
---|
1854 | | - { |
---|
1855 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1856 | 2223 | } else |
---|
1857 | 2224 | if (source == computeAOItem) |
---|
1858 | 2225 | { |
---|
.. | .. |
---|
1872 | 2239 | if (source == invariantsItem) |
---|
1873 | 2240 | { |
---|
1874 | 2241 | System.out.println("Invariants:"); |
---|
1875 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2242 | + Grafreed.grafreeD.universe.invariants(); |
---|
1876 | 2243 | } else |
---|
1877 | 2244 | if (source == memoryItem) |
---|
1878 | 2245 | { |
---|
.. | .. |
---|
1891 | 2258 | { |
---|
1892 | 2259 | DumpObject(); |
---|
1893 | 2260 | } else |
---|
| 2261 | + if (source == minButton) |
---|
| 2262 | + { |
---|
| 2263 | + Minimize(); |
---|
| 2264 | + } else |
---|
| 2265 | + if (source == maxButton) |
---|
| 2266 | + { |
---|
| 2267 | + Maximize(); |
---|
| 2268 | + } else |
---|
| 2269 | + if (source == fullButton) |
---|
| 2270 | + { |
---|
| 2271 | + ToggleFullScreen(); |
---|
| 2272 | + } else |
---|
| 2273 | + if (source == undoButton) |
---|
| 2274 | + { |
---|
| 2275 | + // Go to previous version |
---|
| 2276 | + //if (!Undo()) |
---|
| 2277 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2278 | + Undo(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == restoreButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Restore current version |
---|
| 2283 | + Restore(); |
---|
| 2284 | + } else |
---|
| 2285 | + if (source == replaceButton) |
---|
| 2286 | + { |
---|
| 2287 | + // Overwrite current version |
---|
| 2288 | + Replace(); |
---|
| 2289 | + } else |
---|
| 2290 | + if (source == redoButton) |
---|
| 2291 | + { |
---|
| 2292 | + // Go to next version |
---|
| 2293 | + Redo(); |
---|
| 2294 | + } else |
---|
| 2295 | + if (source == saveButton) |
---|
| 2296 | + { |
---|
| 2297 | + // Save a new version |
---|
| 2298 | + if (!Save(true)) |
---|
| 2299 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2300 | + } else |
---|
1894 | 2301 | if (source == oneStepButton) |
---|
1895 | 2302 | { |
---|
1896 | 2303 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1898 | 2305 | } else |
---|
1899 | 2306 | if (source == screenfitButton) |
---|
1900 | 2307 | { |
---|
1901 | | - //Reload(lastConverter, lastFilename, true); |
---|
1902 | 2308 | ScreenFit(); |
---|
1903 | 2309 | } else |
---|
1904 | 2310 | if (source == screenfitpointButton) |
---|
1905 | 2311 | { |
---|
1906 | | - //Reload(lastConverter, lastFilename, true); |
---|
1907 | 2312 | ScreenFitPoint(); |
---|
1908 | 2313 | } else |
---|
1909 | 2314 | if (source == snapobjectButton) |
---|
1910 | 2315 | { |
---|
1911 | | - //Reload(lastConverter, lastFilename, true); |
---|
1912 | 2316 | SnapObject(); |
---|
1913 | 2317 | } else |
---|
1914 | 2318 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1945 | 2349 | { |
---|
1946 | 2350 | loadClipboard(true); |
---|
1947 | 2351 | } else |
---|
| 2352 | + if (source == undoItem) |
---|
| 2353 | + { |
---|
| 2354 | + Undo(); |
---|
| 2355 | + } else |
---|
| 2356 | + if (source == redoItem) |
---|
| 2357 | + { |
---|
| 2358 | + Redo(); |
---|
| 2359 | + } else |
---|
1948 | 2360 | if (source == duplicateItem) |
---|
1949 | 2361 | { |
---|
1950 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2362 | + Object3D keep = Grafreed.clipboard; |
---|
1951 | 2363 | loadClipboard(false); |
---|
1952 | 2364 | paste(false); |
---|
1953 | | - GrafreeD.clipboard = keep; |
---|
| 2365 | + Grafreed.clipboard = keep; |
---|
1954 | 2366 | } else |
---|
1955 | 2367 | if (source == cloneItem) |
---|
1956 | 2368 | { |
---|
.. | .. |
---|
2170 | 2582 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2171 | 2583 | // refreshContents(); |
---|
2172 | 2584 | // } |
---|
2173 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2585 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2174 | 2586 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2587 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2588 | |
---|
2177 | 2589 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2590 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2222 | 2634 | } else |
---|
2223 | 2635 | if (source == setMasterItem) |
---|
2224 | 2636 | { |
---|
2225 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2637 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2226 | 2638 | { |
---|
2227 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2639 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2228 | 2640 | |
---|
2229 | 2641 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2230 | 2642 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2237 | 2649 | { |
---|
2238 | 2650 | if (group.selection.size() == 1) |
---|
2239 | 2651 | { |
---|
2240 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2652 | + if (Grafreed.clipboard.size() == 1) |
---|
2241 | 2653 | { |
---|
2242 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2654 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2243 | 2655 | |
---|
2244 | 2656 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2245 | 2657 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2256 | 2668 | { |
---|
2257 | 2669 | RevertMeshes(); |
---|
2258 | 2670 | } else |
---|
2259 | | - if (source == resetMeshItem) |
---|
| 2671 | + if (source == resetAllItem) |
---|
2260 | 2672 | { |
---|
2261 | 2673 | ResetAll(); |
---|
2262 | 2674 | } else |
---|
.. | .. |
---|
2264 | 2676 | { |
---|
2265 | 2677 | StepAll(); |
---|
2266 | 2678 | } else |
---|
2267 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2679 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2268 | 2680 | { |
---|
2269 | 2681 | //int indices[] = jList.getSelectedIndices(); |
---|
2270 | 2682 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2276 | 2688 | { |
---|
2277 | 2689 | ClearSelection(true); |
---|
2278 | 2690 | } else |
---|
2279 | | - if (source == grabItem) |
---|
| 2691 | + if (source == grabItem || source == groupButton) |
---|
2280 | 2692 | { |
---|
2281 | | - group(new cGroup(), true); |
---|
| 2693 | + group(new cGroup(), false); // true); |
---|
2282 | 2694 | } else |
---|
2283 | 2695 | if (source == hideItem) |
---|
2284 | 2696 | { |
---|
.. | .. |
---|
2296 | 2708 | { |
---|
2297 | 2709 | makeSomething(new Camera()); |
---|
2298 | 2710 | } else |
---|
2299 | | - if (source == compositeItem) |
---|
| 2711 | + if (source == compositeItem || source == compositeButton) |
---|
2300 | 2712 | { |
---|
2301 | 2713 | group(new Composite()); |
---|
2302 | 2714 | } else |
---|
2303 | | - if (source == randomItem) |
---|
| 2715 | + if (source == switchItem || source == switchButton) |
---|
2304 | 2716 | { |
---|
2305 | 2717 | RandomNode random = new RandomNode(); |
---|
2306 | 2718 | group(random); |
---|
.. | .. |
---|
2402 | 2814 | { |
---|
2403 | 2815 | group(new cLinker()); |
---|
2404 | 2816 | } else |
---|
2405 | | - if (source == textureItem) |
---|
| 2817 | + if (source == textureItem || source == textureButton) |
---|
2406 | 2818 | { |
---|
2407 | 2819 | group(new TextureNode()); |
---|
2408 | 2820 | } else |
---|
.. | .. |
---|
2422 | 2834 | { |
---|
2423 | 2835 | CastShadow(2); |
---|
2424 | 2836 | } else |
---|
2425 | | - if (source == ungroupItem) |
---|
| 2837 | + if (source == ungroupItem || source == ungroupButton) |
---|
2426 | 2838 | { |
---|
2427 | | - //ungroup(); |
---|
| 2839 | + boolean hasRoot = false; |
---|
| 2840 | + |
---|
2428 | 2841 | for (int i=0; i<group.selection.size(); i++) |
---|
2429 | 2842 | { |
---|
2430 | | - Ungroup(group.selection.get(i)); |
---|
| 2843 | + if (group.selection.get(i) == group) |
---|
| 2844 | + { |
---|
| 2845 | + hasRoot = true; |
---|
| 2846 | + break; |
---|
| 2847 | + } |
---|
2431 | 2848 | } |
---|
2432 | 2849 | |
---|
2433 | | - ClearSelection(false); |
---|
2434 | | - |
---|
2435 | | - refreshContents(); |
---|
| 2850 | + if (!hasRoot) |
---|
| 2851 | + { |
---|
| 2852 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2853 | + { |
---|
| 2854 | + Ungroup(group.selection.get(i)); |
---|
| 2855 | + } |
---|
| 2856 | + |
---|
| 2857 | + ClearSelection(false); |
---|
| 2858 | + |
---|
| 2859 | + refreshContents(); |
---|
| 2860 | + } |
---|
2436 | 2861 | } else |
---|
2437 | 2862 | if (source == genUVItem) |
---|
2438 | 2863 | { |
---|
.. | .. |
---|
2444 | 2869 | } else |
---|
2445 | 2870 | if (source == genNormalsMESHItem) |
---|
2446 | 2871 | { |
---|
2447 | | - GenNormals(true); // TODO |
---|
| 2872 | + GenNormalsMESH(); |
---|
2448 | 2873 | } else |
---|
2449 | 2874 | if (source == genNormalsORGANItem) |
---|
2450 | 2875 | { |
---|
.. | .. |
---|
2509 | 2934 | if (source == unmarkleavesItem) |
---|
2510 | 2935 | { |
---|
2511 | 2936 | MarkLeaves(false); |
---|
| 2937 | + } else |
---|
| 2938 | + if (source == rewindleavesItem) |
---|
| 2939 | + { |
---|
| 2940 | + RewindLeaves(true); |
---|
| 2941 | + } else |
---|
| 2942 | + if (source == unrewindleavesItem) |
---|
| 2943 | + { |
---|
| 2944 | + RewindLeaves(false); |
---|
| 2945 | + } else |
---|
| 2946 | + if (source == randomleavesItem) |
---|
| 2947 | + { |
---|
| 2948 | + RandomLeaves(true); |
---|
| 2949 | + } else |
---|
| 2950 | + if (source == unrandomleavesItem) |
---|
| 2951 | + { |
---|
| 2952 | + RandomLeaves(false); |
---|
2512 | 2953 | } else |
---|
2513 | 2954 | if (source == flipVItem) |
---|
2514 | 2955 | { |
---|
.. | .. |
---|
2594 | 3035 | { |
---|
2595 | 3036 | SmoothMesh(); |
---|
2596 | 3037 | } else |
---|
2597 | | - if (source == transformgeometryItem) |
---|
| 3038 | + if (source == transformGeometryItem) |
---|
2598 | 3039 | { |
---|
2599 | 3040 | TransformGeometry(); |
---|
| 3041 | + } else |
---|
| 3042 | + if (source == transformChildrenItem) |
---|
| 3043 | + { |
---|
| 3044 | + TransformChildren(); |
---|
2600 | 3045 | } else |
---|
2601 | 3046 | if (source == resetTransformItem) |
---|
2602 | 3047 | { |
---|
.. | .. |
---|
2604 | 3049 | } else |
---|
2605 | 3050 | if (source == resetCentroidItem) |
---|
2606 | 3051 | { |
---|
2607 | | - ResetCentroid(); |
---|
| 3052 | + ResetCentroid(true); |
---|
| 3053 | + } else |
---|
| 3054 | + if (source == resetCentroidXZItem) |
---|
| 3055 | + { |
---|
| 3056 | + ResetCentroid(false); |
---|
2608 | 3057 | } else |
---|
2609 | 3058 | if (source == resetParentItem) |
---|
2610 | 3059 | { |
---|
.. | .. |
---|
2709 | 3158 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2710 | 3159 | { |
---|
2711 | 3160 | obj = (Object3D)e.nextElement(); |
---|
2712 | | - obj.SetBumpTexture(null); |
---|
| 3161 | + obj.ResetBumpTexture(); |
---|
2713 | 3162 | } |
---|
2714 | 3163 | |
---|
2715 | 3164 | refreshContents(); |
---|
.. | .. |
---|
2725 | 3174 | |
---|
2726 | 3175 | refreshContents(); |
---|
2727 | 3176 | } else |
---|
| 3177 | + if (source == embedTexturesItem) |
---|
| 3178 | + { |
---|
| 3179 | + Object3D obj; |
---|
| 3180 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3181 | + { |
---|
| 3182 | + obj = (Object3D)e.nextElement(); |
---|
| 3183 | + obj.EmbedTextures(true); |
---|
| 3184 | + } |
---|
| 3185 | + |
---|
| 3186 | + refreshContents(); |
---|
| 3187 | + } else |
---|
| 3188 | + if (source == deEmbedTexturesItem) |
---|
| 3189 | + { |
---|
| 3190 | + Object3D obj; |
---|
| 3191 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3192 | + { |
---|
| 3193 | + obj = (Object3D)e.nextElement(); |
---|
| 3194 | + obj.EmbedTextures(false); |
---|
| 3195 | + } |
---|
| 3196 | + |
---|
| 3197 | + CameraPane.texturepigment.clear(); |
---|
| 3198 | + CameraPane.texturebump.clear(); |
---|
| 3199 | + |
---|
| 3200 | + refreshContents(); |
---|
| 3201 | + } else |
---|
2728 | 3202 | if (source == flashSelectionButton) |
---|
2729 | 3203 | { |
---|
2730 | 3204 | CameraPane.flash = true; |
---|
.. | .. |
---|
2736 | 3210 | if (source == twoButton) |
---|
2737 | 3211 | { |
---|
2738 | 3212 | radio.layout = twoButton; |
---|
| 3213 | + |
---|
| 3214 | + if (CameraPane.FULLSCREEN) |
---|
| 3215 | + fullscreenLayout = radio.layout; |
---|
| 3216 | + |
---|
2739 | 3217 | // bug |
---|
2740 | 3218 | //gridPanel.setDividerLocation(1.0); |
---|
2741 | 3219 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2768 | 3246 | bigThree.ClearUI(); |
---|
2769 | 3247 | bigThree.add(centralPanel); |
---|
2770 | 3248 | bigThree.FlushUI(); |
---|
| 3249 | + |
---|
| 3250 | + cameraView.requestFocusInWindow(); |
---|
| 3251 | + |
---|
| 3252 | +// refreshContents(true); |
---|
| 3253 | +// |
---|
| 3254 | +// try |
---|
| 3255 | +// { |
---|
| 3256 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3257 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3258 | +// bot.mouseMove(100, 100); |
---|
| 3259 | +// bot.mousePress(mask); |
---|
| 3260 | +// bot.mouseRelease(mask); |
---|
| 3261 | +// } |
---|
| 3262 | +// catch (Exception e) |
---|
| 3263 | +// { |
---|
| 3264 | +// |
---|
| 3265 | +// } |
---|
| 3266 | + |
---|
2771 | 3267 | } else |
---|
2772 | 3268 | if (source == threeButton) |
---|
2773 | 3269 | { |
---|
2774 | 3270 | radio.layout = threeButton; |
---|
| 3271 | + |
---|
| 3272 | + if (CameraPane.FULLSCREEN) |
---|
| 3273 | + fullscreenLayout = radio.layout; |
---|
2775 | 3274 | |
---|
2776 | 3275 | // bigThree.remove(scenePanel); |
---|
2777 | 3276 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2801 | 3300 | // centralPanel.setVisible(true); |
---|
2802 | 3301 | // XYZPanel.setVisible(true); |
---|
2803 | 3302 | bigThree.ClearUI(); |
---|
| 3303 | + bigThree.add(scenePanel); |
---|
2804 | 3304 | bigThree.add(centralPanel); |
---|
2805 | | - bigThree.add(XYZPanel); |
---|
2806 | 3305 | bigThree.FlushUI(); |
---|
| 3306 | + |
---|
| 3307 | + cameraView.requestFocusInWindow(); |
---|
2807 | 3308 | } else |
---|
2808 | 3309 | if (source == fourButton) |
---|
2809 | 3310 | { |
---|
2810 | 3311 | radio.layout = fourButton; |
---|
| 3312 | + |
---|
| 3313 | + if (CameraPane.FULLSCREEN) |
---|
| 3314 | + fullscreenLayout = radio.layout; |
---|
2811 | 3315 | |
---|
2812 | 3316 | // bigThree.remove(scenePanel); |
---|
2813 | 3317 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2839 | 3343 | bigThree.ClearUI(); |
---|
2840 | 3344 | bigThree.add(scenePanel); |
---|
2841 | 3345 | bigThree.FlushUI(); |
---|
| 3346 | + |
---|
| 3347 | + cameraView.requestFocusInWindow(); |
---|
2842 | 3348 | } else |
---|
2843 | 3349 | if (source == sixButton) |
---|
2844 | 3350 | { |
---|
2845 | 3351 | radio.layout = sixButton; |
---|
| 3352 | + |
---|
| 3353 | + if (CameraPane.FULLSCREEN) |
---|
| 3354 | + fullscreenLayout = radio.layout; |
---|
2846 | 3355 | |
---|
2847 | 3356 | // bigThree.remove(scenePanel); |
---|
2848 | 3357 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2872 | 3381 | // centralPanel.setVisible(true); |
---|
2873 | 3382 | // XYZPanel.setVisible(false); |
---|
2874 | 3383 | bigThree.ClearUI(); |
---|
2875 | | - bigThree.add(scenePanel); |
---|
2876 | 3384 | bigThree.add(centralPanel); |
---|
| 3385 | + bigThree.add(scenePanel); |
---|
2877 | 3386 | bigThree.FlushUI(); |
---|
| 3387 | + |
---|
| 3388 | + cameraView.requestFocusInWindow(); |
---|
2878 | 3389 | } else |
---|
2879 | 3390 | if (source == sevenButton) |
---|
2880 | 3391 | { |
---|
2881 | 3392 | radio.layout = sevenButton; |
---|
| 3393 | + |
---|
| 3394 | + if (CameraPane.FULLSCREEN) |
---|
| 3395 | + fullscreenLayout = radio.layout; |
---|
2882 | 3396 | |
---|
2883 | 3397 | // bigThree.remove(scenePanel); |
---|
2884 | 3398 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2912 | 3426 | bigThree.add(centralPanel); |
---|
2913 | 3427 | bigThree.add(XYZPanel); |
---|
2914 | 3428 | bigThree.FlushUI(); |
---|
| 3429 | + |
---|
| 3430 | + cameraView.requestFocusInWindow(); |
---|
2915 | 3431 | } else |
---|
2916 | 3432 | if (source == rootButton) |
---|
2917 | 3433 | { |
---|
.. | .. |
---|
2923 | 3439 | EditObject(obj); |
---|
2924 | 3440 | } |
---|
2925 | 3441 | |
---|
| 3442 | + cameraView.requestFocusInWindow(); |
---|
2926 | 3443 | refreshContents(true); |
---|
2927 | 3444 | } else |
---|
2928 | 3445 | if (source == closeButton) |
---|
.. | .. |
---|
2932 | 3449 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2933 | 3450 | { |
---|
2934 | 3451 | ab = (cRadio)e.nextElement(); |
---|
2935 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3452 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2936 | 3453 | { |
---|
| 3454 | + // Patch to avoid bug with transparency. |
---|
| 3455 | + if (!ab.hadMaterial) |
---|
| 3456 | + { |
---|
| 3457 | + ab.object.material = null; |
---|
| 3458 | + } |
---|
| 3459 | + |
---|
2937 | 3460 | buttonGroup.remove(ab); |
---|
2938 | 3461 | radioPanel.remove(ab); |
---|
2939 | 3462 | |
---|
2940 | | - ab.GetObject().editWindow = null; |
---|
| 3463 | + //ab.GetObject().editWindow = null; |
---|
| 3464 | + ab.GetObject().manipWindow = null; |
---|
2941 | 3465 | // ab.GetObject().objectUI = null; // ????????? |
---|
2942 | 3466 | |
---|
2943 | 3467 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2944 | 3468 | break; |
---|
2945 | 3469 | } |
---|
2946 | 3470 | } |
---|
| 3471 | + |
---|
| 3472 | + cameraView.requestFocusInWindow(); |
---|
2947 | 3473 | refreshContents(true); |
---|
2948 | 3474 | } else |
---|
2949 | 3475 | if (source == editItem || source == editButton) |
---|
2950 | 3476 | { |
---|
| 3477 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3478 | + { |
---|
| 3479 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3480 | + child.pinned = true; |
---|
| 3481 | + } |
---|
| 3482 | + |
---|
2951 | 3483 | EditSelection(false); |
---|
2952 | 3484 | } else |
---|
2953 | 3485 | if (source == uneditButton) |
---|
.. | .. |
---|
2957 | 3489 | Object3D child = (Object3D)e.nextElement(); |
---|
2958 | 3490 | if(child.editWindow != null) |
---|
2959 | 3491 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3492 | + child.pinned = false; |
---|
2960 | 3493 | child.CloseUI(); |
---|
2961 | 3494 | listUI.remove(child); |
---|
2962 | 3495 | |
---|
2963 | | - child.editWindow = null; // ??????????? |
---|
| 3496 | + //child.editWindow = null; // ??????????? |
---|
2964 | 3497 | } |
---|
2965 | 3498 | objEditor.ctrlPanel.FlushUI(); |
---|
2966 | 3499 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
2973 | 3506 | //copy.ClearUI(); |
---|
2974 | 3507 | for (Object3D obj : listUI) |
---|
2975 | 3508 | { |
---|
| 3509 | + obj.pinned = false; |
---|
2976 | 3510 | obj.CloseUI(); |
---|
2977 | 3511 | } |
---|
2978 | 3512 | listUI.clear(); |
---|
.. | .. |
---|
2982 | 3516 | { |
---|
2983 | 3517 | assert(copy == group); |
---|
2984 | 3518 | |
---|
2985 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3519 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2986 | 3520 | |
---|
2987 | 3521 | for (Object3D obj : listUI) |
---|
2988 | 3522 | { |
---|
.. | .. |
---|
3031 | 3565 | } |
---|
3032 | 3566 | |
---|
3033 | 3567 | copy = group; |
---|
| 3568 | + |
---|
| 3569 | + SetUndoStates(); |
---|
| 3570 | + |
---|
3034 | 3571 | //Globals.theRenderer.object = group; |
---|
3035 | 3572 | if(!useclient) |
---|
3036 | 3573 | { |
---|
.. | .. |
---|
3046 | 3583 | frontView.object = group; |
---|
3047 | 3584 | sideView.object = group; |
---|
3048 | 3585 | } |
---|
3049 | | - group.editWindow = this; |
---|
| 3586 | + |
---|
| 3587 | +// fix "+" issue |
---|
| 3588 | + //group.editWindow = this; |
---|
| 3589 | + group.manipWindow = this; |
---|
| 3590 | + |
---|
3050 | 3591 | /* |
---|
3051 | 3592 | currentLayout = radio.layout; |
---|
3052 | 3593 | if (currentLayout == null) |
---|
3053 | 3594 | currentLayout = sevenButton; |
---|
3054 | 3595 | */ |
---|
3055 | 3596 | radio.layout.doClick(); |
---|
| 3597 | + |
---|
| 3598 | + ClearUnpinned(); |
---|
| 3599 | + //Grafreed.Assert(group != null); |
---|
| 3600 | + //Grafreed.Assert(group.selection != null); |
---|
| 3601 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3602 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3603 | + EditSelection(false); |
---|
3056 | 3604 | keepparent = group.parent; |
---|
3057 | 3605 | // PARENT = NULL or not??? |
---|
3058 | 3606 | //group.parent = null; // ROOT |
---|
3059 | 3607 | //group.attributes = -1; |
---|
3060 | 3608 | ResetModel(); |
---|
| 3609 | + |
---|
| 3610 | + cameraView.requestFocusInWindow(); |
---|
3061 | 3611 | refreshContents(true); |
---|
3062 | | - } |
---|
| 3612 | + } else if (event.getSource() == editCameraItem) |
---|
| 3613 | + { |
---|
| 3614 | + cameraView.ProtectCamera(); |
---|
| 3615 | + cameraView.repaint(); |
---|
| 3616 | + return; |
---|
| 3617 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3618 | + { |
---|
| 3619 | + cameraView.RevertCamera(); |
---|
| 3620 | + cameraView.repaint(); |
---|
| 3621 | + return; |
---|
| 3622 | + // } else if (event.getSource() == textureButton) |
---|
| 3623 | + // { |
---|
| 3624 | + // return; // true; |
---|
| 3625 | + } |
---|
3063 | 3626 | else |
---|
3064 | 3627 | { |
---|
3065 | 3628 | //return super.action(event, arg); |
---|
.. | .. |
---|
3068 | 3631 | } |
---|
3069 | 3632 | |
---|
3070 | 3633 | boolean useclient = false; |
---|
3071 | | - cRadio radio; |
---|
3072 | 3634 | |
---|
3073 | 3635 | void ToggleRoot() |
---|
3074 | 3636 | { |
---|
.. | .. |
---|
3120 | 3682 | refreshContents(); |
---|
3121 | 3683 | } |
---|
3122 | 3684 | |
---|
| 3685 | + void TransformChildren() |
---|
| 3686 | + { |
---|
| 3687 | + Object3D obj; |
---|
| 3688 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3689 | + { |
---|
| 3690 | + obj = (Object3D)e.nextElement(); |
---|
| 3691 | + obj.KeepTextureMatrices(); |
---|
| 3692 | + obj.TransformChildren(); |
---|
| 3693 | + obj.RestoreTextureMatrices(); |
---|
| 3694 | + |
---|
| 3695 | +// if (obj.parent == null) |
---|
| 3696 | +// { |
---|
| 3697 | +// System.out.println("NULL PARENT!"); |
---|
| 3698 | +// new Exception().printStackTrace(); |
---|
| 3699 | +// } |
---|
| 3700 | +// else |
---|
| 3701 | +// TouchTransform(obj); |
---|
| 3702 | +// //obj.parent.Touch(); |
---|
| 3703 | + } |
---|
| 3704 | + |
---|
| 3705 | + refreshContents(); |
---|
| 3706 | + } |
---|
3123 | 3707 | |
---|
3124 | 3708 | void ResetTransform() |
---|
3125 | 3709 | { |
---|
.. | .. |
---|
3232 | 3816 | refreshContents(); |
---|
3233 | 3817 | } |
---|
3234 | 3818 | |
---|
3235 | | - void ResetCentroid() |
---|
| 3819 | + void ResetCentroid(boolean full) |
---|
3236 | 3820 | { |
---|
3237 | 3821 | Object3D obj; |
---|
3238 | 3822 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3247 | 3831 | LA.matIdentity(Object3D.mat); |
---|
3248 | 3832 | obj.getBounds(minima, maxima, false); |
---|
3249 | 3833 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3250 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3834 | + if (full) |
---|
| 3835 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3251 | 3836 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3252 | 3837 | obj.TransformMesh(Object3D.mat); |
---|
| 3838 | + |
---|
3253 | 3839 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3254 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3840 | + if (full) |
---|
| 3841 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3255 | 3842 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3843 | + |
---|
3256 | 3844 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3257 | 3845 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3258 | 3846 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3281 | 3869 | |
---|
3282 | 3870 | int size = obj.MemorySize(); |
---|
3283 | 3871 | |
---|
3284 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3872 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3873 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3285 | 3874 | } |
---|
3286 | 3875 | } |
---|
3287 | 3876 | catch (Exception e) |
---|
.. | .. |
---|
3318 | 3907 | obj = (Object3D)e.nextElement(); |
---|
3319 | 3908 | |
---|
3320 | 3909 | System.out.println("Object is: " + obj); |
---|
3321 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3910 | + Grafreed.AnalyzeObject(obj); |
---|
3322 | 3911 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3323 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3912 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3324 | 3913 | |
---|
3325 | 3914 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3326 | 3915 | } |
---|
.. | .. |
---|
3362 | 3951 | void GenNormals(boolean crease) |
---|
3363 | 3952 | { |
---|
3364 | 3953 | group.GenNormalsS(crease); |
---|
| 3954 | + |
---|
| 3955 | + refreshContents(); |
---|
| 3956 | + } |
---|
| 3957 | + |
---|
| 3958 | + void GenNormalsMESH() |
---|
| 3959 | + { |
---|
| 3960 | + group.GenNormalsMeshS(); |
---|
3365 | 3961 | |
---|
3366 | 3962 | refreshContents(); |
---|
3367 | 3963 | } |
---|
.. | .. |
---|
3534 | 4130 | |
---|
3535 | 4131 | void ParseVertices() |
---|
3536 | 4132 | { |
---|
3537 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3538 | | - GrafreeD.epsequal = true; |
---|
| 4133 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4134 | + Grafreed.epsequal = true; |
---|
3539 | 4135 | |
---|
3540 | 4136 | for (int i=0; i<group.selection.size(); i++) |
---|
3541 | 4137 | { |
---|
.. | .. |
---|
3560 | 4156 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3561 | 4157 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3562 | 4158 | |
---|
3563 | | - g.add(GrafreeD.clipboard); |
---|
| 4159 | + g.add(Grafreed.clipboard); |
---|
3564 | 4160 | |
---|
3565 | 4161 | buffer.add(g); |
---|
3566 | 4162 | } |
---|
.. | .. |
---|
3575 | 4171 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3576 | 4172 | } |
---|
3577 | 4173 | |
---|
3578 | | - GrafreeD.epsequal = epsequal; |
---|
| 4174 | + Grafreed.epsequal = epsequal; |
---|
3579 | 4175 | |
---|
3580 | 4176 | refreshContents(); |
---|
3581 | 4177 | } |
---|
.. | .. |
---|
3593 | 4189 | String pigment = Object3D.GetPigment(tex); |
---|
3594 | 4190 | //String bump = Object3D.GetBump(tex); |
---|
3595 | 4191 | |
---|
3596 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4192 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4193 | + |
---|
| 4194 | + try |
---|
| 4195 | + { |
---|
| 4196 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4197 | + } |
---|
| 4198 | + catch (Exception e) |
---|
| 4199 | + { |
---|
| 4200 | + System.err.println("FAIL: " + node); |
---|
| 4201 | + } |
---|
3597 | 4202 | |
---|
3598 | 4203 | double s = v.s; |
---|
3599 | 4204 | |
---|
.. | .. |
---|
3725 | 4330 | return; |
---|
3726 | 4331 | |
---|
3727 | 4332 | Object3D poses = group.selection.get(0); |
---|
3728 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4333 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3729 | 4334 | |
---|
3730 | 4335 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3731 | 4336 | |
---|
.. | .. |
---|
3919 | 4524 | |
---|
3920 | 4525 | void ClipMesh() |
---|
3921 | 4526 | { |
---|
3922 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4527 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3923 | 4528 | { |
---|
3924 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4529 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3925 | 4530 | |
---|
3926 | 4531 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3927 | 4532 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3930 | 4535 | // { |
---|
3931 | 4536 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3932 | 4537 | // } |
---|
3933 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4538 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3934 | 4539 | } |
---|
3935 | 4540 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3936 | 4541 | System.out.println("DONE."); |
---|
.. | .. |
---|
3977 | 4582 | void MarkLeaves(boolean hide) |
---|
3978 | 4583 | { |
---|
3979 | 4584 | group.selection.MarkLeaves(hide); |
---|
| 4585 | + refreshContents(); |
---|
| 4586 | + } |
---|
| 4587 | + |
---|
| 4588 | + void RewindLeaves(boolean hide) |
---|
| 4589 | + { |
---|
| 4590 | + group.selection.RewindLeaves(hide); |
---|
| 4591 | + refreshContents(); |
---|
| 4592 | + } |
---|
| 4593 | + |
---|
| 4594 | + void RandomLeaves(boolean hide) |
---|
| 4595 | + { |
---|
| 4596 | + group.selection.RandomLeaves(hide); |
---|
3980 | 4597 | refreshContents(); |
---|
3981 | 4598 | } |
---|
3982 | 4599 | |
---|
.. | .. |
---|
4051 | 4668 | // } |
---|
4052 | 4669 | // } |
---|
4053 | 4670 | |
---|
4054 | | - static boolean allparams = true; |
---|
4055 | | - |
---|
4056 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4057 | | - |
---|
4058 | 4671 | void EditSelection(boolean newWindow) |
---|
4059 | 4672 | { |
---|
| 4673 | + if (group.selection == null) |
---|
| 4674 | + { |
---|
| 4675 | + EditElement(group, newWindow); // ? new |
---|
| 4676 | + return; |
---|
| 4677 | + } |
---|
| 4678 | + |
---|
4060 | 4679 | // aConstraints.gridy = 0; |
---|
4061 | 4680 | for (int i=0; i<group.selection.size(); i++) |
---|
4062 | 4681 | { |
---|
4063 | 4682 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4064 | 4683 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4065 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4684 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4066 | 4685 | |
---|
4067 | 4686 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4068 | | - if(elem != group) |
---|
| 4687 | + if(elem != group || !newWindow) |
---|
4069 | 4688 | { |
---|
4070 | | - // if (!(elem instanceof Composite)) |
---|
4071 | | - // newWindow = false; |
---|
4072 | | - listUI.add(elem); |
---|
4073 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4074 | | - System.out.println("edit : " + elem); |
---|
4075 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4689 | + EditElement(elem, newWindow); // ? new |
---|
4076 | 4690 | } |
---|
4077 | 4691 | } |
---|
4078 | 4692 | } |
---|
.. | .. |
---|
4147 | 4761 | //new Exception().printStackTrace(); |
---|
4148 | 4762 | |
---|
4149 | 4763 | freezemodel = true; |
---|
4150 | | - |
---|
| 4764 | + ClearUnpinned(); |
---|
| 4765 | + |
---|
4151 | 4766 | /**/ |
---|
4152 | 4767 | //switch (event.id) |
---|
4153 | 4768 | { |
---|
.. | .. |
---|
4155 | 4770 | //case 702: // Event.LIST_DESELECT |
---|
4156 | 4771 | group.deselectAll(); |
---|
4157 | 4772 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4158 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4159 | 4773 | if (tps != null) |
---|
4160 | 4774 | { |
---|
4161 | 4775 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4164 | 4778 | |
---|
4165 | 4779 | //if (child.parent != null) |
---|
4166 | 4780 | //child.parent.addSelectee(child); |
---|
| 4781 | + objEditor.SetMaterial(child); |
---|
4167 | 4782 | group.addSelectee(child); |
---|
4168 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4169 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4170 | | - System.err.println("info : " + child.GetPath()); |
---|
4171 | 4783 | } |
---|
4172 | 4784 | } |
---|
4173 | 4785 | // else |
---|
.. | .. |
---|
4177 | 4789 | // System.err.println("info : " + group.GetPath()); |
---|
4178 | 4790 | // } |
---|
4179 | 4791 | |
---|
4180 | | - objEditor.SetText(); // jan 2014 |
---|
4181 | | - |
---|
4182 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4792 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4183 | 4793 | CameraPane.flash = true; |
---|
4184 | 4794 | |
---|
4185 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4795 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4186 | 4796 | // a camera |
---|
4187 | 4797 | { |
---|
4188 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4189 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4798 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4799 | + { |
---|
| 4800 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4801 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4802 | + } |
---|
4190 | 4803 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4191 | 4804 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4192 | 4805 | } |
---|
4193 | 4806 | |
---|
| 4807 | + if (tps != null && tps.length == 1) |
---|
| 4808 | + { |
---|
| 4809 | + EditSelection(false); |
---|
| 4810 | + } |
---|
| 4811 | + |
---|
| 4812 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4813 | + |
---|
4194 | 4814 | refreshContents(); |
---|
4195 | 4815 | //return true; |
---|
4196 | 4816 | } |
---|
.. | .. |
---|
4199 | 4819 | |
---|
4200 | 4820 | freezemodel = false; |
---|
4201 | 4821 | } |
---|
| 4822 | + |
---|
| 4823 | + void SetPinStates(boolean enabled) |
---|
| 4824 | + { |
---|
| 4825 | + editButton.setEnabled(enabled); |
---|
| 4826 | + uneditButton.setEnabled(enabled); |
---|
| 4827 | + unselectButton.setEnabled(enabled); |
---|
| 4828 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4829 | + } |
---|
| 4830 | + |
---|
| 4831 | + void refreshContents(boolean cp) |
---|
| 4832 | + { |
---|
| 4833 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4834 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4835 | + { |
---|
| 4836 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4837 | + |
---|
| 4838 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4839 | + { |
---|
| 4840 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4841 | + |
---|
| 4842 | + objEditor.AddInfo(child, this, true); |
---|
| 4843 | + System.err.println("info : " + child.GetPath()); |
---|
| 4844 | + } |
---|
| 4845 | + |
---|
| 4846 | + objEditor.SetText(); // jan 2014 |
---|
| 4847 | + } |
---|
| 4848 | + |
---|
| 4849 | + super.refreshContents(cp); |
---|
| 4850 | + } |
---|
4202 | 4851 | |
---|
4203 | 4852 | void linkSomething(Object3D thing) |
---|
4204 | 4853 | { |
---|
.. | .. |
---|
4270 | 4919 | { |
---|
4271 | 4920 | if (group.selection.isEmpty()) |
---|
4272 | 4921 | return; |
---|
4273 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4922 | + |
---|
| 4923 | + Grafreed.clipboardIsTempGroup = false; |
---|
4274 | 4924 | Composite tGroup = null; |
---|
4275 | 4925 | if (group.selection.size() > 0) // 1) |
---|
4276 | 4926 | { |
---|
4277 | 4927 | tGroup = new cGroup(); |
---|
4278 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4928 | + Grafreed.clipboardIsTempGroup = true; |
---|
4279 | 4929 | } |
---|
4280 | 4930 | |
---|
4281 | 4931 | if (cut) |
---|
4282 | 4932 | { |
---|
| 4933 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4934 | +// Save(); |
---|
4283 | 4935 | //int indices[] = jList.getSelectedIndices(); |
---|
4284 | 4936 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4285 | 4937 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4315 | 4967 | //System.out.println("cut " + child); |
---|
4316 | 4968 | //System.out.println("parent = " + child.parent); |
---|
4317 | 4969 | // tmp.addChild(child); |
---|
4318 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4970 | + if (Grafreed.clipboardIsTempGroup) |
---|
4319 | 4971 | tGroup.add/*Child*/(tmp); |
---|
4320 | 4972 | else |
---|
4321 | | - GrafreeD.clipboard = tmp; |
---|
| 4973 | + Grafreed.clipboard = tmp; |
---|
4322 | 4974 | } |
---|
4323 | 4975 | else |
---|
4324 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4976 | + if (Grafreed.clipboardIsTempGroup) |
---|
4325 | 4977 | tGroup.add/*Child*/(child); |
---|
4326 | 4978 | else |
---|
4327 | | - GrafreeD.clipboard = child; |
---|
| 4979 | + Grafreed.clipboard = child; |
---|
4328 | 4980 | } |
---|
4329 | 4981 | |
---|
4330 | 4982 | //ResetModel(); |
---|
.. | .. |
---|
4356 | 5008 | //System.out.println("cut " + elem); |
---|
4357 | 5009 | //System.out.println("parent = " + elem.parent); |
---|
4358 | 5010 | // tmp.addChild(elem); |
---|
4359 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5011 | + if (Grafreed.clipboardIsTempGroup) |
---|
4360 | 5012 | tGroup.add/*Child*/(tmp); |
---|
4361 | 5013 | else |
---|
4362 | | - GrafreeD.clipboard = tmp; |
---|
| 5014 | + Grafreed.clipboard = tmp; |
---|
4363 | 5015 | } |
---|
4364 | 5016 | else |
---|
4365 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5017 | + if (Grafreed.clipboardIsTempGroup) |
---|
4366 | 5018 | tGroup.add/*Child*/(child); |
---|
4367 | 5019 | else |
---|
4368 | | - GrafreeD.clipboard = child; |
---|
| 5020 | + Grafreed.clipboard = child; |
---|
4369 | 5021 | } |
---|
4370 | 5022 | |
---|
4371 | 5023 | } |
---|
4372 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4373 | | - GrafreeD.clipboard = tGroup; |
---|
| 5024 | + |
---|
| 5025 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 5026 | + Grafreed.clipboard = tGroup; |
---|
| 5027 | + |
---|
4374 | 5028 | if (cut) |
---|
4375 | 5029 | { |
---|
4376 | 5030 | ResetModel(); |
---|
.. | .. |
---|
4380 | 5034 | |
---|
4381 | 5035 | void paste(boolean expand) |
---|
4382 | 5036 | { |
---|
| 5037 | + if (Globals.REPLACEONMAKE) |
---|
| 5038 | + Save(); |
---|
| 5039 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5040 | + Globals.REPLACEONMAKE = false; |
---|
4383 | 5041 | // if (GrafreeD.clipboard == null) |
---|
4384 | 5042 | // return; |
---|
4385 | 5043 | boolean first = true; |
---|
4386 | 5044 | |
---|
4387 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5045 | + if (Grafreed.clipboardIsTempGroup) |
---|
4388 | 5046 | { |
---|
4389 | 5047 | Composite temp; |
---|
4390 | 5048 | |
---|
.. | .. |
---|
4395 | 5053 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4396 | 5054 | */ |
---|
4397 | 5055 | Object3D elem; |
---|
4398 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5056 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4399 | 5057 | { |
---|
4400 | 5058 | Object3D child = (Object3D)e.nextElement(); |
---|
4401 | 5059 | |
---|
.. | .. |
---|
4429 | 5087 | //Object3D cb = Applet3D.clipboard; |
---|
4430 | 5088 | //temp.addChild(cb); |
---|
4431 | 5089 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4432 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4433 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4434 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4435 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4436 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5090 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5091 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5092 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5093 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5094 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4437 | 5095 | else |
---|
4438 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4439 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5096 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5097 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4440 | 5098 | } |
---|
4441 | 5099 | |
---|
| 5100 | + Globals.REPLACEONMAKE = keep; |
---|
4442 | 5101 | ResetModel(); |
---|
4443 | 5102 | refreshContents(); |
---|
4444 | 5103 | } |
---|
.. | .. |
---|
4485 | 5144 | { |
---|
4486 | 5145 | boolean first = true; |
---|
4487 | 5146 | |
---|
4488 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5147 | + if (Grafreed.clipboardIsTempGroup) |
---|
4489 | 5148 | { |
---|
4490 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5149 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4491 | 5150 | Object3D copy; |
---|
4492 | 5151 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4493 | 5152 | { |
---|
.. | .. |
---|
4497 | 5156 | } |
---|
4498 | 5157 | } else |
---|
4499 | 5158 | { |
---|
4500 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5159 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4501 | 5160 | } |
---|
4502 | 5161 | } |
---|
4503 | 5162 | } |
---|
.. | .. |
---|
4574 | 5233 | |
---|
4575 | 5234 | void group(Object3D csg, boolean grab) |
---|
4576 | 5235 | { |
---|
| 5236 | + if (Globals.REPLACEONMAKE) |
---|
| 5237 | + Save(); |
---|
| 5238 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5239 | + Globals.REPLACEONMAKE = false; |
---|
4577 | 5240 | if (//false) // why?? |
---|
4578 | 5241 | !group.selection.isEmpty()) |
---|
4579 | 5242 | { |
---|
.. | .. |
---|
4687 | 5350 | //node.add(csg); |
---|
4688 | 5351 | //makeSomething(node); |
---|
4689 | 5352 | makeSomething(csg); |
---|
| 5353 | + Globals.REPLACEONMAKE = keep; |
---|
4690 | 5354 | } |
---|
4691 | 5355 | |
---|
4692 | 5356 | void Ungroup(Object3D g) |
---|
4693 | 5357 | { |
---|
| 5358 | + if (Globals.REPLACEONMAKE) |
---|
| 5359 | + Save(); |
---|
| 5360 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5361 | + Globals.REPLACEONMAKE = false; |
---|
4694 | 5362 | if (g instanceof HiddenObject) |
---|
4695 | 5363 | { |
---|
4696 | 5364 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4707 | 5375 | objEditor.makeSomething(g.get(i), false); |
---|
4708 | 5376 | } |
---|
4709 | 5377 | } |
---|
| 5378 | + Globals.REPLACEONMAKE = keep; |
---|
4710 | 5379 | } |
---|
4711 | 5380 | |
---|
4712 | 5381 | void ungroup() |
---|
.. | .. |
---|
4902 | 5571 | } |
---|
4903 | 5572 | */ |
---|
4904 | 5573 | |
---|
4905 | | - void ImportGFD() |
---|
4906 | | - { |
---|
4907 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4908 | | - browser.show(); |
---|
4909 | | - String filename = browser.getFile(); |
---|
4910 | | - if (filename != null && filename.length() > 0) |
---|
4911 | | - { |
---|
4912 | | - String fullname = browser.getDirectory() + filename; |
---|
4913 | | - |
---|
4914 | | - //Object3D readobj = |
---|
4915 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4916 | | - //makeSomething(readobj); |
---|
4917 | | - } |
---|
4918 | | - } |
---|
4919 | | - |
---|
4920 | 5574 | /* |
---|
4921 | 5575 | public void Callback(Object obj) |
---|
4922 | 5576 | { |
---|
.. | .. |
---|
4940 | 5594 | } |
---|
4941 | 5595 | */ |
---|
4942 | 5596 | |
---|
4943 | | - void ImportVRMLX3D() |
---|
4944 | | - { |
---|
4945 | | - if (GrafreeD.standAlone) |
---|
4946 | | - { |
---|
4947 | | - /**/ |
---|
4948 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4949 | | - browser.show(); |
---|
4950 | | - String filename = browser.getFile(); |
---|
4951 | | - if (filename != null && filename.length() > 0) |
---|
4952 | | - { |
---|
4953 | | - String fullname = browser.getDirectory() + filename; |
---|
4954 | | - LoadVRMLX3D(fullname); |
---|
4955 | | - } |
---|
4956 | | - /**/ |
---|
4957 | | - } |
---|
4958 | | - } |
---|
4959 | | - |
---|
4960 | 5597 | String GetFile(String dialogName) |
---|
4961 | 5598 | { |
---|
4962 | | - if (GrafreeD.standAlone) |
---|
| 5599 | + if (Grafreed.standAlone) |
---|
4963 | 5600 | { |
---|
4964 | 5601 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4965 | 5602 | browser.show(); |
---|
.. | .. |
---|
5027 | 5664 | cButton clearpanelButton; |
---|
5028 | 5665 | cButton unselectButton; |
---|
5029 | 5666 | |
---|
| 5667 | + cButton restoreCameraButton; |
---|
| 5668 | + |
---|
| 5669 | + cButton saveButton; |
---|
5030 | 5670 | cButton oneStepButton; |
---|
| 5671 | + |
---|
| 5672 | + cButton groupButton; |
---|
| 5673 | + cButton ungroupButton; |
---|
| 5674 | + cButton compositeButton; |
---|
| 5675 | + cButton switchButton; |
---|
| 5676 | + cButton loopButton; |
---|
| 5677 | + cButton textureButton; |
---|
| 5678 | + |
---|
| 5679 | + cButton gridButton; |
---|
| 5680 | + cButton boxButton; |
---|
| 5681 | + cButton sphereButton; |
---|
| 5682 | + cButton coneButton; |
---|
| 5683 | + cButton torusButton; |
---|
| 5684 | + cButton superButton; |
---|
| 5685 | + cButton kleinButton; |
---|
| 5686 | + cButton particlesButton; |
---|
| 5687 | + cButton overlayButton; |
---|
| 5688 | + cButton lightButton; |
---|
5031 | 5689 | |
---|
5032 | 5690 | cButton screenfitButton; |
---|
5033 | 5691 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5040 | 5698 | |
---|
5041 | 5699 | cButton setsupportButton; |
---|
5042 | 5700 | |
---|
5043 | | - cButton twoButton; |
---|
5044 | | - cButton sixButton; |
---|
5045 | | - cButton threeButton; |
---|
5046 | | - cButton sevenButton; |
---|
5047 | | - cButton fourButton; // full panel |
---|
5048 | | - cButton oneButton; // full XYZ |
---|
5049 | | - //cButton currentLayout; |
---|
5050 | | - |
---|
5051 | 5701 | // |
---|
5052 | 5702 | //Composite |
---|
5053 | 5703 | Object3D // to do !! |
---|
.. | .. |
---|
5057 | 5707 | //JTree jTree; |
---|
5058 | 5708 | private MenuItem lookAtItem; |
---|
5059 | 5709 | private MenuItem lookFromItem; |
---|
5060 | | - private MenuItem switchItem; |
---|
| 5710 | + private MenuItem switchViewItem; |
---|
5061 | 5711 | private MenuItem cutItem; |
---|
5062 | | - private MenuItem duplicateItem; |
---|
| 5712 | + private MenuItem undoItem; |
---|
| 5713 | + private MenuItem redoItem; |
---|
| 5714 | + private JMenuItem duplicateItem; |
---|
5063 | 5715 | private MenuItem cloneItem; |
---|
5064 | 5716 | private MenuItem cloneSupportItem; |
---|
5065 | 5717 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5072 | 5724 | private MenuItem linkverticesItem; |
---|
5073 | 5725 | private MenuItem relinkverticesItem; |
---|
5074 | 5726 | private MenuItem setMasterItem; |
---|
5075 | | - private MenuItem resetMeshItem; |
---|
| 5727 | + private MenuItem resetAllItem; |
---|
5076 | 5728 | private MenuItem stepAllItem; |
---|
5077 | 5729 | private MenuItem revertMeshItem; |
---|
5078 | 5730 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5087 | 5739 | private MenuItem pasteLinkItem; |
---|
5088 | 5740 | private MenuItem pasteCloneItem; |
---|
5089 | 5741 | private MenuItem pasteExpandItem; |
---|
5090 | | - private MenuItem clearItem; |
---|
| 5742 | + private MenuItem deleteItem; |
---|
5091 | 5743 | private MenuItem clearAllItem; |
---|
5092 | 5744 | private MenuItem genUVItem; |
---|
5093 | 5745 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5122 | 5774 | private MenuItem showleavesItem; |
---|
5123 | 5775 | private MenuItem markleavesItem; |
---|
5124 | 5776 | private MenuItem unmarkleavesItem; |
---|
| 5777 | + private MenuItem rewindleavesItem; |
---|
| 5778 | + private MenuItem unrewindleavesItem; |
---|
| 5779 | + private MenuItem randomleavesItem; |
---|
| 5780 | + private MenuItem unrandomleavesItem; |
---|
5125 | 5781 | |
---|
5126 | 5782 | private MenuItem flipVItem; |
---|
5127 | 5783 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5133 | 5789 | private MenuItem panoTexturesItem; |
---|
5134 | 5790 | |
---|
5135 | 5791 | private MenuItem resetCentroidItem; |
---|
5136 | | - private MenuItem transformgeometryItem; |
---|
| 5792 | + private MenuItem resetCentroidXZItem; |
---|
5137 | 5793 | private MenuItem resetTransformItem; |
---|
| 5794 | + private MenuItem transformGeometryItem; |
---|
| 5795 | + private MenuItem transformChildrenItem; |
---|
5138 | 5796 | private MenuItem hideItem; |
---|
5139 | 5797 | private MenuItem grabItem; |
---|
5140 | 5798 | private MenuItem backItem; |
---|
5141 | 5799 | private MenuItem frontItem; |
---|
5142 | 5800 | private MenuItem cameraItem; |
---|
5143 | 5801 | private MenuItem compositeItem; |
---|
5144 | | - private MenuItem randomItem; |
---|
| 5802 | + private MenuItem switchItem; |
---|
5145 | 5803 | private MenuItem physicsItem; |
---|
5146 | 5804 | private MenuItem frameselectorItem; |
---|
5147 | 5805 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5165 | 5823 | private MenuItem attachBumpItem; |
---|
5166 | 5824 | private MenuItem detachBumpItem; |
---|
5167 | 5825 | private MenuItem pigmentBumpItem; |
---|
| 5826 | + private MenuItem embedTexturesItem; |
---|
| 5827 | + private MenuItem deEmbedTexturesItem; |
---|
5168 | 5828 | |
---|
5169 | 5829 | private MenuItem particleItem; |
---|
5170 | 5830 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5203 | 5863 | private MenuItem doubleItem; |
---|
5204 | 5864 | private MenuItem tripleItem; |
---|
5205 | 5865 | |
---|
5206 | | - private MenuItem importGFDItem; |
---|
5207 | | - private MenuItem importVRMLX3DItem; |
---|
5208 | | - private MenuItem import3DSItem; |
---|
5209 | | - private MenuItem importOBJItem; |
---|
5210 | | - |
---|
5211 | 5866 | private MenuItem computeAOItem; |
---|
5212 | 5867 | private MenuItem recompileItem; |
---|
5213 | 5868 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5217 | 5872 | private MenuItem analyzeItem; |
---|
5218 | 5873 | private MenuItem dumpItem; |
---|
5219 | 5874 | //boolean freezemodel = false; |
---|
| 5875 | + |
---|
| 5876 | + Menu cameraMenu; |
---|
| 5877 | + MenuItem editCameraItem; |
---|
| 5878 | + MenuItem restoreCameraItem; |
---|
5220 | 5879 | } |
---|