.. | .. |
---|
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 | + if (copy.versions == null) |
---|
| 84 | + { |
---|
| 85 | + copy.versions = new byte[100][]; |
---|
| 86 | + copy.versionindex = -1; |
---|
| 87 | + } |
---|
| 88 | + |
---|
| 89 | + SetupMenu2(this); //objEditor); |
---|
78 | 90 | SetupUI2(objEditor); |
---|
79 | 91 | objEditor.SetupUI(true); |
---|
80 | 92 | SetupViews(objEditor); |
---|
.. | .. |
---|
84 | 96 | |
---|
85 | 97 | void CloneSelection(boolean supports) |
---|
86 | 98 | { |
---|
| 99 | + if (Globals.REPLACEONMAKE) |
---|
| 100 | + Save(); |
---|
| 101 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 102 | + Globals.REPLACEONMAKE = false; |
---|
87 | 103 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 104 | //Object3D obj; |
---|
89 | 105 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 110 | |
---|
95 | 111 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 112 | } |
---|
| 113 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 114 | } |
---|
98 | 115 | |
---|
99 | 116 | void CloneClipboard(boolean supports) |
---|
100 | 117 | { |
---|
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)); |
---|
| 118 | + assert(Grafreed.clipboard.parent == null); |
---|
| 119 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 120 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 121 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 122 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 123 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 124 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 125 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 126 | } |
---|
110 | 127 | |
---|
111 | 128 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 136 | // obj.support = null; |
---|
120 | 137 | if (!supports) |
---|
121 | 138 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 139 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 140 | obj.parent = parent; |
---|
124 | 141 | // obj.support = support; |
---|
125 | 142 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 165 | |
---|
149 | 166 | //JTextField nameField; |
---|
150 | 167 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 168 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 169 | { |
---|
153 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
154 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
155 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
156 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
157 | | - oe.cameraMenu.add("-"); |
---|
158 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
159 | | - openWindowItem.addActionListener(this); |
---|
160 | | - editLeafItem.addActionListener(this); |
---|
161 | | - lookAtItem.addActionListener(this); |
---|
162 | | - //lookFromItem.addActinoListener(this); |
---|
163 | | - //switchItem.addActionListener(this); |
---|
| 170 | + oe.jTree = new cTree(); |
---|
| 171 | + |
---|
164 | 172 | Menu menu; |
---|
165 | 173 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
166 | 174 | //editItem = menu.add(new MenuItem("Edit")); |
---|
167 | 175 | //editItem.addActionListener(this); |
---|
168 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 176 | + |
---|
| 177 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 178 | +// undoItem.addActionListener(this); |
---|
| 179 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 180 | +// redoItem.addActionListener(this); |
---|
| 181 | +// menu.add("-"); |
---|
| 182 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
169 | 183 | duplicateItem.addActionListener(this); |
---|
170 | | - menu.add("-"); |
---|
171 | 184 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
172 | 185 | cloneItem.addActionListener(this); |
---|
| 186 | + if (Globals.ADVANCED) |
---|
| 187 | + { |
---|
173 | 188 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
174 | 189 | cloneSupportItem.addActionListener(this); |
---|
| 190 | + } |
---|
175 | 191 | menu.add("-"); |
---|
176 | 192 | cutItem = menu.add(new MenuItem("Cut")); |
---|
177 | 193 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
179 | 195 | copyItem.addActionListener(this); |
---|
180 | 196 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
181 | 197 | pasteItem.addActionListener(this); |
---|
| 198 | + |
---|
| 199 | + menu.add("-"); |
---|
| 200 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 201 | + pasteIntoItem.addActionListener(this); |
---|
182 | 202 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
183 | 203 | pasteLinkItem.addActionListener(this); |
---|
184 | 204 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
185 | 205 | pasteCloneItem.addActionListener(this); |
---|
186 | 206 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
187 | 207 | // pasteExpandItem.addActionListener(this); |
---|
188 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
189 | | - clearItem.addActionListener(this); |
---|
| 208 | + menu.add("-"); |
---|
| 209 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 210 | + deleteItem.addActionListener(this); |
---|
| 211 | + |
---|
| 212 | + if (Globals.ADVANCED) |
---|
| 213 | + { |
---|
| 214 | + // Deletes the cameras... |
---|
190 | 215 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
191 | 216 | clearAllItem.addActionListener(this); |
---|
| 217 | + } |
---|
| 218 | + |
---|
| 219 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 220 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 221 | + //zBufferItem.addActionListener(this); |
---|
| 222 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 223 | + //normalLensItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
| 226 | + |
---|
| 227 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 228 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 229 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 230 | +// cameraMenu.add("-"); |
---|
| 231 | +// |
---|
| 232 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 233 | +// toggleTextureItem.addItemListener(this); |
---|
| 234 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 235 | +// |
---|
| 236 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 237 | +// toggleSwitchItem.addItemListener(this); |
---|
| 238 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 239 | + |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 241 | + toggleHandleItem.addItemListener(this); |
---|
| 242 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 245 | + togglePaintItem.addItemListener(this); |
---|
| 246 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 247 | + |
---|
| 248 | + if (Globals.ADVANCED) |
---|
| 249 | + { |
---|
| 250 | + cameraMenu.add("-"); |
---|
| 251 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 252 | + toggleLiveItem.addItemListener(this); |
---|
| 253 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
192 | 254 | |
---|
| 255 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 256 | + stepItem.addActionListener(this); |
---|
| 257 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 258 | + // toggleDLItem.addItemListener(this); |
---|
| 259 | + // toggleDLItem.setState(false); |
---|
| 260 | + |
---|
| 261 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 262 | + toggleRenderItem.addItemListener(this); |
---|
| 263 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 264 | + |
---|
| 265 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 266 | + toggleDebugItem.addItemListener(this); |
---|
| 267 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 268 | + |
---|
| 269 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 270 | + toggleFrustumItem.addItemListener(this); |
---|
| 271 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 272 | + |
---|
| 273 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 274 | + toggleFootContactItem.addItemListener(this); |
---|
| 275 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 276 | + |
---|
| 277 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 278 | + toggleTimelineItem.addItemListener(this); |
---|
| 279 | + } |
---|
| 280 | + |
---|
| 281 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 282 | +// toggleRootItem.addItemListener(this); |
---|
| 283 | +// toggleRootItem.setState(false); |
---|
| 284 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 285 | +// animationItem.addItemListener(this); |
---|
| 286 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 287 | + cameraMenu.add("-"); |
---|
| 288 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 289 | + editCameraItem.addActionListener(this); |
---|
| 290 | + |
---|
| 291 | + if (Globals.ADVANCED) |
---|
| 292 | + { |
---|
| 293 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 294 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 296 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 297 | + oe.cameraMenu.add("-"); |
---|
| 298 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 299 | + openWindowItem.addActionListener(this); |
---|
| 300 | + editLeafItem.addActionListener(this); |
---|
| 301 | + lookAtItem.addActionListener(this); |
---|
| 302 | + //lookFromItem.addActinoListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
| 304 | + } |
---|
| 305 | + |
---|
193 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
194 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
195 | | - resetMeshItem.addActionListener(this); |
---|
196 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
197 | | - stepAllItem.addActionListener(this); |
---|
| 307 | + if (Globals.ADVANCED) |
---|
| 308 | + { |
---|
198 | 309 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
199 | 310 | revertMeshItem.addActionListener(this); |
---|
200 | 311 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
201 | 312 | resetreferencesItem.addActionListener(this); |
---|
202 | 313 | menu.add("-"); |
---|
| 314 | + } |
---|
203 | 315 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
204 | 316 | overwriteGeoItem.addActionListener(this); |
---|
205 | 317 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
211 | 323 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
212 | 324 | overwriteUVItem.addActionListener(this); |
---|
213 | 325 | menu.add("-"); |
---|
| 326 | + if (Globals.ADVANCED) |
---|
| 327 | + { |
---|
214 | 328 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
215 | 329 | generateMeshItem.addActionListener(this); |
---|
216 | 330 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
217 | 331 | poseMeshItem.addActionListener(this); |
---|
218 | 332 | menu.add("-"); |
---|
| 333 | + } |
---|
219 | 334 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
220 | 335 | resetsupportItem.addActionListener(this); |
---|
221 | 336 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
222 | 337 | linkverticesItem.addActionListener(this); |
---|
223 | 338 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
224 | 339 | relinkverticesItem.addActionListener(this); |
---|
| 340 | + |
---|
| 341 | + if (Globals.ADVANCED) |
---|
| 342 | + { |
---|
225 | 343 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
226 | 344 | setMasterItem.addActionListener(this); |
---|
| 345 | + } |
---|
227 | 346 | |
---|
228 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
229 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
230 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
231 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
232 | 351 | backItem.addActionListener(this); |
---|
233 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
234 | 353 | frontItem.addActionListener(this); |
---|
235 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
236 | | - compositeItem.addActionListener(this); |
---|
237 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
| 356 | + |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
| 359 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
238 | 360 | hideItem.addActionListener(this); |
---|
| 361 | + } |
---|
239 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
240 | 363 | ungroupItem.addActionListener(this); |
---|
241 | | - menu.add("-"); |
---|
242 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
243 | | - randomItem.addActionListener(this); |
---|
244 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
245 | | - physicsItem.addActionListener(this); |
---|
246 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
247 | | - frameselectorItem.addActionListener(this); |
---|
| 364 | + |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
| 369 | + if (Globals.ADVANCED) |
---|
| 370 | + { |
---|
248 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
249 | 372 | switchGeoItem.addActionListener(this); |
---|
250 | 373 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
251 | 374 | switchTransfoItem.addActionListener(this); |
---|
252 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 375 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
253 | 376 | morphItem.addActionListener(this); |
---|
| 377 | + |
---|
| 378 | + menu.add("-"); |
---|
| 379 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 380 | + physicsItem.addActionListener(this); |
---|
| 381 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 382 | + frameselectorItem.addActionListener(this); |
---|
254 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
255 | 384 | scriptNodeItem.addActionListener(this); |
---|
256 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
257 | | - cameraItem.addActionListener(this); |
---|
| 385 | + } |
---|
258 | 386 | |
---|
259 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
260 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
261 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
262 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
263 | 391 | billboardItem.addActionListener(this); |
---|
264 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
265 | 393 | csgItem.addActionListener(this); |
---|
266 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 394 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
267 | 395 | shadowXItem.addActionListener(this); |
---|
268 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 396 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
269 | 397 | shadowYItem.addActionListener(this); |
---|
270 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 398 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
271 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
| 403 | + if (Globals.ADVANCED) |
---|
| 404 | + { |
---|
| 405 | + menu.add("-"); |
---|
272 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
273 | 407 | linkerItem.addActionListener(this); |
---|
274 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
275 | 409 | templateItem.addActionListener(this); |
---|
276 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
277 | | - attributeItem.addActionListener(this); |
---|
278 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
279 | 411 | pointflowItem.addActionListener(this); |
---|
| 412 | + } |
---|
280 | 413 | menu.add("-"); |
---|
281 | 414 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
282 | 415 | resetTransformItem.addActionListener(this); |
---|
283 | 416 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
284 | 417 | resetCentroidItem.addActionListener(this); |
---|
285 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
286 | | - transformgeometryItem.addActionListener(this); |
---|
| 418 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 419 | + resetCentroidXZItem.addActionListener(this); |
---|
| 420 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 421 | + transformGeometryItem.addActionListener(this); |
---|
| 422 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 423 | + transformChildrenItem.addActionListener(this); |
---|
287 | 424 | |
---|
288 | 425 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
289 | 426 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
294 | 431 | genNormalsCADItem.addActionListener(this); |
---|
295 | 432 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
296 | 433 | genNormalsMESHItem.addActionListener(this); |
---|
297 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 434 | + if (Globals.ADVANCED) |
---|
| 435 | + { |
---|
| 436 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
298 | 437 | genNormalsMINEItem.addActionListener(this); |
---|
| 438 | + } |
---|
299 | 439 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
300 | 440 | stripifyItem.addActionListener(this); |
---|
301 | 441 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
317 | 457 | reduce34MeshItem.addActionListener(this); |
---|
318 | 458 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
319 | 459 | increaseMeshItem.addActionListener(this); |
---|
320 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
321 | | - smoothMeshItem.addActionListener(this); |
---|
322 | 460 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
323 | 461 | clipMeshItem.addActionListener(this); |
---|
| 462 | + |
---|
| 463 | + if (Globals.ADVANCED) |
---|
| 464 | + { |
---|
| 465 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 466 | + smoothMeshItem.addActionListener(this); |
---|
| 467 | + } |
---|
324 | 468 | |
---|
325 | 469 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
326 | 470 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
327 | 471 | clearMaterialsItem.addActionListener(this); |
---|
| 472 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 473 | + resetAllItem.addActionListener(this); |
---|
| 474 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 475 | + stepAllItem.addActionListener(this); |
---|
328 | 476 | menu.add("-"); |
---|
329 | 477 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
330 | 478 | liveleavesItem.addActionListener(this); |
---|
331 | 479 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
332 | 480 | unliveleavesItem.addActionListener(this); |
---|
| 481 | + if (Globals.ADVANCED) |
---|
| 482 | + { |
---|
333 | 483 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
334 | 484 | supportleavesItem.addActionListener(this); |
---|
335 | 485 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
336 | 486 | unsupportleavesItem.addActionListener(this); |
---|
| 487 | + } |
---|
337 | 488 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
338 | 489 | hideleavesItem.addActionListener(this); |
---|
339 | 490 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
342 | 493 | markleavesItem.addActionListener(this); |
---|
343 | 494 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
344 | 495 | unmarkleavesItem.addActionListener(this); |
---|
| 496 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 497 | + rewindleavesItem.addActionListener(this); |
---|
| 498 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 499 | + unrewindleavesItem.addActionListener(this); |
---|
| 500 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 501 | + randomleavesItem.addActionListener(this); |
---|
| 502 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 503 | + unrandomleavesItem.addActionListener(this); |
---|
345 | 504 | menu.add("-"); |
---|
346 | 505 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
347 | 506 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
377 | 536 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
378 | 537 | sortbynameItem.addActionListener(this); |
---|
379 | 538 | menu.add("-"); |
---|
| 539 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 540 | + shareGeometriesItem.addActionListener(this); |
---|
| 541 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 542 | + mergeGeometriesItem.addActionListener(this); |
---|
| 543 | + if (Globals.ADVANCED) |
---|
| 544 | + { |
---|
| 545 | + // Pretty much the same as duplicate and clone. |
---|
380 | 546 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
381 | 547 | extractGeometriesItem.addActionListener(this); |
---|
382 | 548 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
383 | 549 | cloneGeometriesItem.addActionListener(this); |
---|
384 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
385 | | - shareGeometriesItem.addActionListener(this); |
---|
386 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
387 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 550 | + } |
---|
388 | 551 | |
---|
389 | 552 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
390 | 553 | buildCreateMenu(menu); |
---|
391 | 554 | |
---|
392 | | - |
---|
393 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
394 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
395 | | - importGFDItem.addActionListener(this); |
---|
396 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
397 | | - importVRMLX3DItem.addActionListener(this); |
---|
398 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
399 | | - importOBJItem.addActionListener(this); |
---|
400 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
401 | | - import3DSItem.addActionListener(this); |
---|
402 | | - |
---|
403 | 555 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
404 | 556 | buildToolsMenu(menu); |
---|
405 | 557 | } |
---|
406 | 558 | |
---|
| 559 | + |
---|
407 | 560 | void SetupUI2(ObjEditor oe) |
---|
408 | 561 | { |
---|
| 562 | + // June 2019 |
---|
| 563 | + if (oe == null) |
---|
| 564 | + { |
---|
| 565 | + //super.SetupUI2(this); |
---|
| 566 | + //return; |
---|
| 567 | + } |
---|
| 568 | + |
---|
| 569 | + if (copy != group) |
---|
| 570 | + { |
---|
| 571 | + //super.SetupUI2(this); |
---|
| 572 | + } |
---|
| 573 | + |
---|
409 | 574 | //new Exception().printStackTrace(); |
---|
410 | 575 | |
---|
411 | 576 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
434 | 599 | oe.radioPanel.add(dummyButton); |
---|
435 | 600 | oe.buttonGroup.add(dummyButton); |
---|
436 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
437 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
438 | 607 | |
---|
439 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
440 | | - liveCB.setToolTipText("Enabled animation"); |
---|
441 | | - liveCB.addItemListener(this); |
---|
442 | | - |
---|
443 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
444 | | - fastCB.setToolTipText("Fast mode"); |
---|
445 | | - fastCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
448 | | - trackCB.setToolTipText("Enable tracking"); |
---|
449 | | - trackCB.addItemListener(this); |
---|
450 | | - |
---|
451 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + //minButton.setToolTipText("Minimize window"); |
---|
| 610 | + //minButton.addActionListener(this); |
---|
| 611 | + |
---|
| 612 | + if (Globals.ADVANCED) |
---|
| 613 | + { |
---|
| 614 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + maxButton.setToolTipText("Maximize window"); |
---|
| 616 | + maxButton.addActionListener(this); |
---|
| 617 | + } |
---|
| 618 | + |
---|
| 619 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 621 | + fullButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
452 | 624 | screenfitButton.setToolTipText("Screen fit"); |
---|
453 | 625 | screenfitButton.addActionListener(this); |
---|
454 | 626 | |
---|
| 627 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 629 | + restoreCameraButton.addActionListener(this); |
---|
| 630 | + |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
| 633 | + saveButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
| 637 | + undoButton.addActionListener(this); |
---|
| 638 | + undoButton.setEnabled(false); |
---|
| 639 | + |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
| 655 | + redoButton.addActionListener(this); |
---|
| 656 | + redoButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 659 | + liveCB.setToolTipText("Enable animation"); |
---|
| 660 | + liveCB.addItemListener(this); |
---|
| 661 | + |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 663 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 664 | + oneStepButton.addActionListener(this); |
---|
| 665 | + |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 667 | + fastCB.setToolTipText("Fast mode"); |
---|
| 668 | + fastCB.addItemListener(this); |
---|
| 669 | + |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
| 671 | + |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
| 675 | + |
---|
455 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
456 | 677 | // screenfitpointButton.addActionListener(this); |
---|
457 | | -// oe.aConstraints.gridx += 1; |
---|
458 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
459 | | - snapobjectButton.addActionListener(this); |
---|
460 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
461 | | - oe.aConstraints.gridx += 1; |
---|
462 | 678 | |
---|
463 | | - //aConstraints.gridx = 0; |
---|
464 | | - //aConstraints.gridy += 1; |
---|
465 | | - oe.aConstraints.weighty = 0; |
---|
466 | | - oe.aConstraints.gridwidth = 1; |
---|
467 | | - |
---|
468 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
469 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
470 | | - flashSelectionButton.addActionListener(this); |
---|
| 679 | + if (Globals.ADVANCED) |
---|
| 680 | + { |
---|
| 681 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + snapobjectButton.addActionListener(this); |
---|
| 683 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 684 | + } |
---|
| 685 | + |
---|
| 686 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
471 | 687 | |
---|
472 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
473 | | - |
---|
474 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
475 | | - twoButton.setToolTipText("Show center view only"); |
---|
476 | | - twoButton.addActionListener(this); |
---|
477 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
478 | 689 | fourButton.addActionListener(this); |
---|
479 | 690 | fourButton.setToolTipText("Show left panel only"); |
---|
480 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
481 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + twoButton.setToolTipText("Show right view only"); |
---|
| 694 | + twoButton.addActionListener(this); |
---|
| 695 | + this.fullscreenLayout = twoButton; |
---|
| 696 | + |
---|
| 697 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + sixButton.setToolTipText("Show left and right"); |
---|
482 | 699 | sixButton.addActionListener(this); |
---|
483 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
484 | | - threeButton.setToolTipText("2-column layout right"); |
---|
485 | | - threeButton.addActionListener(this); |
---|
486 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
487 | | - sevenButton.setToolTipText("3-column layout"); |
---|
488 | | - sevenButton.addActionListener(this); |
---|
| 700 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 701 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 702 | +// threeButton.addActionListener(this); |
---|
| 703 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 704 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 705 | +// sevenButton.addActionListener(this); |
---|
489 | 706 | // |
---|
490 | 707 | |
---|
491 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 708 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 709 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
493 | 710 | rootButton.addActionListener(this); |
---|
494 | 711 | |
---|
495 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 712 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
496 | 713 | closeButton.setToolTipText("Close tab"); |
---|
497 | 714 | closeButton.addActionListener(this); |
---|
498 | 715 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
499 | 716 | //clearButton.addActionListener(this); |
---|
500 | | - |
---|
501 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 717 | + |
---|
| 718 | + // INSERT |
---|
| 719 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 720 | + gridButton.setToolTipText("Create grid"); |
---|
| 721 | + gridButton.addActionListener(this); |
---|
| 722 | + |
---|
| 723 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + boxButton.setToolTipText("Create box"); |
---|
| 725 | + boxButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 728 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 729 | + sphereButton.addActionListener(this); |
---|
| 730 | + |
---|
| 731 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 732 | + coneButton.setToolTipText("Create cone"); |
---|
| 733 | + coneButton.addActionListener(this); |
---|
| 734 | + |
---|
| 735 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | + torusButton.setToolTipText("Create torus"); |
---|
| 737 | + torusButton.addActionListener(this); |
---|
| 738 | + |
---|
| 739 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 740 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 741 | + superButton.addActionListener(this); |
---|
| 742 | + |
---|
| 743 | + if (Globals.ADVANCED) |
---|
| 744 | + { |
---|
| 745 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 746 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 747 | + kleinButton.addActionListener(this); |
---|
| 748 | + } |
---|
502 | 749 | |
---|
503 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | | - editButton.setToolTipText("Edit selection"); |
---|
| 750 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 751 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 752 | + particlesButton.addActionListener(this); |
---|
| 753 | + |
---|
| 754 | + oe.toolboxPanel.Return(); |
---|
| 755 | + |
---|
| 756 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 757 | + groupButton.setToolTipText("Create group"); |
---|
| 758 | + groupButton.addActionListener(this); |
---|
| 759 | + |
---|
| 760 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 761 | + compositeButton.setToolTipText("Create composite"); |
---|
| 762 | + compositeButton.addActionListener(this); |
---|
| 763 | + |
---|
| 764 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 766 | + switchButton.addActionListener(this); |
---|
| 767 | + |
---|
| 768 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + loopButton.setToolTipText("Create loop"); |
---|
| 770 | + loopButton.addActionListener(this); |
---|
| 771 | + |
---|
| 772 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 773 | + textureButton.setToolTipText("Create texture"); |
---|
| 774 | + textureButton.addActionListener(this); |
---|
| 775 | + |
---|
| 776 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 777 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 778 | + overlayButton.addActionListener(this); |
---|
| 779 | + |
---|
| 780 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 781 | + lightButton.setToolTipText("Create light"); |
---|
| 782 | + lightButton.addActionListener(this); |
---|
| 783 | + |
---|
| 784 | + for (int i=6; --i>=0;) |
---|
| 785 | + { |
---|
| 786 | + oe.toolboxPanel.Return(); |
---|
| 787 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 788 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 794 | + } |
---|
| 795 | + |
---|
| 796 | + // EDIT panel |
---|
| 797 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 798 | + editButton.setToolTipText("Pin selection controls"); |
---|
505 | 799 | editButton.addActionListener(this); |
---|
506 | 800 | |
---|
507 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
508 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 801 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 802 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
509 | 803 | uneditButton.addActionListener(this); |
---|
510 | 804 | |
---|
511 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 806 | + allParamsButton.setToolTipText("Show all controle"); |
---|
| 807 | + allParamsButton.addActionListener(this); |
---|
| 808 | + |
---|
| 809 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
512 | 810 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
513 | 811 | clearPanelButton.addActionListener(this); |
---|
514 | 812 | |
---|
515 | | - commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | | - allParamsButton.setToolTipText("All params??"); |
---|
517 | | - allParamsButton.addActionListener(this); |
---|
518 | | - |
---|
519 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 813 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | 814 | unselectButton.setToolTipText("Unselect"); |
---|
521 | 815 | unselectButton.addActionListener(this); |
---|
522 | 816 | |
---|
523 | | - commandsPanel.preferredHeight = 1; |
---|
| 817 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 818 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 819 | + flashSelectionButton.addActionListener(this); |
---|
524 | 820 | |
---|
525 | | - oe.treePanel.add(commandsPanel); |
---|
526 | | - oe.treePanel.Return(); |
---|
| 821 | + editCommandsPanel.preferredHeight = 1; |
---|
| 822 | + |
---|
| 823 | + SetPinStates(false); |
---|
| 824 | +// oe.treePanel.add(commandsPanel); |
---|
| 825 | +// oe.treePanel.Return(); |
---|
527 | 826 | |
---|
528 | 827 | // oe.aConstraints.gridx += 1; |
---|
529 | 828 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
540 | 839 | |
---|
541 | 840 | JScrollPane jSP; |
---|
542 | 841 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
543 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 842 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
544 | 843 | ResetModel(); |
---|
545 | 844 | |
---|
546 | 845 | oe.treePanel.add(jSPPanel); |
---|
547 | 846 | oe.treePanel.Return(); |
---|
548 | 847 | |
---|
549 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
550 | | - |
---|
551 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
552 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
553 | | - colorCB.addItemListener(this); |
---|
554 | | - |
---|
555 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
556 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
557 | | - materialCB.addItemListener(this); |
---|
558 | | - |
---|
559 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
560 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
561 | | - textureCB.addItemListener(this); |
---|
562 | | - |
---|
563 | | - copyOptionsPanel.preferredHeight = 1; |
---|
564 | 848 | oe.treePanel.add(copyOptionsPanel); |
---|
565 | 849 | oe.treePanel.Return(); |
---|
| 850 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 851 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 852 | + sliderPane.preferredHeight = 1; |
---|
566 | 853 | |
---|
567 | 854 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
568 | 855 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
585 | 872 | dgr.addDragGestureListener(this); |
---|
586 | 873 | }catch(Exception e) {} |
---|
587 | 874 | */ |
---|
588 | | - radio.layout = sevenButton; |
---|
| 875 | + radio.layout = sixButton; // sevenButton; |
---|
589 | 876 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
590 | 877 | } |
---|
591 | 878 | |
---|
592 | 879 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
593 | 880 | { |
---|
594 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
595 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
596 | | - supportCB.addItemListener(this); |
---|
| 881 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 882 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 883 | + colorCB.addItemListener(this); |
---|
| 884 | + |
---|
| 885 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 886 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 887 | + materialCB.addItemListener(this); |
---|
| 888 | + |
---|
| 889 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 890 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 891 | + textureCB.addItemListener(this); |
---|
| 892 | + |
---|
| 893 | + panel.Return(); |
---|
| 894 | + |
---|
| 895 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 896 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 897 | + boxCB.addItemListener(this); |
---|
| 898 | + |
---|
| 899 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 900 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 901 | + zoomBoxCB.addItemListener(this); |
---|
| 902 | + |
---|
| 903 | + if (true) // Globals.ADVANCED) |
---|
| 904 | + { |
---|
| 905 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 906 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 907 | +// supportCB.addItemListener(this); |
---|
| 908 | + |
---|
| 909 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 910 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 911 | + freezeCB.addItemListener(this); |
---|
597 | 912 | |
---|
598 | 913 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
599 | 914 | // localCB.addItemListener(this); |
---|
600 | 915 | |
---|
| 916 | + panel.Return(); |
---|
| 917 | + |
---|
601 | 918 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
602 | 919 | crowdCB.setToolTipText("Used for crowds"); |
---|
603 | 920 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
610 | 927 | slowCB.setToolTipText("Smooth interpolation"); |
---|
611 | 928 | slowCB.addItemListener(this); |
---|
612 | 929 | |
---|
613 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
614 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
615 | | - boxCB.addItemListener(this); |
---|
616 | | - |
---|
617 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
618 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
619 | | - zoomBoxCB.addItemListener(this); |
---|
620 | | - |
---|
621 | 930 | // constraints.gridy += 1; |
---|
622 | 931 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
623 | 932 | // speakerMocapCB.addItemListener(this); |
---|
624 | 933 | |
---|
| 934 | + panel.Return(); |
---|
| 935 | + |
---|
625 | 936 | if (false) |
---|
626 | 937 | { |
---|
627 | 938 | // handled in scripts |
---|
.. | .. |
---|
636 | 947 | //constraints.gridy += 1; |
---|
637 | 948 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
638 | 949 | smoothfocusCB.addItemListener(this); |
---|
| 950 | + panel.Return(); |
---|
639 | 951 | } |
---|
640 | 952 | |
---|
641 | 953 | //constraints.gridx += 1; |
---|
642 | 954 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
643 | 955 | // debugCB.addItemListener(this); |
---|
644 | 956 | |
---|
| 957 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 958 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 959 | + trackCB.addItemListener(this); |
---|
| 960 | + |
---|
645 | 961 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 962 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
646 | 963 | oeilCB.addItemListener(this); |
---|
647 | 964 | |
---|
| 965 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 966 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 967 | + shadowCB.addItemListener(this); |
---|
| 968 | + |
---|
| 969 | + panel.Return(); |
---|
| 970 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 971 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 972 | + toggleTextureCB.addItemListener(this); |
---|
| 973 | + |
---|
| 974 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 975 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 976 | + toggleSwitchCB.addItemListener(this); |
---|
| 977 | + |
---|
| 978 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 979 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 980 | + autokeepCB.addItemListener(this); |
---|
| 981 | + |
---|
| 982 | + panel.Return(); |
---|
| 983 | + if (Globals.ADVANCED) |
---|
| 984 | + { |
---|
648 | 985 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
649 | 986 | lookAtCB.setToolTipText("Look-at target"); |
---|
650 | 987 | lookAtCB.addItemListener(this); |
---|
| 988 | + } |
---|
| 989 | + |
---|
| 990 | + } |
---|
651 | 991 | |
---|
652 | 992 | cGridBag fill = new cGridBag(); |
---|
653 | | - |
---|
654 | 993 | fill.preferredHeight = 200; |
---|
| 994 | + cGridBag fill2 = new cGridBag(); |
---|
| 995 | + fill2.preferredHeight = 200; |
---|
| 996 | + cGridBag fill3 = new cGridBag(); |
---|
| 997 | + fill3.preferredHeight = 200; |
---|
655 | 998 | |
---|
656 | 999 | panel.add(fill); |
---|
| 1000 | + panel.add(fill2); |
---|
| 1001 | + panel.add(fill3); |
---|
657 | 1002 | |
---|
658 | 1003 | } |
---|
659 | 1004 | |
---|
660 | 1005 | void EditObject(Object3D obj) |
---|
661 | 1006 | { |
---|
662 | 1007 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1008 | + |
---|
| 1009 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1010 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1011 | + if (!radioButton.hadMaterial) |
---|
| 1012 | + { |
---|
| 1013 | + obj.material = new cMaterial(); |
---|
| 1014 | + } |
---|
| 1015 | + |
---|
663 | 1016 | radioButton.SetObject(obj); |
---|
664 | | - radioButton.layout = sevenButton; |
---|
| 1017 | + radioButton.layout = sixButton; // sevenButton; |
---|
665 | 1018 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
666 | 1019 | radioButton.addActionListener(this); |
---|
667 | 1020 | radioPanel.add(radioButton); |
---|
668 | 1021 | buttonGroup.add(radioButton); |
---|
669 | 1022 | radioButton.doClick(); |
---|
670 | 1023 | } |
---|
| 1024 | + |
---|
671 | 1025 | void SetupViews(ObjEditor oe) |
---|
672 | 1026 | { |
---|
| 1027 | + theFrame = this; |
---|
| 1028 | + |
---|
673 | 1029 | oe.SetupViews(); |
---|
674 | 1030 | |
---|
675 | 1031 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
678 | 1034 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
679 | 1035 | } |
---|
680 | 1036 | |
---|
681 | | - JCheckBox liveCB; |
---|
682 | | - JCheckBox supportCB; |
---|
683 | | - JCheckBox localCB; |
---|
684 | | - JCheckBox crowdCB; |
---|
685 | | - JCheckBox smoothCB; |
---|
686 | | - JCheckBox fastCB; |
---|
687 | | - JCheckBox slowCB; |
---|
688 | | - JCheckBox boxCB; |
---|
689 | | - JCheckBox zoomBoxCB; |
---|
690 | | - JCheckBox trackCB; |
---|
691 | | - JCheckBox smoothfocusCB; |
---|
| 1037 | + cToggleButton liveCB; |
---|
| 1038 | + cCheckBox supportCB; |
---|
| 1039 | + cCheckBox localCB; |
---|
| 1040 | + cCheckBox crowdCB; |
---|
| 1041 | + cCheckBox smoothCB; |
---|
| 1042 | + cToggleButton fastCB; |
---|
| 1043 | + cCheckBox slowCB; |
---|
| 1044 | + cCheckBox boxCB; |
---|
| 1045 | + cCheckBox zoomBoxCB; |
---|
| 1046 | + cCheckBox freezeCB; |
---|
| 1047 | + //cToggleButton trackCB; |
---|
| 1048 | + cCheckBox trackCB; |
---|
| 1049 | + cCheckBox smoothfocusCB; |
---|
692 | 1050 | // JCheckBox speakerMocapCB; |
---|
693 | | - JCheckBox speakerCameraCB; |
---|
694 | | - JCheckBox speakerFocusCB; |
---|
695 | | - JCheckBox debugCB; |
---|
696 | | - JCheckBox oeilCB; |
---|
697 | | - JCheckBox lookAtCB; |
---|
| 1051 | + cCheckBox speakerCameraCB; |
---|
| 1052 | + cCheckBox speakerFocusCB; |
---|
| 1053 | + cCheckBox debugCB; |
---|
| 1054 | + |
---|
| 1055 | + cCheckBox oeilCB; |
---|
| 1056 | + cCheckBox shadowCB; |
---|
| 1057 | + cCheckBox autokeepCB; |
---|
| 1058 | + cCheckBox lookAtCB; |
---|
698 | 1059 | |
---|
699 | 1060 | // static int COLOR = 1; |
---|
700 | 1061 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
702 | 1063 | |
---|
703 | 1064 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
704 | 1065 | |
---|
705 | | - JCheckBox colorCB; |
---|
706 | | - JCheckBox materialCB; |
---|
707 | | - JCheckBox textureCB; |
---|
| 1066 | + cCheckBox colorCB; |
---|
| 1067 | + cCheckBox materialCB; |
---|
| 1068 | + cCheckBox textureCB; |
---|
708 | 1069 | |
---|
709 | 1070 | public void itemStateChanged(ItemEvent e) |
---|
710 | 1071 | { |
---|
.. | .. |
---|
732 | 1093 | } else if(e.getSource() == liveCB) |
---|
733 | 1094 | { |
---|
734 | 1095 | cameraView.ToggleLive(); |
---|
| 1096 | + refreshContents(false); |
---|
735 | 1097 | } |
---|
736 | 1098 | else if(e.getSource() == supportCB) |
---|
737 | 1099 | { |
---|
.. | .. |
---|
796 | 1158 | { |
---|
797 | 1159 | cameraView.ToggleOeil(); |
---|
798 | 1160 | } |
---|
| 1161 | + else if(e.getSource() == shadowCB) |
---|
| 1162 | + { |
---|
| 1163 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1164 | + } |
---|
| 1165 | + else if(e.getSource() == freezeCB) |
---|
| 1166 | + { |
---|
| 1167 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1168 | + } |
---|
| 1169 | + else if(e.getSource() == autokeepCB) |
---|
| 1170 | + { |
---|
| 1171 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1172 | + } |
---|
799 | 1173 | else if(e.getSource() == lookAtCB) |
---|
800 | 1174 | { |
---|
801 | 1175 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
812 | 1186 | |
---|
813 | 1187 | /**/ |
---|
814 | 1188 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
815 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1190 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
816 | 1191 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
817 | 1192 | // We can't move the root node or an empty selection |
---|
818 | 1193 | return; |
---|
.. | .. |
---|
875 | 1250 | } |
---|
876 | 1251 | } |
---|
877 | 1252 | |
---|
878 | | - String string = (String) object; |
---|
879 | | - |
---|
880 | 1253 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
881 | 1254 | // if( object instanceof java.io.File[]) |
---|
882 | 1255 | // { |
---|
.. | .. |
---|
884 | 1257 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
885 | 1258 | // return; |
---|
886 | 1259 | // } |
---|
887 | | - if (string.charAt(0) == '/') |
---|
| 1260 | + |
---|
| 1261 | + String string = object.toString(); |
---|
| 1262 | + |
---|
| 1263 | + // File path for Mac and Windows |
---|
| 1264 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
888 | 1265 | { |
---|
889 | 1266 | // file(s) |
---|
890 | 1267 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
911 | 1288 | |
---|
912 | 1289 | flashIt = false; |
---|
913 | 1290 | CameraPane pane = (CameraPane) target; |
---|
914 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1291 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
915 | 1292 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
916 | 1293 | |
---|
917 | 1294 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
927 | 1304 | |
---|
928 | 1305 | assert target == objEditor.jTree; |
---|
929 | 1306 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1307 | + Object3D destinationLeaf; |
---|
930 | 1308 | try { |
---|
931 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1309 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
932 | 1310 | } catch (Exception e) { |
---|
933 | 1311 | System.out.println("destinationPath : " + destinationPath); |
---|
934 | 1312 | return; |
---|
935 | 1313 | } |
---|
936 | 1314 | |
---|
937 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1315 | + for (int i=group.selection.size(); --i>=0;) |
---|
938 | 1316 | { |
---|
| 1317 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1318 | + |
---|
| 1319 | + // Cannot move into itself |
---|
| 1320 | + if (child == destinationLeaf) |
---|
| 1321 | + return; |
---|
| 1322 | + } |
---|
| 1323 | + |
---|
| 1324 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1325 | +// { |
---|
939 | 1326 | loadClipboard(true); |
---|
940 | 1327 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
941 | | - pasteInto(false); |
---|
942 | | - } else { |
---|
943 | | - loadClipboard(false); |
---|
944 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
945 | | - pasteInto(false); // true); // ??? |
---|
946 | | - } |
---|
| 1328 | + pasteInto(false, false); |
---|
| 1329 | +// } else { |
---|
| 1330 | +// loadClipboard(false); |
---|
| 1331 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1332 | +// pasteInto(false, false); // true); // ??? |
---|
| 1333 | +// } |
---|
947 | 1334 | } |
---|
948 | 1335 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
949 | 1336 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1048 | 1435 | { |
---|
1049 | 1436 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1050 | 1437 | //heightFieldItem.addActionListener(this); |
---|
1051 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1052 | | - gridItem.addActionListener(this); |
---|
1053 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1054 | | - rectoidItem.addActionListener(this); |
---|
1055 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1056 | | - ellipsoidItem.addActionListener(this); |
---|
1057 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1058 | | - coneItem.addActionListener(this); |
---|
1059 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1060 | | - torusItem.addActionListener(this); |
---|
1061 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1062 | | - superItem.addActionListener(this); |
---|
| 1438 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1439 | +// gridItem.addActionListener(this); |
---|
| 1440 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1441 | +// rectoidItem.addActionListener(this); |
---|
| 1442 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1443 | +// ellipsoidItem.addActionListener(this); |
---|
| 1444 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1445 | +// coneItem.addActionListener(this); |
---|
| 1446 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1447 | +// torusItem.addActionListener(this); |
---|
| 1448 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1449 | +// superItem.addActionListener(this); |
---|
| 1450 | + |
---|
| 1451 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1452 | + cameraItem.addActionListener(this); |
---|
| 1453 | + |
---|
| 1454 | + if (!Globals.ADVANCED) |
---|
| 1455 | + { |
---|
1063 | 1456 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1064 | 1457 | kleinItem.addActionListener(this); |
---|
1065 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1066 | | - particleItem.addActionListener(this); |
---|
| 1458 | + } |
---|
| 1459 | + |
---|
| 1460 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1461 | +// particleItem.addActionListener(this); |
---|
| 1462 | + if (Globals.ADVANCED) |
---|
| 1463 | + { |
---|
1067 | 1464 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1068 | 1465 | ragdollItem.addActionListener(this); |
---|
1069 | 1466 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1070 | 1467 | ragdoll2Item.addActionListener(this); |
---|
| 1468 | + } |
---|
1071 | 1469 | menu.add("-"); |
---|
1072 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1470 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1073 | 1471 | meshItem.addActionListener(this); |
---|
1074 | 1472 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1075 | 1473 | // meshGroupItem.addActionListener(this); |
---|
| 1474 | + if (Globals.ADVANCED) |
---|
| 1475 | + { |
---|
1076 | 1476 | springItem = menu.add(new MenuItem("Spring")); |
---|
1077 | 1477 | springItem.addActionListener(this); |
---|
1078 | 1478 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1079 | 1479 | flagItem.addActionListener(this); |
---|
1080 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1081 | | - bezierItem.addActionListener(this); |
---|
1082 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1083 | | - checkerItem.addActionListener(this); |
---|
1084 | 1480 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1085 | 1481 | blobItem.addActionListener(this); |
---|
1086 | 1482 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1087 | 1483 | latheItem.addActionListener(this); |
---|
1088 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1089 | | - lightItem.addActionListener(this); |
---|
| 1484 | + } |
---|
| 1485 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1486 | + bezierItem.addActionListener(this); |
---|
| 1487 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1488 | +// overlayItem.addActionListener(this); |
---|
| 1489 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1490 | +// lightItem.addActionListener(this); |
---|
1090 | 1491 | menu.add("-"); |
---|
1091 | 1492 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1092 | 1493 | //superLoopItem.addActionListener(this); |
---|
1093 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1094 | | - loopItem.addActionListener(this); |
---|
| 1494 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1495 | +// loopItem.addActionListener(this); |
---|
1095 | 1496 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1096 | 1497 | doubleItem.addActionListener(this); |
---|
| 1498 | + if (Globals.ADVANCED) |
---|
| 1499 | + { |
---|
1097 | 1500 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1098 | 1501 | tripleItem.addActionListener(this); |
---|
| 1502 | + } |
---|
1099 | 1503 | } |
---|
1100 | 1504 | |
---|
1101 | 1505 | void buildToolsMenu(Menu menu) |
---|
.. | .. |
---|
1104 | 1508 | animationItem.addItemListener(this); |
---|
1105 | 1509 | animationItem.setState(Globals.ANIMATION); |
---|
1106 | 1510 | |
---|
| 1511 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1512 | + archiveItem.addActionListener(this); |
---|
| 1513 | + |
---|
1107 | 1514 | menu.add("-"); |
---|
1108 | 1515 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1109 | 1516 | parseverticesItem.addActionListener(this); |
---|
1110 | 1517 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1111 | 1518 | textureFieldItem.addActionListener(this); |
---|
1112 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1519 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1113 | 1520 | alignItem.addActionListener(this); |
---|
1114 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1115 | | - mirrorItem.addActionListener(this); |
---|
1116 | 1521 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1117 | 1522 | reduceMorphItem.addActionListener(this); |
---|
1118 | 1523 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1119 | 1524 | reduce34MorphItem.addActionListener(this); |
---|
1120 | | - |
---|
1121 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1122 | | - computeAOItem.addActionListener(this); |
---|
1123 | 1525 | menu.add("-"); |
---|
1124 | | - |
---|
1125 | 1526 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1126 | 1527 | memoryItem.addActionListener(this); |
---|
| 1528 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1529 | + computeAOItem.addActionListener(this); |
---|
| 1530 | + |
---|
| 1531 | + if (Globals.ADVANCED) |
---|
| 1532 | + { |
---|
| 1533 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1534 | + mirrorItem.addActionListener(this); |
---|
| 1535 | + menu.add("-"); |
---|
1127 | 1536 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1128 | 1537 | analyzeItem.addActionListener(this); |
---|
1129 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1538 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1130 | 1539 | dumpItem.addActionListener(this); |
---|
1131 | 1540 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1132 | 1541 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1144 | 1553 | menu.add("-"); |
---|
1145 | 1554 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1146 | 1555 | editScriptItem.addActionListener(this); |
---|
| 1556 | + } |
---|
1147 | 1557 | } |
---|
1148 | 1558 | |
---|
1149 | 1559 | void ScreenFit() |
---|
.. | .. |
---|
1266 | 1676 | shadow.material = new cMaterial(obj.material); |
---|
1267 | 1677 | shadow.material.diffuse = 0.0001f; |
---|
1268 | 1678 | shadow.material.specular = 0.0001f; |
---|
| 1679 | + //shadow.projectedVertices[1].x = 300; |
---|
1269 | 1680 | |
---|
1270 | 1681 | makeSomething(shadow); |
---|
1271 | 1682 | } |
---|
| 1683 | + |
---|
| 1684 | + private void ClearUnpinned() |
---|
| 1685 | + { |
---|
| 1686 | + //for (Object3D obj : listUI) |
---|
| 1687 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1688 | + { |
---|
| 1689 | + Object3D obj = listUI.elementAt(i); |
---|
| 1690 | + if (!obj.pinned) |
---|
| 1691 | + { |
---|
| 1692 | + obj.CloseUI(); |
---|
| 1693 | + listUI.remove(i); |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
| 1696 | + } |
---|
| 1697 | + |
---|
| 1698 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1699 | + { |
---|
| 1700 | + // if (!(elem instanceof Composite)) |
---|
| 1701 | + // newWindow = false; |
---|
| 1702 | + listUI.add(elem); |
---|
| 1703 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1704 | + System.out.println("edit : " + elem); |
---|
| 1705 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1706 | + } |
---|
1272 | 1707 | |
---|
1273 | 1708 | /** |
---|
1274 | 1709 | * applyExample |
---|
.. | .. |
---|
1472 | 1907 | |
---|
1473 | 1908 | void Overwrite(int mask) |
---|
1474 | 1909 | { |
---|
1475 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1910 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1476 | 1911 | { |
---|
1477 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1912 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1478 | 1913 | |
---|
1479 | 1914 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1480 | 1915 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1513 | 1948 | { |
---|
1514 | 1949 | ScreenFit(); |
---|
1515 | 1950 | } else |
---|
1516 | | - if (source == switchItem) |
---|
| 1951 | + if (source == switchViewItem) |
---|
1517 | 1952 | { |
---|
1518 | 1953 | cVector v1 = new cVector(); |
---|
1519 | 1954 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1522 | 1957 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1523 | 1958 | objEditor.cameraView.repaint(); |
---|
1524 | 1959 | } else |
---|
1525 | | - if (source == rectoidItem) |
---|
| 1960 | + if (source == rectoidItem || source == boxButton) |
---|
1526 | 1961 | { |
---|
1527 | 1962 | makeSomething(new Box()); |
---|
1528 | 1963 | } else |
---|
1529 | | - if (source == particleItem) |
---|
| 1964 | + if (source == particleItem || source == particlesButton) |
---|
1530 | 1965 | { |
---|
1531 | 1966 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1532 | 1967 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1605 | 2040 | |
---|
1606 | 2041 | makeSomething(obj); |
---|
1607 | 2042 | } else |
---|
1608 | | - if (source == gridItem) |
---|
| 2043 | + if (source == gridItem || source == gridButton) |
---|
1609 | 2044 | { |
---|
1610 | 2045 | makeSomething(new Grid()); |
---|
1611 | 2046 | } else |
---|
1612 | | - if (source == ellipsoidItem) |
---|
| 2047 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1613 | 2048 | { |
---|
1614 | 2049 | makeSomething(new Sphere()); |
---|
1615 | 2050 | } else |
---|
1616 | | - if (source == coneItem) |
---|
| 2051 | + if (source == coneItem || source == coneButton) |
---|
1617 | 2052 | { |
---|
1618 | 2053 | makeSomething(new Cone()); |
---|
1619 | 2054 | } else |
---|
1620 | | - if (source == torusItem) |
---|
| 2055 | + if (source == torusItem || source == torusButton) |
---|
1621 | 2056 | { |
---|
1622 | 2057 | makeSomething(new Torus()); |
---|
1623 | 2058 | } else |
---|
1624 | | - if (source == superItem) |
---|
| 2059 | + if (source == superItem || source == superButton) |
---|
1625 | 2060 | { |
---|
1626 | 2061 | makeSomething(new Superellipsoid()); |
---|
1627 | 2062 | } else |
---|
1628 | | - if (source == kleinItem) |
---|
| 2063 | + if (source == kleinItem || source == kleinButton) |
---|
1629 | 2064 | { |
---|
1630 | 2065 | makeSomething(new Klein()); |
---|
1631 | 2066 | } else |
---|
.. | .. |
---|
1645 | 2080 | { |
---|
1646 | 2081 | makeSomething(new BezierSurface()); |
---|
1647 | 2082 | } else |
---|
1648 | | - if (source == checkerItem) |
---|
| 2083 | + if (source == overlayItem || source == overlayButton) |
---|
1649 | 2084 | { |
---|
1650 | 2085 | /* |
---|
1651 | 2086 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1693 | 2128 | s.setup(); |
---|
1694 | 2129 | makeSomething(s); |
---|
1695 | 2130 | } else |
---|
1696 | | - if (source == lightItem) |
---|
| 2131 | + if (source == lightItem || source == lightButton) |
---|
1697 | 2132 | { |
---|
1698 | 2133 | makeSomething(new Light()); |
---|
1699 | 2134 | } else |
---|
.. | .. |
---|
1743 | 2178 | |
---|
1744 | 2179 | group(g); |
---|
1745 | 2180 | } else |
---|
1746 | | - if (source == loopItem) |
---|
| 2181 | + if (source == loopItem || source == loopButton) |
---|
1747 | 2182 | { |
---|
1748 | 2183 | Composite csg = new GroupLeaf(); |
---|
1749 | 2184 | csg.count = 5; |
---|
1750 | 2185 | group(csg); |
---|
1751 | | - Composite child = new cGroup(); |
---|
| 2186 | + Composite child = new cGroup("Branch"); |
---|
1752 | 2187 | csg.addChild(child); |
---|
1753 | 2188 | child.addChild(csg); |
---|
1754 | 2189 | } else |
---|
1755 | 2190 | if (source == doubleItem) |
---|
1756 | 2191 | { |
---|
1757 | | - Composite csg = new GroupLeaf(); |
---|
| 2192 | + Composite csg = new GroupLeaf("Fork"); |
---|
1758 | 2193 | csg.count = 5; |
---|
1759 | 2194 | group(csg); |
---|
1760 | | - Composite child = new cGroup(); |
---|
| 2195 | + Composite child = new cGroup("Branch A"); |
---|
1761 | 2196 | csg.addChild(child); |
---|
1762 | 2197 | child.addChild(csg); |
---|
1763 | | - child = new cGroup(); |
---|
| 2198 | + child = new cGroup("Branch B"); |
---|
1764 | 2199 | csg.addChild(child); |
---|
1765 | 2200 | child.addChild(csg); |
---|
1766 | 2201 | } else |
---|
1767 | 2202 | if (source == tripleItem) |
---|
1768 | 2203 | { |
---|
1769 | | - Composite csg = new GroupLeaf(); |
---|
| 2204 | + Composite csg = new GroupLeaf("Trident"); |
---|
1770 | 2205 | csg.count = 4; |
---|
1771 | 2206 | group(csg); |
---|
1772 | 2207 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1778 | 2213 | child = new cGroup(); |
---|
1779 | 2214 | csg.addChild(child); |
---|
1780 | 2215 | child.addChild(csg); |
---|
1781 | | - } else |
---|
1782 | | - |
---|
1783 | | - if (source == importGFDItem) |
---|
1784 | | - { |
---|
1785 | | - ImportGFD(); |
---|
1786 | | - } else |
---|
1787 | | - if (source == importVRMLX3DItem) |
---|
1788 | | - { |
---|
1789 | | - ImportVRMLX3D(); |
---|
1790 | | - } else |
---|
1791 | | - if (source == import3DSItem) |
---|
1792 | | - { |
---|
1793 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1794 | | - } else |
---|
1795 | | - if (source == importOBJItem) |
---|
1796 | | - { |
---|
1797 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1798 | 2216 | } else |
---|
1799 | 2217 | if (source == computeAOItem) |
---|
1800 | 2218 | { |
---|
.. | .. |
---|
1814 | 2232 | if (source == invariantsItem) |
---|
1815 | 2233 | { |
---|
1816 | 2234 | System.out.println("Invariants:"); |
---|
1817 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2235 | + Grafreed.grafreeD.universe.invariants(); |
---|
1818 | 2236 | } else |
---|
1819 | 2237 | if (source == memoryItem) |
---|
1820 | 2238 | { |
---|
.. | .. |
---|
1833 | 2251 | { |
---|
1834 | 2252 | DumpObject(); |
---|
1835 | 2253 | } else |
---|
| 2254 | + if (source == minButton) |
---|
| 2255 | + { |
---|
| 2256 | + Minimize(); |
---|
| 2257 | + } else |
---|
| 2258 | + if (source == maxButton) |
---|
| 2259 | + { |
---|
| 2260 | + Maximize(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == fullButton) |
---|
| 2263 | + { |
---|
| 2264 | + ToggleFullScreen(); |
---|
| 2265 | + } else |
---|
| 2266 | + if (source == undoButton) |
---|
| 2267 | + { |
---|
| 2268 | + // Go to previous version |
---|
| 2269 | + //if (!Undo()) |
---|
| 2270 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2271 | + Undo(); |
---|
| 2272 | + } else |
---|
| 2273 | + if (source == restoreButton) |
---|
| 2274 | + { |
---|
| 2275 | + // Restore current version |
---|
| 2276 | + Restore(); |
---|
| 2277 | + } else |
---|
| 2278 | + if (source == replaceButton) |
---|
| 2279 | + { |
---|
| 2280 | + // Overwrite current version |
---|
| 2281 | + Replace(); |
---|
| 2282 | + } else |
---|
| 2283 | + if (source == redoButton) |
---|
| 2284 | + { |
---|
| 2285 | + // Go to next version |
---|
| 2286 | + Redo(); |
---|
| 2287 | + } else |
---|
| 2288 | + if (source == saveButton) |
---|
| 2289 | + { |
---|
| 2290 | + // Save a new version |
---|
| 2291 | + if (!Save(true)) |
---|
| 2292 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2293 | + } else |
---|
| 2294 | + if (source == oneStepButton) |
---|
| 2295 | + { |
---|
| 2296 | + Globals.ONESTEP = true; |
---|
| 2297 | + cameraView.repaint(); |
---|
| 2298 | + } else |
---|
1836 | 2299 | if (source == screenfitButton) |
---|
1837 | 2300 | { |
---|
1838 | | - //Reload(lastConverter, lastFilename, true); |
---|
1839 | 2301 | ScreenFit(); |
---|
1840 | 2302 | } else |
---|
1841 | 2303 | if (source == screenfitpointButton) |
---|
1842 | 2304 | { |
---|
1843 | | - //Reload(lastConverter, lastFilename, true); |
---|
1844 | 2305 | ScreenFitPoint(); |
---|
1845 | 2306 | } else |
---|
1846 | 2307 | if (source == snapobjectButton) |
---|
1847 | 2308 | { |
---|
1848 | | - //Reload(lastConverter, lastFilename, true); |
---|
1849 | 2309 | SnapObject(); |
---|
1850 | 2310 | } else |
---|
1851 | 2311 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1882 | 2342 | { |
---|
1883 | 2343 | loadClipboard(true); |
---|
1884 | 2344 | } else |
---|
| 2345 | + if (source == undoItem) |
---|
| 2346 | + { |
---|
| 2347 | + Undo(); |
---|
| 2348 | + } else |
---|
| 2349 | + if (source == redoItem) |
---|
| 2350 | + { |
---|
| 2351 | + Redo(); |
---|
| 2352 | + } else |
---|
1885 | 2353 | if (source == duplicateItem) |
---|
1886 | 2354 | { |
---|
1887 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2355 | + Object3D keep = Grafreed.clipboard; |
---|
1888 | 2356 | loadClipboard(false); |
---|
1889 | 2357 | paste(false); |
---|
1890 | | - GrafreeD.clipboard = keep; |
---|
| 2358 | + Grafreed.clipboard = keep; |
---|
1891 | 2359 | } else |
---|
1892 | 2360 | if (source == cloneItem) |
---|
1893 | 2361 | { |
---|
.. | .. |
---|
1905 | 2373 | { |
---|
1906 | 2374 | paste(false); |
---|
1907 | 2375 | } else |
---|
| 2376 | + if (source == pasteIntoItem) |
---|
| 2377 | + { |
---|
| 2378 | + pasteInto(true, false); |
---|
| 2379 | + } else |
---|
1908 | 2380 | if (source == pasteLinkItem) |
---|
1909 | 2381 | { |
---|
1910 | | - pasteInto(false); |
---|
| 2382 | + pasteInto(false, false); |
---|
1911 | 2383 | } else |
---|
1912 | 2384 | if (source == pasteCloneItem) |
---|
1913 | 2385 | { |
---|
1914 | | - pasteInto(true); |
---|
| 2386 | + pasteInto(true, true); |
---|
1915 | 2387 | } else |
---|
1916 | 2388 | if (source == pasteExpandItem) |
---|
1917 | 2389 | { |
---|
.. | .. |
---|
2103 | 2575 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2104 | 2576 | // refreshContents(); |
---|
2105 | 2577 | // } |
---|
2106 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2578 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2107 | 2579 | { |
---|
2108 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2580 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2109 | 2581 | |
---|
2110 | 2582 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2111 | 2583 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2113 | 2585 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2114 | 2586 | for (int i=0; i<group.selection.size(); i++) |
---|
2115 | 2587 | { |
---|
2116 | | - boolean random = CameraPane.RANDOM; |
---|
2117 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2588 | + boolean random = CameraPane.SWITCH; |
---|
| 2589 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2118 | 2590 | group.selection.get(i).linkVerticesThis(content); |
---|
2119 | 2591 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2120 | | - CameraPane.RANDOM = random; |
---|
| 2592 | + CameraPane.SWITCH = random; |
---|
2121 | 2593 | } |
---|
2122 | 2594 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2123 | 2595 | refreshContents(); |
---|
.. | .. |
---|
2127 | 2599 | { |
---|
2128 | 2600 | for (int i=0; i<group.selection.size(); i++) |
---|
2129 | 2601 | { |
---|
2130 | | - boolean random = CameraPane.RANDOM; |
---|
2131 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2602 | + boolean random = CameraPane.SWITCH; |
---|
| 2603 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2132 | 2604 | group.selection.get(i).linkVerticesThis(null); |
---|
2133 | | - CameraPane.RANDOM = random; |
---|
| 2605 | + CameraPane.SWITCH = random; |
---|
2134 | 2606 | } |
---|
2135 | 2607 | |
---|
2136 | 2608 | refreshContents(); |
---|
2137 | 2609 | } else |
---|
2138 | 2610 | if (source == relinkverticesItem) |
---|
2139 | 2611 | { |
---|
2140 | | - boolean random = CameraPane.RANDOM; |
---|
2141 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2612 | + boolean random = CameraPane.SWITCH; |
---|
| 2613 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2142 | 2614 | group.selection.RelinkToSupport(); |
---|
2143 | | - CameraPane.RANDOM = random; |
---|
| 2615 | + CameraPane.SWITCH = random; |
---|
2144 | 2616 | |
---|
2145 | 2617 | refreshContents(); |
---|
2146 | 2618 | } else |
---|
.. | .. |
---|
2155 | 2627 | } else |
---|
2156 | 2628 | if (source == setMasterItem) |
---|
2157 | 2629 | { |
---|
2158 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2630 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2159 | 2631 | { |
---|
2160 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2632 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2161 | 2633 | |
---|
2162 | 2634 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2163 | 2635 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2170 | 2642 | { |
---|
2171 | 2643 | if (group.selection.size() == 1) |
---|
2172 | 2644 | { |
---|
2173 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2645 | + if (Grafreed.clipboard.size() == 1) |
---|
2174 | 2646 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2647 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2648 | |
---|
2177 | 2649 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2650 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2189 | 2661 | { |
---|
2190 | 2662 | RevertMeshes(); |
---|
2191 | 2663 | } else |
---|
2192 | | - if (source == resetMeshItem) |
---|
| 2664 | + if (source == resetAllItem) |
---|
2193 | 2665 | { |
---|
2194 | 2666 | ResetAll(); |
---|
2195 | 2667 | } else |
---|
.. | .. |
---|
2197 | 2669 | { |
---|
2198 | 2670 | StepAll(); |
---|
2199 | 2671 | } else |
---|
2200 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2672 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2201 | 2673 | { |
---|
2202 | 2674 | //int indices[] = jList.getSelectedIndices(); |
---|
2203 | 2675 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2209 | 2681 | { |
---|
2210 | 2682 | ClearSelection(true); |
---|
2211 | 2683 | } else |
---|
2212 | | - if (source == grabItem) |
---|
| 2684 | + if (source == grabItem || source == groupButton) |
---|
2213 | 2685 | { |
---|
2214 | | - group(new cGroup(), true); |
---|
| 2686 | + group(new cGroup(), false); // true); |
---|
2215 | 2687 | } else |
---|
2216 | 2688 | if (source == hideItem) |
---|
2217 | 2689 | { |
---|
.. | .. |
---|
2229 | 2701 | { |
---|
2230 | 2702 | makeSomething(new Camera()); |
---|
2231 | 2703 | } else |
---|
2232 | | - if (source == compositeItem) |
---|
| 2704 | + if (source == compositeItem || source == compositeButton) |
---|
2233 | 2705 | { |
---|
2234 | 2706 | group(new Composite()); |
---|
2235 | 2707 | } else |
---|
2236 | | - if (source == randomItem) |
---|
| 2708 | + if (source == switchItem || source == switchButton) |
---|
2237 | 2709 | { |
---|
2238 | 2710 | RandomNode random = new RandomNode(); |
---|
2239 | 2711 | group(random); |
---|
2240 | 2712 | if (random.size() > 0) |
---|
2241 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2713 | + random.name = random.get(0).name + "Switch"; |
---|
2242 | 2714 | } else |
---|
2243 | 2715 | if (source == physicsItem) |
---|
2244 | 2716 | { |
---|
.. | .. |
---|
2335 | 2807 | { |
---|
2336 | 2808 | group(new cLinker()); |
---|
2337 | 2809 | } else |
---|
2338 | | - if (source == textureItem) |
---|
| 2810 | + if (source == textureItem || source == textureButton) |
---|
2339 | 2811 | { |
---|
2340 | 2812 | group(new TextureNode()); |
---|
2341 | 2813 | } else |
---|
.. | .. |
---|
2355 | 2827 | { |
---|
2356 | 2828 | CastShadow(2); |
---|
2357 | 2829 | } else |
---|
2358 | | - if (source == ungroupItem) |
---|
| 2830 | + if (source == ungroupItem || source == ungroupButton) |
---|
2359 | 2831 | { |
---|
2360 | | - //ungroup(); |
---|
| 2832 | + boolean hasRoot = false; |
---|
| 2833 | + |
---|
2361 | 2834 | for (int i=0; i<group.selection.size(); i++) |
---|
2362 | 2835 | { |
---|
2363 | | - Ungroup(group.selection.get(i)); |
---|
| 2836 | + if (group.selection.get(i) == group) |
---|
| 2837 | + { |
---|
| 2838 | + hasRoot = true; |
---|
| 2839 | + break; |
---|
| 2840 | + } |
---|
2364 | 2841 | } |
---|
2365 | 2842 | |
---|
2366 | | - ClearSelection(false); |
---|
2367 | | - |
---|
2368 | | - refreshContents(); |
---|
| 2843 | + if (!hasRoot) |
---|
| 2844 | + { |
---|
| 2845 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2846 | + { |
---|
| 2847 | + Ungroup(group.selection.get(i)); |
---|
| 2848 | + } |
---|
| 2849 | + |
---|
| 2850 | + ClearSelection(false); |
---|
| 2851 | + |
---|
| 2852 | + refreshContents(); |
---|
| 2853 | + } |
---|
2369 | 2854 | } else |
---|
2370 | 2855 | if (source == genUVItem) |
---|
2371 | 2856 | { |
---|
.. | .. |
---|
2377 | 2862 | } else |
---|
2378 | 2863 | if (source == genNormalsMESHItem) |
---|
2379 | 2864 | { |
---|
2380 | | - GenNormals(true); // TODO |
---|
| 2865 | + GenNormalsMESH(); |
---|
2381 | 2866 | } else |
---|
2382 | 2867 | if (source == genNormalsORGANItem) |
---|
2383 | 2868 | { |
---|
.. | .. |
---|
2442 | 2927 | if (source == unmarkleavesItem) |
---|
2443 | 2928 | { |
---|
2444 | 2929 | MarkLeaves(false); |
---|
| 2930 | + } else |
---|
| 2931 | + if (source == rewindleavesItem) |
---|
| 2932 | + { |
---|
| 2933 | + RewindLeaves(true); |
---|
| 2934 | + } else |
---|
| 2935 | + if (source == unrewindleavesItem) |
---|
| 2936 | + { |
---|
| 2937 | + RewindLeaves(false); |
---|
| 2938 | + } else |
---|
| 2939 | + if (source == randomleavesItem) |
---|
| 2940 | + { |
---|
| 2941 | + RandomLeaves(true); |
---|
| 2942 | + } else |
---|
| 2943 | + if (source == unrandomleavesItem) |
---|
| 2944 | + { |
---|
| 2945 | + RandomLeaves(false); |
---|
2445 | 2946 | } else |
---|
2446 | 2947 | if (source == flipVItem) |
---|
2447 | 2948 | { |
---|
.. | .. |
---|
2527 | 3028 | { |
---|
2528 | 3029 | SmoothMesh(); |
---|
2529 | 3030 | } else |
---|
2530 | | - if (source == transformgeometryItem) |
---|
| 3031 | + if (source == transformGeometryItem) |
---|
2531 | 3032 | { |
---|
2532 | 3033 | TransformGeometry(); |
---|
| 3034 | + } else |
---|
| 3035 | + if (source == transformChildrenItem) |
---|
| 3036 | + { |
---|
| 3037 | + TransformChildren(); |
---|
2533 | 3038 | } else |
---|
2534 | 3039 | if (source == resetTransformItem) |
---|
2535 | 3040 | { |
---|
.. | .. |
---|
2537 | 3042 | } else |
---|
2538 | 3043 | if (source == resetCentroidItem) |
---|
2539 | 3044 | { |
---|
2540 | | - ResetCentroid(); |
---|
| 3045 | + ResetCentroid(true); |
---|
| 3046 | + } else |
---|
| 3047 | + if (source == resetCentroidXZItem) |
---|
| 3048 | + { |
---|
| 3049 | + ResetCentroid(false); |
---|
2541 | 3050 | } else |
---|
2542 | 3051 | if (source == resetParentItem) |
---|
2543 | 3052 | { |
---|
.. | .. |
---|
2669 | 3178 | if (source == twoButton) |
---|
2670 | 3179 | { |
---|
2671 | 3180 | radio.layout = twoButton; |
---|
| 3181 | + |
---|
| 3182 | + if (CameraPane.FULLSCREEN) |
---|
| 3183 | + fullscreenLayout = radio.layout; |
---|
| 3184 | + |
---|
2672 | 3185 | // bug |
---|
2673 | 3186 | //gridPanel.setDividerLocation(1.0); |
---|
2674 | 3187 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2701 | 3214 | bigThree.ClearUI(); |
---|
2702 | 3215 | bigThree.add(centralPanel); |
---|
2703 | 3216 | bigThree.FlushUI(); |
---|
| 3217 | + |
---|
| 3218 | + cameraView.requestFocusInWindow(); |
---|
| 3219 | + |
---|
| 3220 | +// refreshContents(true); |
---|
| 3221 | +// |
---|
| 3222 | +// try |
---|
| 3223 | +// { |
---|
| 3224 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3225 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3226 | +// bot.mouseMove(100, 100); |
---|
| 3227 | +// bot.mousePress(mask); |
---|
| 3228 | +// bot.mouseRelease(mask); |
---|
| 3229 | +// } |
---|
| 3230 | +// catch (Exception e) |
---|
| 3231 | +// { |
---|
| 3232 | +// |
---|
| 3233 | +// } |
---|
| 3234 | + |
---|
2704 | 3235 | } else |
---|
2705 | 3236 | if (source == threeButton) |
---|
2706 | 3237 | { |
---|
2707 | 3238 | radio.layout = threeButton; |
---|
| 3239 | + |
---|
| 3240 | + if (CameraPane.FULLSCREEN) |
---|
| 3241 | + fullscreenLayout = radio.layout; |
---|
2708 | 3242 | |
---|
2709 | 3243 | // bigThree.remove(scenePanel); |
---|
2710 | 3244 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2737 | 3271 | bigThree.add(centralPanel); |
---|
2738 | 3272 | bigThree.add(XYZPanel); |
---|
2739 | 3273 | bigThree.FlushUI(); |
---|
| 3274 | + |
---|
| 3275 | + cameraView.requestFocusInWindow(); |
---|
2740 | 3276 | } else |
---|
2741 | 3277 | if (source == fourButton) |
---|
2742 | 3278 | { |
---|
2743 | 3279 | radio.layout = fourButton; |
---|
| 3280 | + |
---|
| 3281 | + if (CameraPane.FULLSCREEN) |
---|
| 3282 | + fullscreenLayout = radio.layout; |
---|
2744 | 3283 | |
---|
2745 | 3284 | // bigThree.remove(scenePanel); |
---|
2746 | 3285 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2772 | 3311 | bigThree.ClearUI(); |
---|
2773 | 3312 | bigThree.add(scenePanel); |
---|
2774 | 3313 | bigThree.FlushUI(); |
---|
| 3314 | + |
---|
| 3315 | + cameraView.requestFocusInWindow(); |
---|
2775 | 3316 | } else |
---|
2776 | 3317 | if (source == sixButton) |
---|
2777 | 3318 | { |
---|
2778 | 3319 | radio.layout = sixButton; |
---|
| 3320 | + |
---|
| 3321 | + if (CameraPane.FULLSCREEN) |
---|
| 3322 | + fullscreenLayout = radio.layout; |
---|
2779 | 3323 | |
---|
2780 | 3324 | // bigThree.remove(scenePanel); |
---|
2781 | 3325 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2808 | 3352 | bigThree.add(scenePanel); |
---|
2809 | 3353 | bigThree.add(centralPanel); |
---|
2810 | 3354 | bigThree.FlushUI(); |
---|
| 3355 | + |
---|
| 3356 | + cameraView.requestFocusInWindow(); |
---|
2811 | 3357 | } else |
---|
2812 | 3358 | if (source == sevenButton) |
---|
2813 | 3359 | { |
---|
2814 | 3360 | radio.layout = sevenButton; |
---|
| 3361 | + |
---|
| 3362 | + if (CameraPane.FULLSCREEN) |
---|
| 3363 | + fullscreenLayout = radio.layout; |
---|
2815 | 3364 | |
---|
2816 | 3365 | // bigThree.remove(scenePanel); |
---|
2817 | 3366 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2845 | 3394 | bigThree.add(centralPanel); |
---|
2846 | 3395 | bigThree.add(XYZPanel); |
---|
2847 | 3396 | bigThree.FlushUI(); |
---|
| 3397 | + |
---|
| 3398 | + cameraView.requestFocusInWindow(); |
---|
2848 | 3399 | } else |
---|
2849 | 3400 | if (source == rootButton) |
---|
2850 | 3401 | { |
---|
.. | .. |
---|
2856 | 3407 | EditObject(obj); |
---|
2857 | 3408 | } |
---|
2858 | 3409 | |
---|
| 3410 | + cameraView.requestFocusInWindow(); |
---|
2859 | 3411 | refreshContents(true); |
---|
2860 | 3412 | } else |
---|
2861 | 3413 | if (source == closeButton) |
---|
.. | .. |
---|
2865 | 3417 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2866 | 3418 | { |
---|
2867 | 3419 | ab = (cRadio)e.nextElement(); |
---|
2868 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3420 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2869 | 3421 | { |
---|
| 3422 | + // Patch to avoid bug with transparency. |
---|
| 3423 | + if (!ab.hadMaterial) |
---|
| 3424 | + { |
---|
| 3425 | + ab.object.material = null; |
---|
| 3426 | + } |
---|
| 3427 | + |
---|
2870 | 3428 | buttonGroup.remove(ab); |
---|
2871 | 3429 | radioPanel.remove(ab); |
---|
2872 | 3430 | |
---|
2873 | | - ab.GetObject().editWindow = null; |
---|
| 3431 | + //ab.GetObject().editWindow = null; |
---|
| 3432 | + ab.GetObject().manipWindow = null; |
---|
2874 | 3433 | // ab.GetObject().objectUI = null; // ????????? |
---|
2875 | 3434 | |
---|
2876 | 3435 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2877 | 3436 | break; |
---|
2878 | 3437 | } |
---|
2879 | 3438 | } |
---|
| 3439 | + |
---|
| 3440 | + cameraView.requestFocusInWindow(); |
---|
2880 | 3441 | refreshContents(true); |
---|
2881 | 3442 | } else |
---|
2882 | 3443 | if (source == editItem || source == editButton) |
---|
2883 | 3444 | { |
---|
| 3445 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3446 | + { |
---|
| 3447 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3448 | + child.pinned = true; |
---|
| 3449 | + } |
---|
| 3450 | + |
---|
2884 | 3451 | EditSelection(false); |
---|
2885 | 3452 | } else |
---|
2886 | 3453 | if (source == uneditButton) |
---|
.. | .. |
---|
2890 | 3457 | Object3D child = (Object3D)e.nextElement(); |
---|
2891 | 3458 | if(child.editWindow != null) |
---|
2892 | 3459 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3460 | + child.pinned = false; |
---|
2893 | 3461 | child.CloseUI(); |
---|
2894 | 3462 | listUI.remove(child); |
---|
2895 | 3463 | |
---|
2896 | | - child.editWindow = null; // ??????????? |
---|
| 3464 | + //child.editWindow = null; // ??????????? |
---|
2897 | 3465 | } |
---|
2898 | | - objEditor.ctrlPanel.validate(); |
---|
| 3466 | + objEditor.ctrlPanel.FlushUI(); |
---|
2899 | 3467 | //objEditor.jTree.clearSelection(); |
---|
2900 | 3468 | //objEditor.ResetSliders(); |
---|
2901 | 3469 | refreshContents(true); |
---|
.. | .. |
---|
2906 | 3474 | //copy.ClearUI(); |
---|
2907 | 3475 | for (Object3D obj : listUI) |
---|
2908 | 3476 | { |
---|
| 3477 | + obj.pinned = false; |
---|
2909 | 3478 | obj.CloseUI(); |
---|
2910 | 3479 | } |
---|
2911 | 3480 | listUI.clear(); |
---|
.. | .. |
---|
2915 | 3484 | { |
---|
2916 | 3485 | assert(copy == group); |
---|
2917 | 3486 | |
---|
2918 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3487 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2919 | 3488 | |
---|
2920 | 3489 | for (Object3D obj : listUI) |
---|
2921 | 3490 | { |
---|
.. | .. |
---|
2964 | 3533 | } |
---|
2965 | 3534 | |
---|
2966 | 3535 | copy = group; |
---|
| 3536 | + |
---|
| 3537 | + SetUndoStates(); |
---|
| 3538 | + |
---|
2967 | 3539 | //Globals.theRenderer.object = group; |
---|
2968 | 3540 | if(!useclient) |
---|
2969 | 3541 | { |
---|
.. | .. |
---|
2979 | 3551 | frontView.object = group; |
---|
2980 | 3552 | sideView.object = group; |
---|
2981 | 3553 | } |
---|
2982 | | - group.editWindow = this; |
---|
| 3554 | + |
---|
| 3555 | +// fix "+" issue |
---|
| 3556 | + //group.editWindow = this; |
---|
| 3557 | + group.manipWindow = this; |
---|
| 3558 | + |
---|
2983 | 3559 | /* |
---|
2984 | 3560 | currentLayout = radio.layout; |
---|
2985 | 3561 | if (currentLayout == null) |
---|
2986 | 3562 | currentLayout = sevenButton; |
---|
2987 | 3563 | */ |
---|
2988 | 3564 | radio.layout.doClick(); |
---|
| 3565 | + |
---|
| 3566 | + ClearUnpinned(); |
---|
| 3567 | + //Grafreed.Assert(group != null); |
---|
| 3568 | + //Grafreed.Assert(group.selection != null); |
---|
| 3569 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3570 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3571 | + EditSelection(false); |
---|
2989 | 3572 | keepparent = group.parent; |
---|
2990 | 3573 | // PARENT = NULL or not??? |
---|
2991 | 3574 | //group.parent = null; // ROOT |
---|
2992 | 3575 | //group.attributes = -1; |
---|
2993 | 3576 | ResetModel(); |
---|
| 3577 | + |
---|
| 3578 | + cameraView.requestFocusInWindow(); |
---|
2994 | 3579 | refreshContents(true); |
---|
2995 | | - } |
---|
| 3580 | + } else if (event.getSource() == editCameraItem) |
---|
| 3581 | + { |
---|
| 3582 | + cameraView.ProtectCamera(); |
---|
| 3583 | + cameraView.repaint(); |
---|
| 3584 | + return; |
---|
| 3585 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3586 | + { |
---|
| 3587 | + cameraView.RevertCamera(); |
---|
| 3588 | + cameraView.repaint(); |
---|
| 3589 | + return; |
---|
| 3590 | + // } else if (event.getSource() == textureButton) |
---|
| 3591 | + // { |
---|
| 3592 | + // return; // true; |
---|
| 3593 | + } |
---|
2996 | 3594 | else |
---|
2997 | 3595 | { |
---|
2998 | 3596 | //return super.action(event, arg); |
---|
.. | .. |
---|
3001 | 3599 | } |
---|
3002 | 3600 | |
---|
3003 | 3601 | boolean useclient = false; |
---|
3004 | | - cRadio radio; |
---|
3005 | 3602 | |
---|
3006 | 3603 | void ToggleRoot() |
---|
3007 | 3604 | { |
---|
.. | .. |
---|
3053 | 3650 | refreshContents(); |
---|
3054 | 3651 | } |
---|
3055 | 3652 | |
---|
| 3653 | + void TransformChildren() |
---|
| 3654 | + { |
---|
| 3655 | + Object3D obj; |
---|
| 3656 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3657 | + { |
---|
| 3658 | + obj = (Object3D)e.nextElement(); |
---|
| 3659 | + obj.KeepTextureMatrices(); |
---|
| 3660 | + obj.TransformChildren(); |
---|
| 3661 | + obj.RestoreTextureMatrices(); |
---|
| 3662 | + |
---|
| 3663 | +// if (obj.parent == null) |
---|
| 3664 | +// { |
---|
| 3665 | +// System.out.println("NULL PARENT!"); |
---|
| 3666 | +// new Exception().printStackTrace(); |
---|
| 3667 | +// } |
---|
| 3668 | +// else |
---|
| 3669 | +// TouchTransform(obj); |
---|
| 3670 | +// //obj.parent.Touch(); |
---|
| 3671 | + } |
---|
| 3672 | + |
---|
| 3673 | + refreshContents(); |
---|
| 3674 | + } |
---|
3056 | 3675 | |
---|
3057 | 3676 | void ResetTransform() |
---|
3058 | 3677 | { |
---|
.. | .. |
---|
3165 | 3784 | refreshContents(); |
---|
3166 | 3785 | } |
---|
3167 | 3786 | |
---|
3168 | | - void ResetCentroid() |
---|
| 3787 | + void ResetCentroid(boolean full) |
---|
3169 | 3788 | { |
---|
3170 | 3789 | Object3D obj; |
---|
3171 | 3790 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3180 | 3799 | LA.matIdentity(Object3D.mat); |
---|
3181 | 3800 | obj.getBounds(minima, maxima, false); |
---|
3182 | 3801 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3183 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3802 | + if (full) |
---|
| 3803 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3184 | 3804 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3185 | 3805 | obj.TransformMesh(Object3D.mat); |
---|
| 3806 | + |
---|
3186 | 3807 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3187 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3808 | + if (full) |
---|
| 3809 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3188 | 3810 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3811 | + |
---|
3189 | 3812 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3190 | 3813 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3191 | 3814 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3214 | 3837 | |
---|
3215 | 3838 | int size = obj.MemorySize(); |
---|
3216 | 3839 | |
---|
3217 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3840 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3841 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3218 | 3842 | } |
---|
3219 | 3843 | } |
---|
3220 | 3844 | catch (Exception e) |
---|
.. | .. |
---|
3251 | 3875 | obj = (Object3D)e.nextElement(); |
---|
3252 | 3876 | |
---|
3253 | 3877 | System.out.println("Object is: " + obj); |
---|
3254 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3878 | + Grafreed.AnalyzeObject(obj); |
---|
3255 | 3879 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3256 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3880 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3257 | 3881 | |
---|
3258 | 3882 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3259 | 3883 | } |
---|
.. | .. |
---|
3295 | 3919 | void GenNormals(boolean crease) |
---|
3296 | 3920 | { |
---|
3297 | 3921 | group.GenNormalsS(crease); |
---|
| 3922 | + |
---|
| 3923 | + refreshContents(); |
---|
| 3924 | + } |
---|
| 3925 | + |
---|
| 3926 | + void GenNormalsMESH() |
---|
| 3927 | + { |
---|
| 3928 | + group.GenNormalsMeshS(); |
---|
3298 | 3929 | |
---|
3299 | 3930 | refreshContents(); |
---|
3300 | 3931 | } |
---|
.. | .. |
---|
3467 | 4098 | |
---|
3468 | 4099 | void ParseVertices() |
---|
3469 | 4100 | { |
---|
3470 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3471 | | - GrafreeD.epsequal = true; |
---|
| 4101 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4102 | + Grafreed.epsequal = true; |
---|
3472 | 4103 | |
---|
3473 | 4104 | for (int i=0; i<group.selection.size(); i++) |
---|
3474 | 4105 | { |
---|
.. | .. |
---|
3493 | 4124 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3494 | 4125 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3495 | 4126 | |
---|
3496 | | - g.add(GrafreeD.clipboard); |
---|
| 4127 | + g.add(Grafreed.clipboard); |
---|
3497 | 4128 | |
---|
3498 | 4129 | buffer.add(g); |
---|
3499 | 4130 | } |
---|
.. | .. |
---|
3508 | 4139 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3509 | 4140 | } |
---|
3510 | 4141 | |
---|
3511 | | - GrafreeD.epsequal = epsequal; |
---|
| 4142 | + Grafreed.epsequal = epsequal; |
---|
3512 | 4143 | |
---|
3513 | 4144 | refreshContents(); |
---|
3514 | 4145 | } |
---|
.. | .. |
---|
3526 | 4157 | String pigment = Object3D.GetPigment(tex); |
---|
3527 | 4158 | //String bump = Object3D.GetBump(tex); |
---|
3528 | 4159 | |
---|
3529 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4160 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4161 | + |
---|
| 4162 | + try |
---|
| 4163 | + { |
---|
| 4164 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4165 | + } |
---|
| 4166 | + catch (Exception e) |
---|
| 4167 | + { |
---|
| 4168 | + System.err.println("FAIL: " + node); |
---|
| 4169 | + } |
---|
3530 | 4170 | |
---|
3531 | 4171 | double s = v.s; |
---|
3532 | 4172 | |
---|
.. | .. |
---|
3614 | 4254 | |
---|
3615 | 4255 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3616 | 4256 | |
---|
3617 | | - boolean random = CameraPane.RANDOM; |
---|
3618 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4257 | + boolean random = CameraPane.SWITCH; |
---|
| 4258 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3619 | 4259 | lowres.linkVerticesThis(null); |
---|
3620 | 4260 | lowres.linkVerticesThis(sn); |
---|
3621 | | - CameraPane.RANDOM = random; |
---|
| 4261 | + CameraPane.SWITCH = random; |
---|
3622 | 4262 | |
---|
3623 | 4263 | System.err.flush(); |
---|
3624 | 4264 | |
---|
.. | .. |
---|
3658 | 4298 | return; |
---|
3659 | 4299 | |
---|
3660 | 4300 | Object3D poses = group.selection.get(0); |
---|
3661 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4301 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3662 | 4302 | |
---|
3663 | 4303 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3664 | 4304 | |
---|
.. | .. |
---|
3852 | 4492 | |
---|
3853 | 4493 | void ClipMesh() |
---|
3854 | 4494 | { |
---|
3855 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4495 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3856 | 4496 | { |
---|
3857 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4497 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3858 | 4498 | |
---|
3859 | 4499 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3860 | 4500 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3863 | 4503 | // { |
---|
3864 | 4504 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3865 | 4505 | // } |
---|
3866 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4506 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3867 | 4507 | } |
---|
3868 | 4508 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3869 | 4509 | System.out.println("DONE."); |
---|
.. | .. |
---|
3910 | 4550 | void MarkLeaves(boolean hide) |
---|
3911 | 4551 | { |
---|
3912 | 4552 | group.selection.MarkLeaves(hide); |
---|
| 4553 | + refreshContents(); |
---|
| 4554 | + } |
---|
| 4555 | + |
---|
| 4556 | + void RewindLeaves(boolean hide) |
---|
| 4557 | + { |
---|
| 4558 | + group.selection.RewindLeaves(hide); |
---|
| 4559 | + refreshContents(); |
---|
| 4560 | + } |
---|
| 4561 | + |
---|
| 4562 | + void RandomLeaves(boolean hide) |
---|
| 4563 | + { |
---|
| 4564 | + group.selection.RandomLeaves(hide); |
---|
3913 | 4565 | refreshContents(); |
---|
3914 | 4566 | } |
---|
3915 | 4567 | |
---|
.. | .. |
---|
3984 | 4636 | // } |
---|
3985 | 4637 | // } |
---|
3986 | 4638 | |
---|
3987 | | - static boolean allparams = true; |
---|
3988 | | - |
---|
3989 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3990 | | - |
---|
3991 | 4639 | void EditSelection(boolean newWindow) |
---|
3992 | 4640 | { |
---|
| 4641 | + if (group.selection == null) |
---|
| 4642 | + { |
---|
| 4643 | + EditElement(group, newWindow); // ? new |
---|
| 4644 | + return; |
---|
| 4645 | + } |
---|
| 4646 | + |
---|
3993 | 4647 | // aConstraints.gridy = 0; |
---|
3994 | 4648 | for (int i=0; i<group.selection.size(); i++) |
---|
3995 | 4649 | { |
---|
3996 | 4650 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3997 | 4651 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3998 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4652 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3999 | 4653 | |
---|
4000 | 4654 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4001 | | - if(elem != group) |
---|
| 4655 | + if(elem != group || !newWindow) |
---|
4002 | 4656 | { |
---|
4003 | | - // if (!(elem instanceof Composite)) |
---|
4004 | | - // newWindow = false; |
---|
4005 | | - listUI.add(elem); |
---|
4006 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4007 | | - System.out.println("edit : " + elem); |
---|
4008 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4657 | + EditElement(elem, newWindow); // ? new |
---|
4009 | 4658 | } |
---|
4010 | 4659 | } |
---|
4011 | 4660 | } |
---|
.. | .. |
---|
4080 | 4729 | //new Exception().printStackTrace(); |
---|
4081 | 4730 | |
---|
4082 | 4731 | freezemodel = true; |
---|
4083 | | - |
---|
| 4732 | + ClearUnpinned(); |
---|
| 4733 | + |
---|
4084 | 4734 | /**/ |
---|
4085 | 4735 | //switch (event.id) |
---|
4086 | 4736 | { |
---|
.. | .. |
---|
4088 | 4738 | //case 702: // Event.LIST_DESELECT |
---|
4089 | 4739 | group.deselectAll(); |
---|
4090 | 4740 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4091 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4092 | 4741 | if (tps != null) |
---|
4093 | 4742 | { |
---|
4094 | 4743 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4097 | 4746 | |
---|
4098 | 4747 | //if (child.parent != null) |
---|
4099 | 4748 | //child.parent.addSelectee(child); |
---|
| 4749 | + objEditor.SetMaterial(child); |
---|
4100 | 4750 | group.addSelectee(child); |
---|
4101 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4102 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4103 | | - System.err.println("info : " + child.GetPath()); |
---|
4104 | 4751 | } |
---|
4105 | 4752 | } |
---|
4106 | 4753 | // else |
---|
.. | .. |
---|
4110 | 4757 | // System.err.println("info : " + group.GetPath()); |
---|
4111 | 4758 | // } |
---|
4112 | 4759 | |
---|
4113 | | - objEditor.SetText(); // jan 2014 |
---|
4114 | | - |
---|
4115 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4760 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4116 | 4761 | CameraPane.flash = true; |
---|
4117 | 4762 | |
---|
4118 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4763 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4119 | 4764 | // a camera |
---|
4120 | 4765 | { |
---|
4121 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4122 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4766 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4767 | + { |
---|
| 4768 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4769 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4770 | + } |
---|
4123 | 4771 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4124 | 4772 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4125 | 4773 | } |
---|
4126 | 4774 | |
---|
| 4775 | + if (tps != null && tps.length == 1) |
---|
| 4776 | + { |
---|
| 4777 | + EditSelection(false); |
---|
| 4778 | + } |
---|
| 4779 | + |
---|
| 4780 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4781 | + |
---|
4127 | 4782 | refreshContents(); |
---|
4128 | 4783 | //return true; |
---|
4129 | 4784 | } |
---|
.. | .. |
---|
4132 | 4787 | |
---|
4133 | 4788 | freezemodel = false; |
---|
4134 | 4789 | } |
---|
| 4790 | + |
---|
| 4791 | + void SetPinStates(boolean enabled) |
---|
| 4792 | + { |
---|
| 4793 | + editButton.setEnabled(enabled); |
---|
| 4794 | + uneditButton.setEnabled(enabled); |
---|
| 4795 | + unselectButton.setEnabled(enabled); |
---|
| 4796 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4797 | + } |
---|
| 4798 | + |
---|
| 4799 | + void refreshContents(boolean cp) |
---|
| 4800 | + { |
---|
| 4801 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4802 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4803 | + { |
---|
| 4804 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4805 | + |
---|
| 4806 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4807 | + { |
---|
| 4808 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4809 | + |
---|
| 4810 | + objEditor.AddInfo(child, this, true); |
---|
| 4811 | + System.err.println("info : " + child.GetPath()); |
---|
| 4812 | + } |
---|
| 4813 | + |
---|
| 4814 | + objEditor.SetText(); // jan 2014 |
---|
| 4815 | + } |
---|
| 4816 | + |
---|
| 4817 | + super.refreshContents(cp); |
---|
| 4818 | + } |
---|
4135 | 4819 | |
---|
4136 | 4820 | void linkSomething(Object3D thing) |
---|
4137 | 4821 | { |
---|
.. | .. |
---|
4203 | 4887 | { |
---|
4204 | 4888 | if (group.selection.isEmpty()) |
---|
4205 | 4889 | return; |
---|
4206 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4890 | + |
---|
| 4891 | + Grafreed.clipboardIsTempGroup = false; |
---|
4207 | 4892 | Composite tGroup = null; |
---|
4208 | 4893 | if (group.selection.size() > 0) // 1) |
---|
4209 | 4894 | { |
---|
4210 | 4895 | tGroup = new cGroup(); |
---|
4211 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4896 | + Grafreed.clipboardIsTempGroup = true; |
---|
4212 | 4897 | } |
---|
4213 | 4898 | |
---|
4214 | 4899 | if (cut) |
---|
4215 | 4900 | { |
---|
| 4901 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4902 | +// Save(); |
---|
4216 | 4903 | //int indices[] = jList.getSelectedIndices(); |
---|
4217 | 4904 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4218 | 4905 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4248 | 4935 | //System.out.println("cut " + child); |
---|
4249 | 4936 | //System.out.println("parent = " + child.parent); |
---|
4250 | 4937 | // tmp.addChild(child); |
---|
4251 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4938 | + if (Grafreed.clipboardIsTempGroup) |
---|
4252 | 4939 | tGroup.add/*Child*/(tmp); |
---|
4253 | 4940 | else |
---|
4254 | | - GrafreeD.clipboard = tmp; |
---|
| 4941 | + Grafreed.clipboard = tmp; |
---|
4255 | 4942 | } |
---|
4256 | 4943 | else |
---|
4257 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4944 | + if (Grafreed.clipboardIsTempGroup) |
---|
4258 | 4945 | tGroup.add/*Child*/(child); |
---|
4259 | 4946 | else |
---|
4260 | | - GrafreeD.clipboard = child; |
---|
| 4947 | + Grafreed.clipboard = child; |
---|
4261 | 4948 | } |
---|
4262 | 4949 | |
---|
4263 | 4950 | //ResetModel(); |
---|
.. | .. |
---|
4289 | 4976 | //System.out.println("cut " + elem); |
---|
4290 | 4977 | //System.out.println("parent = " + elem.parent); |
---|
4291 | 4978 | // tmp.addChild(elem); |
---|
4292 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4979 | + if (Grafreed.clipboardIsTempGroup) |
---|
4293 | 4980 | tGroup.add/*Child*/(tmp); |
---|
4294 | 4981 | else |
---|
4295 | | - GrafreeD.clipboard = tmp; |
---|
| 4982 | + Grafreed.clipboard = tmp; |
---|
4296 | 4983 | } |
---|
4297 | 4984 | else |
---|
4298 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4985 | + if (Grafreed.clipboardIsTempGroup) |
---|
4299 | 4986 | tGroup.add/*Child*/(child); |
---|
4300 | 4987 | else |
---|
4301 | | - GrafreeD.clipboard = child; |
---|
| 4988 | + Grafreed.clipboard = child; |
---|
4302 | 4989 | } |
---|
4303 | 4990 | |
---|
4304 | 4991 | } |
---|
4305 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4306 | | - GrafreeD.clipboard = tGroup; |
---|
| 4992 | + |
---|
| 4993 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4994 | + Grafreed.clipboard = tGroup; |
---|
| 4995 | + |
---|
4307 | 4996 | if (cut) |
---|
4308 | 4997 | { |
---|
4309 | 4998 | ResetModel(); |
---|
.. | .. |
---|
4313 | 5002 | |
---|
4314 | 5003 | void paste(boolean expand) |
---|
4315 | 5004 | { |
---|
| 5005 | + if (Globals.REPLACEONMAKE) |
---|
| 5006 | + Save(); |
---|
| 5007 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5008 | + Globals.REPLACEONMAKE = false; |
---|
4316 | 5009 | // if (GrafreeD.clipboard == null) |
---|
4317 | 5010 | // return; |
---|
4318 | 5011 | boolean first = true; |
---|
4319 | 5012 | |
---|
4320 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5013 | + if (Grafreed.clipboardIsTempGroup) |
---|
4321 | 5014 | { |
---|
4322 | 5015 | Composite temp; |
---|
4323 | 5016 | |
---|
.. | .. |
---|
4328 | 5021 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4329 | 5022 | */ |
---|
4330 | 5023 | Object3D elem; |
---|
4331 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5024 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4332 | 5025 | { |
---|
4333 | 5026 | Object3D child = (Object3D)e.nextElement(); |
---|
4334 | 5027 | |
---|
.. | .. |
---|
4362 | 5055 | //Object3D cb = Applet3D.clipboard; |
---|
4363 | 5056 | //temp.addChild(cb); |
---|
4364 | 5057 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4365 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4366 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4367 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4368 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4369 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5058 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5059 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5060 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5061 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5062 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4370 | 5063 | else |
---|
4371 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4372 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5064 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5065 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4373 | 5066 | } |
---|
4374 | 5067 | |
---|
| 5068 | + Globals.REPLACEONMAKE = keep; |
---|
4375 | 5069 | ResetModel(); |
---|
4376 | 5070 | refreshContents(); |
---|
4377 | 5071 | } |
---|
4378 | 5072 | |
---|
4379 | | - void pasteInto(boolean copyit) |
---|
| 5073 | + void pasteInto(boolean copyit, boolean clone) |
---|
4380 | 5074 | { |
---|
4381 | 5075 | // if (GrafreeD.clipboard == null) |
---|
4382 | 5076 | // return; |
---|
.. | .. |
---|
4405 | 5099 | if (copyit) |
---|
4406 | 5100 | { |
---|
4407 | 5101 | // paste(false); |
---|
4408 | | - CloneClipboard(false); // sept 2014 |
---|
| 5102 | + if (clone) |
---|
| 5103 | + { |
---|
| 5104 | + CloneClipboard(false); // sept 2014 |
---|
| 5105 | + } |
---|
| 5106 | + else |
---|
| 5107 | + { |
---|
| 5108 | + paste(false); |
---|
| 5109 | + } |
---|
4409 | 5110 | } |
---|
4410 | 5111 | else |
---|
4411 | 5112 | { |
---|
4412 | 5113 | boolean first = true; |
---|
4413 | 5114 | |
---|
4414 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5115 | + if (Grafreed.clipboardIsTempGroup) |
---|
4415 | 5116 | { |
---|
4416 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5117 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4417 | 5118 | Object3D copy; |
---|
4418 | 5119 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4419 | 5120 | { |
---|
.. | .. |
---|
4423 | 5124 | } |
---|
4424 | 5125 | } else |
---|
4425 | 5126 | { |
---|
4426 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5127 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4427 | 5128 | } |
---|
4428 | 5129 | } |
---|
4429 | 5130 | } |
---|
.. | .. |
---|
4500 | 5201 | |
---|
4501 | 5202 | void group(Object3D csg, boolean grab) |
---|
4502 | 5203 | { |
---|
| 5204 | + if (Globals.REPLACEONMAKE) |
---|
| 5205 | + Save(); |
---|
| 5206 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5207 | + Globals.REPLACEONMAKE = false; |
---|
4503 | 5208 | if (//false) // why?? |
---|
4504 | 5209 | !group.selection.isEmpty()) |
---|
4505 | 5210 | { |
---|
.. | .. |
---|
4613 | 5318 | //node.add(csg); |
---|
4614 | 5319 | //makeSomething(node); |
---|
4615 | 5320 | makeSomething(csg); |
---|
| 5321 | + Globals.REPLACEONMAKE = keep; |
---|
4616 | 5322 | } |
---|
4617 | 5323 | |
---|
4618 | 5324 | void Ungroup(Object3D g) |
---|
4619 | 5325 | { |
---|
| 5326 | + if (Globals.REPLACEONMAKE) |
---|
| 5327 | + Save(); |
---|
| 5328 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5329 | + Globals.REPLACEONMAKE = false; |
---|
4620 | 5330 | if (g instanceof HiddenObject) |
---|
4621 | 5331 | { |
---|
4622 | 5332 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4633 | 5343 | objEditor.makeSomething(g.get(i), false); |
---|
4634 | 5344 | } |
---|
4635 | 5345 | } |
---|
| 5346 | + Globals.REPLACEONMAKE = keep; |
---|
4636 | 5347 | } |
---|
4637 | 5348 | |
---|
4638 | 5349 | void ungroup() |
---|
.. | .. |
---|
4828 | 5539 | } |
---|
4829 | 5540 | */ |
---|
4830 | 5541 | |
---|
4831 | | - void ImportGFD() |
---|
4832 | | - { |
---|
4833 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4834 | | - browser.show(); |
---|
4835 | | - String filename = browser.getFile(); |
---|
4836 | | - if (filename != null && filename.length() > 0) |
---|
4837 | | - { |
---|
4838 | | - String fullname = browser.getDirectory() + filename; |
---|
4839 | | - |
---|
4840 | | - //Object3D readobj = |
---|
4841 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4842 | | - //makeSomething(readobj); |
---|
4843 | | - } |
---|
4844 | | - } |
---|
4845 | | - |
---|
4846 | 5542 | /* |
---|
4847 | 5543 | public void Callback(Object obj) |
---|
4848 | 5544 | { |
---|
.. | .. |
---|
4866 | 5562 | } |
---|
4867 | 5563 | */ |
---|
4868 | 5564 | |
---|
4869 | | - void ImportVRMLX3D() |
---|
4870 | | - { |
---|
4871 | | - if (GrafreeD.standAlone) |
---|
4872 | | - { |
---|
4873 | | - /**/ |
---|
4874 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4875 | | - browser.show(); |
---|
4876 | | - String filename = browser.getFile(); |
---|
4877 | | - if (filename != null && filename.length() > 0) |
---|
4878 | | - { |
---|
4879 | | - String fullname = browser.getDirectory() + filename; |
---|
4880 | | - LoadVRMLX3D(fullname); |
---|
4881 | | - } |
---|
4882 | | - /**/ |
---|
4883 | | - } |
---|
4884 | | - } |
---|
4885 | | - |
---|
4886 | 5565 | String GetFile(String dialogName) |
---|
4887 | 5566 | { |
---|
4888 | | - if (GrafreeD.standAlone) |
---|
| 5567 | + if (Grafreed.standAlone) |
---|
4889 | 5568 | { |
---|
4890 | 5569 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4891 | 5570 | browser.show(); |
---|
.. | .. |
---|
4949 | 5628 | cButton flashSelectionButton; |
---|
4950 | 5629 | cButton editButton; |
---|
4951 | 5630 | cButton uneditButton; |
---|
| 5631 | + JCheckBox allParamsButton; |
---|
4952 | 5632 | cButton clearpanelButton; |
---|
4953 | | - cButton allParamsButton; |
---|
4954 | 5633 | cButton unselectButton; |
---|
4955 | 5634 | |
---|
| 5635 | + cButton restoreCameraButton; |
---|
| 5636 | + |
---|
| 5637 | + cButton saveButton; |
---|
| 5638 | + cButton oneStepButton; |
---|
| 5639 | + |
---|
| 5640 | + cButton groupButton; |
---|
| 5641 | + cButton ungroupButton; |
---|
| 5642 | + cButton compositeButton; |
---|
| 5643 | + cButton switchButton; |
---|
| 5644 | + cButton loopButton; |
---|
| 5645 | + cButton textureButton; |
---|
| 5646 | + |
---|
| 5647 | + cButton gridButton; |
---|
| 5648 | + cButton boxButton; |
---|
| 5649 | + cButton sphereButton; |
---|
| 5650 | + cButton coneButton; |
---|
| 5651 | + cButton torusButton; |
---|
| 5652 | + cButton superButton; |
---|
| 5653 | + cButton kleinButton; |
---|
| 5654 | + cButton particlesButton; |
---|
| 5655 | + cButton overlayButton; |
---|
| 5656 | + cButton lightButton; |
---|
| 5657 | + |
---|
4956 | 5658 | cButton screenfitButton; |
---|
4957 | 5659 | cButton screenfitpointButton; |
---|
4958 | 5660 | cButton snapobjectButton; |
---|
.. | .. |
---|
4964 | 5666 | |
---|
4965 | 5667 | cButton setsupportButton; |
---|
4966 | 5668 | |
---|
4967 | | - cButton twoButton; |
---|
4968 | | - cButton sixButton; |
---|
4969 | | - cButton threeButton; |
---|
4970 | | - cButton sevenButton; |
---|
4971 | | - cButton fourButton; // full panel |
---|
4972 | | - cButton oneButton; // full XYZ |
---|
4973 | | - //cButton currentLayout; |
---|
4974 | | - |
---|
4975 | 5669 | // |
---|
4976 | 5670 | //Composite |
---|
4977 | 5671 | Object3D // to do !! |
---|
.. | .. |
---|
4981 | 5675 | //JTree jTree; |
---|
4982 | 5676 | private MenuItem lookAtItem; |
---|
4983 | 5677 | private MenuItem lookFromItem; |
---|
4984 | | - private MenuItem switchItem; |
---|
| 5678 | + private MenuItem switchViewItem; |
---|
4985 | 5679 | private MenuItem cutItem; |
---|
4986 | | - private MenuItem duplicateItem; |
---|
| 5680 | + private MenuItem undoItem; |
---|
| 5681 | + private MenuItem redoItem; |
---|
| 5682 | + private JMenuItem duplicateItem; |
---|
4987 | 5683 | private MenuItem cloneItem; |
---|
4988 | 5684 | private MenuItem cloneSupportItem; |
---|
4989 | 5685 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4996 | 5692 | private MenuItem linkverticesItem; |
---|
4997 | 5693 | private MenuItem relinkverticesItem; |
---|
4998 | 5694 | private MenuItem setMasterItem; |
---|
4999 | | - private MenuItem resetMeshItem; |
---|
| 5695 | + private MenuItem resetAllItem; |
---|
5000 | 5696 | private MenuItem stepAllItem; |
---|
5001 | 5697 | private MenuItem revertMeshItem; |
---|
5002 | 5698 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5007 | 5703 | private MenuItem mergeGeometriesItem; |
---|
5008 | 5704 | private MenuItem copyItem; |
---|
5009 | 5705 | private MenuItem pasteItem; |
---|
| 5706 | + private MenuItem pasteIntoItem; |
---|
5010 | 5707 | private MenuItem pasteLinkItem; |
---|
5011 | 5708 | private MenuItem pasteCloneItem; |
---|
5012 | 5709 | private MenuItem pasteExpandItem; |
---|
5013 | | - private MenuItem clearItem; |
---|
| 5710 | + private MenuItem deleteItem; |
---|
5014 | 5711 | private MenuItem clearAllItem; |
---|
5015 | 5712 | private MenuItem genUVItem; |
---|
5016 | 5713 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5045 | 5742 | private MenuItem showleavesItem; |
---|
5046 | 5743 | private MenuItem markleavesItem; |
---|
5047 | 5744 | private MenuItem unmarkleavesItem; |
---|
| 5745 | + private MenuItem rewindleavesItem; |
---|
| 5746 | + private MenuItem unrewindleavesItem; |
---|
| 5747 | + private MenuItem randomleavesItem; |
---|
| 5748 | + private MenuItem unrandomleavesItem; |
---|
5048 | 5749 | |
---|
5049 | 5750 | private MenuItem flipVItem; |
---|
5050 | 5751 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5056 | 5757 | private MenuItem panoTexturesItem; |
---|
5057 | 5758 | |
---|
5058 | 5759 | private MenuItem resetCentroidItem; |
---|
5059 | | - private MenuItem transformgeometryItem; |
---|
| 5760 | + private MenuItem resetCentroidXZItem; |
---|
5060 | 5761 | private MenuItem resetTransformItem; |
---|
| 5762 | + private MenuItem transformGeometryItem; |
---|
| 5763 | + private MenuItem transformChildrenItem; |
---|
5061 | 5764 | private MenuItem hideItem; |
---|
5062 | 5765 | private MenuItem grabItem; |
---|
5063 | 5766 | private MenuItem backItem; |
---|
5064 | 5767 | private MenuItem frontItem; |
---|
5065 | 5768 | private MenuItem cameraItem; |
---|
5066 | 5769 | private MenuItem compositeItem; |
---|
5067 | | - private MenuItem randomItem; |
---|
| 5770 | + private MenuItem switchItem; |
---|
5068 | 5771 | private MenuItem physicsItem; |
---|
5069 | 5772 | private MenuItem frameselectorItem; |
---|
5070 | 5773 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5104 | 5807 | private MenuItem blobItem; |
---|
5105 | 5808 | private MenuItem latheItem; |
---|
5106 | 5809 | private MenuItem bezierItem; |
---|
5107 | | - private MenuItem checkerItem; |
---|
| 5810 | + private MenuItem overlayItem; |
---|
5108 | 5811 | private MenuItem meshItem; |
---|
5109 | 5812 | // private MenuItem meshGroupItem; |
---|
5110 | 5813 | private MenuItem springItem; |
---|
.. | .. |
---|
5126 | 5829 | private MenuItem doubleItem; |
---|
5127 | 5830 | private MenuItem tripleItem; |
---|
5128 | 5831 | |
---|
5129 | | - private MenuItem importGFDItem; |
---|
5130 | | - private MenuItem importVRMLX3DItem; |
---|
5131 | | - private MenuItem import3DSItem; |
---|
5132 | | - private MenuItem importOBJItem; |
---|
5133 | | - |
---|
5134 | 5832 | private MenuItem computeAOItem; |
---|
5135 | 5833 | private MenuItem recompileItem; |
---|
5136 | 5834 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5140 | 5838 | private MenuItem analyzeItem; |
---|
5141 | 5839 | private MenuItem dumpItem; |
---|
5142 | 5840 | //boolean freezemodel = false; |
---|
| 5841 | + |
---|
| 5842 | + Menu cameraMenu; |
---|
| 5843 | + MenuItem editCameraItem; |
---|
| 5844 | + MenuItem restoreCameraItem; |
---|
5143 | 5845 | } |
---|