.. | .. |
---|
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 | + Menu menu; |
---|
| 154 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 155 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 156 | + //editItem.addActionListener(this); |
---|
| 157 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
| 163 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + duplicateItem.addActionListener(this); |
---|
| 165 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 166 | + cloneItem.addActionListener(this); |
---|
| 167 | + if (Globals.ADVANCED) |
---|
| 168 | + { |
---|
| 169 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 170 | + cloneSupportItem.addActionListener(this); |
---|
| 171 | + } |
---|
| 172 | + menu.add("-"); |
---|
| 173 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 174 | + cutItem.addActionListener(this); |
---|
| 175 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 176 | + copyItem.addActionListener(this); |
---|
| 177 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 178 | + pasteItem.addActionListener(this); |
---|
| 179 | + menu.add("-"); |
---|
| 180 | + |
---|
| 181 | + menu.add("-"); |
---|
| 182 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 183 | + pasteIntoItem.addActionListener(this); |
---|
| 184 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 185 | + pasteLinkItem.addActionListener(this); |
---|
| 186 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 187 | + pasteCloneItem.addActionListener(this); |
---|
| 188 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 189 | +// pasteExpandItem.addActionListener(this); |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 192 | + clearItem.addActionListener(this); |
---|
| 193 | + |
---|
| 194 | + if (Globals.ADVANCED) |
---|
| 195 | + { |
---|
| 196 | + // Deletes the cameras... |
---|
| 197 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 198 | + clearAllItem.addActionListener(this); |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 202 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 203 | + //zBufferItem.addActionListener(this); |
---|
| 204 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 205 | + //normalLensItem.addActionListener(this); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 207 | + revertCameraItem.addActionListener(this); |
---|
| 208 | + |
---|
| 209 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 210 | + toggleFullScreenItem.addItemListener(this); |
---|
| 211 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 212 | + cameraMenu.add("-"); |
---|
| 213 | + |
---|
| 214 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 215 | + toggleTextureItem.addItemListener(this); |
---|
| 216 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 217 | + |
---|
| 218 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 219 | + toggleSwitchItem.addItemListener(this); |
---|
| 220 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 221 | + |
---|
| 222 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 223 | + toggleHandleItem.addItemListener(this); |
---|
| 224 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 225 | + |
---|
| 226 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 227 | + togglePaintItem.addItemListener(this); |
---|
| 228 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 229 | + |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
| 232 | + cameraMenu.add("-"); |
---|
| 233 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 234 | + toggleLiveItem.addItemListener(this); |
---|
| 235 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 236 | + |
---|
| 237 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 238 | + stepItem.addActionListener(this); |
---|
| 239 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 240 | + // toggleDLItem.addItemListener(this); |
---|
| 241 | + // toggleDLItem.setState(false); |
---|
| 242 | + |
---|
| 243 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 244 | + toggleRenderItem.addItemListener(this); |
---|
| 245 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 246 | + |
---|
| 247 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 248 | + toggleDebugItem.addItemListener(this); |
---|
| 249 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 250 | + |
---|
| 251 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 252 | + toggleFrustumItem.addItemListener(this); |
---|
| 253 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 254 | + |
---|
| 255 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 256 | + toggleFootContactItem.addItemListener(this); |
---|
| 257 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 258 | + |
---|
| 259 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 260 | + toggleTimelineItem.addItemListener(this); |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 264 | +// toggleRootItem.addItemListener(this); |
---|
| 265 | +// toggleRootItem.setState(false); |
---|
| 266 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 267 | +// animationItem.addItemListener(this); |
---|
| 268 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 269 | + cameraMenu.add("-"); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 271 | + editCameraItem.addActionListener(this); |
---|
| 272 | + |
---|
| 273 | + if (Globals.ADVANCED) |
---|
| 274 | + { |
---|
152 | 275 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 276 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 277 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 283 | lookAtItem.addActionListener(this); |
---|
161 | 284 | //lookFromItem.addActinoListener(this); |
---|
162 | 285 | //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); |
---|
| 286 | + } |
---|
| 287 | + |
---|
| 288 | + oe.menuBar.add(menu = new Menu("Setting")); |
---|
| 289 | + if (Globals.ADVANCED) |
---|
| 290 | + { |
---|
196 | 291 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
197 | 292 | revertMeshItem.addActionListener(this); |
---|
198 | 293 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
199 | 294 | resetreferencesItem.addActionListener(this); |
---|
200 | 295 | menu.add("-"); |
---|
| 296 | + } |
---|
201 | 297 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
202 | 298 | overwriteGeoItem.addActionListener(this); |
---|
203 | 299 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
209 | 305 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
210 | 306 | overwriteUVItem.addActionListener(this); |
---|
211 | 307 | menu.add("-"); |
---|
| 308 | + if (Globals.ADVANCED) |
---|
| 309 | + { |
---|
212 | 310 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
213 | 311 | generateMeshItem.addActionListener(this); |
---|
214 | 312 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
215 | 313 | poseMeshItem.addActionListener(this); |
---|
216 | 314 | menu.add("-"); |
---|
| 315 | + } |
---|
217 | 316 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
218 | 317 | resetsupportItem.addActionListener(this); |
---|
219 | 318 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
220 | 319 | linkverticesItem.addActionListener(this); |
---|
| 320 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 321 | + relinkverticesItem.addActionListener(this); |
---|
| 322 | + |
---|
| 323 | + if (Globals.ADVANCED) |
---|
| 324 | + { |
---|
221 | 325 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
222 | 326 | setMasterItem.addActionListener(this); |
---|
| 327 | + } |
---|
223 | 328 | |
---|
224 | | - oe.menuBar.add(menu = new Menu("Object")); |
---|
| 329 | + oe.menuBar.add(menu = new Menu("Group")); |
---|
225 | 330 | grabItem = menu.add(new MenuItem("Grab")); |
---|
226 | 331 | grabItem.addActionListener(this); |
---|
227 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
228 | | - frontItem.addActionListener(this); |
---|
229 | 332 | backItem = menu.add(new MenuItem("Back")); |
---|
230 | 333 | backItem.addActionListener(this); |
---|
| 334 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 335 | + frontItem.addActionListener(this); |
---|
231 | 336 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
232 | 337 | compositeItem.addActionListener(this); |
---|
| 338 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 339 | + hideItem.addActionListener(this); |
---|
| 340 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 341 | + ungroupItem.addActionListener(this); |
---|
233 | 342 | menu.add("-"); |
---|
234 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 343 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
235 | 344 | 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); |
---|
240 | 345 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
241 | 346 | switchGeoItem.addActionListener(this); |
---|
242 | 347 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
243 | 348 | switchTransfoItem.addActionListener(this); |
---|
244 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 349 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
245 | 350 | morphItem.addActionListener(this); |
---|
| 351 | + |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
| 354 | + menu.add("-"); |
---|
| 355 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 356 | + physicsItem.addActionListener(this); |
---|
| 357 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 358 | + frameselectorItem.addActionListener(this); |
---|
246 | 359 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
247 | 360 | scriptNodeItem.addActionListener(this); |
---|
248 | 361 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
249 | 362 | cameraItem.addActionListener(this); |
---|
250 | | - menu.add("-"); |
---|
| 363 | + } |
---|
| 364 | + |
---|
| 365 | + oe.menuBar.add(menu = new Menu("Object")); |
---|
251 | 366 | textureItem = menu.add(new MenuItem("Texture")); |
---|
252 | 367 | textureItem.addActionListener(this); |
---|
| 368 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 369 | + billboardItem.addActionListener(this); |
---|
253 | 370 | csgItem = menu.add(new MenuItem("CSG")); |
---|
254 | 371 | csgItem.addActionListener(this); |
---|
255 | 372 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
258 | 375 | shadowYItem.addActionListener(this); |
---|
259 | 376 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
260 | 377 | shadowZItem.addActionListener(this); |
---|
| 378 | + if (Globals.ADVANCED) |
---|
| 379 | + { |
---|
| 380 | + menu.add("-"); |
---|
261 | 381 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
262 | 382 | linkerItem.addActionListener(this); |
---|
263 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
264 | | - templateItem.addActionListener(this); |
---|
265 | 383 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
266 | 384 | attributeItem.addActionListener(this); |
---|
| 385 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 386 | + templateItem.addActionListener(this); |
---|
267 | 387 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
268 | 388 | pointflowItem.addActionListener(this); |
---|
| 389 | + } |
---|
269 | 390 | menu.add("-"); |
---|
270 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
271 | | - transformgeometryItem.addActionListener(this); |
---|
272 | 391 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
273 | 392 | resetTransformItem.addActionListener(this); |
---|
274 | 393 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
275 | 394 | resetCentroidItem.addActionListener(this); |
---|
276 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
277 | | - ungroupItem.addActionListener(this); |
---|
| 395 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 396 | + resetCentroidXZItem.addActionListener(this); |
---|
| 397 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 398 | + transformGeometryItem.addActionListener(this); |
---|
| 399 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 400 | + transformChildrenItem.addActionListener(this); |
---|
278 | 401 | |
---|
279 | 402 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
280 | 403 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
283 | 406 | genNormalsORGANItem.addActionListener(this); |
---|
284 | 407 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
285 | 408 | genNormalsCADItem.addActionListener(this); |
---|
| 409 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 410 | + genNormalsMESHItem.addActionListener(this); |
---|
| 411 | + if (Globals.ADVANCED) |
---|
| 412 | + { |
---|
| 413 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 414 | + genNormalsMINEItem.addActionListener(this); |
---|
| 415 | + } |
---|
286 | 416 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
287 | 417 | stripifyItem.addActionListener(this); |
---|
288 | 418 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
292 | 422 | untrimItem = menu.add(new MenuItem("Untrim")); |
---|
293 | 423 | untrimItem.addActionListener(this); |
---|
294 | 424 | menu.add("-"); |
---|
295 | | - clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
296 | | - clearMaterialsItem.addActionListener(this); |
---|
297 | 425 | clearColorsItem = menu.add(new MenuItem("Clear AO")); |
---|
298 | 426 | clearColorsItem.addActionListener(this); |
---|
299 | 427 | reverseNormalsItem = menu.add(new MenuItem("Reverse Normals")); |
---|
.. | .. |
---|
306 | 434 | reduce34MeshItem.addActionListener(this); |
---|
307 | 435 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 436 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 437 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 438 | clipMeshItem.addActionListener(this); |
---|
| 439 | + |
---|
| 440 | + if (Globals.ADVANCED) |
---|
| 441 | + { |
---|
| 442 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 443 | + smoothMeshItem.addActionListener(this); |
---|
| 444 | + } |
---|
| 445 | + |
---|
| 446 | + oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 447 | + clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
| 448 | + clearMaterialsItem.addActionListener(this); |
---|
| 449 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 450 | + resetAllItem.addActionListener(this); |
---|
| 451 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 452 | + stepAllItem.addActionListener(this); |
---|
313 | 453 | menu.add("-"); |
---|
314 | 454 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
315 | 455 | liveleavesItem.addActionListener(this); |
---|
316 | 456 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
317 | 457 | unliveleavesItem.addActionListener(this); |
---|
| 458 | + if (Globals.ADVANCED) |
---|
| 459 | + { |
---|
318 | 460 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
319 | 461 | supportleavesItem.addActionListener(this); |
---|
320 | 462 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
321 | 463 | unsupportleavesItem.addActionListener(this); |
---|
| 464 | + } |
---|
322 | 465 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
323 | 466 | hideleavesItem.addActionListener(this); |
---|
324 | 467 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
332 | 475 | flipVItem.addActionListener(this); |
---|
333 | 476 | unflipVItem = menu.add(new MenuItem("Unflip V")); |
---|
334 | 477 | unflipVItem.addActionListener(this); |
---|
335 | | - lowTexturesItem = menu.add(new MenuItem("Low Texture")); |
---|
| 478 | + lowTexturesItem = menu.add(new MenuItem("Low Texture (256)")); |
---|
336 | 479 | lowTexturesItem.addActionListener(this); |
---|
337 | | - normalTexturesItem = menu.add(new MenuItem("Normal Texture")); |
---|
| 480 | + normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)")); |
---|
338 | 481 | normalTexturesItem.addActionListener(this); |
---|
339 | | - highTexturesItem = menu.add(new MenuItem("High Texture")); |
---|
| 482 | + highTexturesItem = menu.add(new MenuItem("High Texture (1024)")); |
---|
340 | 483 | highTexturesItem.addActionListener(this); |
---|
341 | | - veryhighTexturesItem = menu.add(new MenuItem("Very high Texture")); |
---|
| 484 | + veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)")); |
---|
342 | 485 | veryhighTexturesItem.addActionListener(this); |
---|
343 | | - maxTexturesItem = menu.add(new MenuItem("Max Texture")); |
---|
| 486 | + maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)")); |
---|
344 | 487 | maxTexturesItem.addActionListener(this); |
---|
345 | | - panoTexturesItem = menu.add(new MenuItem("Panoramic Texture")); |
---|
| 488 | + panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)")); |
---|
346 | 489 | 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 | 490 | |
---|
357 | 491 | oe.menuBar.add(menu = new Menu("Selection")); |
---|
358 | 492 | attachPigmentItem = menu.add(new MenuItem("Attach Pigment...")); |
---|
.. | .. |
---|
370 | 504 | sortbysizeItem.addActionListener(this); |
---|
371 | 505 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
372 | 506 | sortbynameItem.addActionListener(this); |
---|
| 507 | + menu.add("-"); |
---|
| 508 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 509 | + shareGeometriesItem.addActionListener(this); |
---|
| 510 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 511 | + mergeGeometriesItem.addActionListener(this); |
---|
| 512 | + if (Globals.ADVANCED) |
---|
| 513 | + { |
---|
| 514 | + // Pretty much the same as duplicate and clone. |
---|
| 515 | + extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
| 516 | + extractGeometriesItem.addActionListener(this); |
---|
| 517 | + cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
| 518 | + cloneGeometriesItem.addActionListener(this); |
---|
| 519 | + } |
---|
| 520 | + |
---|
373 | 521 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
374 | 522 | buildCreateMenu(menu); |
---|
375 | | - oe.menuBar.add(menu = new Menu("Tools")); |
---|
| 523 | + |
---|
| 524 | + oe.menuBar.add(menu = new Menu("Tools")); |
---|
376 | 525 | buildToolsMenu(menu); |
---|
377 | 526 | } |
---|
378 | 527 | |
---|
.. | .. |
---|
406 | 555 | oe.radioPanel.add(dummyButton); |
---|
407 | 556 | oe.buttonGroup.add(dummyButton); |
---|
408 | 557 | */ |
---|
409 | | - aConstraints.gridy += 1; |
---|
410 | | - oe.aConstraints.gridwidth = 1; |
---|
411 | | - oe.aConstraints.gridx = 0; |
---|
| 558 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
412 | 559 | |
---|
413 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 560 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + undoButton.setToolTipText("Undo changes"); |
---|
| 562 | + undoButton.addActionListener(this); |
---|
| 563 | + |
---|
| 564 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + redoButton.setToolTipText("Redo changes"); |
---|
| 566 | + redoButton.addActionListener(this); |
---|
| 567 | + |
---|
| 568 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + saveButton.setToolTipText("Save changes"); |
---|
| 570 | + saveButton.addActionListener(this); |
---|
| 571 | + |
---|
| 572 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 573 | + liveCB.setToolTipText("Enable animation"); |
---|
414 | 574 | liveCB.addItemListener(this); |
---|
415 | 575 | |
---|
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); |
---|
| 576 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 578 | + oneStepButton.addActionListener(this); |
---|
| 579 | + |
---|
| 580 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 581 | + fastCB.setToolTipText("Fast mode"); |
---|
434 | 582 | 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); |
---|
| 583 | + |
---|
| 584 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 585 | + trackCB.setToolTipText("Enable tracking"); |
---|
476 | 586 | trackCB.addItemListener(this); |
---|
477 | 587 | |
---|
478 | | - oe.aConstraints.gridx += 1; |
---|
479 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 589 | + screenfitButton.setToolTipText("Screen fit"); |
---|
480 | 590 | screenfitButton.addActionListener(this); |
---|
481 | | - oe.aConstraints.gridx += 1; |
---|
| 591 | + |
---|
482 | 592 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
483 | 593 | // 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 | 594 | |
---|
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); |
---|
| 595 | + if (Globals.ADVANCED) |
---|
| 596 | + { |
---|
| 597 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + snapobjectButton.addActionListener(this); |
---|
| 599 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 600 | + } |
---|
| 601 | + |
---|
| 602 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
495 | 604 | flashSelectionButton.addActionListener(this); |
---|
496 | | - oe.aConstraints.gridx += 1; |
---|
497 | | - oe.aConstraints.weighty = 0; |
---|
498 | | - oe.aConstraints.gridwidth = 1; |
---|
499 | 605 | |
---|
500 | | - // |
---|
501 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 606 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 607 | + |
---|
| 608 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + twoButton.setToolTipText("Show center view only"); |
---|
502 | 610 | twoButton.addActionListener(this); |
---|
503 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 612 | fourButton.addActionListener(this); |
---|
505 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 613 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 614 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + sixButton.setToolTipText("2-column layout left"); |
---|
506 | 616 | sixButton.addActionListener(this); |
---|
507 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 617 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 618 | + threeButton.setToolTipText("2-column layout right"); |
---|
508 | 619 | threeButton.addActionListener(this); |
---|
509 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 620 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 621 | + sevenButton.setToolTipText("3-column layout"); |
---|
510 | 622 | sevenButton.addActionListener(this); |
---|
511 | 623 | // |
---|
512 | 624 | |
---|
513 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 625 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
514 | 627 | rootButton.addActionListener(this); |
---|
515 | | - oe.aConstraints.gridx += 1; |
---|
516 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 628 | + |
---|
| 629 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + closeButton.setToolTipText("Close tab"); |
---|
517 | 631 | closeButton.addActionListener(this); |
---|
518 | 632 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
519 | 633 | //clearButton.addActionListener(this); |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | 634 | |
---|
522 | | - oe.aConstraints.gridx = 1; // |
---|
523 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 635 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 636 | + |
---|
| 637 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 638 | + editButton.setToolTipText("Edit selection"); |
---|
524 | 639 | editButton.addActionListener(this); |
---|
525 | | - oe.aConstraints.gridx += 1; |
---|
526 | | - oe.aConstraints.weighty = 0; |
---|
527 | | - oe.aConstraints.gridwidth = 1; |
---|
528 | 640 | |
---|
529 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 641 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + uneditButton.setToolTipText("Unedit selection"); |
---|
530 | 643 | uneditButton.addActionListener(this); |
---|
531 | 644 | |
---|
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); |
---|
| 645 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 646 | + allParamsButton.setToolTipText("Edit all params"); |
---|
544 | 647 | allParamsButton.addActionListener(this); |
---|
545 | 648 | |
---|
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); |
---|
| 649 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 651 | + clearPanelButton.addActionListener(this); |
---|
| 652 | + |
---|
| 653 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + unselectButton.setToolTipText("Unselect"); |
---|
551 | 655 | unselectButton.addActionListener(this); |
---|
552 | 656 | |
---|
| 657 | + commandsPanel.preferredHeight = 1; |
---|
| 658 | + |
---|
| 659 | + oe.treePanel.add(commandsPanel); |
---|
| 660 | + oe.treePanel.Return(); |
---|
| 661 | + |
---|
553 | 662 | // oe.aConstraints.gridx += 1; |
---|
554 | 663 | // oe.aConstraints.weighty = 0; |
---|
555 | 664 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
561 | 670 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
562 | 671 | // gcButton.addActionListener(this); |
---|
563 | 672 | |
---|
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; |
---|
| 673 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 674 | + |
---|
| 675 | + JScrollPane jSP; |
---|
575 | 676 | //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); |
---|
| 677 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
577 | 678 | ResetModel(); |
---|
578 | | - oe.aConstraints.weighty = 0.5; |
---|
579 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
580 | | - oe.aConstraints.gridy += 1; |
---|
581 | | - oe.aConstraints.gridwidth = 1; |
---|
| 679 | + |
---|
| 680 | + oe.treePanel.add(jSPPanel); |
---|
| 681 | + oe.treePanel.Return(); |
---|
582 | 682 | |
---|
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); |
---|
| 683 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 684 | + |
---|
| 685 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 686 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
587 | 687 | colorCB.addItemListener(this); |
---|
588 | | - oe.aConstraints.gridx += 2; |
---|
589 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 688 | + |
---|
| 689 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 690 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
590 | 691 | materialCB.addItemListener(this); |
---|
591 | | - oe.aConstraints.gridx += 2; |
---|
592 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 692 | + |
---|
| 693 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 694 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
593 | 695 | textureCB.addItemListener(this); |
---|
594 | 696 | |
---|
595 | | - oe.aConstraints.gridx = 0; |
---|
596 | | - oe.aConstraints.gridy += 1; |
---|
| 697 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 698 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 699 | + oe.treePanel.Return(); |
---|
597 | 700 | |
---|
| 701 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 702 | +// mainPanel.setResizeWeight(0.5); |
---|
| 703 | + |
---|
598 | 704 | //jList.addListSelectionListener(this); |
---|
599 | 705 | oe.jTree.addTreeSelectionListener(this); |
---|
600 | 706 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
616 | 722 | radio.layout = sevenButton; |
---|
617 | 723 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
618 | 724 | } |
---|
| 725 | + |
---|
| 726 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 727 | + { |
---|
| 728 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 729 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 730 | + boxCB.addItemListener(this); |
---|
| 731 | + |
---|
| 732 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 733 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 734 | + zoomBoxCB.addItemListener(this); |
---|
| 735 | + |
---|
| 736 | + if (true) // Globals.ADVANCED) |
---|
| 737 | + { |
---|
| 738 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 739 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 740 | + supportCB.addItemListener(this); |
---|
| 741 | + |
---|
| 742 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 743 | + // localCB.addItemListener(this); |
---|
| 744 | + |
---|
| 745 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 746 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 747 | + crowdCB.addItemListener(this); |
---|
| 748 | + |
---|
| 749 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 750 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 751 | + smoothCB.addItemListener(this); |
---|
| 752 | + |
---|
| 753 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 754 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 755 | + slowCB.addItemListener(this); |
---|
| 756 | + |
---|
| 757 | +// constraints.gridy += 1; |
---|
| 758 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 759 | +// speakerMocapCB.addItemListener(this); |
---|
| 760 | + |
---|
| 761 | + if (false) |
---|
| 762 | + { |
---|
| 763 | + // handled in scripts |
---|
| 764 | + //constraints.gridy += 1; |
---|
| 765 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 766 | + speakerCameraCB.addItemListener(this); |
---|
| 767 | + |
---|
| 768 | + //constraints.gridy += 1; |
---|
| 769 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 770 | + speakerFocusCB.addItemListener(this); |
---|
| 771 | + |
---|
| 772 | + //constraints.gridy += 1; |
---|
| 773 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 774 | + smoothfocusCB.addItemListener(this); |
---|
| 775 | + } |
---|
| 776 | + |
---|
| 777 | +//constraints.gridx += 1; |
---|
| 778 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 779 | +// debugCB.addItemListener(this); |
---|
| 780 | + |
---|
| 781 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 782 | + oeilCB.addItemListener(this); |
---|
| 783 | + |
---|
| 784 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 785 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 786 | + lookAtCB.addItemListener(this); |
---|
| 787 | + |
---|
| 788 | + } |
---|
| 789 | + |
---|
| 790 | + cGridBag fill = new cGridBag(); |
---|
| 791 | + |
---|
| 792 | + fill.preferredHeight = 200; |
---|
| 793 | + |
---|
| 794 | + panel.add(fill); |
---|
| 795 | + |
---|
| 796 | + } |
---|
619 | 797 | |
---|
620 | 798 | void EditObject(Object3D obj) |
---|
621 | 799 | { |
---|
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(); |
---|
| 800 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 801 | + radioButton.SetObject(obj); |
---|
| 802 | + radioButton.layout = sevenButton; |
---|
| 803 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 804 | + radioButton.addActionListener(this); |
---|
| 805 | + radioPanel.add(radioButton); |
---|
| 806 | + buttonGroup.add(radioButton); |
---|
| 807 | + radioButton.doClick(); |
---|
630 | 808 | } |
---|
| 809 | + |
---|
631 | 810 | void SetupViews(ObjEditor oe) |
---|
632 | 811 | { |
---|
633 | 812 | oe.SetupViews(); |
---|
.. | .. |
---|
646 | 825 | JCheckBox fastCB; |
---|
647 | 826 | JCheckBox slowCB; |
---|
648 | 827 | JCheckBox boxCB; |
---|
| 828 | + JCheckBox zoomBoxCB; |
---|
649 | 829 | JCheckBox trackCB; |
---|
650 | 830 | JCheckBox smoothfocusCB; |
---|
651 | 831 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
688 | 868 | dropAttributes |= Object3D.TEXTURE; |
---|
689 | 869 | else |
---|
690 | 870 | dropAttributes &= ~Object3D.TEXTURE; |
---|
691 | | - } |
---|
692 | | - else if(e.getSource() == liveCB) |
---|
| 871 | + } else if(e.getSource() == liveCB) |
---|
693 | 872 | { |
---|
694 | 873 | cameraView.ToggleLive(); |
---|
| 874 | + refreshContents(false); |
---|
695 | 875 | } |
---|
696 | 876 | else if(e.getSource() == supportCB) |
---|
697 | 877 | { |
---|
.. | .. |
---|
726 | 906 | Recompile(); |
---|
727 | 907 | cameraView.repaint(); |
---|
728 | 908 | // refreshContents(); |
---|
| 909 | + } |
---|
| 910 | + else if(e.getSource() == zoomBoxCB) |
---|
| 911 | + { |
---|
| 912 | + cameraView.ToggleZoomBoxMode(); |
---|
729 | 913 | } |
---|
730 | 914 | else if(e.getSource() == smoothfocusCB) |
---|
731 | 915 | { |
---|
.. | .. |
---|
840 | 1024 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
841 | 1025 | // return; |
---|
842 | 1026 | // } |
---|
843 | | - if (string.charAt(0) == '/') |
---|
| 1027 | + |
---|
| 1028 | + // File path for Mac and Windows |
---|
| 1029 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
844 | 1030 | { |
---|
845 | 1031 | // file(s) |
---|
846 | 1032 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
867 | 1053 | |
---|
868 | 1054 | flashIt = false; |
---|
869 | 1055 | CameraPane pane = (CameraPane) target; |
---|
870 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1056 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
871 | 1057 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
872 | 1058 | |
---|
873 | 1059 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
894 | 1080 | { |
---|
895 | 1081 | loadClipboard(true); |
---|
896 | 1082 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
897 | | - pasteInto(false); |
---|
| 1083 | + pasteInto(false, false); |
---|
898 | 1084 | } else { |
---|
899 | 1085 | loadClipboard(false); |
---|
900 | 1086 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
901 | | - pasteInto(false); // true); // ??? |
---|
| 1087 | + pasteInto(false, false); // true); // ??? |
---|
902 | 1088 | } |
---|
903 | 1089 | } |
---|
904 | 1090 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1002 | 1188 | |
---|
1003 | 1189 | void buildCreateMenu(Menu menu) |
---|
1004 | 1190 | { |
---|
| 1191 | + //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
| 1192 | + //heightFieldItem.addActionListener(this); |
---|
1005 | 1193 | gridItem = menu.add(new MenuItem("Grid")); |
---|
1006 | 1194 | gridItem.addActionListener(this); |
---|
1007 | 1195 | rectoidItem = menu.add(new MenuItem("Box")); |
---|
.. | .. |
---|
1014 | 1202 | torusItem.addActionListener(this); |
---|
1015 | 1203 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1016 | 1204 | superItem.addActionListener(this); |
---|
| 1205 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1206 | + kleinItem.addActionListener(this); |
---|
1017 | 1207 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1018 | 1208 | particleItem.addActionListener(this); |
---|
| 1209 | + if (Globals.ADVANCED) |
---|
| 1210 | + { |
---|
1019 | 1211 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1020 | 1212 | ragdollItem.addActionListener(this); |
---|
1021 | 1213 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1022 | 1214 | ragdoll2Item.addActionListener(this); |
---|
| 1215 | + } |
---|
1023 | 1216 | menu.add("-"); |
---|
1024 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1217 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1025 | 1218 | meshItem.addActionListener(this); |
---|
1026 | 1219 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1027 | 1220 | // meshGroupItem.addActionListener(this); |
---|
| 1221 | + if (Globals.ADVANCED) |
---|
| 1222 | + { |
---|
1028 | 1223 | springItem = menu.add(new MenuItem("Spring")); |
---|
1029 | 1224 | springItem.addActionListener(this); |
---|
1030 | 1225 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1031 | 1226 | 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 | 1227 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1037 | 1228 | blobItem.addActionListener(this); |
---|
1038 | 1229 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1039 | 1230 | latheItem.addActionListener(this); |
---|
| 1231 | + } |
---|
| 1232 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1233 | + bezierItem.addActionListener(this); |
---|
| 1234 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1235 | + overlayItem.addActionListener(this); |
---|
1040 | 1236 | lightItem = menu.add(new MenuItem("Light")); |
---|
1041 | 1237 | lightItem.addActionListener(this); |
---|
1042 | 1238 | menu.add("-"); |
---|
.. | .. |
---|
1046 | 1242 | loopItem.addActionListener(this); |
---|
1047 | 1243 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1048 | 1244 | doubleItem.addActionListener(this); |
---|
| 1245 | + if (Globals.ADVANCED) |
---|
| 1246 | + { |
---|
1049 | 1247 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1050 | 1248 | 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); |
---|
| 1249 | + } |
---|
1060 | 1250 | } |
---|
1061 | 1251 | |
---|
1062 | 1252 | void buildToolsMenu(Menu menu) |
---|
1063 | 1253 | { |
---|
1064 | 1254 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1065 | 1255 | animationItem.addItemListener(this); |
---|
1066 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1256 | + animationItem.setState(Globals.ANIMATION); |
---|
1067 | 1257 | |
---|
1068 | 1258 | menu.add("-"); |
---|
1069 | 1259 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1070 | 1260 | parseverticesItem.addActionListener(this); |
---|
1071 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1261 | + textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
| 1262 | + textureFieldItem.addActionListener(this); |
---|
| 1263 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1072 | 1264 | alignItem.addActionListener(this); |
---|
1073 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1074 | | - mirrorItem.addActionListener(this); |
---|
1075 | 1265 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1076 | 1266 | reduceMorphItem.addActionListener(this); |
---|
1077 | 1267 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1078 | 1268 | reduce34MorphItem.addActionListener(this); |
---|
1079 | | - |
---|
| 1269 | + menu.add("-"); |
---|
1080 | 1270 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1081 | 1271 | computeAOItem.addActionListener(this); |
---|
1082 | | - menu.add("-"); |
---|
1083 | 1272 | |
---|
| 1273 | + if (Globals.ADVANCED) |
---|
| 1274 | + { |
---|
| 1275 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1276 | + mirrorItem.addActionListener(this); |
---|
| 1277 | + menu.add("-"); |
---|
1084 | 1278 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1085 | 1279 | memoryItem.addActionListener(this); |
---|
1086 | 1280 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1087 | 1281 | analyzeItem.addActionListener(this); |
---|
1088 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1282 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1089 | 1283 | dumpItem.addActionListener(this); |
---|
1090 | 1284 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1091 | 1285 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1094 | 1288 | resetParentItem.addActionListener(this); |
---|
1095 | 1289 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1096 | 1290 | repairParentItem.addActionListener(this); |
---|
| 1291 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1292 | + repairShadowItem.addActionListener(this); |
---|
1097 | 1293 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1098 | 1294 | invariantsItem.addActionListener(this); |
---|
1099 | 1295 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1101 | 1297 | menu.add("-"); |
---|
1102 | 1298 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1103 | 1299 | editScriptItem.addActionListener(this); |
---|
| 1300 | + } |
---|
1104 | 1301 | } |
---|
1105 | 1302 | |
---|
1106 | 1303 | void ScreenFit() |
---|
.. | .. |
---|
1429 | 1626 | |
---|
1430 | 1627 | void Overwrite(int mask) |
---|
1431 | 1628 | { |
---|
1432 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1629 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1433 | 1630 | { |
---|
1434 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1631 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1435 | 1632 | |
---|
1436 | 1633 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1437 | 1634 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1454 | 1651 | // |
---|
1455 | 1652 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1456 | 1653 | { |
---|
| 1654 | + Object source = event.getSource(); |
---|
1457 | 1655 | /* |
---|
1458 | 1656 | if (event.getSource() == nameField) |
---|
1459 | 1657 | { |
---|
.. | .. |
---|
1465 | 1663 | } |
---|
1466 | 1664 | else |
---|
1467 | 1665 | */ |
---|
1468 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1666 | + if (source == lookAtItem || source == lookFromItem) |
---|
1469 | 1667 | { |
---|
1470 | 1668 | ScreenFit(); |
---|
1471 | 1669 | } else |
---|
1472 | | - if (event.getSource() == switchItem) |
---|
| 1670 | + if (source == switchItem) |
---|
1473 | 1671 | { |
---|
1474 | 1672 | cVector v1 = new cVector(); |
---|
1475 | 1673 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1478 | 1676 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1479 | 1677 | objEditor.cameraView.repaint(); |
---|
1480 | 1678 | } else |
---|
1481 | | - if (event.getSource() == rectoidItem) |
---|
| 1679 | + if (source == rectoidItem) |
---|
1482 | 1680 | { |
---|
1483 | 1681 | makeSomething(new Box()); |
---|
1484 | 1682 | } else |
---|
1485 | | - if (event.getSource() == particleItem) |
---|
| 1683 | + if (source == particleItem) |
---|
1486 | 1684 | { |
---|
1487 | 1685 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1488 | 1686 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1503 | 1701 | applyExample(particleGeom, "SMOKE"); |
---|
1504 | 1702 | makeSomething(particleGeom); |
---|
1505 | 1703 | } else |
---|
1506 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1704 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1507 | 1705 | { |
---|
1508 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1706 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1509 | 1707 | |
---|
1510 | 1708 | ragdoll.toParent = LA.newMatrix(); |
---|
1511 | 1709 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1521 | 1719 | makeSomething(ragdoll); |
---|
1522 | 1720 | //makeSomething(new VehicleDemo()); |
---|
1523 | 1721 | } else |
---|
1524 | | - if (event.getSource() == gridItem) |
---|
| 1722 | + /* |
---|
| 1723 | + */ |
---|
| 1724 | + if (source == heightFieldItem) |
---|
| 1725 | + { |
---|
| 1726 | + Object3D obj = new Object3D(); |
---|
| 1727 | + |
---|
| 1728 | + obj.CreateMaterial(); |
---|
| 1729 | + obj.bRep = new BoundaryRep(); |
---|
| 1730 | + |
---|
| 1731 | + obj.bRep.CreateMesh(new iHeightField() |
---|
| 1732 | + { |
---|
| 1733 | + public double f(double x, double y) |
---|
| 1734 | + { |
---|
| 1735 | + // The Mandelbrot set is represented by coloring |
---|
| 1736 | + // each point (x,y) according to the number of |
---|
| 1737 | + // iterations it takes before the while loop in |
---|
| 1738 | + // this method ends. For points that are actually |
---|
| 1739 | + // in the Mandelbrot set, or very close to it, the |
---|
| 1740 | + // count will reach the maximum value, 80. These |
---|
| 1741 | + // points will be colored purple. All other colors |
---|
| 1742 | + // represent points that are definitely NOT in the set. |
---|
| 1743 | + x -= 600; |
---|
| 1744 | + y -= 500; |
---|
| 1745 | + x /= 200; |
---|
| 1746 | + y /= 200; |
---|
| 1747 | + int count = 0; |
---|
| 1748 | + double zx = x; |
---|
| 1749 | + double zy = y; |
---|
| 1750 | + while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) { |
---|
| 1751 | + double new_zx = zx*zx - zy*zy + x; |
---|
| 1752 | + zy = 2*zx*zy + y; |
---|
| 1753 | + zx = new_zx; |
---|
| 1754 | + count++; |
---|
| 1755 | + } |
---|
| 1756 | + return count; // Math.sqrt(count); |
---|
| 1757 | + } |
---|
| 1758 | + }, 1000,1000); |
---|
| 1759 | + |
---|
| 1760 | + makeSomething(obj); |
---|
| 1761 | + } else |
---|
| 1762 | + if (source == gridItem) |
---|
1525 | 1763 | { |
---|
1526 | 1764 | makeSomething(new Grid()); |
---|
1527 | 1765 | } else |
---|
1528 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1766 | + if (source == ellipsoidItem) |
---|
1529 | 1767 | { |
---|
1530 | 1768 | makeSomething(new Sphere()); |
---|
1531 | 1769 | } else |
---|
1532 | | - if (event.getSource() == coneItem) |
---|
| 1770 | + if (source == coneItem) |
---|
1533 | 1771 | { |
---|
1534 | 1772 | makeSomething(new Cone()); |
---|
1535 | 1773 | } else |
---|
1536 | | - if (event.getSource() == torusItem) |
---|
| 1774 | + if (source == torusItem) |
---|
1537 | 1775 | { |
---|
1538 | 1776 | makeSomething(new Torus()); |
---|
1539 | 1777 | } else |
---|
1540 | | - if (event.getSource() == superItem) |
---|
| 1778 | + if (source == superItem) |
---|
1541 | 1779 | { |
---|
1542 | 1780 | makeSomething(new Superellipsoid()); |
---|
1543 | 1781 | } else |
---|
1544 | | - if (event.getSource() == blobItem) |
---|
| 1782 | + if (source == kleinItem) |
---|
| 1783 | + { |
---|
| 1784 | + makeSomething(new Klein()); |
---|
| 1785 | + } else |
---|
| 1786 | + if (source == blobItem) |
---|
1545 | 1787 | { |
---|
1546 | 1788 | Blob blob = new Blob(); |
---|
1547 | 1789 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1549 | 1791 | //blob.retile(); |
---|
1550 | 1792 | makeSomething(blob); |
---|
1551 | 1793 | } else |
---|
1552 | | - if (event.getSource() == latheItem) |
---|
| 1794 | + if (source == latheItem) |
---|
1553 | 1795 | { |
---|
1554 | 1796 | makeSomething(new Lathe()); |
---|
1555 | 1797 | } else |
---|
1556 | | - if (event.getSource() == bezierItem) |
---|
| 1798 | + if (source == bezierItem) |
---|
1557 | 1799 | { |
---|
1558 | 1800 | makeSomething(new BezierSurface()); |
---|
1559 | 1801 | } else |
---|
1560 | | - if (event.getSource() == checkerItem) |
---|
| 1802 | + if (source == overlayItem) |
---|
1561 | 1803 | { |
---|
1562 | 1804 | /* |
---|
1563 | 1805 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1570 | 1812 | LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent); |
---|
1571 | 1813 | LA.matInvert(obj.toParent, obj.fromParent); |
---|
1572 | 1814 | */ |
---|
1573 | | - makeSomething(new CheckerIG()); |
---|
| 1815 | + makeSomething(new Checker()); |
---|
1574 | 1816 | } else |
---|
1575 | | - if (event.getSource() == meshItem) |
---|
| 1817 | + if (source == meshItem) |
---|
1576 | 1818 | { |
---|
1577 | 1819 | Object3D itemtomake = new Object3D(); |
---|
1578 | 1820 | Object3D child; |
---|
.. | .. |
---|
1593 | 1835 | makeSomething(child); |
---|
1594 | 1836 | } |
---|
1595 | 1837 | } else |
---|
1596 | | - if (event.getSource() == springItem) |
---|
| 1838 | + if (source == springItem) |
---|
1597 | 1839 | { |
---|
1598 | 1840 | cSpring s = new cSpring(); |
---|
1599 | 1841 | s.setup(); |
---|
1600 | 1842 | makeSomething(s); |
---|
1601 | 1843 | } else |
---|
1602 | | - if (event.getSource() == flagItem) |
---|
| 1844 | + if (source == flagItem) |
---|
1603 | 1845 | { |
---|
1604 | 1846 | cSpring s = new cFlag(); |
---|
1605 | 1847 | s.setup(); |
---|
1606 | 1848 | makeSomething(s); |
---|
1607 | 1849 | } else |
---|
1608 | | - if (event.getSource() == lightItem) |
---|
| 1850 | + if (source == lightItem) |
---|
1609 | 1851 | { |
---|
1610 | 1852 | makeSomething(new Light()); |
---|
1611 | 1853 | } else |
---|
1612 | | - if (event.getSource() == csgItem) |
---|
| 1854 | + if (source == csgItem) |
---|
1613 | 1855 | { |
---|
1614 | 1856 | group(new CSG()); |
---|
1615 | 1857 | } else |
---|
1616 | | - if (event.getSource() == templateItem) |
---|
| 1858 | + if (source == templateItem) |
---|
1617 | 1859 | { |
---|
1618 | 1860 | group(new cTemplate()); |
---|
1619 | 1861 | } else |
---|
1620 | | - if (event.getSource() == attributeItem) |
---|
| 1862 | + if (source == attributeItem) |
---|
1621 | 1863 | { |
---|
1622 | 1864 | makeSomething(new Attribute()); |
---|
1623 | 1865 | } else |
---|
1624 | | - if (event.getSource() == pointflowItem) |
---|
| 1866 | + if (source == pointflowItem) |
---|
1625 | 1867 | { |
---|
1626 | 1868 | makeSomething(new PointFlow()); |
---|
1627 | 1869 | } else |
---|
.. | .. |
---|
1633 | 1875 | } else |
---|
1634 | 1876 | */ |
---|
1635 | 1877 | |
---|
1636 | | - if (event.getSource() == superLoopItem) |
---|
| 1878 | + if (source == superLoopItem) |
---|
1637 | 1879 | { |
---|
1638 | 1880 | Composite g = new cGroup(); |
---|
1639 | 1881 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1655 | 1897 | |
---|
1656 | 1898 | group(g); |
---|
1657 | 1899 | } else |
---|
1658 | | - if (event.getSource() == loopItem) |
---|
| 1900 | + if (source == loopItem) |
---|
1659 | 1901 | { |
---|
1660 | 1902 | Composite csg = new GroupLeaf(); |
---|
1661 | 1903 | csg.count = 5; |
---|
.. | .. |
---|
1664 | 1906 | csg.addChild(child); |
---|
1665 | 1907 | child.addChild(csg); |
---|
1666 | 1908 | } else |
---|
1667 | | - if (event.getSource() == doubleItem) |
---|
| 1909 | + if (source == doubleItem) |
---|
1668 | 1910 | { |
---|
1669 | 1911 | Composite csg = new GroupLeaf(); |
---|
1670 | 1912 | csg.count = 5; |
---|
.. | .. |
---|
1676 | 1918 | csg.addChild(child); |
---|
1677 | 1919 | child.addChild(csg); |
---|
1678 | 1920 | } else |
---|
1679 | | - if (event.getSource() == tripleItem) |
---|
| 1921 | + if (source == tripleItem) |
---|
1680 | 1922 | { |
---|
1681 | 1923 | Composite csg = new GroupLeaf(); |
---|
1682 | 1924 | csg.count = 4; |
---|
.. | .. |
---|
1691 | 1933 | csg.addChild(child); |
---|
1692 | 1934 | child.addChild(csg); |
---|
1693 | 1935 | } else |
---|
1694 | | - |
---|
1695 | | - if (event.getSource() == importGFDItem) |
---|
| 1936 | + if (source == computeAOItem) |
---|
1696 | 1937 | { |
---|
1697 | | - ImportGFD(); |
---|
| 1938 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1939 | + Globals.theRenderer.repaint(); |
---|
1698 | 1940 | } 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) |
---|
| 1941 | + if (source == recompileItem) |
---|
1717 | 1942 | { |
---|
1718 | 1943 | Recompile(); |
---|
1719 | 1944 | refreshContents(); |
---|
1720 | 1945 | } else |
---|
1721 | | - if (event.getSource() == editScriptItem) |
---|
| 1946 | + if (source == editScriptItem) |
---|
1722 | 1947 | { |
---|
1723 | 1948 | OpenDialog(); |
---|
1724 | 1949 | refreshContents(); |
---|
1725 | 1950 | } else |
---|
1726 | | - if (event.getSource() == invariantsItem) |
---|
| 1951 | + if (source == invariantsItem) |
---|
1727 | 1952 | { |
---|
1728 | 1953 | System.out.println("Invariants:"); |
---|
1729 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1954 | + Grafreed.grafreeD.universe.invariants(); |
---|
1730 | 1955 | } else |
---|
1731 | | - if (event.getSource() == memoryItem) |
---|
| 1956 | + if (source == memoryItem) |
---|
1732 | 1957 | { |
---|
1733 | 1958 | //System.out.println("Invariants:"); |
---|
1734 | 1959 | PrintMemory(); |
---|
1735 | 1960 | } else |
---|
1736 | | - if (event.getSource() == pathItem) |
---|
| 1961 | + if (source == pathItem) |
---|
1737 | 1962 | { |
---|
1738 | 1963 | PrintPath(); |
---|
1739 | 1964 | } else |
---|
1740 | | - if (event.getSource() == analyzeItem) |
---|
| 1965 | + if (source == analyzeItem) |
---|
1741 | 1966 | { |
---|
1742 | 1967 | AnalyzeObject(); |
---|
1743 | 1968 | } else |
---|
1744 | | - if (event.getSource() == dumpItem) |
---|
| 1969 | + if (source == dumpItem) |
---|
1745 | 1970 | { |
---|
1746 | 1971 | DumpObject(); |
---|
1747 | 1972 | } else |
---|
1748 | | - if (event.getSource() == screenfitButton) |
---|
| 1973 | + if (source == undoButton) |
---|
| 1974 | + { |
---|
| 1975 | + Undo(); |
---|
| 1976 | + } else |
---|
| 1977 | + if (source == redoButton) |
---|
| 1978 | + { |
---|
| 1979 | + Redo(); |
---|
| 1980 | + } else |
---|
| 1981 | + if (source == saveButton) |
---|
| 1982 | + { |
---|
| 1983 | + Save(); |
---|
| 1984 | + } else |
---|
| 1985 | + if (source == oneStepButton) |
---|
| 1986 | + { |
---|
| 1987 | + Globals.ONESTEP = true; |
---|
| 1988 | + cameraView.repaint(); |
---|
| 1989 | + } else |
---|
| 1990 | + if (source == screenfitButton) |
---|
1749 | 1991 | { |
---|
1750 | 1992 | //Reload(lastConverter, lastFilename, true); |
---|
1751 | 1993 | ScreenFit(); |
---|
1752 | 1994 | } else |
---|
1753 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1995 | + if (source == screenfitpointButton) |
---|
1754 | 1996 | { |
---|
1755 | 1997 | //Reload(lastConverter, lastFilename, true); |
---|
1756 | 1998 | ScreenFitPoint(); |
---|
1757 | 1999 | } else |
---|
1758 | | - if (event.getSource() == snapobjectButton) |
---|
| 2000 | + if (source == snapobjectButton) |
---|
1759 | 2001 | { |
---|
1760 | 2002 | //Reload(lastConverter, lastFilename, true); |
---|
1761 | 2003 | SnapObject(); |
---|
.. | .. |
---|
1766 | 2008 | // Recompile(); |
---|
1767 | 2009 | // refreshContents(); |
---|
1768 | 2010 | // } else |
---|
1769 | | - if (event.getSource() == gcButton) |
---|
| 2011 | + if (source == gcButton) |
---|
1770 | 2012 | { |
---|
1771 | 2013 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1772 | 2014 | System.gc(); |
---|
1773 | 2015 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1774 | 2016 | } else |
---|
1775 | | - if (event.getSource() == editLeafItem) |
---|
| 2017 | + if (source == editLeafItem) |
---|
1776 | 2018 | { |
---|
1777 | 2019 | Object3D obj; |
---|
1778 | 2020 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1786 | 2028 | } |
---|
1787 | 2029 | refreshContents(true); |
---|
1788 | 2030 | } else |
---|
1789 | | - if (event.getSource() == openWindowItem) |
---|
| 2031 | + if (source == openWindowItem) |
---|
1790 | 2032 | { |
---|
1791 | 2033 | EditSelection(true); |
---|
1792 | 2034 | } else |
---|
1793 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2035 | + if (source == cutItem || source == clearButton) |
---|
1794 | 2036 | { |
---|
1795 | 2037 | loadClipboard(true); |
---|
1796 | 2038 | } else |
---|
1797 | | - if (event.getSource() == duplicateItem) |
---|
| 2039 | + if (source == undoItem) |
---|
1798 | 2040 | { |
---|
1799 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoItem) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
| 2046 | + } else |
---|
| 2047 | + if (source == duplicateItem) |
---|
| 2048 | + { |
---|
| 2049 | + Object3D keep = Grafreed.clipboard; |
---|
1800 | 2050 | loadClipboard(false); |
---|
1801 | 2051 | paste(false); |
---|
1802 | | - GraphreeD.clipboard = keep; |
---|
| 2052 | + Grafreed.clipboard = keep; |
---|
1803 | 2053 | } else |
---|
1804 | | - if (event.getSource() == cloneItem) |
---|
| 2054 | + if (source == cloneItem) |
---|
1805 | 2055 | { |
---|
1806 | 2056 | CloneSelection(false); |
---|
1807 | 2057 | } else |
---|
1808 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2058 | + if (source == cloneSupportItem) |
---|
1809 | 2059 | { |
---|
1810 | 2060 | CloneSelection(true); |
---|
1811 | 2061 | } else |
---|
1812 | | - if (event.getSource() == copyItem) |
---|
| 2062 | + if (source == copyItem) |
---|
1813 | 2063 | { |
---|
1814 | 2064 | loadClipboard(false); |
---|
1815 | 2065 | } else |
---|
1816 | | - if (event.getSource() == pasteItem) |
---|
| 2066 | + if (source == pasteItem) |
---|
1817 | 2067 | { |
---|
1818 | 2068 | paste(false); |
---|
1819 | 2069 | } else |
---|
1820 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2070 | + if (source == pasteIntoItem) |
---|
1821 | 2071 | { |
---|
1822 | | - pasteInto(false); |
---|
| 2072 | + pasteInto(true, false); |
---|
1823 | 2073 | } else |
---|
1824 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2074 | + if (source == pasteLinkItem) |
---|
1825 | 2075 | { |
---|
1826 | | - pasteInto(true); |
---|
| 2076 | + pasteInto(false, false); |
---|
1827 | 2077 | } else |
---|
1828 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2078 | + if (source == pasteCloneItem) |
---|
| 2079 | + { |
---|
| 2080 | + pasteInto(true, true); |
---|
| 2081 | + } else |
---|
| 2082 | + if (source == pasteExpandItem) |
---|
1829 | 2083 | { |
---|
1830 | 2084 | paste(true); |
---|
1831 | 2085 | } else |
---|
1832 | | - if (event.getSource() == synchronizeItem) |
---|
| 2086 | + if (source == synchronizeItem) |
---|
1833 | 2087 | { |
---|
1834 | 2088 | Overwrite(Object3D.TRANSFORM); |
---|
1835 | 2089 | } else |
---|
1836 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2090 | + if (source == overwriteNameItem) |
---|
1837 | 2091 | { |
---|
1838 | 2092 | Overwrite(Object3D.NAME); |
---|
1839 | 2093 | } else |
---|
1840 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2094 | + if (source == overwriteUVItem) |
---|
1841 | 2095 | { |
---|
1842 | 2096 | Overwrite(Object3D.UV); |
---|
1843 | 2097 | } else |
---|
1844 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2098 | + if (source == overwriteMatItem) |
---|
1845 | 2099 | { |
---|
| 2100 | + /* july 2015 |
---|
1846 | 2101 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1847 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2102 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1848 | 2103 | else |
---|
1849 | 2104 | { |
---|
1850 | 2105 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1856 | 2111 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1857 | 2112 | } |
---|
1858 | 2113 | } |
---|
| 2114 | + */ |
---|
| 2115 | + |
---|
| 2116 | + Overwrite(dropAttributes); |
---|
1859 | 2117 | } |
---|
1860 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2118 | + if (source == overwriteGeoItem) |
---|
1861 | 2119 | { |
---|
1862 | 2120 | Overwrite(Object3D.GEOMETRY); |
---|
1863 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2121 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1864 | 2122 | // { |
---|
1865 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2123 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1866 | 2124 | // |
---|
1867 | 2125 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1868 | 2126 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1874 | 2132 | // refreshContents(); |
---|
1875 | 2133 | // } |
---|
1876 | 2134 | } else |
---|
1877 | | - if (event.getSource() == generateMeshItem) |
---|
| 2135 | + if (source == generateMeshItem) |
---|
1878 | 2136 | { |
---|
1879 | 2137 | //if (group.selection.size() == 1) |
---|
1880 | 2138 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1885 | 2143 | ResetModel(); |
---|
1886 | 2144 | refreshContents(); |
---|
1887 | 2145 | } else |
---|
1888 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2146 | + if (source == extractGeometriesItem) |
---|
1889 | 2147 | { |
---|
1890 | 2148 | boolean one = false; |
---|
1891 | 2149 | |
---|
.. | .. |
---|
1912 | 2170 | ResetModel(); |
---|
1913 | 2171 | refreshContents(); |
---|
1914 | 2172 | } else |
---|
1915 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2173 | + if (source == cloneGeometriesItem) |
---|
1916 | 2174 | { |
---|
1917 | 2175 | boolean one = false; |
---|
1918 | 2176 | |
---|
.. | .. |
---|
1938 | 2196 | ResetModel(); |
---|
1939 | 2197 | refreshContents(); |
---|
1940 | 2198 | } else |
---|
1941 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2199 | + if (source == shareGeometriesItem) |
---|
1942 | 2200 | { |
---|
1943 | 2201 | boolean one = false; |
---|
1944 | 2202 | |
---|
1945 | 2203 | if (group.selection.size() == 1) |
---|
1946 | 2204 | one = true; |
---|
1947 | 2205 | |
---|
| 2206 | + Object3D merge = null; |
---|
| 2207 | + |
---|
1948 | 2208 | Object3D content = new cGroup(); |
---|
1949 | 2209 | |
---|
1950 | 2210 | for (int i=0; i<group.selection.size(); i++) |
---|
1951 | 2211 | { |
---|
1952 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2212 | + merge = new Merge(group.selection.get(i)); |
---|
1953 | 2213 | |
---|
1954 | 2214 | if (one) |
---|
1955 | | - makeSomething(sel, false); |
---|
| 2215 | + makeSomething(merge, false); |
---|
1956 | 2216 | else |
---|
1957 | | - content.addChild(sel); |
---|
| 2217 | + content.addChild(merge); |
---|
1958 | 2218 | } |
---|
1959 | 2219 | |
---|
1960 | 2220 | if (!one) |
---|
1961 | | - makeSomething(content, false); |
---|
1962 | | - |
---|
1963 | | - ResetModel(); |
---|
1964 | | - refreshContents(); |
---|
| 2221 | + makeSomething(content, true); |
---|
| 2222 | + else |
---|
| 2223 | + { |
---|
| 2224 | + ResetModel(); |
---|
| 2225 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2226 | + refreshContents(); |
---|
| 2227 | + } |
---|
1965 | 2228 | } else |
---|
1966 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2229 | + if (source == mergeGeometriesItem) |
---|
1967 | 2230 | { |
---|
1968 | 2231 | boolean one = false; |
---|
1969 | 2232 | |
---|
.. | .. |
---|
1993 | 2256 | ResetModel(); |
---|
1994 | 2257 | refreshContents(); |
---|
1995 | 2258 | } else |
---|
1996 | | - if (event.getSource() == linkverticesItem) |
---|
| 2259 | + if (source == linkverticesItem) |
---|
1997 | 2260 | { |
---|
1998 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2261 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
1999 | 2262 | // { |
---|
2000 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2263 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2001 | 2264 | // |
---|
2002 | 2265 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2003 | 2266 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2006 | 2269 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2007 | 2270 | // refreshContents(); |
---|
2008 | 2271 | // } |
---|
2009 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2272 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2010 | 2273 | { |
---|
2011 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2274 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2012 | 2275 | |
---|
2013 | 2276 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2014 | 2277 | content = ((cGroup)content).get(0); |
---|
2015 | 2278 | |
---|
2016 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2279 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2017 | 2280 | for (int i=0; i<group.selection.size(); i++) |
---|
2018 | 2281 | { |
---|
2019 | | - boolean random = CameraPane.RANDOM; |
---|
2020 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2282 | + boolean random = CameraPane.SWITCH; |
---|
| 2283 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2021 | 2284 | group.selection.get(i).linkVerticesThis(content); |
---|
2022 | 2285 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2023 | | - CameraPane.RANDOM = random; |
---|
| 2286 | + CameraPane.SWITCH = random; |
---|
2024 | 2287 | } |
---|
2025 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2288 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2026 | 2289 | refreshContents(); |
---|
2027 | 2290 | } |
---|
2028 | 2291 | } else |
---|
2029 | | - if (event.getSource() == resetsupportItem) |
---|
| 2292 | + if (source == resetsupportItem) |
---|
2030 | 2293 | { |
---|
2031 | 2294 | for (int i=0; i<group.selection.size(); i++) |
---|
2032 | 2295 | { |
---|
2033 | | - boolean random = CameraPane.RANDOM; |
---|
2034 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2296 | + boolean random = CameraPane.SWITCH; |
---|
| 2297 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2035 | 2298 | group.selection.get(i).linkVerticesThis(null); |
---|
2036 | | - CameraPane.RANDOM = random; |
---|
| 2299 | + CameraPane.SWITCH = random; |
---|
2037 | 2300 | } |
---|
2038 | 2301 | |
---|
2039 | 2302 | refreshContents(); |
---|
2040 | 2303 | } else |
---|
2041 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2304 | + if (source == relinkverticesItem) |
---|
| 2305 | + { |
---|
| 2306 | + boolean random = CameraPane.SWITCH; |
---|
| 2307 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2308 | + group.selection.RelinkToSupport(); |
---|
| 2309 | + CameraPane.SWITCH = random; |
---|
| 2310 | + |
---|
| 2311 | + refreshContents(); |
---|
| 2312 | + } else |
---|
| 2313 | + if (source == resetreferencesItem) |
---|
2042 | 2314 | { |
---|
2043 | 2315 | for (int i=0; i<group.selection.size(); i++) |
---|
2044 | 2316 | { |
---|
.. | .. |
---|
2047 | 2319 | |
---|
2048 | 2320 | refreshContents(); |
---|
2049 | 2321 | } else |
---|
2050 | | - if (event.getSource() == setMasterItem) |
---|
| 2322 | + if (source == setMasterItem) |
---|
2051 | 2323 | { |
---|
2052 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2324 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2053 | 2325 | { |
---|
2054 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2326 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2055 | 2327 | |
---|
2056 | 2328 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2057 | 2329 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2060 | 2332 | refreshContents(); |
---|
2061 | 2333 | } |
---|
2062 | 2334 | } else |
---|
2063 | | - if (event.getSource() == poseMeshItem) |
---|
| 2335 | + if (source == poseMeshItem) |
---|
2064 | 2336 | { |
---|
2065 | 2337 | if (group.selection.size() == 1) |
---|
2066 | 2338 | { |
---|
2067 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2339 | + if (Grafreed.clipboard.size() == 1) |
---|
2068 | 2340 | { |
---|
2069 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2341 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2070 | 2342 | |
---|
2071 | 2343 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2072 | 2344 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2079 | 2351 | } |
---|
2080 | 2352 | |
---|
2081 | 2353 | } else |
---|
2082 | | - if (event.getSource() == revertMeshItem) |
---|
| 2354 | + if (source == revertMeshItem) |
---|
2083 | 2355 | { |
---|
2084 | 2356 | RevertMeshes(); |
---|
2085 | 2357 | } else |
---|
2086 | | - if (event.getSource() == resetMeshItem) |
---|
| 2358 | + if (source == resetAllItem) |
---|
2087 | 2359 | { |
---|
2088 | 2360 | ResetAll(); |
---|
2089 | 2361 | } else |
---|
2090 | | - if (event.getSource() == stepAllItem) |
---|
| 2362 | + if (source == stepAllItem) |
---|
2091 | 2363 | { |
---|
2092 | 2364 | StepAll(); |
---|
2093 | 2365 | } else |
---|
2094 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2366 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2095 | 2367 | { |
---|
2096 | 2368 | //int indices[] = jList.getSelectedIndices(); |
---|
2097 | 2369 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2099 | 2371 | |
---|
2100 | 2372 | ClearSelection(false); |
---|
2101 | 2373 | } else |
---|
2102 | | - if (event.getSource() == clearAllItem) |
---|
| 2374 | + if (source == clearAllItem) |
---|
2103 | 2375 | { |
---|
2104 | 2376 | ClearSelection(true); |
---|
2105 | 2377 | } else |
---|
2106 | | - if (event.getSource() == grabItem) |
---|
| 2378 | + if (source == grabItem) |
---|
2107 | 2379 | { |
---|
2108 | 2380 | group(new cGroup(), true); |
---|
2109 | 2381 | } else |
---|
2110 | | - if (event.getSource() == frontItem) |
---|
| 2382 | + if (source == hideItem) |
---|
| 2383 | + { |
---|
| 2384 | + group(new HiddenObject()); |
---|
| 2385 | + } else |
---|
| 2386 | + if (source == frontItem) |
---|
2111 | 2387 | { |
---|
2112 | 2388 | front(); |
---|
2113 | 2389 | } else |
---|
2114 | | - if (event.getSource() == backItem) |
---|
| 2390 | + if (source == backItem) |
---|
2115 | 2391 | { |
---|
2116 | 2392 | back(); |
---|
2117 | 2393 | } else |
---|
2118 | | - if (event.getSource() == cameraItem) |
---|
| 2394 | + if (source == cameraItem) |
---|
2119 | 2395 | { |
---|
2120 | 2396 | makeSomething(new Camera()); |
---|
2121 | 2397 | } else |
---|
2122 | | - if (event.getSource() == compositeItem) |
---|
| 2398 | + if (source == compositeItem) |
---|
2123 | 2399 | { |
---|
2124 | 2400 | group(new Composite()); |
---|
2125 | 2401 | } else |
---|
2126 | | - if (event.getSource() == randomItem) |
---|
| 2402 | + if (source == randomItem) |
---|
2127 | 2403 | { |
---|
2128 | 2404 | RandomNode random = new RandomNode(); |
---|
2129 | 2405 | group(random); |
---|
2130 | 2406 | if (random.size() > 0) |
---|
2131 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2407 | + random.name = random.get(0).name + "Switch"; |
---|
2132 | 2408 | } else |
---|
2133 | | - if (event.getSource() == physicsItem) |
---|
| 2409 | + if (source == physicsItem) |
---|
2134 | 2410 | { |
---|
2135 | 2411 | group(new PhysicsNode()); |
---|
2136 | 2412 | } else |
---|
2137 | | - if (event.getSource() == frameselectorItem) |
---|
| 2413 | + if (source == frameselectorItem) |
---|
2138 | 2414 | { |
---|
2139 | 2415 | for (int i=0; i<group.selection.size(); i++) |
---|
2140 | 2416 | { |
---|
.. | .. |
---|
2146 | 2422 | ResetModel(); |
---|
2147 | 2423 | refreshContents(); |
---|
2148 | 2424 | } else |
---|
2149 | | - if (event.getSource() == switchGeoItem) |
---|
| 2425 | + if (source == switchGeoItem) |
---|
2150 | 2426 | { |
---|
2151 | 2427 | for (int i=0; i<group.selection.size(); i++) |
---|
2152 | 2428 | { |
---|
.. | .. |
---|
2158 | 2434 | ResetModel(); |
---|
2159 | 2435 | refreshContents(); |
---|
2160 | 2436 | } else |
---|
2161 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2437 | + if (source == switchTransfoItem) |
---|
2162 | 2438 | { |
---|
2163 | 2439 | for (int i=0; i<group.selection.size(); i++) |
---|
2164 | 2440 | { |
---|
.. | .. |
---|
2170 | 2446 | ResetModel(); |
---|
2171 | 2447 | refreshContents(); |
---|
2172 | 2448 | } else |
---|
2173 | | - if (event.getSource() == morphItem) |
---|
| 2449 | + if (source == morphItem) |
---|
2174 | 2450 | { |
---|
2175 | 2451 | for (int i=0; i<group.selection.size(); i++) |
---|
2176 | 2452 | { |
---|
.. | .. |
---|
2182 | 2458 | ResetModel(); |
---|
2183 | 2459 | refreshContents(); |
---|
2184 | 2460 | } else |
---|
2185 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2461 | + if (source == scriptNodeItem) |
---|
2186 | 2462 | { |
---|
2187 | 2463 | boolean atleastone = false; |
---|
2188 | 2464 | |
---|
.. | .. |
---|
2221 | 2497 | } |
---|
2222 | 2498 | } |
---|
2223 | 2499 | } else |
---|
2224 | | - if (event.getSource() == linkerItem) |
---|
| 2500 | + if (source == linkerItem) |
---|
2225 | 2501 | { |
---|
2226 | 2502 | group(new cLinker()); |
---|
2227 | 2503 | } else |
---|
2228 | | - if (event.getSource() == textureItem) |
---|
| 2504 | + if (source == textureItem) |
---|
2229 | 2505 | { |
---|
2230 | 2506 | group(new TextureNode()); |
---|
2231 | 2507 | } else |
---|
2232 | | - if (event.getSource() == shadowXItem) |
---|
| 2508 | + if (source == billboardItem) |
---|
| 2509 | + { |
---|
| 2510 | + group(new BillboardNode()); |
---|
| 2511 | + } else |
---|
| 2512 | + if (source == shadowXItem) |
---|
2233 | 2513 | { |
---|
2234 | 2514 | CastShadow(0); |
---|
2235 | 2515 | } else |
---|
2236 | | - if (event.getSource() == shadowYItem) |
---|
| 2516 | + if (source == shadowYItem) |
---|
2237 | 2517 | { |
---|
2238 | 2518 | CastShadow(1); |
---|
2239 | 2519 | } else |
---|
2240 | | - if (event.getSource() == shadowZItem) |
---|
| 2520 | + if (source == shadowZItem) |
---|
2241 | 2521 | { |
---|
2242 | 2522 | CastShadow(2); |
---|
2243 | 2523 | } else |
---|
2244 | | - if (event.getSource() == ungroupItem) |
---|
| 2524 | + if (source == ungroupItem) |
---|
2245 | 2525 | { |
---|
2246 | | - ungroup(); |
---|
| 2526 | + //ungroup(); |
---|
| 2527 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2528 | + { |
---|
| 2529 | + Ungroup(group.selection.get(i)); |
---|
| 2530 | + } |
---|
| 2531 | + |
---|
| 2532 | + ClearSelection(false); |
---|
| 2533 | + |
---|
| 2534 | + refreshContents(); |
---|
2247 | 2535 | } else |
---|
2248 | | - if (event.getSource() == genUVItem) |
---|
| 2536 | + if (source == genUVItem) |
---|
2249 | 2537 | { |
---|
2250 | 2538 | GenUV(); |
---|
2251 | 2539 | } else |
---|
2252 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2540 | + if (source == genNormalsCADItem) |
---|
2253 | 2541 | { |
---|
2254 | 2542 | GenNormals(true); |
---|
2255 | 2543 | } else |
---|
2256 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2544 | + if (source == genNormalsMESHItem) |
---|
| 2545 | + { |
---|
| 2546 | + GenNormalsMESH(); |
---|
| 2547 | + } else |
---|
| 2548 | + if (source == genNormalsORGANItem) |
---|
2257 | 2549 | { |
---|
2258 | 2550 | GenNormals(false); |
---|
2259 | 2551 | } else |
---|
2260 | | - if (event.getSource() == stripifyItem) |
---|
| 2552 | + if (source == genNormalsMINEItem) |
---|
| 2553 | + { |
---|
| 2554 | + GenNormalsMINE(); |
---|
| 2555 | + } else |
---|
| 2556 | + if (source == stripifyItem) |
---|
2261 | 2557 | { |
---|
2262 | 2558 | Stripify(); |
---|
2263 | 2559 | } else |
---|
2264 | | - if (event.getSource() == unstripifyItem) |
---|
| 2560 | + if (source == unstripifyItem) |
---|
2265 | 2561 | { |
---|
2266 | 2562 | Unstripify(); |
---|
2267 | 2563 | } else |
---|
2268 | | - if (event.getSource() == trimItem) |
---|
| 2564 | + if (source == trimItem) |
---|
2269 | 2565 | { |
---|
2270 | 2566 | Trim(); |
---|
2271 | 2567 | } else |
---|
2272 | | - if (event.getSource() == untrimItem) |
---|
| 2568 | + if (source == untrimItem) |
---|
2273 | 2569 | { |
---|
2274 | 2570 | Untrim(); |
---|
2275 | 2571 | } else |
---|
2276 | | - if (event.getSource() == clearColorsItem) |
---|
| 2572 | + if (source == clearColorsItem) |
---|
2277 | 2573 | { |
---|
2278 | 2574 | ClearColors(); |
---|
2279 | 2575 | } else |
---|
2280 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2576 | + if (source == clearMaterialsItem) |
---|
2281 | 2577 | { |
---|
2282 | 2578 | ClearMaterials(); |
---|
2283 | 2579 | } else |
---|
2284 | | - if (event.getSource() == liveleavesItem) |
---|
| 2580 | + if (source == liveleavesItem) |
---|
2285 | 2581 | { |
---|
2286 | 2582 | LiveLeaves(true); |
---|
2287 | 2583 | } else |
---|
2288 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2584 | + if (source == unliveleavesItem) |
---|
2289 | 2585 | { |
---|
2290 | 2586 | LiveLeaves(false); |
---|
2291 | 2587 | } else |
---|
2292 | | - if (event.getSource() == supportleavesItem) |
---|
| 2588 | + if (source == supportleavesItem) |
---|
2293 | 2589 | { |
---|
2294 | 2590 | SupportLeaves(true); |
---|
2295 | 2591 | } else |
---|
2296 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2592 | + if (source == unsupportleavesItem) |
---|
2297 | 2593 | { |
---|
2298 | 2594 | SupportLeaves(false); |
---|
2299 | 2595 | } else |
---|
2300 | | - if (event.getSource() == hideleavesItem) |
---|
| 2596 | + if (source == hideleavesItem) |
---|
2301 | 2597 | { |
---|
2302 | 2598 | HideLeaves(true); |
---|
2303 | 2599 | } else |
---|
2304 | | - if (event.getSource() == showleavesItem) |
---|
| 2600 | + if (source == showleavesItem) |
---|
2305 | 2601 | { |
---|
2306 | 2602 | HideLeaves(false); |
---|
2307 | 2603 | } else |
---|
2308 | | - if (event.getSource() == markleavesItem) |
---|
| 2604 | + if (source == markleavesItem) |
---|
2309 | 2605 | { |
---|
2310 | 2606 | MarkLeaves(true); |
---|
2311 | 2607 | } else |
---|
2312 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2608 | + if (source == unmarkleavesItem) |
---|
2313 | 2609 | { |
---|
2314 | 2610 | MarkLeaves(false); |
---|
2315 | 2611 | } else |
---|
2316 | | - if (event.getSource() == flipVItem) |
---|
| 2612 | + if (source == flipVItem) |
---|
2317 | 2613 | { |
---|
2318 | 2614 | FlipV(true); |
---|
2319 | 2615 | } else |
---|
2320 | | - if (event.getSource() == unflipVItem) |
---|
| 2616 | + if (source == unflipVItem) |
---|
2321 | 2617 | { |
---|
2322 | 2618 | FlipV(false); |
---|
2323 | 2619 | } else |
---|
2324 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2620 | + if (source == lowTexturesItem) |
---|
2325 | 2621 | { |
---|
2326 | 2622 | SetTexRes(0); |
---|
2327 | 2623 | } else |
---|
2328 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2624 | + if (source == normalTexturesItem) |
---|
2329 | 2625 | { |
---|
2330 | 2626 | SetTexRes(1); |
---|
2331 | 2627 | } else |
---|
2332 | | - if (event.getSource() == highTexturesItem) |
---|
| 2628 | + if (source == highTexturesItem) |
---|
2333 | 2629 | { |
---|
2334 | 2630 | SetTexRes(2); |
---|
2335 | 2631 | } else |
---|
2336 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2632 | + if (source == veryhighTexturesItem) |
---|
2337 | 2633 | { |
---|
2338 | 2634 | SetTexRes(3); |
---|
2339 | 2635 | } else |
---|
2340 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2636 | + if (source == maxTexturesItem) |
---|
2341 | 2637 | { |
---|
2342 | 2638 | SetTexRes(4); |
---|
2343 | 2639 | } else |
---|
2344 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2640 | + if (source == panoTexturesItem) |
---|
2345 | 2641 | { |
---|
2346 | 2642 | SetTexRes(5); |
---|
2347 | 2643 | } else |
---|
2348 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2644 | + if (source == reverseNormalsItem) |
---|
2349 | 2645 | { |
---|
2350 | 2646 | ReverseNormals(); |
---|
2351 | 2647 | } else |
---|
2352 | | - if (event.getSource() == parseverticesItem) |
---|
| 2648 | + if (source == parseverticesItem) |
---|
2353 | 2649 | { |
---|
2354 | 2650 | ParseVertices(); |
---|
2355 | 2651 | } else |
---|
2356 | | - if (event.getSource() == alignItem) |
---|
| 2652 | + if (source == textureFieldItem) |
---|
| 2653 | + { |
---|
| 2654 | + TextureVertices(); |
---|
| 2655 | + } else |
---|
| 2656 | + if (source == alignItem) |
---|
2357 | 2657 | { |
---|
2358 | 2658 | Align(); |
---|
2359 | 2659 | } else |
---|
2360 | | - if (event.getSource() == mirrorItem) |
---|
| 2660 | + if (source == mirrorItem) |
---|
2361 | 2661 | { |
---|
2362 | 2662 | MirrorPoses(); |
---|
2363 | 2663 | } else |
---|
2364 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2664 | + if (source == reduceMorphItem) |
---|
2365 | 2665 | { |
---|
2366 | 2666 | MeshReduction(false); |
---|
2367 | 2667 | } else |
---|
2368 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2668 | + if (source == reduce34MorphItem) |
---|
2369 | 2669 | { |
---|
2370 | 2670 | MeshReduction(true); |
---|
2371 | 2671 | } else |
---|
2372 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2672 | + if (source == reverseTrianglesItem) |
---|
2373 | 2673 | { |
---|
2374 | 2674 | ReverseTriangles(); |
---|
2375 | 2675 | } else |
---|
2376 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2676 | + if (source == reduceMeshItem) |
---|
2377 | 2677 | { |
---|
2378 | 2678 | ReduceMesh(false); |
---|
2379 | 2679 | } else |
---|
2380 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2680 | + if (source == reduce34MeshItem) |
---|
2381 | 2681 | { |
---|
2382 | 2682 | ReduceMesh(true); |
---|
2383 | 2683 | } else |
---|
2384 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2684 | + if (source == increaseMeshItem) |
---|
2385 | 2685 | { |
---|
2386 | 2686 | IncreaseMesh(); |
---|
2387 | 2687 | } else |
---|
2388 | | - if (event.getSource() == clipMeshItem) |
---|
| 2688 | + if (source == clipMeshItem) |
---|
2389 | 2689 | { |
---|
2390 | 2690 | ClipMesh(); |
---|
2391 | 2691 | } else |
---|
2392 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2692 | + if (source == smoothMeshItem) |
---|
2393 | 2693 | { |
---|
2394 | 2694 | SmoothMesh(); |
---|
2395 | 2695 | } else |
---|
2396 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2696 | + if (source == transformGeometryItem) |
---|
2397 | 2697 | { |
---|
2398 | 2698 | TransformGeometry(); |
---|
2399 | 2699 | } else |
---|
2400 | | - if (event.getSource() == resetTransformItem) |
---|
| 2700 | + if (source == transformChildrenItem) |
---|
| 2701 | + { |
---|
| 2702 | + TransformChildren(); |
---|
| 2703 | + } else |
---|
| 2704 | + if (source == resetTransformItem) |
---|
2401 | 2705 | { |
---|
2402 | 2706 | ResetTransform(); |
---|
2403 | 2707 | } else |
---|
2404 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2708 | + if (source == resetCentroidItem) |
---|
2405 | 2709 | { |
---|
2406 | | - ResetCentroid(); |
---|
| 2710 | + ResetCentroid(true); |
---|
2407 | 2711 | } else |
---|
2408 | | - if (event.getSource() == resetParentItem) |
---|
| 2712 | + if (source == resetCentroidXZItem) |
---|
| 2713 | + { |
---|
| 2714 | + ResetCentroid(false); |
---|
| 2715 | + } else |
---|
| 2716 | + if (source == resetParentItem) |
---|
2409 | 2717 | { |
---|
2410 | 2718 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2411 | 2719 | { |
---|
.. | .. |
---|
2415 | 2723 | |
---|
2416 | 2724 | refreshContents(); |
---|
2417 | 2725 | } else |
---|
2418 | | - if (event.getSource() == repairParentItem) |
---|
| 2726 | + if (source == repairParentItem) |
---|
2419 | 2727 | { |
---|
2420 | 2728 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2421 | 2729 | { |
---|
.. | .. |
---|
2429 | 2737 | |
---|
2430 | 2738 | refreshContents(); |
---|
2431 | 2739 | } else |
---|
2432 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2740 | + if (source == repairShadowItem) |
---|
| 2741 | + { |
---|
| 2742 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2743 | + { |
---|
| 2744 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2745 | + obj.RepairShadow(); |
---|
| 2746 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2747 | +// { |
---|
| 2748 | +// obj.get(i).parent = obj; |
---|
| 2749 | +// } |
---|
| 2750 | + } |
---|
| 2751 | + |
---|
| 2752 | + refreshContents(); |
---|
| 2753 | + } else |
---|
| 2754 | + if (source == sortbysizeItem) |
---|
2433 | 2755 | { |
---|
2434 | 2756 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2435 | 2757 | { |
---|
.. | .. |
---|
2441 | 2763 | ResetModel(); |
---|
2442 | 2764 | refreshContents(); |
---|
2443 | 2765 | } else |
---|
2444 | | - if (event.getSource() == sortbynameItem) |
---|
| 2766 | + if (source == sortbynameItem) |
---|
2445 | 2767 | { |
---|
2446 | 2768 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2447 | 2769 | { |
---|
.. | .. |
---|
2453 | 2775 | ResetModel(); |
---|
2454 | 2776 | refreshContents(); |
---|
2455 | 2777 | } else |
---|
2456 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2778 | + if (source == attachPigmentItem) |
---|
2457 | 2779 | { |
---|
2458 | 2780 | String texture = GetFile("Attach pigment"); |
---|
2459 | 2781 | Object3D obj; |
---|
.. | .. |
---|
2465 | 2787 | |
---|
2466 | 2788 | refreshContents(); |
---|
2467 | 2789 | } else |
---|
2468 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2790 | + if (source == detachPigmentItem) |
---|
2469 | 2791 | { |
---|
2470 | 2792 | Object3D obj; |
---|
2471 | 2793 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2476 | 2798 | |
---|
2477 | 2799 | refreshContents(); |
---|
2478 | 2800 | } else |
---|
2479 | | - if (event.getSource() == attachBumpItem) |
---|
| 2801 | + if (source == attachBumpItem) |
---|
2480 | 2802 | { |
---|
2481 | 2803 | String texture = GetFile("Attach bump"); |
---|
2482 | 2804 | Object3D obj; |
---|
.. | .. |
---|
2488 | 2810 | |
---|
2489 | 2811 | refreshContents(); |
---|
2490 | 2812 | } else |
---|
2491 | | - if (event.getSource() == detachBumpItem) |
---|
| 2813 | + if (source == detachBumpItem) |
---|
2492 | 2814 | { |
---|
2493 | 2815 | Object3D obj; |
---|
2494 | 2816 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2499 | 2821 | |
---|
2500 | 2822 | refreshContents(); |
---|
2501 | 2823 | } else |
---|
2502 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2824 | + if (source == pigmentBumpItem) |
---|
2503 | 2825 | { |
---|
2504 | 2826 | Object3D obj; |
---|
2505 | 2827 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2510 | 2832 | |
---|
2511 | 2833 | refreshContents(); |
---|
2512 | 2834 | } else |
---|
2513 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2835 | + if (source == flashSelectionButton) |
---|
2514 | 2836 | { |
---|
2515 | 2837 | CameraPane.flash = true; |
---|
2516 | 2838 | refreshContents(); |
---|
2517 | 2839 | } else |
---|
2518 | | - if (event.getSource() == oneButton) |
---|
| 2840 | + if (source == oneButton) |
---|
2519 | 2841 | { |
---|
2520 | 2842 | } else |
---|
2521 | | - if (event.getSource() == twoButton) |
---|
| 2843 | + if (source == twoButton) |
---|
2522 | 2844 | { |
---|
2523 | 2845 | radio.layout = twoButton; |
---|
2524 | 2846 | // bug |
---|
2525 | 2847 | //gridPanel.setDividerLocation(1.0); |
---|
2526 | 2848 | //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(); |
---|
| 2849 | +// bigThree.remove(scenePanel); |
---|
| 2850 | +// bigThree.remove(centralPanel); |
---|
| 2851 | +// bigThree.remove(XYZPanel); |
---|
| 2852 | +// aWindowConstraints.gridx = 0; |
---|
| 2853 | +// aWindowConstraints.gridy = 0; |
---|
| 2854 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2855 | +// // aConstraints.gridheight = 3; |
---|
| 2856 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2857 | +// aWindowConstraints.weightx = 0; |
---|
| 2858 | +// aWindowConstraints.weighty = 1; |
---|
| 2859 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2860 | +// aWindowConstraints.weightx = 1; |
---|
| 2861 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2862 | +// // aConstraints.gridheight = 3; |
---|
| 2863 | +// aWindowConstraints.gridx = 1; |
---|
| 2864 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2865 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2866 | +// aWindowConstraints.weightx = 0; |
---|
| 2867 | +// aWindowConstraints.gridx = 4; |
---|
| 2868 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2869 | +// // aConstraints.gridheight = 3; |
---|
| 2870 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2871 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2872 | +// scenePanel.setVisible(false); |
---|
| 2873 | +// centralPanel.setVisible(true); |
---|
| 2874 | +// XYZPanel.setVisible(false); |
---|
| 2875 | + bigThree.ClearUI(); |
---|
| 2876 | + bigThree.add(centralPanel); |
---|
| 2877 | + bigThree.FlushUI(); |
---|
2551 | 2878 | } else |
---|
2552 | | - if (event.getSource() == threeButton) |
---|
| 2879 | + if (source == threeButton) |
---|
2553 | 2880 | { |
---|
2554 | 2881 | 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(); |
---|
| 2882 | + |
---|
| 2883 | +// bigThree.remove(scenePanel); |
---|
| 2884 | +// bigThree.remove(centralPanel); |
---|
| 2885 | +// bigThree.remove(XYZPanel); |
---|
| 2886 | +// aWindowConstraints.gridx = 0; |
---|
| 2887 | +// aWindowConstraints.gridy = 0; |
---|
| 2888 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2889 | +// // aConstraints.gridheight = 3; |
---|
| 2890 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2891 | +// aWindowConstraints.weightx = 0; |
---|
| 2892 | +// aWindowConstraints.weighty = 1; |
---|
| 2893 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2894 | +// aWindowConstraints.weightx = 1; |
---|
| 2895 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2896 | +// // aConstraints.gridheight = 3; |
---|
| 2897 | +// aWindowConstraints.gridx = 1; |
---|
| 2898 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2899 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2900 | +// aWindowConstraints.weightx = 0; |
---|
| 2901 | +// aWindowConstraints.gridx = 4; |
---|
| 2902 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2903 | +// // aConstraints.gridheight = 3; |
---|
| 2904 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2905 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2906 | +// bigThree.validate(); |
---|
| 2907 | +// scenePanel.setVisible(false); |
---|
| 2908 | +// centralPanel.setVisible(true); |
---|
| 2909 | +// XYZPanel.setVisible(true); |
---|
| 2910 | + bigThree.ClearUI(); |
---|
| 2911 | + bigThree.add(centralPanel); |
---|
| 2912 | + bigThree.add(XYZPanel); |
---|
| 2913 | + bigThree.FlushUI(); |
---|
2579 | 2914 | } else |
---|
2580 | | - if (event.getSource() == fourButton) |
---|
| 2915 | + if (source == fourButton) |
---|
2581 | 2916 | { |
---|
2582 | 2917 | 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(); |
---|
| 2918 | + |
---|
| 2919 | +// bigThree.remove(scenePanel); |
---|
| 2920 | +// bigThree.remove(centralPanel); |
---|
| 2921 | +// bigThree.remove(XYZPanel); |
---|
| 2922 | +// aWindowConstraints.gridx = 0; |
---|
| 2923 | +// aWindowConstraints.gridy = 0; |
---|
| 2924 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2925 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2926 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2927 | +// aWindowConstraints.weightx = 1; |
---|
| 2928 | +// aWindowConstraints.weighty = 1; |
---|
| 2929 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2930 | +// aWindowConstraints.weightx = 1; |
---|
| 2931 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2932 | +// // aConstraints.gridheight = 3; |
---|
| 2933 | +// aWindowConstraints.gridx = 1; |
---|
| 2934 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2935 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2936 | +// aWindowConstraints.weightx = 0; |
---|
| 2937 | +// aWindowConstraints.gridx = 4; |
---|
| 2938 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2939 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2940 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2941 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2942 | +// bigThree.validate(); |
---|
| 2943 | +// scenePanel.setVisible(true); |
---|
| 2944 | +// centralPanel.setVisible(false); |
---|
| 2945 | +// XYZPanel.setVisible(false); |
---|
| 2946 | + bigThree.ClearUI(); |
---|
| 2947 | + bigThree.add(scenePanel); |
---|
| 2948 | + bigThree.FlushUI(); |
---|
2607 | 2949 | } else |
---|
2608 | | - if (event.getSource() == sixButton) |
---|
| 2950 | + if (source == sixButton) |
---|
2609 | 2951 | { |
---|
2610 | 2952 | 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(); |
---|
| 2953 | + |
---|
| 2954 | +// bigThree.remove(scenePanel); |
---|
| 2955 | +// bigThree.remove(centralPanel); |
---|
| 2956 | +// bigThree.remove(XYZPanel); |
---|
| 2957 | +// aWindowConstraints.gridx = 0; |
---|
| 2958 | +// aWindowConstraints.gridy = 0; |
---|
| 2959 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2960 | +// // aConstraints.gridheight = 3; |
---|
| 2961 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2962 | +// aWindowConstraints.weightx = 0; |
---|
| 2963 | +// aWindowConstraints.weighty = 1; |
---|
| 2964 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2965 | +// aWindowConstraints.weightx = 1; |
---|
| 2966 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2967 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2968 | +// aWindowConstraints.gridx = 1; |
---|
| 2969 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2970 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2971 | +// aWindowConstraints.weightx = 0; |
---|
| 2972 | +// aWindowConstraints.gridx = 4; |
---|
| 2973 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2974 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2975 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2976 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2977 | +// bigThree.validate(); |
---|
| 2978 | +// scenePanel.setVisible(true); |
---|
| 2979 | +// centralPanel.setVisible(true); |
---|
| 2980 | +// XYZPanel.setVisible(false); |
---|
| 2981 | + bigThree.ClearUI(); |
---|
| 2982 | + bigThree.add(scenePanel); |
---|
| 2983 | + bigThree.add(centralPanel); |
---|
| 2984 | + bigThree.FlushUI(); |
---|
2635 | 2985 | } else |
---|
2636 | | - if (event.getSource() == sevenButton) |
---|
| 2986 | + if (source == sevenButton) |
---|
2637 | 2987 | { |
---|
2638 | 2988 | 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(); |
---|
| 2989 | + |
---|
| 2990 | +// bigThree.remove(scenePanel); |
---|
| 2991 | +// bigThree.remove(centralPanel); |
---|
| 2992 | +// bigThree.remove(XYZPanel); |
---|
| 2993 | +// aWindowConstraints.gridx = 0; |
---|
| 2994 | +// aWindowConstraints.gridy = 0; |
---|
| 2995 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2996 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2997 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2998 | +// aWindowConstraints.weightx = 0; |
---|
| 2999 | +// aWindowConstraints.weighty = 1; |
---|
| 3000 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3001 | +// aWindowConstraints.weightx = 1; |
---|
| 3002 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3003 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3004 | +// aWindowConstraints.gridx = 1; |
---|
| 3005 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3006 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3007 | +// aWindowConstraints.weightx = 0; |
---|
| 3008 | +// aWindowConstraints.gridx = 4; |
---|
| 3009 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3010 | +// // aConstraints.gridheight = 3; |
---|
| 3011 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3012 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3013 | +// bigThree.validate(); |
---|
| 3014 | +// scenePanel.setVisible(true); |
---|
| 3015 | +// centralPanel.setVisible(true); |
---|
| 3016 | +// XYZPanel.setVisible(true); |
---|
| 3017 | + bigThree.ClearUI(); |
---|
| 3018 | + bigThree.add(scenePanel); |
---|
| 3019 | + bigThree.add(centralPanel); |
---|
| 3020 | + bigThree.add(XYZPanel); |
---|
| 3021 | + bigThree.FlushUI(); |
---|
2663 | 3022 | } else |
---|
2664 | | - if (event.getSource() == rootButton) |
---|
| 3023 | + if (source == rootButton) |
---|
2665 | 3024 | { |
---|
2666 | 3025 | Object3D obj; |
---|
2667 | 3026 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2673 | 3032 | |
---|
2674 | 3033 | refreshContents(true); |
---|
2675 | 3034 | } else |
---|
2676 | | - if (event.getSource() == closeButton) |
---|
| 3035 | + if (source == closeButton) |
---|
2677 | 3036 | { |
---|
2678 | 3037 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2679 | 3038 | cRadio ab; |
---|
.. | .. |
---|
2694 | 3053 | } |
---|
2695 | 3054 | refreshContents(true); |
---|
2696 | 3055 | } else |
---|
2697 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3056 | + if (source == editItem || source == editButton) |
---|
2698 | 3057 | { |
---|
2699 | 3058 | EditSelection(false); |
---|
2700 | 3059 | } else |
---|
2701 | | - if (event.getSource() == uneditButton) |
---|
| 3060 | + if (source == uneditButton) |
---|
2702 | 3061 | { |
---|
2703 | 3062 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2704 | 3063 | { |
---|
.. | .. |
---|
2708 | 3067 | child.CloseUI(); |
---|
2709 | 3068 | listUI.remove(child); |
---|
2710 | 3069 | |
---|
2711 | | - child.editWindow = null; // ??????????? |
---|
| 3070 | + //child.editWindow = null; // ??????????? |
---|
2712 | 3071 | } |
---|
2713 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3072 | + objEditor.ctrlPanel.FlushUI(); |
---|
2714 | 3073 | //objEditor.jTree.clearSelection(); |
---|
2715 | 3074 | //objEditor.ResetSliders(); |
---|
2716 | 3075 | refreshContents(true); |
---|
2717 | 3076 | } else |
---|
2718 | | - if (event.getSource() == clearPanelButton) |
---|
| 3077 | + if (source == clearPanelButton) |
---|
2719 | 3078 | { |
---|
2720 | 3079 | assert(copy == group); |
---|
2721 | 3080 | //copy.ClearUI(); |
---|
.. | .. |
---|
2726 | 3085 | listUI.clear(); |
---|
2727 | 3086 | refreshContents(true); |
---|
2728 | 3087 | } else |
---|
2729 | | - if (event.getSource() == allParamsButton) |
---|
| 3088 | + if (source == allParamsButton) |
---|
2730 | 3089 | { |
---|
2731 | 3090 | assert(copy == group); |
---|
2732 | 3091 | |
---|
.. | .. |
---|
2747 | 3106 | |
---|
2748 | 3107 | refreshContents(true); |
---|
2749 | 3108 | } else |
---|
2750 | | - if (event.getSource() == unselectButton) |
---|
| 3109 | + if (source == unselectButton) |
---|
2751 | 3110 | { |
---|
2752 | 3111 | objEditor.jTree.clearSelection(); |
---|
2753 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3112 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2754 | 3113 | objEditor.ResetSliders(); |
---|
2755 | 3114 | refreshContents(true); |
---|
2756 | 3115 | } else |
---|
2757 | | - if(event.getSource() instanceof cRadio) |
---|
| 3116 | + if(source instanceof cRadio) |
---|
2758 | 3117 | { |
---|
2759 | 3118 | group.parent = keepparent; |
---|
2760 | 3119 | group.attributes = 0; |
---|
2761 | 3120 | //group.editWindow = null; |
---|
2762 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3121 | + /*cRadio*/ radio = (cRadio)source; |
---|
2763 | 3122 | Object3D obj = radio.GetObject(); |
---|
2764 | 3123 | System.out.println("Edit " + obj); |
---|
2765 | 3124 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2779 | 3138 | } |
---|
2780 | 3139 | |
---|
2781 | 3140 | copy = group; |
---|
2782 | | - //CameraPane.theRenderer.object = group; |
---|
| 3141 | + //Globals.theRenderer.object = group; |
---|
2783 | 3142 | if(!useclient) |
---|
2784 | 3143 | { |
---|
2785 | 3144 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2788 | 3147 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2789 | 3148 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2790 | 3149 | cameraView.object = group; |
---|
2791 | | - cameraView.lighttouched = true; |
---|
| 3150 | + //cameraView.lighttouched = true; |
---|
| 3151 | + Globals.lighttouched = true; |
---|
2792 | 3152 | topView.object = group; |
---|
2793 | 3153 | frontView.object = group; |
---|
2794 | 3154 | sideView.object = group; |
---|
2795 | 3155 | } |
---|
| 3156 | + |
---|
| 3157 | +// fix "+" issue |
---|
2796 | 3158 | group.editWindow = this; |
---|
| 3159 | + |
---|
2797 | 3160 | /* |
---|
2798 | 3161 | currentLayout = radio.layout; |
---|
2799 | 3162 | if (currentLayout == null) |
---|
.. | .. |
---|
2806 | 3169 | //group.attributes = -1; |
---|
2807 | 3170 | ResetModel(); |
---|
2808 | 3171 | refreshContents(true); |
---|
2809 | | - } |
---|
| 3172 | + } else if (event.getSource() == editCameraItem) |
---|
| 3173 | + { |
---|
| 3174 | + cameraView.ProtectCamera(); |
---|
| 3175 | + cameraView.repaint(); |
---|
| 3176 | + return; |
---|
| 3177 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3178 | + { |
---|
| 3179 | + cameraView.RevertCamera(); |
---|
| 3180 | + cameraView.repaint(); |
---|
| 3181 | + return; |
---|
| 3182 | + // } else if (event.getSource() == textureButton) |
---|
| 3183 | + // { |
---|
| 3184 | + // return; // true; |
---|
| 3185 | + } |
---|
2810 | 3186 | else |
---|
2811 | 3187 | { |
---|
2812 | 3188 | //return super.action(event, arg); |
---|
.. | .. |
---|
2824 | 3200 | if (useclient) |
---|
2825 | 3201 | { |
---|
2826 | 3202 | cameraView.object = client; |
---|
2827 | | - cameraView.lighttouched = true; |
---|
| 3203 | + Globals.lighttouched = true; |
---|
2828 | 3204 | //topView.object = client; |
---|
2829 | 3205 | //frontView.object = client; |
---|
2830 | 3206 | //sideView.object = client; |
---|
.. | .. |
---|
2832 | 3208 | else |
---|
2833 | 3209 | { |
---|
2834 | 3210 | cameraView.object = group; |
---|
2835 | | - cameraView.lighttouched = true; |
---|
| 3211 | + Globals.lighttouched = true; |
---|
2836 | 3212 | //topView.object = group; |
---|
2837 | 3213 | //frontView.object = group; |
---|
2838 | 3214 | //sideView.object = group; |
---|
.. | .. |
---|
2867 | 3243 | refreshContents(); |
---|
2868 | 3244 | } |
---|
2869 | 3245 | |
---|
| 3246 | + void TransformChildren() |
---|
| 3247 | + { |
---|
| 3248 | + Object3D obj; |
---|
| 3249 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3250 | + { |
---|
| 3251 | + obj = (Object3D)e.nextElement(); |
---|
| 3252 | + obj.KeepTextureMatrices(); |
---|
| 3253 | + obj.TransformChildren(); |
---|
| 3254 | + obj.RestoreTextureMatrices(); |
---|
| 3255 | + |
---|
| 3256 | +// if (obj.parent == null) |
---|
| 3257 | +// { |
---|
| 3258 | +// System.out.println("NULL PARENT!"); |
---|
| 3259 | +// new Exception().printStackTrace(); |
---|
| 3260 | +// } |
---|
| 3261 | +// else |
---|
| 3262 | +// TouchTransform(obj); |
---|
| 3263 | +// //obj.parent.Touch(); |
---|
| 3264 | + } |
---|
| 3265 | + |
---|
| 3266 | + refreshContents(); |
---|
| 3267 | + } |
---|
2870 | 3268 | |
---|
2871 | 3269 | void ResetTransform() |
---|
2872 | 3270 | { |
---|
.. | .. |
---|
2979 | 3377 | refreshContents(); |
---|
2980 | 3378 | } |
---|
2981 | 3379 | |
---|
2982 | | - void ResetCentroid() |
---|
| 3380 | + void ResetCentroid(boolean full) |
---|
2983 | 3381 | { |
---|
2984 | 3382 | Object3D obj; |
---|
2985 | 3383 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2994 | 3392 | LA.matIdentity(Object3D.mat); |
---|
2995 | 3393 | obj.getBounds(minima, maxima, false); |
---|
2996 | 3394 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
2997 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3395 | + if (full) |
---|
| 3396 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
2998 | 3397 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
2999 | 3398 | obj.TransformMesh(Object3D.mat); |
---|
| 3399 | + |
---|
3000 | 3400 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3001 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3401 | + if (full) |
---|
| 3402 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3002 | 3403 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3404 | + |
---|
3003 | 3405 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3004 | 3406 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3005 | 3407 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3028 | 3430 | |
---|
3029 | 3431 | int size = obj.MemorySize(); |
---|
3030 | 3432 | |
---|
3031 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3434 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3032 | 3435 | } |
---|
3033 | 3436 | } |
---|
3034 | 3437 | catch (Exception e) |
---|
.. | .. |
---|
3065 | 3468 | obj = (Object3D)e.nextElement(); |
---|
3066 | 3469 | |
---|
3067 | 3470 | System.out.println("Object is: " + obj); |
---|
3068 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3471 | + Grafreed.AnalyzeObject(obj); |
---|
3069 | 3472 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3070 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3473 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3071 | 3474 | |
---|
3072 | 3475 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3073 | 3476 | } |
---|
.. | .. |
---|
3109 | 3512 | void GenNormals(boolean crease) |
---|
3110 | 3513 | { |
---|
3111 | 3514 | group.GenNormalsS(crease); |
---|
| 3515 | + |
---|
| 3516 | + refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + void GenNormalsMESH() |
---|
| 3520 | + { |
---|
| 3521 | + group.GenNormalsMeshS(); |
---|
| 3522 | + |
---|
| 3523 | + refreshContents(); |
---|
| 3524 | + } |
---|
| 3525 | + |
---|
| 3526 | + void GenNormalsMINE() |
---|
| 3527 | + { |
---|
| 3528 | + group.selection.GenNormalsMINE(); |
---|
3112 | 3529 | |
---|
3113 | 3530 | refreshContents(); |
---|
3114 | 3531 | } |
---|
.. | .. |
---|
3157 | 3574 | |
---|
3158 | 3575 | //Object3D buffer; |
---|
3159 | 3576 | 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 | | - |
---|
| 3577 | +// BoundaryRep temprep; |
---|
| 3578 | +// Object3D nodes; |
---|
| 3579 | +// Vector<Vertex> vertices; |
---|
| 3580 | +// |
---|
| 3581 | +// cGroup buffer; |
---|
| 3582 | +// |
---|
| 3583 | +// public void Vertex(Object3D node, Vertex v) |
---|
| 3584 | +// { |
---|
| 3585 | +//// vertices.add(v); |
---|
| 3586 | +//// nodes.addElement(node); |
---|
| 3587 | +//// |
---|
| 3588 | +//// if (temprep.GetCache(v) != null) |
---|
| 3589 | +//// { |
---|
| 3590 | +//// temprep.Remove(v); |
---|
| 3591 | +//// } else |
---|
| 3592 | +//// { |
---|
| 3593 | +//// temprep.Remember(v); |
---|
| 3594 | +//// } |
---|
| 3595 | +// |
---|
| 3596 | +// //Object3D node = nodes.get(index); |
---|
| 3597 | +// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3598 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3599 | +// |
---|
| 3600 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3601 | +// |
---|
| 3602 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3603 | +// |
---|
| 3604 | +// cGroup g = new cGroup(); |
---|
| 3605 | +// |
---|
| 3606 | +// if (g.toParent == null) |
---|
| 3607 | +// { |
---|
| 3608 | +// g.toParent = LA.newMatrix(); |
---|
| 3609 | +// g.fromParent = LA.newMatrix(); |
---|
| 3610 | +// } |
---|
| 3611 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3612 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3613 | +// |
---|
| 3614 | +// g.add(GrafreeD.clipboard); |
---|
| 3615 | +// |
---|
| 3616 | +// buffer.add(g); |
---|
| 3617 | +// } |
---|
| 3618 | +// |
---|
| 3619 | +// public void Face(Object3D node, Face f) |
---|
| 3620 | +// { |
---|
| 3621 | +// |
---|
| 3622 | +// } |
---|
| 3623 | +// |
---|
| 3624 | +// void ParseVerticesOld() // ?? |
---|
| 3625 | +// { |
---|
| 3626 | +// //if (group.selection.size() != 1) |
---|
| 3627 | +// // return; |
---|
| 3628 | +// |
---|
| 3629 | +// temprep = new BoundaryRep(); |
---|
| 3630 | +// nodes = new Object3D(); |
---|
| 3631 | +// vertices = new Vector<Vertex>(); |
---|
| 3632 | +// |
---|
| 3633 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3634 | +// GrafreeD.epsequal = true; |
---|
| 3635 | +// |
---|
| 3636 | +// for (int i=0; i<group.selection.size(); i++) |
---|
| 3637 | +// { |
---|
| 3638 | +// Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3639 | +// |
---|
| 3640 | +// group.selection.get(i).Parse( |
---|
| 3641 | +//this ); |
---|
| 3642 | +// |
---|
| 3643 | +// int repsize = temprep.VertexCount(); |
---|
| 3644 | +// int tablesize = temprep.vertextable.size(); |
---|
| 3645 | +// int nodesize = nodes.size(); |
---|
| 3646 | +// |
---|
| 3647 | +// assert(vertices.size() == nodes.size()); |
---|
| 3648 | +// |
---|
| 3649 | +// temprep.vertextable.elements(); |
---|
| 3650 | +// |
---|
| 3651 | +// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3652 | +// |
---|
| 3653 | +// for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
| 3654 | +// { |
---|
| 3655 | +// cGroup g = new cGroup(); |
---|
| 3656 | +// |
---|
| 3657 | +// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
| 3658 | +// |
---|
| 3659 | +// Object3D node = nodes.get(index); |
---|
| 3660 | +// temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3661 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3662 | +// |
---|
| 3663 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3664 | +// |
---|
| 3665 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3666 | +// |
---|
| 3667 | +// if (g.toParent == null) |
---|
| 3668 | +// { |
---|
| 3669 | +// g.toParent = LA.newMatrix(); |
---|
| 3670 | +// g.fromParent = LA.newMatrix(); |
---|
| 3671 | +// } |
---|
| 3672 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3673 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3674 | +// |
---|
| 3675 | +// g.add(GrafreeD.clipboard); |
---|
| 3676 | +// |
---|
| 3677 | +// buffer.add(g); |
---|
| 3678 | +// } |
---|
| 3679 | +// |
---|
| 3680 | +// makeSomething(buffer, i==group.selection.size()-1); |
---|
| 3681 | +// } |
---|
| 3682 | +// |
---|
| 3683 | +// GrafreeD.epsequal = epsequal; |
---|
| 3684 | +// |
---|
| 3685 | +// //buffer = null; |
---|
| 3686 | +// temprep = null; |
---|
| 3687 | +// nodes = null; |
---|
| 3688 | +// |
---|
| 3689 | +// refreshContents(); |
---|
| 3690 | +// } |
---|
| 3691 | + |
---|
3184 | 3692 | void ParseVertices() |
---|
3185 | 3693 | { |
---|
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; |
---|
| 3694 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3695 | + Grafreed.epsequal = true; |
---|
3195 | 3696 | |
---|
3196 | 3697 | for (int i=0; i<group.selection.size(); i++) |
---|
3197 | 3698 | { |
---|
3198 | | - Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3699 | + final cGroup buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
3199 | 3700 | |
---|
3200 | | - group.selection.get(i).Parse(this); |
---|
3201 | | - |
---|
3202 | | - int repsize = temprep.VertexCount(); |
---|
3203 | | - int tablesize = temprep.vertextable.size(); |
---|
3204 | | - int nodesize = nodes.size(); |
---|
| 3701 | + group.selection.get(i).Parse( |
---|
| 3702 | + |
---|
| 3703 | + new iParse() |
---|
| 3704 | + { |
---|
| 3705 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3706 | + { |
---|
| 3707 | + temp.set(v); |
---|
| 3708 | + LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3205 | 3709 | |
---|
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(); |
---|
| 3710 | + cGroup g = new cGroup(); |
---|
3211 | 3711 | |
---|
3212 | | - for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
3213 | | - { |
---|
3214 | | - cGroup g = new cGroup(); |
---|
| 3712 | + if (g.toParent == null) |
---|
| 3713 | + { |
---|
| 3714 | + g.toParent = LA.newMatrix(); |
---|
| 3715 | + g.fromParent = LA.newMatrix(); |
---|
| 3716 | + } |
---|
| 3717 | + LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3718 | + LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3215 | 3719 | |
---|
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); |
---|
| 3720 | + g.add(Grafreed.clipboard); |
---|
3220 | 3721 | |
---|
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); |
---|
| 3722 | + buffer.add(g); |
---|
| 3723 | + } |
---|
3232 | 3724 | |
---|
3233 | | - g.add(GraphreeD.clipboard); |
---|
| 3725 | + public void Face(Object3D node, Face f) |
---|
| 3726 | + { |
---|
3234 | 3727 | |
---|
3235 | | - buffer.add(g); |
---|
3236 | | - } |
---|
| 3728 | + } |
---|
| 3729 | + } |
---|
| 3730 | + ); |
---|
3237 | 3731 | |
---|
3238 | 3732 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3239 | 3733 | } |
---|
3240 | 3734 | |
---|
3241 | | - GraphreeD.epsequal = epsequal; |
---|
3242 | | - |
---|
3243 | | - //buffer = null; |
---|
3244 | | - temprep = null; |
---|
3245 | | - nodes = null; |
---|
| 3735 | + Grafreed.epsequal = epsequal; |
---|
3246 | 3736 | |
---|
3247 | 3737 | refreshContents(); |
---|
3248 | 3738 | } |
---|
3249 | | - |
---|
| 3739 | + |
---|
| 3740 | + void TextureVertices() |
---|
| 3741 | + { |
---|
| 3742 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3743 | + { |
---|
| 3744 | + group.selection.get(i).Parse( |
---|
| 3745 | + new iParse() |
---|
| 3746 | + { |
---|
| 3747 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3748 | + { |
---|
| 3749 | + cTexture tex = node.GetTextures(); |
---|
| 3750 | + String pigment = Object3D.GetPigment(tex); |
---|
| 3751 | + //String bump = Object3D.GetBump(tex); |
---|
| 3752 | + |
---|
| 3753 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3754 | + |
---|
| 3755 | + try |
---|
| 3756 | + { |
---|
| 3757 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3758 | + } |
---|
| 3759 | + catch (Exception e) |
---|
| 3760 | + { |
---|
| 3761 | + System.err.println("FAIL: " + node); |
---|
| 3762 | + } |
---|
| 3763 | + |
---|
| 3764 | + double s = v.s; |
---|
| 3765 | + |
---|
| 3766 | + if (s == 1) |
---|
| 3767 | + s = 0; |
---|
| 3768 | + |
---|
| 3769 | + double t = v.t; |
---|
| 3770 | + |
---|
| 3771 | + if (t == 1) |
---|
| 3772 | + t = 0; |
---|
| 3773 | + |
---|
| 3774 | + int indexs = (int) (texturedata.getWidth() * s); |
---|
| 3775 | + int indext = (int) (texturedata.getHeight() * t); |
---|
| 3776 | + |
---|
| 3777 | + int index = indext * texturedata.getWidth() + indexs; |
---|
| 3778 | + |
---|
| 3779 | + java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer(); |
---|
| 3780 | + |
---|
| 3781 | + int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3782 | + |
---|
| 3783 | + float scale = bytebuf.get(index*slide) & 0xFF; |
---|
| 3784 | + scale += bytebuf.get(index*slide+1) & 0xFF; |
---|
| 3785 | + scale += bytebuf.get(index*slide+2) & 0xFF; |
---|
| 3786 | + scale /= 3; |
---|
| 3787 | + |
---|
| 3788 | + scale /= 0xFF; |
---|
| 3789 | + // c'est quoi ca? scale /= 4; |
---|
| 3790 | + |
---|
| 3791 | + //v.AO = scale; |
---|
| 3792 | + |
---|
| 3793 | + v.x += v.norm.x * scale; |
---|
| 3794 | + v.y += v.norm.y * scale; |
---|
| 3795 | + v.z += v.norm.z * scale; |
---|
| 3796 | + } |
---|
| 3797 | + |
---|
| 3798 | + public void Face(Object3D node, Face f) |
---|
| 3799 | + { |
---|
| 3800 | + } |
---|
| 3801 | + } |
---|
| 3802 | + ); |
---|
| 3803 | + } |
---|
| 3804 | + |
---|
| 3805 | + refreshContents(); |
---|
| 3806 | + } |
---|
| 3807 | + |
---|
3250 | 3808 | void Align() |
---|
3251 | 3809 | { |
---|
| 3810 | + if (group.selection.size() == 0) |
---|
| 3811 | + return; |
---|
| 3812 | + |
---|
| 3813 | + cVector bbmin = new cVector(); |
---|
| 3814 | + cVector bbmax = new cVector(); |
---|
| 3815 | + |
---|
| 3816 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3817 | + |
---|
| 3818 | + double dx = bbmax.x - bbmin.x; |
---|
| 3819 | + double dy = bbmax.y - bbmin.y; |
---|
| 3820 | + double dz = bbmax.z - bbmin.z; |
---|
| 3821 | + |
---|
| 3822 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3823 | + |
---|
3252 | 3824 | for (int i=0; i<group.selection.size(); i++) |
---|
3253 | 3825 | { |
---|
3254 | 3826 | Object3D obj = group.selection.get(i); |
---|
3255 | 3827 | |
---|
3256 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3257 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3828 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3829 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3258 | 3830 | } |
---|
3259 | 3831 | |
---|
3260 | 3832 | refreshContents(); |
---|
.. | .. |
---|
3267 | 3839 | // ref.SaveSupports(); |
---|
3268 | 3840 | // Object3D par = ref.parent; |
---|
3269 | 3841 | // ref.parent = null; |
---|
3270 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3842 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3271 | 3843 | // ref.parent = par; |
---|
3272 | 3844 | // ref.RestoreSupports(); |
---|
3273 | 3845 | |
---|
.. | .. |
---|
3275 | 3847 | |
---|
3276 | 3848 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3277 | 3849 | |
---|
3278 | | - boolean random = CameraPane.RANDOM; |
---|
3279 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3850 | + boolean random = CameraPane.SWITCH; |
---|
| 3851 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3280 | 3852 | lowres.linkVerticesThis(null); |
---|
3281 | 3853 | lowres.linkVerticesThis(sn); |
---|
3282 | | - CameraPane.RANDOM = random; |
---|
| 3854 | + CameraPane.SWITCH = random; |
---|
3283 | 3855 | |
---|
3284 | 3856 | System.err.flush(); |
---|
3285 | 3857 | |
---|
.. | .. |
---|
3297 | 3869 | // lowres.SaveSupports(); |
---|
3298 | 3870 | // par = lowres.parent; |
---|
3299 | 3871 | // lowres.parent = null; |
---|
3300 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3872 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3301 | 3873 | Object3D newlow = CloneObject(lowres, false); |
---|
3302 | 3874 | newlow.name = sn.switchobject.get(i).name; |
---|
3303 | 3875 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3319 | 3891 | return; |
---|
3320 | 3892 | |
---|
3321 | 3893 | Object3D poses = group.selection.get(0); |
---|
3322 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3894 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3323 | 3895 | |
---|
3324 | 3896 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3325 | 3897 | |
---|
.. | .. |
---|
3488 | 4060 | group.selection.RelinkToSupport(); // july 2014 |
---|
3489 | 4061 | System.out.println("DONE."); |
---|
3490 | 4062 | refreshContents(); |
---|
3491 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4063 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3492 | 4064 | } |
---|
3493 | 4065 | |
---|
3494 | 4066 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3513 | 4085 | |
---|
3514 | 4086 | void ClipMesh() |
---|
3515 | 4087 | { |
---|
3516 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 4088 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3517 | 4089 | { |
---|
3518 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 4090 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3519 | 4091 | |
---|
3520 | 4092 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3521 | 4093 | content = ((cGroup)content).get(0); |
---|
3522 | 4094 | |
---|
3523 | 4095 | // for (int i=0; i<group.selection.size(); i++) |
---|
3524 | 4096 | // { |
---|
3525 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 4097 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3526 | 4098 | // } |
---|
3527 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4099 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3528 | 4100 | } |
---|
3529 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4101 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3530 | 4102 | System.out.println("DONE."); |
---|
3531 | 4103 | refreshContents(); |
---|
3532 | 4104 | } |
---|
.. | .. |
---|
3659 | 4231 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3660 | 4232 | |
---|
3661 | 4233 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3662 | | - if(elem != group) |
---|
| 4234 | + if(elem != group || !newWindow) |
---|
3663 | 4235 | { |
---|
3664 | 4236 | // if (!(elem instanceof Composite)) |
---|
3665 | 4237 | // newWindow = false; |
---|
.. | .. |
---|
3749 | 4321 | //case 702: // Event.LIST_DESELECT |
---|
3750 | 4322 | group.deselectAll(); |
---|
3751 | 4323 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
3752 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
3753 | 4324 | if (tps != null) |
---|
3754 | 4325 | { |
---|
3755 | 4326 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
3758 | 4329 | |
---|
3759 | 4330 | //if (child.parent != null) |
---|
3760 | 4331 | //child.parent.addSelectee(child); |
---|
| 4332 | + objEditor.SetMaterial(child); |
---|
3761 | 4333 | group.addSelectee(child); |
---|
3762 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
3763 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
3764 | | - System.err.println("info : " + child.GetPath()); |
---|
3765 | 4334 | } |
---|
3766 | 4335 | } |
---|
3767 | | - else |
---|
3768 | | - { |
---|
3769 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3770 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3771 | | - System.err.println("info : " + group.GetPath()); |
---|
3772 | | - } |
---|
| 4336 | +// else |
---|
| 4337 | +// { |
---|
| 4338 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4339 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4340 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4341 | +// } |
---|
3773 | 4342 | |
---|
3774 | | - objEditor.SetText(); // jan 2014 |
---|
3775 | | - |
---|
3776 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4343 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
3777 | 4344 | CameraPane.flash = true; |
---|
3778 | 4345 | |
---|
3779 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4346 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
3780 | 4347 | // a camera |
---|
3781 | 4348 | { |
---|
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; |
---|
| 4349 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4350 | + { |
---|
| 4351 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4352 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4353 | + } |
---|
| 4354 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4355 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3786 | 4356 | } |
---|
3787 | 4357 | |
---|
3788 | 4358 | refreshContents(); |
---|
.. | .. |
---|
3793 | 4363 | |
---|
3794 | 4364 | freezemodel = false; |
---|
3795 | 4365 | } |
---|
| 4366 | + |
---|
| 4367 | + void refreshContents(boolean cp) |
---|
| 4368 | + { |
---|
| 4369 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4370 | + { |
---|
| 4371 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4372 | + |
---|
| 4373 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4374 | + { |
---|
| 4375 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4376 | + |
---|
| 4377 | + objEditor.AddInfo(child, this, true); |
---|
| 4378 | + System.err.println("info : " + child.GetPath()); |
---|
| 4379 | + } |
---|
| 4380 | + |
---|
| 4381 | + objEditor.SetText(); // jan 2014 |
---|
| 4382 | + } |
---|
| 4383 | + |
---|
| 4384 | + super.refreshContents(cp); |
---|
| 4385 | + } |
---|
3796 | 4386 | |
---|
3797 | 4387 | void linkSomething(Object3D thing) |
---|
3798 | 4388 | { |
---|
.. | .. |
---|
3864 | 4454 | { |
---|
3865 | 4455 | if (group.selection.isEmpty()) |
---|
3866 | 4456 | return; |
---|
3867 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4457 | + |
---|
| 4458 | + Grafreed.clipboardIsTempGroup = false; |
---|
3868 | 4459 | Composite tGroup = null; |
---|
3869 | 4460 | if (group.selection.size() > 0) // 1) |
---|
3870 | 4461 | { |
---|
3871 | 4462 | tGroup = new cGroup(); |
---|
3872 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4463 | + Grafreed.clipboardIsTempGroup = true; |
---|
3873 | 4464 | } |
---|
3874 | 4465 | |
---|
3875 | 4466 | if (cut) |
---|
3876 | 4467 | { |
---|
| 4468 | + Save(); |
---|
3877 | 4469 | //int indices[] = jList.getSelectedIndices(); |
---|
3878 | 4470 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
3879 | 4471 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
3909 | 4501 | //System.out.println("cut " + child); |
---|
3910 | 4502 | //System.out.println("parent = " + child.parent); |
---|
3911 | 4503 | // tmp.addChild(child); |
---|
3912 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4504 | + if (Grafreed.clipboardIsTempGroup) |
---|
3913 | 4505 | tGroup.add/*Child*/(tmp); |
---|
3914 | 4506 | else |
---|
3915 | | - GraphreeD.clipboard = tmp; |
---|
| 4507 | + Grafreed.clipboard = tmp; |
---|
3916 | 4508 | } |
---|
3917 | 4509 | else |
---|
3918 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4510 | + if (Grafreed.clipboardIsTempGroup) |
---|
3919 | 4511 | tGroup.add/*Child*/(child); |
---|
3920 | 4512 | else |
---|
3921 | | - GraphreeD.clipboard = child; |
---|
| 4513 | + Grafreed.clipboard = child; |
---|
3922 | 4514 | } |
---|
3923 | 4515 | |
---|
3924 | 4516 | //ResetModel(); |
---|
.. | .. |
---|
3950 | 4542 | //System.out.println("cut " + elem); |
---|
3951 | 4543 | //System.out.println("parent = " + elem.parent); |
---|
3952 | 4544 | // tmp.addChild(elem); |
---|
3953 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4545 | + if (Grafreed.clipboardIsTempGroup) |
---|
3954 | 4546 | tGroup.add/*Child*/(tmp); |
---|
3955 | 4547 | else |
---|
3956 | | - GraphreeD.clipboard = tmp; |
---|
| 4548 | + Grafreed.clipboard = tmp; |
---|
3957 | 4549 | } |
---|
3958 | 4550 | else |
---|
3959 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4551 | + if (Grafreed.clipboardIsTempGroup) |
---|
3960 | 4552 | tGroup.add/*Child*/(child); |
---|
3961 | 4553 | else |
---|
3962 | | - GraphreeD.clipboard = child; |
---|
| 4554 | + Grafreed.clipboard = child; |
---|
3963 | 4555 | } |
---|
3964 | 4556 | |
---|
3965 | 4557 | } |
---|
3966 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
3967 | | - GraphreeD.clipboard = tGroup; |
---|
| 4558 | + |
---|
| 4559 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4560 | + Grafreed.clipboard = tGroup; |
---|
| 4561 | + |
---|
3968 | 4562 | if (cut) |
---|
3969 | 4563 | { |
---|
3970 | 4564 | ResetModel(); |
---|
.. | .. |
---|
3974 | 4568 | |
---|
3975 | 4569 | void paste(boolean expand) |
---|
3976 | 4570 | { |
---|
3977 | | - // if (GraphreeD.clipboard == null) |
---|
| 4571 | + // if (GrafreeD.clipboard == null) |
---|
3978 | 4572 | // return; |
---|
3979 | 4573 | boolean first = true; |
---|
3980 | 4574 | |
---|
3981 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4575 | + if (Grafreed.clipboardIsTempGroup) |
---|
3982 | 4576 | { |
---|
3983 | 4577 | Composite temp; |
---|
3984 | 4578 | |
---|
.. | .. |
---|
3989 | 4583 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
3990 | 4584 | */ |
---|
3991 | 4585 | Object3D elem; |
---|
3992 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4586 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
3993 | 4587 | { |
---|
3994 | 4588 | Object3D child = (Object3D)e.nextElement(); |
---|
3995 | 4589 | |
---|
.. | .. |
---|
4003 | 4597 | else |
---|
4004 | 4598 | elem = child.deepCopy(); // ? |
---|
4005 | 4599 | child.parent = keepparent; |
---|
4006 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4600 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4007 | 4601 | // elem = elem.get(0); |
---|
4008 | 4602 | makeSomething(elem, true); // ?? first); |
---|
4009 | 4603 | //group.addChild(elem); |
---|
.. | .. |
---|
4023 | 4617 | //Object3D cb = Applet3D.clipboard; |
---|
4024 | 4618 | //temp.addChild(cb); |
---|
4025 | 4619 | //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()); |
---|
| 4620 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4621 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4622 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4623 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4624 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4031 | 4625 | else |
---|
4032 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4033 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4626 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4627 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4034 | 4628 | } |
---|
4035 | 4629 | |
---|
4036 | 4630 | ResetModel(); |
---|
4037 | 4631 | refreshContents(); |
---|
4038 | 4632 | } |
---|
4039 | 4633 | |
---|
4040 | | - void pasteInto(boolean copyit) |
---|
| 4634 | + void pasteInto(boolean copyit, boolean clone) |
---|
4041 | 4635 | { |
---|
4042 | | -// if (GraphreeD.clipboard == null) |
---|
| 4636 | +// if (GrafreeD.clipboard == null) |
---|
4043 | 4637 | // return; |
---|
4044 | 4638 | |
---|
4045 | 4639 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4066 | 4660 | if (copyit) |
---|
4067 | 4661 | { |
---|
4068 | 4662 | // paste(false); |
---|
4069 | | - CloneClipboard(false); // sept 2014 |
---|
| 4663 | + if (clone) |
---|
| 4664 | + { |
---|
| 4665 | + CloneClipboard(false); // sept 2014 |
---|
| 4666 | + } |
---|
| 4667 | + else |
---|
| 4668 | + { |
---|
| 4669 | + paste(false); |
---|
| 4670 | + } |
---|
4070 | 4671 | } |
---|
4071 | 4672 | else |
---|
4072 | 4673 | { |
---|
4073 | 4674 | boolean first = true; |
---|
4074 | 4675 | |
---|
4075 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4676 | + if (Grafreed.clipboardIsTempGroup) |
---|
4076 | 4677 | { |
---|
4077 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4678 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4078 | 4679 | Object3D copy; |
---|
4079 | 4680 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4080 | 4681 | { |
---|
.. | .. |
---|
4084 | 4685 | } |
---|
4085 | 4686 | } else |
---|
4086 | 4687 | { |
---|
4087 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4688 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4088 | 4689 | } |
---|
4089 | 4690 | } |
---|
4090 | 4691 | } |
---|
.. | .. |
---|
4276 | 4877 | makeSomething(csg); |
---|
4277 | 4878 | } |
---|
4278 | 4879 | |
---|
| 4880 | + void Ungroup(Object3D g) |
---|
| 4881 | + { |
---|
| 4882 | + if (g instanceof HiddenObject) |
---|
| 4883 | + { |
---|
| 4884 | + HiddenObject h = (HiddenObject) g; |
---|
| 4885 | + |
---|
| 4886 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4887 | + { |
---|
| 4888 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4889 | + } |
---|
| 4890 | + } |
---|
| 4891 | + else |
---|
| 4892 | + { |
---|
| 4893 | + for (int i=0; i<g.Size(); i++) |
---|
| 4894 | + { |
---|
| 4895 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4896 | + } |
---|
| 4897 | + } |
---|
| 4898 | + } |
---|
| 4899 | + |
---|
4279 | 4900 | void ungroup() |
---|
4280 | 4901 | { |
---|
4281 | 4902 | /* |
---|
.. | .. |
---|
4469 | 5090 | } |
---|
4470 | 5091 | */ |
---|
4471 | 5092 | |
---|
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 | 5093 | /* |
---|
4488 | 5094 | public void Callback(Object obj) |
---|
4489 | 5095 | { |
---|
.. | .. |
---|
4507 | 5113 | } |
---|
4508 | 5114 | */ |
---|
4509 | 5115 | |
---|
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 | 5116 | String GetFile(String dialogName) |
---|
4528 | 5117 | { |
---|
4529 | | - if (GraphreeD.standAlone) |
---|
| 5118 | + if (Grafreed.standAlone) |
---|
4530 | 5119 | { |
---|
4531 | 5120 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4532 | 5121 | browser.show(); |
---|
.. | .. |
---|
4590 | 5179 | cButton flashSelectionButton; |
---|
4591 | 5180 | cButton editButton; |
---|
4592 | 5181 | cButton uneditButton; |
---|
| 5182 | + JCheckBox allParamsButton; |
---|
4593 | 5183 | cButton clearpanelButton; |
---|
4594 | | - cButton allParamsButton; |
---|
4595 | 5184 | cButton unselectButton; |
---|
4596 | 5185 | |
---|
| 5186 | + cButton saveButton; |
---|
| 5187 | + cButton undoButton; |
---|
| 5188 | + cButton redoButton; |
---|
| 5189 | + cButton oneStepButton; |
---|
| 5190 | + |
---|
4597 | 5191 | cButton screenfitButton; |
---|
4598 | 5192 | cButton screenfitpointButton; |
---|
4599 | 5193 | cButton snapobjectButton; |
---|
.. | .. |
---|
4624 | 5218 | private MenuItem lookFromItem; |
---|
4625 | 5219 | private MenuItem switchItem; |
---|
4626 | 5220 | private MenuItem cutItem; |
---|
| 5221 | + private MenuItem undoItem; |
---|
| 5222 | + private MenuItem redoItem; |
---|
4627 | 5223 | private MenuItem duplicateItem; |
---|
4628 | 5224 | private MenuItem cloneItem; |
---|
4629 | 5225 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4635 | 5231 | private MenuItem resetsupportItem; |
---|
4636 | 5232 | private MenuItem resetreferencesItem; |
---|
4637 | 5233 | private MenuItem linkverticesItem; |
---|
| 5234 | + private MenuItem relinkverticesItem; |
---|
4638 | 5235 | private MenuItem setMasterItem; |
---|
4639 | | - private MenuItem resetMeshItem; |
---|
| 5236 | + private MenuItem resetAllItem; |
---|
4640 | 5237 | private MenuItem stepAllItem; |
---|
4641 | 5238 | private MenuItem revertMeshItem; |
---|
4642 | 5239 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4647 | 5244 | private MenuItem mergeGeometriesItem; |
---|
4648 | 5245 | private MenuItem copyItem; |
---|
4649 | 5246 | private MenuItem pasteItem; |
---|
| 5247 | + private MenuItem pasteIntoItem; |
---|
4650 | 5248 | private MenuItem pasteLinkItem; |
---|
4651 | 5249 | private MenuItem pasteCloneItem; |
---|
4652 | 5250 | private MenuItem pasteExpandItem; |
---|
4653 | 5251 | private MenuItem clearItem; |
---|
4654 | 5252 | private MenuItem clearAllItem; |
---|
4655 | 5253 | private MenuItem genUVItem; |
---|
| 5254 | + private MenuItem genNormalsMESHItem; |
---|
4656 | 5255 | private MenuItem genNormalsCADItem; |
---|
4657 | 5256 | private MenuItem genNormalsORGANItem; |
---|
| 5257 | + private MenuItem genNormalsMINEItem; |
---|
4658 | 5258 | private MenuItem stripifyItem; |
---|
4659 | 5259 | private MenuItem unstripifyItem; |
---|
4660 | 5260 | private MenuItem trimItem; |
---|
.. | .. |
---|
4694 | 5294 | private MenuItem panoTexturesItem; |
---|
4695 | 5295 | |
---|
4696 | 5296 | private MenuItem resetCentroidItem; |
---|
4697 | | - private MenuItem transformgeometryItem; |
---|
| 5297 | + private MenuItem resetCentroidXZItem; |
---|
4698 | 5298 | private MenuItem resetTransformItem; |
---|
| 5299 | + private MenuItem transformGeometryItem; |
---|
| 5300 | + private MenuItem transformChildrenItem; |
---|
| 5301 | + private MenuItem hideItem; |
---|
4699 | 5302 | private MenuItem grabItem; |
---|
4700 | 5303 | private MenuItem backItem; |
---|
4701 | 5304 | private MenuItem frontItem; |
---|
.. | .. |
---|
4716 | 5319 | |
---|
4717 | 5320 | private MenuItem resetParentItem; |
---|
4718 | 5321 | private MenuItem repairParentItem; |
---|
| 5322 | + private MenuItem repairShadowItem; |
---|
4719 | 5323 | private MenuItem sortbysizeItem; |
---|
4720 | 5324 | private MenuItem sortbynameItem; |
---|
4721 | 5325 | |
---|
.. | .. |
---|
4728 | 5332 | private MenuItem particleItem; |
---|
4729 | 5333 | private MenuItem ragdollItem; |
---|
4730 | 5334 | private MenuItem ragdoll2Item; |
---|
| 5335 | + private MenuItem heightFieldItem; |
---|
| 5336 | + private MenuItem textureFieldItem; |
---|
4731 | 5337 | private MenuItem gridItem; |
---|
4732 | 5338 | private MenuItem rectoidItem; |
---|
4733 | 5339 | private MenuItem ellipsoidItem; |
---|
4734 | 5340 | private MenuItem coneItem; |
---|
4735 | 5341 | private MenuItem torusItem; |
---|
4736 | 5342 | private MenuItem superItem; |
---|
| 5343 | + private MenuItem kleinItem; |
---|
4737 | 5344 | private MenuItem blobItem; |
---|
4738 | 5345 | private MenuItem latheItem; |
---|
4739 | 5346 | private MenuItem bezierItem; |
---|
4740 | | - private MenuItem checkerItem; |
---|
| 5347 | + private MenuItem overlayItem; |
---|
4741 | 5348 | private MenuItem meshItem; |
---|
4742 | 5349 | // private MenuItem meshGroupItem; |
---|
4743 | 5350 | private MenuItem springItem; |
---|
.. | .. |
---|
4746 | 5353 | private MenuItem csgItem; |
---|
4747 | 5354 | private MenuItem templateItem; |
---|
4748 | 5355 | private MenuItem textureItem; |
---|
| 5356 | + private MenuItem billboardItem; |
---|
4749 | 5357 | private MenuItem shadowXItem; |
---|
4750 | 5358 | private MenuItem shadowYItem; |
---|
4751 | 5359 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4758 | 5366 | private MenuItem doubleItem; |
---|
4759 | 5367 | private MenuItem tripleItem; |
---|
4760 | 5368 | |
---|
4761 | | - private MenuItem importGFDItem; |
---|
4762 | | - private MenuItem importVRMLX3DItem; |
---|
4763 | | - private MenuItem import3DSItem; |
---|
4764 | | - private MenuItem importOBJItem; |
---|
4765 | | - |
---|
4766 | 5369 | private MenuItem computeAOItem; |
---|
4767 | 5370 | private MenuItem recompileItem; |
---|
4768 | 5371 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4772 | 5375 | private MenuItem analyzeItem; |
---|
4773 | 5376 | private MenuItem dumpItem; |
---|
4774 | 5377 | //boolean freezemodel = false; |
---|
| 5378 | + |
---|
| 5379 | + Menu cameraMenu; |
---|
| 5380 | + MenuItem editCameraItem; |
---|
| 5381 | + MenuItem revertCameraItem; |
---|
4775 | 5382 | } |
---|