.. | .. |
---|
74 | 74 | this.copy = this.group = copy; |
---|
75 | 75 | //selectees = this.group.selectees; |
---|
76 | 76 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
78 | 78 | SetupUI2(objEditor); |
---|
79 | 79 | objEditor.SetupUI(true); |
---|
80 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.REPLACEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 90 | + Globals.REPLACEONMAKE = false; |
---|
87 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 92 | //Object3D obj; |
---|
89 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 98 | |
---|
95 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 100 | } |
---|
| 101 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 102 | } |
---|
98 | 103 | |
---|
99 | 104 | void CloneClipboard(boolean supports) |
---|
100 | 105 | { |
---|
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)); |
---|
| 106 | + assert(Grafreed.clipboard.parent == null); |
---|
| 107 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 108 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 109 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 110 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 111 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 112 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 113 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 114 | } |
---|
110 | 115 | |
---|
111 | 116 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 124 | // obj.support = null; |
---|
120 | 125 | if (!supports) |
---|
121 | 126 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 127 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 128 | obj.parent = parent; |
---|
124 | 129 | // obj.support = support; |
---|
125 | 130 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 153 | |
---|
149 | 154 | //JTextField nameField; |
---|
150 | 155 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 156 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 157 | { |
---|
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); |
---|
| 158 | + oe.jTree = new cTree(); |
---|
| 159 | + |
---|
164 | 160 | Menu menu; |
---|
165 | 161 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
166 | 162 | //editItem = menu.add(new MenuItem("Edit")); |
---|
167 | 163 | //editItem.addActionListener(this); |
---|
168 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + |
---|
| 165 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 166 | +// undoItem.addActionListener(this); |
---|
| 167 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 168 | +// redoItem.addActionListener(this); |
---|
| 169 | +// menu.add("-"); |
---|
| 170 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
169 | 171 | duplicateItem.addActionListener(this); |
---|
170 | | - menu.add("-"); |
---|
171 | 172 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
172 | 173 | cloneItem.addActionListener(this); |
---|
| 174 | + if (Globals.ADVANCED) |
---|
| 175 | + { |
---|
173 | 176 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
174 | 177 | cloneSupportItem.addActionListener(this); |
---|
| 178 | + } |
---|
175 | 179 | menu.add("-"); |
---|
176 | 180 | cutItem = menu.add(new MenuItem("Cut")); |
---|
177 | 181 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
179 | 183 | copyItem.addActionListener(this); |
---|
180 | 184 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
181 | 185 | pasteItem.addActionListener(this); |
---|
| 186 | + |
---|
| 187 | + menu.add("-"); |
---|
| 188 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 189 | + pasteIntoItem.addActionListener(this); |
---|
182 | 190 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
183 | 191 | pasteLinkItem.addActionListener(this); |
---|
184 | 192 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
185 | 193 | pasteCloneItem.addActionListener(this); |
---|
186 | 194 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
187 | 195 | // pasteExpandItem.addActionListener(this); |
---|
| 196 | + menu.add("-"); |
---|
188 | 197 | clearItem = menu.add(new MenuItem("Clear")); |
---|
189 | 198 | clearItem.addActionListener(this); |
---|
| 199 | + |
---|
| 200 | + if (Globals.ADVANCED) |
---|
| 201 | + { |
---|
| 202 | + // Deletes the cameras... |
---|
190 | 203 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
191 | 204 | clearAllItem.addActionListener(this); |
---|
| 205 | + } |
---|
| 206 | + |
---|
| 207 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 208 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 209 | + //zBufferItem.addActionListener(this); |
---|
| 210 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 211 | + //normalLensItem.addActionListener(this); |
---|
| 212 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 213 | + restoreCameraItem.addActionListener(this); |
---|
| 214 | + |
---|
| 215 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 216 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 217 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 218 | +// cameraMenu.add("-"); |
---|
| 219 | +// |
---|
| 220 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 221 | +// toggleTextureItem.addItemListener(this); |
---|
| 222 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 223 | +// |
---|
| 224 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 225 | +// toggleSwitchItem.addItemListener(this); |
---|
| 226 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 227 | + |
---|
| 228 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 229 | + toggleHandleItem.addItemListener(this); |
---|
| 230 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 231 | + |
---|
| 232 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 233 | + togglePaintItem.addItemListener(this); |
---|
| 234 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 235 | + |
---|
| 236 | + if (Globals.ADVANCED) |
---|
| 237 | + { |
---|
| 238 | + cameraMenu.add("-"); |
---|
| 239 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 240 | + toggleLiveItem.addItemListener(this); |
---|
| 241 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
192 | 242 | |
---|
| 243 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 244 | + stepItem.addActionListener(this); |
---|
| 245 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 246 | + // toggleDLItem.addItemListener(this); |
---|
| 247 | + // toggleDLItem.setState(false); |
---|
| 248 | + |
---|
| 249 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 250 | + toggleRenderItem.addItemListener(this); |
---|
| 251 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 252 | + |
---|
| 253 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 254 | + toggleDebugItem.addItemListener(this); |
---|
| 255 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 256 | + |
---|
| 257 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 258 | + toggleFrustumItem.addItemListener(this); |
---|
| 259 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 260 | + |
---|
| 261 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 262 | + toggleFootContactItem.addItemListener(this); |
---|
| 263 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 264 | + |
---|
| 265 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 266 | + toggleTimelineItem.addItemListener(this); |
---|
| 267 | + } |
---|
| 268 | + |
---|
| 269 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 270 | +// toggleRootItem.addItemListener(this); |
---|
| 271 | +// toggleRootItem.setState(false); |
---|
| 272 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 273 | +// animationItem.addItemListener(this); |
---|
| 274 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 275 | + cameraMenu.add("-"); |
---|
| 276 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 277 | + editCameraItem.addActionListener(this); |
---|
| 278 | + |
---|
| 279 | + if (Globals.ADVANCED) |
---|
| 280 | + { |
---|
| 281 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 282 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 283 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 284 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 285 | + oe.cameraMenu.add("-"); |
---|
| 286 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 287 | + openWindowItem.addActionListener(this); |
---|
| 288 | + editLeafItem.addActionListener(this); |
---|
| 289 | + lookAtItem.addActionListener(this); |
---|
| 290 | + //lookFromItem.addActinoListener(this); |
---|
| 291 | + //switchViewItem.addActionListener(this); |
---|
| 292 | + } |
---|
| 293 | + |
---|
193 | 294 | 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); |
---|
| 295 | + if (Globals.ADVANCED) |
---|
| 296 | + { |
---|
198 | 297 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
199 | 298 | revertMeshItem.addActionListener(this); |
---|
200 | 299 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
201 | 300 | resetreferencesItem.addActionListener(this); |
---|
202 | 301 | menu.add("-"); |
---|
| 302 | + } |
---|
203 | 303 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
204 | 304 | overwriteGeoItem.addActionListener(this); |
---|
205 | 305 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
211 | 311 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
212 | 312 | overwriteUVItem.addActionListener(this); |
---|
213 | 313 | menu.add("-"); |
---|
| 314 | + if (Globals.ADVANCED) |
---|
| 315 | + { |
---|
214 | 316 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
215 | 317 | generateMeshItem.addActionListener(this); |
---|
216 | 318 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
217 | 319 | poseMeshItem.addActionListener(this); |
---|
218 | 320 | menu.add("-"); |
---|
| 321 | + } |
---|
219 | 322 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
220 | 323 | resetsupportItem.addActionListener(this); |
---|
221 | 324 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
222 | 325 | linkverticesItem.addActionListener(this); |
---|
223 | 326 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
224 | 327 | relinkverticesItem.addActionListener(this); |
---|
| 328 | + |
---|
| 329 | + if (Globals.ADVANCED) |
---|
| 330 | + { |
---|
225 | 331 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
226 | 332 | setMasterItem.addActionListener(this); |
---|
| 333 | + } |
---|
227 | 334 | |
---|
228 | 335 | oe.menuBar.add(menu = new Menu("Group")); |
---|
229 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
230 | | - grabItem.addActionListener(this); |
---|
| 336 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 337 | +// grabItem.addActionListener(this); |
---|
231 | 338 | backItem = menu.add(new MenuItem("Back")); |
---|
232 | 339 | backItem.addActionListener(this); |
---|
233 | 340 | frontItem = menu.add(new MenuItem("Front")); |
---|
234 | 341 | frontItem.addActionListener(this); |
---|
235 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
236 | | - compositeItem.addActionListener(this); |
---|
237 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 342 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 343 | +// compositeItem.addActionListener(this); |
---|
| 344 | + |
---|
| 345 | + if (Globals.ADVANCED) |
---|
| 346 | + { |
---|
| 347 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
238 | 348 | hideItem.addActionListener(this); |
---|
| 349 | + } |
---|
239 | 350 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
240 | 351 | 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); |
---|
| 352 | + |
---|
| 353 | +// menu.add("-"); |
---|
| 354 | +// |
---|
| 355 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 356 | +// switchItem.addActionListener(this); |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
248 | 359 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
249 | 360 | switchGeoItem.addActionListener(this); |
---|
250 | 361 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
251 | 362 | switchTransfoItem.addActionListener(this); |
---|
252 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 363 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
253 | 364 | morphItem.addActionListener(this); |
---|
| 365 | + |
---|
| 366 | + menu.add("-"); |
---|
| 367 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 368 | + physicsItem.addActionListener(this); |
---|
| 369 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 370 | + frameselectorItem.addActionListener(this); |
---|
254 | 371 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
255 | 372 | scriptNodeItem.addActionListener(this); |
---|
256 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
257 | | - cameraItem.addActionListener(this); |
---|
| 373 | + } |
---|
258 | 374 | |
---|
259 | 375 | oe.menuBar.add(menu = new Menu("Object")); |
---|
260 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
261 | | - textureItem.addActionListener(this); |
---|
| 376 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 377 | +// textureItem.addActionListener(this); |
---|
262 | 378 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
263 | 379 | billboardItem.addActionListener(this); |
---|
264 | 380 | csgItem = menu.add(new MenuItem("CSG")); |
---|
265 | 381 | csgItem.addActionListener(this); |
---|
266 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 382 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
267 | 383 | shadowXItem.addActionListener(this); |
---|
268 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 384 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
269 | 385 | shadowYItem.addActionListener(this); |
---|
270 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 386 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
271 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
| 391 | + if (Globals.ADVANCED) |
---|
| 392 | + { |
---|
| 393 | + menu.add("-"); |
---|
272 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
273 | 395 | linkerItem.addActionListener(this); |
---|
274 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
275 | 397 | templateItem.addActionListener(this); |
---|
276 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
277 | | - attributeItem.addActionListener(this); |
---|
278 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
279 | 399 | pointflowItem.addActionListener(this); |
---|
| 400 | + } |
---|
280 | 401 | menu.add("-"); |
---|
281 | 402 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
282 | 403 | resetTransformItem.addActionListener(this); |
---|
283 | 404 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
284 | 405 | resetCentroidItem.addActionListener(this); |
---|
285 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
286 | | - transformgeometryItem.addActionListener(this); |
---|
| 406 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 407 | + resetCentroidXZItem.addActionListener(this); |
---|
| 408 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 409 | + transformGeometryItem.addActionListener(this); |
---|
| 410 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 411 | + transformChildrenItem.addActionListener(this); |
---|
287 | 412 | |
---|
288 | 413 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
289 | 414 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
294 | 419 | genNormalsCADItem.addActionListener(this); |
---|
295 | 420 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
296 | 421 | genNormalsMESHItem.addActionListener(this); |
---|
| 422 | + if (Globals.ADVANCED) |
---|
| 423 | + { |
---|
297 | 424 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
298 | 425 | genNormalsMINEItem.addActionListener(this); |
---|
| 426 | + } |
---|
299 | 427 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
300 | 428 | stripifyItem.addActionListener(this); |
---|
301 | 429 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
317 | 445 | reduce34MeshItem.addActionListener(this); |
---|
318 | 446 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
319 | 447 | increaseMeshItem.addActionListener(this); |
---|
320 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
321 | | - smoothMeshItem.addActionListener(this); |
---|
322 | 448 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
323 | 449 | clipMeshItem.addActionListener(this); |
---|
| 450 | + |
---|
| 451 | + if (Globals.ADVANCED) |
---|
| 452 | + { |
---|
| 453 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 454 | + smoothMeshItem.addActionListener(this); |
---|
| 455 | + } |
---|
324 | 456 | |
---|
325 | 457 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
326 | 458 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
327 | 459 | clearMaterialsItem.addActionListener(this); |
---|
| 460 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 461 | + resetAllItem.addActionListener(this); |
---|
| 462 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 463 | + stepAllItem.addActionListener(this); |
---|
328 | 464 | menu.add("-"); |
---|
329 | 465 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
330 | 466 | liveleavesItem.addActionListener(this); |
---|
331 | 467 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
332 | 468 | unliveleavesItem.addActionListener(this); |
---|
| 469 | + if (Globals.ADVANCED) |
---|
| 470 | + { |
---|
333 | 471 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
334 | 472 | supportleavesItem.addActionListener(this); |
---|
335 | 473 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
336 | 474 | unsupportleavesItem.addActionListener(this); |
---|
| 475 | + } |
---|
337 | 476 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
338 | 477 | hideleavesItem.addActionListener(this); |
---|
339 | 478 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
342 | 481 | markleavesItem.addActionListener(this); |
---|
343 | 482 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
344 | 483 | unmarkleavesItem.addActionListener(this); |
---|
| 484 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 485 | + rewindleavesItem.addActionListener(this); |
---|
| 486 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 487 | + unrewindleavesItem.addActionListener(this); |
---|
| 488 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 489 | + randomleavesItem.addActionListener(this); |
---|
| 490 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 491 | + unrandomleavesItem.addActionListener(this); |
---|
345 | 492 | menu.add("-"); |
---|
346 | 493 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
347 | 494 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
377 | 524 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
378 | 525 | sortbynameItem.addActionListener(this); |
---|
379 | 526 | menu.add("-"); |
---|
| 527 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 528 | + shareGeometriesItem.addActionListener(this); |
---|
| 529 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 530 | + mergeGeometriesItem.addActionListener(this); |
---|
| 531 | + if (Globals.ADVANCED) |
---|
| 532 | + { |
---|
| 533 | + // Pretty much the same as duplicate and clone. |
---|
380 | 534 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
381 | 535 | extractGeometriesItem.addActionListener(this); |
---|
382 | 536 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
383 | 537 | 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); |
---|
| 538 | + } |
---|
388 | 539 | |
---|
389 | 540 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
390 | 541 | buildCreateMenu(menu); |
---|
391 | 542 | |
---|
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 | 543 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
404 | 544 | buildToolsMenu(menu); |
---|
405 | 545 | } |
---|
406 | 546 | |
---|
| 547 | + |
---|
407 | 548 | void SetupUI2(ObjEditor oe) |
---|
408 | 549 | { |
---|
| 550 | + // June 2019 |
---|
| 551 | + if (oe == null) |
---|
| 552 | + { |
---|
| 553 | + //super.SetupUI2(this); |
---|
| 554 | + //return; |
---|
| 555 | + } |
---|
| 556 | + |
---|
| 557 | + if (copy != group) |
---|
| 558 | + { |
---|
| 559 | + //super.SetupUI2(this); |
---|
| 560 | + } |
---|
| 561 | + |
---|
409 | 562 | //new Exception().printStackTrace(); |
---|
410 | 563 | |
---|
411 | 564 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
434 | 587 | oe.radioPanel.add(dummyButton); |
---|
435 | 588 | oe.buttonGroup.add(dummyButton); |
---|
436 | 589 | */ |
---|
| 590 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 591 | + |
---|
| 592 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 593 | + |
---|
437 | 594 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
438 | 595 | |
---|
439 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
440 | | - liveCB.setToolTipText("Enabled animation"); |
---|
441 | | - liveCB.addItemListener(this); |
---|
442 | | - |
---|
443 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
444 | | - trackCB.setToolTipText("Enable tracking"); |
---|
445 | | - trackCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 597 | + //minButton.setToolTipText("Minimize window"); |
---|
| 598 | + //minButton.addActionListener(this); |
---|
| 599 | + |
---|
| 600 | + if (Globals.ADVANCED) |
---|
| 601 | + { |
---|
| 602 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + maxButton.setToolTipText("Maximize window"); |
---|
| 604 | + maxButton.addActionListener(this); |
---|
| 605 | + } |
---|
| 606 | + |
---|
| 607 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 609 | + fullButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
448 | 612 | screenfitButton.setToolTipText("Screen fit"); |
---|
449 | 613 | screenfitButton.addActionListener(this); |
---|
450 | 614 | |
---|
| 615 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 617 | + restoreCameraButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + saveButton.setToolTipText("New version"); |
---|
| 621 | + saveButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + undoButton.setToolTipText("Previous version"); |
---|
| 625 | + undoButton.addActionListener(this); |
---|
| 626 | + undoButton.setEnabled(false); |
---|
| 627 | + |
---|
| 628 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 629 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreButton.setToolTipText("Restore current"); |
---|
| 631 | + restoreButton.addActionListener(this); |
---|
| 632 | + restoreButton.setEnabled(false); |
---|
| 633 | + |
---|
| 634 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + replaceButton.setToolTipText("Replace current"); |
---|
| 636 | + replaceButton.addActionListener(this); |
---|
| 637 | + replaceButton.setEnabled(false); |
---|
| 638 | + |
---|
| 639 | + copyOptionsPanel.add(updown); |
---|
| 640 | + |
---|
| 641 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + redoButton.setToolTipText("Next version"); |
---|
| 643 | + redoButton.addActionListener(this); |
---|
| 644 | + redoButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 647 | + liveCB.setToolTipText("Enable animation"); |
---|
| 648 | + liveCB.addItemListener(this); |
---|
| 649 | + |
---|
| 650 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 652 | + oneStepButton.addActionListener(this); |
---|
| 653 | + |
---|
| 654 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 655 | + fastCB.setToolTipText("Fast mode"); |
---|
| 656 | + fastCB.addItemListener(this); |
---|
| 657 | + |
---|
| 658 | + //oe.toolboxPanel.Return(); |
---|
| 659 | + |
---|
| 660 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 661 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 662 | +// trackCB.addItemListener(this); |
---|
| 663 | + |
---|
451 | 664 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
452 | 665 | // screenfitpointButton.addActionListener(this); |
---|
453 | | -// oe.aConstraints.gridx += 1; |
---|
454 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
455 | | - snapobjectButton.addActionListener(this); |
---|
456 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
457 | | - oe.aConstraints.gridx += 1; |
---|
458 | 666 | |
---|
459 | | - //aConstraints.gridx = 0; |
---|
460 | | - //aConstraints.gridy += 1; |
---|
461 | | - oe.aConstraints.weighty = 0; |
---|
462 | | - oe.aConstraints.gridwidth = 1; |
---|
463 | | - |
---|
464 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
465 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
466 | | - flashSelectionButton.addActionListener(this); |
---|
| 667 | + if (Globals.ADVANCED) |
---|
| 668 | + { |
---|
| 669 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + snapobjectButton.addActionListener(this); |
---|
| 671 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 672 | + } |
---|
| 673 | + |
---|
| 674 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
467 | 675 | |
---|
468 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
469 | | - |
---|
470 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 676 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
471 | 677 | twoButton.setToolTipText("Show center view only"); |
---|
472 | 678 | twoButton.addActionListener(this); |
---|
473 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + this.fullscreenLayout = twoButton; |
---|
| 680 | + |
---|
| 681 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
474 | 682 | fourButton.addActionListener(this); |
---|
475 | 683 | fourButton.setToolTipText("Show left panel only"); |
---|
476 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
477 | 685 | sixButton.setToolTipText("2-column layout left"); |
---|
478 | 686 | sixButton.addActionListener(this); |
---|
479 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 687 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
480 | 688 | threeButton.setToolTipText("2-column layout right"); |
---|
481 | 689 | threeButton.addActionListener(this); |
---|
482 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 690 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
483 | 691 | sevenButton.setToolTipText("3-column layout"); |
---|
484 | 692 | sevenButton.addActionListener(this); |
---|
485 | 693 | // |
---|
486 | 694 | |
---|
487 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
488 | 696 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
489 | 697 | rootButton.addActionListener(this); |
---|
490 | 698 | |
---|
491 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 700 | closeButton.setToolTipText("Close tab"); |
---|
493 | 701 | closeButton.addActionListener(this); |
---|
494 | 702 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
495 | 703 | //clearButton.addActionListener(this); |
---|
496 | | - |
---|
497 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 704 | + |
---|
| 705 | + // INSERT |
---|
| 706 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + gridButton.setToolTipText("Create grid"); |
---|
| 708 | + gridButton.addActionListener(this); |
---|
| 709 | + |
---|
| 710 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + boxButton.setToolTipText("Create box"); |
---|
| 712 | + boxButton.addActionListener(this); |
---|
| 713 | + |
---|
| 714 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 715 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 716 | + sphereButton.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + coneButton.setToolTipText("Create cone"); |
---|
| 720 | + coneButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + torusButton.setToolTipText("Create torus"); |
---|
| 724 | + torusButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 728 | + superButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + if (Globals.ADVANCED) |
---|
| 731 | + { |
---|
| 732 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 734 | + kleinButton.addActionListener(this); |
---|
| 735 | + } |
---|
498 | 736 | |
---|
499 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
500 | | - editButton.setToolTipText("Edit selection"); |
---|
| 737 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 739 | + particlesButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.Return(); |
---|
| 742 | + |
---|
| 743 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + groupButton.setToolTipText("Create group"); |
---|
| 745 | + groupButton.addActionListener(this); |
---|
| 746 | + |
---|
| 747 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + compositeButton.setToolTipText("Create composite"); |
---|
| 749 | + compositeButton.addActionListener(this); |
---|
| 750 | + |
---|
| 751 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 752 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 753 | + switchButton.addActionListener(this); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + loopButton.setToolTipText("Create loop"); |
---|
| 757 | + loopButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + textureButton.setToolTipText("Create texture"); |
---|
| 761 | + textureButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 765 | + overlayButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + lightButton.setToolTipText("Create light"); |
---|
| 769 | + lightButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + for (int i=6; --i>=0;) |
---|
| 772 | + { |
---|
| 773 | + oe.toolboxPanel.Return(); |
---|
| 774 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 775 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 776 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 777 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 778 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 779 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 780 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 781 | + } |
---|
| 782 | + |
---|
| 783 | + // EDIT panel |
---|
| 784 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + editButton.setToolTipText("Pin selection controls"); |
---|
501 | 786 | editButton.addActionListener(this); |
---|
502 | 787 | |
---|
503 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 788 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 789 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
505 | 790 | uneditButton.addActionListener(this); |
---|
506 | 791 | |
---|
507 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 792 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 793 | + allParamsButton.setToolTipText("Show all controle"); |
---|
| 794 | + allParamsButton.addActionListener(this); |
---|
| 795 | + |
---|
| 796 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
508 | 797 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
509 | 798 | clearPanelButton.addActionListener(this); |
---|
510 | 799 | |
---|
511 | | - commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
512 | | - allParamsButton.setToolTipText("All params??"); |
---|
513 | | - allParamsButton.addActionListener(this); |
---|
514 | | - |
---|
515 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 800 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 801 | unselectButton.setToolTipText("Unselect"); |
---|
517 | 802 | unselectButton.addActionListener(this); |
---|
518 | 803 | |
---|
519 | | - commandsPanel.preferredHeight = 1; |
---|
| 804 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 806 | + flashSelectionButton.addActionListener(this); |
---|
520 | 807 | |
---|
521 | | - oe.treePanel.add(commandsPanel); |
---|
522 | | - oe.treePanel.Return(); |
---|
| 808 | + editCommandsPanel.preferredHeight = 1; |
---|
| 809 | + |
---|
| 810 | + SetPinStates(false); |
---|
| 811 | +// oe.treePanel.add(commandsPanel); |
---|
| 812 | +// oe.treePanel.Return(); |
---|
523 | 813 | |
---|
524 | 814 | // oe.aConstraints.gridx += 1; |
---|
525 | 815 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
536 | 826 | |
---|
537 | 827 | JScrollPane jSP; |
---|
538 | 828 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
539 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 829 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
540 | 830 | ResetModel(); |
---|
541 | 831 | |
---|
542 | 832 | oe.treePanel.add(jSPPanel); |
---|
543 | 833 | oe.treePanel.Return(); |
---|
544 | 834 | |
---|
545 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
546 | | - |
---|
547 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
548 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
549 | | - colorCB.addItemListener(this); |
---|
550 | | - |
---|
551 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
552 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
553 | | - materialCB.addItemListener(this); |
---|
554 | | - |
---|
555 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
556 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
557 | | - textureCB.addItemListener(this); |
---|
558 | | - |
---|
559 | | - copyOptionsPanel.preferredHeight = 1; |
---|
560 | 835 | oe.treePanel.add(copyOptionsPanel); |
---|
561 | 836 | oe.treePanel.Return(); |
---|
| 837 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0); |
---|
| 838 | + versionField = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 839 | + sliderPane.preferredHeight = 1; |
---|
562 | 840 | |
---|
563 | 841 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
564 | 842 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
587 | 865 | |
---|
588 | 866 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
589 | 867 | { |
---|
590 | | - //constraints.gridx = 0; |
---|
591 | | - //constraints.gridy = 0; |
---|
592 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
593 | | - fastCB.setToolTipText("Fast mode"); |
---|
594 | | - fastCB.addItemListener(this); |
---|
595 | | - //constraints.gridy += 1; |
---|
596 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
597 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
598 | | - supportCB.addItemListener(this); |
---|
| 868 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 869 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 870 | + colorCB.addItemListener(this); |
---|
599 | 871 | |
---|
600 | | - // constraints.gridy += 1; |
---|
| 872 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 873 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 874 | + materialCB.addItemListener(this); |
---|
| 875 | + |
---|
| 876 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 877 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 878 | + textureCB.addItemListener(this); |
---|
| 879 | + |
---|
| 880 | + panel.Return(); |
---|
| 881 | + |
---|
| 882 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 883 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 884 | + boxCB.addItemListener(this); |
---|
| 885 | + |
---|
| 886 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 887 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 888 | + zoomBoxCB.addItemListener(this); |
---|
| 889 | + |
---|
| 890 | + if (true) // Globals.ADVANCED) |
---|
| 891 | + { |
---|
| 892 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 893 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 894 | +// supportCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 897 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 898 | + freezeCB.addItemListener(this); |
---|
| 899 | + |
---|
601 | 900 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
602 | 901 | // localCB.addItemListener(this); |
---|
603 | 902 | |
---|
604 | | - //constraints.gridy += 1; |
---|
| 903 | + panel.Return(); |
---|
| 904 | + |
---|
605 | 905 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
606 | 906 | crowdCB.setToolTipText("Used for crowds"); |
---|
607 | 907 | crowdCB.addItemListener(this); |
---|
608 | 908 | |
---|
609 | | - //constraints.gridy += 1; |
---|
610 | 909 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
611 | 910 | smoothCB.setToolTipText("Snapping delay"); |
---|
612 | 911 | smoothCB.addItemListener(this); |
---|
613 | 912 | |
---|
614 | | - //constraints.gridy += 1; |
---|
615 | 913 | panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
616 | 914 | slowCB.setToolTipText("Smooth interpolation"); |
---|
617 | 915 | slowCB.addItemListener(this); |
---|
618 | | - //constraints.gridy += 1; |
---|
619 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
620 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
621 | | - boxCB.addItemListener(this); |
---|
622 | | - //constraints.gridy += 1; |
---|
623 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
624 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
625 | | - zoomBoxCB.addItemListener(this); |
---|
626 | | - |
---|
| 916 | + |
---|
627 | 917 | // constraints.gridy += 1; |
---|
628 | 918 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
629 | 919 | // speakerMocapCB.addItemListener(this); |
---|
630 | 920 | |
---|
| 921 | + panel.Return(); |
---|
| 922 | + |
---|
631 | 923 | if (false) |
---|
632 | 924 | { |
---|
633 | 925 | // handled in scripts |
---|
.. | .. |
---|
642 | 934 | //constraints.gridy += 1; |
---|
643 | 935 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
644 | 936 | smoothfocusCB.addItemListener(this); |
---|
| 937 | + panel.Return(); |
---|
645 | 938 | } |
---|
646 | 939 | |
---|
647 | 940 | //constraints.gridx += 1; |
---|
648 | 941 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
649 | 942 | // debugCB.addItemListener(this); |
---|
650 | 943 | |
---|
651 | | - //constraints.gridy += 1; |
---|
| 944 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 945 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 946 | + trackCB.addItemListener(this); |
---|
| 947 | + |
---|
652 | 948 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 949 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
653 | 950 | oeilCB.addItemListener(this); |
---|
654 | 951 | |
---|
655 | | - //constraints.gridy += 1; |
---|
| 952 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 953 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 954 | + shadowCB.addItemListener(this); |
---|
| 955 | + |
---|
| 956 | + panel.Return(); |
---|
| 957 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 958 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 959 | + toggleTextureCB.addItemListener(this); |
---|
| 960 | + |
---|
| 961 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 962 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 963 | + toggleSwitchCB.addItemListener(this); |
---|
| 964 | + |
---|
| 965 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 966 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 967 | + autokeepCB.addItemListener(this); |
---|
| 968 | + |
---|
| 969 | + panel.Return(); |
---|
| 970 | + if (Globals.ADVANCED) |
---|
| 971 | + { |
---|
656 | 972 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
657 | 973 | lookAtCB.setToolTipText("Look-at target"); |
---|
658 | 974 | lookAtCB.addItemListener(this); |
---|
| 975 | + } |
---|
| 976 | + |
---|
| 977 | + } |
---|
659 | 978 | |
---|
660 | 979 | cGridBag fill = new cGridBag(); |
---|
661 | | - |
---|
662 | 980 | fill.preferredHeight = 200; |
---|
| 981 | + cGridBag fill2 = new cGridBag(); |
---|
| 982 | + fill2.preferredHeight = 200; |
---|
| 983 | + cGridBag fill3 = new cGridBag(); |
---|
| 984 | + fill3.preferredHeight = 200; |
---|
663 | 985 | |
---|
664 | 986 | panel.add(fill); |
---|
| 987 | + panel.add(fill2); |
---|
| 988 | + panel.add(fill3); |
---|
665 | 989 | |
---|
666 | 990 | } |
---|
667 | 991 | |
---|
668 | 992 | void EditObject(Object3D obj) |
---|
669 | 993 | { |
---|
670 | 994 | cRadio radioButton = new cRadio(obj.name); |
---|
| 995 | + |
---|
| 996 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 997 | + radioButton.hadMaterial = obj.material != null; |
---|
| 998 | + if (!radioButton.hadMaterial) |
---|
| 999 | + { |
---|
| 1000 | + obj.material = new cMaterial(); |
---|
| 1001 | + } |
---|
| 1002 | + |
---|
671 | 1003 | radioButton.SetObject(obj); |
---|
672 | 1004 | radioButton.layout = sevenButton; |
---|
673 | 1005 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
676 | 1008 | buttonGroup.add(radioButton); |
---|
677 | 1009 | radioButton.doClick(); |
---|
678 | 1010 | } |
---|
| 1011 | + |
---|
679 | 1012 | void SetupViews(ObjEditor oe) |
---|
680 | 1013 | { |
---|
| 1014 | + theFrame = this; |
---|
| 1015 | + |
---|
681 | 1016 | oe.SetupViews(); |
---|
682 | 1017 | |
---|
683 | 1018 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
686 | 1021 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
687 | 1022 | } |
---|
688 | 1023 | |
---|
689 | | - JCheckBox liveCB; |
---|
690 | | - JCheckBox supportCB; |
---|
691 | | - JCheckBox localCB; |
---|
692 | | - JCheckBox crowdCB; |
---|
693 | | - JCheckBox smoothCB; |
---|
694 | | - JCheckBox fastCB; |
---|
695 | | - JCheckBox slowCB; |
---|
696 | | - JCheckBox boxCB; |
---|
697 | | - JCheckBox zoomBoxCB; |
---|
698 | | - JCheckBox trackCB; |
---|
699 | | - JCheckBox smoothfocusCB; |
---|
| 1024 | + cToggleButton liveCB; |
---|
| 1025 | + cCheckBox supportCB; |
---|
| 1026 | + cCheckBox localCB; |
---|
| 1027 | + cCheckBox crowdCB; |
---|
| 1028 | + cCheckBox smoothCB; |
---|
| 1029 | + cToggleButton fastCB; |
---|
| 1030 | + cCheckBox slowCB; |
---|
| 1031 | + cCheckBox boxCB; |
---|
| 1032 | + cCheckBox zoomBoxCB; |
---|
| 1033 | + cCheckBox freezeCB; |
---|
| 1034 | + //cToggleButton trackCB; |
---|
| 1035 | + cCheckBox trackCB; |
---|
| 1036 | + cCheckBox smoothfocusCB; |
---|
700 | 1037 | // JCheckBox speakerMocapCB; |
---|
701 | | - JCheckBox speakerCameraCB; |
---|
702 | | - JCheckBox speakerFocusCB; |
---|
703 | | - JCheckBox debugCB; |
---|
704 | | - JCheckBox oeilCB; |
---|
705 | | - JCheckBox lookAtCB; |
---|
| 1038 | + cCheckBox speakerCameraCB; |
---|
| 1039 | + cCheckBox speakerFocusCB; |
---|
| 1040 | + cCheckBox debugCB; |
---|
| 1041 | + |
---|
| 1042 | + cCheckBox oeilCB; |
---|
| 1043 | + cCheckBox shadowCB; |
---|
| 1044 | + cCheckBox autokeepCB; |
---|
| 1045 | + cCheckBox lookAtCB; |
---|
706 | 1046 | |
---|
707 | 1047 | // static int COLOR = 1; |
---|
708 | 1048 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
710 | 1050 | |
---|
711 | 1051 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
712 | 1052 | |
---|
713 | | - JCheckBox colorCB; |
---|
714 | | - JCheckBox materialCB; |
---|
715 | | - JCheckBox textureCB; |
---|
| 1053 | + cCheckBox colorCB; |
---|
| 1054 | + cCheckBox materialCB; |
---|
| 1055 | + cCheckBox textureCB; |
---|
716 | 1056 | |
---|
717 | 1057 | public void itemStateChanged(ItemEvent e) |
---|
718 | 1058 | { |
---|
.. | .. |
---|
740 | 1080 | } else if(e.getSource() == liveCB) |
---|
741 | 1081 | { |
---|
742 | 1082 | cameraView.ToggleLive(); |
---|
| 1083 | + refreshContents(false); |
---|
743 | 1084 | } |
---|
744 | 1085 | else if(e.getSource() == supportCB) |
---|
745 | 1086 | { |
---|
.. | .. |
---|
804 | 1145 | { |
---|
805 | 1146 | cameraView.ToggleOeil(); |
---|
806 | 1147 | } |
---|
| 1148 | + else if(e.getSource() == shadowCB) |
---|
| 1149 | + { |
---|
| 1150 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1151 | + } |
---|
| 1152 | + else if(e.getSource() == freezeCB) |
---|
| 1153 | + { |
---|
| 1154 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1155 | + } |
---|
| 1156 | + else if(e.getSource() == autokeepCB) |
---|
| 1157 | + { |
---|
| 1158 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1159 | + } |
---|
807 | 1160 | else if(e.getSource() == lookAtCB) |
---|
808 | 1161 | { |
---|
809 | 1162 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
820 | 1173 | |
---|
821 | 1174 | /**/ |
---|
822 | 1175 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
823 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1176 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1177 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
824 | 1178 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
825 | 1179 | // We can't move the root node or an empty selection |
---|
826 | 1180 | return; |
---|
.. | .. |
---|
883 | 1237 | } |
---|
884 | 1238 | } |
---|
885 | 1239 | |
---|
886 | | - String string = (String) object; |
---|
887 | | - |
---|
888 | 1240 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
889 | 1241 | // if( object instanceof java.io.File[]) |
---|
890 | 1242 | // { |
---|
.. | .. |
---|
892 | 1244 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
893 | 1245 | // return; |
---|
894 | 1246 | // } |
---|
895 | | - if (string.charAt(0) == '/') |
---|
| 1247 | + |
---|
| 1248 | + String string = object.toString(); |
---|
| 1249 | + |
---|
| 1250 | + // File path for Mac and Windows |
---|
| 1251 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
896 | 1252 | { |
---|
897 | 1253 | // file(s) |
---|
898 | 1254 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
919 | 1275 | |
---|
920 | 1276 | flashIt = false; |
---|
921 | 1277 | CameraPane pane = (CameraPane) target; |
---|
922 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1278 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
923 | 1279 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
924 | 1280 | |
---|
925 | 1281 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
935 | 1291 | |
---|
936 | 1292 | assert target == objEditor.jTree; |
---|
937 | 1293 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1294 | + Object3D destinationLeaf; |
---|
938 | 1295 | try { |
---|
939 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1296 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
940 | 1297 | } catch (Exception e) { |
---|
941 | 1298 | System.out.println("destinationPath : " + destinationPath); |
---|
942 | 1299 | return; |
---|
943 | 1300 | } |
---|
944 | 1301 | |
---|
945 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1302 | + for (int i=group.selection.size(); --i>=0;) |
---|
946 | 1303 | { |
---|
| 1304 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1305 | + |
---|
| 1306 | + // Cannot move into itself |
---|
| 1307 | + if (child == destinationLeaf) |
---|
| 1308 | + return; |
---|
| 1309 | + } |
---|
| 1310 | + |
---|
| 1311 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1312 | +// { |
---|
947 | 1313 | loadClipboard(true); |
---|
948 | 1314 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
949 | | - pasteInto(false); |
---|
950 | | - } else { |
---|
951 | | - loadClipboard(false); |
---|
952 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
953 | | - pasteInto(false); // true); // ??? |
---|
954 | | - } |
---|
| 1315 | + pasteInto(false, false); |
---|
| 1316 | +// } else { |
---|
| 1317 | +// loadClipboard(false); |
---|
| 1318 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1319 | +// pasteInto(false, false); // true); // ??? |
---|
| 1320 | +// } |
---|
955 | 1321 | } |
---|
956 | 1322 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
957 | 1323 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1056 | 1422 | { |
---|
1057 | 1423 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1058 | 1424 | //heightFieldItem.addActionListener(this); |
---|
1059 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1060 | | - gridItem.addActionListener(this); |
---|
1061 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1062 | | - rectoidItem.addActionListener(this); |
---|
1063 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1064 | | - ellipsoidItem.addActionListener(this); |
---|
1065 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1066 | | - coneItem.addActionListener(this); |
---|
1067 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1068 | | - torusItem.addActionListener(this); |
---|
1069 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1070 | | - superItem.addActionListener(this); |
---|
| 1425 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1426 | +// gridItem.addActionListener(this); |
---|
| 1427 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1428 | +// rectoidItem.addActionListener(this); |
---|
| 1429 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1430 | +// ellipsoidItem.addActionListener(this); |
---|
| 1431 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1432 | +// coneItem.addActionListener(this); |
---|
| 1433 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1434 | +// torusItem.addActionListener(this); |
---|
| 1435 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1436 | +// superItem.addActionListener(this); |
---|
| 1437 | + |
---|
| 1438 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1439 | + cameraItem.addActionListener(this); |
---|
| 1440 | + |
---|
| 1441 | + if (!Globals.ADVANCED) |
---|
| 1442 | + { |
---|
1071 | 1443 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1072 | 1444 | kleinItem.addActionListener(this); |
---|
1073 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1074 | | - particleItem.addActionListener(this); |
---|
| 1445 | + } |
---|
| 1446 | + |
---|
| 1447 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1448 | +// particleItem.addActionListener(this); |
---|
| 1449 | + if (Globals.ADVANCED) |
---|
| 1450 | + { |
---|
1075 | 1451 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1076 | 1452 | ragdollItem.addActionListener(this); |
---|
1077 | 1453 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1078 | 1454 | ragdoll2Item.addActionListener(this); |
---|
| 1455 | + } |
---|
1079 | 1456 | menu.add("-"); |
---|
1080 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1457 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1081 | 1458 | meshItem.addActionListener(this); |
---|
1082 | 1459 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1083 | 1460 | // meshGroupItem.addActionListener(this); |
---|
| 1461 | + if (Globals.ADVANCED) |
---|
| 1462 | + { |
---|
1084 | 1463 | springItem = menu.add(new MenuItem("Spring")); |
---|
1085 | 1464 | springItem.addActionListener(this); |
---|
1086 | 1465 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1087 | 1466 | flagItem.addActionListener(this); |
---|
1088 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1089 | | - bezierItem.addActionListener(this); |
---|
1090 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1091 | | - checkerItem.addActionListener(this); |
---|
1092 | 1467 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1093 | 1468 | blobItem.addActionListener(this); |
---|
1094 | 1469 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1095 | 1470 | latheItem.addActionListener(this); |
---|
1096 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1097 | | - lightItem.addActionListener(this); |
---|
| 1471 | + } |
---|
| 1472 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1473 | + bezierItem.addActionListener(this); |
---|
| 1474 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1475 | +// overlayItem.addActionListener(this); |
---|
| 1476 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1477 | +// lightItem.addActionListener(this); |
---|
1098 | 1478 | menu.add("-"); |
---|
1099 | 1479 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1100 | 1480 | //superLoopItem.addActionListener(this); |
---|
1101 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1102 | | - loopItem.addActionListener(this); |
---|
| 1481 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1482 | +// loopItem.addActionListener(this); |
---|
1103 | 1483 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1104 | 1484 | doubleItem.addActionListener(this); |
---|
| 1485 | + if (Globals.ADVANCED) |
---|
| 1486 | + { |
---|
1105 | 1487 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1106 | 1488 | tripleItem.addActionListener(this); |
---|
| 1489 | + } |
---|
1107 | 1490 | } |
---|
1108 | 1491 | |
---|
1109 | 1492 | void buildToolsMenu(Menu menu) |
---|
1110 | 1493 | { |
---|
1111 | 1494 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1112 | 1495 | animationItem.addItemListener(this); |
---|
1113 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1496 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1497 | + |
---|
| 1498 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1499 | + archiveItem.addActionListener(this); |
---|
1114 | 1500 | |
---|
1115 | 1501 | menu.add("-"); |
---|
1116 | 1502 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1117 | 1503 | parseverticesItem.addActionListener(this); |
---|
1118 | 1504 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1119 | 1505 | textureFieldItem.addActionListener(this); |
---|
1120 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1506 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1121 | 1507 | alignItem.addActionListener(this); |
---|
1122 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1123 | | - mirrorItem.addActionListener(this); |
---|
1124 | 1508 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1125 | 1509 | reduceMorphItem.addActionListener(this); |
---|
1126 | 1510 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1127 | 1511 | reduce34MorphItem.addActionListener(this); |
---|
1128 | | - |
---|
1129 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1130 | | - computeAOItem.addActionListener(this); |
---|
1131 | 1512 | menu.add("-"); |
---|
1132 | | - |
---|
1133 | 1513 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1134 | 1514 | memoryItem.addActionListener(this); |
---|
| 1515 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1516 | + computeAOItem.addActionListener(this); |
---|
| 1517 | + |
---|
| 1518 | + if (Globals.ADVANCED) |
---|
| 1519 | + { |
---|
| 1520 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1521 | + mirrorItem.addActionListener(this); |
---|
| 1522 | + menu.add("-"); |
---|
1135 | 1523 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1136 | 1524 | analyzeItem.addActionListener(this); |
---|
1137 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1525 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1138 | 1526 | dumpItem.addActionListener(this); |
---|
1139 | 1527 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1140 | 1528 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1152 | 1540 | menu.add("-"); |
---|
1153 | 1541 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1154 | 1542 | editScriptItem.addActionListener(this); |
---|
| 1543 | + } |
---|
1155 | 1544 | } |
---|
1156 | 1545 | |
---|
1157 | 1546 | void ScreenFit() |
---|
.. | .. |
---|
1274 | 1663 | shadow.material = new cMaterial(obj.material); |
---|
1275 | 1664 | shadow.material.diffuse = 0.0001f; |
---|
1276 | 1665 | shadow.material.specular = 0.0001f; |
---|
| 1666 | + //shadow.projectedVertices[1].x = 300; |
---|
1277 | 1667 | |
---|
1278 | 1668 | makeSomething(shadow); |
---|
1279 | 1669 | } |
---|
| 1670 | + |
---|
| 1671 | + private void ClearUnpinned() |
---|
| 1672 | + { |
---|
| 1673 | + //for (Object3D obj : listUI) |
---|
| 1674 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1675 | + { |
---|
| 1676 | + Object3D obj = listUI.elementAt(i); |
---|
| 1677 | + if (!obj.pinned) |
---|
| 1678 | + { |
---|
| 1679 | + obj.CloseUI(); |
---|
| 1680 | + listUI.remove(i); |
---|
| 1681 | + } |
---|
| 1682 | + } |
---|
| 1683 | + } |
---|
1280 | 1684 | |
---|
1281 | 1685 | /** |
---|
1282 | 1686 | * applyExample |
---|
.. | .. |
---|
1480 | 1884 | |
---|
1481 | 1885 | void Overwrite(int mask) |
---|
1482 | 1886 | { |
---|
1483 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1887 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1484 | 1888 | { |
---|
1485 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1889 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1486 | 1890 | |
---|
1487 | 1891 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1488 | 1892 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1521 | 1925 | { |
---|
1522 | 1926 | ScreenFit(); |
---|
1523 | 1927 | } else |
---|
1524 | | - if (source == switchItem) |
---|
| 1928 | + if (source == switchViewItem) |
---|
1525 | 1929 | { |
---|
1526 | 1930 | cVector v1 = new cVector(); |
---|
1527 | 1931 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1530 | 1934 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1531 | 1935 | objEditor.cameraView.repaint(); |
---|
1532 | 1936 | } else |
---|
1533 | | - if (source == rectoidItem) |
---|
| 1937 | + if (source == rectoidItem || source == boxButton) |
---|
1534 | 1938 | { |
---|
1535 | 1939 | makeSomething(new Box()); |
---|
1536 | 1940 | } else |
---|
1537 | | - if (source == particleItem) |
---|
| 1941 | + if (source == particleItem || source == particlesButton) |
---|
1538 | 1942 | { |
---|
1539 | 1943 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1540 | 1944 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1613 | 2017 | |
---|
1614 | 2018 | makeSomething(obj); |
---|
1615 | 2019 | } else |
---|
1616 | | - if (source == gridItem) |
---|
| 2020 | + if (source == gridItem || source == gridButton) |
---|
1617 | 2021 | { |
---|
1618 | 2022 | makeSomething(new Grid()); |
---|
1619 | 2023 | } else |
---|
1620 | | - if (source == ellipsoidItem) |
---|
| 2024 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1621 | 2025 | { |
---|
1622 | 2026 | makeSomething(new Sphere()); |
---|
1623 | 2027 | } else |
---|
1624 | | - if (source == coneItem) |
---|
| 2028 | + if (source == coneItem || source == coneButton) |
---|
1625 | 2029 | { |
---|
1626 | 2030 | makeSomething(new Cone()); |
---|
1627 | 2031 | } else |
---|
1628 | | - if (source == torusItem) |
---|
| 2032 | + if (source == torusItem || source == torusButton) |
---|
1629 | 2033 | { |
---|
1630 | 2034 | makeSomething(new Torus()); |
---|
1631 | 2035 | } else |
---|
1632 | | - if (source == superItem) |
---|
| 2036 | + if (source == superItem || source == superButton) |
---|
1633 | 2037 | { |
---|
1634 | 2038 | makeSomething(new Superellipsoid()); |
---|
1635 | 2039 | } else |
---|
1636 | | - if (source == kleinItem) |
---|
| 2040 | + if (source == kleinItem || source == kleinButton) |
---|
1637 | 2041 | { |
---|
1638 | 2042 | makeSomething(new Klein()); |
---|
1639 | 2043 | } else |
---|
.. | .. |
---|
1653 | 2057 | { |
---|
1654 | 2058 | makeSomething(new BezierSurface()); |
---|
1655 | 2059 | } else |
---|
1656 | | - if (source == checkerItem) |
---|
| 2060 | + if (source == overlayItem || source == overlayButton) |
---|
1657 | 2061 | { |
---|
1658 | 2062 | /* |
---|
1659 | 2063 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1701 | 2105 | s.setup(); |
---|
1702 | 2106 | makeSomething(s); |
---|
1703 | 2107 | } else |
---|
1704 | | - if (source == lightItem) |
---|
| 2108 | + if (source == lightItem || source == lightButton) |
---|
1705 | 2109 | { |
---|
1706 | 2110 | makeSomething(new Light()); |
---|
1707 | 2111 | } else |
---|
.. | .. |
---|
1751 | 2155 | |
---|
1752 | 2156 | group(g); |
---|
1753 | 2157 | } else |
---|
1754 | | - if (source == loopItem) |
---|
| 2158 | + if (source == loopItem || source == loopButton) |
---|
1755 | 2159 | { |
---|
1756 | 2160 | Composite csg = new GroupLeaf(); |
---|
1757 | 2161 | csg.count = 5; |
---|
1758 | 2162 | group(csg); |
---|
1759 | | - Composite child = new cGroup(); |
---|
| 2163 | + Composite child = new cGroup("Branch"); |
---|
1760 | 2164 | csg.addChild(child); |
---|
1761 | 2165 | child.addChild(csg); |
---|
1762 | 2166 | } else |
---|
1763 | 2167 | if (source == doubleItem) |
---|
1764 | 2168 | { |
---|
1765 | | - Composite csg = new GroupLeaf(); |
---|
| 2169 | + Composite csg = new GroupLeaf("Fork"); |
---|
1766 | 2170 | csg.count = 5; |
---|
1767 | 2171 | group(csg); |
---|
1768 | | - Composite child = new cGroup(); |
---|
| 2172 | + Composite child = new cGroup("Branch A"); |
---|
1769 | 2173 | csg.addChild(child); |
---|
1770 | 2174 | child.addChild(csg); |
---|
1771 | | - child = new cGroup(); |
---|
| 2175 | + child = new cGroup("Branch B"); |
---|
1772 | 2176 | csg.addChild(child); |
---|
1773 | 2177 | child.addChild(csg); |
---|
1774 | 2178 | } else |
---|
1775 | 2179 | if (source == tripleItem) |
---|
1776 | 2180 | { |
---|
1777 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Trident"); |
---|
1778 | 2182 | csg.count = 4; |
---|
1779 | 2183 | group(csg); |
---|
1780 | 2184 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1786 | 2190 | child = new cGroup(); |
---|
1787 | 2191 | csg.addChild(child); |
---|
1788 | 2192 | child.addChild(csg); |
---|
1789 | | - } else |
---|
1790 | | - |
---|
1791 | | - if (source == importGFDItem) |
---|
1792 | | - { |
---|
1793 | | - ImportGFD(); |
---|
1794 | | - } else |
---|
1795 | | - if (source == importVRMLX3DItem) |
---|
1796 | | - { |
---|
1797 | | - ImportVRMLX3D(); |
---|
1798 | | - } else |
---|
1799 | | - if (source == import3DSItem) |
---|
1800 | | - { |
---|
1801 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1802 | | - } else |
---|
1803 | | - if (source == importOBJItem) |
---|
1804 | | - { |
---|
1805 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1806 | 2193 | } else |
---|
1807 | 2194 | if (source == computeAOItem) |
---|
1808 | 2195 | { |
---|
.. | .. |
---|
1822 | 2209 | if (source == invariantsItem) |
---|
1823 | 2210 | { |
---|
1824 | 2211 | System.out.println("Invariants:"); |
---|
1825 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2212 | + Grafreed.grafreeD.universe.invariants(); |
---|
1826 | 2213 | } else |
---|
1827 | 2214 | if (source == memoryItem) |
---|
1828 | 2215 | { |
---|
.. | .. |
---|
1841 | 2228 | { |
---|
1842 | 2229 | DumpObject(); |
---|
1843 | 2230 | } else |
---|
| 2231 | + if (source == minButton) |
---|
| 2232 | + { |
---|
| 2233 | + Minimize(); |
---|
| 2234 | + } else |
---|
| 2235 | + if (source == maxButton) |
---|
| 2236 | + { |
---|
| 2237 | + Maximize(); |
---|
| 2238 | + } else |
---|
| 2239 | + if (source == fullButton) |
---|
| 2240 | + { |
---|
| 2241 | + ToggleFullScreen(); |
---|
| 2242 | + } else |
---|
| 2243 | + if (source == undoButton) |
---|
| 2244 | + { |
---|
| 2245 | + // Go to previous version |
---|
| 2246 | + //if (!Undo()) |
---|
| 2247 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2248 | + Undo(); |
---|
| 2249 | + } else |
---|
| 2250 | + if (source == restoreButton) |
---|
| 2251 | + { |
---|
| 2252 | + // Restore current version |
---|
| 2253 | + Restore(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == replaceButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Overwrite current version |
---|
| 2258 | + Replace(); |
---|
| 2259 | + } else |
---|
| 2260 | + if (source == redoButton) |
---|
| 2261 | + { |
---|
| 2262 | + // Go to next version |
---|
| 2263 | + Redo(); |
---|
| 2264 | + } else |
---|
| 2265 | + if (source == saveButton) |
---|
| 2266 | + { |
---|
| 2267 | + // Save a new version |
---|
| 2268 | + if (!Save(true)) |
---|
| 2269 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2270 | + } else |
---|
| 2271 | + if (source == oneStepButton) |
---|
| 2272 | + { |
---|
| 2273 | + Globals.ONESTEP = true; |
---|
| 2274 | + cameraView.repaint(); |
---|
| 2275 | + } else |
---|
1844 | 2276 | if (source == screenfitButton) |
---|
1845 | 2277 | { |
---|
1846 | | - //Reload(lastConverter, lastFilename, true); |
---|
1847 | 2278 | ScreenFit(); |
---|
1848 | 2279 | } else |
---|
1849 | 2280 | if (source == screenfitpointButton) |
---|
1850 | 2281 | { |
---|
1851 | | - //Reload(lastConverter, lastFilename, true); |
---|
1852 | 2282 | ScreenFitPoint(); |
---|
1853 | 2283 | } else |
---|
1854 | 2284 | if (source == snapobjectButton) |
---|
1855 | 2285 | { |
---|
1856 | | - //Reload(lastConverter, lastFilename, true); |
---|
1857 | 2286 | SnapObject(); |
---|
1858 | 2287 | } else |
---|
1859 | 2288 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1890 | 2319 | { |
---|
1891 | 2320 | loadClipboard(true); |
---|
1892 | 2321 | } else |
---|
| 2322 | + if (source == undoItem) |
---|
| 2323 | + { |
---|
| 2324 | + Undo(); |
---|
| 2325 | + } else |
---|
| 2326 | + if (source == redoItem) |
---|
| 2327 | + { |
---|
| 2328 | + Redo(); |
---|
| 2329 | + } else |
---|
1893 | 2330 | if (source == duplicateItem) |
---|
1894 | 2331 | { |
---|
1895 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2332 | + Object3D keep = Grafreed.clipboard; |
---|
1896 | 2333 | loadClipboard(false); |
---|
1897 | 2334 | paste(false); |
---|
1898 | | - GrafreeD.clipboard = keep; |
---|
| 2335 | + Grafreed.clipboard = keep; |
---|
1899 | 2336 | } else |
---|
1900 | 2337 | if (source == cloneItem) |
---|
1901 | 2338 | { |
---|
.. | .. |
---|
1913 | 2350 | { |
---|
1914 | 2351 | paste(false); |
---|
1915 | 2352 | } else |
---|
| 2353 | + if (source == pasteIntoItem) |
---|
| 2354 | + { |
---|
| 2355 | + pasteInto(true, false); |
---|
| 2356 | + } else |
---|
1916 | 2357 | if (source == pasteLinkItem) |
---|
1917 | 2358 | { |
---|
1918 | | - pasteInto(false); |
---|
| 2359 | + pasteInto(false, false); |
---|
1919 | 2360 | } else |
---|
1920 | 2361 | if (source == pasteCloneItem) |
---|
1921 | 2362 | { |
---|
1922 | | - pasteInto(true); |
---|
| 2363 | + pasteInto(true, true); |
---|
1923 | 2364 | } else |
---|
1924 | 2365 | if (source == pasteExpandItem) |
---|
1925 | 2366 | { |
---|
.. | .. |
---|
2111 | 2552 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2112 | 2553 | // refreshContents(); |
---|
2113 | 2554 | // } |
---|
2114 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2555 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2115 | 2556 | { |
---|
2116 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2557 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2117 | 2558 | |
---|
2118 | 2559 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2119 | 2560 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2121 | 2562 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2122 | 2563 | for (int i=0; i<group.selection.size(); i++) |
---|
2123 | 2564 | { |
---|
2124 | | - boolean random = CameraPane.RANDOM; |
---|
2125 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2565 | + boolean random = CameraPane.SWITCH; |
---|
| 2566 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2126 | 2567 | group.selection.get(i).linkVerticesThis(content); |
---|
2127 | 2568 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2128 | | - CameraPane.RANDOM = random; |
---|
| 2569 | + CameraPane.SWITCH = random; |
---|
2129 | 2570 | } |
---|
2130 | 2571 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2131 | 2572 | refreshContents(); |
---|
.. | .. |
---|
2135 | 2576 | { |
---|
2136 | 2577 | for (int i=0; i<group.selection.size(); i++) |
---|
2137 | 2578 | { |
---|
2138 | | - boolean random = CameraPane.RANDOM; |
---|
2139 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2579 | + boolean random = CameraPane.SWITCH; |
---|
| 2580 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2140 | 2581 | group.selection.get(i).linkVerticesThis(null); |
---|
2141 | | - CameraPane.RANDOM = random; |
---|
| 2582 | + CameraPane.SWITCH = random; |
---|
2142 | 2583 | } |
---|
2143 | 2584 | |
---|
2144 | 2585 | refreshContents(); |
---|
2145 | 2586 | } else |
---|
2146 | 2587 | if (source == relinkverticesItem) |
---|
2147 | 2588 | { |
---|
2148 | | - boolean random = CameraPane.RANDOM; |
---|
2149 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2589 | + boolean random = CameraPane.SWITCH; |
---|
| 2590 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2150 | 2591 | group.selection.RelinkToSupport(); |
---|
2151 | | - CameraPane.RANDOM = random; |
---|
| 2592 | + CameraPane.SWITCH = random; |
---|
2152 | 2593 | |
---|
2153 | 2594 | refreshContents(); |
---|
2154 | 2595 | } else |
---|
.. | .. |
---|
2163 | 2604 | } else |
---|
2164 | 2605 | if (source == setMasterItem) |
---|
2165 | 2606 | { |
---|
2166 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2607 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2167 | 2608 | { |
---|
2168 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2609 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2169 | 2610 | |
---|
2170 | 2611 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2171 | 2612 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2178 | 2619 | { |
---|
2179 | 2620 | if (group.selection.size() == 1) |
---|
2180 | 2621 | { |
---|
2181 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2622 | + if (Grafreed.clipboard.size() == 1) |
---|
2182 | 2623 | { |
---|
2183 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2624 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2184 | 2625 | |
---|
2185 | 2626 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2186 | 2627 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2197 | 2638 | { |
---|
2198 | 2639 | RevertMeshes(); |
---|
2199 | 2640 | } else |
---|
2200 | | - if (source == resetMeshItem) |
---|
| 2641 | + if (source == resetAllItem) |
---|
2201 | 2642 | { |
---|
2202 | 2643 | ResetAll(); |
---|
2203 | 2644 | } else |
---|
.. | .. |
---|
2217 | 2658 | { |
---|
2218 | 2659 | ClearSelection(true); |
---|
2219 | 2660 | } else |
---|
2220 | | - if (source == grabItem) |
---|
| 2661 | + if (source == grabItem || source == groupButton) |
---|
2221 | 2662 | { |
---|
2222 | | - group(new cGroup(), true); |
---|
| 2663 | + group(new cGroup(), false); // true); |
---|
2223 | 2664 | } else |
---|
2224 | 2665 | if (source == hideItem) |
---|
2225 | 2666 | { |
---|
.. | .. |
---|
2237 | 2678 | { |
---|
2238 | 2679 | makeSomething(new Camera()); |
---|
2239 | 2680 | } else |
---|
2240 | | - if (source == compositeItem) |
---|
| 2681 | + if (source == compositeItem || source == compositeButton) |
---|
2241 | 2682 | { |
---|
2242 | 2683 | group(new Composite()); |
---|
2243 | 2684 | } else |
---|
2244 | | - if (source == randomItem) |
---|
| 2685 | + if (source == switchItem || source == switchButton) |
---|
2245 | 2686 | { |
---|
2246 | 2687 | RandomNode random = new RandomNode(); |
---|
2247 | 2688 | group(random); |
---|
2248 | 2689 | if (random.size() > 0) |
---|
2249 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2690 | + random.name = random.get(0).name + "Switch"; |
---|
2250 | 2691 | } else |
---|
2251 | 2692 | if (source == physicsItem) |
---|
2252 | 2693 | { |
---|
.. | .. |
---|
2343 | 2784 | { |
---|
2344 | 2785 | group(new cLinker()); |
---|
2345 | 2786 | } else |
---|
2346 | | - if (source == textureItem) |
---|
| 2787 | + if (source == textureItem || source == textureButton) |
---|
2347 | 2788 | { |
---|
2348 | 2789 | group(new TextureNode()); |
---|
2349 | 2790 | } else |
---|
.. | .. |
---|
2363 | 2804 | { |
---|
2364 | 2805 | CastShadow(2); |
---|
2365 | 2806 | } else |
---|
2366 | | - if (source == ungroupItem) |
---|
| 2807 | + if (source == ungroupItem || source == ungroupButton) |
---|
2367 | 2808 | { |
---|
2368 | | - //ungroup(); |
---|
| 2809 | + boolean hasRoot = false; |
---|
| 2810 | + |
---|
2369 | 2811 | for (int i=0; i<group.selection.size(); i++) |
---|
2370 | 2812 | { |
---|
2371 | | - Ungroup(group.selection.get(i)); |
---|
| 2813 | + if (group.selection.get(i) == group) |
---|
| 2814 | + { |
---|
| 2815 | + hasRoot = true; |
---|
| 2816 | + break; |
---|
| 2817 | + } |
---|
2372 | 2818 | } |
---|
2373 | 2819 | |
---|
2374 | | - ClearSelection(false); |
---|
2375 | | - |
---|
2376 | | - refreshContents(); |
---|
| 2820 | + if (!hasRoot) |
---|
| 2821 | + { |
---|
| 2822 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2823 | + { |
---|
| 2824 | + Ungroup(group.selection.get(i)); |
---|
| 2825 | + } |
---|
| 2826 | + |
---|
| 2827 | + ClearSelection(false); |
---|
| 2828 | + |
---|
| 2829 | + refreshContents(); |
---|
| 2830 | + } |
---|
2377 | 2831 | } else |
---|
2378 | 2832 | if (source == genUVItem) |
---|
2379 | 2833 | { |
---|
.. | .. |
---|
2385 | 2839 | } else |
---|
2386 | 2840 | if (source == genNormalsMESHItem) |
---|
2387 | 2841 | { |
---|
2388 | | - GenNormals(true); // TODO |
---|
| 2842 | + GenNormalsMESH(); |
---|
2389 | 2843 | } else |
---|
2390 | 2844 | if (source == genNormalsORGANItem) |
---|
2391 | 2845 | { |
---|
.. | .. |
---|
2450 | 2904 | if (source == unmarkleavesItem) |
---|
2451 | 2905 | { |
---|
2452 | 2906 | MarkLeaves(false); |
---|
| 2907 | + } else |
---|
| 2908 | + if (source == rewindleavesItem) |
---|
| 2909 | + { |
---|
| 2910 | + RewindLeaves(true); |
---|
| 2911 | + } else |
---|
| 2912 | + if (source == unrewindleavesItem) |
---|
| 2913 | + { |
---|
| 2914 | + RewindLeaves(false); |
---|
| 2915 | + } else |
---|
| 2916 | + if (source == randomleavesItem) |
---|
| 2917 | + { |
---|
| 2918 | + RandomLeaves(true); |
---|
| 2919 | + } else |
---|
| 2920 | + if (source == unrandomleavesItem) |
---|
| 2921 | + { |
---|
| 2922 | + RandomLeaves(false); |
---|
2453 | 2923 | } else |
---|
2454 | 2924 | if (source == flipVItem) |
---|
2455 | 2925 | { |
---|
.. | .. |
---|
2535 | 3005 | { |
---|
2536 | 3006 | SmoothMesh(); |
---|
2537 | 3007 | } else |
---|
2538 | | - if (source == transformgeometryItem) |
---|
| 3008 | + if (source == transformGeometryItem) |
---|
2539 | 3009 | { |
---|
2540 | 3010 | TransformGeometry(); |
---|
| 3011 | + } else |
---|
| 3012 | + if (source == transformChildrenItem) |
---|
| 3013 | + { |
---|
| 3014 | + TransformChildren(); |
---|
2541 | 3015 | } else |
---|
2542 | 3016 | if (source == resetTransformItem) |
---|
2543 | 3017 | { |
---|
.. | .. |
---|
2545 | 3019 | } else |
---|
2546 | 3020 | if (source == resetCentroidItem) |
---|
2547 | 3021 | { |
---|
2548 | | - ResetCentroid(); |
---|
| 3022 | + ResetCentroid(true); |
---|
| 3023 | + } else |
---|
| 3024 | + if (source == resetCentroidXZItem) |
---|
| 3025 | + { |
---|
| 3026 | + ResetCentroid(false); |
---|
2549 | 3027 | } else |
---|
2550 | 3028 | if (source == resetParentItem) |
---|
2551 | 3029 | { |
---|
.. | .. |
---|
2677 | 3155 | if (source == twoButton) |
---|
2678 | 3156 | { |
---|
2679 | 3157 | radio.layout = twoButton; |
---|
| 3158 | + |
---|
| 3159 | + if (CameraPane.FULLSCREEN) |
---|
| 3160 | + fullscreenLayout = radio.layout; |
---|
| 3161 | + |
---|
2680 | 3162 | // bug |
---|
2681 | 3163 | //gridPanel.setDividerLocation(1.0); |
---|
2682 | 3164 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2709 | 3191 | bigThree.ClearUI(); |
---|
2710 | 3192 | bigThree.add(centralPanel); |
---|
2711 | 3193 | bigThree.FlushUI(); |
---|
| 3194 | + |
---|
| 3195 | + cameraView.requestFocusInWindow(); |
---|
| 3196 | + |
---|
| 3197 | +// refreshContents(true); |
---|
| 3198 | +// |
---|
| 3199 | +// try |
---|
| 3200 | +// { |
---|
| 3201 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3202 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3203 | +// bot.mouseMove(100, 100); |
---|
| 3204 | +// bot.mousePress(mask); |
---|
| 3205 | +// bot.mouseRelease(mask); |
---|
| 3206 | +// } |
---|
| 3207 | +// catch (Exception e) |
---|
| 3208 | +// { |
---|
| 3209 | +// |
---|
| 3210 | +// } |
---|
| 3211 | + |
---|
2712 | 3212 | } else |
---|
2713 | 3213 | if (source == threeButton) |
---|
2714 | 3214 | { |
---|
2715 | 3215 | radio.layout = threeButton; |
---|
| 3216 | + |
---|
| 3217 | + if (CameraPane.FULLSCREEN) |
---|
| 3218 | + fullscreenLayout = radio.layout; |
---|
2716 | 3219 | |
---|
2717 | 3220 | // bigThree.remove(scenePanel); |
---|
2718 | 3221 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2745 | 3248 | bigThree.add(centralPanel); |
---|
2746 | 3249 | bigThree.add(XYZPanel); |
---|
2747 | 3250 | bigThree.FlushUI(); |
---|
| 3251 | + |
---|
| 3252 | + cameraView.requestFocusInWindow(); |
---|
2748 | 3253 | } else |
---|
2749 | 3254 | if (source == fourButton) |
---|
2750 | 3255 | { |
---|
2751 | 3256 | radio.layout = fourButton; |
---|
| 3257 | + |
---|
| 3258 | + if (CameraPane.FULLSCREEN) |
---|
| 3259 | + fullscreenLayout = radio.layout; |
---|
2752 | 3260 | |
---|
2753 | 3261 | // bigThree.remove(scenePanel); |
---|
2754 | 3262 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2780 | 3288 | bigThree.ClearUI(); |
---|
2781 | 3289 | bigThree.add(scenePanel); |
---|
2782 | 3290 | bigThree.FlushUI(); |
---|
| 3291 | + |
---|
| 3292 | + cameraView.requestFocusInWindow(); |
---|
2783 | 3293 | } else |
---|
2784 | 3294 | if (source == sixButton) |
---|
2785 | 3295 | { |
---|
2786 | 3296 | radio.layout = sixButton; |
---|
| 3297 | + |
---|
| 3298 | + if (CameraPane.FULLSCREEN) |
---|
| 3299 | + fullscreenLayout = radio.layout; |
---|
2787 | 3300 | |
---|
2788 | 3301 | // bigThree.remove(scenePanel); |
---|
2789 | 3302 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2816 | 3329 | bigThree.add(scenePanel); |
---|
2817 | 3330 | bigThree.add(centralPanel); |
---|
2818 | 3331 | bigThree.FlushUI(); |
---|
| 3332 | + |
---|
| 3333 | + cameraView.requestFocusInWindow(); |
---|
2819 | 3334 | } else |
---|
2820 | 3335 | if (source == sevenButton) |
---|
2821 | 3336 | { |
---|
2822 | 3337 | radio.layout = sevenButton; |
---|
| 3338 | + |
---|
| 3339 | + if (CameraPane.FULLSCREEN) |
---|
| 3340 | + fullscreenLayout = radio.layout; |
---|
2823 | 3341 | |
---|
2824 | 3342 | // bigThree.remove(scenePanel); |
---|
2825 | 3343 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2853 | 3371 | bigThree.add(centralPanel); |
---|
2854 | 3372 | bigThree.add(XYZPanel); |
---|
2855 | 3373 | bigThree.FlushUI(); |
---|
| 3374 | + |
---|
| 3375 | + cameraView.requestFocusInWindow(); |
---|
2856 | 3376 | } else |
---|
2857 | 3377 | if (source == rootButton) |
---|
2858 | 3378 | { |
---|
.. | .. |
---|
2864 | 3384 | EditObject(obj); |
---|
2865 | 3385 | } |
---|
2866 | 3386 | |
---|
| 3387 | + cameraView.requestFocusInWindow(); |
---|
2867 | 3388 | refreshContents(true); |
---|
2868 | 3389 | } else |
---|
2869 | 3390 | if (source == closeButton) |
---|
.. | .. |
---|
2873 | 3394 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2874 | 3395 | { |
---|
2875 | 3396 | ab = (cRadio)e.nextElement(); |
---|
2876 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3397 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2877 | 3398 | { |
---|
| 3399 | + // Patch to avoid bug with transparency. |
---|
| 3400 | + if (!ab.hadMaterial) |
---|
| 3401 | + { |
---|
| 3402 | + ab.object.material = null; |
---|
| 3403 | + } |
---|
| 3404 | + |
---|
2878 | 3405 | buttonGroup.remove(ab); |
---|
2879 | 3406 | radioPanel.remove(ab); |
---|
2880 | 3407 | |
---|
2881 | | - ab.GetObject().editWindow = null; |
---|
| 3408 | + //ab.GetObject().editWindow = null; |
---|
| 3409 | + ab.GetObject().manipWindow = null; |
---|
2882 | 3410 | // ab.GetObject().objectUI = null; // ????????? |
---|
2883 | 3411 | |
---|
2884 | 3412 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2885 | 3413 | break; |
---|
2886 | 3414 | } |
---|
2887 | 3415 | } |
---|
| 3416 | + |
---|
| 3417 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3418 | refreshContents(true); |
---|
2889 | 3419 | } else |
---|
2890 | 3420 | if (source == editItem || source == editButton) |
---|
2891 | 3421 | { |
---|
| 3422 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3423 | + { |
---|
| 3424 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3425 | + child.pinned = true; |
---|
| 3426 | + } |
---|
| 3427 | + |
---|
2892 | 3428 | EditSelection(false); |
---|
2893 | 3429 | } else |
---|
2894 | 3430 | if (source == uneditButton) |
---|
.. | .. |
---|
2898 | 3434 | Object3D child = (Object3D)e.nextElement(); |
---|
2899 | 3435 | if(child.editWindow != null) |
---|
2900 | 3436 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3437 | + child.pinned = false; |
---|
2901 | 3438 | child.CloseUI(); |
---|
2902 | 3439 | listUI.remove(child); |
---|
2903 | 3440 | |
---|
2904 | | - child.editWindow = null; // ??????????? |
---|
| 3441 | + //child.editWindow = null; // ??????????? |
---|
2905 | 3442 | } |
---|
2906 | | - objEditor.ctrlPanel.validate(); |
---|
| 3443 | + objEditor.ctrlPanel.FlushUI(); |
---|
2907 | 3444 | //objEditor.jTree.clearSelection(); |
---|
2908 | 3445 | //objEditor.ResetSliders(); |
---|
2909 | 3446 | refreshContents(true); |
---|
.. | .. |
---|
2914 | 3451 | //copy.ClearUI(); |
---|
2915 | 3452 | for (Object3D obj : listUI) |
---|
2916 | 3453 | { |
---|
| 3454 | + obj.pinned = false; |
---|
2917 | 3455 | obj.CloseUI(); |
---|
2918 | 3456 | } |
---|
2919 | 3457 | listUI.clear(); |
---|
.. | .. |
---|
2923 | 3461 | { |
---|
2924 | 3462 | assert(copy == group); |
---|
2925 | 3463 | |
---|
2926 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3464 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2927 | 3465 | |
---|
2928 | 3466 | for (Object3D obj : listUI) |
---|
2929 | 3467 | { |
---|
.. | .. |
---|
2972 | 3510 | } |
---|
2973 | 3511 | |
---|
2974 | 3512 | copy = group; |
---|
| 3513 | + |
---|
| 3514 | + SetUndoStates(); |
---|
| 3515 | + |
---|
2975 | 3516 | //Globals.theRenderer.object = group; |
---|
2976 | 3517 | if(!useclient) |
---|
2977 | 3518 | { |
---|
.. | .. |
---|
2987 | 3528 | frontView.object = group; |
---|
2988 | 3529 | sideView.object = group; |
---|
2989 | 3530 | } |
---|
2990 | | - group.editWindow = this; |
---|
| 3531 | + |
---|
| 3532 | +// fix "+" issue |
---|
| 3533 | + //group.editWindow = this; |
---|
| 3534 | + group.manipWindow = this; |
---|
| 3535 | + |
---|
2991 | 3536 | /* |
---|
2992 | 3537 | currentLayout = radio.layout; |
---|
2993 | 3538 | if (currentLayout == null) |
---|
2994 | 3539 | currentLayout = sevenButton; |
---|
2995 | 3540 | */ |
---|
2996 | 3541 | radio.layout.doClick(); |
---|
| 3542 | + |
---|
| 3543 | + ClearUnpinned(); |
---|
| 3544 | + SetPinStates(group.selection.size() > 0); |
---|
| 3545 | + if (group.selection.size() == 1) |
---|
| 3546 | + EditSelection(false); |
---|
2997 | 3547 | keepparent = group.parent; |
---|
2998 | 3548 | // PARENT = NULL or not??? |
---|
2999 | 3549 | //group.parent = null; // ROOT |
---|
3000 | 3550 | //group.attributes = -1; |
---|
3001 | 3551 | ResetModel(); |
---|
| 3552 | + |
---|
| 3553 | + cameraView.requestFocusInWindow(); |
---|
3002 | 3554 | refreshContents(true); |
---|
3003 | | - } |
---|
| 3555 | + } else if (event.getSource() == editCameraItem) |
---|
| 3556 | + { |
---|
| 3557 | + cameraView.ProtectCamera(); |
---|
| 3558 | + cameraView.repaint(); |
---|
| 3559 | + return; |
---|
| 3560 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3561 | + { |
---|
| 3562 | + cameraView.RevertCamera(); |
---|
| 3563 | + cameraView.repaint(); |
---|
| 3564 | + return; |
---|
| 3565 | + // } else if (event.getSource() == textureButton) |
---|
| 3566 | + // { |
---|
| 3567 | + // return; // true; |
---|
| 3568 | + } |
---|
3004 | 3569 | else |
---|
3005 | 3570 | { |
---|
3006 | 3571 | //return super.action(event, arg); |
---|
.. | .. |
---|
3009 | 3574 | } |
---|
3010 | 3575 | |
---|
3011 | 3576 | boolean useclient = false; |
---|
3012 | | - cRadio radio; |
---|
3013 | 3577 | |
---|
3014 | 3578 | void ToggleRoot() |
---|
3015 | 3579 | { |
---|
.. | .. |
---|
3061 | 3625 | refreshContents(); |
---|
3062 | 3626 | } |
---|
3063 | 3627 | |
---|
| 3628 | + void TransformChildren() |
---|
| 3629 | + { |
---|
| 3630 | + Object3D obj; |
---|
| 3631 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3632 | + { |
---|
| 3633 | + obj = (Object3D)e.nextElement(); |
---|
| 3634 | + obj.KeepTextureMatrices(); |
---|
| 3635 | + obj.TransformChildren(); |
---|
| 3636 | + obj.RestoreTextureMatrices(); |
---|
| 3637 | + |
---|
| 3638 | +// if (obj.parent == null) |
---|
| 3639 | +// { |
---|
| 3640 | +// System.out.println("NULL PARENT!"); |
---|
| 3641 | +// new Exception().printStackTrace(); |
---|
| 3642 | +// } |
---|
| 3643 | +// else |
---|
| 3644 | +// TouchTransform(obj); |
---|
| 3645 | +// //obj.parent.Touch(); |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + refreshContents(); |
---|
| 3649 | + } |
---|
3064 | 3650 | |
---|
3065 | 3651 | void ResetTransform() |
---|
3066 | 3652 | { |
---|
.. | .. |
---|
3173 | 3759 | refreshContents(); |
---|
3174 | 3760 | } |
---|
3175 | 3761 | |
---|
3176 | | - void ResetCentroid() |
---|
| 3762 | + void ResetCentroid(boolean full) |
---|
3177 | 3763 | { |
---|
3178 | 3764 | Object3D obj; |
---|
3179 | 3765 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3188 | 3774 | LA.matIdentity(Object3D.mat); |
---|
3189 | 3775 | obj.getBounds(minima, maxima, false); |
---|
3190 | 3776 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3191 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3777 | + if (full) |
---|
| 3778 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3192 | 3779 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3193 | 3780 | obj.TransformMesh(Object3D.mat); |
---|
| 3781 | + |
---|
3194 | 3782 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3195 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3783 | + if (full) |
---|
| 3784 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3196 | 3785 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3786 | + |
---|
3197 | 3787 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3198 | 3788 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3199 | 3789 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3222 | 3812 | |
---|
3223 | 3813 | int size = obj.MemorySize(); |
---|
3224 | 3814 | |
---|
3225 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3815 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3816 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3226 | 3817 | } |
---|
3227 | 3818 | } |
---|
3228 | 3819 | catch (Exception e) |
---|
.. | .. |
---|
3259 | 3850 | obj = (Object3D)e.nextElement(); |
---|
3260 | 3851 | |
---|
3261 | 3852 | System.out.println("Object is: " + obj); |
---|
3262 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3853 | + Grafreed.AnalyzeObject(obj); |
---|
3263 | 3854 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3264 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3855 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3265 | 3856 | |
---|
3266 | 3857 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3267 | 3858 | } |
---|
.. | .. |
---|
3303 | 3894 | void GenNormals(boolean crease) |
---|
3304 | 3895 | { |
---|
3305 | 3896 | group.GenNormalsS(crease); |
---|
| 3897 | + |
---|
| 3898 | + refreshContents(); |
---|
| 3899 | + } |
---|
| 3900 | + |
---|
| 3901 | + void GenNormalsMESH() |
---|
| 3902 | + { |
---|
| 3903 | + group.GenNormalsMeshS(); |
---|
3306 | 3904 | |
---|
3307 | 3905 | refreshContents(); |
---|
3308 | 3906 | } |
---|
.. | .. |
---|
3475 | 4073 | |
---|
3476 | 4074 | void ParseVertices() |
---|
3477 | 4075 | { |
---|
3478 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3479 | | - GrafreeD.epsequal = true; |
---|
| 4076 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4077 | + Grafreed.epsequal = true; |
---|
3480 | 4078 | |
---|
3481 | 4079 | for (int i=0; i<group.selection.size(); i++) |
---|
3482 | 4080 | { |
---|
.. | .. |
---|
3501 | 4099 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3502 | 4100 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3503 | 4101 | |
---|
3504 | | - g.add(GrafreeD.clipboard); |
---|
| 4102 | + g.add(Grafreed.clipboard); |
---|
3505 | 4103 | |
---|
3506 | 4104 | buffer.add(g); |
---|
3507 | 4105 | } |
---|
.. | .. |
---|
3516 | 4114 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3517 | 4115 | } |
---|
3518 | 4116 | |
---|
3519 | | - GrafreeD.epsequal = epsequal; |
---|
| 4117 | + Grafreed.epsequal = epsequal; |
---|
3520 | 4118 | |
---|
3521 | 4119 | refreshContents(); |
---|
3522 | 4120 | } |
---|
.. | .. |
---|
3534 | 4132 | String pigment = Object3D.GetPigment(tex); |
---|
3535 | 4133 | //String bump = Object3D.GetBump(tex); |
---|
3536 | 4134 | |
---|
3537 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4135 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4136 | + |
---|
| 4137 | + try |
---|
| 4138 | + { |
---|
| 4139 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4140 | + } |
---|
| 4141 | + catch (Exception e) |
---|
| 4142 | + { |
---|
| 4143 | + System.err.println("FAIL: " + node); |
---|
| 4144 | + } |
---|
3538 | 4145 | |
---|
3539 | 4146 | double s = v.s; |
---|
3540 | 4147 | |
---|
.. | .. |
---|
3622 | 4229 | |
---|
3623 | 4230 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3624 | 4231 | |
---|
3625 | | - boolean random = CameraPane.RANDOM; |
---|
3626 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4232 | + boolean random = CameraPane.SWITCH; |
---|
| 4233 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3627 | 4234 | lowres.linkVerticesThis(null); |
---|
3628 | 4235 | lowres.linkVerticesThis(sn); |
---|
3629 | | - CameraPane.RANDOM = random; |
---|
| 4236 | + CameraPane.SWITCH = random; |
---|
3630 | 4237 | |
---|
3631 | 4238 | System.err.flush(); |
---|
3632 | 4239 | |
---|
.. | .. |
---|
3666 | 4273 | return; |
---|
3667 | 4274 | |
---|
3668 | 4275 | Object3D poses = group.selection.get(0); |
---|
3669 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4276 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3670 | 4277 | |
---|
3671 | 4278 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3672 | 4279 | |
---|
.. | .. |
---|
3860 | 4467 | |
---|
3861 | 4468 | void ClipMesh() |
---|
3862 | 4469 | { |
---|
3863 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4470 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3864 | 4471 | { |
---|
3865 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4472 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3866 | 4473 | |
---|
3867 | 4474 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3868 | 4475 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3871 | 4478 | // { |
---|
3872 | 4479 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3873 | 4480 | // } |
---|
3874 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4481 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3875 | 4482 | } |
---|
3876 | 4483 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3877 | 4484 | System.out.println("DONE."); |
---|
.. | .. |
---|
3918 | 4525 | void MarkLeaves(boolean hide) |
---|
3919 | 4526 | { |
---|
3920 | 4527 | group.selection.MarkLeaves(hide); |
---|
| 4528 | + refreshContents(); |
---|
| 4529 | + } |
---|
| 4530 | + |
---|
| 4531 | + void RewindLeaves(boolean hide) |
---|
| 4532 | + { |
---|
| 4533 | + group.selection.RewindLeaves(hide); |
---|
| 4534 | + refreshContents(); |
---|
| 4535 | + } |
---|
| 4536 | + |
---|
| 4537 | + void RandomLeaves(boolean hide) |
---|
| 4538 | + { |
---|
| 4539 | + group.selection.RandomLeaves(hide); |
---|
3921 | 4540 | refreshContents(); |
---|
3922 | 4541 | } |
---|
3923 | 4542 | |
---|
.. | .. |
---|
3992 | 4611 | // } |
---|
3993 | 4612 | // } |
---|
3994 | 4613 | |
---|
3995 | | - static boolean allparams = true; |
---|
3996 | | - |
---|
3997 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3998 | | - |
---|
3999 | 4614 | void EditSelection(boolean newWindow) |
---|
4000 | 4615 | { |
---|
4001 | 4616 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4003 | 4618 | { |
---|
4004 | 4619 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4005 | 4620 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4006 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4621 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4007 | 4622 | |
---|
4008 | 4623 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4009 | | - if(elem != group) |
---|
| 4624 | + if(elem != group || !newWindow) |
---|
4010 | 4625 | { |
---|
4011 | 4626 | // if (!(elem instanceof Composite)) |
---|
4012 | 4627 | // newWindow = false; |
---|
.. | .. |
---|
4088 | 4703 | //new Exception().printStackTrace(); |
---|
4089 | 4704 | |
---|
4090 | 4705 | freezemodel = true; |
---|
4091 | | - |
---|
| 4706 | + ClearUnpinned(); |
---|
| 4707 | + |
---|
4092 | 4708 | /**/ |
---|
4093 | 4709 | //switch (event.id) |
---|
4094 | 4710 | { |
---|
.. | .. |
---|
4096 | 4712 | //case 702: // Event.LIST_DESELECT |
---|
4097 | 4713 | group.deselectAll(); |
---|
4098 | 4714 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4099 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4100 | 4715 | if (tps != null) |
---|
4101 | 4716 | { |
---|
4102 | 4717 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4105 | 4720 | |
---|
4106 | 4721 | //if (child.parent != null) |
---|
4107 | 4722 | //child.parent.addSelectee(child); |
---|
| 4723 | + objEditor.SetMaterial(child); |
---|
4108 | 4724 | group.addSelectee(child); |
---|
4109 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4110 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4111 | | - System.err.println("info : " + child.GetPath()); |
---|
4112 | 4725 | } |
---|
4113 | 4726 | } |
---|
4114 | 4727 | // else |
---|
.. | .. |
---|
4118 | 4731 | // System.err.println("info : " + group.GetPath()); |
---|
4119 | 4732 | // } |
---|
4120 | 4733 | |
---|
4121 | | - objEditor.SetText(); // jan 2014 |
---|
4122 | | - |
---|
4123 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4734 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4124 | 4735 | CameraPane.flash = true; |
---|
4125 | 4736 | |
---|
4126 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4737 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4127 | 4738 | // a camera |
---|
4128 | 4739 | { |
---|
4129 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4130 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4740 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4741 | + { |
---|
| 4742 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4743 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4744 | + } |
---|
4131 | 4745 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4132 | 4746 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4133 | 4747 | } |
---|
4134 | 4748 | |
---|
| 4749 | + if (tps != null && tps.length == 1) |
---|
| 4750 | + { |
---|
| 4751 | + EditSelection(false); |
---|
| 4752 | + } |
---|
| 4753 | + |
---|
| 4754 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4755 | + |
---|
4135 | 4756 | refreshContents(); |
---|
4136 | 4757 | //return true; |
---|
4137 | 4758 | } |
---|
.. | .. |
---|
4140 | 4761 | |
---|
4141 | 4762 | freezemodel = false; |
---|
4142 | 4763 | } |
---|
| 4764 | + |
---|
| 4765 | + void SetPinStates(boolean enabled) |
---|
| 4766 | + { |
---|
| 4767 | + editButton.setEnabled(enabled); |
---|
| 4768 | + uneditButton.setEnabled(enabled); |
---|
| 4769 | + unselectButton.setEnabled(enabled); |
---|
| 4770 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4771 | + } |
---|
| 4772 | + |
---|
| 4773 | + void refreshContents(boolean cp) |
---|
| 4774 | + { |
---|
| 4775 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4776 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4777 | + { |
---|
| 4778 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4779 | + |
---|
| 4780 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4781 | + { |
---|
| 4782 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4783 | + |
---|
| 4784 | + objEditor.AddInfo(child, this, true); |
---|
| 4785 | + System.err.println("info : " + child.GetPath()); |
---|
| 4786 | + } |
---|
| 4787 | + |
---|
| 4788 | + objEditor.SetText(); // jan 2014 |
---|
| 4789 | + } |
---|
| 4790 | + |
---|
| 4791 | + super.refreshContents(cp); |
---|
| 4792 | + } |
---|
4143 | 4793 | |
---|
4144 | 4794 | void linkSomething(Object3D thing) |
---|
4145 | 4795 | { |
---|
.. | .. |
---|
4211 | 4861 | { |
---|
4212 | 4862 | if (group.selection.isEmpty()) |
---|
4213 | 4863 | return; |
---|
4214 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4864 | + |
---|
| 4865 | + Grafreed.clipboardIsTempGroup = false; |
---|
4215 | 4866 | Composite tGroup = null; |
---|
4216 | 4867 | if (group.selection.size() > 0) // 1) |
---|
4217 | 4868 | { |
---|
4218 | 4869 | tGroup = new cGroup(); |
---|
4219 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4870 | + Grafreed.clipboardIsTempGroup = true; |
---|
4220 | 4871 | } |
---|
4221 | 4872 | |
---|
4222 | 4873 | if (cut) |
---|
4223 | 4874 | { |
---|
| 4875 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4876 | +// Save(); |
---|
4224 | 4877 | //int indices[] = jList.getSelectedIndices(); |
---|
4225 | 4878 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4226 | 4879 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4256 | 4909 | //System.out.println("cut " + child); |
---|
4257 | 4910 | //System.out.println("parent = " + child.parent); |
---|
4258 | 4911 | // tmp.addChild(child); |
---|
4259 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4912 | + if (Grafreed.clipboardIsTempGroup) |
---|
4260 | 4913 | tGroup.add/*Child*/(tmp); |
---|
4261 | 4914 | else |
---|
4262 | | - GrafreeD.clipboard = tmp; |
---|
| 4915 | + Grafreed.clipboard = tmp; |
---|
4263 | 4916 | } |
---|
4264 | 4917 | else |
---|
4265 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4918 | + if (Grafreed.clipboardIsTempGroup) |
---|
4266 | 4919 | tGroup.add/*Child*/(child); |
---|
4267 | 4920 | else |
---|
4268 | | - GrafreeD.clipboard = child; |
---|
| 4921 | + Grafreed.clipboard = child; |
---|
4269 | 4922 | } |
---|
4270 | 4923 | |
---|
4271 | 4924 | //ResetModel(); |
---|
.. | .. |
---|
4297 | 4950 | //System.out.println("cut " + elem); |
---|
4298 | 4951 | //System.out.println("parent = " + elem.parent); |
---|
4299 | 4952 | // tmp.addChild(elem); |
---|
4300 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4953 | + if (Grafreed.clipboardIsTempGroup) |
---|
4301 | 4954 | tGroup.add/*Child*/(tmp); |
---|
4302 | 4955 | else |
---|
4303 | | - GrafreeD.clipboard = tmp; |
---|
| 4956 | + Grafreed.clipboard = tmp; |
---|
4304 | 4957 | } |
---|
4305 | 4958 | else |
---|
4306 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4959 | + if (Grafreed.clipboardIsTempGroup) |
---|
4307 | 4960 | tGroup.add/*Child*/(child); |
---|
4308 | 4961 | else |
---|
4309 | | - GrafreeD.clipboard = child; |
---|
| 4962 | + Grafreed.clipboard = child; |
---|
4310 | 4963 | } |
---|
4311 | 4964 | |
---|
4312 | 4965 | } |
---|
4313 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4314 | | - GrafreeD.clipboard = tGroup; |
---|
| 4966 | + |
---|
| 4967 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4968 | + Grafreed.clipboard = tGroup; |
---|
| 4969 | + |
---|
4315 | 4970 | if (cut) |
---|
4316 | 4971 | { |
---|
4317 | 4972 | ResetModel(); |
---|
.. | .. |
---|
4321 | 4976 | |
---|
4322 | 4977 | void paste(boolean expand) |
---|
4323 | 4978 | { |
---|
| 4979 | + if (Globals.REPLACEONMAKE) |
---|
| 4980 | + Save(); |
---|
| 4981 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4982 | + Globals.REPLACEONMAKE = false; |
---|
4324 | 4983 | // if (GrafreeD.clipboard == null) |
---|
4325 | 4984 | // return; |
---|
4326 | 4985 | boolean first = true; |
---|
4327 | 4986 | |
---|
4328 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4987 | + if (Grafreed.clipboardIsTempGroup) |
---|
4329 | 4988 | { |
---|
4330 | 4989 | Composite temp; |
---|
4331 | 4990 | |
---|
.. | .. |
---|
4336 | 4995 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4337 | 4996 | */ |
---|
4338 | 4997 | Object3D elem; |
---|
4339 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4998 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4340 | 4999 | { |
---|
4341 | 5000 | Object3D child = (Object3D)e.nextElement(); |
---|
4342 | 5001 | |
---|
.. | .. |
---|
4370 | 5029 | //Object3D cb = Applet3D.clipboard; |
---|
4371 | 5030 | //temp.addChild(cb); |
---|
4372 | 5031 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4373 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4374 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4375 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4376 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4377 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5032 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5033 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5034 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5035 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5036 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4378 | 5037 | else |
---|
4379 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4380 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5038 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5039 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4381 | 5040 | } |
---|
4382 | 5041 | |
---|
| 5042 | + Globals.REPLACEONMAKE = keep; |
---|
4383 | 5043 | ResetModel(); |
---|
4384 | 5044 | refreshContents(); |
---|
4385 | 5045 | } |
---|
4386 | 5046 | |
---|
4387 | | - void pasteInto(boolean copyit) |
---|
| 5047 | + void pasteInto(boolean copyit, boolean clone) |
---|
4388 | 5048 | { |
---|
4389 | 5049 | // if (GrafreeD.clipboard == null) |
---|
4390 | 5050 | // return; |
---|
.. | .. |
---|
4413 | 5073 | if (copyit) |
---|
4414 | 5074 | { |
---|
4415 | 5075 | // paste(false); |
---|
4416 | | - CloneClipboard(false); // sept 2014 |
---|
| 5076 | + if (clone) |
---|
| 5077 | + { |
---|
| 5078 | + CloneClipboard(false); // sept 2014 |
---|
| 5079 | + } |
---|
| 5080 | + else |
---|
| 5081 | + { |
---|
| 5082 | + paste(false); |
---|
| 5083 | + } |
---|
4417 | 5084 | } |
---|
4418 | 5085 | else |
---|
4419 | 5086 | { |
---|
4420 | 5087 | boolean first = true; |
---|
4421 | 5088 | |
---|
4422 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5089 | + if (Grafreed.clipboardIsTempGroup) |
---|
4423 | 5090 | { |
---|
4424 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5091 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4425 | 5092 | Object3D copy; |
---|
4426 | 5093 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4427 | 5094 | { |
---|
.. | .. |
---|
4431 | 5098 | } |
---|
4432 | 5099 | } else |
---|
4433 | 5100 | { |
---|
4434 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5101 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4435 | 5102 | } |
---|
4436 | 5103 | } |
---|
4437 | 5104 | } |
---|
.. | .. |
---|
4508 | 5175 | |
---|
4509 | 5176 | void group(Object3D csg, boolean grab) |
---|
4510 | 5177 | { |
---|
| 5178 | + if (Globals.REPLACEONMAKE) |
---|
| 5179 | + Save(); |
---|
| 5180 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5181 | + Globals.REPLACEONMAKE = false; |
---|
4511 | 5182 | if (//false) // why?? |
---|
4512 | 5183 | !group.selection.isEmpty()) |
---|
4513 | 5184 | { |
---|
.. | .. |
---|
4621 | 5292 | //node.add(csg); |
---|
4622 | 5293 | //makeSomething(node); |
---|
4623 | 5294 | makeSomething(csg); |
---|
| 5295 | + Globals.REPLACEONMAKE = keep; |
---|
4624 | 5296 | } |
---|
4625 | 5297 | |
---|
4626 | 5298 | void Ungroup(Object3D g) |
---|
4627 | 5299 | { |
---|
| 5300 | + if (Globals.REPLACEONMAKE) |
---|
| 5301 | + Save(); |
---|
| 5302 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5303 | + Globals.REPLACEONMAKE = false; |
---|
4628 | 5304 | if (g instanceof HiddenObject) |
---|
4629 | 5305 | { |
---|
4630 | 5306 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4641 | 5317 | objEditor.makeSomething(g.get(i), false); |
---|
4642 | 5318 | } |
---|
4643 | 5319 | } |
---|
| 5320 | + Globals.REPLACEONMAKE = keep; |
---|
4644 | 5321 | } |
---|
4645 | 5322 | |
---|
4646 | 5323 | void ungroup() |
---|
.. | .. |
---|
4836 | 5513 | } |
---|
4837 | 5514 | */ |
---|
4838 | 5515 | |
---|
4839 | | - void ImportGFD() |
---|
4840 | | - { |
---|
4841 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4842 | | - browser.show(); |
---|
4843 | | - String filename = browser.getFile(); |
---|
4844 | | - if (filename != null && filename.length() > 0) |
---|
4845 | | - { |
---|
4846 | | - String fullname = browser.getDirectory() + filename; |
---|
4847 | | - |
---|
4848 | | - //Object3D readobj = |
---|
4849 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4850 | | - //makeSomething(readobj); |
---|
4851 | | - } |
---|
4852 | | - } |
---|
4853 | | - |
---|
4854 | 5516 | /* |
---|
4855 | 5517 | public void Callback(Object obj) |
---|
4856 | 5518 | { |
---|
.. | .. |
---|
4874 | 5536 | } |
---|
4875 | 5537 | */ |
---|
4876 | 5538 | |
---|
4877 | | - void ImportVRMLX3D() |
---|
4878 | | - { |
---|
4879 | | - if (GrafreeD.standAlone) |
---|
4880 | | - { |
---|
4881 | | - /**/ |
---|
4882 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4883 | | - browser.show(); |
---|
4884 | | - String filename = browser.getFile(); |
---|
4885 | | - if (filename != null && filename.length() > 0) |
---|
4886 | | - { |
---|
4887 | | - String fullname = browser.getDirectory() + filename; |
---|
4888 | | - LoadVRMLX3D(fullname); |
---|
4889 | | - } |
---|
4890 | | - /**/ |
---|
4891 | | - } |
---|
4892 | | - } |
---|
4893 | | - |
---|
4894 | 5539 | String GetFile(String dialogName) |
---|
4895 | 5540 | { |
---|
4896 | | - if (GrafreeD.standAlone) |
---|
| 5541 | + if (Grafreed.standAlone) |
---|
4897 | 5542 | { |
---|
4898 | 5543 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4899 | 5544 | browser.show(); |
---|
.. | .. |
---|
4957 | 5602 | cButton flashSelectionButton; |
---|
4958 | 5603 | cButton editButton; |
---|
4959 | 5604 | cButton uneditButton; |
---|
| 5605 | + JCheckBox allParamsButton; |
---|
4960 | 5606 | cButton clearpanelButton; |
---|
4961 | | - cButton allParamsButton; |
---|
4962 | 5607 | cButton unselectButton; |
---|
4963 | 5608 | |
---|
| 5609 | + cButton restoreCameraButton; |
---|
| 5610 | + |
---|
| 5611 | + cButton saveButton; |
---|
| 5612 | + cButton oneStepButton; |
---|
| 5613 | + |
---|
| 5614 | + cButton groupButton; |
---|
| 5615 | + cButton ungroupButton; |
---|
| 5616 | + cButton compositeButton; |
---|
| 5617 | + cButton switchButton; |
---|
| 5618 | + cButton loopButton; |
---|
| 5619 | + cButton textureButton; |
---|
| 5620 | + |
---|
| 5621 | + cButton gridButton; |
---|
| 5622 | + cButton boxButton; |
---|
| 5623 | + cButton sphereButton; |
---|
| 5624 | + cButton coneButton; |
---|
| 5625 | + cButton torusButton; |
---|
| 5626 | + cButton superButton; |
---|
| 5627 | + cButton kleinButton; |
---|
| 5628 | + cButton particlesButton; |
---|
| 5629 | + cButton overlayButton; |
---|
| 5630 | + cButton lightButton; |
---|
| 5631 | + |
---|
4964 | 5632 | cButton screenfitButton; |
---|
4965 | 5633 | cButton screenfitpointButton; |
---|
4966 | 5634 | cButton snapobjectButton; |
---|
.. | .. |
---|
4972 | 5640 | |
---|
4973 | 5641 | cButton setsupportButton; |
---|
4974 | 5642 | |
---|
4975 | | - cButton twoButton; |
---|
4976 | | - cButton sixButton; |
---|
4977 | | - cButton threeButton; |
---|
4978 | | - cButton sevenButton; |
---|
4979 | | - cButton fourButton; // full panel |
---|
4980 | | - cButton oneButton; // full XYZ |
---|
4981 | | - //cButton currentLayout; |
---|
4982 | | - |
---|
4983 | 5643 | // |
---|
4984 | 5644 | //Composite |
---|
4985 | 5645 | Object3D // to do !! |
---|
.. | .. |
---|
4989 | 5649 | //JTree jTree; |
---|
4990 | 5650 | private MenuItem lookAtItem; |
---|
4991 | 5651 | private MenuItem lookFromItem; |
---|
4992 | | - private MenuItem switchItem; |
---|
| 5652 | + private MenuItem switchViewItem; |
---|
4993 | 5653 | private MenuItem cutItem; |
---|
4994 | | - private MenuItem duplicateItem; |
---|
| 5654 | + private MenuItem undoItem; |
---|
| 5655 | + private MenuItem redoItem; |
---|
| 5656 | + private JMenuItem duplicateItem; |
---|
4995 | 5657 | private MenuItem cloneItem; |
---|
4996 | 5658 | private MenuItem cloneSupportItem; |
---|
4997 | 5659 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5004 | 5666 | private MenuItem linkverticesItem; |
---|
5005 | 5667 | private MenuItem relinkverticesItem; |
---|
5006 | 5668 | private MenuItem setMasterItem; |
---|
5007 | | - private MenuItem resetMeshItem; |
---|
| 5669 | + private MenuItem resetAllItem; |
---|
5008 | 5670 | private MenuItem stepAllItem; |
---|
5009 | 5671 | private MenuItem revertMeshItem; |
---|
5010 | 5672 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5015 | 5677 | private MenuItem mergeGeometriesItem; |
---|
5016 | 5678 | private MenuItem copyItem; |
---|
5017 | 5679 | private MenuItem pasteItem; |
---|
| 5680 | + private MenuItem pasteIntoItem; |
---|
5018 | 5681 | private MenuItem pasteLinkItem; |
---|
5019 | 5682 | private MenuItem pasteCloneItem; |
---|
5020 | 5683 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5053 | 5716 | private MenuItem showleavesItem; |
---|
5054 | 5717 | private MenuItem markleavesItem; |
---|
5055 | 5718 | private MenuItem unmarkleavesItem; |
---|
| 5719 | + private MenuItem rewindleavesItem; |
---|
| 5720 | + private MenuItem unrewindleavesItem; |
---|
| 5721 | + private MenuItem randomleavesItem; |
---|
| 5722 | + private MenuItem unrandomleavesItem; |
---|
5056 | 5723 | |
---|
5057 | 5724 | private MenuItem flipVItem; |
---|
5058 | 5725 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5064 | 5731 | private MenuItem panoTexturesItem; |
---|
5065 | 5732 | |
---|
5066 | 5733 | private MenuItem resetCentroidItem; |
---|
5067 | | - private MenuItem transformgeometryItem; |
---|
| 5734 | + private MenuItem resetCentroidXZItem; |
---|
5068 | 5735 | private MenuItem resetTransformItem; |
---|
| 5736 | + private MenuItem transformGeometryItem; |
---|
| 5737 | + private MenuItem transformChildrenItem; |
---|
5069 | 5738 | private MenuItem hideItem; |
---|
5070 | 5739 | private MenuItem grabItem; |
---|
5071 | 5740 | private MenuItem backItem; |
---|
5072 | 5741 | private MenuItem frontItem; |
---|
5073 | 5742 | private MenuItem cameraItem; |
---|
5074 | 5743 | private MenuItem compositeItem; |
---|
5075 | | - private MenuItem randomItem; |
---|
| 5744 | + private MenuItem switchItem; |
---|
5076 | 5745 | private MenuItem physicsItem; |
---|
5077 | 5746 | private MenuItem frameselectorItem; |
---|
5078 | 5747 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5112 | 5781 | private MenuItem blobItem; |
---|
5113 | 5782 | private MenuItem latheItem; |
---|
5114 | 5783 | private MenuItem bezierItem; |
---|
5115 | | - private MenuItem checkerItem; |
---|
| 5784 | + private MenuItem overlayItem; |
---|
5116 | 5785 | private MenuItem meshItem; |
---|
5117 | 5786 | // private MenuItem meshGroupItem; |
---|
5118 | 5787 | private MenuItem springItem; |
---|
.. | .. |
---|
5134 | 5803 | private MenuItem doubleItem; |
---|
5135 | 5804 | private MenuItem tripleItem; |
---|
5136 | 5805 | |
---|
5137 | | - private MenuItem importGFDItem; |
---|
5138 | | - private MenuItem importVRMLX3DItem; |
---|
5139 | | - private MenuItem import3DSItem; |
---|
5140 | | - private MenuItem importOBJItem; |
---|
5141 | | - |
---|
5142 | 5806 | private MenuItem computeAOItem; |
---|
5143 | 5807 | private MenuItem recompileItem; |
---|
5144 | 5808 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5148 | 5812 | private MenuItem analyzeItem; |
---|
5149 | 5813 | private MenuItem dumpItem; |
---|
5150 | 5814 | //boolean freezemodel = false; |
---|
| 5815 | + |
---|
| 5816 | + Menu cameraMenu; |
---|
| 5817 | + MenuItem editCameraItem; |
---|
| 5818 | + MenuItem restoreCameraItem; |
---|
5151 | 5819 | } |
---|