.. | .. |
---|
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); |
---|
| 208 | + menu.add("-"); |
---|
188 | 209 | clearItem = menu.add(new MenuItem("Clear")); |
---|
189 | 210 | clearItem.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); |
---|
| 434 | + if (Globals.ADVANCED) |
---|
| 435 | + { |
---|
297 | 436 | genNormalsMINEItem = menu.add(new MenuItem("My 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 | */ |
---|
437 | | - aConstraints.gridy += 1; |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
438 | 605 | |
---|
439 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
440 | 607 | |
---|
441 | | - oe.aConstraints.gridwidth = 1; |
---|
442 | | - oe.aConstraints.gridx = 0; |
---|
| 608 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + //minButton.setToolTipText("Minimize window"); |
---|
| 610 | + //minButton.addActionListener(this); |
---|
443 | 611 | |
---|
444 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
445 | | - liveCB.setToolTipText("Enabled animation"); |
---|
446 | | - liveCB.addItemListener(this); |
---|
447 | | - |
---|
448 | | - oe.aConstraints.gridx += 1; |
---|
449 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); |
---|
450 | | - trackCB.setToolTipText("Enable tracking"); |
---|
451 | | - trackCB.addItemListener(this); |
---|
452 | | - |
---|
453 | | - oe.aConstraints.gridx += 1; |
---|
454 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 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); |
---|
455 | 624 | screenfitButton.setToolTipText("Screen fit"); |
---|
456 | 625 | screenfitButton.addActionListener(this); |
---|
457 | | - oe.aConstraints.gridx += 1; |
---|
| 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 | + |
---|
458 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
459 | 677 | // screenfitpointButton.addActionListener(this); |
---|
460 | | -// oe.aConstraints.gridx += 1; |
---|
461 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
462 | | - snapobjectButton.addActionListener(this); |
---|
463 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
464 | | - oe.aConstraints.gridx += 1; |
---|
465 | 678 | |
---|
466 | | - //aConstraints.gridx = 0; |
---|
467 | | - //aConstraints.gridy += 1; |
---|
468 | | - oe.aConstraints.weighty = 0; |
---|
469 | | - oe.aConstraints.gridwidth = 1; |
---|
470 | | - |
---|
471 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
472 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
473 | | - 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)); |
---|
474 | 687 | |
---|
475 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
476 | | - |
---|
477 | | - oe.aConstraints.gridx += 1; |
---|
478 | | - oe.aConstraints.weighty = 0; |
---|
479 | | - oe.aConstraints.gridwidth = 1; |
---|
480 | | - |
---|
481 | | - // |
---|
482 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 688 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
483 | 689 | twoButton.setToolTipText("Show center view only"); |
---|
484 | 690 | twoButton.addActionListener(this); |
---|
485 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 691 | + this.fullscreenLayout = twoButton; |
---|
| 692 | + |
---|
| 693 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
486 | 694 | fourButton.addActionListener(this); |
---|
487 | 695 | fourButton.setToolTipText("Show left panel only"); |
---|
488 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 696 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
489 | 697 | sixButton.setToolTipText("2-column layout left"); |
---|
490 | 698 | sixButton.addActionListener(this); |
---|
491 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 700 | threeButton.setToolTipText("2-column layout right"); |
---|
493 | 701 | threeButton.addActionListener(this); |
---|
494 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 702 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 703 | sevenButton.setToolTipText("3-column layout"); |
---|
496 | 704 | sevenButton.addActionListener(this); |
---|
497 | 705 | // |
---|
498 | 706 | |
---|
499 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
500 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 707 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
501 | 709 | rootButton.addActionListener(this); |
---|
502 | | - oe.aConstraints.gridx += 1; |
---|
503 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 710 | + |
---|
| 711 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 712 | closeButton.setToolTipText("Close tab"); |
---|
505 | 713 | closeButton.addActionListener(this); |
---|
506 | 714 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
507 | 715 | //clearButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
509 | | - |
---|
510 | | - oe.aConstraints.gridx = 1; // |
---|
511 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
512 | | - editButton.addActionListener(this); |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.aConstraints.weighty = 0; |
---|
515 | | - oe.aConstraints.gridwidth = 1; |
---|
516 | 716 | |
---|
517 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 717 | + // INSERT |
---|
| 718 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + gridButton.setToolTipText("Create grid"); |
---|
| 720 | + gridButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + boxButton.setToolTipText("Create box"); |
---|
| 724 | + boxButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 728 | + sphereButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + coneButton.setToolTipText("Create cone"); |
---|
| 732 | + coneButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + torusButton.setToolTipText("Create torus"); |
---|
| 736 | + torusButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 740 | + superButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + if (Globals.ADVANCED) |
---|
| 743 | + { |
---|
| 744 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 745 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 746 | + kleinButton.addActionListener(this); |
---|
| 747 | + } |
---|
| 748 | + |
---|
| 749 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 750 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 751 | + particlesButton.addActionListener(this); |
---|
| 752 | + |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + groupButton.setToolTipText("Create group"); |
---|
| 757 | + groupButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + compositeButton.setToolTipText("Create composite"); |
---|
| 761 | + compositeButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 765 | + switchButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + loopButton.setToolTipText("Create loop"); |
---|
| 769 | + loopButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + textureButton.setToolTipText("Create texture"); |
---|
| 773 | + textureButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 777 | + overlayButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + lightButton.setToolTipText("Create light"); |
---|
| 781 | + lightButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + for (int i=6; --i>=0;) |
---|
| 784 | + { |
---|
| 785 | + oe.toolboxPanel.Return(); |
---|
| 786 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 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 | + } |
---|
| 794 | + |
---|
| 795 | + // EDIT panel |
---|
| 796 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + editButton.setToolTipText("Pin selection controls"); |
---|
| 798 | + editButton.addActionListener(this); |
---|
| 799 | + |
---|
| 800 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
518 | 802 | uneditButton.addActionListener(this); |
---|
519 | 803 | |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | | - oe.aConstraints.weighty = 0; |
---|
522 | | - oe.aConstraints.gridwidth = 1; |
---|
523 | | - |
---|
524 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
525 | | - clearPanelButton.addActionListener(this); |
---|
526 | | - |
---|
527 | | - oe.aConstraints.gridx += 1; |
---|
528 | | - oe.aConstraints.weighty = 0; |
---|
529 | | - oe.aConstraints.gridwidth = 1; |
---|
530 | | - |
---|
531 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 804 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 805 | + allParamsButton.setToolTipText("Show all controle"); |
---|
532 | 806 | allParamsButton.addActionListener(this); |
---|
533 | 807 | |
---|
534 | | - oe.aConstraints.gridx += 1; |
---|
535 | | - oe.aConstraints.weighty = 0; |
---|
536 | | - oe.aConstraints.gridwidth = 1; |
---|
537 | | - |
---|
538 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 808 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 810 | + clearPanelButton.addActionListener(this); |
---|
| 811 | + |
---|
| 812 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 813 | + unselectButton.setToolTipText("Unselect"); |
---|
539 | 814 | unselectButton.addActionListener(this); |
---|
540 | 815 | |
---|
| 816 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 818 | + flashSelectionButton.addActionListener(this); |
---|
| 819 | + |
---|
| 820 | + editCommandsPanel.preferredHeight = 1; |
---|
| 821 | + |
---|
| 822 | + SetPinStates(false); |
---|
| 823 | +// oe.treePanel.add(commandsPanel); |
---|
| 824 | +// oe.treePanel.Return(); |
---|
| 825 | + |
---|
541 | 826 | // oe.aConstraints.gridx += 1; |
---|
542 | 827 | // oe.aConstraints.weighty = 0; |
---|
543 | 828 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
549 | 834 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
550 | 835 | // gcButton.addActionListener(this); |
---|
551 | 836 | |
---|
552 | | - oe.aConstraints.gridx = 0; |
---|
553 | | - oe.aConstraints.gridy += 1; |
---|
554 | | - |
---|
555 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
556 | | - oe.aConstraints.gridwidth = 100; |
---|
557 | | - // oe.aConstraints.gridheight = 100; |
---|
558 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
559 | | - oe.aConstraints.gridheight = 1; |
---|
560 | | - oe.aConstraints.weighty = 0.5; |
---|
561 | | - oe.aConstraints.gridx = 0; |
---|
562 | | - JScrollPane jSP; |
---|
| 837 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 838 | + |
---|
| 839 | + JScrollPane jSP; |
---|
563 | 840 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
564 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 841 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
565 | 842 | ResetModel(); |
---|
566 | | - oe.aConstraints.weighty = 0.5; |
---|
567 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
568 | | - oe.aConstraints.gridy += 1; |
---|
569 | | - oe.aConstraints.gridwidth = 1; |
---|
570 | | - |
---|
571 | | - oe.aConstraints.weighty = 0; |
---|
572 | | - oe.aConstraints.gridwidth = 2; |
---|
573 | | - |
---|
574 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
575 | | - colorCB.addItemListener(this); |
---|
576 | | - oe.aConstraints.gridx += 2; |
---|
577 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
578 | | - materialCB.addItemListener(this); |
---|
579 | | - oe.aConstraints.gridx += 2; |
---|
580 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
581 | | - textureCB.addItemListener(this); |
---|
582 | | - |
---|
583 | | - oe.aConstraints.gridx = 0; |
---|
584 | | - oe.aConstraints.gridy += 1; |
---|
585 | 843 | |
---|
| 844 | + oe.treePanel.add(jSPPanel); |
---|
| 845 | + oe.treePanel.Return(); |
---|
| 846 | + |
---|
| 847 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 848 | + oe.treePanel.Return(); |
---|
| 849 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 850 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 851 | + sliderPane.preferredHeight = 1; |
---|
| 852 | + |
---|
| 853 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 854 | +// mainPanel.setResizeWeight(0.5); |
---|
| 855 | + |
---|
586 | 856 | //jList.addListSelectionListener(this); |
---|
587 | 857 | oe.jTree.addTreeSelectionListener(this); |
---|
588 | 858 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
607 | 877 | |
---|
608 | 878 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
609 | 879 | { |
---|
610 | | - //constraints.gridx = 0; |
---|
611 | | - //constraints.gridy = 0; |
---|
612 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
613 | | - fastCB.setToolTipText("Fast mode"); |
---|
614 | | - fastCB.addItemListener(this); |
---|
615 | | - //constraints.gridy += 1; |
---|
616 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
617 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
618 | | - supportCB.addItemListener(this); |
---|
| 880 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 881 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 882 | + colorCB.addItemListener(this); |
---|
619 | 883 | |
---|
620 | | - // constraints.gridy += 1; |
---|
| 884 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 885 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 886 | + materialCB.addItemListener(this); |
---|
| 887 | + |
---|
| 888 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 889 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 890 | + textureCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.Return(); |
---|
| 893 | + |
---|
| 894 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 895 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 896 | + boxCB.addItemListener(this); |
---|
| 897 | + |
---|
| 898 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 899 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 900 | + zoomBoxCB.addItemListener(this); |
---|
| 901 | + |
---|
| 902 | + if (true) // Globals.ADVANCED) |
---|
| 903 | + { |
---|
| 904 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 905 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 906 | +// supportCB.addItemListener(this); |
---|
| 907 | + |
---|
| 908 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 909 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 910 | + freezeCB.addItemListener(this); |
---|
| 911 | + |
---|
621 | 912 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
622 | 913 | // localCB.addItemListener(this); |
---|
623 | 914 | |
---|
624 | | - //constraints.gridy += 1; |
---|
| 915 | + panel.Return(); |
---|
| 916 | + |
---|
625 | 917 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
626 | 918 | crowdCB.setToolTipText("Used for crowds"); |
---|
627 | 919 | crowdCB.addItemListener(this); |
---|
628 | 920 | |
---|
629 | | - //constraints.gridy += 1; |
---|
630 | 921 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
631 | 922 | smoothCB.setToolTipText("Snapping delay"); |
---|
632 | 923 | smoothCB.addItemListener(this); |
---|
633 | 924 | |
---|
634 | | - //constraints.gridy += 1; |
---|
635 | 925 | panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
636 | 926 | slowCB.setToolTipText("Smooth interpolation"); |
---|
637 | 927 | slowCB.addItemListener(this); |
---|
638 | | - //constraints.gridy += 1; |
---|
639 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
640 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
641 | | - boxCB.addItemListener(this); |
---|
642 | | - //constraints.gridy += 1; |
---|
643 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
644 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
645 | | - zoomBoxCB.addItemListener(this); |
---|
646 | | - |
---|
| 928 | + |
---|
647 | 929 | // constraints.gridy += 1; |
---|
648 | 930 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
649 | 931 | // speakerMocapCB.addItemListener(this); |
---|
650 | 932 | |
---|
| 933 | + panel.Return(); |
---|
| 934 | + |
---|
651 | 935 | if (false) |
---|
652 | 936 | { |
---|
653 | 937 | // handled in scripts |
---|
.. | .. |
---|
662 | 946 | //constraints.gridy += 1; |
---|
663 | 947 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
664 | 948 | smoothfocusCB.addItemListener(this); |
---|
| 949 | + panel.Return(); |
---|
665 | 950 | } |
---|
666 | 951 | |
---|
667 | 952 | //constraints.gridx += 1; |
---|
668 | 953 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
669 | 954 | // debugCB.addItemListener(this); |
---|
670 | 955 | |
---|
671 | | - //constraints.gridy += 1; |
---|
| 956 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 957 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 958 | + trackCB.addItemListener(this); |
---|
| 959 | + |
---|
672 | 960 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 961 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
673 | 962 | oeilCB.addItemListener(this); |
---|
674 | 963 | |
---|
675 | | - //constraints.gridy += 1; |
---|
| 964 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 965 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 966 | + shadowCB.addItemListener(this); |
---|
| 967 | + |
---|
| 968 | + panel.Return(); |
---|
| 969 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 970 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 971 | + toggleTextureCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 974 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 975 | + toggleSwitchCB.addItemListener(this); |
---|
| 976 | + |
---|
| 977 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 978 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 979 | + autokeepCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.Return(); |
---|
| 982 | + if (Globals.ADVANCED) |
---|
| 983 | + { |
---|
676 | 984 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
677 | 985 | lookAtCB.setToolTipText("Look-at target"); |
---|
678 | 986 | lookAtCB.addItemListener(this); |
---|
| 987 | + } |
---|
| 988 | + |
---|
| 989 | + } |
---|
| 990 | + |
---|
| 991 | + cGridBag fill = new cGridBag(); |
---|
| 992 | + fill.preferredHeight = 200; |
---|
| 993 | + cGridBag fill2 = new cGridBag(); |
---|
| 994 | + fill2.preferredHeight = 200; |
---|
| 995 | + cGridBag fill3 = new cGridBag(); |
---|
| 996 | + fill3.preferredHeight = 200; |
---|
| 997 | + |
---|
| 998 | + panel.add(fill); |
---|
| 999 | + panel.add(fill2); |
---|
| 1000 | + panel.add(fill3); |
---|
679 | 1001 | |
---|
680 | 1002 | } |
---|
681 | 1003 | |
---|
682 | 1004 | void EditObject(Object3D obj) |
---|
683 | 1005 | { |
---|
684 | 1006 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1007 | + |
---|
| 1008 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1009 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1010 | + if (!radioButton.hadMaterial) |
---|
| 1011 | + { |
---|
| 1012 | + obj.material = new cMaterial(); |
---|
| 1013 | + } |
---|
| 1014 | + |
---|
685 | 1015 | radioButton.SetObject(obj); |
---|
686 | 1016 | radioButton.layout = sevenButton; |
---|
687 | 1017 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
690 | 1020 | buttonGroup.add(radioButton); |
---|
691 | 1021 | radioButton.doClick(); |
---|
692 | 1022 | } |
---|
| 1023 | + |
---|
693 | 1024 | void SetupViews(ObjEditor oe) |
---|
694 | 1025 | { |
---|
| 1026 | + theFrame = this; |
---|
| 1027 | + |
---|
695 | 1028 | oe.SetupViews(); |
---|
696 | 1029 | |
---|
697 | 1030 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
700 | 1033 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
701 | 1034 | } |
---|
702 | 1035 | |
---|
703 | | - JCheckBox liveCB; |
---|
704 | | - JCheckBox supportCB; |
---|
705 | | - JCheckBox localCB; |
---|
706 | | - JCheckBox crowdCB; |
---|
707 | | - JCheckBox smoothCB; |
---|
708 | | - JCheckBox fastCB; |
---|
709 | | - JCheckBox slowCB; |
---|
710 | | - JCheckBox boxCB; |
---|
711 | | - JCheckBox zoomBoxCB; |
---|
712 | | - JCheckBox trackCB; |
---|
713 | | - JCheckBox smoothfocusCB; |
---|
| 1036 | + cToggleButton liveCB; |
---|
| 1037 | + cCheckBox supportCB; |
---|
| 1038 | + cCheckBox localCB; |
---|
| 1039 | + cCheckBox crowdCB; |
---|
| 1040 | + cCheckBox smoothCB; |
---|
| 1041 | + cToggleButton fastCB; |
---|
| 1042 | + cCheckBox slowCB; |
---|
| 1043 | + cCheckBox boxCB; |
---|
| 1044 | + cCheckBox zoomBoxCB; |
---|
| 1045 | + cCheckBox freezeCB; |
---|
| 1046 | + //cToggleButton trackCB; |
---|
| 1047 | + cCheckBox trackCB; |
---|
| 1048 | + cCheckBox smoothfocusCB; |
---|
714 | 1049 | // JCheckBox speakerMocapCB; |
---|
715 | | - JCheckBox speakerCameraCB; |
---|
716 | | - JCheckBox speakerFocusCB; |
---|
717 | | - JCheckBox debugCB; |
---|
718 | | - JCheckBox oeilCB; |
---|
719 | | - JCheckBox lookAtCB; |
---|
| 1050 | + cCheckBox speakerCameraCB; |
---|
| 1051 | + cCheckBox speakerFocusCB; |
---|
| 1052 | + cCheckBox debugCB; |
---|
| 1053 | + |
---|
| 1054 | + cCheckBox oeilCB; |
---|
| 1055 | + cCheckBox shadowCB; |
---|
| 1056 | + cCheckBox autokeepCB; |
---|
| 1057 | + cCheckBox lookAtCB; |
---|
720 | 1058 | |
---|
721 | 1059 | // static int COLOR = 1; |
---|
722 | 1060 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
724 | 1062 | |
---|
725 | 1063 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
726 | 1064 | |
---|
727 | | - JCheckBox colorCB; |
---|
728 | | - JCheckBox materialCB; |
---|
729 | | - JCheckBox textureCB; |
---|
| 1065 | + cCheckBox colorCB; |
---|
| 1066 | + cCheckBox materialCB; |
---|
| 1067 | + cCheckBox textureCB; |
---|
730 | 1068 | |
---|
731 | 1069 | public void itemStateChanged(ItemEvent e) |
---|
732 | 1070 | { |
---|
.. | .. |
---|
754 | 1092 | } else if(e.getSource() == liveCB) |
---|
755 | 1093 | { |
---|
756 | 1094 | cameraView.ToggleLive(); |
---|
| 1095 | + refreshContents(false); |
---|
757 | 1096 | } |
---|
758 | 1097 | else if(e.getSource() == supportCB) |
---|
759 | 1098 | { |
---|
.. | .. |
---|
818 | 1157 | { |
---|
819 | 1158 | cameraView.ToggleOeil(); |
---|
820 | 1159 | } |
---|
| 1160 | + else if(e.getSource() == shadowCB) |
---|
| 1161 | + { |
---|
| 1162 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1163 | + } |
---|
| 1164 | + else if(e.getSource() == freezeCB) |
---|
| 1165 | + { |
---|
| 1166 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1167 | + } |
---|
| 1168 | + else if(e.getSource() == autokeepCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1171 | + } |
---|
821 | 1172 | else if(e.getSource() == lookAtCB) |
---|
822 | 1173 | { |
---|
823 | 1174 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
834 | 1185 | |
---|
835 | 1186 | /**/ |
---|
836 | 1187 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
837 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1188 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
838 | 1190 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
839 | 1191 | // We can't move the root node or an empty selection |
---|
840 | 1192 | return; |
---|
.. | .. |
---|
897 | 1249 | } |
---|
898 | 1250 | } |
---|
899 | 1251 | |
---|
900 | | - String string = (String) object; |
---|
901 | | - |
---|
902 | 1252 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
903 | 1253 | // if( object instanceof java.io.File[]) |
---|
904 | 1254 | // { |
---|
.. | .. |
---|
906 | 1256 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
907 | 1257 | // return; |
---|
908 | 1258 | // } |
---|
909 | | - if (string.charAt(0) == '/') |
---|
| 1259 | + |
---|
| 1260 | + String string = object.toString(); |
---|
| 1261 | + |
---|
| 1262 | + // File path for Mac and Windows |
---|
| 1263 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
910 | 1264 | { |
---|
911 | 1265 | // file(s) |
---|
912 | 1266 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
933 | 1287 | |
---|
934 | 1288 | flashIt = false; |
---|
935 | 1289 | CameraPane pane = (CameraPane) target; |
---|
936 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1290 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
937 | 1291 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
938 | 1292 | |
---|
939 | 1293 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
949 | 1303 | |
---|
950 | 1304 | assert target == objEditor.jTree; |
---|
951 | 1305 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1306 | + Object3D destinationLeaf; |
---|
952 | 1307 | try { |
---|
953 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1308 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
954 | 1309 | } catch (Exception e) { |
---|
955 | 1310 | System.out.println("destinationPath : " + destinationPath); |
---|
956 | 1311 | return; |
---|
957 | 1312 | } |
---|
958 | 1313 | |
---|
959 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1314 | + for (int i=group.selection.size(); --i>=0;) |
---|
960 | 1315 | { |
---|
| 1316 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1317 | + |
---|
| 1318 | + // Cannot move into itself |
---|
| 1319 | + if (child == destinationLeaf) |
---|
| 1320 | + return; |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
| 1323 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1324 | +// { |
---|
961 | 1325 | loadClipboard(true); |
---|
962 | 1326 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
963 | | - pasteInto(false); |
---|
964 | | - } else { |
---|
965 | | - loadClipboard(false); |
---|
966 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
967 | | - pasteInto(false); // true); // ??? |
---|
968 | | - } |
---|
| 1327 | + pasteInto(false, false); |
---|
| 1328 | +// } else { |
---|
| 1329 | +// loadClipboard(false); |
---|
| 1330 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1331 | +// pasteInto(false, false); // true); // ??? |
---|
| 1332 | +// } |
---|
969 | 1333 | } |
---|
970 | 1334 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
971 | 1335 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1070 | 1434 | { |
---|
1071 | 1435 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1072 | 1436 | //heightFieldItem.addActionListener(this); |
---|
1073 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1074 | | - gridItem.addActionListener(this); |
---|
1075 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1076 | | - rectoidItem.addActionListener(this); |
---|
1077 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1078 | | - ellipsoidItem.addActionListener(this); |
---|
1079 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1080 | | - coneItem.addActionListener(this); |
---|
1081 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1082 | | - torusItem.addActionListener(this); |
---|
1083 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1084 | | - superItem.addActionListener(this); |
---|
| 1437 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1438 | +// gridItem.addActionListener(this); |
---|
| 1439 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1440 | +// rectoidItem.addActionListener(this); |
---|
| 1441 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1442 | +// ellipsoidItem.addActionListener(this); |
---|
| 1443 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1444 | +// coneItem.addActionListener(this); |
---|
| 1445 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1446 | +// torusItem.addActionListener(this); |
---|
| 1447 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1448 | +// superItem.addActionListener(this); |
---|
| 1449 | + |
---|
| 1450 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1451 | + cameraItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + if (!Globals.ADVANCED) |
---|
| 1454 | + { |
---|
1085 | 1455 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1086 | 1456 | kleinItem.addActionListener(this); |
---|
1087 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1088 | | - particleItem.addActionListener(this); |
---|
| 1457 | + } |
---|
| 1458 | + |
---|
| 1459 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1460 | +// particleItem.addActionListener(this); |
---|
| 1461 | + if (Globals.ADVANCED) |
---|
| 1462 | + { |
---|
1089 | 1463 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1090 | 1464 | ragdollItem.addActionListener(this); |
---|
1091 | 1465 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1092 | 1466 | ragdoll2Item.addActionListener(this); |
---|
| 1467 | + } |
---|
1093 | 1468 | menu.add("-"); |
---|
1094 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1469 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1095 | 1470 | meshItem.addActionListener(this); |
---|
1096 | 1471 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1097 | 1472 | // meshGroupItem.addActionListener(this); |
---|
| 1473 | + if (Globals.ADVANCED) |
---|
| 1474 | + { |
---|
1098 | 1475 | springItem = menu.add(new MenuItem("Spring")); |
---|
1099 | 1476 | springItem.addActionListener(this); |
---|
1100 | 1477 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1101 | 1478 | flagItem.addActionListener(this); |
---|
1102 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1103 | | - bezierItem.addActionListener(this); |
---|
1104 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1105 | | - checkerItem.addActionListener(this); |
---|
1106 | 1479 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1107 | 1480 | blobItem.addActionListener(this); |
---|
1108 | 1481 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1109 | 1482 | latheItem.addActionListener(this); |
---|
1110 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1111 | | - lightItem.addActionListener(this); |
---|
| 1483 | + } |
---|
| 1484 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1485 | + bezierItem.addActionListener(this); |
---|
| 1486 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1487 | +// overlayItem.addActionListener(this); |
---|
| 1488 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1489 | +// lightItem.addActionListener(this); |
---|
1112 | 1490 | menu.add("-"); |
---|
1113 | 1491 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1114 | 1492 | //superLoopItem.addActionListener(this); |
---|
1115 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1116 | | - loopItem.addActionListener(this); |
---|
| 1493 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1494 | +// loopItem.addActionListener(this); |
---|
1117 | 1495 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1118 | 1496 | doubleItem.addActionListener(this); |
---|
| 1497 | + if (Globals.ADVANCED) |
---|
| 1498 | + { |
---|
1119 | 1499 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1120 | 1500 | tripleItem.addActionListener(this); |
---|
| 1501 | + } |
---|
1121 | 1502 | } |
---|
1122 | 1503 | |
---|
1123 | 1504 | void buildToolsMenu(Menu menu) |
---|
1124 | 1505 | { |
---|
1125 | 1506 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1126 | 1507 | animationItem.addItemListener(this); |
---|
1127 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1508 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1509 | + |
---|
| 1510 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1511 | + archiveItem.addActionListener(this); |
---|
1128 | 1512 | |
---|
1129 | 1513 | menu.add("-"); |
---|
1130 | 1514 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1131 | 1515 | parseverticesItem.addActionListener(this); |
---|
1132 | 1516 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1133 | 1517 | textureFieldItem.addActionListener(this); |
---|
1134 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1518 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1135 | 1519 | alignItem.addActionListener(this); |
---|
1136 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1137 | | - mirrorItem.addActionListener(this); |
---|
1138 | 1520 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1139 | 1521 | reduceMorphItem.addActionListener(this); |
---|
1140 | 1522 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1141 | 1523 | reduce34MorphItem.addActionListener(this); |
---|
1142 | | - |
---|
1143 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1144 | | - computeAOItem.addActionListener(this); |
---|
1145 | 1524 | menu.add("-"); |
---|
1146 | | - |
---|
1147 | 1525 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1148 | 1526 | memoryItem.addActionListener(this); |
---|
| 1527 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1528 | + computeAOItem.addActionListener(this); |
---|
| 1529 | + |
---|
| 1530 | + if (Globals.ADVANCED) |
---|
| 1531 | + { |
---|
| 1532 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1533 | + mirrorItem.addActionListener(this); |
---|
| 1534 | + menu.add("-"); |
---|
1149 | 1535 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1150 | 1536 | analyzeItem.addActionListener(this); |
---|
1151 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1537 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1152 | 1538 | dumpItem.addActionListener(this); |
---|
1153 | 1539 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1154 | 1540 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1166 | 1552 | menu.add("-"); |
---|
1167 | 1553 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1168 | 1554 | editScriptItem.addActionListener(this); |
---|
| 1555 | + } |
---|
1169 | 1556 | } |
---|
1170 | 1557 | |
---|
1171 | 1558 | void ScreenFit() |
---|
.. | .. |
---|
1288 | 1675 | shadow.material = new cMaterial(obj.material); |
---|
1289 | 1676 | shadow.material.diffuse = 0.0001f; |
---|
1290 | 1677 | shadow.material.specular = 0.0001f; |
---|
| 1678 | + //shadow.projectedVertices[1].x = 300; |
---|
1291 | 1679 | |
---|
1292 | 1680 | makeSomething(shadow); |
---|
1293 | 1681 | } |
---|
| 1682 | + |
---|
| 1683 | + private void ClearUnpinned() |
---|
| 1684 | + { |
---|
| 1685 | + //for (Object3D obj : listUI) |
---|
| 1686 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1687 | + { |
---|
| 1688 | + Object3D obj = listUI.elementAt(i); |
---|
| 1689 | + if (!obj.pinned) |
---|
| 1690 | + { |
---|
| 1691 | + obj.CloseUI(); |
---|
| 1692 | + listUI.remove(i); |
---|
| 1693 | + } |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
1294 | 1696 | |
---|
1295 | 1697 | /** |
---|
1296 | 1698 | * applyExample |
---|
.. | .. |
---|
1494 | 1896 | |
---|
1495 | 1897 | void Overwrite(int mask) |
---|
1496 | 1898 | { |
---|
1497 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1899 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1498 | 1900 | { |
---|
1499 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1901 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1500 | 1902 | |
---|
1501 | 1903 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1502 | 1904 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1535 | 1937 | { |
---|
1536 | 1938 | ScreenFit(); |
---|
1537 | 1939 | } else |
---|
1538 | | - if (source == switchItem) |
---|
| 1940 | + if (source == switchViewItem) |
---|
1539 | 1941 | { |
---|
1540 | 1942 | cVector v1 = new cVector(); |
---|
1541 | 1943 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1544 | 1946 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1545 | 1947 | objEditor.cameraView.repaint(); |
---|
1546 | 1948 | } else |
---|
1547 | | - if (source == rectoidItem) |
---|
| 1949 | + if (source == rectoidItem || source == boxButton) |
---|
1548 | 1950 | { |
---|
1549 | 1951 | makeSomething(new Box()); |
---|
1550 | 1952 | } else |
---|
1551 | | - if (source == particleItem) |
---|
| 1953 | + if (source == particleItem || source == particlesButton) |
---|
1552 | 1954 | { |
---|
1553 | 1955 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1554 | 1956 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1627 | 2029 | |
---|
1628 | 2030 | makeSomething(obj); |
---|
1629 | 2031 | } else |
---|
1630 | | - if (source == gridItem) |
---|
| 2032 | + if (source == gridItem || source == gridButton) |
---|
1631 | 2033 | { |
---|
1632 | 2034 | makeSomething(new Grid()); |
---|
1633 | 2035 | } else |
---|
1634 | | - if (source == ellipsoidItem) |
---|
| 2036 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1635 | 2037 | { |
---|
1636 | 2038 | makeSomething(new Sphere()); |
---|
1637 | 2039 | } else |
---|
1638 | | - if (source == coneItem) |
---|
| 2040 | + if (source == coneItem || source == coneButton) |
---|
1639 | 2041 | { |
---|
1640 | 2042 | makeSomething(new Cone()); |
---|
1641 | 2043 | } else |
---|
1642 | | - if (source == torusItem) |
---|
| 2044 | + if (source == torusItem || source == torusButton) |
---|
1643 | 2045 | { |
---|
1644 | 2046 | makeSomething(new Torus()); |
---|
1645 | 2047 | } else |
---|
1646 | | - if (source == superItem) |
---|
| 2048 | + if (source == superItem || source == superButton) |
---|
1647 | 2049 | { |
---|
1648 | 2050 | makeSomething(new Superellipsoid()); |
---|
1649 | 2051 | } else |
---|
1650 | | - if (source == kleinItem) |
---|
| 2052 | + if (source == kleinItem || source == kleinButton) |
---|
1651 | 2053 | { |
---|
1652 | 2054 | makeSomething(new Klein()); |
---|
1653 | 2055 | } else |
---|
.. | .. |
---|
1667 | 2069 | { |
---|
1668 | 2070 | makeSomething(new BezierSurface()); |
---|
1669 | 2071 | } else |
---|
1670 | | - if (source == checkerItem) |
---|
| 2072 | + if (source == overlayItem || source == overlayButton) |
---|
1671 | 2073 | { |
---|
1672 | 2074 | /* |
---|
1673 | 2075 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1715 | 2117 | s.setup(); |
---|
1716 | 2118 | makeSomething(s); |
---|
1717 | 2119 | } else |
---|
1718 | | - if (source == lightItem) |
---|
| 2120 | + if (source == lightItem || source == lightButton) |
---|
1719 | 2121 | { |
---|
1720 | 2122 | makeSomething(new Light()); |
---|
1721 | 2123 | } else |
---|
.. | .. |
---|
1765 | 2167 | |
---|
1766 | 2168 | group(g); |
---|
1767 | 2169 | } else |
---|
1768 | | - if (source == loopItem) |
---|
| 2170 | + if (source == loopItem || source == loopButton) |
---|
1769 | 2171 | { |
---|
1770 | 2172 | Composite csg = new GroupLeaf(); |
---|
1771 | 2173 | csg.count = 5; |
---|
1772 | 2174 | group(csg); |
---|
1773 | | - Composite child = new cGroup(); |
---|
| 2175 | + Composite child = new cGroup("Branch"); |
---|
1774 | 2176 | csg.addChild(child); |
---|
1775 | 2177 | child.addChild(csg); |
---|
1776 | 2178 | } else |
---|
1777 | 2179 | if (source == doubleItem) |
---|
1778 | 2180 | { |
---|
1779 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Fork"); |
---|
1780 | 2182 | csg.count = 5; |
---|
1781 | 2183 | group(csg); |
---|
1782 | | - Composite child = new cGroup(); |
---|
| 2184 | + Composite child = new cGroup("Branch A"); |
---|
1783 | 2185 | csg.addChild(child); |
---|
1784 | 2186 | child.addChild(csg); |
---|
1785 | | - child = new cGroup(); |
---|
| 2187 | + child = new cGroup("Branch B"); |
---|
1786 | 2188 | csg.addChild(child); |
---|
1787 | 2189 | child.addChild(csg); |
---|
1788 | 2190 | } else |
---|
1789 | 2191 | if (source == tripleItem) |
---|
1790 | 2192 | { |
---|
1791 | | - Composite csg = new GroupLeaf(); |
---|
| 2193 | + Composite csg = new GroupLeaf("Trident"); |
---|
1792 | 2194 | csg.count = 4; |
---|
1793 | 2195 | group(csg); |
---|
1794 | 2196 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1800 | 2202 | child = new cGroup(); |
---|
1801 | 2203 | csg.addChild(child); |
---|
1802 | 2204 | child.addChild(csg); |
---|
1803 | | - } else |
---|
1804 | | - |
---|
1805 | | - if (source == importGFDItem) |
---|
1806 | | - { |
---|
1807 | | - ImportGFD(); |
---|
1808 | | - } else |
---|
1809 | | - if (source == importVRMLX3DItem) |
---|
1810 | | - { |
---|
1811 | | - ImportVRMLX3D(); |
---|
1812 | | - } else |
---|
1813 | | - if (source == import3DSItem) |
---|
1814 | | - { |
---|
1815 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1816 | | - } else |
---|
1817 | | - if (source == importOBJItem) |
---|
1818 | | - { |
---|
1819 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1820 | 2205 | } else |
---|
1821 | 2206 | if (source == computeAOItem) |
---|
1822 | 2207 | { |
---|
.. | .. |
---|
1836 | 2221 | if (source == invariantsItem) |
---|
1837 | 2222 | { |
---|
1838 | 2223 | System.out.println("Invariants:"); |
---|
1839 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2224 | + Grafreed.grafreeD.universe.invariants(); |
---|
1840 | 2225 | } else |
---|
1841 | 2226 | if (source == memoryItem) |
---|
1842 | 2227 | { |
---|
.. | .. |
---|
1855 | 2240 | { |
---|
1856 | 2241 | DumpObject(); |
---|
1857 | 2242 | } else |
---|
| 2243 | + if (source == minButton) |
---|
| 2244 | + { |
---|
| 2245 | + Minimize(); |
---|
| 2246 | + } else |
---|
| 2247 | + if (source == maxButton) |
---|
| 2248 | + { |
---|
| 2249 | + Maximize(); |
---|
| 2250 | + } else |
---|
| 2251 | + if (source == fullButton) |
---|
| 2252 | + { |
---|
| 2253 | + ToggleFullScreen(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == undoButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Go to previous version |
---|
| 2258 | + //if (!Undo()) |
---|
| 2259 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2260 | + Undo(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == restoreButton) |
---|
| 2263 | + { |
---|
| 2264 | + // Restore current version |
---|
| 2265 | + Restore(); |
---|
| 2266 | + } else |
---|
| 2267 | + if (source == replaceButton) |
---|
| 2268 | + { |
---|
| 2269 | + // Overwrite current version |
---|
| 2270 | + Replace(); |
---|
| 2271 | + } else |
---|
| 2272 | + if (source == redoButton) |
---|
| 2273 | + { |
---|
| 2274 | + // Go to next version |
---|
| 2275 | + Redo(); |
---|
| 2276 | + } else |
---|
| 2277 | + if (source == saveButton) |
---|
| 2278 | + { |
---|
| 2279 | + // Save a new version |
---|
| 2280 | + if (!Save(true)) |
---|
| 2281 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2282 | + } else |
---|
| 2283 | + if (source == oneStepButton) |
---|
| 2284 | + { |
---|
| 2285 | + Globals.ONESTEP = true; |
---|
| 2286 | + cameraView.repaint(); |
---|
| 2287 | + } else |
---|
1858 | 2288 | if (source == screenfitButton) |
---|
1859 | 2289 | { |
---|
1860 | | - //Reload(lastConverter, lastFilename, true); |
---|
1861 | 2290 | ScreenFit(); |
---|
1862 | 2291 | } else |
---|
1863 | 2292 | if (source == screenfitpointButton) |
---|
1864 | 2293 | { |
---|
1865 | | - //Reload(lastConverter, lastFilename, true); |
---|
1866 | 2294 | ScreenFitPoint(); |
---|
1867 | 2295 | } else |
---|
1868 | 2296 | if (source == snapobjectButton) |
---|
1869 | 2297 | { |
---|
1870 | | - //Reload(lastConverter, lastFilename, true); |
---|
1871 | 2298 | SnapObject(); |
---|
1872 | 2299 | } else |
---|
1873 | 2300 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1904 | 2331 | { |
---|
1905 | 2332 | loadClipboard(true); |
---|
1906 | 2333 | } else |
---|
| 2334 | + if (source == undoItem) |
---|
| 2335 | + { |
---|
| 2336 | + Undo(); |
---|
| 2337 | + } else |
---|
| 2338 | + if (source == redoItem) |
---|
| 2339 | + { |
---|
| 2340 | + Redo(); |
---|
| 2341 | + } else |
---|
1907 | 2342 | if (source == duplicateItem) |
---|
1908 | 2343 | { |
---|
1909 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2344 | + Object3D keep = Grafreed.clipboard; |
---|
1910 | 2345 | loadClipboard(false); |
---|
1911 | 2346 | paste(false); |
---|
1912 | | - GrafreeD.clipboard = keep; |
---|
| 2347 | + Grafreed.clipboard = keep; |
---|
1913 | 2348 | } else |
---|
1914 | 2349 | if (source == cloneItem) |
---|
1915 | 2350 | { |
---|
.. | .. |
---|
1927 | 2362 | { |
---|
1928 | 2363 | paste(false); |
---|
1929 | 2364 | } else |
---|
| 2365 | + if (source == pasteIntoItem) |
---|
| 2366 | + { |
---|
| 2367 | + pasteInto(true, false); |
---|
| 2368 | + } else |
---|
1930 | 2369 | if (source == pasteLinkItem) |
---|
1931 | 2370 | { |
---|
1932 | | - pasteInto(false); |
---|
| 2371 | + pasteInto(false, false); |
---|
1933 | 2372 | } else |
---|
1934 | 2373 | if (source == pasteCloneItem) |
---|
1935 | 2374 | { |
---|
1936 | | - pasteInto(true); |
---|
| 2375 | + pasteInto(true, true); |
---|
1937 | 2376 | } else |
---|
1938 | 2377 | if (source == pasteExpandItem) |
---|
1939 | 2378 | { |
---|
.. | .. |
---|
2125 | 2564 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2126 | 2565 | // refreshContents(); |
---|
2127 | 2566 | // } |
---|
2128 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2567 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2129 | 2568 | { |
---|
2130 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2569 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2131 | 2570 | |
---|
2132 | 2571 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2133 | 2572 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2135 | 2574 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2136 | 2575 | for (int i=0; i<group.selection.size(); i++) |
---|
2137 | 2576 | { |
---|
2138 | | - boolean random = CameraPane.RANDOM; |
---|
2139 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2577 | + boolean random = CameraPane.SWITCH; |
---|
| 2578 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2140 | 2579 | group.selection.get(i).linkVerticesThis(content); |
---|
2141 | 2580 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2142 | | - CameraPane.RANDOM = random; |
---|
| 2581 | + CameraPane.SWITCH = random; |
---|
2143 | 2582 | } |
---|
2144 | 2583 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2145 | 2584 | refreshContents(); |
---|
.. | .. |
---|
2149 | 2588 | { |
---|
2150 | 2589 | for (int i=0; i<group.selection.size(); i++) |
---|
2151 | 2590 | { |
---|
2152 | | - boolean random = CameraPane.RANDOM; |
---|
2153 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2591 | + boolean random = CameraPane.SWITCH; |
---|
| 2592 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2154 | 2593 | group.selection.get(i).linkVerticesThis(null); |
---|
2155 | | - CameraPane.RANDOM = random; |
---|
| 2594 | + CameraPane.SWITCH = random; |
---|
2156 | 2595 | } |
---|
2157 | 2596 | |
---|
2158 | 2597 | refreshContents(); |
---|
2159 | 2598 | } else |
---|
2160 | 2599 | if (source == relinkverticesItem) |
---|
2161 | 2600 | { |
---|
2162 | | - boolean random = CameraPane.RANDOM; |
---|
2163 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2601 | + boolean random = CameraPane.SWITCH; |
---|
| 2602 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2164 | 2603 | group.selection.RelinkToSupport(); |
---|
2165 | | - CameraPane.RANDOM = random; |
---|
| 2604 | + CameraPane.SWITCH = random; |
---|
2166 | 2605 | |
---|
2167 | 2606 | refreshContents(); |
---|
2168 | 2607 | } else |
---|
.. | .. |
---|
2177 | 2616 | } else |
---|
2178 | 2617 | if (source == setMasterItem) |
---|
2179 | 2618 | { |
---|
2180 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2619 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2181 | 2620 | { |
---|
2182 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2621 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2183 | 2622 | |
---|
2184 | 2623 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2185 | 2624 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2192 | 2631 | { |
---|
2193 | 2632 | if (group.selection.size() == 1) |
---|
2194 | 2633 | { |
---|
2195 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2634 | + if (Grafreed.clipboard.size() == 1) |
---|
2196 | 2635 | { |
---|
2197 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2636 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2198 | 2637 | |
---|
2199 | 2638 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2200 | 2639 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2211 | 2650 | { |
---|
2212 | 2651 | RevertMeshes(); |
---|
2213 | 2652 | } else |
---|
2214 | | - if (source == resetMeshItem) |
---|
| 2653 | + if (source == resetAllItem) |
---|
2215 | 2654 | { |
---|
2216 | 2655 | ResetAll(); |
---|
2217 | 2656 | } else |
---|
.. | .. |
---|
2231 | 2670 | { |
---|
2232 | 2671 | ClearSelection(true); |
---|
2233 | 2672 | } else |
---|
2234 | | - if (source == grabItem) |
---|
| 2673 | + if (source == grabItem || source == groupButton) |
---|
2235 | 2674 | { |
---|
2236 | | - group(new cGroup(), true); |
---|
| 2675 | + group(new cGroup(), false); // true); |
---|
2237 | 2676 | } else |
---|
2238 | 2677 | if (source == hideItem) |
---|
2239 | 2678 | { |
---|
.. | .. |
---|
2251 | 2690 | { |
---|
2252 | 2691 | makeSomething(new Camera()); |
---|
2253 | 2692 | } else |
---|
2254 | | - if (source == compositeItem) |
---|
| 2693 | + if (source == compositeItem || source == compositeButton) |
---|
2255 | 2694 | { |
---|
2256 | 2695 | group(new Composite()); |
---|
2257 | 2696 | } else |
---|
2258 | | - if (source == randomItem) |
---|
| 2697 | + if (source == switchItem || source == switchButton) |
---|
2259 | 2698 | { |
---|
2260 | 2699 | RandomNode random = new RandomNode(); |
---|
2261 | 2700 | group(random); |
---|
2262 | 2701 | if (random.size() > 0) |
---|
2263 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2702 | + random.name = random.get(0).name + "Switch"; |
---|
2264 | 2703 | } else |
---|
2265 | 2704 | if (source == physicsItem) |
---|
2266 | 2705 | { |
---|
.. | .. |
---|
2357 | 2796 | { |
---|
2358 | 2797 | group(new cLinker()); |
---|
2359 | 2798 | } else |
---|
2360 | | - if (source == textureItem) |
---|
| 2799 | + if (source == textureItem || source == textureButton) |
---|
2361 | 2800 | { |
---|
2362 | 2801 | group(new TextureNode()); |
---|
2363 | 2802 | } else |
---|
.. | .. |
---|
2377 | 2816 | { |
---|
2378 | 2817 | CastShadow(2); |
---|
2379 | 2818 | } else |
---|
2380 | | - if (source == ungroupItem) |
---|
| 2819 | + if (source == ungroupItem || source == ungroupButton) |
---|
2381 | 2820 | { |
---|
2382 | | - //ungroup(); |
---|
| 2821 | + boolean hasRoot = false; |
---|
| 2822 | + |
---|
2383 | 2823 | for (int i=0; i<group.selection.size(); i++) |
---|
2384 | 2824 | { |
---|
2385 | | - Ungroup(group.selection.get(i)); |
---|
| 2825 | + if (group.selection.get(i) == group) |
---|
| 2826 | + { |
---|
| 2827 | + hasRoot = true; |
---|
| 2828 | + break; |
---|
| 2829 | + } |
---|
2386 | 2830 | } |
---|
2387 | 2831 | |
---|
2388 | | - ClearSelection(false); |
---|
2389 | | - |
---|
2390 | | - refreshContents(); |
---|
| 2832 | + if (!hasRoot) |
---|
| 2833 | + { |
---|
| 2834 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2835 | + { |
---|
| 2836 | + Ungroup(group.selection.get(i)); |
---|
| 2837 | + } |
---|
| 2838 | + |
---|
| 2839 | + ClearSelection(false); |
---|
| 2840 | + |
---|
| 2841 | + refreshContents(); |
---|
| 2842 | + } |
---|
2391 | 2843 | } else |
---|
2392 | 2844 | if (source == genUVItem) |
---|
2393 | 2845 | { |
---|
.. | .. |
---|
2399 | 2851 | } else |
---|
2400 | 2852 | if (source == genNormalsMESHItem) |
---|
2401 | 2853 | { |
---|
2402 | | - GenNormals(true); // TODO |
---|
| 2854 | + GenNormalsMESH(); |
---|
2403 | 2855 | } else |
---|
2404 | 2856 | if (source == genNormalsORGANItem) |
---|
2405 | 2857 | { |
---|
.. | .. |
---|
2464 | 2916 | if (source == unmarkleavesItem) |
---|
2465 | 2917 | { |
---|
2466 | 2918 | MarkLeaves(false); |
---|
| 2919 | + } else |
---|
| 2920 | + if (source == rewindleavesItem) |
---|
| 2921 | + { |
---|
| 2922 | + RewindLeaves(true); |
---|
| 2923 | + } else |
---|
| 2924 | + if (source == unrewindleavesItem) |
---|
| 2925 | + { |
---|
| 2926 | + RewindLeaves(false); |
---|
| 2927 | + } else |
---|
| 2928 | + if (source == randomleavesItem) |
---|
| 2929 | + { |
---|
| 2930 | + RandomLeaves(true); |
---|
| 2931 | + } else |
---|
| 2932 | + if (source == unrandomleavesItem) |
---|
| 2933 | + { |
---|
| 2934 | + RandomLeaves(false); |
---|
2467 | 2935 | } else |
---|
2468 | 2936 | if (source == flipVItem) |
---|
2469 | 2937 | { |
---|
.. | .. |
---|
2549 | 3017 | { |
---|
2550 | 3018 | SmoothMesh(); |
---|
2551 | 3019 | } else |
---|
2552 | | - if (source == transformgeometryItem) |
---|
| 3020 | + if (source == transformGeometryItem) |
---|
2553 | 3021 | { |
---|
2554 | 3022 | TransformGeometry(); |
---|
| 3023 | + } else |
---|
| 3024 | + if (source == transformChildrenItem) |
---|
| 3025 | + { |
---|
| 3026 | + TransformChildren(); |
---|
2555 | 3027 | } else |
---|
2556 | 3028 | if (source == resetTransformItem) |
---|
2557 | 3029 | { |
---|
.. | .. |
---|
2559 | 3031 | } else |
---|
2560 | 3032 | if (source == resetCentroidItem) |
---|
2561 | 3033 | { |
---|
2562 | | - ResetCentroid(); |
---|
| 3034 | + ResetCentroid(true); |
---|
| 3035 | + } else |
---|
| 3036 | + if (source == resetCentroidXZItem) |
---|
| 3037 | + { |
---|
| 3038 | + ResetCentroid(false); |
---|
2563 | 3039 | } else |
---|
2564 | 3040 | if (source == resetParentItem) |
---|
2565 | 3041 | { |
---|
.. | .. |
---|
2691 | 3167 | if (source == twoButton) |
---|
2692 | 3168 | { |
---|
2693 | 3169 | radio.layout = twoButton; |
---|
| 3170 | + |
---|
| 3171 | + if (CameraPane.FULLSCREEN) |
---|
| 3172 | + fullscreenLayout = radio.layout; |
---|
| 3173 | + |
---|
2694 | 3174 | // bug |
---|
2695 | 3175 | //gridPanel.setDividerLocation(1.0); |
---|
2696 | 3176 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2723 | 3203 | bigThree.ClearUI(); |
---|
2724 | 3204 | bigThree.add(centralPanel); |
---|
2725 | 3205 | bigThree.FlushUI(); |
---|
| 3206 | + |
---|
| 3207 | + cameraView.requestFocusInWindow(); |
---|
| 3208 | + |
---|
| 3209 | +// refreshContents(true); |
---|
| 3210 | +// |
---|
| 3211 | +// try |
---|
| 3212 | +// { |
---|
| 3213 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3214 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3215 | +// bot.mouseMove(100, 100); |
---|
| 3216 | +// bot.mousePress(mask); |
---|
| 3217 | +// bot.mouseRelease(mask); |
---|
| 3218 | +// } |
---|
| 3219 | +// catch (Exception e) |
---|
| 3220 | +// { |
---|
| 3221 | +// |
---|
| 3222 | +// } |
---|
| 3223 | + |
---|
2726 | 3224 | } else |
---|
2727 | 3225 | if (source == threeButton) |
---|
2728 | 3226 | { |
---|
2729 | 3227 | radio.layout = threeButton; |
---|
| 3228 | + |
---|
| 3229 | + if (CameraPane.FULLSCREEN) |
---|
| 3230 | + fullscreenLayout = radio.layout; |
---|
2730 | 3231 | |
---|
2731 | 3232 | // bigThree.remove(scenePanel); |
---|
2732 | 3233 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2759 | 3260 | bigThree.add(centralPanel); |
---|
2760 | 3261 | bigThree.add(XYZPanel); |
---|
2761 | 3262 | bigThree.FlushUI(); |
---|
| 3263 | + |
---|
| 3264 | + cameraView.requestFocusInWindow(); |
---|
2762 | 3265 | } else |
---|
2763 | 3266 | if (source == fourButton) |
---|
2764 | 3267 | { |
---|
2765 | 3268 | radio.layout = fourButton; |
---|
| 3269 | + |
---|
| 3270 | + if (CameraPane.FULLSCREEN) |
---|
| 3271 | + fullscreenLayout = radio.layout; |
---|
2766 | 3272 | |
---|
2767 | 3273 | // bigThree.remove(scenePanel); |
---|
2768 | 3274 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2794 | 3300 | bigThree.ClearUI(); |
---|
2795 | 3301 | bigThree.add(scenePanel); |
---|
2796 | 3302 | bigThree.FlushUI(); |
---|
| 3303 | + |
---|
| 3304 | + cameraView.requestFocusInWindow(); |
---|
2797 | 3305 | } else |
---|
2798 | 3306 | if (source == sixButton) |
---|
2799 | 3307 | { |
---|
2800 | 3308 | radio.layout = sixButton; |
---|
| 3309 | + |
---|
| 3310 | + if (CameraPane.FULLSCREEN) |
---|
| 3311 | + fullscreenLayout = radio.layout; |
---|
2801 | 3312 | |
---|
2802 | 3313 | // bigThree.remove(scenePanel); |
---|
2803 | 3314 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2830 | 3341 | bigThree.add(scenePanel); |
---|
2831 | 3342 | bigThree.add(centralPanel); |
---|
2832 | 3343 | bigThree.FlushUI(); |
---|
| 3344 | + |
---|
| 3345 | + cameraView.requestFocusInWindow(); |
---|
2833 | 3346 | } else |
---|
2834 | 3347 | if (source == sevenButton) |
---|
2835 | 3348 | { |
---|
2836 | 3349 | radio.layout = sevenButton; |
---|
| 3350 | + |
---|
| 3351 | + if (CameraPane.FULLSCREEN) |
---|
| 3352 | + fullscreenLayout = radio.layout; |
---|
2837 | 3353 | |
---|
2838 | 3354 | // bigThree.remove(scenePanel); |
---|
2839 | 3355 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2867 | 3383 | bigThree.add(centralPanel); |
---|
2868 | 3384 | bigThree.add(XYZPanel); |
---|
2869 | 3385 | bigThree.FlushUI(); |
---|
| 3386 | + |
---|
| 3387 | + cameraView.requestFocusInWindow(); |
---|
2870 | 3388 | } else |
---|
2871 | 3389 | if (source == rootButton) |
---|
2872 | 3390 | { |
---|
.. | .. |
---|
2878 | 3396 | EditObject(obj); |
---|
2879 | 3397 | } |
---|
2880 | 3398 | |
---|
| 3399 | + cameraView.requestFocusInWindow(); |
---|
2881 | 3400 | refreshContents(true); |
---|
2882 | 3401 | } else |
---|
2883 | 3402 | if (source == closeButton) |
---|
.. | .. |
---|
2887 | 3406 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2888 | 3407 | { |
---|
2889 | 3408 | ab = (cRadio)e.nextElement(); |
---|
2890 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3409 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2891 | 3410 | { |
---|
| 3411 | + // Patch to avoid bug with transparency. |
---|
| 3412 | + if (!ab.hadMaterial) |
---|
| 3413 | + { |
---|
| 3414 | + ab.object.material = null; |
---|
| 3415 | + } |
---|
| 3416 | + |
---|
2892 | 3417 | buttonGroup.remove(ab); |
---|
2893 | 3418 | radioPanel.remove(ab); |
---|
2894 | 3419 | |
---|
2895 | | - ab.GetObject().editWindow = null; |
---|
| 3420 | + //ab.GetObject().editWindow = null; |
---|
| 3421 | + ab.GetObject().manipWindow = null; |
---|
2896 | 3422 | // ab.GetObject().objectUI = null; // ????????? |
---|
2897 | 3423 | |
---|
2898 | 3424 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2899 | 3425 | break; |
---|
2900 | 3426 | } |
---|
2901 | 3427 | } |
---|
| 3428 | + |
---|
| 3429 | + cameraView.requestFocusInWindow(); |
---|
2902 | 3430 | refreshContents(true); |
---|
2903 | 3431 | } else |
---|
2904 | 3432 | if (source == editItem || source == editButton) |
---|
2905 | 3433 | { |
---|
| 3434 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3435 | + { |
---|
| 3436 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3437 | + child.pinned = true; |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
2906 | 3440 | EditSelection(false); |
---|
2907 | 3441 | } else |
---|
2908 | 3442 | if (source == uneditButton) |
---|
.. | .. |
---|
2912 | 3446 | Object3D child = (Object3D)e.nextElement(); |
---|
2913 | 3447 | if(child.editWindow != null) |
---|
2914 | 3448 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3449 | + child.pinned = false; |
---|
2915 | 3450 | child.CloseUI(); |
---|
2916 | 3451 | listUI.remove(child); |
---|
2917 | 3452 | |
---|
2918 | | - child.editWindow = null; // ??????????? |
---|
| 3453 | + //child.editWindow = null; // ??????????? |
---|
2919 | 3454 | } |
---|
2920 | | - objEditor.ctrlPanel.validate(); |
---|
| 3455 | + objEditor.ctrlPanel.FlushUI(); |
---|
2921 | 3456 | //objEditor.jTree.clearSelection(); |
---|
2922 | 3457 | //objEditor.ResetSliders(); |
---|
2923 | 3458 | refreshContents(true); |
---|
.. | .. |
---|
2928 | 3463 | //copy.ClearUI(); |
---|
2929 | 3464 | for (Object3D obj : listUI) |
---|
2930 | 3465 | { |
---|
| 3466 | + obj.pinned = false; |
---|
2931 | 3467 | obj.CloseUI(); |
---|
2932 | 3468 | } |
---|
2933 | 3469 | listUI.clear(); |
---|
.. | .. |
---|
2937 | 3473 | { |
---|
2938 | 3474 | assert(copy == group); |
---|
2939 | 3475 | |
---|
2940 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3476 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2941 | 3477 | |
---|
2942 | 3478 | for (Object3D obj : listUI) |
---|
2943 | 3479 | { |
---|
.. | .. |
---|
2986 | 3522 | } |
---|
2987 | 3523 | |
---|
2988 | 3524 | copy = group; |
---|
| 3525 | + |
---|
| 3526 | + SetUndoStates(); |
---|
| 3527 | + |
---|
2989 | 3528 | //Globals.theRenderer.object = group; |
---|
2990 | 3529 | if(!useclient) |
---|
2991 | 3530 | { |
---|
.. | .. |
---|
3001 | 3540 | frontView.object = group; |
---|
3002 | 3541 | sideView.object = group; |
---|
3003 | 3542 | } |
---|
3004 | | - group.editWindow = this; |
---|
| 3543 | + |
---|
| 3544 | +// fix "+" issue |
---|
| 3545 | + //group.editWindow = this; |
---|
| 3546 | + group.manipWindow = this; |
---|
| 3547 | + |
---|
3005 | 3548 | /* |
---|
3006 | 3549 | currentLayout = radio.layout; |
---|
3007 | 3550 | if (currentLayout == null) |
---|
3008 | 3551 | currentLayout = sevenButton; |
---|
3009 | 3552 | */ |
---|
3010 | 3553 | radio.layout.doClick(); |
---|
| 3554 | + |
---|
| 3555 | + ClearUnpinned(); |
---|
| 3556 | + Grafreed.Assert(group != null); |
---|
| 3557 | + Grafreed.Assert(group.selection != null); |
---|
| 3558 | + SetPinStates(group.selection.size() > 0); |
---|
| 3559 | + if (group.selection.size() == 1) |
---|
| 3560 | + EditSelection(false); |
---|
3011 | 3561 | keepparent = group.parent; |
---|
3012 | 3562 | // PARENT = NULL or not??? |
---|
3013 | 3563 | //group.parent = null; // ROOT |
---|
3014 | 3564 | //group.attributes = -1; |
---|
3015 | 3565 | ResetModel(); |
---|
| 3566 | + |
---|
| 3567 | + cameraView.requestFocusInWindow(); |
---|
3016 | 3568 | refreshContents(true); |
---|
3017 | | - } |
---|
| 3569 | + } else if (event.getSource() == editCameraItem) |
---|
| 3570 | + { |
---|
| 3571 | + cameraView.ProtectCamera(); |
---|
| 3572 | + cameraView.repaint(); |
---|
| 3573 | + return; |
---|
| 3574 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3575 | + { |
---|
| 3576 | + cameraView.RevertCamera(); |
---|
| 3577 | + cameraView.repaint(); |
---|
| 3578 | + return; |
---|
| 3579 | + // } else if (event.getSource() == textureButton) |
---|
| 3580 | + // { |
---|
| 3581 | + // return; // true; |
---|
| 3582 | + } |
---|
3018 | 3583 | else |
---|
3019 | 3584 | { |
---|
3020 | 3585 | //return super.action(event, arg); |
---|
.. | .. |
---|
3023 | 3588 | } |
---|
3024 | 3589 | |
---|
3025 | 3590 | boolean useclient = false; |
---|
3026 | | - cRadio radio; |
---|
3027 | 3591 | |
---|
3028 | 3592 | void ToggleRoot() |
---|
3029 | 3593 | { |
---|
.. | .. |
---|
3075 | 3639 | refreshContents(); |
---|
3076 | 3640 | } |
---|
3077 | 3641 | |
---|
| 3642 | + void TransformChildren() |
---|
| 3643 | + { |
---|
| 3644 | + Object3D obj; |
---|
| 3645 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3646 | + { |
---|
| 3647 | + obj = (Object3D)e.nextElement(); |
---|
| 3648 | + obj.KeepTextureMatrices(); |
---|
| 3649 | + obj.TransformChildren(); |
---|
| 3650 | + obj.RestoreTextureMatrices(); |
---|
| 3651 | + |
---|
| 3652 | +// if (obj.parent == null) |
---|
| 3653 | +// { |
---|
| 3654 | +// System.out.println("NULL PARENT!"); |
---|
| 3655 | +// new Exception().printStackTrace(); |
---|
| 3656 | +// } |
---|
| 3657 | +// else |
---|
| 3658 | +// TouchTransform(obj); |
---|
| 3659 | +// //obj.parent.Touch(); |
---|
| 3660 | + } |
---|
| 3661 | + |
---|
| 3662 | + refreshContents(); |
---|
| 3663 | + } |
---|
3078 | 3664 | |
---|
3079 | 3665 | void ResetTransform() |
---|
3080 | 3666 | { |
---|
.. | .. |
---|
3187 | 3773 | refreshContents(); |
---|
3188 | 3774 | } |
---|
3189 | 3775 | |
---|
3190 | | - void ResetCentroid() |
---|
| 3776 | + void ResetCentroid(boolean full) |
---|
3191 | 3777 | { |
---|
3192 | 3778 | Object3D obj; |
---|
3193 | 3779 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3202 | 3788 | LA.matIdentity(Object3D.mat); |
---|
3203 | 3789 | obj.getBounds(minima, maxima, false); |
---|
3204 | 3790 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3205 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3791 | + if (full) |
---|
| 3792 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3206 | 3793 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3207 | 3794 | obj.TransformMesh(Object3D.mat); |
---|
| 3795 | + |
---|
3208 | 3796 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3209 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3797 | + if (full) |
---|
| 3798 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3210 | 3799 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3800 | + |
---|
3211 | 3801 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3212 | 3802 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3213 | 3803 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3236 | 3826 | |
---|
3237 | 3827 | int size = obj.MemorySize(); |
---|
3238 | 3828 | |
---|
3239 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3829 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3830 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3240 | 3831 | } |
---|
3241 | 3832 | } |
---|
3242 | 3833 | catch (Exception e) |
---|
.. | .. |
---|
3273 | 3864 | obj = (Object3D)e.nextElement(); |
---|
3274 | 3865 | |
---|
3275 | 3866 | System.out.println("Object is: " + obj); |
---|
3276 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3867 | + Grafreed.AnalyzeObject(obj); |
---|
3277 | 3868 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3278 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3869 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3279 | 3870 | |
---|
3280 | 3871 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3281 | 3872 | } |
---|
.. | .. |
---|
3317 | 3908 | void GenNormals(boolean crease) |
---|
3318 | 3909 | { |
---|
3319 | 3910 | group.GenNormalsS(crease); |
---|
| 3911 | + |
---|
| 3912 | + refreshContents(); |
---|
| 3913 | + } |
---|
| 3914 | + |
---|
| 3915 | + void GenNormalsMESH() |
---|
| 3916 | + { |
---|
| 3917 | + group.GenNormalsMeshS(); |
---|
3320 | 3918 | |
---|
3321 | 3919 | refreshContents(); |
---|
3322 | 3920 | } |
---|
.. | .. |
---|
3489 | 4087 | |
---|
3490 | 4088 | void ParseVertices() |
---|
3491 | 4089 | { |
---|
3492 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3493 | | - GrafreeD.epsequal = true; |
---|
| 4090 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4091 | + Grafreed.epsequal = true; |
---|
3494 | 4092 | |
---|
3495 | 4093 | for (int i=0; i<group.selection.size(); i++) |
---|
3496 | 4094 | { |
---|
.. | .. |
---|
3515 | 4113 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3516 | 4114 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3517 | 4115 | |
---|
3518 | | - g.add(GrafreeD.clipboard); |
---|
| 4116 | + g.add(Grafreed.clipboard); |
---|
3519 | 4117 | |
---|
3520 | 4118 | buffer.add(g); |
---|
3521 | 4119 | } |
---|
.. | .. |
---|
3530 | 4128 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3531 | 4129 | } |
---|
3532 | 4130 | |
---|
3533 | | - GrafreeD.epsequal = epsequal; |
---|
| 4131 | + Grafreed.epsequal = epsequal; |
---|
3534 | 4132 | |
---|
3535 | 4133 | refreshContents(); |
---|
3536 | 4134 | } |
---|
.. | .. |
---|
3548 | 4146 | String pigment = Object3D.GetPigment(tex); |
---|
3549 | 4147 | //String bump = Object3D.GetBump(tex); |
---|
3550 | 4148 | |
---|
3551 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4149 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4150 | + |
---|
| 4151 | + try |
---|
| 4152 | + { |
---|
| 4153 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4154 | + } |
---|
| 4155 | + catch (Exception e) |
---|
| 4156 | + { |
---|
| 4157 | + System.err.println("FAIL: " + node); |
---|
| 4158 | + } |
---|
3552 | 4159 | |
---|
3553 | 4160 | double s = v.s; |
---|
3554 | 4161 | |
---|
.. | .. |
---|
3636 | 4243 | |
---|
3637 | 4244 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3638 | 4245 | |
---|
3639 | | - boolean random = CameraPane.RANDOM; |
---|
3640 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4246 | + boolean random = CameraPane.SWITCH; |
---|
| 4247 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3641 | 4248 | lowres.linkVerticesThis(null); |
---|
3642 | 4249 | lowres.linkVerticesThis(sn); |
---|
3643 | | - CameraPane.RANDOM = random; |
---|
| 4250 | + CameraPane.SWITCH = random; |
---|
3644 | 4251 | |
---|
3645 | 4252 | System.err.flush(); |
---|
3646 | 4253 | |
---|
.. | .. |
---|
3680 | 4287 | return; |
---|
3681 | 4288 | |
---|
3682 | 4289 | Object3D poses = group.selection.get(0); |
---|
3683 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4290 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3684 | 4291 | |
---|
3685 | 4292 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3686 | 4293 | |
---|
.. | .. |
---|
3874 | 4481 | |
---|
3875 | 4482 | void ClipMesh() |
---|
3876 | 4483 | { |
---|
3877 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4484 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3878 | 4485 | { |
---|
3879 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4486 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3880 | 4487 | |
---|
3881 | 4488 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3882 | 4489 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3885 | 4492 | // { |
---|
3886 | 4493 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3887 | 4494 | // } |
---|
3888 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4495 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3889 | 4496 | } |
---|
3890 | 4497 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3891 | 4498 | System.out.println("DONE."); |
---|
.. | .. |
---|
3932 | 4539 | void MarkLeaves(boolean hide) |
---|
3933 | 4540 | { |
---|
3934 | 4541 | group.selection.MarkLeaves(hide); |
---|
| 4542 | + refreshContents(); |
---|
| 4543 | + } |
---|
| 4544 | + |
---|
| 4545 | + void RewindLeaves(boolean hide) |
---|
| 4546 | + { |
---|
| 4547 | + group.selection.RewindLeaves(hide); |
---|
| 4548 | + refreshContents(); |
---|
| 4549 | + } |
---|
| 4550 | + |
---|
| 4551 | + void RandomLeaves(boolean hide) |
---|
| 4552 | + { |
---|
| 4553 | + group.selection.RandomLeaves(hide); |
---|
3935 | 4554 | refreshContents(); |
---|
3936 | 4555 | } |
---|
3937 | 4556 | |
---|
.. | .. |
---|
4006 | 4625 | // } |
---|
4007 | 4626 | // } |
---|
4008 | 4627 | |
---|
4009 | | - static boolean allparams = true; |
---|
4010 | | - |
---|
4011 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4012 | | - |
---|
4013 | 4628 | void EditSelection(boolean newWindow) |
---|
4014 | 4629 | { |
---|
4015 | 4630 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4017 | 4632 | { |
---|
4018 | 4633 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4019 | 4634 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4020 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4635 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4021 | 4636 | |
---|
4022 | 4637 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4023 | | - if(elem != group) |
---|
| 4638 | + if(elem != group || !newWindow) |
---|
4024 | 4639 | { |
---|
4025 | 4640 | // if (!(elem instanceof Composite)) |
---|
4026 | 4641 | // newWindow = false; |
---|
.. | .. |
---|
4102 | 4717 | //new Exception().printStackTrace(); |
---|
4103 | 4718 | |
---|
4104 | 4719 | freezemodel = true; |
---|
4105 | | - |
---|
| 4720 | + ClearUnpinned(); |
---|
| 4721 | + |
---|
4106 | 4722 | /**/ |
---|
4107 | 4723 | //switch (event.id) |
---|
4108 | 4724 | { |
---|
.. | .. |
---|
4110 | 4726 | //case 702: // Event.LIST_DESELECT |
---|
4111 | 4727 | group.deselectAll(); |
---|
4112 | 4728 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4113 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4114 | 4729 | if (tps != null) |
---|
4115 | 4730 | { |
---|
4116 | 4731 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4119 | 4734 | |
---|
4120 | 4735 | //if (child.parent != null) |
---|
4121 | 4736 | //child.parent.addSelectee(child); |
---|
| 4737 | + objEditor.SetMaterial(child); |
---|
4122 | 4738 | group.addSelectee(child); |
---|
4123 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4124 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4125 | | - System.err.println("info : " + child.GetPath()); |
---|
4126 | 4739 | } |
---|
4127 | 4740 | } |
---|
4128 | | - else |
---|
4129 | | - { |
---|
4130 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4131 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4132 | | - System.err.println("info : " + group.GetPath()); |
---|
4133 | | - } |
---|
| 4741 | +// else |
---|
| 4742 | +// { |
---|
| 4743 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4744 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4745 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4746 | +// } |
---|
4134 | 4747 | |
---|
4135 | | - objEditor.SetText(); // jan 2014 |
---|
4136 | | - |
---|
4137 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4748 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4138 | 4749 | CameraPane.flash = true; |
---|
4139 | 4750 | |
---|
4140 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4751 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4141 | 4752 | // a camera |
---|
4142 | 4753 | { |
---|
4143 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4144 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4754 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4755 | + { |
---|
| 4756 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4757 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4758 | + } |
---|
4145 | 4759 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4146 | 4760 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4147 | 4761 | } |
---|
4148 | 4762 | |
---|
| 4763 | + if (tps != null && tps.length == 1) |
---|
| 4764 | + { |
---|
| 4765 | + EditSelection(false); |
---|
| 4766 | + } |
---|
| 4767 | + |
---|
| 4768 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4769 | + |
---|
4149 | 4770 | refreshContents(); |
---|
4150 | 4771 | //return true; |
---|
4151 | 4772 | } |
---|
.. | .. |
---|
4154 | 4775 | |
---|
4155 | 4776 | freezemodel = false; |
---|
4156 | 4777 | } |
---|
| 4778 | + |
---|
| 4779 | + void SetPinStates(boolean enabled) |
---|
| 4780 | + { |
---|
| 4781 | + editButton.setEnabled(enabled); |
---|
| 4782 | + uneditButton.setEnabled(enabled); |
---|
| 4783 | + unselectButton.setEnabled(enabled); |
---|
| 4784 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4785 | + } |
---|
| 4786 | + |
---|
| 4787 | + void refreshContents(boolean cp) |
---|
| 4788 | + { |
---|
| 4789 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4790 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4791 | + { |
---|
| 4792 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4793 | + |
---|
| 4794 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4795 | + { |
---|
| 4796 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4797 | + |
---|
| 4798 | + objEditor.AddInfo(child, this, true); |
---|
| 4799 | + System.err.println("info : " + child.GetPath()); |
---|
| 4800 | + } |
---|
| 4801 | + |
---|
| 4802 | + objEditor.SetText(); // jan 2014 |
---|
| 4803 | + } |
---|
| 4804 | + |
---|
| 4805 | + super.refreshContents(cp); |
---|
| 4806 | + } |
---|
4157 | 4807 | |
---|
4158 | 4808 | void linkSomething(Object3D thing) |
---|
4159 | 4809 | { |
---|
.. | .. |
---|
4225 | 4875 | { |
---|
4226 | 4876 | if (group.selection.isEmpty()) |
---|
4227 | 4877 | return; |
---|
4228 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4878 | + |
---|
| 4879 | + Grafreed.clipboardIsTempGroup = false; |
---|
4229 | 4880 | Composite tGroup = null; |
---|
4230 | 4881 | if (group.selection.size() > 0) // 1) |
---|
4231 | 4882 | { |
---|
4232 | 4883 | tGroup = new cGroup(); |
---|
4233 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4884 | + Grafreed.clipboardIsTempGroup = true; |
---|
4234 | 4885 | } |
---|
4235 | 4886 | |
---|
4236 | 4887 | if (cut) |
---|
4237 | 4888 | { |
---|
| 4889 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4890 | +// Save(); |
---|
4238 | 4891 | //int indices[] = jList.getSelectedIndices(); |
---|
4239 | 4892 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4240 | 4893 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4270 | 4923 | //System.out.println("cut " + child); |
---|
4271 | 4924 | //System.out.println("parent = " + child.parent); |
---|
4272 | 4925 | // tmp.addChild(child); |
---|
4273 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4926 | + if (Grafreed.clipboardIsTempGroup) |
---|
4274 | 4927 | tGroup.add/*Child*/(tmp); |
---|
4275 | 4928 | else |
---|
4276 | | - GrafreeD.clipboard = tmp; |
---|
| 4929 | + Grafreed.clipboard = tmp; |
---|
4277 | 4930 | } |
---|
4278 | 4931 | else |
---|
4279 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4932 | + if (Grafreed.clipboardIsTempGroup) |
---|
4280 | 4933 | tGroup.add/*Child*/(child); |
---|
4281 | 4934 | else |
---|
4282 | | - GrafreeD.clipboard = child; |
---|
| 4935 | + Grafreed.clipboard = child; |
---|
4283 | 4936 | } |
---|
4284 | 4937 | |
---|
4285 | 4938 | //ResetModel(); |
---|
.. | .. |
---|
4311 | 4964 | //System.out.println("cut " + elem); |
---|
4312 | 4965 | //System.out.println("parent = " + elem.parent); |
---|
4313 | 4966 | // tmp.addChild(elem); |
---|
4314 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4967 | + if (Grafreed.clipboardIsTempGroup) |
---|
4315 | 4968 | tGroup.add/*Child*/(tmp); |
---|
4316 | 4969 | else |
---|
4317 | | - GrafreeD.clipboard = tmp; |
---|
| 4970 | + Grafreed.clipboard = tmp; |
---|
4318 | 4971 | } |
---|
4319 | 4972 | else |
---|
4320 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4973 | + if (Grafreed.clipboardIsTempGroup) |
---|
4321 | 4974 | tGroup.add/*Child*/(child); |
---|
4322 | 4975 | else |
---|
4323 | | - GrafreeD.clipboard = child; |
---|
| 4976 | + Grafreed.clipboard = child; |
---|
4324 | 4977 | } |
---|
4325 | 4978 | |
---|
4326 | 4979 | } |
---|
4327 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4328 | | - GrafreeD.clipboard = tGroup; |
---|
| 4980 | + |
---|
| 4981 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4982 | + Grafreed.clipboard = tGroup; |
---|
| 4983 | + |
---|
4329 | 4984 | if (cut) |
---|
4330 | 4985 | { |
---|
4331 | 4986 | ResetModel(); |
---|
.. | .. |
---|
4335 | 4990 | |
---|
4336 | 4991 | void paste(boolean expand) |
---|
4337 | 4992 | { |
---|
| 4993 | + if (Globals.REPLACEONMAKE) |
---|
| 4994 | + Save(); |
---|
| 4995 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4996 | + Globals.REPLACEONMAKE = false; |
---|
4338 | 4997 | // if (GrafreeD.clipboard == null) |
---|
4339 | 4998 | // return; |
---|
4340 | 4999 | boolean first = true; |
---|
4341 | 5000 | |
---|
4342 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5001 | + if (Grafreed.clipboardIsTempGroup) |
---|
4343 | 5002 | { |
---|
4344 | 5003 | Composite temp; |
---|
4345 | 5004 | |
---|
.. | .. |
---|
4350 | 5009 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4351 | 5010 | */ |
---|
4352 | 5011 | Object3D elem; |
---|
4353 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5012 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4354 | 5013 | { |
---|
4355 | 5014 | Object3D child = (Object3D)e.nextElement(); |
---|
4356 | 5015 | |
---|
.. | .. |
---|
4384 | 5043 | //Object3D cb = Applet3D.clipboard; |
---|
4385 | 5044 | //temp.addChild(cb); |
---|
4386 | 5045 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4387 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4388 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4389 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4390 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4391 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5046 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5047 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5048 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5049 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5050 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4392 | 5051 | else |
---|
4393 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4394 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5052 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5053 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4395 | 5054 | } |
---|
4396 | 5055 | |
---|
| 5056 | + Globals.REPLACEONMAKE = keep; |
---|
4397 | 5057 | ResetModel(); |
---|
4398 | 5058 | refreshContents(); |
---|
4399 | 5059 | } |
---|
4400 | 5060 | |
---|
4401 | | - void pasteInto(boolean copyit) |
---|
| 5061 | + void pasteInto(boolean copyit, boolean clone) |
---|
4402 | 5062 | { |
---|
4403 | 5063 | // if (GrafreeD.clipboard == null) |
---|
4404 | 5064 | // return; |
---|
.. | .. |
---|
4427 | 5087 | if (copyit) |
---|
4428 | 5088 | { |
---|
4429 | 5089 | // paste(false); |
---|
4430 | | - CloneClipboard(false); // sept 2014 |
---|
| 5090 | + if (clone) |
---|
| 5091 | + { |
---|
| 5092 | + CloneClipboard(false); // sept 2014 |
---|
| 5093 | + } |
---|
| 5094 | + else |
---|
| 5095 | + { |
---|
| 5096 | + paste(false); |
---|
| 5097 | + } |
---|
4431 | 5098 | } |
---|
4432 | 5099 | else |
---|
4433 | 5100 | { |
---|
4434 | 5101 | boolean first = true; |
---|
4435 | 5102 | |
---|
4436 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5103 | + if (Grafreed.clipboardIsTempGroup) |
---|
4437 | 5104 | { |
---|
4438 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5105 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4439 | 5106 | Object3D copy; |
---|
4440 | 5107 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4441 | 5108 | { |
---|
.. | .. |
---|
4445 | 5112 | } |
---|
4446 | 5113 | } else |
---|
4447 | 5114 | { |
---|
4448 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5115 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4449 | 5116 | } |
---|
4450 | 5117 | } |
---|
4451 | 5118 | } |
---|
.. | .. |
---|
4522 | 5189 | |
---|
4523 | 5190 | void group(Object3D csg, boolean grab) |
---|
4524 | 5191 | { |
---|
| 5192 | + if (Globals.REPLACEONMAKE) |
---|
| 5193 | + Save(); |
---|
| 5194 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5195 | + Globals.REPLACEONMAKE = false; |
---|
4525 | 5196 | if (//false) // why?? |
---|
4526 | 5197 | !group.selection.isEmpty()) |
---|
4527 | 5198 | { |
---|
.. | .. |
---|
4635 | 5306 | //node.add(csg); |
---|
4636 | 5307 | //makeSomething(node); |
---|
4637 | 5308 | makeSomething(csg); |
---|
| 5309 | + Globals.REPLACEONMAKE = keep; |
---|
4638 | 5310 | } |
---|
4639 | 5311 | |
---|
4640 | 5312 | void Ungroup(Object3D g) |
---|
4641 | 5313 | { |
---|
| 5314 | + if (Globals.REPLACEONMAKE) |
---|
| 5315 | + Save(); |
---|
| 5316 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5317 | + Globals.REPLACEONMAKE = false; |
---|
4642 | 5318 | if (g instanceof HiddenObject) |
---|
4643 | 5319 | { |
---|
4644 | 5320 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4655 | 5331 | objEditor.makeSomething(g.get(i), false); |
---|
4656 | 5332 | } |
---|
4657 | 5333 | } |
---|
| 5334 | + Globals.REPLACEONMAKE = keep; |
---|
4658 | 5335 | } |
---|
4659 | 5336 | |
---|
4660 | 5337 | void ungroup() |
---|
.. | .. |
---|
4850 | 5527 | } |
---|
4851 | 5528 | */ |
---|
4852 | 5529 | |
---|
4853 | | - void ImportGFD() |
---|
4854 | | - { |
---|
4855 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4856 | | - browser.show(); |
---|
4857 | | - String filename = browser.getFile(); |
---|
4858 | | - if (filename != null && filename.length() > 0) |
---|
4859 | | - { |
---|
4860 | | - String fullname = browser.getDirectory() + filename; |
---|
4861 | | - |
---|
4862 | | - //Object3D readobj = |
---|
4863 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4864 | | - //makeSomething(readobj); |
---|
4865 | | - } |
---|
4866 | | - } |
---|
4867 | | - |
---|
4868 | 5530 | /* |
---|
4869 | 5531 | public void Callback(Object obj) |
---|
4870 | 5532 | { |
---|
.. | .. |
---|
4888 | 5550 | } |
---|
4889 | 5551 | */ |
---|
4890 | 5552 | |
---|
4891 | | - void ImportVRMLX3D() |
---|
4892 | | - { |
---|
4893 | | - if (GrafreeD.standAlone) |
---|
4894 | | - { |
---|
4895 | | - /**/ |
---|
4896 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4897 | | - browser.show(); |
---|
4898 | | - String filename = browser.getFile(); |
---|
4899 | | - if (filename != null && filename.length() > 0) |
---|
4900 | | - { |
---|
4901 | | - String fullname = browser.getDirectory() + filename; |
---|
4902 | | - LoadVRMLX3D(fullname); |
---|
4903 | | - } |
---|
4904 | | - /**/ |
---|
4905 | | - } |
---|
4906 | | - } |
---|
4907 | | - |
---|
4908 | 5553 | String GetFile(String dialogName) |
---|
4909 | 5554 | { |
---|
4910 | | - if (GrafreeD.standAlone) |
---|
| 5555 | + if (Grafreed.standAlone) |
---|
4911 | 5556 | { |
---|
4912 | 5557 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4913 | 5558 | browser.show(); |
---|
.. | .. |
---|
4971 | 5616 | cButton flashSelectionButton; |
---|
4972 | 5617 | cButton editButton; |
---|
4973 | 5618 | cButton uneditButton; |
---|
| 5619 | + JCheckBox allParamsButton; |
---|
4974 | 5620 | cButton clearpanelButton; |
---|
4975 | | - cButton allParamsButton; |
---|
4976 | 5621 | cButton unselectButton; |
---|
4977 | 5622 | |
---|
| 5623 | + cButton restoreCameraButton; |
---|
| 5624 | + |
---|
| 5625 | + cButton saveButton; |
---|
| 5626 | + cButton oneStepButton; |
---|
| 5627 | + |
---|
| 5628 | + cButton groupButton; |
---|
| 5629 | + cButton ungroupButton; |
---|
| 5630 | + cButton compositeButton; |
---|
| 5631 | + cButton switchButton; |
---|
| 5632 | + cButton loopButton; |
---|
| 5633 | + cButton textureButton; |
---|
| 5634 | + |
---|
| 5635 | + cButton gridButton; |
---|
| 5636 | + cButton boxButton; |
---|
| 5637 | + cButton sphereButton; |
---|
| 5638 | + cButton coneButton; |
---|
| 5639 | + cButton torusButton; |
---|
| 5640 | + cButton superButton; |
---|
| 5641 | + cButton kleinButton; |
---|
| 5642 | + cButton particlesButton; |
---|
| 5643 | + cButton overlayButton; |
---|
| 5644 | + cButton lightButton; |
---|
| 5645 | + |
---|
4978 | 5646 | cButton screenfitButton; |
---|
4979 | 5647 | cButton screenfitpointButton; |
---|
4980 | 5648 | cButton snapobjectButton; |
---|
.. | .. |
---|
4986 | 5654 | |
---|
4987 | 5655 | cButton setsupportButton; |
---|
4988 | 5656 | |
---|
4989 | | - cButton twoButton; |
---|
4990 | | - cButton sixButton; |
---|
4991 | | - cButton threeButton; |
---|
4992 | | - cButton sevenButton; |
---|
4993 | | - cButton fourButton; // full panel |
---|
4994 | | - cButton oneButton; // full XYZ |
---|
4995 | | - //cButton currentLayout; |
---|
4996 | | - |
---|
4997 | 5657 | // |
---|
4998 | 5658 | //Composite |
---|
4999 | 5659 | Object3D // to do !! |
---|
.. | .. |
---|
5003 | 5663 | //JTree jTree; |
---|
5004 | 5664 | private MenuItem lookAtItem; |
---|
5005 | 5665 | private MenuItem lookFromItem; |
---|
5006 | | - private MenuItem switchItem; |
---|
| 5666 | + private MenuItem switchViewItem; |
---|
5007 | 5667 | private MenuItem cutItem; |
---|
5008 | | - private MenuItem duplicateItem; |
---|
| 5668 | + private MenuItem undoItem; |
---|
| 5669 | + private MenuItem redoItem; |
---|
| 5670 | + private JMenuItem duplicateItem; |
---|
5009 | 5671 | private MenuItem cloneItem; |
---|
5010 | 5672 | private MenuItem cloneSupportItem; |
---|
5011 | 5673 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5018 | 5680 | private MenuItem linkverticesItem; |
---|
5019 | 5681 | private MenuItem relinkverticesItem; |
---|
5020 | 5682 | private MenuItem setMasterItem; |
---|
5021 | | - private MenuItem resetMeshItem; |
---|
| 5683 | + private MenuItem resetAllItem; |
---|
5022 | 5684 | private MenuItem stepAllItem; |
---|
5023 | 5685 | private MenuItem revertMeshItem; |
---|
5024 | 5686 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5029 | 5691 | private MenuItem mergeGeometriesItem; |
---|
5030 | 5692 | private MenuItem copyItem; |
---|
5031 | 5693 | private MenuItem pasteItem; |
---|
| 5694 | + private MenuItem pasteIntoItem; |
---|
5032 | 5695 | private MenuItem pasteLinkItem; |
---|
5033 | 5696 | private MenuItem pasteCloneItem; |
---|
5034 | 5697 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5067 | 5730 | private MenuItem showleavesItem; |
---|
5068 | 5731 | private MenuItem markleavesItem; |
---|
5069 | 5732 | private MenuItem unmarkleavesItem; |
---|
| 5733 | + private MenuItem rewindleavesItem; |
---|
| 5734 | + private MenuItem unrewindleavesItem; |
---|
| 5735 | + private MenuItem randomleavesItem; |
---|
| 5736 | + private MenuItem unrandomleavesItem; |
---|
5070 | 5737 | |
---|
5071 | 5738 | private MenuItem flipVItem; |
---|
5072 | 5739 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5078 | 5745 | private MenuItem panoTexturesItem; |
---|
5079 | 5746 | |
---|
5080 | 5747 | private MenuItem resetCentroidItem; |
---|
5081 | | - private MenuItem transformgeometryItem; |
---|
| 5748 | + private MenuItem resetCentroidXZItem; |
---|
5082 | 5749 | private MenuItem resetTransformItem; |
---|
| 5750 | + private MenuItem transformGeometryItem; |
---|
| 5751 | + private MenuItem transformChildrenItem; |
---|
5083 | 5752 | private MenuItem hideItem; |
---|
5084 | 5753 | private MenuItem grabItem; |
---|
5085 | 5754 | private MenuItem backItem; |
---|
5086 | 5755 | private MenuItem frontItem; |
---|
5087 | 5756 | private MenuItem cameraItem; |
---|
5088 | 5757 | private MenuItem compositeItem; |
---|
5089 | | - private MenuItem randomItem; |
---|
| 5758 | + private MenuItem switchItem; |
---|
5090 | 5759 | private MenuItem physicsItem; |
---|
5091 | 5760 | private MenuItem frameselectorItem; |
---|
5092 | 5761 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5126 | 5795 | private MenuItem blobItem; |
---|
5127 | 5796 | private MenuItem latheItem; |
---|
5128 | 5797 | private MenuItem bezierItem; |
---|
5129 | | - private MenuItem checkerItem; |
---|
| 5798 | + private MenuItem overlayItem; |
---|
5130 | 5799 | private MenuItem meshItem; |
---|
5131 | 5800 | // private MenuItem meshGroupItem; |
---|
5132 | 5801 | private MenuItem springItem; |
---|
.. | .. |
---|
5148 | 5817 | private MenuItem doubleItem; |
---|
5149 | 5818 | private MenuItem tripleItem; |
---|
5150 | 5819 | |
---|
5151 | | - private MenuItem importGFDItem; |
---|
5152 | | - private MenuItem importVRMLX3DItem; |
---|
5153 | | - private MenuItem import3DSItem; |
---|
5154 | | - private MenuItem importOBJItem; |
---|
5155 | | - |
---|
5156 | 5820 | private MenuItem computeAOItem; |
---|
5157 | 5821 | private MenuItem recompileItem; |
---|
5158 | 5822 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5162 | 5826 | private MenuItem analyzeItem; |
---|
5163 | 5827 | private MenuItem dumpItem; |
---|
5164 | 5828 | //boolean freezemodel = false; |
---|
| 5829 | + |
---|
| 5830 | + Menu cameraMenu; |
---|
| 5831 | + MenuItem editCameraItem; |
---|
| 5832 | + MenuItem restoreCameraItem; |
---|
5165 | 5833 | } |
---|