.. | .. |
---|
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 | | -class GroupEditor extends ObjEditor implements iParse, //iCallBack, |
---|
| 18 | +class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
18 | 19 | ObjectUI, |
---|
19 | 20 | Runnable, |
---|
20 | 21 | ActionListener, |
---|
.. | .. |
---|
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 | { |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
| 155 | + Menu menu; |
---|
| 156 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 157 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 158 | + //editItem.addActionListener(this); |
---|
| 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")); |
---|
| 166 | + duplicateItem.addActionListener(this); |
---|
| 167 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 168 | + cloneItem.addActionListener(this); |
---|
| 169 | + if (Globals.ADVANCED) |
---|
| 170 | + { |
---|
| 171 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 172 | + cloneSupportItem.addActionListener(this); |
---|
| 173 | + } |
---|
| 174 | + menu.add("-"); |
---|
| 175 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 176 | + cutItem.addActionListener(this); |
---|
| 177 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 178 | + copyItem.addActionListener(this); |
---|
| 179 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 180 | + pasteItem.addActionListener(this); |
---|
| 181 | + |
---|
| 182 | + menu.add("-"); |
---|
| 183 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 184 | + pasteIntoItem.addActionListener(this); |
---|
| 185 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 186 | + pasteLinkItem.addActionListener(this); |
---|
| 187 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 188 | + pasteCloneItem.addActionListener(this); |
---|
| 189 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 190 | +// pasteExpandItem.addActionListener(this); |
---|
| 191 | + menu.add("-"); |
---|
| 192 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 193 | + clearItem.addActionListener(this); |
---|
| 194 | + |
---|
| 195 | + if (Globals.ADVANCED) |
---|
| 196 | + { |
---|
| 197 | + // Deletes the cameras... |
---|
| 198 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 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(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + revertCameraItem.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("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()); |
---|
| 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 | + { |
---|
152 | 276 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 277 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 278 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 284 | lookAtItem.addActionListener(this); |
---|
161 | 285 | //lookFromItem.addActinoListener(this); |
---|
162 | 286 | //switchItem.addActionListener(this); |
---|
163 | | - Menu menu; |
---|
164 | | - oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | | - //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | | - //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | | - duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | | - cloneItem.addActionListener(this); |
---|
172 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | | - cloneSupportItem.addActionListener(this); |
---|
174 | | - menu.add("-"); |
---|
175 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | | - cutItem.addActionListener(this); |
---|
177 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
178 | | - copyItem.addActionListener(this); |
---|
179 | | - pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | | - pasteItem.addActionListener(this); |
---|
181 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | | - pasteLinkItem.addActionListener(this); |
---|
183 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | | - pasteCloneItem.addActionListener(this); |
---|
185 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | | -// pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
189 | | - clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | | - clearAllItem.addActionListener(this); |
---|
191 | | - menu.add("-"); |
---|
192 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
193 | | - resetMeshItem.addActionListener(this); |
---|
194 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
195 | | - stepAllItem.addActionListener(this); |
---|
| 287 | + } |
---|
| 288 | + |
---|
| 289 | + oe.menuBar.add(menu = new Menu("Setting")); |
---|
| 290 | + if (Globals.ADVANCED) |
---|
| 291 | + { |
---|
196 | 292 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
197 | 293 | revertMeshItem.addActionListener(this); |
---|
198 | 294 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
199 | 295 | resetreferencesItem.addActionListener(this); |
---|
200 | 296 | menu.add("-"); |
---|
| 297 | + } |
---|
201 | 298 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
202 | 299 | overwriteGeoItem.addActionListener(this); |
---|
203 | 300 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
209 | 306 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
210 | 307 | overwriteUVItem.addActionListener(this); |
---|
211 | 308 | menu.add("-"); |
---|
| 309 | + if (Globals.ADVANCED) |
---|
| 310 | + { |
---|
212 | 311 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
213 | 312 | generateMeshItem.addActionListener(this); |
---|
214 | 313 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
215 | 314 | poseMeshItem.addActionListener(this); |
---|
216 | 315 | menu.add("-"); |
---|
| 316 | + } |
---|
217 | 317 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
218 | 318 | resetsupportItem.addActionListener(this); |
---|
219 | 319 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
220 | 320 | linkverticesItem.addActionListener(this); |
---|
| 321 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 322 | + relinkverticesItem.addActionListener(this); |
---|
| 323 | + |
---|
| 324 | + if (Globals.ADVANCED) |
---|
| 325 | + { |
---|
221 | 326 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
222 | 327 | setMasterItem.addActionListener(this); |
---|
| 328 | + } |
---|
223 | 329 | |
---|
224 | | - oe.menuBar.add(menu = new Menu("Object")); |
---|
| 330 | + oe.menuBar.add(menu = new Menu("Group")); |
---|
225 | 331 | grabItem = menu.add(new MenuItem("Grab")); |
---|
226 | 332 | grabItem.addActionListener(this); |
---|
227 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
228 | | - frontItem.addActionListener(this); |
---|
229 | 333 | backItem = menu.add(new MenuItem("Back")); |
---|
230 | 334 | backItem.addActionListener(this); |
---|
| 335 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 336 | + frontItem.addActionListener(this); |
---|
231 | 337 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
232 | 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 | + |
---|
233 | 348 | menu.add("-"); |
---|
234 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 349 | + |
---|
| 350 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
235 | 351 | randomItem.addActionListener(this); |
---|
236 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
237 | | - physicsItem.addActionListener(this); |
---|
238 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
239 | | - frameselectorItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
240 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
241 | 355 | switchGeoItem.addActionListener(this); |
---|
242 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
243 | 357 | switchTransfoItem.addActionListener(this); |
---|
244 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 358 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
245 | 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); |
---|
246 | 366 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
247 | 367 | scriptNodeItem.addActionListener(this); |
---|
248 | 368 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
249 | 369 | cameraItem.addActionListener(this); |
---|
250 | | - menu.add("-"); |
---|
| 370 | + } |
---|
| 371 | + |
---|
| 372 | + oe.menuBar.add(menu = new Menu("Object")); |
---|
251 | 373 | textureItem = menu.add(new MenuItem("Texture")); |
---|
252 | 374 | textureItem.addActionListener(this); |
---|
| 375 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 376 | + billboardItem.addActionListener(this); |
---|
253 | 377 | csgItem = menu.add(new MenuItem("CSG")); |
---|
254 | 378 | csgItem.addActionListener(this); |
---|
255 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 379 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
256 | 380 | shadowXItem.addActionListener(this); |
---|
257 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 381 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
258 | 382 | shadowYItem.addActionListener(this); |
---|
259 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 383 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
260 | 384 | shadowZItem.addActionListener(this); |
---|
| 385 | + if (Globals.ADVANCED) |
---|
| 386 | + { |
---|
| 387 | + menu.add("-"); |
---|
261 | 388 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
262 | 389 | linkerItem.addActionListener(this); |
---|
263 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
264 | | - templateItem.addActionListener(this); |
---|
265 | 390 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
266 | 391 | attributeItem.addActionListener(this); |
---|
| 392 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 393 | + templateItem.addActionListener(this); |
---|
267 | 394 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
268 | 395 | pointflowItem.addActionListener(this); |
---|
| 396 | + } |
---|
269 | 397 | menu.add("-"); |
---|
270 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
271 | | - transformgeometryItem.addActionListener(this); |
---|
272 | 398 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
273 | 399 | resetTransformItem.addActionListener(this); |
---|
274 | 400 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
275 | 401 | resetCentroidItem.addActionListener(this); |
---|
276 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
277 | | - ungroupItem.addActionListener(this); |
---|
| 402 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 403 | + resetCentroidXZItem.addActionListener(this); |
---|
| 404 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 405 | + transformGeometryItem.addActionListener(this); |
---|
| 406 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 407 | + transformChildrenItem.addActionListener(this); |
---|
278 | 408 | |
---|
279 | 409 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
280 | 410 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
283 | 413 | genNormalsORGANItem.addActionListener(this); |
---|
284 | 414 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
285 | 415 | genNormalsCADItem.addActionListener(this); |
---|
| 416 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 417 | + genNormalsMESHItem.addActionListener(this); |
---|
| 418 | + if (Globals.ADVANCED) |
---|
| 419 | + { |
---|
| 420 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 421 | + genNormalsMINEItem.addActionListener(this); |
---|
| 422 | + } |
---|
286 | 423 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
287 | 424 | stripifyItem.addActionListener(this); |
---|
288 | 425 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
292 | 429 | untrimItem = menu.add(new MenuItem("Untrim")); |
---|
293 | 430 | untrimItem.addActionListener(this); |
---|
294 | 431 | menu.add("-"); |
---|
295 | | - clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
296 | | - clearMaterialsItem.addActionListener(this); |
---|
297 | 432 | clearColorsItem = menu.add(new MenuItem("Clear AO")); |
---|
298 | 433 | clearColorsItem.addActionListener(this); |
---|
299 | 434 | reverseNormalsItem = menu.add(new MenuItem("Reverse Normals")); |
---|
.. | .. |
---|
306 | 441 | reduce34MeshItem.addActionListener(this); |
---|
307 | 442 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 443 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 444 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 445 | clipMeshItem.addActionListener(this); |
---|
| 446 | + |
---|
| 447 | + if (Globals.ADVANCED) |
---|
| 448 | + { |
---|
| 449 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 450 | + smoothMeshItem.addActionListener(this); |
---|
| 451 | + } |
---|
| 452 | + |
---|
| 453 | + oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 454 | + clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
| 455 | + clearMaterialsItem.addActionListener(this); |
---|
| 456 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 457 | + resetAllItem.addActionListener(this); |
---|
| 458 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 459 | + stepAllItem.addActionListener(this); |
---|
313 | 460 | menu.add("-"); |
---|
314 | 461 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
315 | 462 | liveleavesItem.addActionListener(this); |
---|
316 | 463 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
317 | 464 | unliveleavesItem.addActionListener(this); |
---|
| 465 | + if (Globals.ADVANCED) |
---|
| 466 | + { |
---|
318 | 467 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
319 | 468 | supportleavesItem.addActionListener(this); |
---|
320 | 469 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
321 | 470 | unsupportleavesItem.addActionListener(this); |
---|
| 471 | + } |
---|
322 | 472 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
323 | 473 | hideleavesItem.addActionListener(this); |
---|
324 | 474 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
327 | 477 | markleavesItem.addActionListener(this); |
---|
328 | 478 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
329 | 479 | unmarkleavesItem.addActionListener(this); |
---|
| 480 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 481 | + rewindleavesItem.addActionListener(this); |
---|
| 482 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 483 | + unrewindleavesItem.addActionListener(this); |
---|
| 484 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 485 | + randomleavesItem.addActionListener(this); |
---|
| 486 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 487 | + unrandomleavesItem.addActionListener(this); |
---|
330 | 488 | menu.add("-"); |
---|
331 | 489 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
332 | 490 | flipVItem.addActionListener(this); |
---|
333 | 491 | unflipVItem = menu.add(new MenuItem("Unflip V")); |
---|
334 | 492 | unflipVItem.addActionListener(this); |
---|
335 | | - lowTexturesItem = menu.add(new MenuItem("Low Texture")); |
---|
| 493 | + lowTexturesItem = menu.add(new MenuItem("Low Texture (256)")); |
---|
336 | 494 | lowTexturesItem.addActionListener(this); |
---|
337 | | - normalTexturesItem = menu.add(new MenuItem("Normal Texture")); |
---|
| 495 | + normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)")); |
---|
338 | 496 | normalTexturesItem.addActionListener(this); |
---|
339 | | - highTexturesItem = menu.add(new MenuItem("High Texture")); |
---|
| 497 | + highTexturesItem = menu.add(new MenuItem("High Texture (1024)")); |
---|
340 | 498 | highTexturesItem.addActionListener(this); |
---|
341 | | - veryhighTexturesItem = menu.add(new MenuItem("Very high Texture")); |
---|
| 499 | + veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)")); |
---|
342 | 500 | veryhighTexturesItem.addActionListener(this); |
---|
343 | | - maxTexturesItem = menu.add(new MenuItem("Max Texture")); |
---|
| 501 | + maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)")); |
---|
344 | 502 | maxTexturesItem.addActionListener(this); |
---|
345 | | - panoTexturesItem = menu.add(new MenuItem("Panoramic Texture")); |
---|
| 503 | + panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)")); |
---|
346 | 504 | panoTexturesItem.addActionListener(this); |
---|
347 | | - menu.add("-"); |
---|
348 | | - extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
349 | | - extractGeometriesItem.addActionListener(this); |
---|
350 | | - cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
351 | | - cloneGeometriesItem.addActionListener(this); |
---|
352 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
353 | | - shareGeometriesItem.addActionListener(this); |
---|
354 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
355 | | - mergeGeometriesItem.addActionListener(this); |
---|
356 | 505 | |
---|
357 | 506 | oe.menuBar.add(menu = new Menu("Selection")); |
---|
358 | 507 | attachPigmentItem = menu.add(new MenuItem("Attach Pigment...")); |
---|
.. | .. |
---|
370 | 519 | sortbysizeItem.addActionListener(this); |
---|
371 | 520 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
372 | 521 | sortbynameItem.addActionListener(this); |
---|
| 522 | + menu.add("-"); |
---|
| 523 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 524 | + shareGeometriesItem.addActionListener(this); |
---|
| 525 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 526 | + mergeGeometriesItem.addActionListener(this); |
---|
| 527 | + if (Globals.ADVANCED) |
---|
| 528 | + { |
---|
| 529 | + // Pretty much the same as duplicate and clone. |
---|
| 530 | + extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
| 531 | + extractGeometriesItem.addActionListener(this); |
---|
| 532 | + cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
| 533 | + cloneGeometriesItem.addActionListener(this); |
---|
| 534 | + } |
---|
| 535 | + |
---|
373 | 536 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
374 | 537 | buildCreateMenu(menu); |
---|
375 | | - oe.menuBar.add(menu = new Menu("Tools")); |
---|
| 538 | + |
---|
| 539 | + oe.menuBar.add(menu = new Menu("Tools")); |
---|
376 | 540 | buildToolsMenu(menu); |
---|
377 | 541 | } |
---|
378 | 542 | |
---|
379 | 543 | void SetupUI2(ObjEditor oe) |
---|
380 | 544 | { |
---|
| 545 | + // June 2019 |
---|
| 546 | + if (oe == null) |
---|
| 547 | + { |
---|
| 548 | + //super.SetupUI2(this); |
---|
| 549 | + //return; |
---|
| 550 | + } |
---|
| 551 | + |
---|
| 552 | + if (copy != group) |
---|
| 553 | + { |
---|
| 554 | + //super.SetupUI2(this); |
---|
| 555 | + } |
---|
| 556 | + |
---|
381 | 557 | //new Exception().printStackTrace(); |
---|
382 | 558 | |
---|
383 | 559 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
406 | 582 | oe.radioPanel.add(dummyButton); |
---|
407 | 583 | oe.buttonGroup.add(dummyButton); |
---|
408 | 584 | */ |
---|
409 | | - aConstraints.gridy += 1; |
---|
410 | | - oe.aConstraints.gridwidth = 1; |
---|
411 | | - oe.aConstraints.gridx = 0; |
---|
| 585 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
412 | 586 | |
---|
413 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 587 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + //minButton.setToolTipText("Minimize window"); |
---|
| 589 | + //minButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + maxButton.setToolTipText("Maximize window"); |
---|
| 593 | + maxButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 597 | + fullButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + undoButton.setToolTipText("Undo changes"); |
---|
| 601 | + undoButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 604 | + redoButton.setToolTipText("Redo changes"); |
---|
| 605 | + redoButton.addActionListener(this); |
---|
| 606 | + |
---|
| 607 | + oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + saveButton.setToolTipText("Save changes"); |
---|
| 609 | + saveButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 612 | + liveCB.setToolTipText("Enable animation"); |
---|
414 | 613 | liveCB.addItemListener(this); |
---|
415 | 614 | |
---|
416 | | - oe.aConstraints.gridx += 1; |
---|
417 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
418 | | - supportCB.addItemListener(this); |
---|
419 | | - |
---|
420 | | - // oe.aConstraints.gridx += 1; |
---|
421 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
422 | | - // localCB.addItemListener(this); |
---|
423 | | - |
---|
424 | | - oe.aConstraints.gridx += 1; |
---|
425 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
426 | | - crowdCB.addItemListener(this); |
---|
427 | | - |
---|
428 | | - oe.aConstraints.gridx += 1; |
---|
429 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
430 | | - smoothCB.addItemListener(this); |
---|
431 | | - |
---|
432 | | - oe.aConstraints.gridx += 1; |
---|
433 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 615 | + oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 617 | + oneStepButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 620 | + fastCB.setToolTipText("Fast mode"); |
---|
434 | 621 | fastCB.addItemListener(this); |
---|
435 | | - oe.aConstraints.gridx += 1; |
---|
436 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
437 | | - slowCB.addItemListener(this); |
---|
438 | | - oe.aConstraints.gridx += 1; |
---|
439 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
440 | | - boxCB.addItemListener(this); |
---|
441 | | - |
---|
442 | | -// oe.aConstraints.gridx += 1; |
---|
443 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
444 | | -// speakerMocapCB.addItemListener(this); |
---|
445 | | - |
---|
446 | | - if (false) |
---|
447 | | - { |
---|
448 | | - // handled in scripts |
---|
449 | | - oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
451 | | - speakerCameraCB.addItemListener(this); |
---|
452 | | - |
---|
453 | | - oe.aConstraints.gridx += 1; |
---|
454 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
455 | | - speakerFocusCB.addItemListener(this); |
---|
456 | | - |
---|
457 | | - oe.aConstraints.gridx += 1; |
---|
458 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
459 | | - smoothfocusCB.addItemListener(this); |
---|
460 | | - } |
---|
461 | | - |
---|
462 | | -//oe.aConstraints.gridx += 1; |
---|
463 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
464 | | -// debugCB.addItemListener(this); |
---|
465 | | - |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
468 | | - oeilCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
472 | | - lookAtCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 622 | + |
---|
| 623 | + oe.toolboxPanel.Return(); |
---|
| 624 | + |
---|
| 625 | + oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 626 | + trackCB.setToolTipText("Enable tracking"); |
---|
476 | 627 | trackCB.addItemListener(this); |
---|
477 | 628 | |
---|
478 | | - oe.aConstraints.gridx += 1; |
---|
479 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 629 | + oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + screenfitButton.setToolTipText("Screen fit"); |
---|
480 | 631 | screenfitButton.addActionListener(this); |
---|
481 | | - oe.aConstraints.gridx += 1; |
---|
| 632 | + |
---|
482 | 633 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
483 | 634 | // screenfitpointButton.addActionListener(this); |
---|
484 | | -// oe.aConstraints.gridx += 1; |
---|
485 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
486 | | - snapobjectButton.addActionListener(this); |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | 635 | |
---|
489 | | - //aConstraints.gridx = 0; |
---|
490 | | - //aConstraints.gridy += 1; |
---|
491 | | - oe.aConstraints.weighty = 0; |
---|
492 | | - oe.aConstraints.gridwidth = 1; |
---|
493 | | - |
---|
494 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 636 | + if (Globals.ADVANCED) |
---|
| 637 | + { |
---|
| 638 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + snapobjectButton.addActionListener(this); |
---|
| 640 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 641 | + } |
---|
| 642 | + |
---|
| 643 | + oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
495 | 645 | flashSelectionButton.addActionListener(this); |
---|
496 | | - oe.aConstraints.gridx += 1; |
---|
497 | | - oe.aConstraints.weighty = 0; |
---|
498 | | - oe.aConstraints.gridwidth = 1; |
---|
499 | 646 | |
---|
500 | | - // |
---|
501 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 647 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 648 | + |
---|
| 649 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + twoButton.setToolTipText("Show center view only"); |
---|
502 | 651 | twoButton.addActionListener(this); |
---|
503 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 652 | + this.fullscreenLayout = twoButton; |
---|
| 653 | + |
---|
| 654 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 655 | fourButton.addActionListener(this); |
---|
505 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 656 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 657 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 658 | + sixButton.setToolTipText("2-column layout left"); |
---|
506 | 659 | sixButton.addActionListener(this); |
---|
507 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + threeButton.setToolTipText("2-column layout right"); |
---|
508 | 662 | threeButton.addActionListener(this); |
---|
509 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 663 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + sevenButton.setToolTipText("3-column layout"); |
---|
510 | 665 | sevenButton.addActionListener(this); |
---|
511 | 666 | // |
---|
512 | 667 | |
---|
513 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 668 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
514 | 670 | rootButton.addActionListener(this); |
---|
515 | | - oe.aConstraints.gridx += 1; |
---|
516 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 671 | + |
---|
| 672 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 673 | + closeButton.setToolTipText("Close tab"); |
---|
517 | 674 | closeButton.addActionListener(this); |
---|
518 | 675 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
519 | 676 | //clearButton.addActionListener(this); |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | | - |
---|
522 | | - oe.aConstraints.gridx = 1; // |
---|
523 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
524 | | - editButton.addActionListener(this); |
---|
525 | | - oe.aConstraints.gridx += 1; |
---|
526 | | - oe.aConstraints.weighty = 0; |
---|
527 | | - oe.aConstraints.gridwidth = 1; |
---|
528 | 677 | |
---|
529 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 678 | + // INSERT |
---|
| 679 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 680 | + gridButton.setToolTipText("Create grid"); |
---|
| 681 | + gridButton.addActionListener(this); |
---|
| 682 | + |
---|
| 683 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + boxButton.setToolTipText("Create box"); |
---|
| 685 | + boxButton.addActionListener(this); |
---|
| 686 | + |
---|
| 687 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 689 | + sphereButton.addActionListener(this); |
---|
| 690 | + |
---|
| 691 | + oe.toolboxPanel.Return(); |
---|
| 692 | + |
---|
| 693 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + coneButton.setToolTipText("Create cone"); |
---|
| 695 | + coneButton.addActionListener(this); |
---|
| 696 | + |
---|
| 697 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + torusButton.setToolTipText("Create torus"); |
---|
| 699 | + torusButton.addActionListener(this); |
---|
| 700 | + |
---|
| 701 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 703 | + superButton.addActionListener(this); |
---|
| 704 | + |
---|
| 705 | + if (Globals.ADVANCED) |
---|
| 706 | + { |
---|
| 707 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 709 | + kleinButton.addActionListener(this); |
---|
| 710 | + } |
---|
| 711 | + |
---|
| 712 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 714 | + particlesButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 717 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 718 | + overlayButton.addActionListener(this); |
---|
| 719 | + |
---|
| 720 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 721 | + lightButton.setToolTipText("Create light"); |
---|
| 722 | + lightButton.addActionListener(this); |
---|
| 723 | + |
---|
| 724 | + // EDIT panel |
---|
| 725 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 726 | + editButton.setToolTipText("Edit selection"); |
---|
| 727 | + editButton.addActionListener(this); |
---|
| 728 | + |
---|
| 729 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + uneditButton.setToolTipText("Unedit selection"); |
---|
530 | 731 | uneditButton.addActionListener(this); |
---|
531 | 732 | |
---|
532 | | - oe.aConstraints.gridx += 1; |
---|
533 | | - oe.aConstraints.weighty = 0; |
---|
534 | | - oe.aConstraints.gridwidth = 1; |
---|
535 | | - |
---|
536 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
537 | | - clearPanelButton.addActionListener(this); |
---|
538 | | - |
---|
539 | | - oe.aConstraints.gridx += 1; |
---|
540 | | - oe.aConstraints.weighty = 0; |
---|
541 | | - oe.aConstraints.gridwidth = 1; |
---|
542 | | - |
---|
543 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 733 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 734 | + allParamsButton.setToolTipText("Edit all params"); |
---|
544 | 735 | allParamsButton.addActionListener(this); |
---|
545 | 736 | |
---|
546 | | - oe.aConstraints.gridx += 1; |
---|
547 | | - oe.aConstraints.weighty = 0; |
---|
548 | | - oe.aConstraints.gridwidth = 1; |
---|
549 | | - |
---|
550 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 737 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 739 | + clearPanelButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 742 | + unselectButton.setToolTipText("Unselect"); |
---|
551 | 743 | unselectButton.addActionListener(this); |
---|
552 | 744 | |
---|
| 745 | + editCommandsPanel.preferredHeight = 1; |
---|
| 746 | + |
---|
| 747 | +// oe.treePanel.add(commandsPanel); |
---|
| 748 | +// oe.treePanel.Return(); |
---|
| 749 | + |
---|
553 | 750 | // oe.aConstraints.gridx += 1; |
---|
554 | 751 | // oe.aConstraints.weighty = 0; |
---|
555 | 752 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
561 | 758 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
562 | 759 | // gcButton.addActionListener(this); |
---|
563 | 760 | |
---|
564 | | - oe.aConstraints.gridx = 0; |
---|
565 | | - oe.aConstraints.gridy += 1; |
---|
566 | | - |
---|
567 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
568 | | - oe.aConstraints.gridwidth = 100; |
---|
569 | | - // oe.aConstraints.gridheight = 100; |
---|
570 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
571 | | - oe.aConstraints.gridheight = 1; |
---|
572 | | - oe.aConstraints.weighty = 0.5; |
---|
573 | | - oe.aConstraints.gridx = 0; |
---|
574 | | - JScrollPane jSP; |
---|
| 761 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 762 | + |
---|
| 763 | + JScrollPane jSP; |
---|
575 | 764 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
576 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 765 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
577 | 766 | ResetModel(); |
---|
578 | | - oe.aConstraints.weighty = 0.5; |
---|
579 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
580 | | - oe.aConstraints.gridy += 1; |
---|
581 | | - oe.aConstraints.gridwidth = 1; |
---|
| 767 | + |
---|
| 768 | + oe.treePanel.add(jSPPanel); |
---|
| 769 | + oe.treePanel.Return(); |
---|
582 | 770 | |
---|
583 | | - oe.aConstraints.weighty = 0; |
---|
584 | | - oe.aConstraints.gridwidth = 2; |
---|
585 | | - |
---|
586 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 771 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 772 | + |
---|
| 773 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 774 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
587 | 775 | colorCB.addItemListener(this); |
---|
588 | | - oe.aConstraints.gridx += 2; |
---|
589 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 776 | + |
---|
| 777 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 778 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
590 | 779 | materialCB.addItemListener(this); |
---|
591 | | - oe.aConstraints.gridx += 2; |
---|
592 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 780 | + |
---|
| 781 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 782 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
593 | 783 | textureCB.addItemListener(this); |
---|
594 | 784 | |
---|
595 | | - oe.aConstraints.gridx = 0; |
---|
596 | | - oe.aConstraints.gridy += 1; |
---|
| 785 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 786 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 787 | + oe.treePanel.Return(); |
---|
597 | 788 | |
---|
| 789 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 790 | +// mainPanel.setResizeWeight(0.5); |
---|
| 791 | + |
---|
598 | 792 | //jList.addListSelectionListener(this); |
---|
599 | 793 | oe.jTree.addTreeSelectionListener(this); |
---|
600 | 794 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
616 | 810 | radio.layout = sevenButton; |
---|
617 | 811 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
618 | 812 | } |
---|
| 813 | + |
---|
| 814 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 815 | + { |
---|
| 816 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 817 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 818 | + boxCB.addItemListener(this); |
---|
| 819 | + |
---|
| 820 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 821 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 822 | + zoomBoxCB.addItemListener(this); |
---|
| 823 | + |
---|
| 824 | + if (true) // Globals.ADVANCED) |
---|
| 825 | + { |
---|
| 826 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 827 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 828 | + supportCB.addItemListener(this); |
---|
| 829 | + |
---|
| 830 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 831 | + // localCB.addItemListener(this); |
---|
| 832 | + |
---|
| 833 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 834 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 835 | + crowdCB.addItemListener(this); |
---|
| 836 | + |
---|
| 837 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 838 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 839 | + smoothCB.addItemListener(this); |
---|
| 840 | + |
---|
| 841 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 842 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 843 | + slowCB.addItemListener(this); |
---|
| 844 | + |
---|
| 845 | +// constraints.gridy += 1; |
---|
| 846 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 847 | +// speakerMocapCB.addItemListener(this); |
---|
| 848 | + |
---|
| 849 | + if (false) |
---|
| 850 | + { |
---|
| 851 | + // handled in scripts |
---|
| 852 | + //constraints.gridy += 1; |
---|
| 853 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 854 | + speakerCameraCB.addItemListener(this); |
---|
| 855 | + |
---|
| 856 | + //constraints.gridy += 1; |
---|
| 857 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 858 | + speakerFocusCB.addItemListener(this); |
---|
| 859 | + |
---|
| 860 | + //constraints.gridy += 1; |
---|
| 861 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 862 | + smoothfocusCB.addItemListener(this); |
---|
| 863 | + } |
---|
| 864 | + |
---|
| 865 | +//constraints.gridx += 1; |
---|
| 866 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 867 | +// debugCB.addItemListener(this); |
---|
| 868 | + |
---|
| 869 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 870 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 871 | + oeilCB.addItemListener(this); |
---|
| 872 | + |
---|
| 873 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 874 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 875 | + shadowCB.addItemListener(this); |
---|
| 876 | + |
---|
| 877 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 878 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 879 | + autosaveCB.addItemListener(this); |
---|
| 880 | + |
---|
| 881 | + if (Globals.ADVANCED) |
---|
| 882 | + { |
---|
| 883 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 884 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 885 | + lookAtCB.addItemListener(this); |
---|
| 886 | + } |
---|
| 887 | + |
---|
| 888 | + } |
---|
| 889 | + |
---|
| 890 | + cGridBag fill = new cGridBag(); |
---|
| 891 | + |
---|
| 892 | + fill.preferredHeight = 200; |
---|
| 893 | + |
---|
| 894 | + panel.add(fill); |
---|
| 895 | + |
---|
| 896 | + } |
---|
619 | 897 | |
---|
620 | 898 | void EditObject(Object3D obj) |
---|
621 | 899 | { |
---|
622 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
623 | | - dummyButton.SetObject(obj); |
---|
624 | | - dummyButton.layout = sevenButton; |
---|
625 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
626 | | - dummyButton.addActionListener(this); |
---|
627 | | - radioPanel.add(dummyButton); |
---|
628 | | - buttonGroup.add(dummyButton); |
---|
629 | | - dummyButton.doClick(); |
---|
| 900 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 901 | + |
---|
| 902 | + // Patch to avoid bug with transparency. |
---|
| 903 | + radioButton.hadMaterial = obj.material != null; |
---|
| 904 | + if (!radioButton.hadMaterial) |
---|
| 905 | + { |
---|
| 906 | + obj.material = new cMaterial(); |
---|
| 907 | + } |
---|
| 908 | + |
---|
| 909 | + radioButton.SetObject(obj); |
---|
| 910 | + radioButton.layout = sevenButton; |
---|
| 911 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 912 | + radioButton.addActionListener(this); |
---|
| 913 | + radioPanel.add(radioButton); |
---|
| 914 | + buttonGroup.add(radioButton); |
---|
| 915 | + radioButton.doClick(); |
---|
630 | 916 | } |
---|
| 917 | + |
---|
631 | 918 | void SetupViews(ObjEditor oe) |
---|
632 | 919 | { |
---|
| 920 | + theFrame = this; |
---|
| 921 | + |
---|
633 | 922 | oe.SetupViews(); |
---|
634 | 923 | |
---|
635 | 924 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
638 | 927 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
639 | 928 | } |
---|
640 | 929 | |
---|
641 | | - JCheckBox liveCB; |
---|
642 | | - JCheckBox supportCB; |
---|
643 | | - JCheckBox localCB; |
---|
644 | | - JCheckBox crowdCB; |
---|
645 | | - JCheckBox smoothCB; |
---|
646 | | - JCheckBox fastCB; |
---|
647 | | - JCheckBox slowCB; |
---|
648 | | - JCheckBox boxCB; |
---|
649 | | - JCheckBox trackCB; |
---|
650 | | - JCheckBox smoothfocusCB; |
---|
| 930 | + cToggleButton liveCB; |
---|
| 931 | + cCheckBox supportCB; |
---|
| 932 | + cCheckBox localCB; |
---|
| 933 | + cCheckBox crowdCB; |
---|
| 934 | + cCheckBox smoothCB; |
---|
| 935 | + cToggleButton fastCB; |
---|
| 936 | + cCheckBox slowCB; |
---|
| 937 | + cCheckBox boxCB; |
---|
| 938 | + cCheckBox zoomBoxCB; |
---|
| 939 | + cToggleButton trackCB; |
---|
| 940 | + cCheckBox smoothfocusCB; |
---|
651 | 941 | // JCheckBox speakerMocapCB; |
---|
652 | | - JCheckBox speakerCameraCB; |
---|
653 | | - JCheckBox speakerFocusCB; |
---|
654 | | - JCheckBox debugCB; |
---|
655 | | - JCheckBox oeilCB; |
---|
656 | | - JCheckBox lookAtCB; |
---|
| 942 | + cCheckBox speakerCameraCB; |
---|
| 943 | + cCheckBox speakerFocusCB; |
---|
| 944 | + cCheckBox debugCB; |
---|
| 945 | + |
---|
| 946 | + cCheckBox oeilCB; |
---|
| 947 | + cCheckBox shadowCB; |
---|
| 948 | + cCheckBox autosaveCB; |
---|
| 949 | + cCheckBox lookAtCB; |
---|
657 | 950 | |
---|
658 | 951 | // static int COLOR = 1; |
---|
659 | 952 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
661 | 954 | |
---|
662 | 955 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
663 | 956 | |
---|
664 | | - JCheckBox colorCB; |
---|
665 | | - JCheckBox materialCB; |
---|
666 | | - JCheckBox textureCB; |
---|
| 957 | + cCheckBox colorCB; |
---|
| 958 | + cCheckBox materialCB; |
---|
| 959 | + cCheckBox textureCB; |
---|
667 | 960 | |
---|
668 | 961 | public void itemStateChanged(ItemEvent e) |
---|
669 | 962 | { |
---|
.. | .. |
---|
688 | 981 | dropAttributes |= Object3D.TEXTURE; |
---|
689 | 982 | else |
---|
690 | 983 | dropAttributes &= ~Object3D.TEXTURE; |
---|
691 | | - } |
---|
692 | | - else if(e.getSource() == liveCB) |
---|
| 984 | + } else if(e.getSource() == liveCB) |
---|
693 | 985 | { |
---|
694 | 986 | cameraView.ToggleLive(); |
---|
| 987 | + refreshContents(false); |
---|
695 | 988 | } |
---|
696 | 989 | else if(e.getSource() == supportCB) |
---|
697 | 990 | { |
---|
.. | .. |
---|
727 | 1020 | cameraView.repaint(); |
---|
728 | 1021 | // refreshContents(); |
---|
729 | 1022 | } |
---|
| 1023 | + else if(e.getSource() == zoomBoxCB) |
---|
| 1024 | + { |
---|
| 1025 | + cameraView.ToggleZoomBoxMode(); |
---|
| 1026 | + } |
---|
730 | 1027 | else if(e.getSource() == smoothfocusCB) |
---|
731 | 1028 | { |
---|
732 | 1029 | cameraView.ToggleSmoothFocus(); |
---|
.. | .. |
---|
752 | 1049 | { |
---|
753 | 1050 | cameraView.ToggleOeil(); |
---|
754 | 1051 | } |
---|
| 1052 | + else if(e.getSource() == shadowCB) |
---|
| 1053 | + { |
---|
| 1054 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1055 | + } |
---|
| 1056 | + else if(e.getSource() == autosaveCB) |
---|
| 1057 | + { |
---|
| 1058 | + Globals.SAVEONMAKE ^= true; |
---|
| 1059 | + } |
---|
755 | 1060 | else if(e.getSource() == lookAtCB) |
---|
756 | 1061 | { |
---|
757 | 1062 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
768 | 1073 | |
---|
769 | 1074 | /**/ |
---|
770 | 1075 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
771 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1076 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1077 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
772 | 1078 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
773 | 1079 | // We can't move the root node or an empty selection |
---|
774 | 1080 | return; |
---|
.. | .. |
---|
840 | 1146 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
841 | 1147 | // return; |
---|
842 | 1148 | // } |
---|
843 | | - if (string.charAt(0) == '/') |
---|
| 1149 | + |
---|
| 1150 | + // File path for Mac and Windows |
---|
| 1151 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
844 | 1152 | { |
---|
845 | 1153 | // file(s) |
---|
846 | 1154 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
867 | 1175 | |
---|
868 | 1176 | flashIt = false; |
---|
869 | 1177 | CameraPane pane = (CameraPane) target; |
---|
870 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1178 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
871 | 1179 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
872 | 1180 | |
---|
873 | 1181 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
890 | 1198 | return; |
---|
891 | 1199 | } |
---|
892 | 1200 | |
---|
893 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
894 | | - { |
---|
| 1201 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1202 | +// { |
---|
895 | 1203 | loadClipboard(true); |
---|
896 | 1204 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
897 | | - pasteInto(false); |
---|
898 | | - } else { |
---|
899 | | - loadClipboard(false); |
---|
900 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
901 | | - pasteInto(false); // true); // ??? |
---|
902 | | - } |
---|
| 1205 | + pasteInto(false, false); |
---|
| 1206 | +// } else { |
---|
| 1207 | +// loadClipboard(false); |
---|
| 1208 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1209 | +// pasteInto(false, false); // true); // ??? |
---|
| 1210 | +// } |
---|
903 | 1211 | } |
---|
904 | 1212 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
905 | 1213 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1002 | 1310 | |
---|
1003 | 1311 | void buildCreateMenu(Menu menu) |
---|
1004 | 1312 | { |
---|
| 1313 | + //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
| 1314 | + //heightFieldItem.addActionListener(this); |
---|
1005 | 1315 | gridItem = menu.add(new MenuItem("Grid")); |
---|
1006 | 1316 | gridItem.addActionListener(this); |
---|
1007 | 1317 | rectoidItem = menu.add(new MenuItem("Box")); |
---|
.. | .. |
---|
1014 | 1324 | torusItem.addActionListener(this); |
---|
1015 | 1325 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1016 | 1326 | superItem.addActionListener(this); |
---|
| 1327 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1328 | + kleinItem.addActionListener(this); |
---|
1017 | 1329 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1018 | 1330 | particleItem.addActionListener(this); |
---|
| 1331 | + if (Globals.ADVANCED) |
---|
| 1332 | + { |
---|
1019 | 1333 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1020 | 1334 | ragdollItem.addActionListener(this); |
---|
1021 | 1335 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1022 | 1336 | ragdoll2Item.addActionListener(this); |
---|
| 1337 | + } |
---|
1023 | 1338 | menu.add("-"); |
---|
1024 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1339 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1025 | 1340 | meshItem.addActionListener(this); |
---|
1026 | 1341 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1027 | 1342 | // meshGroupItem.addActionListener(this); |
---|
| 1343 | + if (Globals.ADVANCED) |
---|
| 1344 | + { |
---|
1028 | 1345 | springItem = menu.add(new MenuItem("Spring")); |
---|
1029 | 1346 | springItem.addActionListener(this); |
---|
1030 | 1347 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1031 | 1348 | flagItem.addActionListener(this); |
---|
1032 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1033 | | - bezierItem.addActionListener(this); |
---|
1034 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1035 | | - checkerItem.addActionListener(this); |
---|
1036 | 1349 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1037 | 1350 | blobItem.addActionListener(this); |
---|
1038 | 1351 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1039 | 1352 | latheItem.addActionListener(this); |
---|
| 1353 | + } |
---|
| 1354 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1355 | + bezierItem.addActionListener(this); |
---|
| 1356 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1357 | + overlayItem.addActionListener(this); |
---|
1040 | 1358 | lightItem = menu.add(new MenuItem("Light")); |
---|
1041 | 1359 | lightItem.addActionListener(this); |
---|
1042 | 1360 | menu.add("-"); |
---|
.. | .. |
---|
1046 | 1364 | loopItem.addActionListener(this); |
---|
1047 | 1365 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1048 | 1366 | doubleItem.addActionListener(this); |
---|
| 1367 | + if (Globals.ADVANCED) |
---|
| 1368 | + { |
---|
1049 | 1369 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1050 | 1370 | tripleItem.addActionListener(this); |
---|
1051 | | - menu.add("-"); |
---|
1052 | | - importGFDItem = menu.add(new MenuItem("GraphreeD Object...")); |
---|
1053 | | - importGFDItem.addActionListener(this); |
---|
1054 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
1055 | | - importVRMLX3DItem.addActionListener(this); |
---|
1056 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
1057 | | - importOBJItem.addActionListener(this); |
---|
1058 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
1059 | | - import3DSItem.addActionListener(this); |
---|
| 1371 | + } |
---|
1060 | 1372 | } |
---|
1061 | 1373 | |
---|
1062 | 1374 | void buildToolsMenu(Menu menu) |
---|
1063 | 1375 | { |
---|
1064 | 1376 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1065 | 1377 | animationItem.addItemListener(this); |
---|
1066 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1378 | + animationItem.setState(Globals.ANIMATION); |
---|
1067 | 1379 | |
---|
1068 | 1380 | menu.add("-"); |
---|
1069 | 1381 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1070 | 1382 | parseverticesItem.addActionListener(this); |
---|
1071 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1383 | + textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
| 1384 | + textureFieldItem.addActionListener(this); |
---|
| 1385 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1072 | 1386 | alignItem.addActionListener(this); |
---|
1073 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1074 | | - mirrorItem.addActionListener(this); |
---|
1075 | 1387 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1076 | 1388 | reduceMorphItem.addActionListener(this); |
---|
1077 | 1389 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1078 | 1390 | reduce34MorphItem.addActionListener(this); |
---|
1079 | | - |
---|
| 1391 | + menu.add("-"); |
---|
1080 | 1392 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1081 | 1393 | computeAOItem.addActionListener(this); |
---|
1082 | | - menu.add("-"); |
---|
1083 | 1394 | |
---|
| 1395 | + if (Globals.ADVANCED) |
---|
| 1396 | + { |
---|
| 1397 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1398 | + mirrorItem.addActionListener(this); |
---|
| 1399 | + menu.add("-"); |
---|
1084 | 1400 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1085 | 1401 | memoryItem.addActionListener(this); |
---|
1086 | 1402 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1087 | 1403 | analyzeItem.addActionListener(this); |
---|
1088 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1404 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1089 | 1405 | dumpItem.addActionListener(this); |
---|
1090 | 1406 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1091 | 1407 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1094 | 1410 | resetParentItem.addActionListener(this); |
---|
1095 | 1411 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1096 | 1412 | repairParentItem.addActionListener(this); |
---|
| 1413 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1414 | + repairShadowItem.addActionListener(this); |
---|
1097 | 1415 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1098 | 1416 | invariantsItem.addActionListener(this); |
---|
1099 | 1417 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1101 | 1419 | menu.add("-"); |
---|
1102 | 1420 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1103 | 1421 | editScriptItem.addActionListener(this); |
---|
| 1422 | + } |
---|
1104 | 1423 | } |
---|
1105 | 1424 | |
---|
1106 | 1425 | void ScreenFit() |
---|
.. | .. |
---|
1223 | 1542 | shadow.material = new cMaterial(obj.material); |
---|
1224 | 1543 | shadow.material.diffuse = 0.0001f; |
---|
1225 | 1544 | shadow.material.specular = 0.0001f; |
---|
| 1545 | + //shadow.projectedVertices[1].x = 300; |
---|
1226 | 1546 | |
---|
1227 | 1547 | makeSomething(shadow); |
---|
1228 | 1548 | } |
---|
.. | .. |
---|
1429 | 1749 | |
---|
1430 | 1750 | void Overwrite(int mask) |
---|
1431 | 1751 | { |
---|
1432 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1752 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1433 | 1753 | { |
---|
1434 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1754 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1435 | 1755 | |
---|
1436 | 1756 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1437 | 1757 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1454 | 1774 | // |
---|
1455 | 1775 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1456 | 1776 | { |
---|
| 1777 | + Object source = event.getSource(); |
---|
1457 | 1778 | /* |
---|
1458 | 1779 | if (event.getSource() == nameField) |
---|
1459 | 1780 | { |
---|
.. | .. |
---|
1465 | 1786 | } |
---|
1466 | 1787 | else |
---|
1467 | 1788 | */ |
---|
1468 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1789 | + if (source == lookAtItem || source == lookFromItem) |
---|
1469 | 1790 | { |
---|
1470 | 1791 | ScreenFit(); |
---|
1471 | 1792 | } else |
---|
1472 | | - if (event.getSource() == switchItem) |
---|
| 1793 | + if (source == switchItem) |
---|
1473 | 1794 | { |
---|
1474 | 1795 | cVector v1 = new cVector(); |
---|
1475 | 1796 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1478 | 1799 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1479 | 1800 | objEditor.cameraView.repaint(); |
---|
1480 | 1801 | } else |
---|
1481 | | - if (event.getSource() == rectoidItem) |
---|
| 1802 | + if (source == rectoidItem || source == boxButton) |
---|
1482 | 1803 | { |
---|
1483 | 1804 | makeSomething(new Box()); |
---|
1484 | 1805 | } else |
---|
1485 | | - if (event.getSource() == particleItem) |
---|
| 1806 | + if (source == particleItem || source == particlesButton) |
---|
1486 | 1807 | { |
---|
1487 | 1808 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1488 | 1809 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1503 | 1824 | applyExample(particleGeom, "SMOKE"); |
---|
1504 | 1825 | makeSomething(particleGeom); |
---|
1505 | 1826 | } else |
---|
1506 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1827 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1507 | 1828 | { |
---|
1508 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1829 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1509 | 1830 | |
---|
1510 | 1831 | ragdoll.toParent = LA.newMatrix(); |
---|
1511 | 1832 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1521 | 1842 | makeSomething(ragdoll); |
---|
1522 | 1843 | //makeSomething(new VehicleDemo()); |
---|
1523 | 1844 | } else |
---|
1524 | | - if (event.getSource() == gridItem) |
---|
| 1845 | + /* |
---|
| 1846 | + */ |
---|
| 1847 | + if (source == heightFieldItem) |
---|
| 1848 | + { |
---|
| 1849 | + Object3D obj = new Object3D(); |
---|
| 1850 | + |
---|
| 1851 | + obj.CreateMaterial(); |
---|
| 1852 | + obj.bRep = new BoundaryRep(); |
---|
| 1853 | + |
---|
| 1854 | + obj.bRep.CreateMesh(new iHeightField() |
---|
| 1855 | + { |
---|
| 1856 | + public double f(double x, double y) |
---|
| 1857 | + { |
---|
| 1858 | + // The Mandelbrot set is represented by coloring |
---|
| 1859 | + // each point (x,y) according to the number of |
---|
| 1860 | + // iterations it takes before the while loop in |
---|
| 1861 | + // this method ends. For points that are actually |
---|
| 1862 | + // in the Mandelbrot set, or very close to it, the |
---|
| 1863 | + // count will reach the maximum value, 80. These |
---|
| 1864 | + // points will be colored purple. All other colors |
---|
| 1865 | + // represent points that are definitely NOT in the set. |
---|
| 1866 | + x -= 600; |
---|
| 1867 | + y -= 500; |
---|
| 1868 | + x /= 200; |
---|
| 1869 | + y /= 200; |
---|
| 1870 | + int count = 0; |
---|
| 1871 | + double zx = x; |
---|
| 1872 | + double zy = y; |
---|
| 1873 | + while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) { |
---|
| 1874 | + double new_zx = zx*zx - zy*zy + x; |
---|
| 1875 | + zy = 2*zx*zy + y; |
---|
| 1876 | + zx = new_zx; |
---|
| 1877 | + count++; |
---|
| 1878 | + } |
---|
| 1879 | + return count; // Math.sqrt(count); |
---|
| 1880 | + } |
---|
| 1881 | + }, 1000,1000); |
---|
| 1882 | + |
---|
| 1883 | + makeSomething(obj); |
---|
| 1884 | + } else |
---|
| 1885 | + if (source == gridItem || source == gridButton) |
---|
1525 | 1886 | { |
---|
1526 | 1887 | makeSomething(new Grid()); |
---|
1527 | 1888 | } else |
---|
1528 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1889 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1529 | 1890 | { |
---|
1530 | 1891 | makeSomething(new Sphere()); |
---|
1531 | 1892 | } else |
---|
1532 | | - if (event.getSource() == coneItem) |
---|
| 1893 | + if (source == coneItem || source == coneButton) |
---|
1533 | 1894 | { |
---|
1534 | 1895 | makeSomething(new Cone()); |
---|
1535 | 1896 | } else |
---|
1536 | | - if (event.getSource() == torusItem) |
---|
| 1897 | + if (source == torusItem || source == torusButton) |
---|
1537 | 1898 | { |
---|
1538 | 1899 | makeSomething(new Torus()); |
---|
1539 | 1900 | } else |
---|
1540 | | - if (event.getSource() == superItem) |
---|
| 1901 | + if (source == superItem || source == superButton) |
---|
1541 | 1902 | { |
---|
1542 | 1903 | makeSomething(new Superellipsoid()); |
---|
1543 | 1904 | } else |
---|
1544 | | - if (event.getSource() == blobItem) |
---|
| 1905 | + if (source == kleinItem || source == kleinButton) |
---|
| 1906 | + { |
---|
| 1907 | + makeSomething(new Klein()); |
---|
| 1908 | + } else |
---|
| 1909 | + if (source == blobItem) |
---|
1545 | 1910 | { |
---|
1546 | 1911 | Blob blob = new Blob(); |
---|
1547 | 1912 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1549 | 1914 | //blob.retile(); |
---|
1550 | 1915 | makeSomething(blob); |
---|
1551 | 1916 | } else |
---|
1552 | | - if (event.getSource() == latheItem) |
---|
| 1917 | + if (source == latheItem) |
---|
1553 | 1918 | { |
---|
1554 | 1919 | makeSomething(new Lathe()); |
---|
1555 | 1920 | } else |
---|
1556 | | - if (event.getSource() == bezierItem) |
---|
| 1921 | + if (source == bezierItem) |
---|
1557 | 1922 | { |
---|
1558 | 1923 | makeSomething(new BezierSurface()); |
---|
1559 | 1924 | } else |
---|
1560 | | - if (event.getSource() == checkerItem) |
---|
| 1925 | + if (source == overlayItem || source == overlayButton) |
---|
1561 | 1926 | { |
---|
1562 | 1927 | /* |
---|
1563 | 1928 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1570 | 1935 | LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent); |
---|
1571 | 1936 | LA.matInvert(obj.toParent, obj.fromParent); |
---|
1572 | 1937 | */ |
---|
1573 | | - makeSomething(new CheckerIG()); |
---|
| 1938 | + makeSomething(new Checker()); |
---|
1574 | 1939 | } else |
---|
1575 | | - if (event.getSource() == meshItem) |
---|
| 1940 | + if (source == meshItem) |
---|
1576 | 1941 | { |
---|
1577 | 1942 | Object3D itemtomake = new Object3D(); |
---|
1578 | 1943 | Object3D child; |
---|
.. | .. |
---|
1593 | 1958 | makeSomething(child); |
---|
1594 | 1959 | } |
---|
1595 | 1960 | } else |
---|
1596 | | - if (event.getSource() == springItem) |
---|
| 1961 | + if (source == springItem) |
---|
1597 | 1962 | { |
---|
1598 | 1963 | cSpring s = new cSpring(); |
---|
1599 | 1964 | s.setup(); |
---|
1600 | 1965 | makeSomething(s); |
---|
1601 | 1966 | } else |
---|
1602 | | - if (event.getSource() == flagItem) |
---|
| 1967 | + if (source == flagItem) |
---|
1603 | 1968 | { |
---|
1604 | 1969 | cSpring s = new cFlag(); |
---|
1605 | 1970 | s.setup(); |
---|
1606 | 1971 | makeSomething(s); |
---|
1607 | 1972 | } else |
---|
1608 | | - if (event.getSource() == lightItem) |
---|
| 1973 | + if (source == lightItem || source == lightButton) |
---|
1609 | 1974 | { |
---|
1610 | 1975 | makeSomething(new Light()); |
---|
1611 | 1976 | } else |
---|
1612 | | - if (event.getSource() == csgItem) |
---|
| 1977 | + if (source == csgItem) |
---|
1613 | 1978 | { |
---|
1614 | 1979 | group(new CSG()); |
---|
1615 | 1980 | } else |
---|
1616 | | - if (event.getSource() == templateItem) |
---|
| 1981 | + if (source == templateItem) |
---|
1617 | 1982 | { |
---|
1618 | 1983 | group(new cTemplate()); |
---|
1619 | 1984 | } else |
---|
1620 | | - if (event.getSource() == attributeItem) |
---|
| 1985 | + if (source == attributeItem) |
---|
1621 | 1986 | { |
---|
1622 | 1987 | makeSomething(new Attribute()); |
---|
1623 | 1988 | } else |
---|
1624 | | - if (event.getSource() == pointflowItem) |
---|
| 1989 | + if (source == pointflowItem) |
---|
1625 | 1990 | { |
---|
1626 | 1991 | makeSomething(new PointFlow()); |
---|
1627 | 1992 | } else |
---|
.. | .. |
---|
1633 | 1998 | } else |
---|
1634 | 1999 | */ |
---|
1635 | 2000 | |
---|
1636 | | - if (event.getSource() == superLoopItem) |
---|
| 2001 | + if (source == superLoopItem) |
---|
1637 | 2002 | { |
---|
1638 | 2003 | Composite g = new cGroup(); |
---|
1639 | 2004 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1655 | 2020 | |
---|
1656 | 2021 | group(g); |
---|
1657 | 2022 | } else |
---|
1658 | | - if (event.getSource() == loopItem) |
---|
| 2023 | + if (source == loopItem) |
---|
1659 | 2024 | { |
---|
1660 | 2025 | Composite csg = new GroupLeaf(); |
---|
1661 | 2026 | csg.count = 5; |
---|
.. | .. |
---|
1664 | 2029 | csg.addChild(child); |
---|
1665 | 2030 | child.addChild(csg); |
---|
1666 | 2031 | } else |
---|
1667 | | - if (event.getSource() == doubleItem) |
---|
| 2032 | + if (source == doubleItem) |
---|
1668 | 2033 | { |
---|
1669 | 2034 | Composite csg = new GroupLeaf(); |
---|
1670 | 2035 | csg.count = 5; |
---|
.. | .. |
---|
1676 | 2041 | csg.addChild(child); |
---|
1677 | 2042 | child.addChild(csg); |
---|
1678 | 2043 | } else |
---|
1679 | | - if (event.getSource() == tripleItem) |
---|
| 2044 | + if (source == tripleItem) |
---|
1680 | 2045 | { |
---|
1681 | 2046 | Composite csg = new GroupLeaf(); |
---|
1682 | 2047 | csg.count = 4; |
---|
.. | .. |
---|
1691 | 2056 | csg.addChild(child); |
---|
1692 | 2057 | child.addChild(csg); |
---|
1693 | 2058 | } else |
---|
1694 | | - |
---|
1695 | | - if (event.getSource() == importGFDItem) |
---|
| 2059 | + if (source == computeAOItem) |
---|
1696 | 2060 | { |
---|
1697 | | - ImportGFD(); |
---|
| 2061 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 2062 | + Globals.theRenderer.repaint(); |
---|
1698 | 2063 | } else |
---|
1699 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1700 | | - { |
---|
1701 | | - ImportVRMLX3D(); |
---|
1702 | | - } else |
---|
1703 | | - if (event.getSource() == import3DSItem) |
---|
1704 | | - { |
---|
1705 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1706 | | - } else |
---|
1707 | | - if (event.getSource() == importOBJItem) |
---|
1708 | | - { |
---|
1709 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1710 | | - } else |
---|
1711 | | - if (event.getSource() == computeAOItem) |
---|
1712 | | - { |
---|
1713 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1714 | | - CameraPane.theRenderer.repaint(); |
---|
1715 | | - } else |
---|
1716 | | - if (event.getSource() == recompileItem) |
---|
| 2064 | + if (source == recompileItem) |
---|
1717 | 2065 | { |
---|
1718 | 2066 | Recompile(); |
---|
1719 | 2067 | refreshContents(); |
---|
1720 | 2068 | } else |
---|
1721 | | - if (event.getSource() == editScriptItem) |
---|
| 2069 | + if (source == editScriptItem) |
---|
1722 | 2070 | { |
---|
1723 | 2071 | OpenDialog(); |
---|
1724 | 2072 | refreshContents(); |
---|
1725 | 2073 | } else |
---|
1726 | | - if (event.getSource() == invariantsItem) |
---|
| 2074 | + if (source == invariantsItem) |
---|
1727 | 2075 | { |
---|
1728 | 2076 | System.out.println("Invariants:"); |
---|
1729 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 2077 | + Grafreed.grafreeD.universe.invariants(); |
---|
1730 | 2078 | } else |
---|
1731 | | - if (event.getSource() == memoryItem) |
---|
| 2079 | + if (source == memoryItem) |
---|
1732 | 2080 | { |
---|
1733 | 2081 | //System.out.println("Invariants:"); |
---|
1734 | 2082 | PrintMemory(); |
---|
1735 | 2083 | } else |
---|
1736 | | - if (event.getSource() == pathItem) |
---|
| 2084 | + if (source == pathItem) |
---|
1737 | 2085 | { |
---|
1738 | 2086 | PrintPath(); |
---|
1739 | 2087 | } else |
---|
1740 | | - if (event.getSource() == analyzeItem) |
---|
| 2088 | + if (source == analyzeItem) |
---|
1741 | 2089 | { |
---|
1742 | 2090 | AnalyzeObject(); |
---|
1743 | 2091 | } else |
---|
1744 | | - if (event.getSource() == dumpItem) |
---|
| 2092 | + if (source == dumpItem) |
---|
1745 | 2093 | { |
---|
1746 | 2094 | DumpObject(); |
---|
1747 | 2095 | } else |
---|
1748 | | - if (event.getSource() == screenfitButton) |
---|
| 2096 | + if (source == minButton) |
---|
| 2097 | + { |
---|
| 2098 | + Minimize(); |
---|
| 2099 | + } else |
---|
| 2100 | + if (source == maxButton) |
---|
| 2101 | + { |
---|
| 2102 | + Maximize(); |
---|
| 2103 | + } else |
---|
| 2104 | + if (source == fullButton) |
---|
| 2105 | + { |
---|
| 2106 | + ToggleFullScreen(); |
---|
| 2107 | + } else |
---|
| 2108 | + if (source == undoButton) |
---|
| 2109 | + { |
---|
| 2110 | + Undo(); |
---|
| 2111 | + } else |
---|
| 2112 | + if (source == redoButton) |
---|
| 2113 | + { |
---|
| 2114 | + Redo(); |
---|
| 2115 | + } else |
---|
| 2116 | + if (source == saveButton) |
---|
| 2117 | + { |
---|
| 2118 | + Save(); |
---|
| 2119 | + } else |
---|
| 2120 | + if (source == oneStepButton) |
---|
| 2121 | + { |
---|
| 2122 | + Globals.ONESTEP = true; |
---|
| 2123 | + cameraView.repaint(); |
---|
| 2124 | + } else |
---|
| 2125 | + if (source == screenfitButton) |
---|
1749 | 2126 | { |
---|
1750 | 2127 | //Reload(lastConverter, lastFilename, true); |
---|
1751 | 2128 | ScreenFit(); |
---|
1752 | 2129 | } else |
---|
1753 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2130 | + if (source == screenfitpointButton) |
---|
1754 | 2131 | { |
---|
1755 | 2132 | //Reload(lastConverter, lastFilename, true); |
---|
1756 | 2133 | ScreenFitPoint(); |
---|
1757 | 2134 | } else |
---|
1758 | | - if (event.getSource() == snapobjectButton) |
---|
| 2135 | + if (source == snapobjectButton) |
---|
1759 | 2136 | { |
---|
1760 | 2137 | //Reload(lastConverter, lastFilename, true); |
---|
1761 | 2138 | SnapObject(); |
---|
.. | .. |
---|
1766 | 2143 | // Recompile(); |
---|
1767 | 2144 | // refreshContents(); |
---|
1768 | 2145 | // } else |
---|
1769 | | - if (event.getSource() == gcButton) |
---|
| 2146 | + if (source == gcButton) |
---|
1770 | 2147 | { |
---|
1771 | 2148 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1772 | 2149 | System.gc(); |
---|
1773 | 2150 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1774 | 2151 | } else |
---|
1775 | | - if (event.getSource() == editLeafItem) |
---|
| 2152 | + if (source == editLeafItem) |
---|
1776 | 2153 | { |
---|
1777 | 2154 | Object3D obj; |
---|
1778 | 2155 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1786 | 2163 | } |
---|
1787 | 2164 | refreshContents(true); |
---|
1788 | 2165 | } else |
---|
1789 | | - if (event.getSource() == openWindowItem) |
---|
| 2166 | + if (source == openWindowItem) |
---|
1790 | 2167 | { |
---|
1791 | 2168 | EditSelection(true); |
---|
1792 | 2169 | } else |
---|
1793 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2170 | + if (source == cutItem || source == clearButton) |
---|
1794 | 2171 | { |
---|
1795 | 2172 | loadClipboard(true); |
---|
1796 | 2173 | } else |
---|
1797 | | - if (event.getSource() == duplicateItem) |
---|
| 2174 | + if (source == undoItem) |
---|
1798 | 2175 | { |
---|
1799 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 2176 | + Undo(); |
---|
| 2177 | + } else |
---|
| 2178 | + if (source == redoItem) |
---|
| 2179 | + { |
---|
| 2180 | + Redo(); |
---|
| 2181 | + } else |
---|
| 2182 | + if (source == duplicateItem) |
---|
| 2183 | + { |
---|
| 2184 | + Object3D keep = Grafreed.clipboard; |
---|
1800 | 2185 | loadClipboard(false); |
---|
1801 | 2186 | paste(false); |
---|
1802 | | - GraphreeD.clipboard = keep; |
---|
| 2187 | + Grafreed.clipboard = keep; |
---|
1803 | 2188 | } else |
---|
1804 | | - if (event.getSource() == cloneItem) |
---|
| 2189 | + if (source == cloneItem) |
---|
1805 | 2190 | { |
---|
1806 | 2191 | CloneSelection(false); |
---|
1807 | 2192 | } else |
---|
1808 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2193 | + if (source == cloneSupportItem) |
---|
1809 | 2194 | { |
---|
1810 | 2195 | CloneSelection(true); |
---|
1811 | 2196 | } else |
---|
1812 | | - if (event.getSource() == copyItem) |
---|
| 2197 | + if (source == copyItem) |
---|
1813 | 2198 | { |
---|
1814 | 2199 | loadClipboard(false); |
---|
1815 | 2200 | } else |
---|
1816 | | - if (event.getSource() == pasteItem) |
---|
| 2201 | + if (source == pasteItem) |
---|
1817 | 2202 | { |
---|
1818 | 2203 | paste(false); |
---|
1819 | 2204 | } else |
---|
1820 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2205 | + if (source == pasteIntoItem) |
---|
1821 | 2206 | { |
---|
1822 | | - pasteInto(false); |
---|
| 2207 | + pasteInto(true, false); |
---|
1823 | 2208 | } else |
---|
1824 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2209 | + if (source == pasteLinkItem) |
---|
1825 | 2210 | { |
---|
1826 | | - pasteInto(true); |
---|
| 2211 | + pasteInto(false, false); |
---|
1827 | 2212 | } else |
---|
1828 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2213 | + if (source == pasteCloneItem) |
---|
| 2214 | + { |
---|
| 2215 | + pasteInto(true, true); |
---|
| 2216 | + } else |
---|
| 2217 | + if (source == pasteExpandItem) |
---|
1829 | 2218 | { |
---|
1830 | 2219 | paste(true); |
---|
1831 | 2220 | } else |
---|
1832 | | - if (event.getSource() == synchronizeItem) |
---|
| 2221 | + if (source == synchronizeItem) |
---|
1833 | 2222 | { |
---|
1834 | 2223 | Overwrite(Object3D.TRANSFORM); |
---|
1835 | 2224 | } else |
---|
1836 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2225 | + if (source == overwriteNameItem) |
---|
1837 | 2226 | { |
---|
1838 | 2227 | Overwrite(Object3D.NAME); |
---|
1839 | 2228 | } else |
---|
1840 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2229 | + if (source == overwriteUVItem) |
---|
1841 | 2230 | { |
---|
1842 | 2231 | Overwrite(Object3D.UV); |
---|
1843 | 2232 | } else |
---|
1844 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2233 | + if (source == overwriteMatItem) |
---|
1845 | 2234 | { |
---|
| 2235 | + /* july 2015 |
---|
1846 | 2236 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1847 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2237 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1848 | 2238 | else |
---|
1849 | 2239 | { |
---|
1850 | 2240 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1856 | 2246 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1857 | 2247 | } |
---|
1858 | 2248 | } |
---|
| 2249 | + */ |
---|
| 2250 | + |
---|
| 2251 | + Overwrite(dropAttributes); |
---|
1859 | 2252 | } |
---|
1860 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2253 | + if (source == overwriteGeoItem) |
---|
1861 | 2254 | { |
---|
1862 | 2255 | Overwrite(Object3D.GEOMETRY); |
---|
1863 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2256 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1864 | 2257 | // { |
---|
1865 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2258 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1866 | 2259 | // |
---|
1867 | 2260 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1868 | 2261 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1874 | 2267 | // refreshContents(); |
---|
1875 | 2268 | // } |
---|
1876 | 2269 | } else |
---|
1877 | | - if (event.getSource() == generateMeshItem) |
---|
| 2270 | + if (source == generateMeshItem) |
---|
1878 | 2271 | { |
---|
1879 | 2272 | //if (group.selection.size() == 1) |
---|
1880 | 2273 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1885 | 2278 | ResetModel(); |
---|
1886 | 2279 | refreshContents(); |
---|
1887 | 2280 | } else |
---|
1888 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2281 | + if (source == extractGeometriesItem) |
---|
1889 | 2282 | { |
---|
1890 | 2283 | boolean one = false; |
---|
1891 | 2284 | |
---|
.. | .. |
---|
1912 | 2305 | ResetModel(); |
---|
1913 | 2306 | refreshContents(); |
---|
1914 | 2307 | } else |
---|
1915 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2308 | + if (source == cloneGeometriesItem) |
---|
1916 | 2309 | { |
---|
1917 | 2310 | boolean one = false; |
---|
1918 | 2311 | |
---|
.. | .. |
---|
1938 | 2331 | ResetModel(); |
---|
1939 | 2332 | refreshContents(); |
---|
1940 | 2333 | } else |
---|
1941 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2334 | + if (source == shareGeometriesItem) |
---|
1942 | 2335 | { |
---|
1943 | 2336 | boolean one = false; |
---|
1944 | 2337 | |
---|
1945 | 2338 | if (group.selection.size() == 1) |
---|
1946 | 2339 | one = true; |
---|
1947 | 2340 | |
---|
| 2341 | + Object3D merge = null; |
---|
| 2342 | + |
---|
1948 | 2343 | Object3D content = new cGroup(); |
---|
1949 | 2344 | |
---|
1950 | 2345 | for (int i=0; i<group.selection.size(); i++) |
---|
1951 | 2346 | { |
---|
1952 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2347 | + merge = new Merge(group.selection.get(i)); |
---|
1953 | 2348 | |
---|
1954 | 2349 | if (one) |
---|
1955 | | - makeSomething(sel, false); |
---|
| 2350 | + makeSomething(merge, false); |
---|
1956 | 2351 | else |
---|
1957 | | - content.addChild(sel); |
---|
| 2352 | + content.addChild(merge); |
---|
1958 | 2353 | } |
---|
1959 | 2354 | |
---|
1960 | 2355 | if (!one) |
---|
1961 | | - makeSomething(content, false); |
---|
1962 | | - |
---|
1963 | | - ResetModel(); |
---|
1964 | | - refreshContents(); |
---|
| 2356 | + makeSomething(content, true); |
---|
| 2357 | + else |
---|
| 2358 | + { |
---|
| 2359 | + ResetModel(); |
---|
| 2360 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2361 | + refreshContents(); |
---|
| 2362 | + } |
---|
1965 | 2363 | } else |
---|
1966 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2364 | + if (source == mergeGeometriesItem) |
---|
1967 | 2365 | { |
---|
1968 | 2366 | boolean one = false; |
---|
1969 | 2367 | |
---|
.. | .. |
---|
1993 | 2391 | ResetModel(); |
---|
1994 | 2392 | refreshContents(); |
---|
1995 | 2393 | } else |
---|
1996 | | - if (event.getSource() == linkverticesItem) |
---|
| 2394 | + if (source == linkverticesItem) |
---|
1997 | 2395 | { |
---|
1998 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2396 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
1999 | 2397 | // { |
---|
2000 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2398 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2001 | 2399 | // |
---|
2002 | 2400 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2003 | 2401 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2006 | 2404 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2007 | 2405 | // refreshContents(); |
---|
2008 | 2406 | // } |
---|
2009 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2407 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2010 | 2408 | { |
---|
2011 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2409 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2012 | 2410 | |
---|
2013 | 2411 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2014 | 2412 | content = ((cGroup)content).get(0); |
---|
2015 | 2413 | |
---|
2016 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2414 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2017 | 2415 | for (int i=0; i<group.selection.size(); i++) |
---|
2018 | 2416 | { |
---|
2019 | | - boolean random = CameraPane.RANDOM; |
---|
2020 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2417 | + boolean random = CameraPane.SWITCH; |
---|
| 2418 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2021 | 2419 | group.selection.get(i).linkVerticesThis(content); |
---|
2022 | 2420 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2023 | | - CameraPane.RANDOM = random; |
---|
| 2421 | + CameraPane.SWITCH = random; |
---|
2024 | 2422 | } |
---|
2025 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2423 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2026 | 2424 | refreshContents(); |
---|
2027 | 2425 | } |
---|
2028 | 2426 | } else |
---|
2029 | | - if (event.getSource() == resetsupportItem) |
---|
| 2427 | + if (source == resetsupportItem) |
---|
2030 | 2428 | { |
---|
2031 | 2429 | for (int i=0; i<group.selection.size(); i++) |
---|
2032 | 2430 | { |
---|
2033 | | - boolean random = CameraPane.RANDOM; |
---|
2034 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2431 | + boolean random = CameraPane.SWITCH; |
---|
| 2432 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2035 | 2433 | group.selection.get(i).linkVerticesThis(null); |
---|
2036 | | - CameraPane.RANDOM = random; |
---|
| 2434 | + CameraPane.SWITCH = random; |
---|
2037 | 2435 | } |
---|
2038 | 2436 | |
---|
2039 | 2437 | refreshContents(); |
---|
2040 | 2438 | } else |
---|
2041 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2439 | + if (source == relinkverticesItem) |
---|
| 2440 | + { |
---|
| 2441 | + boolean random = CameraPane.SWITCH; |
---|
| 2442 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2443 | + group.selection.RelinkToSupport(); |
---|
| 2444 | + CameraPane.SWITCH = random; |
---|
| 2445 | + |
---|
| 2446 | + refreshContents(); |
---|
| 2447 | + } else |
---|
| 2448 | + if (source == resetreferencesItem) |
---|
2042 | 2449 | { |
---|
2043 | 2450 | for (int i=0; i<group.selection.size(); i++) |
---|
2044 | 2451 | { |
---|
.. | .. |
---|
2047 | 2454 | |
---|
2048 | 2455 | refreshContents(); |
---|
2049 | 2456 | } else |
---|
2050 | | - if (event.getSource() == setMasterItem) |
---|
| 2457 | + if (source == setMasterItem) |
---|
2051 | 2458 | { |
---|
2052 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2459 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2053 | 2460 | { |
---|
2054 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2461 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2055 | 2462 | |
---|
2056 | 2463 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2057 | 2464 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2060 | 2467 | refreshContents(); |
---|
2061 | 2468 | } |
---|
2062 | 2469 | } else |
---|
2063 | | - if (event.getSource() == poseMeshItem) |
---|
| 2470 | + if (source == poseMeshItem) |
---|
2064 | 2471 | { |
---|
2065 | 2472 | if (group.selection.size() == 1) |
---|
2066 | 2473 | { |
---|
2067 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2474 | + if (Grafreed.clipboard.size() == 1) |
---|
2068 | 2475 | { |
---|
2069 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2476 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2070 | 2477 | |
---|
2071 | 2478 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2072 | 2479 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2079 | 2486 | } |
---|
2080 | 2487 | |
---|
2081 | 2488 | } else |
---|
2082 | | - if (event.getSource() == revertMeshItem) |
---|
| 2489 | + if (source == revertMeshItem) |
---|
2083 | 2490 | { |
---|
2084 | 2491 | RevertMeshes(); |
---|
2085 | 2492 | } else |
---|
2086 | | - if (event.getSource() == resetMeshItem) |
---|
| 2493 | + if (source == resetAllItem) |
---|
2087 | 2494 | { |
---|
2088 | 2495 | ResetAll(); |
---|
2089 | 2496 | } else |
---|
2090 | | - if (event.getSource() == stepAllItem) |
---|
| 2497 | + if (source == stepAllItem) |
---|
2091 | 2498 | { |
---|
2092 | 2499 | StepAll(); |
---|
2093 | 2500 | } else |
---|
2094 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2501 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2095 | 2502 | { |
---|
2096 | 2503 | //int indices[] = jList.getSelectedIndices(); |
---|
2097 | 2504 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2099 | 2506 | |
---|
2100 | 2507 | ClearSelection(false); |
---|
2101 | 2508 | } else |
---|
2102 | | - if (event.getSource() == clearAllItem) |
---|
| 2509 | + if (source == clearAllItem) |
---|
2103 | 2510 | { |
---|
2104 | 2511 | ClearSelection(true); |
---|
2105 | 2512 | } else |
---|
2106 | | - if (event.getSource() == grabItem) |
---|
| 2513 | + if (source == grabItem) |
---|
2107 | 2514 | { |
---|
2108 | 2515 | group(new cGroup(), true); |
---|
2109 | 2516 | } else |
---|
2110 | | - if (event.getSource() == frontItem) |
---|
| 2517 | + if (source == hideItem) |
---|
| 2518 | + { |
---|
| 2519 | + group(new HiddenObject()); |
---|
| 2520 | + } else |
---|
| 2521 | + if (source == frontItem) |
---|
2111 | 2522 | { |
---|
2112 | 2523 | front(); |
---|
2113 | 2524 | } else |
---|
2114 | | - if (event.getSource() == backItem) |
---|
| 2525 | + if (source == backItem) |
---|
2115 | 2526 | { |
---|
2116 | 2527 | back(); |
---|
2117 | 2528 | } else |
---|
2118 | | - if (event.getSource() == cameraItem) |
---|
| 2529 | + if (source == cameraItem) |
---|
2119 | 2530 | { |
---|
2120 | 2531 | makeSomething(new Camera()); |
---|
2121 | 2532 | } else |
---|
2122 | | - if (event.getSource() == compositeItem) |
---|
| 2533 | + if (source == compositeItem) |
---|
2123 | 2534 | { |
---|
2124 | 2535 | group(new Composite()); |
---|
2125 | 2536 | } else |
---|
2126 | | - if (event.getSource() == randomItem) |
---|
| 2537 | + if (source == randomItem) |
---|
2127 | 2538 | { |
---|
2128 | 2539 | RandomNode random = new RandomNode(); |
---|
2129 | 2540 | group(random); |
---|
2130 | 2541 | if (random.size() > 0) |
---|
2131 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2542 | + random.name = random.get(0).name + "Switch"; |
---|
2132 | 2543 | } else |
---|
2133 | | - if (event.getSource() == physicsItem) |
---|
| 2544 | + if (source == physicsItem) |
---|
2134 | 2545 | { |
---|
2135 | 2546 | group(new PhysicsNode()); |
---|
2136 | 2547 | } else |
---|
2137 | | - if (event.getSource() == frameselectorItem) |
---|
| 2548 | + if (source == frameselectorItem) |
---|
2138 | 2549 | { |
---|
2139 | 2550 | for (int i=0; i<group.selection.size(); i++) |
---|
2140 | 2551 | { |
---|
.. | .. |
---|
2146 | 2557 | ResetModel(); |
---|
2147 | 2558 | refreshContents(); |
---|
2148 | 2559 | } else |
---|
2149 | | - if (event.getSource() == switchGeoItem) |
---|
| 2560 | + if (source == switchGeoItem) |
---|
2150 | 2561 | { |
---|
2151 | 2562 | for (int i=0; i<group.selection.size(); i++) |
---|
2152 | 2563 | { |
---|
.. | .. |
---|
2158 | 2569 | ResetModel(); |
---|
2159 | 2570 | refreshContents(); |
---|
2160 | 2571 | } else |
---|
2161 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2572 | + if (source == switchTransfoItem) |
---|
2162 | 2573 | { |
---|
2163 | 2574 | for (int i=0; i<group.selection.size(); i++) |
---|
2164 | 2575 | { |
---|
.. | .. |
---|
2170 | 2581 | ResetModel(); |
---|
2171 | 2582 | refreshContents(); |
---|
2172 | 2583 | } else |
---|
2173 | | - if (event.getSource() == morphItem) |
---|
| 2584 | + if (source == morphItem) |
---|
2174 | 2585 | { |
---|
2175 | 2586 | for (int i=0; i<group.selection.size(); i++) |
---|
2176 | 2587 | { |
---|
.. | .. |
---|
2182 | 2593 | ResetModel(); |
---|
2183 | 2594 | refreshContents(); |
---|
2184 | 2595 | } else |
---|
2185 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2596 | + if (source == scriptNodeItem) |
---|
2186 | 2597 | { |
---|
2187 | 2598 | boolean atleastone = false; |
---|
2188 | 2599 | |
---|
.. | .. |
---|
2221 | 2632 | } |
---|
2222 | 2633 | } |
---|
2223 | 2634 | } else |
---|
2224 | | - if (event.getSource() == linkerItem) |
---|
| 2635 | + if (source == linkerItem) |
---|
2225 | 2636 | { |
---|
2226 | 2637 | group(new cLinker()); |
---|
2227 | 2638 | } else |
---|
2228 | | - if (event.getSource() == textureItem) |
---|
| 2639 | + if (source == textureItem) |
---|
2229 | 2640 | { |
---|
2230 | 2641 | group(new TextureNode()); |
---|
2231 | 2642 | } else |
---|
2232 | | - if (event.getSource() == shadowXItem) |
---|
| 2643 | + if (source == billboardItem) |
---|
| 2644 | + { |
---|
| 2645 | + group(new BillboardNode()); |
---|
| 2646 | + } else |
---|
| 2647 | + if (source == shadowXItem) |
---|
2233 | 2648 | { |
---|
2234 | 2649 | CastShadow(0); |
---|
2235 | 2650 | } else |
---|
2236 | | - if (event.getSource() == shadowYItem) |
---|
| 2651 | + if (source == shadowYItem) |
---|
2237 | 2652 | { |
---|
2238 | 2653 | CastShadow(1); |
---|
2239 | 2654 | } else |
---|
2240 | | - if (event.getSource() == shadowZItem) |
---|
| 2655 | + if (source == shadowZItem) |
---|
2241 | 2656 | { |
---|
2242 | 2657 | CastShadow(2); |
---|
2243 | 2658 | } else |
---|
2244 | | - if (event.getSource() == ungroupItem) |
---|
| 2659 | + if (source == ungroupItem || source == ungroupButton) |
---|
2245 | 2660 | { |
---|
2246 | | - ungroup(); |
---|
| 2661 | + //ungroup(); |
---|
| 2662 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2663 | + { |
---|
| 2664 | + Ungroup(group.selection.get(i)); |
---|
| 2665 | + } |
---|
| 2666 | + |
---|
| 2667 | + ClearSelection(false); |
---|
| 2668 | + |
---|
| 2669 | + refreshContents(); |
---|
2247 | 2670 | } else |
---|
2248 | | - if (event.getSource() == genUVItem) |
---|
| 2671 | + if (source == genUVItem) |
---|
2249 | 2672 | { |
---|
2250 | 2673 | GenUV(); |
---|
2251 | 2674 | } else |
---|
2252 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2675 | + if (source == genNormalsCADItem) |
---|
2253 | 2676 | { |
---|
2254 | 2677 | GenNormals(true); |
---|
2255 | 2678 | } else |
---|
2256 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2679 | + if (source == genNormalsMESHItem) |
---|
| 2680 | + { |
---|
| 2681 | + GenNormalsMESH(); |
---|
| 2682 | + } else |
---|
| 2683 | + if (source == genNormalsORGANItem) |
---|
2257 | 2684 | { |
---|
2258 | 2685 | GenNormals(false); |
---|
2259 | 2686 | } else |
---|
2260 | | - if (event.getSource() == stripifyItem) |
---|
| 2687 | + if (source == genNormalsMINEItem) |
---|
| 2688 | + { |
---|
| 2689 | + GenNormalsMINE(); |
---|
| 2690 | + } else |
---|
| 2691 | + if (source == stripifyItem) |
---|
2261 | 2692 | { |
---|
2262 | 2693 | Stripify(); |
---|
2263 | 2694 | } else |
---|
2264 | | - if (event.getSource() == unstripifyItem) |
---|
| 2695 | + if (source == unstripifyItem) |
---|
2265 | 2696 | { |
---|
2266 | 2697 | Unstripify(); |
---|
2267 | 2698 | } else |
---|
2268 | | - if (event.getSource() == trimItem) |
---|
| 2699 | + if (source == trimItem) |
---|
2269 | 2700 | { |
---|
2270 | 2701 | Trim(); |
---|
2271 | 2702 | } else |
---|
2272 | | - if (event.getSource() == untrimItem) |
---|
| 2703 | + if (source == untrimItem) |
---|
2273 | 2704 | { |
---|
2274 | 2705 | Untrim(); |
---|
2275 | 2706 | } else |
---|
2276 | | - if (event.getSource() == clearColorsItem) |
---|
| 2707 | + if (source == clearColorsItem) |
---|
2277 | 2708 | { |
---|
2278 | 2709 | ClearColors(); |
---|
2279 | 2710 | } else |
---|
2280 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2711 | + if (source == clearMaterialsItem) |
---|
2281 | 2712 | { |
---|
2282 | 2713 | ClearMaterials(); |
---|
2283 | 2714 | } else |
---|
2284 | | - if (event.getSource() == liveleavesItem) |
---|
| 2715 | + if (source == liveleavesItem) |
---|
2285 | 2716 | { |
---|
2286 | 2717 | LiveLeaves(true); |
---|
2287 | 2718 | } else |
---|
2288 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2719 | + if (source == unliveleavesItem) |
---|
2289 | 2720 | { |
---|
2290 | 2721 | LiveLeaves(false); |
---|
2291 | 2722 | } else |
---|
2292 | | - if (event.getSource() == supportleavesItem) |
---|
| 2723 | + if (source == supportleavesItem) |
---|
2293 | 2724 | { |
---|
2294 | 2725 | SupportLeaves(true); |
---|
2295 | 2726 | } else |
---|
2296 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2727 | + if (source == unsupportleavesItem) |
---|
2297 | 2728 | { |
---|
2298 | 2729 | SupportLeaves(false); |
---|
2299 | 2730 | } else |
---|
2300 | | - if (event.getSource() == hideleavesItem) |
---|
| 2731 | + if (source == hideleavesItem) |
---|
2301 | 2732 | { |
---|
2302 | 2733 | HideLeaves(true); |
---|
2303 | 2734 | } else |
---|
2304 | | - if (event.getSource() == showleavesItem) |
---|
| 2735 | + if (source == showleavesItem) |
---|
2305 | 2736 | { |
---|
2306 | 2737 | HideLeaves(false); |
---|
2307 | 2738 | } else |
---|
2308 | | - if (event.getSource() == markleavesItem) |
---|
| 2739 | + if (source == markleavesItem) |
---|
2309 | 2740 | { |
---|
2310 | 2741 | MarkLeaves(true); |
---|
2311 | 2742 | } else |
---|
2312 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2743 | + if (source == unmarkleavesItem) |
---|
2313 | 2744 | { |
---|
2314 | 2745 | MarkLeaves(false); |
---|
2315 | 2746 | } else |
---|
2316 | | - if (event.getSource() == flipVItem) |
---|
| 2747 | + if (source == rewindleavesItem) |
---|
| 2748 | + { |
---|
| 2749 | + RewindLeaves(true); |
---|
| 2750 | + } else |
---|
| 2751 | + if (source == unrewindleavesItem) |
---|
| 2752 | + { |
---|
| 2753 | + RewindLeaves(false); |
---|
| 2754 | + } else |
---|
| 2755 | + if (source == randomleavesItem) |
---|
| 2756 | + { |
---|
| 2757 | + RandomLeaves(true); |
---|
| 2758 | + } else |
---|
| 2759 | + if (source == unrandomleavesItem) |
---|
| 2760 | + { |
---|
| 2761 | + RandomLeaves(false); |
---|
| 2762 | + } else |
---|
| 2763 | + if (source == flipVItem) |
---|
2317 | 2764 | { |
---|
2318 | 2765 | FlipV(true); |
---|
2319 | 2766 | } else |
---|
2320 | | - if (event.getSource() == unflipVItem) |
---|
| 2767 | + if (source == unflipVItem) |
---|
2321 | 2768 | { |
---|
2322 | 2769 | FlipV(false); |
---|
2323 | 2770 | } else |
---|
2324 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2771 | + if (source == lowTexturesItem) |
---|
2325 | 2772 | { |
---|
2326 | 2773 | SetTexRes(0); |
---|
2327 | 2774 | } else |
---|
2328 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2775 | + if (source == normalTexturesItem) |
---|
2329 | 2776 | { |
---|
2330 | 2777 | SetTexRes(1); |
---|
2331 | 2778 | } else |
---|
2332 | | - if (event.getSource() == highTexturesItem) |
---|
| 2779 | + if (source == highTexturesItem) |
---|
2333 | 2780 | { |
---|
2334 | 2781 | SetTexRes(2); |
---|
2335 | 2782 | } else |
---|
2336 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2783 | + if (source == veryhighTexturesItem) |
---|
2337 | 2784 | { |
---|
2338 | 2785 | SetTexRes(3); |
---|
2339 | 2786 | } else |
---|
2340 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2787 | + if (source == maxTexturesItem) |
---|
2341 | 2788 | { |
---|
2342 | 2789 | SetTexRes(4); |
---|
2343 | 2790 | } else |
---|
2344 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2791 | + if (source == panoTexturesItem) |
---|
2345 | 2792 | { |
---|
2346 | 2793 | SetTexRes(5); |
---|
2347 | 2794 | } else |
---|
2348 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2795 | + if (source == reverseNormalsItem) |
---|
2349 | 2796 | { |
---|
2350 | 2797 | ReverseNormals(); |
---|
2351 | 2798 | } else |
---|
2352 | | - if (event.getSource() == parseverticesItem) |
---|
| 2799 | + if (source == parseverticesItem) |
---|
2353 | 2800 | { |
---|
2354 | 2801 | ParseVertices(); |
---|
2355 | 2802 | } else |
---|
2356 | | - if (event.getSource() == alignItem) |
---|
| 2803 | + if (source == textureFieldItem) |
---|
| 2804 | + { |
---|
| 2805 | + TextureVertices(); |
---|
| 2806 | + } else |
---|
| 2807 | + if (source == alignItem) |
---|
2357 | 2808 | { |
---|
2358 | 2809 | Align(); |
---|
2359 | 2810 | } else |
---|
2360 | | - if (event.getSource() == mirrorItem) |
---|
| 2811 | + if (source == mirrorItem) |
---|
2361 | 2812 | { |
---|
2362 | 2813 | MirrorPoses(); |
---|
2363 | 2814 | } else |
---|
2364 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2815 | + if (source == reduceMorphItem) |
---|
2365 | 2816 | { |
---|
2366 | 2817 | MeshReduction(false); |
---|
2367 | 2818 | } else |
---|
2368 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2819 | + if (source == reduce34MorphItem) |
---|
2369 | 2820 | { |
---|
2370 | 2821 | MeshReduction(true); |
---|
2371 | 2822 | } else |
---|
2372 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2823 | + if (source == reverseTrianglesItem) |
---|
2373 | 2824 | { |
---|
2374 | 2825 | ReverseTriangles(); |
---|
2375 | 2826 | } else |
---|
2376 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2827 | + if (source == reduceMeshItem) |
---|
2377 | 2828 | { |
---|
2378 | 2829 | ReduceMesh(false); |
---|
2379 | 2830 | } else |
---|
2380 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2831 | + if (source == reduce34MeshItem) |
---|
2381 | 2832 | { |
---|
2382 | 2833 | ReduceMesh(true); |
---|
2383 | 2834 | } else |
---|
2384 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2835 | + if (source == increaseMeshItem) |
---|
2385 | 2836 | { |
---|
2386 | 2837 | IncreaseMesh(); |
---|
2387 | 2838 | } else |
---|
2388 | | - if (event.getSource() == clipMeshItem) |
---|
| 2839 | + if (source == clipMeshItem) |
---|
2389 | 2840 | { |
---|
2390 | 2841 | ClipMesh(); |
---|
2391 | 2842 | } else |
---|
2392 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2843 | + if (source == smoothMeshItem) |
---|
2393 | 2844 | { |
---|
2394 | 2845 | SmoothMesh(); |
---|
2395 | 2846 | } else |
---|
2396 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2847 | + if (source == transformGeometryItem) |
---|
2397 | 2848 | { |
---|
2398 | 2849 | TransformGeometry(); |
---|
2399 | 2850 | } else |
---|
2400 | | - if (event.getSource() == resetTransformItem) |
---|
| 2851 | + if (source == transformChildrenItem) |
---|
| 2852 | + { |
---|
| 2853 | + TransformChildren(); |
---|
| 2854 | + } else |
---|
| 2855 | + if (source == resetTransformItem) |
---|
2401 | 2856 | { |
---|
2402 | 2857 | ResetTransform(); |
---|
2403 | 2858 | } else |
---|
2404 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2859 | + if (source == resetCentroidItem) |
---|
2405 | 2860 | { |
---|
2406 | | - ResetCentroid(); |
---|
| 2861 | + ResetCentroid(true); |
---|
2407 | 2862 | } else |
---|
2408 | | - if (event.getSource() == resetParentItem) |
---|
| 2863 | + if (source == resetCentroidXZItem) |
---|
| 2864 | + { |
---|
| 2865 | + ResetCentroid(false); |
---|
| 2866 | + } else |
---|
| 2867 | + if (source == resetParentItem) |
---|
2409 | 2868 | { |
---|
2410 | 2869 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2411 | 2870 | { |
---|
.. | .. |
---|
2415 | 2874 | |
---|
2416 | 2875 | refreshContents(); |
---|
2417 | 2876 | } else |
---|
2418 | | - if (event.getSource() == repairParentItem) |
---|
| 2877 | + if (source == repairParentItem) |
---|
2419 | 2878 | { |
---|
2420 | 2879 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2421 | 2880 | { |
---|
.. | .. |
---|
2429 | 2888 | |
---|
2430 | 2889 | refreshContents(); |
---|
2431 | 2890 | } else |
---|
2432 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2891 | + if (source == repairShadowItem) |
---|
| 2892 | + { |
---|
| 2893 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2894 | + { |
---|
| 2895 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2896 | + obj.RepairShadow(); |
---|
| 2897 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2898 | +// { |
---|
| 2899 | +// obj.get(i).parent = obj; |
---|
| 2900 | +// } |
---|
| 2901 | + } |
---|
| 2902 | + |
---|
| 2903 | + refreshContents(); |
---|
| 2904 | + } else |
---|
| 2905 | + if (source == sortbysizeItem) |
---|
2433 | 2906 | { |
---|
2434 | 2907 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2435 | 2908 | { |
---|
.. | .. |
---|
2441 | 2914 | ResetModel(); |
---|
2442 | 2915 | refreshContents(); |
---|
2443 | 2916 | } else |
---|
2444 | | - if (event.getSource() == sortbynameItem) |
---|
| 2917 | + if (source == sortbynameItem) |
---|
2445 | 2918 | { |
---|
2446 | 2919 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2447 | 2920 | { |
---|
.. | .. |
---|
2453 | 2926 | ResetModel(); |
---|
2454 | 2927 | refreshContents(); |
---|
2455 | 2928 | } else |
---|
2456 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2929 | + if (source == attachPigmentItem) |
---|
2457 | 2930 | { |
---|
2458 | 2931 | String texture = GetFile("Attach pigment"); |
---|
2459 | 2932 | Object3D obj; |
---|
.. | .. |
---|
2465 | 2938 | |
---|
2466 | 2939 | refreshContents(); |
---|
2467 | 2940 | } else |
---|
2468 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2941 | + if (source == detachPigmentItem) |
---|
2469 | 2942 | { |
---|
2470 | 2943 | Object3D obj; |
---|
2471 | 2944 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2476 | 2949 | |
---|
2477 | 2950 | refreshContents(); |
---|
2478 | 2951 | } else |
---|
2479 | | - if (event.getSource() == attachBumpItem) |
---|
| 2952 | + if (source == attachBumpItem) |
---|
2480 | 2953 | { |
---|
2481 | 2954 | String texture = GetFile("Attach bump"); |
---|
2482 | 2955 | Object3D obj; |
---|
.. | .. |
---|
2488 | 2961 | |
---|
2489 | 2962 | refreshContents(); |
---|
2490 | 2963 | } else |
---|
2491 | | - if (event.getSource() == detachBumpItem) |
---|
| 2964 | + if (source == detachBumpItem) |
---|
2492 | 2965 | { |
---|
2493 | 2966 | Object3D obj; |
---|
2494 | 2967 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2499 | 2972 | |
---|
2500 | 2973 | refreshContents(); |
---|
2501 | 2974 | } else |
---|
2502 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2975 | + if (source == pigmentBumpItem) |
---|
2503 | 2976 | { |
---|
2504 | 2977 | Object3D obj; |
---|
2505 | 2978 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2510 | 2983 | |
---|
2511 | 2984 | refreshContents(); |
---|
2512 | 2985 | } else |
---|
2513 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2986 | + if (source == flashSelectionButton) |
---|
2514 | 2987 | { |
---|
2515 | 2988 | CameraPane.flash = true; |
---|
2516 | 2989 | refreshContents(); |
---|
2517 | 2990 | } else |
---|
2518 | | - if (event.getSource() == oneButton) |
---|
| 2991 | + if (source == oneButton) |
---|
2519 | 2992 | { |
---|
2520 | 2993 | } else |
---|
2521 | | - if (event.getSource() == twoButton) |
---|
| 2994 | + if (source == twoButton) |
---|
2522 | 2995 | { |
---|
2523 | 2996 | radio.layout = twoButton; |
---|
| 2997 | + |
---|
| 2998 | + if (CameraPane.FULLSCREEN) |
---|
| 2999 | + fullscreenLayout = radio.layout; |
---|
| 3000 | + |
---|
2524 | 3001 | // bug |
---|
2525 | 3002 | //gridPanel.setDividerLocation(1.0); |
---|
2526 | 3003 | //bigPanel.setDividerLocation(0.0); |
---|
2527 | | - bigThree.remove(jtp); |
---|
2528 | | - bigThree.remove(cameraPanel); |
---|
2529 | | - bigThree.remove(XYZPanel); |
---|
2530 | | - aWindowConstraints.gridx = 0; |
---|
2531 | | - aWindowConstraints.gridy = 0; |
---|
2532 | | - aWindowConstraints.gridwidth = 1; |
---|
2533 | | - // aConstraints.gridheight = 3; |
---|
2534 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2535 | | - aWindowConstraints.weightx = 0; |
---|
2536 | | - aWindowConstraints.weighty = 1; |
---|
2537 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2538 | | - aWindowConstraints.weightx = 1; |
---|
2539 | | - aWindowConstraints.gridwidth = 3; |
---|
2540 | | - // aConstraints.gridheight = 3; |
---|
2541 | | - aWindowConstraints.gridx = 1; |
---|
2542 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2543 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2544 | | - aWindowConstraints.weightx = 0; |
---|
2545 | | - aWindowConstraints.gridx = 4; |
---|
2546 | | - aWindowConstraints.gridwidth = 1; |
---|
2547 | | - // aConstraints.gridheight = 3; |
---|
2548 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2549 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2550 | | - bigThree.revalidate(); |
---|
| 3004 | +// bigThree.remove(scenePanel); |
---|
| 3005 | +// bigThree.remove(centralPanel); |
---|
| 3006 | +// bigThree.remove(XYZPanel); |
---|
| 3007 | +// aWindowConstraints.gridx = 0; |
---|
| 3008 | +// aWindowConstraints.gridy = 0; |
---|
| 3009 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3010 | +// // aConstraints.gridheight = 3; |
---|
| 3011 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3012 | +// aWindowConstraints.weightx = 0; |
---|
| 3013 | +// aWindowConstraints.weighty = 1; |
---|
| 3014 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3015 | +// aWindowConstraints.weightx = 1; |
---|
| 3016 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3017 | +// // aConstraints.gridheight = 3; |
---|
| 3018 | +// aWindowConstraints.gridx = 1; |
---|
| 3019 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3020 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3021 | +// aWindowConstraints.weightx = 0; |
---|
| 3022 | +// aWindowConstraints.gridx = 4; |
---|
| 3023 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3024 | +// // aConstraints.gridheight = 3; |
---|
| 3025 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3026 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3027 | +// scenePanel.setVisible(false); |
---|
| 3028 | +// centralPanel.setVisible(true); |
---|
| 3029 | +// XYZPanel.setVisible(false); |
---|
| 3030 | + bigThree.ClearUI(); |
---|
| 3031 | + bigThree.add(centralPanel); |
---|
| 3032 | + bigThree.FlushUI(); |
---|
| 3033 | + |
---|
| 3034 | + cameraView.requestFocusInWindow(); |
---|
| 3035 | + |
---|
| 3036 | +// refreshContents(true); |
---|
| 3037 | +// |
---|
| 3038 | +// try |
---|
| 3039 | +// { |
---|
| 3040 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3041 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3042 | +// bot.mouseMove(100, 100); |
---|
| 3043 | +// bot.mousePress(mask); |
---|
| 3044 | +// bot.mouseRelease(mask); |
---|
| 3045 | +// } |
---|
| 3046 | +// catch (Exception e) |
---|
| 3047 | +// { |
---|
| 3048 | +// |
---|
| 3049 | +// } |
---|
| 3050 | + |
---|
2551 | 3051 | } else |
---|
2552 | | - if (event.getSource() == threeButton) |
---|
| 3052 | + if (source == threeButton) |
---|
2553 | 3053 | { |
---|
2554 | 3054 | radio.layout = threeButton; |
---|
2555 | | - bigThree.remove(jtp); |
---|
2556 | | - bigThree.remove(cameraPanel); |
---|
2557 | | - bigThree.remove(XYZPanel); |
---|
2558 | | - aWindowConstraints.gridx = 0; |
---|
2559 | | - aWindowConstraints.gridy = 0; |
---|
2560 | | - aWindowConstraints.gridwidth = 1; |
---|
2561 | | - // aConstraints.gridheight = 3; |
---|
2562 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2563 | | - aWindowConstraints.weightx = 0; |
---|
2564 | | - aWindowConstraints.weighty = 1; |
---|
2565 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2566 | | - aWindowConstraints.weightx = 1; |
---|
2567 | | - aWindowConstraints.gridwidth = 3; |
---|
2568 | | - // aConstraints.gridheight = 3; |
---|
2569 | | - aWindowConstraints.gridx = 1; |
---|
2570 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2571 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2572 | | - aWindowConstraints.weightx = 0; |
---|
2573 | | - aWindowConstraints.gridx = 4; |
---|
2574 | | - aWindowConstraints.gridwidth = 1; |
---|
2575 | | - // aConstraints.gridheight = 3; |
---|
2576 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2577 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2578 | | - bigThree.revalidate(); |
---|
| 3055 | + |
---|
| 3056 | + if (CameraPane.FULLSCREEN) |
---|
| 3057 | + fullscreenLayout = radio.layout; |
---|
| 3058 | + |
---|
| 3059 | +// bigThree.remove(scenePanel); |
---|
| 3060 | +// bigThree.remove(centralPanel); |
---|
| 3061 | +// bigThree.remove(XYZPanel); |
---|
| 3062 | +// aWindowConstraints.gridx = 0; |
---|
| 3063 | +// aWindowConstraints.gridy = 0; |
---|
| 3064 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3065 | +// // aConstraints.gridheight = 3; |
---|
| 3066 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3067 | +// aWindowConstraints.weightx = 0; |
---|
| 3068 | +// aWindowConstraints.weighty = 1; |
---|
| 3069 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3070 | +// aWindowConstraints.weightx = 1; |
---|
| 3071 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3072 | +// // aConstraints.gridheight = 3; |
---|
| 3073 | +// aWindowConstraints.gridx = 1; |
---|
| 3074 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3075 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3076 | +// aWindowConstraints.weightx = 0; |
---|
| 3077 | +// aWindowConstraints.gridx = 4; |
---|
| 3078 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3079 | +// // aConstraints.gridheight = 3; |
---|
| 3080 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3081 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3082 | +// bigThree.validate(); |
---|
| 3083 | +// scenePanel.setVisible(false); |
---|
| 3084 | +// centralPanel.setVisible(true); |
---|
| 3085 | +// XYZPanel.setVisible(true); |
---|
| 3086 | + bigThree.ClearUI(); |
---|
| 3087 | + bigThree.add(centralPanel); |
---|
| 3088 | + bigThree.add(XYZPanel); |
---|
| 3089 | + bigThree.FlushUI(); |
---|
| 3090 | + |
---|
| 3091 | + cameraView.requestFocusInWindow(); |
---|
2579 | 3092 | } else |
---|
2580 | | - if (event.getSource() == fourButton) |
---|
| 3093 | + if (source == fourButton) |
---|
2581 | 3094 | { |
---|
2582 | 3095 | radio.layout = fourButton; |
---|
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 | | - // aWindowConstraints.gridheight = 3; |
---|
2590 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2591 | | - aWindowConstraints.weightx = 1; |
---|
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 | | - // aWindowConstraints.gridheight = 3; |
---|
2604 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2605 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2606 | | - bigThree.revalidate(); |
---|
| 3096 | + |
---|
| 3097 | + if (CameraPane.FULLSCREEN) |
---|
| 3098 | + fullscreenLayout = radio.layout; |
---|
| 3099 | + |
---|
| 3100 | +// bigThree.remove(scenePanel); |
---|
| 3101 | +// bigThree.remove(centralPanel); |
---|
| 3102 | +// bigThree.remove(XYZPanel); |
---|
| 3103 | +// aWindowConstraints.gridx = 0; |
---|
| 3104 | +// aWindowConstraints.gridy = 0; |
---|
| 3105 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3106 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3107 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3108 | +// aWindowConstraints.weightx = 1; |
---|
| 3109 | +// aWindowConstraints.weighty = 1; |
---|
| 3110 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3111 | +// aWindowConstraints.weightx = 1; |
---|
| 3112 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3113 | +// // aConstraints.gridheight = 3; |
---|
| 3114 | +// aWindowConstraints.gridx = 1; |
---|
| 3115 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3116 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3117 | +// aWindowConstraints.weightx = 0; |
---|
| 3118 | +// aWindowConstraints.gridx = 4; |
---|
| 3119 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3120 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3121 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3122 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3123 | +// bigThree.validate(); |
---|
| 3124 | +// scenePanel.setVisible(true); |
---|
| 3125 | +// centralPanel.setVisible(false); |
---|
| 3126 | +// XYZPanel.setVisible(false); |
---|
| 3127 | + bigThree.ClearUI(); |
---|
| 3128 | + bigThree.add(scenePanel); |
---|
| 3129 | + bigThree.FlushUI(); |
---|
| 3130 | + |
---|
| 3131 | + cameraView.requestFocusInWindow(); |
---|
2607 | 3132 | } else |
---|
2608 | | - if (event.getSource() == sixButton) |
---|
| 3133 | + if (source == sixButton) |
---|
2609 | 3134 | { |
---|
2610 | 3135 | radio.layout = sixButton; |
---|
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 | | - // aWindowConstraints.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 | | - // aWindowConstraints.gridheight = 3; |
---|
2632 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2633 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2634 | | - bigThree.revalidate(); |
---|
| 3136 | + |
---|
| 3137 | + if (CameraPane.FULLSCREEN) |
---|
| 3138 | + fullscreenLayout = radio.layout; |
---|
| 3139 | + |
---|
| 3140 | +// bigThree.remove(scenePanel); |
---|
| 3141 | +// bigThree.remove(centralPanel); |
---|
| 3142 | +// bigThree.remove(XYZPanel); |
---|
| 3143 | +// aWindowConstraints.gridx = 0; |
---|
| 3144 | +// aWindowConstraints.gridy = 0; |
---|
| 3145 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3146 | +// // aConstraints.gridheight = 3; |
---|
| 3147 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3148 | +// aWindowConstraints.weightx = 0; |
---|
| 3149 | +// aWindowConstraints.weighty = 1; |
---|
| 3150 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3151 | +// aWindowConstraints.weightx = 1; |
---|
| 3152 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3153 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3154 | +// aWindowConstraints.gridx = 1; |
---|
| 3155 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3156 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3157 | +// aWindowConstraints.weightx = 0; |
---|
| 3158 | +// aWindowConstraints.gridx = 4; |
---|
| 3159 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3160 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3161 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3162 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3163 | +// bigThree.validate(); |
---|
| 3164 | +// scenePanel.setVisible(true); |
---|
| 3165 | +// centralPanel.setVisible(true); |
---|
| 3166 | +// XYZPanel.setVisible(false); |
---|
| 3167 | + bigThree.ClearUI(); |
---|
| 3168 | + bigThree.add(scenePanel); |
---|
| 3169 | + bigThree.add(centralPanel); |
---|
| 3170 | + bigThree.FlushUI(); |
---|
| 3171 | + |
---|
| 3172 | + cameraView.requestFocusInWindow(); |
---|
2635 | 3173 | } else |
---|
2636 | | - if (event.getSource() == sevenButton) |
---|
| 3174 | + if (source == sevenButton) |
---|
2637 | 3175 | { |
---|
2638 | 3176 | radio.layout = sevenButton; |
---|
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.VERTICAL; |
---|
2647 | | - aWindowConstraints.weightx = 0; |
---|
2648 | | - aWindowConstraints.weighty = 1; |
---|
2649 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2650 | | - aWindowConstraints.weightx = 1; |
---|
2651 | | - aWindowConstraints.gridwidth = 3; |
---|
2652 | | - // aWindowConstraints.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 | | - // aConstraints.gridheight = 3; |
---|
2660 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2661 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2662 | | - 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 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3188 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3189 | +// aWindowConstraints.weightx = 0; |
---|
| 3190 | +// aWindowConstraints.weighty = 1; |
---|
| 3191 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3192 | +// aWindowConstraints.weightx = 1; |
---|
| 3193 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3194 | +// // aWindowConstraints.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 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3203 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3204 | +// bigThree.validate(); |
---|
| 3205 | +// scenePanel.setVisible(true); |
---|
| 3206 | +// centralPanel.setVisible(true); |
---|
| 3207 | +// XYZPanel.setVisible(true); |
---|
| 3208 | + bigThree.ClearUI(); |
---|
| 3209 | + bigThree.add(scenePanel); |
---|
| 3210 | + bigThree.add(centralPanel); |
---|
| 3211 | + bigThree.add(XYZPanel); |
---|
| 3212 | + bigThree.FlushUI(); |
---|
| 3213 | + |
---|
| 3214 | + cameraView.requestFocusInWindow(); |
---|
2663 | 3215 | } else |
---|
2664 | | - if (event.getSource() == rootButton) |
---|
| 3216 | + if (source == rootButton) |
---|
2665 | 3217 | { |
---|
2666 | 3218 | Object3D obj; |
---|
2667 | 3219 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2671 | 3223 | EditObject(obj); |
---|
2672 | 3224 | } |
---|
2673 | 3225 | |
---|
| 3226 | + cameraView.requestFocusInWindow(); |
---|
2674 | 3227 | refreshContents(true); |
---|
2675 | 3228 | } else |
---|
2676 | | - if (event.getSource() == closeButton) |
---|
| 3229 | + if (source == closeButton) |
---|
2677 | 3230 | { |
---|
2678 | 3231 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2679 | 3232 | cRadio ab; |
---|
2680 | 3233 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2681 | 3234 | { |
---|
2682 | 3235 | ab = (cRadio)e.nextElement(); |
---|
2683 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3236 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2684 | 3237 | { |
---|
| 3238 | + // Patch to avoid bug with transparency. |
---|
| 3239 | + if (!ab.hadMaterial) |
---|
| 3240 | + { |
---|
| 3241 | + ab.object.material = null; |
---|
| 3242 | + } |
---|
| 3243 | + |
---|
2685 | 3244 | buttonGroup.remove(ab); |
---|
2686 | 3245 | radioPanel.remove(ab); |
---|
2687 | 3246 | |
---|
2688 | | - ab.GetObject().editWindow = null; |
---|
| 3247 | + //ab.GetObject().editWindow = null; |
---|
| 3248 | + ab.GetObject().manipWindow = null; |
---|
2689 | 3249 | // ab.GetObject().objectUI = null; // ????????? |
---|
2690 | 3250 | |
---|
2691 | 3251 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2692 | 3252 | break; |
---|
2693 | 3253 | } |
---|
2694 | 3254 | } |
---|
| 3255 | + |
---|
| 3256 | + cameraView.requestFocusInWindow(); |
---|
2695 | 3257 | refreshContents(true); |
---|
2696 | 3258 | } else |
---|
2697 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3259 | + if (source == editItem || source == editButton) |
---|
2698 | 3260 | { |
---|
2699 | 3261 | EditSelection(false); |
---|
2700 | 3262 | } else |
---|
2701 | | - if (event.getSource() == uneditButton) |
---|
| 3263 | + if (source == uneditButton) |
---|
2702 | 3264 | { |
---|
2703 | 3265 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2704 | 3266 | { |
---|
.. | .. |
---|
2708 | 3270 | child.CloseUI(); |
---|
2709 | 3271 | listUI.remove(child); |
---|
2710 | 3272 | |
---|
2711 | | - child.editWindow = null; // ??????????? |
---|
| 3273 | + //child.editWindow = null; // ??????????? |
---|
2712 | 3274 | } |
---|
2713 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3275 | + objEditor.ctrlPanel.FlushUI(); |
---|
2714 | 3276 | //objEditor.jTree.clearSelection(); |
---|
2715 | 3277 | //objEditor.ResetSliders(); |
---|
2716 | 3278 | refreshContents(true); |
---|
2717 | 3279 | } else |
---|
2718 | | - if (event.getSource() == clearPanelButton) |
---|
| 3280 | + if (source == clearPanelButton) |
---|
2719 | 3281 | { |
---|
2720 | 3282 | assert(copy == group); |
---|
2721 | 3283 | //copy.ClearUI(); |
---|
.. | .. |
---|
2726 | 3288 | listUI.clear(); |
---|
2727 | 3289 | refreshContents(true); |
---|
2728 | 3290 | } else |
---|
2729 | | - if (event.getSource() == allParamsButton) |
---|
| 3291 | + if (source == allParamsButton) |
---|
2730 | 3292 | { |
---|
2731 | 3293 | assert(copy == group); |
---|
2732 | 3294 | |
---|
.. | .. |
---|
2747 | 3309 | |
---|
2748 | 3310 | refreshContents(true); |
---|
2749 | 3311 | } else |
---|
2750 | | - if (event.getSource() == unselectButton) |
---|
| 3312 | + if (source == unselectButton) |
---|
2751 | 3313 | { |
---|
2752 | 3314 | objEditor.jTree.clearSelection(); |
---|
2753 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3315 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2754 | 3316 | objEditor.ResetSliders(); |
---|
2755 | 3317 | refreshContents(true); |
---|
2756 | 3318 | } else |
---|
2757 | | - if(event.getSource() instanceof cRadio) |
---|
| 3319 | + if(source instanceof cRadio) |
---|
2758 | 3320 | { |
---|
2759 | 3321 | group.parent = keepparent; |
---|
2760 | 3322 | group.attributes = 0; |
---|
2761 | 3323 | //group.editWindow = null; |
---|
2762 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3324 | + /*cRadio*/ radio = (cRadio)source; |
---|
2763 | 3325 | Object3D obj = radio.GetObject(); |
---|
2764 | 3326 | System.out.println("Edit " + obj); |
---|
2765 | 3327 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2779 | 3341 | } |
---|
2780 | 3342 | |
---|
2781 | 3343 | copy = group; |
---|
2782 | | - //CameraPane.theRenderer.object = group; |
---|
| 3344 | + //Globals.theRenderer.object = group; |
---|
2783 | 3345 | if(!useclient) |
---|
2784 | 3346 | { |
---|
2785 | 3347 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2788 | 3350 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2789 | 3351 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2790 | 3352 | cameraView.object = group; |
---|
2791 | | - cameraView.lighttouched = true; |
---|
| 3353 | + //cameraView.lighttouched = true; |
---|
| 3354 | + Globals.lighttouched = true; |
---|
2792 | 3355 | topView.object = group; |
---|
2793 | 3356 | frontView.object = group; |
---|
2794 | 3357 | sideView.object = group; |
---|
2795 | 3358 | } |
---|
2796 | | - group.editWindow = this; |
---|
| 3359 | + |
---|
| 3360 | +// fix "+" issue |
---|
| 3361 | + //group.editWindow = this; |
---|
| 3362 | + group.manipWindow = this; |
---|
| 3363 | + |
---|
2797 | 3364 | /* |
---|
2798 | 3365 | currentLayout = radio.layout; |
---|
2799 | 3366 | if (currentLayout == null) |
---|
.. | .. |
---|
2805 | 3372 | //group.parent = null; // ROOT |
---|
2806 | 3373 | //group.attributes = -1; |
---|
2807 | 3374 | ResetModel(); |
---|
| 3375 | + |
---|
| 3376 | + cameraView.requestFocusInWindow(); |
---|
2808 | 3377 | refreshContents(true); |
---|
2809 | | - } |
---|
| 3378 | + } else if (event.getSource() == editCameraItem) |
---|
| 3379 | + { |
---|
| 3380 | + cameraView.ProtectCamera(); |
---|
| 3381 | + cameraView.repaint(); |
---|
| 3382 | + return; |
---|
| 3383 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3384 | + { |
---|
| 3385 | + cameraView.RevertCamera(); |
---|
| 3386 | + cameraView.repaint(); |
---|
| 3387 | + return; |
---|
| 3388 | + // } else if (event.getSource() == textureButton) |
---|
| 3389 | + // { |
---|
| 3390 | + // return; // true; |
---|
| 3391 | + } |
---|
2810 | 3392 | else |
---|
2811 | 3393 | { |
---|
2812 | 3394 | //return super.action(event, arg); |
---|
.. | .. |
---|
2815 | 3397 | } |
---|
2816 | 3398 | |
---|
2817 | 3399 | boolean useclient = false; |
---|
2818 | | - cRadio radio; |
---|
2819 | 3400 | |
---|
2820 | 3401 | void ToggleRoot() |
---|
2821 | 3402 | { |
---|
.. | .. |
---|
2824 | 3405 | if (useclient) |
---|
2825 | 3406 | { |
---|
2826 | 3407 | cameraView.object = client; |
---|
2827 | | - cameraView.lighttouched = true; |
---|
| 3408 | + Globals.lighttouched = true; |
---|
2828 | 3409 | //topView.object = client; |
---|
2829 | 3410 | //frontView.object = client; |
---|
2830 | 3411 | //sideView.object = client; |
---|
.. | .. |
---|
2832 | 3413 | else |
---|
2833 | 3414 | { |
---|
2834 | 3415 | cameraView.object = group; |
---|
2835 | | - cameraView.lighttouched = true; |
---|
| 3416 | + Globals.lighttouched = true; |
---|
2836 | 3417 | //topView.object = group; |
---|
2837 | 3418 | //frontView.object = group; |
---|
2838 | 3419 | //sideView.object = group; |
---|
.. | .. |
---|
2867 | 3448 | refreshContents(); |
---|
2868 | 3449 | } |
---|
2869 | 3450 | |
---|
| 3451 | + void TransformChildren() |
---|
| 3452 | + { |
---|
| 3453 | + Object3D obj; |
---|
| 3454 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3455 | + { |
---|
| 3456 | + obj = (Object3D)e.nextElement(); |
---|
| 3457 | + obj.KeepTextureMatrices(); |
---|
| 3458 | + obj.TransformChildren(); |
---|
| 3459 | + obj.RestoreTextureMatrices(); |
---|
| 3460 | + |
---|
| 3461 | +// if (obj.parent == null) |
---|
| 3462 | +// { |
---|
| 3463 | +// System.out.println("NULL PARENT!"); |
---|
| 3464 | +// new Exception().printStackTrace(); |
---|
| 3465 | +// } |
---|
| 3466 | +// else |
---|
| 3467 | +// TouchTransform(obj); |
---|
| 3468 | +// //obj.parent.Touch(); |
---|
| 3469 | + } |
---|
| 3470 | + |
---|
| 3471 | + refreshContents(); |
---|
| 3472 | + } |
---|
2870 | 3473 | |
---|
2871 | 3474 | void ResetTransform() |
---|
2872 | 3475 | { |
---|
.. | .. |
---|
2979 | 3582 | refreshContents(); |
---|
2980 | 3583 | } |
---|
2981 | 3584 | |
---|
2982 | | - void ResetCentroid() |
---|
| 3585 | + void ResetCentroid(boolean full) |
---|
2983 | 3586 | { |
---|
2984 | 3587 | Object3D obj; |
---|
2985 | 3588 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2994 | 3597 | LA.matIdentity(Object3D.mat); |
---|
2995 | 3598 | obj.getBounds(minima, maxima, false); |
---|
2996 | 3599 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
2997 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3600 | + if (full) |
---|
| 3601 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
2998 | 3602 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
2999 | 3603 | obj.TransformMesh(Object3D.mat); |
---|
| 3604 | + |
---|
3000 | 3605 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3001 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3606 | + if (full) |
---|
| 3607 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3002 | 3608 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3609 | + |
---|
3003 | 3610 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3004 | 3611 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3005 | 3612 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3028 | 3635 | |
---|
3029 | 3636 | int size = obj.MemorySize(); |
---|
3030 | 3637 | |
---|
3031 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3638 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3639 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3032 | 3640 | } |
---|
3033 | 3641 | } |
---|
3034 | 3642 | catch (Exception e) |
---|
.. | .. |
---|
3065 | 3673 | obj = (Object3D)e.nextElement(); |
---|
3066 | 3674 | |
---|
3067 | 3675 | System.out.println("Object is: " + obj); |
---|
3068 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3676 | + Grafreed.AnalyzeObject(obj); |
---|
3069 | 3677 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3070 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3678 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3071 | 3679 | |
---|
3072 | 3680 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3073 | 3681 | } |
---|
.. | .. |
---|
3109 | 3717 | void GenNormals(boolean crease) |
---|
3110 | 3718 | { |
---|
3111 | 3719 | group.GenNormalsS(crease); |
---|
| 3720 | + |
---|
| 3721 | + refreshContents(); |
---|
| 3722 | + } |
---|
| 3723 | + |
---|
| 3724 | + void GenNormalsMESH() |
---|
| 3725 | + { |
---|
| 3726 | + group.GenNormalsMeshS(); |
---|
| 3727 | + |
---|
| 3728 | + refreshContents(); |
---|
| 3729 | + } |
---|
| 3730 | + |
---|
| 3731 | + void GenNormalsMINE() |
---|
| 3732 | + { |
---|
| 3733 | + group.selection.GenNormalsMINE(); |
---|
3112 | 3734 | |
---|
3113 | 3735 | refreshContents(); |
---|
3114 | 3736 | } |
---|
.. | .. |
---|
3157 | 3779 | |
---|
3158 | 3780 | //Object3D buffer; |
---|
3159 | 3781 | cVector temp = new cVector(); |
---|
3160 | | - BoundaryRep temprep; |
---|
3161 | | - Object3D nodes; |
---|
3162 | | - Vector<Vertex> vertices; |
---|
3163 | | - |
---|
3164 | | - public void Vertex(Object3D node, Vertex v) |
---|
3165 | | - { |
---|
3166 | | - vertices.add(v); |
---|
3167 | | - nodes.addElement(node); |
---|
3168 | | - |
---|
3169 | | - if (temprep.GetCache(v) != null) |
---|
3170 | | - { |
---|
3171 | | - temprep.Remove(v); |
---|
3172 | | - } |
---|
3173 | | - else |
---|
3174 | | - { |
---|
3175 | | - temprep.Remember(v); |
---|
3176 | | - } |
---|
3177 | | - } |
---|
3178 | | - |
---|
3179 | | - public void Face(Object3D node, Face f) |
---|
3180 | | - { |
---|
3181 | | - |
---|
3182 | | - } |
---|
3183 | | - |
---|
| 3782 | +// BoundaryRep temprep; |
---|
| 3783 | +// Object3D nodes; |
---|
| 3784 | +// Vector<Vertex> vertices; |
---|
| 3785 | +// |
---|
| 3786 | +// cGroup buffer; |
---|
| 3787 | +// |
---|
| 3788 | +// public void Vertex(Object3D node, Vertex v) |
---|
| 3789 | +// { |
---|
| 3790 | +//// vertices.add(v); |
---|
| 3791 | +//// nodes.addElement(node); |
---|
| 3792 | +//// |
---|
| 3793 | +//// if (temprep.GetCache(v) != null) |
---|
| 3794 | +//// { |
---|
| 3795 | +//// temprep.Remove(v); |
---|
| 3796 | +//// } else |
---|
| 3797 | +//// { |
---|
| 3798 | +//// temprep.Remember(v); |
---|
| 3799 | +//// } |
---|
| 3800 | +// |
---|
| 3801 | +// //Object3D node = nodes.get(index); |
---|
| 3802 | +// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3803 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3804 | +// |
---|
| 3805 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3806 | +// |
---|
| 3807 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3808 | +// |
---|
| 3809 | +// cGroup g = new cGroup(); |
---|
| 3810 | +// |
---|
| 3811 | +// if (g.toParent == null) |
---|
| 3812 | +// { |
---|
| 3813 | +// g.toParent = LA.newMatrix(); |
---|
| 3814 | +// g.fromParent = LA.newMatrix(); |
---|
| 3815 | +// } |
---|
| 3816 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3817 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3818 | +// |
---|
| 3819 | +// g.add(GrafreeD.clipboard); |
---|
| 3820 | +// |
---|
| 3821 | +// buffer.add(g); |
---|
| 3822 | +// } |
---|
| 3823 | +// |
---|
| 3824 | +// public void Face(Object3D node, Face f) |
---|
| 3825 | +// { |
---|
| 3826 | +// |
---|
| 3827 | +// } |
---|
| 3828 | +// |
---|
| 3829 | +// void ParseVerticesOld() // ?? |
---|
| 3830 | +// { |
---|
| 3831 | +// //if (group.selection.size() != 1) |
---|
| 3832 | +// // return; |
---|
| 3833 | +// |
---|
| 3834 | +// temprep = new BoundaryRep(); |
---|
| 3835 | +// nodes = new Object3D(); |
---|
| 3836 | +// vertices = new Vector<Vertex>(); |
---|
| 3837 | +// |
---|
| 3838 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3839 | +// GrafreeD.epsequal = true; |
---|
| 3840 | +// |
---|
| 3841 | +// for (int i=0; i<group.selection.size(); i++) |
---|
| 3842 | +// { |
---|
| 3843 | +// Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3844 | +// |
---|
| 3845 | +// group.selection.get(i).Parse( |
---|
| 3846 | +//this ); |
---|
| 3847 | +// |
---|
| 3848 | +// int repsize = temprep.VertexCount(); |
---|
| 3849 | +// int tablesize = temprep.vertextable.size(); |
---|
| 3850 | +// int nodesize = nodes.size(); |
---|
| 3851 | +// |
---|
| 3852 | +// assert(vertices.size() == nodes.size()); |
---|
| 3853 | +// |
---|
| 3854 | +// temprep.vertextable.elements(); |
---|
| 3855 | +// |
---|
| 3856 | +// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3857 | +// |
---|
| 3858 | +// for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
| 3859 | +// { |
---|
| 3860 | +// cGroup g = new cGroup(); |
---|
| 3861 | +// |
---|
| 3862 | +// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
| 3863 | +// |
---|
| 3864 | +// Object3D node = nodes.get(index); |
---|
| 3865 | +// temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3866 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3867 | +// |
---|
| 3868 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3869 | +// |
---|
| 3870 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3871 | +// |
---|
| 3872 | +// if (g.toParent == null) |
---|
| 3873 | +// { |
---|
| 3874 | +// g.toParent = LA.newMatrix(); |
---|
| 3875 | +// g.fromParent = LA.newMatrix(); |
---|
| 3876 | +// } |
---|
| 3877 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3878 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3879 | +// |
---|
| 3880 | +// g.add(GrafreeD.clipboard); |
---|
| 3881 | +// |
---|
| 3882 | +// buffer.add(g); |
---|
| 3883 | +// } |
---|
| 3884 | +// |
---|
| 3885 | +// makeSomething(buffer, i==group.selection.size()-1); |
---|
| 3886 | +// } |
---|
| 3887 | +// |
---|
| 3888 | +// GrafreeD.epsequal = epsequal; |
---|
| 3889 | +// |
---|
| 3890 | +// //buffer = null; |
---|
| 3891 | +// temprep = null; |
---|
| 3892 | +// nodes = null; |
---|
| 3893 | +// |
---|
| 3894 | +// refreshContents(); |
---|
| 3895 | +// } |
---|
| 3896 | + |
---|
3184 | 3897 | void ParseVertices() |
---|
3185 | 3898 | { |
---|
3186 | | - //if (group.selection.size() != 1) |
---|
3187 | | - // return; |
---|
3188 | | - |
---|
3189 | | - temprep = new BoundaryRep(); |
---|
3190 | | - nodes = new Object3D(); |
---|
3191 | | - vertices = new Vector<Vertex>(); |
---|
3192 | | - |
---|
3193 | | - boolean epsequal = GraphreeD.epsequal; |
---|
3194 | | - GraphreeD.epsequal = true; |
---|
| 3899 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3900 | + Grafreed.epsequal = true; |
---|
3195 | 3901 | |
---|
3196 | 3902 | for (int i=0; i<group.selection.size(); i++) |
---|
3197 | 3903 | { |
---|
3198 | | - Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3904 | + final cGroup buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
3199 | 3905 | |
---|
3200 | | - group.selection.get(i).Parse(this); |
---|
3201 | | - |
---|
3202 | | - int repsize = temprep.VertexCount(); |
---|
3203 | | - int tablesize = temprep.vertextable.size(); |
---|
3204 | | - int nodesize = nodes.size(); |
---|
| 3906 | + group.selection.get(i).Parse( |
---|
| 3907 | + |
---|
| 3908 | + new iParse() |
---|
| 3909 | + { |
---|
| 3910 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3911 | + { |
---|
| 3912 | + temp.set(v); |
---|
| 3913 | + LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3205 | 3914 | |
---|
3206 | | - assert(vertices.size() == nodes.size()); |
---|
3207 | | - |
---|
3208 | | - temprep.vertextable.elements(); |
---|
3209 | | - |
---|
3210 | | - java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3915 | + cGroup g = new cGroup(); |
---|
3211 | 3916 | |
---|
3212 | | - for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
3213 | | - { |
---|
3214 | | - cGroup g = new cGroup(); |
---|
| 3917 | + if (g.toParent == null) |
---|
| 3918 | + { |
---|
| 3919 | + g.toParent = LA.newMatrix(); |
---|
| 3920 | + g.fromParent = LA.newMatrix(); |
---|
| 3921 | + } |
---|
| 3922 | + LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3923 | + LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3215 | 3924 | |
---|
3216 | | - int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
3217 | | - Object3D node = nodes.get(index); |
---|
3218 | | - temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
3219 | | - // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3925 | + g.add(Grafreed.clipboard); |
---|
3220 | 3926 | |
---|
3221 | | - LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3222 | | - |
---|
3223 | | - // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
3224 | | - |
---|
3225 | | - if (g.toParent == null) |
---|
3226 | | - { |
---|
3227 | | - g.toParent = LA.newMatrix(); |
---|
3228 | | - g.fromParent = LA.newMatrix(); |
---|
3229 | | - } |
---|
3230 | | - LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3231 | | - LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3927 | + buffer.add(g); |
---|
| 3928 | + } |
---|
3232 | 3929 | |
---|
3233 | | - g.add(GraphreeD.clipboard); |
---|
| 3930 | + public void Face(Object3D node, Face f) |
---|
| 3931 | + { |
---|
3234 | 3932 | |
---|
3235 | | - buffer.add(g); |
---|
3236 | | - } |
---|
| 3933 | + } |
---|
| 3934 | + } |
---|
| 3935 | + ); |
---|
3237 | 3936 | |
---|
3238 | 3937 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3239 | 3938 | } |
---|
3240 | 3939 | |
---|
3241 | | - GraphreeD.epsequal = epsequal; |
---|
3242 | | - |
---|
3243 | | - //buffer = null; |
---|
3244 | | - temprep = null; |
---|
3245 | | - nodes = null; |
---|
| 3940 | + Grafreed.epsequal = epsequal; |
---|
3246 | 3941 | |
---|
3247 | 3942 | refreshContents(); |
---|
3248 | 3943 | } |
---|
3249 | | - |
---|
| 3944 | + |
---|
| 3945 | + void TextureVertices() |
---|
| 3946 | + { |
---|
| 3947 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3948 | + { |
---|
| 3949 | + group.selection.get(i).Parse( |
---|
| 3950 | + new iParse() |
---|
| 3951 | + { |
---|
| 3952 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3953 | + { |
---|
| 3954 | + cTexture tex = node.GetTextures(); |
---|
| 3955 | + String pigment = Object3D.GetPigment(tex); |
---|
| 3956 | + //String bump = Object3D.GetBump(tex); |
---|
| 3957 | + |
---|
| 3958 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3959 | + |
---|
| 3960 | + try |
---|
| 3961 | + { |
---|
| 3962 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3963 | + } |
---|
| 3964 | + catch (Exception e) |
---|
| 3965 | + { |
---|
| 3966 | + System.err.println("FAIL: " + node); |
---|
| 3967 | + } |
---|
| 3968 | + |
---|
| 3969 | + double s = v.s; |
---|
| 3970 | + |
---|
| 3971 | + if (s == 1) |
---|
| 3972 | + s = 0; |
---|
| 3973 | + |
---|
| 3974 | + double t = v.t; |
---|
| 3975 | + |
---|
| 3976 | + if (t == 1) |
---|
| 3977 | + t = 0; |
---|
| 3978 | + |
---|
| 3979 | + int indexs = (int) (texturedata.getWidth() * s); |
---|
| 3980 | + int indext = (int) (texturedata.getHeight() * t); |
---|
| 3981 | + |
---|
| 3982 | + int index = indext * texturedata.getWidth() + indexs; |
---|
| 3983 | + |
---|
| 3984 | + java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer(); |
---|
| 3985 | + |
---|
| 3986 | + int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3987 | + |
---|
| 3988 | + float scale = bytebuf.get(index*slide) & 0xFF; |
---|
| 3989 | + scale += bytebuf.get(index*slide+1) & 0xFF; |
---|
| 3990 | + scale += bytebuf.get(index*slide+2) & 0xFF; |
---|
| 3991 | + scale /= 3; |
---|
| 3992 | + |
---|
| 3993 | + scale /= 0xFF; |
---|
| 3994 | + // c'est quoi ca? scale /= 4; |
---|
| 3995 | + |
---|
| 3996 | + //v.AO = scale; |
---|
| 3997 | + |
---|
| 3998 | + v.x += v.norm.x * scale; |
---|
| 3999 | + v.y += v.norm.y * scale; |
---|
| 4000 | + v.z += v.norm.z * scale; |
---|
| 4001 | + } |
---|
| 4002 | + |
---|
| 4003 | + public void Face(Object3D node, Face f) |
---|
| 4004 | + { |
---|
| 4005 | + } |
---|
| 4006 | + } |
---|
| 4007 | + ); |
---|
| 4008 | + } |
---|
| 4009 | + |
---|
| 4010 | + refreshContents(); |
---|
| 4011 | + } |
---|
| 4012 | + |
---|
3250 | 4013 | void Align() |
---|
3251 | 4014 | { |
---|
| 4015 | + if (group.selection.size() == 0) |
---|
| 4016 | + return; |
---|
| 4017 | + |
---|
| 4018 | + cVector bbmin = new cVector(); |
---|
| 4019 | + cVector bbmax = new cVector(); |
---|
| 4020 | + |
---|
| 4021 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 4022 | + |
---|
| 4023 | + double dx = bbmax.x - bbmin.x; |
---|
| 4024 | + double dy = bbmax.y - bbmin.y; |
---|
| 4025 | + double dz = bbmax.z - bbmin.z; |
---|
| 4026 | + |
---|
| 4027 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 4028 | + |
---|
3252 | 4029 | for (int i=0; i<group.selection.size(); i++) |
---|
3253 | 4030 | { |
---|
3254 | 4031 | Object3D obj = group.selection.get(i); |
---|
3255 | 4032 | |
---|
3256 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3257 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 4033 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 4034 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3258 | 4035 | } |
---|
3259 | 4036 | |
---|
3260 | 4037 | refreshContents(); |
---|
.. | .. |
---|
3267 | 4044 | // ref.SaveSupports(); |
---|
3268 | 4045 | // Object3D par = ref.parent; |
---|
3269 | 4046 | // ref.parent = null; |
---|
3270 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 4047 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3271 | 4048 | // ref.parent = par; |
---|
3272 | 4049 | // ref.RestoreSupports(); |
---|
3273 | 4050 | |
---|
.. | .. |
---|
3275 | 4052 | |
---|
3276 | 4053 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3277 | 4054 | |
---|
3278 | | - boolean random = CameraPane.RANDOM; |
---|
3279 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4055 | + boolean random = CameraPane.SWITCH; |
---|
| 4056 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3280 | 4057 | lowres.linkVerticesThis(null); |
---|
3281 | 4058 | lowres.linkVerticesThis(sn); |
---|
3282 | | - CameraPane.RANDOM = random; |
---|
| 4059 | + CameraPane.SWITCH = random; |
---|
3283 | 4060 | |
---|
3284 | 4061 | System.err.flush(); |
---|
3285 | 4062 | |
---|
.. | .. |
---|
3297 | 4074 | // lowres.SaveSupports(); |
---|
3298 | 4075 | // par = lowres.parent; |
---|
3299 | 4076 | // lowres.parent = null; |
---|
3300 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 4077 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3301 | 4078 | Object3D newlow = CloneObject(lowres, false); |
---|
3302 | 4079 | newlow.name = sn.switchobject.get(i).name; |
---|
3303 | 4080 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3319 | 4096 | return; |
---|
3320 | 4097 | |
---|
3321 | 4098 | Object3D poses = group.selection.get(0); |
---|
3322 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 4099 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3323 | 4100 | |
---|
3324 | 4101 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3325 | 4102 | |
---|
.. | .. |
---|
3488 | 4265 | group.selection.RelinkToSupport(); // july 2014 |
---|
3489 | 4266 | System.out.println("DONE."); |
---|
3490 | 4267 | refreshContents(); |
---|
3491 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4268 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3492 | 4269 | } |
---|
3493 | 4270 | |
---|
3494 | 4271 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3513 | 4290 | |
---|
3514 | 4291 | void ClipMesh() |
---|
3515 | 4292 | { |
---|
3516 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 4293 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3517 | 4294 | { |
---|
3518 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 4295 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3519 | 4296 | |
---|
3520 | 4297 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3521 | 4298 | content = ((cGroup)content).get(0); |
---|
3522 | 4299 | |
---|
3523 | 4300 | // for (int i=0; i<group.selection.size(); i++) |
---|
3524 | 4301 | // { |
---|
3525 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 4302 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3526 | 4303 | // } |
---|
3527 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4304 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3528 | 4305 | } |
---|
3529 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4306 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3530 | 4307 | System.out.println("DONE."); |
---|
3531 | 4308 | refreshContents(); |
---|
3532 | 4309 | } |
---|
.. | .. |
---|
3571 | 4348 | void MarkLeaves(boolean hide) |
---|
3572 | 4349 | { |
---|
3573 | 4350 | group.selection.MarkLeaves(hide); |
---|
| 4351 | + refreshContents(); |
---|
| 4352 | + } |
---|
| 4353 | + |
---|
| 4354 | + void RewindLeaves(boolean hide) |
---|
| 4355 | + { |
---|
| 4356 | + group.selection.RewindLeaves(hide); |
---|
| 4357 | + refreshContents(); |
---|
| 4358 | + } |
---|
| 4359 | + |
---|
| 4360 | + void RandomLeaves(boolean hide) |
---|
| 4361 | + { |
---|
| 4362 | + group.selection.RandomLeaves(hide); |
---|
3574 | 4363 | refreshContents(); |
---|
3575 | 4364 | } |
---|
3576 | 4365 | |
---|
.. | .. |
---|
3656 | 4445 | { |
---|
3657 | 4446 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3658 | 4447 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3659 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4448 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3660 | 4449 | |
---|
3661 | 4450 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3662 | | - if(elem != group) |
---|
| 4451 | + if(elem != group || !newWindow) |
---|
3663 | 4452 | { |
---|
3664 | 4453 | // if (!(elem instanceof Composite)) |
---|
3665 | 4454 | // newWindow = false; |
---|
.. | .. |
---|
3749 | 4538 | //case 702: // Event.LIST_DESELECT |
---|
3750 | 4539 | group.deselectAll(); |
---|
3751 | 4540 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
3752 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
3753 | 4541 | if (tps != null) |
---|
3754 | 4542 | { |
---|
3755 | 4543 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
3758 | 4546 | |
---|
3759 | 4547 | //if (child.parent != null) |
---|
3760 | 4548 | //child.parent.addSelectee(child); |
---|
| 4549 | + objEditor.SetMaterial(child); |
---|
3761 | 4550 | group.addSelectee(child); |
---|
3762 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
3763 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
3764 | | - System.err.println("info : " + child.GetPath()); |
---|
3765 | 4551 | } |
---|
3766 | 4552 | } |
---|
3767 | | - else |
---|
3768 | | - { |
---|
3769 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3770 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3771 | | - System.err.println("info : " + group.GetPath()); |
---|
3772 | | - } |
---|
| 4553 | +// else |
---|
| 4554 | +// { |
---|
| 4555 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4556 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4557 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4558 | +// } |
---|
3773 | 4559 | |
---|
3774 | | - objEditor.SetText(); // jan 2014 |
---|
3775 | | - |
---|
3776 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4560 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
3777 | 4561 | CameraPane.flash = true; |
---|
3778 | 4562 | |
---|
3779 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4563 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
3780 | 4564 | // a camera |
---|
3781 | 4565 | { |
---|
3782 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3783 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3784 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3785 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4566 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4567 | + { |
---|
| 4568 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4569 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4570 | + } |
---|
| 4571 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4572 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3786 | 4573 | } |
---|
3787 | 4574 | |
---|
3788 | 4575 | refreshContents(); |
---|
.. | .. |
---|
3793 | 4580 | |
---|
3794 | 4581 | freezemodel = false; |
---|
3795 | 4582 | } |
---|
| 4583 | + |
---|
| 4584 | + void refreshContents(boolean cp) |
---|
| 4585 | + { |
---|
| 4586 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4587 | + { |
---|
| 4588 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4589 | + |
---|
| 4590 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4591 | + { |
---|
| 4592 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4593 | + |
---|
| 4594 | + objEditor.AddInfo(child, this, true); |
---|
| 4595 | + System.err.println("info : " + child.GetPath()); |
---|
| 4596 | + } |
---|
| 4597 | + |
---|
| 4598 | + objEditor.SetText(); // jan 2014 |
---|
| 4599 | + } |
---|
| 4600 | + |
---|
| 4601 | + super.refreshContents(cp); |
---|
| 4602 | + } |
---|
3796 | 4603 | |
---|
3797 | 4604 | void linkSomething(Object3D thing) |
---|
3798 | 4605 | { |
---|
.. | .. |
---|
3864 | 4671 | { |
---|
3865 | 4672 | if (group.selection.isEmpty()) |
---|
3866 | 4673 | return; |
---|
3867 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4674 | + |
---|
| 4675 | + Grafreed.clipboardIsTempGroup = false; |
---|
3868 | 4676 | Composite tGroup = null; |
---|
3869 | 4677 | if (group.selection.size() > 0) // 1) |
---|
3870 | 4678 | { |
---|
3871 | 4679 | tGroup = new cGroup(); |
---|
3872 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4680 | + Grafreed.clipboardIsTempGroup = true; |
---|
3873 | 4681 | } |
---|
3874 | 4682 | |
---|
3875 | 4683 | if (cut) |
---|
3876 | 4684 | { |
---|
| 4685 | + if (Globals.SAVEONMAKE) |
---|
| 4686 | + Save(); |
---|
3877 | 4687 | //int indices[] = jList.getSelectedIndices(); |
---|
3878 | 4688 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
3879 | 4689 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
3909 | 4719 | //System.out.println("cut " + child); |
---|
3910 | 4720 | //System.out.println("parent = " + child.parent); |
---|
3911 | 4721 | // tmp.addChild(child); |
---|
3912 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4722 | + if (Grafreed.clipboardIsTempGroup) |
---|
3913 | 4723 | tGroup.add/*Child*/(tmp); |
---|
3914 | 4724 | else |
---|
3915 | | - GraphreeD.clipboard = tmp; |
---|
| 4725 | + Grafreed.clipboard = tmp; |
---|
3916 | 4726 | } |
---|
3917 | 4727 | else |
---|
3918 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4728 | + if (Grafreed.clipboardIsTempGroup) |
---|
3919 | 4729 | tGroup.add/*Child*/(child); |
---|
3920 | 4730 | else |
---|
3921 | | - GraphreeD.clipboard = child; |
---|
| 4731 | + Grafreed.clipboard = child; |
---|
3922 | 4732 | } |
---|
3923 | 4733 | |
---|
3924 | 4734 | //ResetModel(); |
---|
.. | .. |
---|
3950 | 4760 | //System.out.println("cut " + elem); |
---|
3951 | 4761 | //System.out.println("parent = " + elem.parent); |
---|
3952 | 4762 | // tmp.addChild(elem); |
---|
3953 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4763 | + if (Grafreed.clipboardIsTempGroup) |
---|
3954 | 4764 | tGroup.add/*Child*/(tmp); |
---|
3955 | 4765 | else |
---|
3956 | | - GraphreeD.clipboard = tmp; |
---|
| 4766 | + Grafreed.clipboard = tmp; |
---|
3957 | 4767 | } |
---|
3958 | 4768 | else |
---|
3959 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4769 | + if (Grafreed.clipboardIsTempGroup) |
---|
3960 | 4770 | tGroup.add/*Child*/(child); |
---|
3961 | 4771 | else |
---|
3962 | | - GraphreeD.clipboard = child; |
---|
| 4772 | + Grafreed.clipboard = child; |
---|
3963 | 4773 | } |
---|
3964 | 4774 | |
---|
3965 | 4775 | } |
---|
3966 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
3967 | | - GraphreeD.clipboard = tGroup; |
---|
| 4776 | + |
---|
| 4777 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4778 | + Grafreed.clipboard = tGroup; |
---|
| 4779 | + |
---|
3968 | 4780 | if (cut) |
---|
3969 | 4781 | { |
---|
3970 | 4782 | ResetModel(); |
---|
.. | .. |
---|
3974 | 4786 | |
---|
3975 | 4787 | void paste(boolean expand) |
---|
3976 | 4788 | { |
---|
3977 | | - // if (GraphreeD.clipboard == null) |
---|
| 4789 | + // if (GrafreeD.clipboard == null) |
---|
3978 | 4790 | // return; |
---|
3979 | 4791 | boolean first = true; |
---|
3980 | 4792 | |
---|
3981 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4793 | + if (Grafreed.clipboardIsTempGroup) |
---|
3982 | 4794 | { |
---|
3983 | 4795 | Composite temp; |
---|
3984 | 4796 | |
---|
.. | .. |
---|
3989 | 4801 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
3990 | 4802 | */ |
---|
3991 | 4803 | Object3D elem; |
---|
3992 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4804 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
3993 | 4805 | { |
---|
3994 | 4806 | Object3D child = (Object3D)e.nextElement(); |
---|
3995 | 4807 | |
---|
.. | .. |
---|
4003 | 4815 | else |
---|
4004 | 4816 | elem = child.deepCopy(); // ? |
---|
4005 | 4817 | child.parent = keepparent; |
---|
4006 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4818 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4007 | 4819 | // elem = elem.get(0); |
---|
4008 | 4820 | makeSomething(elem, true); // ?? first); |
---|
4009 | 4821 | //group.addChild(elem); |
---|
.. | .. |
---|
4023 | 4835 | //Object3D cb = Applet3D.clipboard; |
---|
4024 | 4836 | //temp.addChild(cb); |
---|
4025 | 4837 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4026 | | - assert(GraphreeD.clipboard.parent == null); |
---|
4027 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
4028 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4029 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
4030 | | - makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy()); |
---|
| 4838 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4839 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4840 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4841 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4842 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4031 | 4843 | else |
---|
4032 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4033 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4844 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4845 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4034 | 4846 | } |
---|
4035 | 4847 | |
---|
4036 | 4848 | ResetModel(); |
---|
4037 | 4849 | refreshContents(); |
---|
4038 | 4850 | } |
---|
4039 | 4851 | |
---|
4040 | | - void pasteInto(boolean copyit) |
---|
| 4852 | + void pasteInto(boolean copyit, boolean clone) |
---|
4041 | 4853 | { |
---|
4042 | | -// if (GraphreeD.clipboard == null) |
---|
| 4854 | +// if (GrafreeD.clipboard == null) |
---|
4043 | 4855 | // return; |
---|
4044 | 4856 | |
---|
4045 | 4857 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4066 | 4878 | if (copyit) |
---|
4067 | 4879 | { |
---|
4068 | 4880 | // paste(false); |
---|
4069 | | - CloneClipboard(false); // sept 2014 |
---|
| 4881 | + if (clone) |
---|
| 4882 | + { |
---|
| 4883 | + CloneClipboard(false); // sept 2014 |
---|
| 4884 | + } |
---|
| 4885 | + else |
---|
| 4886 | + { |
---|
| 4887 | + paste(false); |
---|
| 4888 | + } |
---|
4070 | 4889 | } |
---|
4071 | 4890 | else |
---|
4072 | 4891 | { |
---|
4073 | 4892 | boolean first = true; |
---|
4074 | 4893 | |
---|
4075 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4894 | + if (Grafreed.clipboardIsTempGroup) |
---|
4076 | 4895 | { |
---|
4077 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4896 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4078 | 4897 | Object3D copy; |
---|
4079 | 4898 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4080 | 4899 | { |
---|
.. | .. |
---|
4084 | 4903 | } |
---|
4085 | 4904 | } else |
---|
4086 | 4905 | { |
---|
4087 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4906 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4088 | 4907 | } |
---|
4089 | 4908 | } |
---|
4090 | 4909 | } |
---|
.. | .. |
---|
4276 | 5095 | makeSomething(csg); |
---|
4277 | 5096 | } |
---|
4278 | 5097 | |
---|
| 5098 | + void Ungroup(Object3D g) |
---|
| 5099 | + { |
---|
| 5100 | + if (g instanceof HiddenObject) |
---|
| 5101 | + { |
---|
| 5102 | + HiddenObject h = (HiddenObject) g; |
---|
| 5103 | + |
---|
| 5104 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 5105 | + { |
---|
| 5106 | + objEditor.makeSomething(h.get(i), false); |
---|
| 5107 | + } |
---|
| 5108 | + } |
---|
| 5109 | + else |
---|
| 5110 | + { |
---|
| 5111 | + for (int i=0; i<g.Size(); i++) |
---|
| 5112 | + { |
---|
| 5113 | + objEditor.makeSomething(g.get(i), false); |
---|
| 5114 | + } |
---|
| 5115 | + } |
---|
| 5116 | + } |
---|
| 5117 | + |
---|
4279 | 5118 | void ungroup() |
---|
4280 | 5119 | { |
---|
4281 | 5120 | /* |
---|
.. | .. |
---|
4469 | 5308 | } |
---|
4470 | 5309 | */ |
---|
4471 | 5310 | |
---|
4472 | | - void ImportGFD() |
---|
4473 | | - { |
---|
4474 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
4475 | | - browser.show(); |
---|
4476 | | - String filename = browser.getFile(); |
---|
4477 | | - if (filename != null && filename.length() > 0) |
---|
4478 | | - { |
---|
4479 | | - String fullname = browser.getDirectory() + filename; |
---|
4480 | | - |
---|
4481 | | - //Object3D readobj = |
---|
4482 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4483 | | - //makeSomething(readobj); |
---|
4484 | | - } |
---|
4485 | | - } |
---|
4486 | | - |
---|
4487 | 5311 | /* |
---|
4488 | 5312 | public void Callback(Object obj) |
---|
4489 | 5313 | { |
---|
.. | .. |
---|
4507 | 5331 | } |
---|
4508 | 5332 | */ |
---|
4509 | 5333 | |
---|
4510 | | - void ImportVRMLX3D() |
---|
4511 | | - { |
---|
4512 | | - if (GraphreeD.standAlone) |
---|
4513 | | - { |
---|
4514 | | - /**/ |
---|
4515 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4516 | | - browser.show(); |
---|
4517 | | - String filename = browser.getFile(); |
---|
4518 | | - if (filename != null && filename.length() > 0) |
---|
4519 | | - { |
---|
4520 | | - String fullname = browser.getDirectory() + filename; |
---|
4521 | | - LoadVRMLX3D(fullname); |
---|
4522 | | - } |
---|
4523 | | - /**/ |
---|
4524 | | - } |
---|
4525 | | - } |
---|
4526 | | - |
---|
4527 | 5334 | String GetFile(String dialogName) |
---|
4528 | 5335 | { |
---|
4529 | | - if (GraphreeD.standAlone) |
---|
| 5336 | + if (Grafreed.standAlone) |
---|
4530 | 5337 | { |
---|
4531 | 5338 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4532 | 5339 | browser.show(); |
---|
.. | .. |
---|
4590 | 5397 | cButton flashSelectionButton; |
---|
4591 | 5398 | cButton editButton; |
---|
4592 | 5399 | cButton uneditButton; |
---|
| 5400 | + JCheckBox allParamsButton; |
---|
4593 | 5401 | cButton clearpanelButton; |
---|
4594 | | - cButton allParamsButton; |
---|
4595 | 5402 | cButton unselectButton; |
---|
4596 | 5403 | |
---|
| 5404 | + cButton minButton; |
---|
| 5405 | + cButton maxButton; |
---|
| 5406 | + cButton fullButton; |
---|
| 5407 | + cButton undoButton; |
---|
| 5408 | + cButton redoButton; |
---|
| 5409 | + cButton saveButton; |
---|
| 5410 | + cButton oneStepButton; |
---|
| 5411 | + |
---|
| 5412 | + cButton groupButton; |
---|
| 5413 | + cButton ungroupButton; |
---|
| 5414 | + cButton compositeButton; |
---|
| 5415 | + |
---|
| 5416 | + cButton gridButton; |
---|
| 5417 | + cButton boxButton; |
---|
| 5418 | + cButton sphereButton; |
---|
| 5419 | + cButton coneButton; |
---|
| 5420 | + cButton torusButton; |
---|
| 5421 | + cButton superButton; |
---|
| 5422 | + cButton kleinButton; |
---|
| 5423 | + cButton particlesButton; |
---|
| 5424 | + cButton overlayButton; |
---|
| 5425 | + cButton lightButton; |
---|
| 5426 | + |
---|
4597 | 5427 | cButton screenfitButton; |
---|
4598 | 5428 | cButton screenfitpointButton; |
---|
4599 | 5429 | cButton snapobjectButton; |
---|
.. | .. |
---|
4604 | 5434 | cButton closeButton; |
---|
4605 | 5435 | |
---|
4606 | 5436 | cButton setsupportButton; |
---|
4607 | | - |
---|
4608 | | - cButton twoButton; |
---|
4609 | | - cButton sixButton; |
---|
4610 | | - cButton threeButton; |
---|
4611 | | - cButton sevenButton; |
---|
4612 | | - cButton fourButton; // full panel |
---|
4613 | | - cButton oneButton; // full XYZ |
---|
4614 | | - //cButton currentLayout; |
---|
4615 | 5437 | |
---|
4616 | 5438 | // |
---|
4617 | 5439 | //Composite |
---|
.. | .. |
---|
4624 | 5446 | private MenuItem lookFromItem; |
---|
4625 | 5447 | private MenuItem switchItem; |
---|
4626 | 5448 | private MenuItem cutItem; |
---|
4627 | | - private MenuItem duplicateItem; |
---|
| 5449 | + private MenuItem undoItem; |
---|
| 5450 | + private MenuItem redoItem; |
---|
| 5451 | + private JMenuItem duplicateItem; |
---|
4628 | 5452 | private MenuItem cloneItem; |
---|
4629 | 5453 | private MenuItem cloneSupportItem; |
---|
4630 | 5454 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4635 | 5459 | private MenuItem resetsupportItem; |
---|
4636 | 5460 | private MenuItem resetreferencesItem; |
---|
4637 | 5461 | private MenuItem linkverticesItem; |
---|
| 5462 | + private MenuItem relinkverticesItem; |
---|
4638 | 5463 | private MenuItem setMasterItem; |
---|
4639 | | - private MenuItem resetMeshItem; |
---|
| 5464 | + private MenuItem resetAllItem; |
---|
4640 | 5465 | private MenuItem stepAllItem; |
---|
4641 | 5466 | private MenuItem revertMeshItem; |
---|
4642 | 5467 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4647 | 5472 | private MenuItem mergeGeometriesItem; |
---|
4648 | 5473 | private MenuItem copyItem; |
---|
4649 | 5474 | private MenuItem pasteItem; |
---|
| 5475 | + private MenuItem pasteIntoItem; |
---|
4650 | 5476 | private MenuItem pasteLinkItem; |
---|
4651 | 5477 | private MenuItem pasteCloneItem; |
---|
4652 | 5478 | private MenuItem pasteExpandItem; |
---|
4653 | 5479 | private MenuItem clearItem; |
---|
4654 | 5480 | private MenuItem clearAllItem; |
---|
4655 | 5481 | private MenuItem genUVItem; |
---|
| 5482 | + private MenuItem genNormalsMESHItem; |
---|
4656 | 5483 | private MenuItem genNormalsCADItem; |
---|
4657 | 5484 | private MenuItem genNormalsORGANItem; |
---|
| 5485 | + private MenuItem genNormalsMINEItem; |
---|
4658 | 5486 | private MenuItem stripifyItem; |
---|
4659 | 5487 | private MenuItem unstripifyItem; |
---|
4660 | 5488 | private MenuItem trimItem; |
---|
.. | .. |
---|
4683 | 5511 | private MenuItem showleavesItem; |
---|
4684 | 5512 | private MenuItem markleavesItem; |
---|
4685 | 5513 | private MenuItem unmarkleavesItem; |
---|
| 5514 | + private MenuItem rewindleavesItem; |
---|
| 5515 | + private MenuItem unrewindleavesItem; |
---|
| 5516 | + private MenuItem randomleavesItem; |
---|
| 5517 | + private MenuItem unrandomleavesItem; |
---|
4686 | 5518 | |
---|
4687 | 5519 | private MenuItem flipVItem; |
---|
4688 | 5520 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
4694 | 5526 | private MenuItem panoTexturesItem; |
---|
4695 | 5527 | |
---|
4696 | 5528 | private MenuItem resetCentroidItem; |
---|
4697 | | - private MenuItem transformgeometryItem; |
---|
| 5529 | + private MenuItem resetCentroidXZItem; |
---|
4698 | 5530 | private MenuItem resetTransformItem; |
---|
| 5531 | + private MenuItem transformGeometryItem; |
---|
| 5532 | + private MenuItem transformChildrenItem; |
---|
| 5533 | + private MenuItem hideItem; |
---|
4699 | 5534 | private MenuItem grabItem; |
---|
4700 | 5535 | private MenuItem backItem; |
---|
4701 | 5536 | private MenuItem frontItem; |
---|
.. | .. |
---|
4716 | 5551 | |
---|
4717 | 5552 | private MenuItem resetParentItem; |
---|
4718 | 5553 | private MenuItem repairParentItem; |
---|
| 5554 | + private MenuItem repairShadowItem; |
---|
4719 | 5555 | private MenuItem sortbysizeItem; |
---|
4720 | 5556 | private MenuItem sortbynameItem; |
---|
4721 | 5557 | |
---|
.. | .. |
---|
4728 | 5564 | private MenuItem particleItem; |
---|
4729 | 5565 | private MenuItem ragdollItem; |
---|
4730 | 5566 | private MenuItem ragdoll2Item; |
---|
| 5567 | + private MenuItem heightFieldItem; |
---|
| 5568 | + private MenuItem textureFieldItem; |
---|
4731 | 5569 | private MenuItem gridItem; |
---|
4732 | 5570 | private MenuItem rectoidItem; |
---|
4733 | 5571 | private MenuItem ellipsoidItem; |
---|
4734 | 5572 | private MenuItem coneItem; |
---|
4735 | 5573 | private MenuItem torusItem; |
---|
4736 | 5574 | private MenuItem superItem; |
---|
| 5575 | + private MenuItem kleinItem; |
---|
4737 | 5576 | private MenuItem blobItem; |
---|
4738 | 5577 | private MenuItem latheItem; |
---|
4739 | 5578 | private MenuItem bezierItem; |
---|
4740 | | - private MenuItem checkerItem; |
---|
| 5579 | + private MenuItem overlayItem; |
---|
4741 | 5580 | private MenuItem meshItem; |
---|
4742 | 5581 | // private MenuItem meshGroupItem; |
---|
4743 | 5582 | private MenuItem springItem; |
---|
.. | .. |
---|
4746 | 5585 | private MenuItem csgItem; |
---|
4747 | 5586 | private MenuItem templateItem; |
---|
4748 | 5587 | private MenuItem textureItem; |
---|
| 5588 | + private MenuItem billboardItem; |
---|
4749 | 5589 | private MenuItem shadowXItem; |
---|
4750 | 5590 | private MenuItem shadowYItem; |
---|
4751 | 5591 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4758 | 5598 | private MenuItem doubleItem; |
---|
4759 | 5599 | private MenuItem tripleItem; |
---|
4760 | 5600 | |
---|
4761 | | - private MenuItem importGFDItem; |
---|
4762 | | - private MenuItem importVRMLX3DItem; |
---|
4763 | | - private MenuItem import3DSItem; |
---|
4764 | | - private MenuItem importOBJItem; |
---|
4765 | | - |
---|
4766 | 5601 | private MenuItem computeAOItem; |
---|
4767 | 5602 | private MenuItem recompileItem; |
---|
4768 | 5603 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4772 | 5607 | private MenuItem analyzeItem; |
---|
4773 | 5608 | private MenuItem dumpItem; |
---|
4774 | 5609 | //boolean freezemodel = false; |
---|
| 5610 | + |
---|
| 5611 | + Menu cameraMenu; |
---|
| 5612 | + MenuItem editCameraItem; |
---|
| 5613 | + MenuItem revertCameraItem; |
---|
4775 | 5614 | } |
---|