.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
.. | .. |
---|
73 | 74 | this.copy = this.group = copy; |
---|
74 | 75 | //selectees = this.group.selectees; |
---|
75 | 76 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
77 | 78 | SetupUI2(objEditor); |
---|
78 | 79 | objEditor.SetupUI(true); |
---|
79 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
83 | 84 | |
---|
84 | 85 | void CloneSelection(boolean supports) |
---|
85 | 86 | { |
---|
86 | | - // Object3D keep = GraphreeD.clipboard; |
---|
| 87 | + // Object3D keep = GrafreeD.clipboard; |
---|
87 | 88 | //Object3D obj; |
---|
88 | 89 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
89 | 90 | { |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GraphreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
102 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GraphreeD.clipboard.get(0), false)); |
---|
| 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)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GraphreeD.clipboard, false)); |
---|
107 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GraphreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 148 | |
---|
148 | 149 | //JTextField nameField; |
---|
149 | 150 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 152 | { |
---|
152 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
155 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
156 | | - oe.cameraMenu.add("-"); |
---|
157 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
158 | | - openWindowItem.addActionListener(this); |
---|
159 | | - editLeafItem.addActionListener(this); |
---|
160 | | - lookAtItem.addActionListener(this); |
---|
161 | | - //lookFromItem.addActinoListener(this); |
---|
162 | | - //switchItem.addActionListener(this); |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
163 | 155 | Menu menu; |
---|
164 | 156 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 157 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 158 | //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 159 | + |
---|
| 160 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 161 | +// undoItem.addActionListener(this); |
---|
| 162 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 163 | +// redoItem.addActionListener(this); |
---|
| 164 | +// menu.add("-"); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
168 | 166 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 167 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 168 | cloneItem.addActionListener(this); |
---|
| 169 | + if (Globals.ADVANCED) |
---|
| 170 | + { |
---|
172 | 171 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 172 | cloneSupportItem.addActionListener(this); |
---|
| 173 | + } |
---|
174 | 174 | menu.add("-"); |
---|
175 | 175 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 176 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 178 | copyItem.addActionListener(this); |
---|
179 | 179 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 180 | pasteItem.addActionListener(this); |
---|
| 181 | + |
---|
| 182 | + menu.add("-"); |
---|
| 183 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 184 | + pasteIntoItem.addActionListener(this); |
---|
181 | 185 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 186 | pasteLinkItem.addActionListener(this); |
---|
183 | 187 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 188 | pasteCloneItem.addActionListener(this); |
---|
185 | 189 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 190 | // pasteExpandItem.addActionListener(this); |
---|
| 191 | + menu.add("-"); |
---|
187 | 192 | clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | 193 | clearItem.addActionListener(this); |
---|
| 194 | + |
---|
| 195 | + if (Globals.ADVANCED) |
---|
| 196 | + { |
---|
| 197 | + // Deletes the cameras... |
---|
189 | 198 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 199 | clearAllItem.addActionListener(this); |
---|
| 200 | + } |
---|
| 201 | + |
---|
| 202 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 203 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 204 | + //zBufferItem.addActionListener(this); |
---|
| 205 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 206 | + //normalLensItem.addActionListener(this); |
---|
| 207 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + restoreCameraItem.addActionListener(this); |
---|
| 209 | + |
---|
| 210 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 211 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 212 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 213 | +// cameraMenu.add("-"); |
---|
| 214 | +// |
---|
| 215 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 216 | +// toggleTextureItem.addItemListener(this); |
---|
| 217 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 218 | +// |
---|
| 219 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 220 | +// toggleSwitchItem.addItemListener(this); |
---|
| 221 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 222 | + |
---|
| 223 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 224 | + toggleHandleItem.addItemListener(this); |
---|
| 225 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 226 | + |
---|
| 227 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 228 | + togglePaintItem.addItemListener(this); |
---|
| 229 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 230 | + |
---|
| 231 | + if (Globals.ADVANCED) |
---|
| 232 | + { |
---|
| 233 | + cameraMenu.add("-"); |
---|
| 234 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 235 | + toggleLiveItem.addItemListener(this); |
---|
| 236 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
191 | 237 | |
---|
| 238 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 239 | + stepItem.addActionListener(this); |
---|
| 240 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 241 | + // toggleDLItem.addItemListener(this); |
---|
| 242 | + // toggleDLItem.setState(false); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 245 | + toggleRenderItem.addItemListener(this); |
---|
| 246 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 247 | + |
---|
| 248 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 249 | + toggleDebugItem.addItemListener(this); |
---|
| 250 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 251 | + |
---|
| 252 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 253 | + toggleFrustumItem.addItemListener(this); |
---|
| 254 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 255 | + |
---|
| 256 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 257 | + toggleFootContactItem.addItemListener(this); |
---|
| 258 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 259 | + |
---|
| 260 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 261 | + toggleTimelineItem.addItemListener(this); |
---|
| 262 | + } |
---|
| 263 | + |
---|
| 264 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 265 | +// toggleRootItem.addItemListener(this); |
---|
| 266 | +// toggleRootItem.setState(false); |
---|
| 267 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 268 | +// animationItem.addItemListener(this); |
---|
| 269 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 270 | + cameraMenu.add("-"); |
---|
| 271 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 272 | + editCameraItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
| 276 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 277 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 278 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 279 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 280 | + oe.cameraMenu.add("-"); |
---|
| 281 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 282 | + openWindowItem.addActionListener(this); |
---|
| 283 | + editLeafItem.addActionListener(this); |
---|
| 284 | + lookAtItem.addActionListener(this); |
---|
| 285 | + //lookFromItem.addActinoListener(this); |
---|
| 286 | + //switchViewItem.addActionListener(this); |
---|
| 287 | + } |
---|
| 288 | + |
---|
192 | 289 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
193 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
194 | | - resetMeshItem.addActionListener(this); |
---|
195 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
196 | | - stepAllItem.addActionListener(this); |
---|
| 290 | + if (Globals.ADVANCED) |
---|
| 291 | + { |
---|
197 | 292 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 293 | revertMeshItem.addActionListener(this); |
---|
199 | 294 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 295 | resetreferencesItem.addActionListener(this); |
---|
201 | 296 | menu.add("-"); |
---|
| 297 | + } |
---|
202 | 298 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 299 | overwriteGeoItem.addActionListener(this); |
---|
204 | 300 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 306 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 307 | overwriteUVItem.addActionListener(this); |
---|
212 | 308 | menu.add("-"); |
---|
| 309 | + if (Globals.ADVANCED) |
---|
| 310 | + { |
---|
213 | 311 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 312 | generateMeshItem.addActionListener(this); |
---|
215 | 313 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 314 | poseMeshItem.addActionListener(this); |
---|
217 | 315 | menu.add("-"); |
---|
| 316 | + } |
---|
218 | 317 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 318 | resetsupportItem.addActionListener(this); |
---|
220 | 319 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 320 | linkverticesItem.addActionListener(this); |
---|
| 321 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 322 | + relinkverticesItem.addActionListener(this); |
---|
| 323 | + |
---|
| 324 | + if (Globals.ADVANCED) |
---|
| 325 | + { |
---|
222 | 326 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
223 | 327 | setMasterItem.addActionListener(this); |
---|
| 328 | + } |
---|
224 | 329 | |
---|
225 | 330 | oe.menuBar.add(menu = new Menu("Group")); |
---|
226 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
227 | | - grabItem.addActionListener(this); |
---|
228 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
229 | | - frontItem.addActionListener(this); |
---|
| 331 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 332 | +// grabItem.addActionListener(this); |
---|
230 | 333 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 334 | backItem.addActionListener(this); |
---|
232 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
233 | | - compositeItem.addActionListener(this); |
---|
234 | | - menu.add("-"); |
---|
235 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
236 | | - randomItem.addActionListener(this); |
---|
237 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
238 | | - physicsItem.addActionListener(this); |
---|
239 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
240 | | - frameselectorItem.addActionListener(this); |
---|
| 335 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 336 | + frontItem.addActionListener(this); |
---|
| 337 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 338 | +// compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
| 342 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 343 | + hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
| 345 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 346 | + ungroupItem.addActionListener(this); |
---|
| 347 | + |
---|
| 348 | +// menu.add("-"); |
---|
| 349 | +// |
---|
| 350 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 351 | +// switchItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
241 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
242 | 355 | switchGeoItem.addActionListener(this); |
---|
243 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
244 | 357 | switchTransfoItem.addActionListener(this); |
---|
245 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 358 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
246 | 359 | morphItem.addActionListener(this); |
---|
| 360 | + |
---|
| 361 | + menu.add("-"); |
---|
| 362 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 363 | + physicsItem.addActionListener(this); |
---|
| 364 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 365 | + frameselectorItem.addActionListener(this); |
---|
247 | 366 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
248 | 367 | scriptNodeItem.addActionListener(this); |
---|
249 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
250 | | - cameraItem.addActionListener(this); |
---|
| 368 | + } |
---|
251 | 369 | |
---|
252 | 370 | oe.menuBar.add(menu = new Menu("Object")); |
---|
253 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
254 | | - textureItem.addActionListener(this); |
---|
| 371 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 372 | +// textureItem.addActionListener(this); |
---|
| 373 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 374 | + billboardItem.addActionListener(this); |
---|
255 | 375 | csgItem = menu.add(new MenuItem("CSG")); |
---|
256 | 376 | csgItem.addActionListener(this); |
---|
257 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 377 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
258 | 378 | shadowXItem.addActionListener(this); |
---|
259 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 379 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
260 | 380 | shadowYItem.addActionListener(this); |
---|
261 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 381 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
262 | 382 | shadowZItem.addActionListener(this); |
---|
| 383 | + if (Globals.ADVANCED) |
---|
| 384 | + { |
---|
| 385 | + menu.add("-"); |
---|
263 | 386 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
264 | 387 | linkerItem.addActionListener(this); |
---|
265 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
266 | | - templateItem.addActionListener(this); |
---|
267 | 388 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
268 | 389 | attributeItem.addActionListener(this); |
---|
| 390 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 391 | + templateItem.addActionListener(this); |
---|
269 | 392 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
270 | 393 | pointflowItem.addActionListener(this); |
---|
| 394 | + } |
---|
271 | 395 | menu.add("-"); |
---|
272 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
273 | | - transformgeometryItem.addActionListener(this); |
---|
274 | 396 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
275 | 397 | resetTransformItem.addActionListener(this); |
---|
276 | 398 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
277 | 399 | resetCentroidItem.addActionListener(this); |
---|
278 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
279 | | - ungroupItem.addActionListener(this); |
---|
| 400 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 401 | + resetCentroidXZItem.addActionListener(this); |
---|
| 402 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 403 | + transformGeometryItem.addActionListener(this); |
---|
| 404 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 405 | + transformChildrenItem.addActionListener(this); |
---|
280 | 406 | |
---|
281 | 407 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
282 | 408 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
285 | 411 | genNormalsORGANItem.addActionListener(this); |
---|
286 | 412 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
287 | 413 | genNormalsCADItem.addActionListener(this); |
---|
| 414 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 415 | + genNormalsMESHItem.addActionListener(this); |
---|
| 416 | + if (Globals.ADVANCED) |
---|
| 417 | + { |
---|
| 418 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 419 | + genNormalsMINEItem.addActionListener(this); |
---|
| 420 | + } |
---|
288 | 421 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
289 | 422 | stripifyItem.addActionListener(this); |
---|
290 | 423 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
306 | 439 | reduce34MeshItem.addActionListener(this); |
---|
307 | 440 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 441 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 442 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 443 | clipMeshItem.addActionListener(this); |
---|
| 444 | + |
---|
| 445 | + if (Globals.ADVANCED) |
---|
| 446 | + { |
---|
| 447 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 448 | + smoothMeshItem.addActionListener(this); |
---|
| 449 | + } |
---|
313 | 450 | |
---|
314 | 451 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
315 | 452 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
316 | 453 | clearMaterialsItem.addActionListener(this); |
---|
| 454 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 455 | + resetAllItem.addActionListener(this); |
---|
| 456 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 457 | + stepAllItem.addActionListener(this); |
---|
317 | 458 | menu.add("-"); |
---|
318 | 459 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
319 | 460 | liveleavesItem.addActionListener(this); |
---|
320 | 461 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
321 | 462 | unliveleavesItem.addActionListener(this); |
---|
| 463 | + if (Globals.ADVANCED) |
---|
| 464 | + { |
---|
322 | 465 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
323 | 466 | supportleavesItem.addActionListener(this); |
---|
324 | 467 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
325 | 468 | unsupportleavesItem.addActionListener(this); |
---|
| 469 | + } |
---|
326 | 470 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
327 | 471 | hideleavesItem.addActionListener(this); |
---|
328 | 472 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
331 | 475 | markleavesItem.addActionListener(this); |
---|
332 | 476 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
333 | 477 | unmarkleavesItem.addActionListener(this); |
---|
| 478 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 479 | + rewindleavesItem.addActionListener(this); |
---|
| 480 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 481 | + unrewindleavesItem.addActionListener(this); |
---|
| 482 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 483 | + randomleavesItem.addActionListener(this); |
---|
| 484 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 485 | + unrandomleavesItem.addActionListener(this); |
---|
334 | 486 | menu.add("-"); |
---|
335 | 487 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
336 | 488 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
366 | 518 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
367 | 519 | sortbynameItem.addActionListener(this); |
---|
368 | 520 | menu.add("-"); |
---|
| 521 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 522 | + shareGeometriesItem.addActionListener(this); |
---|
| 523 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 524 | + mergeGeometriesItem.addActionListener(this); |
---|
| 525 | + if (Globals.ADVANCED) |
---|
| 526 | + { |
---|
| 527 | + // Pretty much the same as duplicate and clone. |
---|
369 | 528 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
370 | 529 | extractGeometriesItem.addActionListener(this); |
---|
371 | 530 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
372 | 531 | cloneGeometriesItem.addActionListener(this); |
---|
373 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
374 | | - shareGeometriesItem.addActionListener(this); |
---|
375 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
376 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 532 | + } |
---|
377 | 533 | |
---|
378 | 534 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
379 | 535 | buildCreateMenu(menu); |
---|
380 | 536 | |
---|
381 | | - |
---|
382 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
383 | | - importGFDItem = menu.add(new MenuItem("GraphreeD Object...")); |
---|
384 | | - importGFDItem.addActionListener(this); |
---|
385 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
386 | | - importVRMLX3DItem.addActionListener(this); |
---|
387 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
388 | | - importOBJItem.addActionListener(this); |
---|
389 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
390 | | - import3DSItem.addActionListener(this); |
---|
391 | | - |
---|
392 | 537 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
393 | 538 | buildToolsMenu(menu); |
---|
394 | 539 | } |
---|
395 | 540 | |
---|
396 | 541 | void SetupUI2(ObjEditor oe) |
---|
397 | 542 | { |
---|
| 543 | + // June 2019 |
---|
| 544 | + if (oe == null) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + //return; |
---|
| 548 | + } |
---|
| 549 | + |
---|
| 550 | + if (copy != group) |
---|
| 551 | + { |
---|
| 552 | + //super.SetupUI2(this); |
---|
| 553 | + } |
---|
| 554 | + |
---|
398 | 555 | //new Exception().printStackTrace(); |
---|
399 | 556 | |
---|
400 | 557 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
423 | 580 | oe.radioPanel.add(dummyButton); |
---|
424 | 581 | oe.buttonGroup.add(dummyButton); |
---|
425 | 582 | */ |
---|
426 | | - aConstraints.gridy += 1; |
---|
427 | | - oe.aConstraints.gridwidth = 1; |
---|
428 | | - oe.aConstraints.gridx = 0; |
---|
| 583 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 584 | + |
---|
| 585 | + copyOptionsPanel.preferredHeight = 1; |
---|
429 | 586 | |
---|
430 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 587 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
| 588 | + |
---|
| 589 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 590 | + //minButton.setToolTipText("Minimize window"); |
---|
| 591 | + //minButton.addActionListener(this); |
---|
| 592 | + |
---|
| 593 | + if (Globals.ADVANCED) |
---|
| 594 | + { |
---|
| 595 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + maxButton.setToolTipText("Maximize window"); |
---|
| 597 | + maxButton.addActionListener(this); |
---|
| 598 | + } |
---|
| 599 | + |
---|
| 600 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 601 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 602 | + fullButton.addActionListener(this); |
---|
| 603 | + |
---|
| 604 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 605 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 606 | + restoreCameraButton.addActionListener(this); |
---|
| 607 | + |
---|
| 608 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + undoButton.setToolTipText("Undo changes"); |
---|
| 610 | + undoButton.addActionListener(this); |
---|
| 611 | + undoButton.setEnabled(false); |
---|
| 612 | + |
---|
| 613 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 614 | + redoButton.setToolTipText("Redo changes"); |
---|
| 615 | + redoButton.addActionListener(this); |
---|
| 616 | + redoButton.setEnabled(false); |
---|
| 617 | + |
---|
| 618 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + saveButton.setToolTipText("Save changes"); |
---|
| 620 | + saveButton.addActionListener(this); |
---|
| 621 | + |
---|
| 622 | + copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 623 | + liveCB.setToolTipText("Enable animation"); |
---|
431 | 624 | liveCB.addItemListener(this); |
---|
432 | 625 | |
---|
433 | | - oe.aConstraints.gridx += 1; |
---|
434 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
435 | | - supportCB.addItemListener(this); |
---|
436 | | - |
---|
437 | | - // oe.aConstraints.gridx += 1; |
---|
438 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
439 | | - // localCB.addItemListener(this); |
---|
440 | | - |
---|
441 | | - oe.aConstraints.gridx += 1; |
---|
442 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
443 | | - crowdCB.addItemListener(this); |
---|
444 | | - |
---|
445 | | - oe.aConstraints.gridx += 1; |
---|
446 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
447 | | - smoothCB.addItemListener(this); |
---|
448 | | - |
---|
449 | | - oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 626 | + copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 627 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 628 | + oneStepButton.addActionListener(this); |
---|
| 629 | + |
---|
| 630 | + copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 631 | + fastCB.setToolTipText("Fast mode"); |
---|
451 | 632 | fastCB.addItemListener(this); |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
454 | | - slowCB.addItemListener(this); |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
457 | | - boxCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
461 | | -// speakerMocapCB.addItemListener(this); |
---|
462 | | - |
---|
463 | | - if (false) |
---|
464 | | - { |
---|
465 | | - // handled in scripts |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
468 | | - speakerCameraCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
472 | | - speakerFocusCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
476 | | - smoothfocusCB.addItemListener(this); |
---|
477 | | - } |
---|
478 | | - |
---|
479 | | -//oe.aConstraints.gridx += 1; |
---|
480 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
481 | | -// debugCB.addItemListener(this); |
---|
482 | | - |
---|
483 | | - oe.aConstraints.gridx += 1; |
---|
484 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
485 | | - oeilCB.addItemListener(this); |
---|
486 | | - |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
489 | | - lookAtCB.addItemListener(this); |
---|
490 | | - |
---|
491 | | - oe.aConstraints.gridx += 1; |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
493 | | - trackCB.addItemListener(this); |
---|
494 | | - |
---|
495 | | - oe.aConstraints.gridx += 1; |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 633 | + |
---|
| 634 | + //oe.toolboxPanel.Return(); |
---|
| 635 | + |
---|
| 636 | + copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 637 | + screenfitButton.setToolTipText("Screen fit"); |
---|
497 | 638 | screenfitButton.addActionListener(this); |
---|
498 | | - oe.aConstraints.gridx += 1; |
---|
| 639 | + |
---|
| 640 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 641 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 642 | +// trackCB.addItemListener(this); |
---|
| 643 | + |
---|
499 | 644 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
500 | 645 | // screenfitpointButton.addActionListener(this); |
---|
501 | | -// oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
503 | | - snapobjectButton.addActionListener(this); |
---|
504 | | - oe.aConstraints.gridx += 1; |
---|
505 | 646 | |
---|
506 | | - //aConstraints.gridx = 0; |
---|
507 | | - //aConstraints.gridy += 1; |
---|
508 | | - oe.aConstraints.weighty = 0; |
---|
509 | | - oe.aConstraints.gridwidth = 1; |
---|
510 | | - |
---|
511 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
512 | | - flashSelectionButton.addActionListener(this); |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.aConstraints.weighty = 0; |
---|
515 | | - oe.aConstraints.gridwidth = 1; |
---|
| 647 | + if (Globals.ADVANCED) |
---|
| 648 | + { |
---|
| 649 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + snapobjectButton.addActionListener(this); |
---|
| 651 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 652 | + } |
---|
| 653 | + |
---|
| 654 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
516 | 655 | |
---|
517 | | - // |
---|
518 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 656 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + twoButton.setToolTipText("Show center view only"); |
---|
519 | 658 | twoButton.addActionListener(this); |
---|
520 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 659 | + this.fullscreenLayout = twoButton; |
---|
| 660 | + |
---|
| 661 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 662 | fourButton.addActionListener(this); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 663 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 664 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 665 | + sixButton.setToolTipText("2-column layout left"); |
---|
523 | 666 | sixButton.addActionListener(this); |
---|
524 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 667 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 668 | + threeButton.setToolTipText("2-column layout right"); |
---|
525 | 669 | threeButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 670 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 671 | + sevenButton.setToolTipText("3-column layout"); |
---|
527 | 672 | sevenButton.addActionListener(this); |
---|
528 | 673 | // |
---|
529 | 674 | |
---|
530 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 675 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 676 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
531 | 677 | rootButton.addActionListener(this); |
---|
532 | | - oe.aConstraints.gridx += 1; |
---|
533 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 678 | + |
---|
| 679 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 680 | + closeButton.setToolTipText("Close tab"); |
---|
534 | 681 | closeButton.addActionListener(this); |
---|
535 | 682 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
536 | 683 | //clearButton.addActionListener(this); |
---|
537 | | - oe.aConstraints.gridx += 1; |
---|
538 | | - |
---|
539 | | - oe.aConstraints.gridx = 1; // |
---|
540 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
541 | | - editButton.addActionListener(this); |
---|
542 | | - oe.aConstraints.gridx += 1; |
---|
543 | | - oe.aConstraints.weighty = 0; |
---|
544 | | - oe.aConstraints.gridwidth = 1; |
---|
545 | 684 | |
---|
546 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 685 | + // INSERT |
---|
| 686 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 687 | + gridButton.setToolTipText("Create grid"); |
---|
| 688 | + gridButton.addActionListener(this); |
---|
| 689 | + |
---|
| 690 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 691 | + boxButton.setToolTipText("Create box"); |
---|
| 692 | + boxButton.addActionListener(this); |
---|
| 693 | + |
---|
| 694 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 696 | + sphereButton.addActionListener(this); |
---|
| 697 | + |
---|
| 698 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + coneButton.setToolTipText("Create cone"); |
---|
| 700 | + coneButton.addActionListener(this); |
---|
| 701 | + |
---|
| 702 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | + torusButton.setToolTipText("Create torus"); |
---|
| 704 | + torusButton.addActionListener(this); |
---|
| 705 | + |
---|
| 706 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 708 | + superButton.addActionListener(this); |
---|
| 709 | + |
---|
| 710 | + if (Globals.ADVANCED) |
---|
| 711 | + { |
---|
| 712 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 714 | + kleinButton.addActionListener(this); |
---|
| 715 | + } |
---|
| 716 | + |
---|
| 717 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 718 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 719 | + particlesButton.addActionListener(this); |
---|
| 720 | + |
---|
| 721 | + oe.toolboxPanel.Return(); |
---|
| 722 | + |
---|
| 723 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + groupButton.setToolTipText("Create group"); |
---|
| 725 | + groupButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 728 | + compositeButton.setToolTipText("Create composite"); |
---|
| 729 | + compositeButton.addActionListener(this); |
---|
| 730 | + |
---|
| 731 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 732 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 733 | + switchButton.addActionListener(this); |
---|
| 734 | + |
---|
| 735 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | + loopButton.setToolTipText("Create loop"); |
---|
| 737 | + loopButton.addActionListener(this); |
---|
| 738 | + |
---|
| 739 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 740 | + textureButton.setToolTipText("Create texture"); |
---|
| 741 | + textureButton.addActionListener(this); |
---|
| 742 | + |
---|
| 743 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 745 | + overlayButton.addActionListener(this); |
---|
| 746 | + |
---|
| 747 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + lightButton.setToolTipText("Create light"); |
---|
| 749 | + lightButton.addActionListener(this); |
---|
| 750 | + |
---|
| 751 | + for (int i=6; --i>=0;) |
---|
| 752 | + { |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 755 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 756 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 757 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 758 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 759 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 760 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 761 | + } |
---|
| 762 | + |
---|
| 763 | + // EDIT panel |
---|
| 764 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + editButton.setToolTipText("Pin selection controls"); |
---|
| 766 | + editButton.addActionListener(this); |
---|
| 767 | + |
---|
| 768 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
547 | 770 | uneditButton.addActionListener(this); |
---|
548 | 771 | |
---|
549 | | - oe.aConstraints.gridx += 1; |
---|
550 | | - oe.aConstraints.weighty = 0; |
---|
551 | | - oe.aConstraints.gridwidth = 1; |
---|
552 | | - |
---|
553 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
554 | | - clearPanelButton.addActionListener(this); |
---|
555 | | - |
---|
556 | | - oe.aConstraints.gridx += 1; |
---|
557 | | - oe.aConstraints.weighty = 0; |
---|
558 | | - oe.aConstraints.gridwidth = 1; |
---|
559 | | - |
---|
560 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 772 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 773 | + allParamsButton.setToolTipText("Show all controle"); |
---|
561 | 774 | allParamsButton.addActionListener(this); |
---|
562 | 775 | |
---|
563 | | - oe.aConstraints.gridx += 1; |
---|
564 | | - oe.aConstraints.weighty = 0; |
---|
565 | | - oe.aConstraints.gridwidth = 1; |
---|
566 | | - |
---|
567 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 776 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 777 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 778 | + clearPanelButton.addActionListener(this); |
---|
| 779 | + |
---|
| 780 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 781 | + unselectButton.setToolTipText("Unselect"); |
---|
568 | 782 | unselectButton.addActionListener(this); |
---|
569 | 783 | |
---|
| 784 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 786 | + flashSelectionButton.addActionListener(this); |
---|
| 787 | + |
---|
| 788 | + editCommandsPanel.preferredHeight = 1; |
---|
| 789 | + |
---|
| 790 | + SetPinStates(false); |
---|
| 791 | +// oe.treePanel.add(commandsPanel); |
---|
| 792 | +// oe.treePanel.Return(); |
---|
| 793 | + |
---|
570 | 794 | // oe.aConstraints.gridx += 1; |
---|
571 | 795 | // oe.aConstraints.weighty = 0; |
---|
572 | 796 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
578 | 802 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
579 | 803 | // gcButton.addActionListener(this); |
---|
580 | 804 | |
---|
581 | | - oe.aConstraints.gridx = 0; |
---|
582 | | - oe.aConstraints.gridy += 1; |
---|
583 | | - |
---|
584 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
585 | | - oe.aConstraints.gridwidth = 100; |
---|
586 | | - // oe.aConstraints.gridheight = 100; |
---|
587 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
588 | | - oe.aConstraints.gridheight = 1; |
---|
589 | | - oe.aConstraints.weighty = 0.5; |
---|
590 | | - oe.aConstraints.gridx = 0; |
---|
591 | | - JScrollPane jSP; |
---|
| 805 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 806 | + |
---|
| 807 | + JScrollPane jSP; |
---|
592 | 808 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
593 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 809 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
594 | 810 | ResetModel(); |
---|
595 | | - oe.aConstraints.weighty = 0.5; |
---|
596 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
597 | | - oe.aConstraints.gridy += 1; |
---|
598 | | - oe.aConstraints.gridwidth = 1; |
---|
599 | | - |
---|
600 | | - oe.aConstraints.weighty = 0; |
---|
601 | | - oe.aConstraints.gridwidth = 2; |
---|
602 | | - |
---|
603 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
604 | | - colorCB.addItemListener(this); |
---|
605 | | - oe.aConstraints.gridx += 2; |
---|
606 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
607 | | - materialCB.addItemListener(this); |
---|
608 | | - oe.aConstraints.gridx += 2; |
---|
609 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
610 | | - textureCB.addItemListener(this); |
---|
611 | | - |
---|
612 | | - oe.aConstraints.gridx = 0; |
---|
613 | | - oe.aConstraints.gridy += 1; |
---|
614 | 811 | |
---|
| 812 | + oe.treePanel.add(jSPPanel); |
---|
| 813 | + oe.treePanel.Return(); |
---|
| 814 | + |
---|
| 815 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 816 | + oe.treePanel.Return(); |
---|
| 817 | + |
---|
| 818 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 819 | +// mainPanel.setResizeWeight(0.5); |
---|
| 820 | + |
---|
615 | 821 | //jList.addListSelectionListener(this); |
---|
616 | 822 | oe.jTree.addTreeSelectionListener(this); |
---|
617 | 823 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
633 | 839 | radio.layout = sevenButton; |
---|
634 | 840 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
635 | 841 | } |
---|
| 842 | + |
---|
| 843 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 844 | + { |
---|
| 845 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 846 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 847 | + colorCB.addItemListener(this); |
---|
| 848 | + |
---|
| 849 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 850 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 851 | + materialCB.addItemListener(this); |
---|
| 852 | + |
---|
| 853 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 854 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 855 | + textureCB.addItemListener(this); |
---|
| 856 | + |
---|
| 857 | + panel.Return(); |
---|
| 858 | + |
---|
| 859 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 860 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 861 | + boxCB.addItemListener(this); |
---|
| 862 | + |
---|
| 863 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 864 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 865 | + zoomBoxCB.addItemListener(this); |
---|
| 866 | + |
---|
| 867 | + if (true) // Globals.ADVANCED) |
---|
| 868 | + { |
---|
| 869 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 870 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 871 | +// supportCB.addItemListener(this); |
---|
| 872 | + |
---|
| 873 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 874 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 875 | + freezeCB.addItemListener(this); |
---|
| 876 | + |
---|
| 877 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 878 | + // localCB.addItemListener(this); |
---|
| 879 | + |
---|
| 880 | + panel.Return(); |
---|
| 881 | + |
---|
| 882 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 883 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 884 | + crowdCB.addItemListener(this); |
---|
| 885 | + |
---|
| 886 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 887 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 888 | + smoothCB.addItemListener(this); |
---|
| 889 | + |
---|
| 890 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 891 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 892 | + slowCB.addItemListener(this); |
---|
| 893 | + |
---|
| 894 | +// constraints.gridy += 1; |
---|
| 895 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 896 | +// speakerMocapCB.addItemListener(this); |
---|
| 897 | + |
---|
| 898 | + panel.Return(); |
---|
| 899 | + |
---|
| 900 | + if (false) |
---|
| 901 | + { |
---|
| 902 | + // handled in scripts |
---|
| 903 | + //constraints.gridy += 1; |
---|
| 904 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 905 | + speakerCameraCB.addItemListener(this); |
---|
| 906 | + |
---|
| 907 | + //constraints.gridy += 1; |
---|
| 908 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 909 | + speakerFocusCB.addItemListener(this); |
---|
| 910 | + |
---|
| 911 | + //constraints.gridy += 1; |
---|
| 912 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 913 | + smoothfocusCB.addItemListener(this); |
---|
| 914 | + panel.Return(); |
---|
| 915 | + } |
---|
| 916 | + |
---|
| 917 | +//constraints.gridx += 1; |
---|
| 918 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 919 | +// debugCB.addItemListener(this); |
---|
| 920 | + |
---|
| 921 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 922 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 923 | + trackCB.addItemListener(this); |
---|
| 924 | + |
---|
| 925 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 926 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
| 927 | + oeilCB.addItemListener(this); |
---|
| 928 | + |
---|
| 929 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 930 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 931 | + shadowCB.addItemListener(this); |
---|
| 932 | + |
---|
| 933 | + panel.Return(); |
---|
| 934 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 935 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 936 | + toggleTextureCB.addItemListener(this); |
---|
| 937 | + |
---|
| 938 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 939 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 940 | + toggleSwitchCB.addItemListener(this); |
---|
| 941 | + |
---|
| 942 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 943 | + autosaveCB.setToolTipText("On structure change"); |
---|
| 944 | + autosaveCB.addItemListener(this); |
---|
| 945 | + |
---|
| 946 | + panel.Return(); |
---|
| 947 | + if (Globals.ADVANCED) |
---|
| 948 | + { |
---|
| 949 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 950 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 951 | + lookAtCB.addItemListener(this); |
---|
| 952 | + } |
---|
| 953 | + |
---|
| 954 | + } |
---|
| 955 | + |
---|
| 956 | + cGridBag fill = new cGridBag(); |
---|
| 957 | + fill.preferredHeight = 200; |
---|
| 958 | + cGridBag fill2 = new cGridBag(); |
---|
| 959 | + fill2.preferredHeight = 200; |
---|
| 960 | + cGridBag fill3 = new cGridBag(); |
---|
| 961 | + fill3.preferredHeight = 200; |
---|
| 962 | + |
---|
| 963 | + panel.add(fill); |
---|
| 964 | + panel.add(fill2); |
---|
| 965 | + panel.add(fill3); |
---|
| 966 | + |
---|
| 967 | + } |
---|
636 | 968 | |
---|
637 | 969 | void EditObject(Object3D obj) |
---|
638 | 970 | { |
---|
639 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
640 | | - dummyButton.SetObject(obj); |
---|
641 | | - dummyButton.layout = sevenButton; |
---|
642 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
643 | | - dummyButton.addActionListener(this); |
---|
644 | | - radioPanel.add(dummyButton); |
---|
645 | | - buttonGroup.add(dummyButton); |
---|
646 | | - dummyButton.doClick(); |
---|
| 971 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 972 | + |
---|
| 973 | + // Patch to avoid bug with transparency. |
---|
| 974 | + radioButton.hadMaterial = obj.material != null; |
---|
| 975 | + if (!radioButton.hadMaterial) |
---|
| 976 | + { |
---|
| 977 | + obj.material = new cMaterial(); |
---|
| 978 | + } |
---|
| 979 | + |
---|
| 980 | + radioButton.SetObject(obj); |
---|
| 981 | + radioButton.layout = sevenButton; |
---|
| 982 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 983 | + radioButton.addActionListener(this); |
---|
| 984 | + radioPanel.add(radioButton); |
---|
| 985 | + buttonGroup.add(radioButton); |
---|
| 986 | + radioButton.doClick(); |
---|
647 | 987 | } |
---|
| 988 | + |
---|
648 | 989 | void SetupViews(ObjEditor oe) |
---|
649 | 990 | { |
---|
| 991 | + theFrame = this; |
---|
| 992 | + |
---|
650 | 993 | oe.SetupViews(); |
---|
651 | 994 | |
---|
652 | 995 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
655 | 998 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
656 | 999 | } |
---|
657 | 1000 | |
---|
658 | | - JCheckBox liveCB; |
---|
659 | | - JCheckBox supportCB; |
---|
660 | | - JCheckBox localCB; |
---|
661 | | - JCheckBox crowdCB; |
---|
662 | | - JCheckBox smoothCB; |
---|
663 | | - JCheckBox fastCB; |
---|
664 | | - JCheckBox slowCB; |
---|
665 | | - JCheckBox boxCB; |
---|
666 | | - JCheckBox trackCB; |
---|
667 | | - JCheckBox smoothfocusCB; |
---|
| 1001 | + cToggleButton liveCB; |
---|
| 1002 | + cCheckBox supportCB; |
---|
| 1003 | + cCheckBox localCB; |
---|
| 1004 | + cCheckBox crowdCB; |
---|
| 1005 | + cCheckBox smoothCB; |
---|
| 1006 | + cToggleButton fastCB; |
---|
| 1007 | + cCheckBox slowCB; |
---|
| 1008 | + cCheckBox boxCB; |
---|
| 1009 | + cCheckBox zoomBoxCB; |
---|
| 1010 | + cCheckBox freezeCB; |
---|
| 1011 | + //cToggleButton trackCB; |
---|
| 1012 | + cCheckBox trackCB; |
---|
| 1013 | + cCheckBox smoothfocusCB; |
---|
668 | 1014 | // JCheckBox speakerMocapCB; |
---|
669 | | - JCheckBox speakerCameraCB; |
---|
670 | | - JCheckBox speakerFocusCB; |
---|
671 | | - JCheckBox debugCB; |
---|
672 | | - JCheckBox oeilCB; |
---|
673 | | - JCheckBox lookAtCB; |
---|
| 1015 | + cCheckBox speakerCameraCB; |
---|
| 1016 | + cCheckBox speakerFocusCB; |
---|
| 1017 | + cCheckBox debugCB; |
---|
| 1018 | + |
---|
| 1019 | + cCheckBox oeilCB; |
---|
| 1020 | + cCheckBox shadowCB; |
---|
| 1021 | + cCheckBox autosaveCB; |
---|
| 1022 | + cCheckBox lookAtCB; |
---|
674 | 1023 | |
---|
675 | 1024 | // static int COLOR = 1; |
---|
676 | 1025 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
678 | 1027 | |
---|
679 | 1028 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
680 | 1029 | |
---|
681 | | - JCheckBox colorCB; |
---|
682 | | - JCheckBox materialCB; |
---|
683 | | - JCheckBox textureCB; |
---|
| 1030 | + cCheckBox colorCB; |
---|
| 1031 | + cCheckBox materialCB; |
---|
| 1032 | + cCheckBox textureCB; |
---|
684 | 1033 | |
---|
685 | 1034 | public void itemStateChanged(ItemEvent e) |
---|
686 | 1035 | { |
---|
.. | .. |
---|
705 | 1054 | dropAttributes |= Object3D.TEXTURE; |
---|
706 | 1055 | else |
---|
707 | 1056 | dropAttributes &= ~Object3D.TEXTURE; |
---|
708 | | - } |
---|
709 | | - else if(e.getSource() == liveCB) |
---|
| 1057 | + } else if(e.getSource() == liveCB) |
---|
710 | 1058 | { |
---|
711 | 1059 | cameraView.ToggleLive(); |
---|
| 1060 | + refreshContents(false); |
---|
712 | 1061 | } |
---|
713 | 1062 | else if(e.getSource() == supportCB) |
---|
714 | 1063 | { |
---|
.. | .. |
---|
744 | 1093 | cameraView.repaint(); |
---|
745 | 1094 | // refreshContents(); |
---|
746 | 1095 | } |
---|
| 1096 | + else if(e.getSource() == zoomBoxCB) |
---|
| 1097 | + { |
---|
| 1098 | + cameraView.ToggleZoomBoxMode(); |
---|
| 1099 | + } |
---|
747 | 1100 | else if(e.getSource() == smoothfocusCB) |
---|
748 | 1101 | { |
---|
749 | 1102 | cameraView.ToggleSmoothFocus(); |
---|
.. | .. |
---|
769 | 1122 | { |
---|
770 | 1123 | cameraView.ToggleOeil(); |
---|
771 | 1124 | } |
---|
| 1125 | + else if(e.getSource() == shadowCB) |
---|
| 1126 | + { |
---|
| 1127 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1128 | + } |
---|
| 1129 | + else if(e.getSource() == freezeCB) |
---|
| 1130 | + { |
---|
| 1131 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1132 | + } |
---|
| 1133 | + else if(e.getSource() == autosaveCB) |
---|
| 1134 | + { |
---|
| 1135 | + Globals.SAVEONMAKE ^= true; |
---|
| 1136 | + } |
---|
772 | 1137 | else if(e.getSource() == lookAtCB) |
---|
773 | 1138 | { |
---|
774 | 1139 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
785 | 1150 | |
---|
786 | 1151 | /**/ |
---|
787 | 1152 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
788 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1153 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1154 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
789 | 1155 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
790 | 1156 | // We can't move the root node or an empty selection |
---|
791 | 1157 | return; |
---|
.. | .. |
---|
857 | 1223 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
858 | 1224 | // return; |
---|
859 | 1225 | // } |
---|
860 | | - if (string.charAt(0) == '/') |
---|
| 1226 | + |
---|
| 1227 | + // File path for Mac and Windows |
---|
| 1228 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
861 | 1229 | { |
---|
862 | 1230 | // file(s) |
---|
863 | 1231 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
884 | 1252 | |
---|
885 | 1253 | flashIt = false; |
---|
886 | 1254 | CameraPane pane = (CameraPane) target; |
---|
887 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1255 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
888 | 1256 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
889 | 1257 | |
---|
890 | 1258 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
900 | 1268 | |
---|
901 | 1269 | assert target == objEditor.jTree; |
---|
902 | 1270 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1271 | + Object3D destinationLeaf; |
---|
903 | 1272 | try { |
---|
904 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1273 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
905 | 1274 | } catch (Exception e) { |
---|
906 | 1275 | System.out.println("destinationPath : " + destinationPath); |
---|
907 | 1276 | return; |
---|
908 | 1277 | } |
---|
909 | 1278 | |
---|
910 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1279 | + for (int i=group.selection.size(); --i>=0;) |
---|
911 | 1280 | { |
---|
| 1281 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1282 | + |
---|
| 1283 | + // Cannot move into itself |
---|
| 1284 | + if (child == destinationLeaf) |
---|
| 1285 | + return; |
---|
| 1286 | + } |
---|
| 1287 | + |
---|
| 1288 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1289 | +// { |
---|
912 | 1290 | loadClipboard(true); |
---|
913 | 1291 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
914 | | - pasteInto(false); |
---|
915 | | - } else { |
---|
916 | | - loadClipboard(false); |
---|
917 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
918 | | - pasteInto(false); // true); // ??? |
---|
919 | | - } |
---|
| 1292 | + pasteInto(false, false); |
---|
| 1293 | +// } else { |
---|
| 1294 | +// loadClipboard(false); |
---|
| 1295 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1296 | +// pasteInto(false, false); // true); // ??? |
---|
| 1297 | +// } |
---|
920 | 1298 | } |
---|
921 | 1299 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
922 | 1300 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1021 | 1399 | { |
---|
1022 | 1400 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1023 | 1401 | //heightFieldItem.addActionListener(this); |
---|
1024 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1025 | | - gridItem.addActionListener(this); |
---|
1026 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1027 | | - rectoidItem.addActionListener(this); |
---|
1028 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1029 | | - ellipsoidItem.addActionListener(this); |
---|
1030 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1031 | | - coneItem.addActionListener(this); |
---|
1032 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1033 | | - torusItem.addActionListener(this); |
---|
1034 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1035 | | - superItem.addActionListener(this); |
---|
1036 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1037 | | - particleItem.addActionListener(this); |
---|
| 1402 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1403 | +// gridItem.addActionListener(this); |
---|
| 1404 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1405 | +// rectoidItem.addActionListener(this); |
---|
| 1406 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1407 | +// ellipsoidItem.addActionListener(this); |
---|
| 1408 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1409 | +// coneItem.addActionListener(this); |
---|
| 1410 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1411 | +// torusItem.addActionListener(this); |
---|
| 1412 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1413 | +// superItem.addActionListener(this); |
---|
| 1414 | + |
---|
| 1415 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1416 | + cameraItem.addActionListener(this); |
---|
| 1417 | + |
---|
| 1418 | + if (!Globals.ADVANCED) |
---|
| 1419 | + { |
---|
| 1420 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1421 | + kleinItem.addActionListener(this); |
---|
| 1422 | + } |
---|
| 1423 | + |
---|
| 1424 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1425 | +// particleItem.addActionListener(this); |
---|
| 1426 | + if (Globals.ADVANCED) |
---|
| 1427 | + { |
---|
1038 | 1428 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1039 | 1429 | ragdollItem.addActionListener(this); |
---|
1040 | 1430 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1041 | 1431 | ragdoll2Item.addActionListener(this); |
---|
| 1432 | + } |
---|
1042 | 1433 | menu.add("-"); |
---|
1043 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1434 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1044 | 1435 | meshItem.addActionListener(this); |
---|
1045 | 1436 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1046 | 1437 | // meshGroupItem.addActionListener(this); |
---|
| 1438 | + if (Globals.ADVANCED) |
---|
| 1439 | + { |
---|
1047 | 1440 | springItem = menu.add(new MenuItem("Spring")); |
---|
1048 | 1441 | springItem.addActionListener(this); |
---|
1049 | 1442 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1050 | 1443 | flagItem.addActionListener(this); |
---|
1051 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1052 | | - bezierItem.addActionListener(this); |
---|
1053 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1054 | | - checkerItem.addActionListener(this); |
---|
1055 | 1444 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1056 | 1445 | blobItem.addActionListener(this); |
---|
1057 | 1446 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1058 | 1447 | latheItem.addActionListener(this); |
---|
1059 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1060 | | - lightItem.addActionListener(this); |
---|
| 1448 | + } |
---|
| 1449 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1450 | + bezierItem.addActionListener(this); |
---|
| 1451 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1452 | +// overlayItem.addActionListener(this); |
---|
| 1453 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1454 | +// lightItem.addActionListener(this); |
---|
1061 | 1455 | menu.add("-"); |
---|
1062 | 1456 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1063 | 1457 | //superLoopItem.addActionListener(this); |
---|
1064 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1065 | | - loopItem.addActionListener(this); |
---|
| 1458 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1459 | +// loopItem.addActionListener(this); |
---|
1066 | 1460 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1067 | 1461 | doubleItem.addActionListener(this); |
---|
| 1462 | + if (Globals.ADVANCED) |
---|
| 1463 | + { |
---|
1068 | 1464 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1069 | 1465 | tripleItem.addActionListener(this); |
---|
| 1466 | + } |
---|
1070 | 1467 | } |
---|
1071 | 1468 | |
---|
1072 | 1469 | void buildToolsMenu(Menu menu) |
---|
1073 | 1470 | { |
---|
1074 | 1471 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1075 | 1472 | animationItem.addItemListener(this); |
---|
1076 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1473 | + animationItem.setState(Globals.ANIMATION); |
---|
1077 | 1474 | |
---|
1078 | 1475 | menu.add("-"); |
---|
1079 | 1476 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1080 | 1477 | parseverticesItem.addActionListener(this); |
---|
1081 | 1478 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1082 | 1479 | textureFieldItem.addActionListener(this); |
---|
1083 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1480 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1084 | 1481 | alignItem.addActionListener(this); |
---|
1085 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1086 | | - mirrorItem.addActionListener(this); |
---|
1087 | 1482 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1088 | 1483 | reduceMorphItem.addActionListener(this); |
---|
1089 | 1484 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1090 | 1485 | reduce34MorphItem.addActionListener(this); |
---|
1091 | | - |
---|
| 1486 | + menu.add("-"); |
---|
1092 | 1487 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1093 | 1488 | computeAOItem.addActionListener(this); |
---|
1094 | | - menu.add("-"); |
---|
1095 | 1489 | |
---|
| 1490 | + if (Globals.ADVANCED) |
---|
| 1491 | + { |
---|
| 1492 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1493 | + mirrorItem.addActionListener(this); |
---|
| 1494 | + menu.add("-"); |
---|
1096 | 1495 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1097 | 1496 | memoryItem.addActionListener(this); |
---|
1098 | 1497 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1099 | 1498 | analyzeItem.addActionListener(this); |
---|
1100 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1499 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1101 | 1500 | dumpItem.addActionListener(this); |
---|
1102 | 1501 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1103 | 1502 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1106 | 1505 | resetParentItem.addActionListener(this); |
---|
1107 | 1506 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1108 | 1507 | repairParentItem.addActionListener(this); |
---|
| 1508 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1509 | + repairShadowItem.addActionListener(this); |
---|
1109 | 1510 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1110 | 1511 | invariantsItem.addActionListener(this); |
---|
1111 | 1512 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1113 | 1514 | menu.add("-"); |
---|
1114 | 1515 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1115 | 1516 | editScriptItem.addActionListener(this); |
---|
| 1517 | + } |
---|
1116 | 1518 | } |
---|
1117 | 1519 | |
---|
1118 | 1520 | void ScreenFit() |
---|
.. | .. |
---|
1235 | 1637 | shadow.material = new cMaterial(obj.material); |
---|
1236 | 1638 | shadow.material.diffuse = 0.0001f; |
---|
1237 | 1639 | shadow.material.specular = 0.0001f; |
---|
| 1640 | + //shadow.projectedVertices[1].x = 300; |
---|
1238 | 1641 | |
---|
1239 | 1642 | makeSomething(shadow); |
---|
1240 | 1643 | } |
---|
| 1644 | + |
---|
| 1645 | + private void ClearUnpinned() |
---|
| 1646 | + { |
---|
| 1647 | + //for (Object3D obj : listUI) |
---|
| 1648 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1649 | + { |
---|
| 1650 | + Object3D obj = listUI.elementAt(i); |
---|
| 1651 | + if (!obj.pinned) |
---|
| 1652 | + { |
---|
| 1653 | + obj.CloseUI(); |
---|
| 1654 | + listUI.remove(i); |
---|
| 1655 | + } |
---|
| 1656 | + } |
---|
| 1657 | + } |
---|
1241 | 1658 | |
---|
1242 | 1659 | /** |
---|
1243 | 1660 | * applyExample |
---|
.. | .. |
---|
1441 | 1858 | |
---|
1442 | 1859 | void Overwrite(int mask) |
---|
1443 | 1860 | { |
---|
1444 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1861 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1445 | 1862 | { |
---|
1446 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1863 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1447 | 1864 | |
---|
1448 | 1865 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1449 | 1866 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1466 | 1883 | // |
---|
1467 | 1884 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1468 | 1885 | { |
---|
| 1886 | + Object source = event.getSource(); |
---|
1469 | 1887 | /* |
---|
1470 | 1888 | if (event.getSource() == nameField) |
---|
1471 | 1889 | { |
---|
.. | .. |
---|
1477 | 1895 | } |
---|
1478 | 1896 | else |
---|
1479 | 1897 | */ |
---|
1480 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1898 | + if (source == lookAtItem || source == lookFromItem) |
---|
1481 | 1899 | { |
---|
1482 | 1900 | ScreenFit(); |
---|
1483 | 1901 | } else |
---|
1484 | | - if (event.getSource() == switchItem) |
---|
| 1902 | + if (source == switchViewItem) |
---|
1485 | 1903 | { |
---|
1486 | 1904 | cVector v1 = new cVector(); |
---|
1487 | 1905 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1490 | 1908 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1491 | 1909 | objEditor.cameraView.repaint(); |
---|
1492 | 1910 | } else |
---|
1493 | | - if (event.getSource() == rectoidItem) |
---|
| 1911 | + if (source == rectoidItem || source == boxButton) |
---|
1494 | 1912 | { |
---|
1495 | 1913 | makeSomething(new Box()); |
---|
1496 | 1914 | } else |
---|
1497 | | - if (event.getSource() == particleItem) |
---|
| 1915 | + if (source == particleItem || source == particlesButton) |
---|
1498 | 1916 | { |
---|
1499 | 1917 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1500 | 1918 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1515 | 1933 | applyExample(particleGeom, "SMOKE"); |
---|
1516 | 1934 | makeSomething(particleGeom); |
---|
1517 | 1935 | } else |
---|
1518 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1936 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1519 | 1937 | { |
---|
1520 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1938 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1521 | 1939 | |
---|
1522 | 1940 | ragdoll.toParent = LA.newMatrix(); |
---|
1523 | 1941 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1535 | 1953 | } else |
---|
1536 | 1954 | /* |
---|
1537 | 1955 | */ |
---|
1538 | | - if (event.getSource() == heightFieldItem) |
---|
| 1956 | + if (source == heightFieldItem) |
---|
1539 | 1957 | { |
---|
1540 | 1958 | Object3D obj = new Object3D(); |
---|
1541 | 1959 | |
---|
.. | .. |
---|
1573 | 1991 | |
---|
1574 | 1992 | makeSomething(obj); |
---|
1575 | 1993 | } else |
---|
1576 | | - if (event.getSource() == gridItem) |
---|
| 1994 | + if (source == gridItem || source == gridButton) |
---|
1577 | 1995 | { |
---|
1578 | 1996 | makeSomething(new Grid()); |
---|
1579 | 1997 | } else |
---|
1580 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1998 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1581 | 1999 | { |
---|
1582 | 2000 | makeSomething(new Sphere()); |
---|
1583 | 2001 | } else |
---|
1584 | | - if (event.getSource() == coneItem) |
---|
| 2002 | + if (source == coneItem || source == coneButton) |
---|
1585 | 2003 | { |
---|
1586 | 2004 | makeSomething(new Cone()); |
---|
1587 | 2005 | } else |
---|
1588 | | - if (event.getSource() == torusItem) |
---|
| 2006 | + if (source == torusItem || source == torusButton) |
---|
1589 | 2007 | { |
---|
1590 | 2008 | makeSomething(new Torus()); |
---|
1591 | 2009 | } else |
---|
1592 | | - if (event.getSource() == superItem) |
---|
| 2010 | + if (source == superItem || source == superButton) |
---|
1593 | 2011 | { |
---|
1594 | 2012 | makeSomething(new Superellipsoid()); |
---|
1595 | 2013 | } else |
---|
1596 | | - if (event.getSource() == blobItem) |
---|
| 2014 | + if (source == kleinItem || source == kleinButton) |
---|
| 2015 | + { |
---|
| 2016 | + makeSomething(new Klein()); |
---|
| 2017 | + } else |
---|
| 2018 | + if (source == blobItem) |
---|
1597 | 2019 | { |
---|
1598 | 2020 | Blob blob = new Blob(); |
---|
1599 | 2021 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1601 | 2023 | //blob.retile(); |
---|
1602 | 2024 | makeSomething(blob); |
---|
1603 | 2025 | } else |
---|
1604 | | - if (event.getSource() == latheItem) |
---|
| 2026 | + if (source == latheItem) |
---|
1605 | 2027 | { |
---|
1606 | 2028 | makeSomething(new Lathe()); |
---|
1607 | 2029 | } else |
---|
1608 | | - if (event.getSource() == bezierItem) |
---|
| 2030 | + if (source == bezierItem) |
---|
1609 | 2031 | { |
---|
1610 | 2032 | makeSomething(new BezierSurface()); |
---|
1611 | 2033 | } else |
---|
1612 | | - if (event.getSource() == checkerItem) |
---|
| 2034 | + if (source == overlayItem || source == overlayButton) |
---|
1613 | 2035 | { |
---|
1614 | 2036 | /* |
---|
1615 | 2037 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1624 | 2046 | */ |
---|
1625 | 2047 | makeSomething(new Checker()); |
---|
1626 | 2048 | } else |
---|
1627 | | - if (event.getSource() == meshItem) |
---|
| 2049 | + if (source == meshItem) |
---|
1628 | 2050 | { |
---|
1629 | 2051 | Object3D itemtomake = new Object3D(); |
---|
1630 | 2052 | Object3D child; |
---|
.. | .. |
---|
1645 | 2067 | makeSomething(child); |
---|
1646 | 2068 | } |
---|
1647 | 2069 | } else |
---|
1648 | | - if (event.getSource() == springItem) |
---|
| 2070 | + if (source == springItem) |
---|
1649 | 2071 | { |
---|
1650 | 2072 | cSpring s = new cSpring(); |
---|
1651 | 2073 | s.setup(); |
---|
1652 | 2074 | makeSomething(s); |
---|
1653 | 2075 | } else |
---|
1654 | | - if (event.getSource() == flagItem) |
---|
| 2076 | + if (source == flagItem) |
---|
1655 | 2077 | { |
---|
1656 | 2078 | cSpring s = new cFlag(); |
---|
1657 | 2079 | s.setup(); |
---|
1658 | 2080 | makeSomething(s); |
---|
1659 | 2081 | } else |
---|
1660 | | - if (event.getSource() == lightItem) |
---|
| 2082 | + if (source == lightItem || source == lightButton) |
---|
1661 | 2083 | { |
---|
1662 | 2084 | makeSomething(new Light()); |
---|
1663 | 2085 | } else |
---|
1664 | | - if (event.getSource() == csgItem) |
---|
| 2086 | + if (source == csgItem) |
---|
1665 | 2087 | { |
---|
1666 | 2088 | group(new CSG()); |
---|
1667 | 2089 | } else |
---|
1668 | | - if (event.getSource() == templateItem) |
---|
| 2090 | + if (source == templateItem) |
---|
1669 | 2091 | { |
---|
1670 | 2092 | group(new cTemplate()); |
---|
1671 | 2093 | } else |
---|
1672 | | - if (event.getSource() == attributeItem) |
---|
| 2094 | + if (source == attributeItem) |
---|
1673 | 2095 | { |
---|
1674 | 2096 | makeSomething(new Attribute()); |
---|
1675 | 2097 | } else |
---|
1676 | | - if (event.getSource() == pointflowItem) |
---|
| 2098 | + if (source == pointflowItem) |
---|
1677 | 2099 | { |
---|
1678 | 2100 | makeSomething(new PointFlow()); |
---|
1679 | 2101 | } else |
---|
.. | .. |
---|
1685 | 2107 | } else |
---|
1686 | 2108 | */ |
---|
1687 | 2109 | |
---|
1688 | | - if (event.getSource() == superLoopItem) |
---|
| 2110 | + if (source == superLoopItem) |
---|
1689 | 2111 | { |
---|
1690 | 2112 | Composite g = new cGroup(); |
---|
1691 | 2113 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1707 | 2129 | |
---|
1708 | 2130 | group(g); |
---|
1709 | 2131 | } else |
---|
1710 | | - if (event.getSource() == loopItem) |
---|
| 2132 | + if (source == loopItem || source == loopButton) |
---|
1711 | 2133 | { |
---|
1712 | 2134 | Composite csg = new GroupLeaf(); |
---|
1713 | 2135 | csg.count = 5; |
---|
1714 | 2136 | group(csg); |
---|
1715 | | - Composite child = new cGroup(); |
---|
| 2137 | + Composite child = new cGroup("Branch"); |
---|
1716 | 2138 | csg.addChild(child); |
---|
1717 | 2139 | child.addChild(csg); |
---|
1718 | 2140 | } else |
---|
1719 | | - if (event.getSource() == doubleItem) |
---|
| 2141 | + if (source == doubleItem) |
---|
1720 | 2142 | { |
---|
1721 | | - Composite csg = new GroupLeaf(); |
---|
| 2143 | + Composite csg = new GroupLeaf("Fork"); |
---|
1722 | 2144 | csg.count = 5; |
---|
1723 | 2145 | group(csg); |
---|
1724 | | - Composite child = new cGroup(); |
---|
| 2146 | + Composite child = new cGroup("Branch A"); |
---|
1725 | 2147 | csg.addChild(child); |
---|
1726 | 2148 | child.addChild(csg); |
---|
1727 | | - child = new cGroup(); |
---|
| 2149 | + child = new cGroup("Branch B"); |
---|
1728 | 2150 | csg.addChild(child); |
---|
1729 | 2151 | child.addChild(csg); |
---|
1730 | 2152 | } else |
---|
1731 | | - if (event.getSource() == tripleItem) |
---|
| 2153 | + if (source == tripleItem) |
---|
1732 | 2154 | { |
---|
1733 | | - Composite csg = new GroupLeaf(); |
---|
| 2155 | + Composite csg = new GroupLeaf("Trident"); |
---|
1734 | 2156 | csg.count = 4; |
---|
1735 | 2157 | group(csg); |
---|
1736 | 2158 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1743 | 2165 | csg.addChild(child); |
---|
1744 | 2166 | child.addChild(csg); |
---|
1745 | 2167 | } else |
---|
1746 | | - |
---|
1747 | | - if (event.getSource() == importGFDItem) |
---|
| 2168 | + if (source == computeAOItem) |
---|
1748 | 2169 | { |
---|
1749 | | - ImportGFD(); |
---|
| 2170 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 2171 | + Globals.theRenderer.repaint(); |
---|
1750 | 2172 | } else |
---|
1751 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1752 | | - { |
---|
1753 | | - ImportVRMLX3D(); |
---|
1754 | | - } else |
---|
1755 | | - if (event.getSource() == import3DSItem) |
---|
1756 | | - { |
---|
1757 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1758 | | - } else |
---|
1759 | | - if (event.getSource() == importOBJItem) |
---|
1760 | | - { |
---|
1761 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1762 | | - } else |
---|
1763 | | - if (event.getSource() == computeAOItem) |
---|
1764 | | - { |
---|
1765 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1766 | | - CameraPane.theRenderer.repaint(); |
---|
1767 | | - } else |
---|
1768 | | - if (event.getSource() == recompileItem) |
---|
| 2173 | + if (source == recompileItem) |
---|
1769 | 2174 | { |
---|
1770 | 2175 | Recompile(); |
---|
1771 | 2176 | refreshContents(); |
---|
1772 | 2177 | } else |
---|
1773 | | - if (event.getSource() == editScriptItem) |
---|
| 2178 | + if (source == editScriptItem) |
---|
1774 | 2179 | { |
---|
1775 | 2180 | OpenDialog(); |
---|
1776 | 2181 | refreshContents(); |
---|
1777 | 2182 | } else |
---|
1778 | | - if (event.getSource() == invariantsItem) |
---|
| 2183 | + if (source == invariantsItem) |
---|
1779 | 2184 | { |
---|
1780 | 2185 | System.out.println("Invariants:"); |
---|
1781 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 2186 | + Grafreed.grafreeD.universe.invariants(); |
---|
1782 | 2187 | } else |
---|
1783 | | - if (event.getSource() == memoryItem) |
---|
| 2188 | + if (source == memoryItem) |
---|
1784 | 2189 | { |
---|
1785 | 2190 | //System.out.println("Invariants:"); |
---|
1786 | 2191 | PrintMemory(); |
---|
1787 | 2192 | } else |
---|
1788 | | - if (event.getSource() == pathItem) |
---|
| 2193 | + if (source == pathItem) |
---|
1789 | 2194 | { |
---|
1790 | 2195 | PrintPath(); |
---|
1791 | 2196 | } else |
---|
1792 | | - if (event.getSource() == analyzeItem) |
---|
| 2197 | + if (source == analyzeItem) |
---|
1793 | 2198 | { |
---|
1794 | 2199 | AnalyzeObject(); |
---|
1795 | 2200 | } else |
---|
1796 | | - if (event.getSource() == dumpItem) |
---|
| 2201 | + if (source == dumpItem) |
---|
1797 | 2202 | { |
---|
1798 | 2203 | DumpObject(); |
---|
1799 | 2204 | } else |
---|
1800 | | - if (event.getSource() == screenfitButton) |
---|
| 2205 | + if (source == minButton) |
---|
| 2206 | + { |
---|
| 2207 | + Minimize(); |
---|
| 2208 | + } else |
---|
| 2209 | + if (source == maxButton) |
---|
| 2210 | + { |
---|
| 2211 | + Maximize(); |
---|
| 2212 | + } else |
---|
| 2213 | + if (source == fullButton) |
---|
| 2214 | + { |
---|
| 2215 | + ToggleFullScreen(); |
---|
| 2216 | + } else |
---|
| 2217 | + if (source == undoButton) |
---|
| 2218 | + { |
---|
| 2219 | + Undo(); |
---|
| 2220 | + } else |
---|
| 2221 | + if (source == redoButton) |
---|
| 2222 | + { |
---|
| 2223 | + Redo(); |
---|
| 2224 | + } else |
---|
| 2225 | + if (source == saveButton) |
---|
| 2226 | + { |
---|
| 2227 | + Save(); |
---|
| 2228 | + } else |
---|
| 2229 | + if (source == oneStepButton) |
---|
| 2230 | + { |
---|
| 2231 | + Globals.ONESTEP = true; |
---|
| 2232 | + cameraView.repaint(); |
---|
| 2233 | + } else |
---|
| 2234 | + if (source == screenfitButton) |
---|
1801 | 2235 | { |
---|
1802 | 2236 | //Reload(lastConverter, lastFilename, true); |
---|
1803 | 2237 | ScreenFit(); |
---|
1804 | 2238 | } else |
---|
1805 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2239 | + if (source == screenfitpointButton) |
---|
1806 | 2240 | { |
---|
1807 | 2241 | //Reload(lastConverter, lastFilename, true); |
---|
1808 | 2242 | ScreenFitPoint(); |
---|
1809 | 2243 | } else |
---|
1810 | | - if (event.getSource() == snapobjectButton) |
---|
| 2244 | + if (source == snapobjectButton) |
---|
1811 | 2245 | { |
---|
1812 | 2246 | //Reload(lastConverter, lastFilename, true); |
---|
1813 | 2247 | SnapObject(); |
---|
.. | .. |
---|
1818 | 2252 | // Recompile(); |
---|
1819 | 2253 | // refreshContents(); |
---|
1820 | 2254 | // } else |
---|
1821 | | - if (event.getSource() == gcButton) |
---|
| 2255 | + if (source == gcButton) |
---|
1822 | 2256 | { |
---|
1823 | 2257 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1824 | 2258 | System.gc(); |
---|
1825 | 2259 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1826 | 2260 | } else |
---|
1827 | | - if (event.getSource() == editLeafItem) |
---|
| 2261 | + if (source == editLeafItem) |
---|
1828 | 2262 | { |
---|
1829 | 2263 | Object3D obj; |
---|
1830 | 2264 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1838 | 2272 | } |
---|
1839 | 2273 | refreshContents(true); |
---|
1840 | 2274 | } else |
---|
1841 | | - if (event.getSource() == openWindowItem) |
---|
| 2275 | + if (source == openWindowItem) |
---|
1842 | 2276 | { |
---|
1843 | 2277 | EditSelection(true); |
---|
1844 | 2278 | } else |
---|
1845 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2279 | + if (source == cutItem || source == clearButton) |
---|
1846 | 2280 | { |
---|
1847 | 2281 | loadClipboard(true); |
---|
1848 | 2282 | } else |
---|
1849 | | - if (event.getSource() == duplicateItem) |
---|
| 2283 | + if (source == undoItem) |
---|
1850 | 2284 | { |
---|
1851 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 2285 | + Undo(); |
---|
| 2286 | + } else |
---|
| 2287 | + if (source == redoItem) |
---|
| 2288 | + { |
---|
| 2289 | + Redo(); |
---|
| 2290 | + } else |
---|
| 2291 | + if (source == duplicateItem) |
---|
| 2292 | + { |
---|
| 2293 | + Object3D keep = Grafreed.clipboard; |
---|
1852 | 2294 | loadClipboard(false); |
---|
1853 | 2295 | paste(false); |
---|
1854 | | - GraphreeD.clipboard = keep; |
---|
| 2296 | + Grafreed.clipboard = keep; |
---|
1855 | 2297 | } else |
---|
1856 | | - if (event.getSource() == cloneItem) |
---|
| 2298 | + if (source == cloneItem) |
---|
1857 | 2299 | { |
---|
1858 | 2300 | CloneSelection(false); |
---|
1859 | 2301 | } else |
---|
1860 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2302 | + if (source == cloneSupportItem) |
---|
1861 | 2303 | { |
---|
1862 | 2304 | CloneSelection(true); |
---|
1863 | 2305 | } else |
---|
1864 | | - if (event.getSource() == copyItem) |
---|
| 2306 | + if (source == copyItem) |
---|
1865 | 2307 | { |
---|
1866 | 2308 | loadClipboard(false); |
---|
1867 | 2309 | } else |
---|
1868 | | - if (event.getSource() == pasteItem) |
---|
| 2310 | + if (source == pasteItem) |
---|
1869 | 2311 | { |
---|
1870 | 2312 | paste(false); |
---|
1871 | 2313 | } else |
---|
1872 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2314 | + if (source == pasteIntoItem) |
---|
1873 | 2315 | { |
---|
1874 | | - pasteInto(false); |
---|
| 2316 | + pasteInto(true, false); |
---|
1875 | 2317 | } else |
---|
1876 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2318 | + if (source == pasteLinkItem) |
---|
1877 | 2319 | { |
---|
1878 | | - pasteInto(true); |
---|
| 2320 | + pasteInto(false, false); |
---|
1879 | 2321 | } else |
---|
1880 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2322 | + if (source == pasteCloneItem) |
---|
| 2323 | + { |
---|
| 2324 | + pasteInto(true, true); |
---|
| 2325 | + } else |
---|
| 2326 | + if (source == pasteExpandItem) |
---|
1881 | 2327 | { |
---|
1882 | 2328 | paste(true); |
---|
1883 | 2329 | } else |
---|
1884 | | - if (event.getSource() == synchronizeItem) |
---|
| 2330 | + if (source == synchronizeItem) |
---|
1885 | 2331 | { |
---|
1886 | 2332 | Overwrite(Object3D.TRANSFORM); |
---|
1887 | 2333 | } else |
---|
1888 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2334 | + if (source == overwriteNameItem) |
---|
1889 | 2335 | { |
---|
1890 | 2336 | Overwrite(Object3D.NAME); |
---|
1891 | 2337 | } else |
---|
1892 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2338 | + if (source == overwriteUVItem) |
---|
1893 | 2339 | { |
---|
1894 | 2340 | Overwrite(Object3D.UV); |
---|
1895 | 2341 | } else |
---|
1896 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2342 | + if (source == overwriteMatItem) |
---|
1897 | 2343 | { |
---|
| 2344 | + /* july 2015 |
---|
1898 | 2345 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1899 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2346 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1900 | 2347 | else |
---|
1901 | 2348 | { |
---|
1902 | 2349 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1908 | 2355 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1909 | 2356 | } |
---|
1910 | 2357 | } |
---|
| 2358 | + */ |
---|
| 2359 | + |
---|
| 2360 | + Overwrite(dropAttributes); |
---|
1911 | 2361 | } |
---|
1912 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2362 | + if (source == overwriteGeoItem) |
---|
1913 | 2363 | { |
---|
1914 | 2364 | Overwrite(Object3D.GEOMETRY); |
---|
1915 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2365 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1916 | 2366 | // { |
---|
1917 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2367 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1918 | 2368 | // |
---|
1919 | 2369 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1920 | 2370 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1926 | 2376 | // refreshContents(); |
---|
1927 | 2377 | // } |
---|
1928 | 2378 | } else |
---|
1929 | | - if (event.getSource() == generateMeshItem) |
---|
| 2379 | + if (source == generateMeshItem) |
---|
1930 | 2380 | { |
---|
1931 | 2381 | //if (group.selection.size() == 1) |
---|
1932 | 2382 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1937 | 2387 | ResetModel(); |
---|
1938 | 2388 | refreshContents(); |
---|
1939 | 2389 | } else |
---|
1940 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2390 | + if (source == extractGeometriesItem) |
---|
1941 | 2391 | { |
---|
1942 | 2392 | boolean one = false; |
---|
1943 | 2393 | |
---|
.. | .. |
---|
1964 | 2414 | ResetModel(); |
---|
1965 | 2415 | refreshContents(); |
---|
1966 | 2416 | } else |
---|
1967 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2417 | + if (source == cloneGeometriesItem) |
---|
1968 | 2418 | { |
---|
1969 | 2419 | boolean one = false; |
---|
1970 | 2420 | |
---|
.. | .. |
---|
1990 | 2440 | ResetModel(); |
---|
1991 | 2441 | refreshContents(); |
---|
1992 | 2442 | } else |
---|
1993 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2443 | + if (source == shareGeometriesItem) |
---|
1994 | 2444 | { |
---|
1995 | 2445 | boolean one = false; |
---|
1996 | 2446 | |
---|
1997 | 2447 | if (group.selection.size() == 1) |
---|
1998 | 2448 | one = true; |
---|
1999 | 2449 | |
---|
| 2450 | + Object3D merge = null; |
---|
| 2451 | + |
---|
2000 | 2452 | Object3D content = new cGroup(); |
---|
2001 | 2453 | |
---|
2002 | 2454 | for (int i=0; i<group.selection.size(); i++) |
---|
2003 | 2455 | { |
---|
2004 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2456 | + merge = new Merge(group.selection.get(i)); |
---|
2005 | 2457 | |
---|
2006 | 2458 | if (one) |
---|
2007 | | - makeSomething(sel, false); |
---|
| 2459 | + makeSomething(merge, false); |
---|
2008 | 2460 | else |
---|
2009 | | - content.addChild(sel); |
---|
| 2461 | + content.addChild(merge); |
---|
2010 | 2462 | } |
---|
2011 | 2463 | |
---|
2012 | 2464 | if (!one) |
---|
2013 | | - makeSomething(content, false); |
---|
2014 | | - |
---|
2015 | | - ResetModel(); |
---|
2016 | | - refreshContents(); |
---|
| 2465 | + makeSomething(content, true); |
---|
| 2466 | + else |
---|
| 2467 | + { |
---|
| 2468 | + ResetModel(); |
---|
| 2469 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2470 | + refreshContents(); |
---|
| 2471 | + } |
---|
2017 | 2472 | } else |
---|
2018 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2473 | + if (source == mergeGeometriesItem) |
---|
2019 | 2474 | { |
---|
2020 | 2475 | boolean one = false; |
---|
2021 | 2476 | |
---|
.. | .. |
---|
2045 | 2500 | ResetModel(); |
---|
2046 | 2501 | refreshContents(); |
---|
2047 | 2502 | } else |
---|
2048 | | - if (event.getSource() == linkverticesItem) |
---|
| 2503 | + if (source == linkverticesItem) |
---|
2049 | 2504 | { |
---|
2050 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2505 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2051 | 2506 | // { |
---|
2052 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2507 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2053 | 2508 | // |
---|
2054 | 2509 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2055 | 2510 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2058 | 2513 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2059 | 2514 | // refreshContents(); |
---|
2060 | 2515 | // } |
---|
2061 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2516 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2062 | 2517 | { |
---|
2063 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2518 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2064 | 2519 | |
---|
2065 | 2520 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2066 | 2521 | content = ((cGroup)content).get(0); |
---|
2067 | 2522 | |
---|
2068 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2523 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2069 | 2524 | for (int i=0; i<group.selection.size(); i++) |
---|
2070 | 2525 | { |
---|
2071 | | - boolean random = CameraPane.RANDOM; |
---|
2072 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2526 | + boolean random = CameraPane.SWITCH; |
---|
| 2527 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2073 | 2528 | group.selection.get(i).linkVerticesThis(content); |
---|
2074 | 2529 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2075 | | - CameraPane.RANDOM = random; |
---|
| 2530 | + CameraPane.SWITCH = random; |
---|
2076 | 2531 | } |
---|
2077 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2532 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2078 | 2533 | refreshContents(); |
---|
2079 | 2534 | } |
---|
2080 | 2535 | } else |
---|
2081 | | - if (event.getSource() == resetsupportItem) |
---|
| 2536 | + if (source == resetsupportItem) |
---|
2082 | 2537 | { |
---|
2083 | 2538 | for (int i=0; i<group.selection.size(); i++) |
---|
2084 | 2539 | { |
---|
2085 | | - boolean random = CameraPane.RANDOM; |
---|
2086 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2540 | + boolean random = CameraPane.SWITCH; |
---|
| 2541 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2087 | 2542 | group.selection.get(i).linkVerticesThis(null); |
---|
2088 | | - CameraPane.RANDOM = random; |
---|
| 2543 | + CameraPane.SWITCH = random; |
---|
2089 | 2544 | } |
---|
2090 | 2545 | |
---|
2091 | 2546 | refreshContents(); |
---|
2092 | 2547 | } else |
---|
2093 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2548 | + if (source == relinkverticesItem) |
---|
| 2549 | + { |
---|
| 2550 | + boolean random = CameraPane.SWITCH; |
---|
| 2551 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2552 | + group.selection.RelinkToSupport(); |
---|
| 2553 | + CameraPane.SWITCH = random; |
---|
| 2554 | + |
---|
| 2555 | + refreshContents(); |
---|
| 2556 | + } else |
---|
| 2557 | + if (source == resetreferencesItem) |
---|
2094 | 2558 | { |
---|
2095 | 2559 | for (int i=0; i<group.selection.size(); i++) |
---|
2096 | 2560 | { |
---|
.. | .. |
---|
2099 | 2563 | |
---|
2100 | 2564 | refreshContents(); |
---|
2101 | 2565 | } else |
---|
2102 | | - if (event.getSource() == setMasterItem) |
---|
| 2566 | + if (source == setMasterItem) |
---|
2103 | 2567 | { |
---|
2104 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2568 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2105 | 2569 | { |
---|
2106 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2570 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2107 | 2571 | |
---|
2108 | 2572 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2109 | 2573 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2112 | 2576 | refreshContents(); |
---|
2113 | 2577 | } |
---|
2114 | 2578 | } else |
---|
2115 | | - if (event.getSource() == poseMeshItem) |
---|
| 2579 | + if (source == poseMeshItem) |
---|
2116 | 2580 | { |
---|
2117 | 2581 | if (group.selection.size() == 1) |
---|
2118 | 2582 | { |
---|
2119 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2583 | + if (Grafreed.clipboard.size() == 1) |
---|
2120 | 2584 | { |
---|
2121 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2585 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2122 | 2586 | |
---|
2123 | 2587 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2124 | 2588 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2131 | 2595 | } |
---|
2132 | 2596 | |
---|
2133 | 2597 | } else |
---|
2134 | | - if (event.getSource() == revertMeshItem) |
---|
| 2598 | + if (source == revertMeshItem) |
---|
2135 | 2599 | { |
---|
2136 | 2600 | RevertMeshes(); |
---|
2137 | 2601 | } else |
---|
2138 | | - if (event.getSource() == resetMeshItem) |
---|
| 2602 | + if (source == resetAllItem) |
---|
2139 | 2603 | { |
---|
2140 | 2604 | ResetAll(); |
---|
2141 | 2605 | } else |
---|
2142 | | - if (event.getSource() == stepAllItem) |
---|
| 2606 | + if (source == stepAllItem) |
---|
2143 | 2607 | { |
---|
2144 | 2608 | StepAll(); |
---|
2145 | 2609 | } else |
---|
2146 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2610 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2147 | 2611 | { |
---|
2148 | 2612 | //int indices[] = jList.getSelectedIndices(); |
---|
2149 | 2613 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2151 | 2615 | |
---|
2152 | 2616 | ClearSelection(false); |
---|
2153 | 2617 | } else |
---|
2154 | | - if (event.getSource() == clearAllItem) |
---|
| 2618 | + if (source == clearAllItem) |
---|
2155 | 2619 | { |
---|
2156 | 2620 | ClearSelection(true); |
---|
2157 | 2621 | } else |
---|
2158 | | - if (event.getSource() == grabItem) |
---|
| 2622 | + if (source == grabItem || source == groupButton) |
---|
2159 | 2623 | { |
---|
2160 | | - group(new cGroup(), true); |
---|
| 2624 | + group(new cGroup(), false); // true); |
---|
2161 | 2625 | } else |
---|
2162 | | - if (event.getSource() == frontItem) |
---|
| 2626 | + if (source == hideItem) |
---|
| 2627 | + { |
---|
| 2628 | + group(new HiddenObject()); |
---|
| 2629 | + } else |
---|
| 2630 | + if (source == frontItem) |
---|
2163 | 2631 | { |
---|
2164 | 2632 | front(); |
---|
2165 | 2633 | } else |
---|
2166 | | - if (event.getSource() == backItem) |
---|
| 2634 | + if (source == backItem) |
---|
2167 | 2635 | { |
---|
2168 | 2636 | back(); |
---|
2169 | 2637 | } else |
---|
2170 | | - if (event.getSource() == cameraItem) |
---|
| 2638 | + if (source == cameraItem) |
---|
2171 | 2639 | { |
---|
2172 | 2640 | makeSomething(new Camera()); |
---|
2173 | 2641 | } else |
---|
2174 | | - if (event.getSource() == compositeItem) |
---|
| 2642 | + if (source == compositeItem || source == compositeButton) |
---|
2175 | 2643 | { |
---|
2176 | 2644 | group(new Composite()); |
---|
2177 | 2645 | } else |
---|
2178 | | - if (event.getSource() == randomItem) |
---|
| 2646 | + if (source == switchItem || source == switchButton) |
---|
2179 | 2647 | { |
---|
2180 | 2648 | RandomNode random = new RandomNode(); |
---|
2181 | 2649 | group(random); |
---|
2182 | 2650 | if (random.size() > 0) |
---|
2183 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2651 | + random.name = random.get(0).name + "Switch"; |
---|
2184 | 2652 | } else |
---|
2185 | | - if (event.getSource() == physicsItem) |
---|
| 2653 | + if (source == physicsItem) |
---|
2186 | 2654 | { |
---|
2187 | 2655 | group(new PhysicsNode()); |
---|
2188 | 2656 | } else |
---|
2189 | | - if (event.getSource() == frameselectorItem) |
---|
| 2657 | + if (source == frameselectorItem) |
---|
2190 | 2658 | { |
---|
2191 | 2659 | for (int i=0; i<group.selection.size(); i++) |
---|
2192 | 2660 | { |
---|
.. | .. |
---|
2198 | 2666 | ResetModel(); |
---|
2199 | 2667 | refreshContents(); |
---|
2200 | 2668 | } else |
---|
2201 | | - if (event.getSource() == switchGeoItem) |
---|
| 2669 | + if (source == switchGeoItem) |
---|
2202 | 2670 | { |
---|
2203 | 2671 | for (int i=0; i<group.selection.size(); i++) |
---|
2204 | 2672 | { |
---|
.. | .. |
---|
2210 | 2678 | ResetModel(); |
---|
2211 | 2679 | refreshContents(); |
---|
2212 | 2680 | } else |
---|
2213 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2681 | + if (source == switchTransfoItem) |
---|
2214 | 2682 | { |
---|
2215 | 2683 | for (int i=0; i<group.selection.size(); i++) |
---|
2216 | 2684 | { |
---|
.. | .. |
---|
2222 | 2690 | ResetModel(); |
---|
2223 | 2691 | refreshContents(); |
---|
2224 | 2692 | } else |
---|
2225 | | - if (event.getSource() == morphItem) |
---|
| 2693 | + if (source == morphItem) |
---|
2226 | 2694 | { |
---|
2227 | 2695 | for (int i=0; i<group.selection.size(); i++) |
---|
2228 | 2696 | { |
---|
.. | .. |
---|
2234 | 2702 | ResetModel(); |
---|
2235 | 2703 | refreshContents(); |
---|
2236 | 2704 | } else |
---|
2237 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2705 | + if (source == scriptNodeItem) |
---|
2238 | 2706 | { |
---|
2239 | 2707 | boolean atleastone = false; |
---|
2240 | 2708 | |
---|
.. | .. |
---|
2273 | 2741 | } |
---|
2274 | 2742 | } |
---|
2275 | 2743 | } else |
---|
2276 | | - if (event.getSource() == linkerItem) |
---|
| 2744 | + if (source == linkerItem) |
---|
2277 | 2745 | { |
---|
2278 | 2746 | group(new cLinker()); |
---|
2279 | 2747 | } else |
---|
2280 | | - if (event.getSource() == textureItem) |
---|
| 2748 | + if (source == textureItem || source == textureButton) |
---|
2281 | 2749 | { |
---|
2282 | 2750 | group(new TextureNode()); |
---|
2283 | 2751 | } else |
---|
2284 | | - if (event.getSource() == shadowXItem) |
---|
| 2752 | + if (source == billboardItem) |
---|
| 2753 | + { |
---|
| 2754 | + group(new BillboardNode()); |
---|
| 2755 | + } else |
---|
| 2756 | + if (source == shadowXItem) |
---|
2285 | 2757 | { |
---|
2286 | 2758 | CastShadow(0); |
---|
2287 | 2759 | } else |
---|
2288 | | - if (event.getSource() == shadowYItem) |
---|
| 2760 | + if (source == shadowYItem) |
---|
2289 | 2761 | { |
---|
2290 | 2762 | CastShadow(1); |
---|
2291 | 2763 | } else |
---|
2292 | | - if (event.getSource() == shadowZItem) |
---|
| 2764 | + if (source == shadowZItem) |
---|
2293 | 2765 | { |
---|
2294 | 2766 | CastShadow(2); |
---|
2295 | 2767 | } else |
---|
2296 | | - if (event.getSource() == ungroupItem) |
---|
| 2768 | + if (source == ungroupItem || source == ungroupButton) |
---|
2297 | 2769 | { |
---|
2298 | | - ungroup(); |
---|
| 2770 | + boolean hasRoot = false; |
---|
| 2771 | + |
---|
| 2772 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2773 | + { |
---|
| 2774 | + if (group.selection.get(i) == group) |
---|
| 2775 | + { |
---|
| 2776 | + hasRoot = true; |
---|
| 2777 | + break; |
---|
| 2778 | + } |
---|
| 2779 | + } |
---|
| 2780 | + |
---|
| 2781 | + if (!hasRoot) |
---|
| 2782 | + { |
---|
| 2783 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2784 | + { |
---|
| 2785 | + Ungroup(group.selection.get(i)); |
---|
| 2786 | + } |
---|
| 2787 | + |
---|
| 2788 | + ClearSelection(false); |
---|
| 2789 | + |
---|
| 2790 | + refreshContents(); |
---|
| 2791 | + } |
---|
2299 | 2792 | } else |
---|
2300 | | - if (event.getSource() == genUVItem) |
---|
| 2793 | + if (source == genUVItem) |
---|
2301 | 2794 | { |
---|
2302 | 2795 | GenUV(); |
---|
2303 | 2796 | } else |
---|
2304 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2797 | + if (source == genNormalsCADItem) |
---|
2305 | 2798 | { |
---|
2306 | 2799 | GenNormals(true); |
---|
2307 | 2800 | } else |
---|
2308 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2801 | + if (source == genNormalsMESHItem) |
---|
| 2802 | + { |
---|
| 2803 | + GenNormalsMESH(); |
---|
| 2804 | + } else |
---|
| 2805 | + if (source == genNormalsORGANItem) |
---|
2309 | 2806 | { |
---|
2310 | 2807 | GenNormals(false); |
---|
2311 | 2808 | } else |
---|
2312 | | - if (event.getSource() == stripifyItem) |
---|
| 2809 | + if (source == genNormalsMINEItem) |
---|
| 2810 | + { |
---|
| 2811 | + GenNormalsMINE(); |
---|
| 2812 | + } else |
---|
| 2813 | + if (source == stripifyItem) |
---|
2313 | 2814 | { |
---|
2314 | 2815 | Stripify(); |
---|
2315 | 2816 | } else |
---|
2316 | | - if (event.getSource() == unstripifyItem) |
---|
| 2817 | + if (source == unstripifyItem) |
---|
2317 | 2818 | { |
---|
2318 | 2819 | Unstripify(); |
---|
2319 | 2820 | } else |
---|
2320 | | - if (event.getSource() == trimItem) |
---|
| 2821 | + if (source == trimItem) |
---|
2321 | 2822 | { |
---|
2322 | 2823 | Trim(); |
---|
2323 | 2824 | } else |
---|
2324 | | - if (event.getSource() == untrimItem) |
---|
| 2825 | + if (source == untrimItem) |
---|
2325 | 2826 | { |
---|
2326 | 2827 | Untrim(); |
---|
2327 | 2828 | } else |
---|
2328 | | - if (event.getSource() == clearColorsItem) |
---|
| 2829 | + if (source == clearColorsItem) |
---|
2329 | 2830 | { |
---|
2330 | 2831 | ClearColors(); |
---|
2331 | 2832 | } else |
---|
2332 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2833 | + if (source == clearMaterialsItem) |
---|
2333 | 2834 | { |
---|
2334 | 2835 | ClearMaterials(); |
---|
2335 | 2836 | } else |
---|
2336 | | - if (event.getSource() == liveleavesItem) |
---|
| 2837 | + if (source == liveleavesItem) |
---|
2337 | 2838 | { |
---|
2338 | 2839 | LiveLeaves(true); |
---|
2339 | 2840 | } else |
---|
2340 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2841 | + if (source == unliveleavesItem) |
---|
2341 | 2842 | { |
---|
2342 | 2843 | LiveLeaves(false); |
---|
2343 | 2844 | } else |
---|
2344 | | - if (event.getSource() == supportleavesItem) |
---|
| 2845 | + if (source == supportleavesItem) |
---|
2345 | 2846 | { |
---|
2346 | 2847 | SupportLeaves(true); |
---|
2347 | 2848 | } else |
---|
2348 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2849 | + if (source == unsupportleavesItem) |
---|
2349 | 2850 | { |
---|
2350 | 2851 | SupportLeaves(false); |
---|
2351 | 2852 | } else |
---|
2352 | | - if (event.getSource() == hideleavesItem) |
---|
| 2853 | + if (source == hideleavesItem) |
---|
2353 | 2854 | { |
---|
2354 | 2855 | HideLeaves(true); |
---|
2355 | 2856 | } else |
---|
2356 | | - if (event.getSource() == showleavesItem) |
---|
| 2857 | + if (source == showleavesItem) |
---|
2357 | 2858 | { |
---|
2358 | 2859 | HideLeaves(false); |
---|
2359 | 2860 | } else |
---|
2360 | | - if (event.getSource() == markleavesItem) |
---|
| 2861 | + if (source == markleavesItem) |
---|
2361 | 2862 | { |
---|
2362 | 2863 | MarkLeaves(true); |
---|
2363 | 2864 | } else |
---|
2364 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2865 | + if (source == unmarkleavesItem) |
---|
2365 | 2866 | { |
---|
2366 | 2867 | MarkLeaves(false); |
---|
2367 | 2868 | } else |
---|
2368 | | - if (event.getSource() == flipVItem) |
---|
| 2869 | + if (source == rewindleavesItem) |
---|
| 2870 | + { |
---|
| 2871 | + RewindLeaves(true); |
---|
| 2872 | + } else |
---|
| 2873 | + if (source == unrewindleavesItem) |
---|
| 2874 | + { |
---|
| 2875 | + RewindLeaves(false); |
---|
| 2876 | + } else |
---|
| 2877 | + if (source == randomleavesItem) |
---|
| 2878 | + { |
---|
| 2879 | + RandomLeaves(true); |
---|
| 2880 | + } else |
---|
| 2881 | + if (source == unrandomleavesItem) |
---|
| 2882 | + { |
---|
| 2883 | + RandomLeaves(false); |
---|
| 2884 | + } else |
---|
| 2885 | + if (source == flipVItem) |
---|
2369 | 2886 | { |
---|
2370 | 2887 | FlipV(true); |
---|
2371 | 2888 | } else |
---|
2372 | | - if (event.getSource() == unflipVItem) |
---|
| 2889 | + if (source == unflipVItem) |
---|
2373 | 2890 | { |
---|
2374 | 2891 | FlipV(false); |
---|
2375 | 2892 | } else |
---|
2376 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2893 | + if (source == lowTexturesItem) |
---|
2377 | 2894 | { |
---|
2378 | 2895 | SetTexRes(0); |
---|
2379 | 2896 | } else |
---|
2380 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2897 | + if (source == normalTexturesItem) |
---|
2381 | 2898 | { |
---|
2382 | 2899 | SetTexRes(1); |
---|
2383 | 2900 | } else |
---|
2384 | | - if (event.getSource() == highTexturesItem) |
---|
| 2901 | + if (source == highTexturesItem) |
---|
2385 | 2902 | { |
---|
2386 | 2903 | SetTexRes(2); |
---|
2387 | 2904 | } else |
---|
2388 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2905 | + if (source == veryhighTexturesItem) |
---|
2389 | 2906 | { |
---|
2390 | 2907 | SetTexRes(3); |
---|
2391 | 2908 | } else |
---|
2392 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2909 | + if (source == maxTexturesItem) |
---|
2393 | 2910 | { |
---|
2394 | 2911 | SetTexRes(4); |
---|
2395 | 2912 | } else |
---|
2396 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2913 | + if (source == panoTexturesItem) |
---|
2397 | 2914 | { |
---|
2398 | 2915 | SetTexRes(5); |
---|
2399 | 2916 | } else |
---|
2400 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2917 | + if (source == reverseNormalsItem) |
---|
2401 | 2918 | { |
---|
2402 | 2919 | ReverseNormals(); |
---|
2403 | 2920 | } else |
---|
2404 | | - if (event.getSource() == parseverticesItem) |
---|
| 2921 | + if (source == parseverticesItem) |
---|
2405 | 2922 | { |
---|
2406 | 2923 | ParseVertices(); |
---|
2407 | 2924 | } else |
---|
2408 | | - if (event.getSource() == textureFieldItem) |
---|
| 2925 | + if (source == textureFieldItem) |
---|
2409 | 2926 | { |
---|
2410 | 2927 | TextureVertices(); |
---|
2411 | 2928 | } else |
---|
2412 | | - if (event.getSource() == alignItem) |
---|
| 2929 | + if (source == alignItem) |
---|
2413 | 2930 | { |
---|
2414 | 2931 | Align(); |
---|
2415 | 2932 | } else |
---|
2416 | | - if (event.getSource() == mirrorItem) |
---|
| 2933 | + if (source == mirrorItem) |
---|
2417 | 2934 | { |
---|
2418 | 2935 | MirrorPoses(); |
---|
2419 | 2936 | } else |
---|
2420 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2937 | + if (source == reduceMorphItem) |
---|
2421 | 2938 | { |
---|
2422 | 2939 | MeshReduction(false); |
---|
2423 | 2940 | } else |
---|
2424 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2941 | + if (source == reduce34MorphItem) |
---|
2425 | 2942 | { |
---|
2426 | 2943 | MeshReduction(true); |
---|
2427 | 2944 | } else |
---|
2428 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2945 | + if (source == reverseTrianglesItem) |
---|
2429 | 2946 | { |
---|
2430 | 2947 | ReverseTriangles(); |
---|
2431 | 2948 | } else |
---|
2432 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2949 | + if (source == reduceMeshItem) |
---|
2433 | 2950 | { |
---|
2434 | 2951 | ReduceMesh(false); |
---|
2435 | 2952 | } else |
---|
2436 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2953 | + if (source == reduce34MeshItem) |
---|
2437 | 2954 | { |
---|
2438 | 2955 | ReduceMesh(true); |
---|
2439 | 2956 | } else |
---|
2440 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2957 | + if (source == increaseMeshItem) |
---|
2441 | 2958 | { |
---|
2442 | 2959 | IncreaseMesh(); |
---|
2443 | 2960 | } else |
---|
2444 | | - if (event.getSource() == clipMeshItem) |
---|
| 2961 | + if (source == clipMeshItem) |
---|
2445 | 2962 | { |
---|
2446 | 2963 | ClipMesh(); |
---|
2447 | 2964 | } else |
---|
2448 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2965 | + if (source == smoothMeshItem) |
---|
2449 | 2966 | { |
---|
2450 | 2967 | SmoothMesh(); |
---|
2451 | 2968 | } else |
---|
2452 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2969 | + if (source == transformGeometryItem) |
---|
2453 | 2970 | { |
---|
2454 | 2971 | TransformGeometry(); |
---|
2455 | 2972 | } else |
---|
2456 | | - if (event.getSource() == resetTransformItem) |
---|
| 2973 | + if (source == transformChildrenItem) |
---|
| 2974 | + { |
---|
| 2975 | + TransformChildren(); |
---|
| 2976 | + } else |
---|
| 2977 | + if (source == resetTransformItem) |
---|
2457 | 2978 | { |
---|
2458 | 2979 | ResetTransform(); |
---|
2459 | 2980 | } else |
---|
2460 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2981 | + if (source == resetCentroidItem) |
---|
2461 | 2982 | { |
---|
2462 | | - ResetCentroid(); |
---|
| 2983 | + ResetCentroid(true); |
---|
2463 | 2984 | } else |
---|
2464 | | - if (event.getSource() == resetParentItem) |
---|
| 2985 | + if (source == resetCentroidXZItem) |
---|
| 2986 | + { |
---|
| 2987 | + ResetCentroid(false); |
---|
| 2988 | + } else |
---|
| 2989 | + if (source == resetParentItem) |
---|
2465 | 2990 | { |
---|
2466 | 2991 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2467 | 2992 | { |
---|
.. | .. |
---|
2471 | 2996 | |
---|
2472 | 2997 | refreshContents(); |
---|
2473 | 2998 | } else |
---|
2474 | | - if (event.getSource() == repairParentItem) |
---|
| 2999 | + if (source == repairParentItem) |
---|
2475 | 3000 | { |
---|
2476 | 3001 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2477 | 3002 | { |
---|
.. | .. |
---|
2485 | 3010 | |
---|
2486 | 3011 | refreshContents(); |
---|
2487 | 3012 | } else |
---|
2488 | | - if (event.getSource() == sortbysizeItem) |
---|
| 3013 | + if (source == repairShadowItem) |
---|
| 3014 | + { |
---|
| 3015 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3016 | + { |
---|
| 3017 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 3018 | + obj.RepairShadow(); |
---|
| 3019 | +// for (int i=0; i<obj.size(); i++) |
---|
| 3020 | +// { |
---|
| 3021 | +// obj.get(i).parent = obj; |
---|
| 3022 | +// } |
---|
| 3023 | + } |
---|
| 3024 | + |
---|
| 3025 | + refreshContents(); |
---|
| 3026 | + } else |
---|
| 3027 | + if (source == sortbysizeItem) |
---|
2489 | 3028 | { |
---|
2490 | 3029 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2491 | 3030 | { |
---|
.. | .. |
---|
2497 | 3036 | ResetModel(); |
---|
2498 | 3037 | refreshContents(); |
---|
2499 | 3038 | } else |
---|
2500 | | - if (event.getSource() == sortbynameItem) |
---|
| 3039 | + if (source == sortbynameItem) |
---|
2501 | 3040 | { |
---|
2502 | 3041 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2503 | 3042 | { |
---|
.. | .. |
---|
2509 | 3048 | ResetModel(); |
---|
2510 | 3049 | refreshContents(); |
---|
2511 | 3050 | } else |
---|
2512 | | - if (event.getSource() == attachPigmentItem) |
---|
| 3051 | + if (source == attachPigmentItem) |
---|
2513 | 3052 | { |
---|
2514 | 3053 | String texture = GetFile("Attach pigment"); |
---|
2515 | 3054 | Object3D obj; |
---|
.. | .. |
---|
2521 | 3060 | |
---|
2522 | 3061 | refreshContents(); |
---|
2523 | 3062 | } else |
---|
2524 | | - if (event.getSource() == detachPigmentItem) |
---|
| 3063 | + if (source == detachPigmentItem) |
---|
2525 | 3064 | { |
---|
2526 | 3065 | Object3D obj; |
---|
2527 | 3066 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2532 | 3071 | |
---|
2533 | 3072 | refreshContents(); |
---|
2534 | 3073 | } else |
---|
2535 | | - if (event.getSource() == attachBumpItem) |
---|
| 3074 | + if (source == attachBumpItem) |
---|
2536 | 3075 | { |
---|
2537 | 3076 | String texture = GetFile("Attach bump"); |
---|
2538 | 3077 | Object3D obj; |
---|
.. | .. |
---|
2544 | 3083 | |
---|
2545 | 3084 | refreshContents(); |
---|
2546 | 3085 | } else |
---|
2547 | | - if (event.getSource() == detachBumpItem) |
---|
| 3086 | + if (source == detachBumpItem) |
---|
2548 | 3087 | { |
---|
2549 | 3088 | Object3D obj; |
---|
2550 | 3089 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2555 | 3094 | |
---|
2556 | 3095 | refreshContents(); |
---|
2557 | 3096 | } else |
---|
2558 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 3097 | + if (source == pigmentBumpItem) |
---|
2559 | 3098 | { |
---|
2560 | 3099 | Object3D obj; |
---|
2561 | 3100 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2566 | 3105 | |
---|
2567 | 3106 | refreshContents(); |
---|
2568 | 3107 | } else |
---|
2569 | | - if (event.getSource() == flashSelectionButton) |
---|
| 3108 | + if (source == flashSelectionButton) |
---|
2570 | 3109 | { |
---|
2571 | 3110 | CameraPane.flash = true; |
---|
2572 | 3111 | refreshContents(); |
---|
2573 | 3112 | } else |
---|
2574 | | - if (event.getSource() == oneButton) |
---|
| 3113 | + if (source == oneButton) |
---|
2575 | 3114 | { |
---|
2576 | 3115 | } else |
---|
2577 | | - if (event.getSource() == twoButton) |
---|
| 3116 | + if (source == twoButton) |
---|
2578 | 3117 | { |
---|
2579 | 3118 | radio.layout = twoButton; |
---|
| 3119 | + |
---|
| 3120 | + if (CameraPane.FULLSCREEN) |
---|
| 3121 | + fullscreenLayout = radio.layout; |
---|
| 3122 | + |
---|
2580 | 3123 | // bug |
---|
2581 | 3124 | //gridPanel.setDividerLocation(1.0); |
---|
2582 | 3125 | //bigPanel.setDividerLocation(0.0); |
---|
2583 | | - bigThree.remove(jtp); |
---|
2584 | | - bigThree.remove(cameraPanel); |
---|
2585 | | - bigThree.remove(XYZPanel); |
---|
2586 | | - aWindowConstraints.gridx = 0; |
---|
2587 | | - aWindowConstraints.gridy = 0; |
---|
2588 | | - aWindowConstraints.gridwidth = 1; |
---|
2589 | | - // aConstraints.gridheight = 3; |
---|
2590 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2591 | | - aWindowConstraints.weightx = 0; |
---|
2592 | | - aWindowConstraints.weighty = 1; |
---|
2593 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2594 | | - aWindowConstraints.weightx = 1; |
---|
2595 | | - aWindowConstraints.gridwidth = 3; |
---|
2596 | | - // aConstraints.gridheight = 3; |
---|
2597 | | - aWindowConstraints.gridx = 1; |
---|
2598 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2599 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2600 | | - aWindowConstraints.weightx = 0; |
---|
2601 | | - aWindowConstraints.gridx = 4; |
---|
2602 | | - aWindowConstraints.gridwidth = 1; |
---|
2603 | | - // aConstraints.gridheight = 3; |
---|
2604 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2605 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2606 | | - bigThree.revalidate(); |
---|
| 3126 | +// bigThree.remove(scenePanel); |
---|
| 3127 | +// bigThree.remove(centralPanel); |
---|
| 3128 | +// bigThree.remove(XYZPanel); |
---|
| 3129 | +// aWindowConstraints.gridx = 0; |
---|
| 3130 | +// aWindowConstraints.gridy = 0; |
---|
| 3131 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3132 | +// // aConstraints.gridheight = 3; |
---|
| 3133 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3134 | +// aWindowConstraints.weightx = 0; |
---|
| 3135 | +// aWindowConstraints.weighty = 1; |
---|
| 3136 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3137 | +// aWindowConstraints.weightx = 1; |
---|
| 3138 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3139 | +// // aConstraints.gridheight = 3; |
---|
| 3140 | +// aWindowConstraints.gridx = 1; |
---|
| 3141 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3142 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3143 | +// aWindowConstraints.weightx = 0; |
---|
| 3144 | +// aWindowConstraints.gridx = 4; |
---|
| 3145 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3146 | +// // aConstraints.gridheight = 3; |
---|
| 3147 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3148 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3149 | +// scenePanel.setVisible(false); |
---|
| 3150 | +// centralPanel.setVisible(true); |
---|
| 3151 | +// XYZPanel.setVisible(false); |
---|
| 3152 | + bigThree.ClearUI(); |
---|
| 3153 | + bigThree.add(centralPanel); |
---|
| 3154 | + bigThree.FlushUI(); |
---|
| 3155 | + |
---|
| 3156 | + cameraView.requestFocusInWindow(); |
---|
| 3157 | + |
---|
| 3158 | +// refreshContents(true); |
---|
| 3159 | +// |
---|
| 3160 | +// try |
---|
| 3161 | +// { |
---|
| 3162 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3163 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3164 | +// bot.mouseMove(100, 100); |
---|
| 3165 | +// bot.mousePress(mask); |
---|
| 3166 | +// bot.mouseRelease(mask); |
---|
| 3167 | +// } |
---|
| 3168 | +// catch (Exception e) |
---|
| 3169 | +// { |
---|
| 3170 | +// |
---|
| 3171 | +// } |
---|
| 3172 | + |
---|
2607 | 3173 | } else |
---|
2608 | | - if (event.getSource() == threeButton) |
---|
| 3174 | + if (source == threeButton) |
---|
2609 | 3175 | { |
---|
2610 | 3176 | radio.layout = threeButton; |
---|
2611 | | - bigThree.remove(jtp); |
---|
2612 | | - bigThree.remove(cameraPanel); |
---|
2613 | | - bigThree.remove(XYZPanel); |
---|
2614 | | - aWindowConstraints.gridx = 0; |
---|
2615 | | - aWindowConstraints.gridy = 0; |
---|
2616 | | - aWindowConstraints.gridwidth = 1; |
---|
2617 | | - // aConstraints.gridheight = 3; |
---|
2618 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2619 | | - aWindowConstraints.weightx = 0; |
---|
2620 | | - aWindowConstraints.weighty = 1; |
---|
2621 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2622 | | - aWindowConstraints.weightx = 1; |
---|
2623 | | - aWindowConstraints.gridwidth = 3; |
---|
2624 | | - // aConstraints.gridheight = 3; |
---|
2625 | | - aWindowConstraints.gridx = 1; |
---|
2626 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2627 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2628 | | - aWindowConstraints.weightx = 0; |
---|
2629 | | - aWindowConstraints.gridx = 4; |
---|
2630 | | - aWindowConstraints.gridwidth = 1; |
---|
2631 | | - // aConstraints.gridheight = 3; |
---|
2632 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2633 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2634 | | - bigThree.revalidate(); |
---|
| 3177 | + |
---|
| 3178 | + if (CameraPane.FULLSCREEN) |
---|
| 3179 | + fullscreenLayout = radio.layout; |
---|
| 3180 | + |
---|
| 3181 | +// bigThree.remove(scenePanel); |
---|
| 3182 | +// bigThree.remove(centralPanel); |
---|
| 3183 | +// bigThree.remove(XYZPanel); |
---|
| 3184 | +// aWindowConstraints.gridx = 0; |
---|
| 3185 | +// aWindowConstraints.gridy = 0; |
---|
| 3186 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3187 | +// // aConstraints.gridheight = 3; |
---|
| 3188 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3189 | +// aWindowConstraints.weightx = 0; |
---|
| 3190 | +// aWindowConstraints.weighty = 1; |
---|
| 3191 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3192 | +// aWindowConstraints.weightx = 1; |
---|
| 3193 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3194 | +// // aConstraints.gridheight = 3; |
---|
| 3195 | +// aWindowConstraints.gridx = 1; |
---|
| 3196 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3197 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3198 | +// aWindowConstraints.weightx = 0; |
---|
| 3199 | +// aWindowConstraints.gridx = 4; |
---|
| 3200 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3201 | +// // aConstraints.gridheight = 3; |
---|
| 3202 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3203 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3204 | +// bigThree.validate(); |
---|
| 3205 | +// scenePanel.setVisible(false); |
---|
| 3206 | +// centralPanel.setVisible(true); |
---|
| 3207 | +// XYZPanel.setVisible(true); |
---|
| 3208 | + bigThree.ClearUI(); |
---|
| 3209 | + bigThree.add(centralPanel); |
---|
| 3210 | + bigThree.add(XYZPanel); |
---|
| 3211 | + bigThree.FlushUI(); |
---|
| 3212 | + |
---|
| 3213 | + cameraView.requestFocusInWindow(); |
---|
2635 | 3214 | } else |
---|
2636 | | - if (event.getSource() == fourButton) |
---|
| 3215 | + if (source == fourButton) |
---|
2637 | 3216 | { |
---|
2638 | 3217 | radio.layout = fourButton; |
---|
2639 | | - bigThree.remove(jtp); |
---|
2640 | | - bigThree.remove(cameraPanel); |
---|
2641 | | - bigThree.remove(XYZPanel); |
---|
2642 | | - aWindowConstraints.gridx = 0; |
---|
2643 | | - aWindowConstraints.gridy = 0; |
---|
2644 | | - aWindowConstraints.gridwidth = 1; |
---|
2645 | | - // aWindowConstraints.gridheight = 3; |
---|
2646 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2647 | | - aWindowConstraints.weightx = 1; |
---|
2648 | | - aWindowConstraints.weighty = 1; |
---|
2649 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2650 | | - aWindowConstraints.weightx = 1; |
---|
2651 | | - aWindowConstraints.gridwidth = 3; |
---|
2652 | | - // aConstraints.gridheight = 3; |
---|
2653 | | - aWindowConstraints.gridx = 1; |
---|
2654 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2655 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2656 | | - aWindowConstraints.weightx = 0; |
---|
2657 | | - aWindowConstraints.gridx = 4; |
---|
2658 | | - aWindowConstraints.gridwidth = 1; |
---|
2659 | | - // aWindowConstraints.gridheight = 3; |
---|
2660 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2661 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2662 | | - bigThree.revalidate(); |
---|
| 3218 | + |
---|
| 3219 | + if (CameraPane.FULLSCREEN) |
---|
| 3220 | + fullscreenLayout = radio.layout; |
---|
| 3221 | + |
---|
| 3222 | +// bigThree.remove(scenePanel); |
---|
| 3223 | +// bigThree.remove(centralPanel); |
---|
| 3224 | +// bigThree.remove(XYZPanel); |
---|
| 3225 | +// aWindowConstraints.gridx = 0; |
---|
| 3226 | +// aWindowConstraints.gridy = 0; |
---|
| 3227 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3228 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3229 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3230 | +// aWindowConstraints.weightx = 1; |
---|
| 3231 | +// aWindowConstraints.weighty = 1; |
---|
| 3232 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3233 | +// aWindowConstraints.weightx = 1; |
---|
| 3234 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3235 | +// // aConstraints.gridheight = 3; |
---|
| 3236 | +// aWindowConstraints.gridx = 1; |
---|
| 3237 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3238 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3239 | +// aWindowConstraints.weightx = 0; |
---|
| 3240 | +// aWindowConstraints.gridx = 4; |
---|
| 3241 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3242 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3243 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3244 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3245 | +// bigThree.validate(); |
---|
| 3246 | +// scenePanel.setVisible(true); |
---|
| 3247 | +// centralPanel.setVisible(false); |
---|
| 3248 | +// XYZPanel.setVisible(false); |
---|
| 3249 | + bigThree.ClearUI(); |
---|
| 3250 | + bigThree.add(scenePanel); |
---|
| 3251 | + bigThree.FlushUI(); |
---|
| 3252 | + |
---|
| 3253 | + cameraView.requestFocusInWindow(); |
---|
2663 | 3254 | } else |
---|
2664 | | - if (event.getSource() == sixButton) |
---|
| 3255 | + if (source == sixButton) |
---|
2665 | 3256 | { |
---|
2666 | 3257 | radio.layout = sixButton; |
---|
2667 | | - bigThree.remove(jtp); |
---|
2668 | | - bigThree.remove(cameraPanel); |
---|
2669 | | - bigThree.remove(XYZPanel); |
---|
2670 | | - aWindowConstraints.gridx = 0; |
---|
2671 | | - aWindowConstraints.gridy = 0; |
---|
2672 | | - aWindowConstraints.gridwidth = 1; |
---|
2673 | | - // aConstraints.gridheight = 3; |
---|
2674 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2675 | | - aWindowConstraints.weightx = 0; |
---|
2676 | | - aWindowConstraints.weighty = 1; |
---|
2677 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2678 | | - aWindowConstraints.weightx = 1; |
---|
2679 | | - aWindowConstraints.gridwidth = 3; |
---|
2680 | | - // aWindowConstraints.gridheight = 3; |
---|
2681 | | - aWindowConstraints.gridx = 1; |
---|
2682 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2683 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2684 | | - aWindowConstraints.weightx = 0; |
---|
2685 | | - aWindowConstraints.gridx = 4; |
---|
2686 | | - aWindowConstraints.gridwidth = 1; |
---|
2687 | | - // aWindowConstraints.gridheight = 3; |
---|
2688 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2689 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2690 | | - bigThree.revalidate(); |
---|
| 3258 | + |
---|
| 3259 | + if (CameraPane.FULLSCREEN) |
---|
| 3260 | + fullscreenLayout = radio.layout; |
---|
| 3261 | + |
---|
| 3262 | +// bigThree.remove(scenePanel); |
---|
| 3263 | +// bigThree.remove(centralPanel); |
---|
| 3264 | +// bigThree.remove(XYZPanel); |
---|
| 3265 | +// aWindowConstraints.gridx = 0; |
---|
| 3266 | +// aWindowConstraints.gridy = 0; |
---|
| 3267 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3268 | +// // aConstraints.gridheight = 3; |
---|
| 3269 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3270 | +// aWindowConstraints.weightx = 0; |
---|
| 3271 | +// aWindowConstraints.weighty = 1; |
---|
| 3272 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3273 | +// aWindowConstraints.weightx = 1; |
---|
| 3274 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3275 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3276 | +// aWindowConstraints.gridx = 1; |
---|
| 3277 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3278 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3279 | +// aWindowConstraints.weightx = 0; |
---|
| 3280 | +// aWindowConstraints.gridx = 4; |
---|
| 3281 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3282 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3283 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3284 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3285 | +// bigThree.validate(); |
---|
| 3286 | +// scenePanel.setVisible(true); |
---|
| 3287 | +// centralPanel.setVisible(true); |
---|
| 3288 | +// XYZPanel.setVisible(false); |
---|
| 3289 | + bigThree.ClearUI(); |
---|
| 3290 | + bigThree.add(scenePanel); |
---|
| 3291 | + bigThree.add(centralPanel); |
---|
| 3292 | + bigThree.FlushUI(); |
---|
| 3293 | + |
---|
| 3294 | + cameraView.requestFocusInWindow(); |
---|
2691 | 3295 | } else |
---|
2692 | | - if (event.getSource() == sevenButton) |
---|
| 3296 | + if (source == sevenButton) |
---|
2693 | 3297 | { |
---|
2694 | 3298 | radio.layout = sevenButton; |
---|
2695 | | - bigThree.remove(jtp); |
---|
2696 | | - bigThree.remove(cameraPanel); |
---|
2697 | | - bigThree.remove(XYZPanel); |
---|
2698 | | - aWindowConstraints.gridx = 0; |
---|
2699 | | - aWindowConstraints.gridy = 0; |
---|
2700 | | - aWindowConstraints.gridwidth = 1; |
---|
2701 | | - // aWindowConstraints.gridheight = 3; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2703 | | - aWindowConstraints.weightx = 0; |
---|
2704 | | - aWindowConstraints.weighty = 1; |
---|
2705 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2706 | | - aWindowConstraints.weightx = 1; |
---|
2707 | | - aWindowConstraints.gridwidth = 3; |
---|
2708 | | - // aWindowConstraints.gridheight = 3; |
---|
2709 | | - aWindowConstraints.gridx = 1; |
---|
2710 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2711 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2712 | | - aWindowConstraints.weightx = 0; |
---|
2713 | | - aWindowConstraints.gridx = 4; |
---|
2714 | | - aWindowConstraints.gridwidth = 1; |
---|
2715 | | - // aConstraints.gridheight = 3; |
---|
2716 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2717 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2718 | | - bigThree.revalidate(); |
---|
| 3299 | + |
---|
| 3300 | + if (CameraPane.FULLSCREEN) |
---|
| 3301 | + fullscreenLayout = radio.layout; |
---|
| 3302 | + |
---|
| 3303 | +// bigThree.remove(scenePanel); |
---|
| 3304 | +// bigThree.remove(centralPanel); |
---|
| 3305 | +// bigThree.remove(XYZPanel); |
---|
| 3306 | +// aWindowConstraints.gridx = 0; |
---|
| 3307 | +// aWindowConstraints.gridy = 0; |
---|
| 3308 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3309 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3310 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3311 | +// aWindowConstraints.weightx = 0; |
---|
| 3312 | +// aWindowConstraints.weighty = 1; |
---|
| 3313 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3314 | +// aWindowConstraints.weightx = 1; |
---|
| 3315 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3316 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3317 | +// aWindowConstraints.gridx = 1; |
---|
| 3318 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3319 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3320 | +// aWindowConstraints.weightx = 0; |
---|
| 3321 | +// aWindowConstraints.gridx = 4; |
---|
| 3322 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3323 | +// // aConstraints.gridheight = 3; |
---|
| 3324 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3325 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3326 | +// bigThree.validate(); |
---|
| 3327 | +// scenePanel.setVisible(true); |
---|
| 3328 | +// centralPanel.setVisible(true); |
---|
| 3329 | +// XYZPanel.setVisible(true); |
---|
| 3330 | + bigThree.ClearUI(); |
---|
| 3331 | + bigThree.add(scenePanel); |
---|
| 3332 | + bigThree.add(centralPanel); |
---|
| 3333 | + bigThree.add(XYZPanel); |
---|
| 3334 | + bigThree.FlushUI(); |
---|
| 3335 | + |
---|
| 3336 | + cameraView.requestFocusInWindow(); |
---|
2719 | 3337 | } else |
---|
2720 | | - if (event.getSource() == rootButton) |
---|
| 3338 | + if (source == rootButton) |
---|
2721 | 3339 | { |
---|
2722 | 3340 | Object3D obj; |
---|
2723 | 3341 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2727 | 3345 | EditObject(obj); |
---|
2728 | 3346 | } |
---|
2729 | 3347 | |
---|
| 3348 | + cameraView.requestFocusInWindow(); |
---|
2730 | 3349 | refreshContents(true); |
---|
2731 | 3350 | } else |
---|
2732 | | - if (event.getSource() == closeButton) |
---|
| 3351 | + if (source == closeButton) |
---|
2733 | 3352 | { |
---|
2734 | 3353 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2735 | 3354 | cRadio ab; |
---|
2736 | 3355 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2737 | 3356 | { |
---|
2738 | 3357 | ab = (cRadio)e.nextElement(); |
---|
2739 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3358 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2740 | 3359 | { |
---|
| 3360 | + // Patch to avoid bug with transparency. |
---|
| 3361 | + if (!ab.hadMaterial) |
---|
| 3362 | + { |
---|
| 3363 | + ab.object.material = null; |
---|
| 3364 | + } |
---|
| 3365 | + |
---|
2741 | 3366 | buttonGroup.remove(ab); |
---|
2742 | 3367 | radioPanel.remove(ab); |
---|
2743 | 3368 | |
---|
2744 | | - ab.GetObject().editWindow = null; |
---|
| 3369 | + //ab.GetObject().editWindow = null; |
---|
| 3370 | + ab.GetObject().manipWindow = null; |
---|
2745 | 3371 | // ab.GetObject().objectUI = null; // ????????? |
---|
2746 | 3372 | |
---|
2747 | 3373 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2748 | 3374 | break; |
---|
2749 | 3375 | } |
---|
2750 | 3376 | } |
---|
| 3377 | + |
---|
| 3378 | + cameraView.requestFocusInWindow(); |
---|
2751 | 3379 | refreshContents(true); |
---|
2752 | 3380 | } else |
---|
2753 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3381 | + if (source == editItem || source == editButton) |
---|
2754 | 3382 | { |
---|
| 3383 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3384 | + { |
---|
| 3385 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3386 | + child.pinned = true; |
---|
| 3387 | + } |
---|
| 3388 | + |
---|
2755 | 3389 | EditSelection(false); |
---|
2756 | 3390 | } else |
---|
2757 | | - if (event.getSource() == uneditButton) |
---|
| 3391 | + if (source == uneditButton) |
---|
2758 | 3392 | { |
---|
2759 | 3393 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2760 | 3394 | { |
---|
2761 | 3395 | Object3D child = (Object3D)e.nextElement(); |
---|
2762 | 3396 | if(child.editWindow != null) |
---|
2763 | 3397 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3398 | + child.pinned = false; |
---|
2764 | 3399 | child.CloseUI(); |
---|
2765 | 3400 | listUI.remove(child); |
---|
2766 | 3401 | |
---|
2767 | | - child.editWindow = null; // ??????????? |
---|
| 3402 | + //child.editWindow = null; // ??????????? |
---|
2768 | 3403 | } |
---|
2769 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3404 | + objEditor.ctrlPanel.FlushUI(); |
---|
2770 | 3405 | //objEditor.jTree.clearSelection(); |
---|
2771 | 3406 | //objEditor.ResetSliders(); |
---|
2772 | 3407 | refreshContents(true); |
---|
2773 | 3408 | } else |
---|
2774 | | - if (event.getSource() == clearPanelButton) |
---|
| 3409 | + if (source == clearPanelButton) |
---|
2775 | 3410 | { |
---|
2776 | 3411 | assert(copy == group); |
---|
2777 | 3412 | //copy.ClearUI(); |
---|
2778 | 3413 | for (Object3D obj : listUI) |
---|
2779 | 3414 | { |
---|
| 3415 | + obj.pinned = false; |
---|
2780 | 3416 | obj.CloseUI(); |
---|
2781 | 3417 | } |
---|
2782 | 3418 | listUI.clear(); |
---|
2783 | 3419 | refreshContents(true); |
---|
2784 | 3420 | } else |
---|
2785 | | - if (event.getSource() == allParamsButton) |
---|
| 3421 | + if (source == allParamsButton) |
---|
2786 | 3422 | { |
---|
2787 | 3423 | assert(copy == group); |
---|
2788 | 3424 | |
---|
2789 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3425 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2790 | 3426 | |
---|
2791 | 3427 | for (Object3D obj : listUI) |
---|
2792 | 3428 | { |
---|
.. | .. |
---|
2803 | 3439 | |
---|
2804 | 3440 | refreshContents(true); |
---|
2805 | 3441 | } else |
---|
2806 | | - if (event.getSource() == unselectButton) |
---|
| 3442 | + if (source == unselectButton) |
---|
2807 | 3443 | { |
---|
2808 | 3444 | objEditor.jTree.clearSelection(); |
---|
2809 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3445 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2810 | 3446 | objEditor.ResetSliders(); |
---|
2811 | 3447 | refreshContents(true); |
---|
2812 | 3448 | } else |
---|
2813 | | - if(event.getSource() instanceof cRadio) |
---|
| 3449 | + if(source instanceof cRadio) |
---|
2814 | 3450 | { |
---|
2815 | 3451 | group.parent = keepparent; |
---|
2816 | 3452 | group.attributes = 0; |
---|
2817 | 3453 | //group.editWindow = null; |
---|
2818 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3454 | + /*cRadio*/ radio = (cRadio)source; |
---|
2819 | 3455 | Object3D obj = radio.GetObject(); |
---|
2820 | 3456 | System.out.println("Edit " + obj); |
---|
2821 | 3457 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2835 | 3471 | } |
---|
2836 | 3472 | |
---|
2837 | 3473 | copy = group; |
---|
2838 | | - //CameraPane.theRenderer.object = group; |
---|
| 3474 | + //Globals.theRenderer.object = group; |
---|
2839 | 3475 | if(!useclient) |
---|
2840 | 3476 | { |
---|
2841 | 3477 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2844 | 3480 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2845 | 3481 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2846 | 3482 | cameraView.object = group; |
---|
2847 | | - cameraView.lighttouched = true; |
---|
| 3483 | + //cameraView.lighttouched = true; |
---|
| 3484 | + Globals.lighttouched = true; |
---|
2848 | 3485 | topView.object = group; |
---|
2849 | 3486 | frontView.object = group; |
---|
2850 | 3487 | sideView.object = group; |
---|
2851 | 3488 | } |
---|
2852 | | - group.editWindow = this; |
---|
| 3489 | + |
---|
| 3490 | +// fix "+" issue |
---|
| 3491 | + //group.editWindow = this; |
---|
| 3492 | + group.manipWindow = this; |
---|
| 3493 | + |
---|
2853 | 3494 | /* |
---|
2854 | 3495 | currentLayout = radio.layout; |
---|
2855 | 3496 | if (currentLayout == null) |
---|
2856 | 3497 | currentLayout = sevenButton; |
---|
2857 | 3498 | */ |
---|
2858 | 3499 | radio.layout.doClick(); |
---|
| 3500 | + |
---|
| 3501 | + ClearUnpinned(); |
---|
| 3502 | + SetPinStates(group.selection.size() > 0); |
---|
| 3503 | + if (group.selection.size() == 1) |
---|
| 3504 | + EditSelection(false); |
---|
2859 | 3505 | keepparent = group.parent; |
---|
2860 | 3506 | // PARENT = NULL or not??? |
---|
2861 | 3507 | //group.parent = null; // ROOT |
---|
2862 | 3508 | //group.attributes = -1; |
---|
2863 | 3509 | ResetModel(); |
---|
| 3510 | + |
---|
| 3511 | + cameraView.requestFocusInWindow(); |
---|
2864 | 3512 | refreshContents(true); |
---|
2865 | | - } |
---|
| 3513 | + } else if (event.getSource() == editCameraItem) |
---|
| 3514 | + { |
---|
| 3515 | + cameraView.ProtectCamera(); |
---|
| 3516 | + cameraView.repaint(); |
---|
| 3517 | + return; |
---|
| 3518 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3519 | + { |
---|
| 3520 | + cameraView.RevertCamera(); |
---|
| 3521 | + cameraView.repaint(); |
---|
| 3522 | + return; |
---|
| 3523 | + // } else if (event.getSource() == textureButton) |
---|
| 3524 | + // { |
---|
| 3525 | + // return; // true; |
---|
| 3526 | + } |
---|
2866 | 3527 | else |
---|
2867 | 3528 | { |
---|
2868 | 3529 | //return super.action(event, arg); |
---|
.. | .. |
---|
2871 | 3532 | } |
---|
2872 | 3533 | |
---|
2873 | 3534 | boolean useclient = false; |
---|
2874 | | - cRadio radio; |
---|
2875 | 3535 | |
---|
2876 | 3536 | void ToggleRoot() |
---|
2877 | 3537 | { |
---|
.. | .. |
---|
2880 | 3540 | if (useclient) |
---|
2881 | 3541 | { |
---|
2882 | 3542 | cameraView.object = client; |
---|
2883 | | - cameraView.lighttouched = true; |
---|
| 3543 | + Globals.lighttouched = true; |
---|
2884 | 3544 | //topView.object = client; |
---|
2885 | 3545 | //frontView.object = client; |
---|
2886 | 3546 | //sideView.object = client; |
---|
.. | .. |
---|
2888 | 3548 | else |
---|
2889 | 3549 | { |
---|
2890 | 3550 | cameraView.object = group; |
---|
2891 | | - cameraView.lighttouched = true; |
---|
| 3551 | + Globals.lighttouched = true; |
---|
2892 | 3552 | //topView.object = group; |
---|
2893 | 3553 | //frontView.object = group; |
---|
2894 | 3554 | //sideView.object = group; |
---|
.. | .. |
---|
2923 | 3583 | refreshContents(); |
---|
2924 | 3584 | } |
---|
2925 | 3585 | |
---|
| 3586 | + void TransformChildren() |
---|
| 3587 | + { |
---|
| 3588 | + Object3D obj; |
---|
| 3589 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3590 | + { |
---|
| 3591 | + obj = (Object3D)e.nextElement(); |
---|
| 3592 | + obj.KeepTextureMatrices(); |
---|
| 3593 | + obj.TransformChildren(); |
---|
| 3594 | + obj.RestoreTextureMatrices(); |
---|
| 3595 | + |
---|
| 3596 | +// if (obj.parent == null) |
---|
| 3597 | +// { |
---|
| 3598 | +// System.out.println("NULL PARENT!"); |
---|
| 3599 | +// new Exception().printStackTrace(); |
---|
| 3600 | +// } |
---|
| 3601 | +// else |
---|
| 3602 | +// TouchTransform(obj); |
---|
| 3603 | +// //obj.parent.Touch(); |
---|
| 3604 | + } |
---|
| 3605 | + |
---|
| 3606 | + refreshContents(); |
---|
| 3607 | + } |
---|
2926 | 3608 | |
---|
2927 | 3609 | void ResetTransform() |
---|
2928 | 3610 | { |
---|
.. | .. |
---|
3035 | 3717 | refreshContents(); |
---|
3036 | 3718 | } |
---|
3037 | 3719 | |
---|
3038 | | - void ResetCentroid() |
---|
| 3720 | + void ResetCentroid(boolean full) |
---|
3039 | 3721 | { |
---|
3040 | 3722 | Object3D obj; |
---|
3041 | 3723 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3050 | 3732 | LA.matIdentity(Object3D.mat); |
---|
3051 | 3733 | obj.getBounds(minima, maxima, false); |
---|
3052 | 3734 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3053 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3735 | + if (full) |
---|
| 3736 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3054 | 3737 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3055 | 3738 | obj.TransformMesh(Object3D.mat); |
---|
| 3739 | + |
---|
3056 | 3740 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3057 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3741 | + if (full) |
---|
| 3742 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3058 | 3743 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3744 | + |
---|
3059 | 3745 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3060 | 3746 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3061 | 3747 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3084 | 3770 | |
---|
3085 | 3771 | int size = obj.MemorySize(); |
---|
3086 | 3772 | |
---|
3087 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3773 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3774 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3088 | 3775 | } |
---|
3089 | 3776 | } |
---|
3090 | 3777 | catch (Exception e) |
---|
.. | .. |
---|
3121 | 3808 | obj = (Object3D)e.nextElement(); |
---|
3122 | 3809 | |
---|
3123 | 3810 | System.out.println("Object is: " + obj); |
---|
3124 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3811 | + Grafreed.AnalyzeObject(obj); |
---|
3125 | 3812 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3126 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3813 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3127 | 3814 | |
---|
3128 | 3815 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3129 | 3816 | } |
---|
.. | .. |
---|
3165 | 3852 | void GenNormals(boolean crease) |
---|
3166 | 3853 | { |
---|
3167 | 3854 | group.GenNormalsS(crease); |
---|
| 3855 | + |
---|
| 3856 | + refreshContents(); |
---|
| 3857 | + } |
---|
| 3858 | + |
---|
| 3859 | + void GenNormalsMESH() |
---|
| 3860 | + { |
---|
| 3861 | + group.GenNormalsMeshS(); |
---|
| 3862 | + |
---|
| 3863 | + refreshContents(); |
---|
| 3864 | + } |
---|
| 3865 | + |
---|
| 3866 | + void GenNormalsMINE() |
---|
| 3867 | + { |
---|
| 3868 | + group.selection.GenNormalsMINE(); |
---|
3168 | 3869 | |
---|
3169 | 3870 | refreshContents(); |
---|
3170 | 3871 | } |
---|
.. | .. |
---|
3250 | 3951 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3251 | 3952 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3252 | 3953 | // |
---|
3253 | | -// g.add(GraphreeD.clipboard); |
---|
| 3954 | +// g.add(GrafreeD.clipboard); |
---|
3254 | 3955 | // |
---|
3255 | 3956 | // buffer.add(g); |
---|
3256 | 3957 | // } |
---|
.. | .. |
---|
3269 | 3970 | // nodes = new Object3D(); |
---|
3270 | 3971 | // vertices = new Vector<Vertex>(); |
---|
3271 | 3972 | // |
---|
3272 | | -// boolean epsequal = GraphreeD.epsequal; |
---|
3273 | | -// GraphreeD.epsequal = true; |
---|
| 3973 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3974 | +// GrafreeD.epsequal = true; |
---|
3274 | 3975 | // |
---|
3275 | 3976 | // for (int i=0; i<group.selection.size(); i++) |
---|
3276 | 3977 | // { |
---|
.. | .. |
---|
3311 | 4012 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3312 | 4013 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3313 | 4014 | // |
---|
3314 | | -// g.add(GraphreeD.clipboard); |
---|
| 4015 | +// g.add(GrafreeD.clipboard); |
---|
3315 | 4016 | // |
---|
3316 | 4017 | // buffer.add(g); |
---|
3317 | 4018 | // } |
---|
.. | .. |
---|
3319 | 4020 | // makeSomething(buffer, i==group.selection.size()-1); |
---|
3320 | 4021 | // } |
---|
3321 | 4022 | // |
---|
3322 | | -// GraphreeD.epsequal = epsequal; |
---|
| 4023 | +// GrafreeD.epsequal = epsequal; |
---|
3323 | 4024 | // |
---|
3324 | 4025 | // //buffer = null; |
---|
3325 | 4026 | // temprep = null; |
---|
.. | .. |
---|
3330 | 4031 | |
---|
3331 | 4032 | void ParseVertices() |
---|
3332 | 4033 | { |
---|
3333 | | - boolean epsequal = GraphreeD.epsequal; |
---|
3334 | | - GraphreeD.epsequal = true; |
---|
| 4034 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4035 | + Grafreed.epsequal = true; |
---|
3335 | 4036 | |
---|
3336 | 4037 | for (int i=0; i<group.selection.size(); i++) |
---|
3337 | 4038 | { |
---|
.. | .. |
---|
3356 | 4057 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3357 | 4058 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3358 | 4059 | |
---|
3359 | | - g.add(GraphreeD.clipboard); |
---|
| 4060 | + g.add(Grafreed.clipboard); |
---|
3360 | 4061 | |
---|
3361 | 4062 | buffer.add(g); |
---|
3362 | 4063 | } |
---|
.. | .. |
---|
3371 | 4072 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3372 | 4073 | } |
---|
3373 | 4074 | |
---|
3374 | | - GraphreeD.epsequal = epsequal; |
---|
| 4075 | + Grafreed.epsequal = epsequal; |
---|
3375 | 4076 | |
---|
3376 | 4077 | refreshContents(); |
---|
3377 | 4078 | } |
---|
.. | .. |
---|
3389 | 4090 | String pigment = Object3D.GetPigment(tex); |
---|
3390 | 4091 | //String bump = Object3D.GetBump(tex); |
---|
3391 | 4092 | |
---|
3392 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4093 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4094 | + |
---|
| 4095 | + try |
---|
| 4096 | + { |
---|
| 4097 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4098 | + } |
---|
| 4099 | + catch (Exception e) |
---|
| 4100 | + { |
---|
| 4101 | + System.err.println("FAIL: " + node); |
---|
| 4102 | + } |
---|
3393 | 4103 | |
---|
3394 | 4104 | double s = v.s; |
---|
3395 | 4105 | |
---|
.. | .. |
---|
3416 | 4126 | scale /= 3; |
---|
3417 | 4127 | |
---|
3418 | 4128 | scale /= 0xFF; |
---|
3419 | | - scale /= 4; |
---|
| 4129 | + // c'est quoi ca? scale /= 4; |
---|
3420 | 4130 | |
---|
3421 | 4131 | //v.AO = scale; |
---|
3422 | 4132 | |
---|
.. | .. |
---|
3437 | 4147 | |
---|
3438 | 4148 | void Align() |
---|
3439 | 4149 | { |
---|
| 4150 | + if (group.selection.size() == 0) |
---|
| 4151 | + return; |
---|
| 4152 | + |
---|
| 4153 | + cVector bbmin = new cVector(); |
---|
| 4154 | + cVector bbmax = new cVector(); |
---|
| 4155 | + |
---|
| 4156 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 4157 | + |
---|
| 4158 | + double dx = bbmax.x - bbmin.x; |
---|
| 4159 | + double dy = bbmax.y - bbmin.y; |
---|
| 4160 | + double dz = bbmax.z - bbmin.z; |
---|
| 4161 | + |
---|
| 4162 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 4163 | + |
---|
3440 | 4164 | for (int i=0; i<group.selection.size(); i++) |
---|
3441 | 4165 | { |
---|
3442 | 4166 | Object3D obj = group.selection.get(i); |
---|
3443 | 4167 | |
---|
3444 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3445 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 4168 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 4169 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3446 | 4170 | } |
---|
3447 | 4171 | |
---|
3448 | 4172 | refreshContents(); |
---|
.. | .. |
---|
3455 | 4179 | // ref.SaveSupports(); |
---|
3456 | 4180 | // Object3D par = ref.parent; |
---|
3457 | 4181 | // ref.parent = null; |
---|
3458 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 4182 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3459 | 4183 | // ref.parent = par; |
---|
3460 | 4184 | // ref.RestoreSupports(); |
---|
3461 | 4185 | |
---|
.. | .. |
---|
3463 | 4187 | |
---|
3464 | 4188 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3465 | 4189 | |
---|
3466 | | - boolean random = CameraPane.RANDOM; |
---|
3467 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4190 | + boolean random = CameraPane.SWITCH; |
---|
| 4191 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3468 | 4192 | lowres.linkVerticesThis(null); |
---|
3469 | 4193 | lowres.linkVerticesThis(sn); |
---|
3470 | | - CameraPane.RANDOM = random; |
---|
| 4194 | + CameraPane.SWITCH = random; |
---|
3471 | 4195 | |
---|
3472 | 4196 | System.err.flush(); |
---|
3473 | 4197 | |
---|
.. | .. |
---|
3485 | 4209 | // lowres.SaveSupports(); |
---|
3486 | 4210 | // par = lowres.parent; |
---|
3487 | 4211 | // lowres.parent = null; |
---|
3488 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 4212 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3489 | 4213 | Object3D newlow = CloneObject(lowres, false); |
---|
3490 | 4214 | newlow.name = sn.switchobject.get(i).name; |
---|
3491 | 4215 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3507 | 4231 | return; |
---|
3508 | 4232 | |
---|
3509 | 4233 | Object3D poses = group.selection.get(0); |
---|
3510 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 4234 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3511 | 4235 | |
---|
3512 | 4236 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3513 | 4237 | |
---|
.. | .. |
---|
3676 | 4400 | group.selection.RelinkToSupport(); // july 2014 |
---|
3677 | 4401 | System.out.println("DONE."); |
---|
3678 | 4402 | refreshContents(); |
---|
3679 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4403 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3680 | 4404 | } |
---|
3681 | 4405 | |
---|
3682 | 4406 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3701 | 4425 | |
---|
3702 | 4426 | void ClipMesh() |
---|
3703 | 4427 | { |
---|
3704 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 4428 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3705 | 4429 | { |
---|
3706 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 4430 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3707 | 4431 | |
---|
3708 | 4432 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3709 | 4433 | content = ((cGroup)content).get(0); |
---|
3710 | 4434 | |
---|
3711 | 4435 | // for (int i=0; i<group.selection.size(); i++) |
---|
3712 | 4436 | // { |
---|
3713 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 4437 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3714 | 4438 | // } |
---|
3715 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4439 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3716 | 4440 | } |
---|
3717 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4441 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3718 | 4442 | System.out.println("DONE."); |
---|
3719 | 4443 | refreshContents(); |
---|
3720 | 4444 | } |
---|
.. | .. |
---|
3759 | 4483 | void MarkLeaves(boolean hide) |
---|
3760 | 4484 | { |
---|
3761 | 4485 | group.selection.MarkLeaves(hide); |
---|
| 4486 | + refreshContents(); |
---|
| 4487 | + } |
---|
| 4488 | + |
---|
| 4489 | + void RewindLeaves(boolean hide) |
---|
| 4490 | + { |
---|
| 4491 | + group.selection.RewindLeaves(hide); |
---|
| 4492 | + refreshContents(); |
---|
| 4493 | + } |
---|
| 4494 | + |
---|
| 4495 | + void RandomLeaves(boolean hide) |
---|
| 4496 | + { |
---|
| 4497 | + group.selection.RandomLeaves(hide); |
---|
3762 | 4498 | refreshContents(); |
---|
3763 | 4499 | } |
---|
3764 | 4500 | |
---|
.. | .. |
---|
3833 | 4569 | // } |
---|
3834 | 4570 | // } |
---|
3835 | 4571 | |
---|
3836 | | - static boolean allparams = true; |
---|
3837 | | - |
---|
3838 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3839 | | - |
---|
3840 | 4572 | void EditSelection(boolean newWindow) |
---|
3841 | 4573 | { |
---|
3842 | 4574 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
3844 | 4576 | { |
---|
3845 | 4577 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3846 | 4578 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3847 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4579 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3848 | 4580 | |
---|
3849 | 4581 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3850 | | - if(elem != group) |
---|
| 4582 | + if(elem != group || !newWindow) |
---|
3851 | 4583 | { |
---|
3852 | 4584 | // if (!(elem instanceof Composite)) |
---|
3853 | 4585 | // newWindow = false; |
---|
.. | .. |
---|
3929 | 4661 | //new Exception().printStackTrace(); |
---|
3930 | 4662 | |
---|
3931 | 4663 | freezemodel = true; |
---|
3932 | | - |
---|
| 4664 | + ClearUnpinned(); |
---|
| 4665 | + |
---|
3933 | 4666 | /**/ |
---|
3934 | 4667 | //switch (event.id) |
---|
3935 | 4668 | { |
---|
.. | .. |
---|
3937 | 4670 | //case 702: // Event.LIST_DESELECT |
---|
3938 | 4671 | group.deselectAll(); |
---|
3939 | 4672 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
3940 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
3941 | 4673 | if (tps != null) |
---|
3942 | 4674 | { |
---|
3943 | 4675 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
3946 | 4678 | |
---|
3947 | 4679 | //if (child.parent != null) |
---|
3948 | 4680 | //child.parent.addSelectee(child); |
---|
| 4681 | + objEditor.SetMaterial(child); |
---|
3949 | 4682 | group.addSelectee(child); |
---|
3950 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
3951 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
3952 | | - System.err.println("info : " + child.GetPath()); |
---|
3953 | 4683 | } |
---|
3954 | 4684 | } |
---|
3955 | | - else |
---|
3956 | | - { |
---|
3957 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3958 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3959 | | - System.err.println("info : " + group.GetPath()); |
---|
3960 | | - } |
---|
| 4685 | +// else |
---|
| 4686 | +// { |
---|
| 4687 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4688 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4689 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4690 | +// } |
---|
3961 | 4691 | |
---|
3962 | | - objEditor.SetText(); // jan 2014 |
---|
3963 | | - |
---|
3964 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4692 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
3965 | 4693 | CameraPane.flash = true; |
---|
3966 | 4694 | |
---|
3967 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4695 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
3968 | 4696 | // a camera |
---|
3969 | 4697 | { |
---|
3970 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3971 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3972 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3973 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4698 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4699 | + { |
---|
| 4700 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4701 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4702 | + } |
---|
| 4703 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4704 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3974 | 4705 | } |
---|
3975 | 4706 | |
---|
| 4707 | + if (tps != null && tps.length == 1) |
---|
| 4708 | + { |
---|
| 4709 | + EditSelection(false); |
---|
| 4710 | + } |
---|
| 4711 | + |
---|
| 4712 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4713 | + |
---|
3976 | 4714 | refreshContents(); |
---|
3977 | 4715 | //return true; |
---|
3978 | 4716 | } |
---|
.. | .. |
---|
3981 | 4719 | |
---|
3982 | 4720 | freezemodel = false; |
---|
3983 | 4721 | } |
---|
| 4722 | + |
---|
| 4723 | + void SetPinStates(boolean enabled) |
---|
| 4724 | + { |
---|
| 4725 | + editButton.setEnabled(enabled); |
---|
| 4726 | + uneditButton.setEnabled(enabled); |
---|
| 4727 | + unselectButton.setEnabled(enabled); |
---|
| 4728 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4729 | + } |
---|
| 4730 | + |
---|
| 4731 | + void refreshContents(boolean cp) |
---|
| 4732 | + { |
---|
| 4733 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4734 | + if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4735 | + { |
---|
| 4736 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4737 | + |
---|
| 4738 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4739 | + { |
---|
| 4740 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4741 | + |
---|
| 4742 | + objEditor.AddInfo(child, this, true); |
---|
| 4743 | + System.err.println("info : " + child.GetPath()); |
---|
| 4744 | + } |
---|
| 4745 | + |
---|
| 4746 | + objEditor.SetText(); // jan 2014 |
---|
| 4747 | + } |
---|
| 4748 | + |
---|
| 4749 | + super.refreshContents(cp); |
---|
| 4750 | + } |
---|
3984 | 4751 | |
---|
3985 | 4752 | void linkSomething(Object3D thing) |
---|
3986 | 4753 | { |
---|
.. | .. |
---|
4052 | 4819 | { |
---|
4053 | 4820 | if (group.selection.isEmpty()) |
---|
4054 | 4821 | return; |
---|
4055 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4822 | + |
---|
| 4823 | + Grafreed.clipboardIsTempGroup = false; |
---|
4056 | 4824 | Composite tGroup = null; |
---|
4057 | 4825 | if (group.selection.size() > 0) // 1) |
---|
4058 | 4826 | { |
---|
4059 | 4827 | tGroup = new cGroup(); |
---|
4060 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4828 | + Grafreed.clipboardIsTempGroup = true; |
---|
4061 | 4829 | } |
---|
4062 | 4830 | |
---|
4063 | 4831 | if (cut) |
---|
4064 | 4832 | { |
---|
| 4833 | + if (Globals.SAVEONMAKE) |
---|
| 4834 | + Save(); |
---|
4065 | 4835 | //int indices[] = jList.getSelectedIndices(); |
---|
4066 | 4836 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4067 | 4837 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4097 | 4867 | //System.out.println("cut " + child); |
---|
4098 | 4868 | //System.out.println("parent = " + child.parent); |
---|
4099 | 4869 | // tmp.addChild(child); |
---|
4100 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4870 | + if (Grafreed.clipboardIsTempGroup) |
---|
4101 | 4871 | tGroup.add/*Child*/(tmp); |
---|
4102 | 4872 | else |
---|
4103 | | - GraphreeD.clipboard = tmp; |
---|
| 4873 | + Grafreed.clipboard = tmp; |
---|
4104 | 4874 | } |
---|
4105 | 4875 | else |
---|
4106 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4876 | + if (Grafreed.clipboardIsTempGroup) |
---|
4107 | 4877 | tGroup.add/*Child*/(child); |
---|
4108 | 4878 | else |
---|
4109 | | - GraphreeD.clipboard = child; |
---|
| 4879 | + Grafreed.clipboard = child; |
---|
4110 | 4880 | } |
---|
4111 | 4881 | |
---|
4112 | 4882 | //ResetModel(); |
---|
.. | .. |
---|
4138 | 4908 | //System.out.println("cut " + elem); |
---|
4139 | 4909 | //System.out.println("parent = " + elem.parent); |
---|
4140 | 4910 | // tmp.addChild(elem); |
---|
4141 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4911 | + if (Grafreed.clipboardIsTempGroup) |
---|
4142 | 4912 | tGroup.add/*Child*/(tmp); |
---|
4143 | 4913 | else |
---|
4144 | | - GraphreeD.clipboard = tmp; |
---|
| 4914 | + Grafreed.clipboard = tmp; |
---|
4145 | 4915 | } |
---|
4146 | 4916 | else |
---|
4147 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4917 | + if (Grafreed.clipboardIsTempGroup) |
---|
4148 | 4918 | tGroup.add/*Child*/(child); |
---|
4149 | 4919 | else |
---|
4150 | | - GraphreeD.clipboard = child; |
---|
| 4920 | + Grafreed.clipboard = child; |
---|
4151 | 4921 | } |
---|
4152 | 4922 | |
---|
4153 | 4923 | } |
---|
4154 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
4155 | | - GraphreeD.clipboard = tGroup; |
---|
| 4924 | + |
---|
| 4925 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4926 | + Grafreed.clipboard = tGroup; |
---|
| 4927 | + |
---|
4156 | 4928 | if (cut) |
---|
4157 | 4929 | { |
---|
4158 | 4930 | ResetModel(); |
---|
.. | .. |
---|
4162 | 4934 | |
---|
4163 | 4935 | void paste(boolean expand) |
---|
4164 | 4936 | { |
---|
4165 | | - // if (GraphreeD.clipboard == null) |
---|
| 4937 | + // if (GrafreeD.clipboard == null) |
---|
4166 | 4938 | // return; |
---|
4167 | 4939 | boolean first = true; |
---|
4168 | 4940 | |
---|
4169 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4941 | + if (Grafreed.clipboardIsTempGroup) |
---|
4170 | 4942 | { |
---|
4171 | 4943 | Composite temp; |
---|
4172 | 4944 | |
---|
.. | .. |
---|
4177 | 4949 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4178 | 4950 | */ |
---|
4179 | 4951 | Object3D elem; |
---|
4180 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4952 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4181 | 4953 | { |
---|
4182 | 4954 | Object3D child = (Object3D)e.nextElement(); |
---|
4183 | 4955 | |
---|
.. | .. |
---|
4191 | 4963 | else |
---|
4192 | 4964 | elem = child.deepCopy(); // ? |
---|
4193 | 4965 | child.parent = keepparent; |
---|
4194 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4966 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4195 | 4967 | // elem = elem.get(0); |
---|
4196 | 4968 | makeSomething(elem, true); // ?? first); |
---|
4197 | 4969 | //group.addChild(elem); |
---|
.. | .. |
---|
4211 | 4983 | //Object3D cb = Applet3D.clipboard; |
---|
4212 | 4984 | //temp.addChild(cb); |
---|
4213 | 4985 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4214 | | - assert(GraphreeD.clipboard.parent == null); |
---|
4215 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
4216 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4217 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
4218 | | - makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy()); |
---|
| 4986 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4987 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4988 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4989 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4990 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4219 | 4991 | else |
---|
4220 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4221 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4992 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4993 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4222 | 4994 | } |
---|
4223 | 4995 | |
---|
4224 | 4996 | ResetModel(); |
---|
4225 | 4997 | refreshContents(); |
---|
4226 | 4998 | } |
---|
4227 | 4999 | |
---|
4228 | | - void pasteInto(boolean copyit) |
---|
| 5000 | + void pasteInto(boolean copyit, boolean clone) |
---|
4229 | 5001 | { |
---|
4230 | | -// if (GraphreeD.clipboard == null) |
---|
| 5002 | +// if (GrafreeD.clipboard == null) |
---|
4231 | 5003 | // return; |
---|
4232 | 5004 | |
---|
4233 | 5005 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4254 | 5026 | if (copyit) |
---|
4255 | 5027 | { |
---|
4256 | 5028 | // paste(false); |
---|
4257 | | - CloneClipboard(false); // sept 2014 |
---|
| 5029 | + if (clone) |
---|
| 5030 | + { |
---|
| 5031 | + CloneClipboard(false); // sept 2014 |
---|
| 5032 | + } |
---|
| 5033 | + else |
---|
| 5034 | + { |
---|
| 5035 | + paste(false); |
---|
| 5036 | + } |
---|
4258 | 5037 | } |
---|
4259 | 5038 | else |
---|
4260 | 5039 | { |
---|
4261 | 5040 | boolean first = true; |
---|
4262 | 5041 | |
---|
4263 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 5042 | + if (Grafreed.clipboardIsTempGroup) |
---|
4264 | 5043 | { |
---|
4265 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 5044 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4266 | 5045 | Object3D copy; |
---|
4267 | 5046 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4268 | 5047 | { |
---|
.. | .. |
---|
4272 | 5051 | } |
---|
4273 | 5052 | } else |
---|
4274 | 5053 | { |
---|
4275 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 5054 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4276 | 5055 | } |
---|
4277 | 5056 | } |
---|
4278 | 5057 | } |
---|
.. | .. |
---|
4464 | 5243 | makeSomething(csg); |
---|
4465 | 5244 | } |
---|
4466 | 5245 | |
---|
| 5246 | + void Ungroup(Object3D g) |
---|
| 5247 | + { |
---|
| 5248 | + if (g instanceof HiddenObject) |
---|
| 5249 | + { |
---|
| 5250 | + HiddenObject h = (HiddenObject) g; |
---|
| 5251 | + |
---|
| 5252 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 5253 | + { |
---|
| 5254 | + objEditor.makeSomething(h.get(i), false); |
---|
| 5255 | + } |
---|
| 5256 | + } |
---|
| 5257 | + else |
---|
| 5258 | + { |
---|
| 5259 | + for (int i=0; i<g.Size(); i++) |
---|
| 5260 | + { |
---|
| 5261 | + objEditor.makeSomething(g.get(i), false); |
---|
| 5262 | + } |
---|
| 5263 | + } |
---|
| 5264 | + } |
---|
| 5265 | + |
---|
4467 | 5266 | void ungroup() |
---|
4468 | 5267 | { |
---|
4469 | 5268 | /* |
---|
.. | .. |
---|
4657 | 5456 | } |
---|
4658 | 5457 | */ |
---|
4659 | 5458 | |
---|
4660 | | - void ImportGFD() |
---|
4661 | | - { |
---|
4662 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
4663 | | - browser.show(); |
---|
4664 | | - String filename = browser.getFile(); |
---|
4665 | | - if (filename != null && filename.length() > 0) |
---|
4666 | | - { |
---|
4667 | | - String fullname = browser.getDirectory() + filename; |
---|
4668 | | - |
---|
4669 | | - //Object3D readobj = |
---|
4670 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4671 | | - //makeSomething(readobj); |
---|
4672 | | - } |
---|
4673 | | - } |
---|
4674 | | - |
---|
4675 | 5459 | /* |
---|
4676 | 5460 | public void Callback(Object obj) |
---|
4677 | 5461 | { |
---|
.. | .. |
---|
4695 | 5479 | } |
---|
4696 | 5480 | */ |
---|
4697 | 5481 | |
---|
4698 | | - void ImportVRMLX3D() |
---|
4699 | | - { |
---|
4700 | | - if (GraphreeD.standAlone) |
---|
4701 | | - { |
---|
4702 | | - /**/ |
---|
4703 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4704 | | - browser.show(); |
---|
4705 | | - String filename = browser.getFile(); |
---|
4706 | | - if (filename != null && filename.length() > 0) |
---|
4707 | | - { |
---|
4708 | | - String fullname = browser.getDirectory() + filename; |
---|
4709 | | - LoadVRMLX3D(fullname); |
---|
4710 | | - } |
---|
4711 | | - /**/ |
---|
4712 | | - } |
---|
4713 | | - } |
---|
4714 | | - |
---|
4715 | 5482 | String GetFile(String dialogName) |
---|
4716 | 5483 | { |
---|
4717 | | - if (GraphreeD.standAlone) |
---|
| 5484 | + if (Grafreed.standAlone) |
---|
4718 | 5485 | { |
---|
4719 | 5486 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4720 | 5487 | browser.show(); |
---|
.. | .. |
---|
4778 | 5545 | cButton flashSelectionButton; |
---|
4779 | 5546 | cButton editButton; |
---|
4780 | 5547 | cButton uneditButton; |
---|
| 5548 | + JCheckBox allParamsButton; |
---|
4781 | 5549 | cButton clearpanelButton; |
---|
4782 | | - cButton allParamsButton; |
---|
4783 | 5550 | cButton unselectButton; |
---|
4784 | 5551 | |
---|
| 5552 | + cButton restoreCameraButton; |
---|
| 5553 | + |
---|
| 5554 | + cButton saveButton; |
---|
| 5555 | + cButton oneStepButton; |
---|
| 5556 | + |
---|
| 5557 | + cButton groupButton; |
---|
| 5558 | + cButton ungroupButton; |
---|
| 5559 | + cButton compositeButton; |
---|
| 5560 | + cButton switchButton; |
---|
| 5561 | + cButton loopButton; |
---|
| 5562 | + cButton textureButton; |
---|
| 5563 | + |
---|
| 5564 | + cButton gridButton; |
---|
| 5565 | + cButton boxButton; |
---|
| 5566 | + cButton sphereButton; |
---|
| 5567 | + cButton coneButton; |
---|
| 5568 | + cButton torusButton; |
---|
| 5569 | + cButton superButton; |
---|
| 5570 | + cButton kleinButton; |
---|
| 5571 | + cButton particlesButton; |
---|
| 5572 | + cButton overlayButton; |
---|
| 5573 | + cButton lightButton; |
---|
| 5574 | + |
---|
4785 | 5575 | cButton screenfitButton; |
---|
4786 | 5576 | cButton screenfitpointButton; |
---|
4787 | 5577 | cButton snapobjectButton; |
---|
.. | .. |
---|
4793 | 5583 | |
---|
4794 | 5584 | cButton setsupportButton; |
---|
4795 | 5585 | |
---|
4796 | | - cButton twoButton; |
---|
4797 | | - cButton sixButton; |
---|
4798 | | - cButton threeButton; |
---|
4799 | | - cButton sevenButton; |
---|
4800 | | - cButton fourButton; // full panel |
---|
4801 | | - cButton oneButton; // full XYZ |
---|
4802 | | - //cButton currentLayout; |
---|
4803 | | - |
---|
4804 | 5586 | // |
---|
4805 | 5587 | //Composite |
---|
4806 | 5588 | Object3D // to do !! |
---|
.. | .. |
---|
4810 | 5592 | //JTree jTree; |
---|
4811 | 5593 | private MenuItem lookAtItem; |
---|
4812 | 5594 | private MenuItem lookFromItem; |
---|
4813 | | - private MenuItem switchItem; |
---|
| 5595 | + private MenuItem switchViewItem; |
---|
4814 | 5596 | private MenuItem cutItem; |
---|
4815 | | - private MenuItem duplicateItem; |
---|
| 5597 | + private MenuItem undoItem; |
---|
| 5598 | + private MenuItem redoItem; |
---|
| 5599 | + private JMenuItem duplicateItem; |
---|
4816 | 5600 | private MenuItem cloneItem; |
---|
4817 | 5601 | private MenuItem cloneSupportItem; |
---|
4818 | 5602 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4823 | 5607 | private MenuItem resetsupportItem; |
---|
4824 | 5608 | private MenuItem resetreferencesItem; |
---|
4825 | 5609 | private MenuItem linkverticesItem; |
---|
| 5610 | + private MenuItem relinkverticesItem; |
---|
4826 | 5611 | private MenuItem setMasterItem; |
---|
4827 | | - private MenuItem resetMeshItem; |
---|
| 5612 | + private MenuItem resetAllItem; |
---|
4828 | 5613 | private MenuItem stepAllItem; |
---|
4829 | 5614 | private MenuItem revertMeshItem; |
---|
4830 | 5615 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4835 | 5620 | private MenuItem mergeGeometriesItem; |
---|
4836 | 5621 | private MenuItem copyItem; |
---|
4837 | 5622 | private MenuItem pasteItem; |
---|
| 5623 | + private MenuItem pasteIntoItem; |
---|
4838 | 5624 | private MenuItem pasteLinkItem; |
---|
4839 | 5625 | private MenuItem pasteCloneItem; |
---|
4840 | 5626 | private MenuItem pasteExpandItem; |
---|
4841 | 5627 | private MenuItem clearItem; |
---|
4842 | 5628 | private MenuItem clearAllItem; |
---|
4843 | 5629 | private MenuItem genUVItem; |
---|
| 5630 | + private MenuItem genNormalsMESHItem; |
---|
4844 | 5631 | private MenuItem genNormalsCADItem; |
---|
4845 | 5632 | private MenuItem genNormalsORGANItem; |
---|
| 5633 | + private MenuItem genNormalsMINEItem; |
---|
4846 | 5634 | private MenuItem stripifyItem; |
---|
4847 | 5635 | private MenuItem unstripifyItem; |
---|
4848 | 5636 | private MenuItem trimItem; |
---|
.. | .. |
---|
4871 | 5659 | private MenuItem showleavesItem; |
---|
4872 | 5660 | private MenuItem markleavesItem; |
---|
4873 | 5661 | private MenuItem unmarkleavesItem; |
---|
| 5662 | + private MenuItem rewindleavesItem; |
---|
| 5663 | + private MenuItem unrewindleavesItem; |
---|
| 5664 | + private MenuItem randomleavesItem; |
---|
| 5665 | + private MenuItem unrandomleavesItem; |
---|
4874 | 5666 | |
---|
4875 | 5667 | private MenuItem flipVItem; |
---|
4876 | 5668 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
4882 | 5674 | private MenuItem panoTexturesItem; |
---|
4883 | 5675 | |
---|
4884 | 5676 | private MenuItem resetCentroidItem; |
---|
4885 | | - private MenuItem transformgeometryItem; |
---|
| 5677 | + private MenuItem resetCentroidXZItem; |
---|
4886 | 5678 | private MenuItem resetTransformItem; |
---|
| 5679 | + private MenuItem transformGeometryItem; |
---|
| 5680 | + private MenuItem transformChildrenItem; |
---|
| 5681 | + private MenuItem hideItem; |
---|
4887 | 5682 | private MenuItem grabItem; |
---|
4888 | 5683 | private MenuItem backItem; |
---|
4889 | 5684 | private MenuItem frontItem; |
---|
4890 | 5685 | private MenuItem cameraItem; |
---|
4891 | 5686 | private MenuItem compositeItem; |
---|
4892 | | - private MenuItem randomItem; |
---|
| 5687 | + private MenuItem switchItem; |
---|
4893 | 5688 | private MenuItem physicsItem; |
---|
4894 | 5689 | private MenuItem frameselectorItem; |
---|
4895 | 5690 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
4904 | 5699 | |
---|
4905 | 5700 | private MenuItem resetParentItem; |
---|
4906 | 5701 | private MenuItem repairParentItem; |
---|
| 5702 | + private MenuItem repairShadowItem; |
---|
4907 | 5703 | private MenuItem sortbysizeItem; |
---|
4908 | 5704 | private MenuItem sortbynameItem; |
---|
4909 | 5705 | |
---|
.. | .. |
---|
4924 | 5720 | private MenuItem coneItem; |
---|
4925 | 5721 | private MenuItem torusItem; |
---|
4926 | 5722 | private MenuItem superItem; |
---|
| 5723 | + private MenuItem kleinItem; |
---|
4927 | 5724 | private MenuItem blobItem; |
---|
4928 | 5725 | private MenuItem latheItem; |
---|
4929 | 5726 | private MenuItem bezierItem; |
---|
4930 | | - private MenuItem checkerItem; |
---|
| 5727 | + private MenuItem overlayItem; |
---|
4931 | 5728 | private MenuItem meshItem; |
---|
4932 | 5729 | // private MenuItem meshGroupItem; |
---|
4933 | 5730 | private MenuItem springItem; |
---|
.. | .. |
---|
4936 | 5733 | private MenuItem csgItem; |
---|
4937 | 5734 | private MenuItem templateItem; |
---|
4938 | 5735 | private MenuItem textureItem; |
---|
| 5736 | + private MenuItem billboardItem; |
---|
4939 | 5737 | private MenuItem shadowXItem; |
---|
4940 | 5738 | private MenuItem shadowYItem; |
---|
4941 | 5739 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4948 | 5746 | private MenuItem doubleItem; |
---|
4949 | 5747 | private MenuItem tripleItem; |
---|
4950 | 5748 | |
---|
4951 | | - private MenuItem importGFDItem; |
---|
4952 | | - private MenuItem importVRMLX3DItem; |
---|
4953 | | - private MenuItem import3DSItem; |
---|
4954 | | - private MenuItem importOBJItem; |
---|
4955 | | - |
---|
4956 | 5749 | private MenuItem computeAOItem; |
---|
4957 | 5750 | private MenuItem recompileItem; |
---|
4958 | 5751 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4962 | 5755 | private MenuItem analyzeItem; |
---|
4963 | 5756 | private MenuItem dumpItem; |
---|
4964 | 5757 | //boolean freezemodel = false; |
---|
| 5758 | + |
---|
| 5759 | + Menu cameraMenu; |
---|
| 5760 | + MenuItem editCameraItem; |
---|
| 5761 | + MenuItem restoreCameraItem; |
---|
4965 | 5762 | } |
---|