.. | .. |
---|
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 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 158 | + duplicateItem.addActionListener(this); |
---|
| 159 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 160 | + cloneItem.addActionListener(this); |
---|
| 161 | + if (Globals.ADVANCED) |
---|
| 162 | + { |
---|
| 163 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 164 | + cloneSupportItem.addActionListener(this); |
---|
| 165 | + } |
---|
| 166 | + menu.add("-"); |
---|
| 167 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 168 | + cutItem.addActionListener(this); |
---|
| 169 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 170 | + copyItem.addActionListener(this); |
---|
| 171 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 172 | + pasteItem.addActionListener(this); |
---|
| 173 | + menu.add("-"); |
---|
| 174 | + |
---|
| 175 | + menu.add("-"); |
---|
| 176 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 177 | + pasteIntoItem.addActionListener(this); |
---|
| 178 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 179 | + pasteLinkItem.addActionListener(this); |
---|
| 180 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 181 | + pasteCloneItem.addActionListener(this); |
---|
| 182 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 183 | +// pasteExpandItem.addActionListener(this); |
---|
| 184 | + menu.add("-"); |
---|
| 185 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 186 | + clearItem.addActionListener(this); |
---|
| 187 | + |
---|
| 188 | + if (Globals.ADVANCED) |
---|
| 189 | + { |
---|
| 190 | + // Deletes the cameras... |
---|
| 191 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 192 | + clearAllItem.addActionListener(this); |
---|
| 193 | + } |
---|
| 194 | + |
---|
| 195 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 196 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 197 | + //zBufferItem.addActionListener(this); |
---|
| 198 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 199 | + //normalLensItem.addActionListener(this); |
---|
| 200 | + cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
| 201 | + revertCameraItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 204 | + toggleFullScreenItem.addItemListener(this); |
---|
| 205 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 206 | + cameraMenu.add("-"); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 209 | + toggleTextureItem.addItemListener(this); |
---|
| 210 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 211 | + |
---|
| 212 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 213 | + toggleSwitchItem.addItemListener(this); |
---|
| 214 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 215 | + |
---|
| 216 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 217 | + toggleHandleItem.addItemListener(this); |
---|
| 218 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 219 | + |
---|
| 220 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 221 | + togglePaintItem.addItemListener(this); |
---|
| 222 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 223 | + |
---|
| 224 | + if (Globals.ADVANCED) |
---|
| 225 | + { |
---|
| 226 | + cameraMenu.add("-"); |
---|
| 227 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 228 | + toggleLiveItem.addItemListener(this); |
---|
| 229 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 230 | + |
---|
| 231 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 232 | + stepItem.addActionListener(this); |
---|
| 233 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 234 | + // toggleDLItem.addItemListener(this); |
---|
| 235 | + // toggleDLItem.setState(false); |
---|
| 236 | + |
---|
| 237 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 238 | + toggleRenderItem.addItemListener(this); |
---|
| 239 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 240 | + |
---|
| 241 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 242 | + toggleDebugItem.addItemListener(this); |
---|
| 243 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 244 | + |
---|
| 245 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 246 | + toggleFrustumItem.addItemListener(this); |
---|
| 247 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 248 | + |
---|
| 249 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 250 | + toggleFootContactItem.addItemListener(this); |
---|
| 251 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 252 | + |
---|
| 253 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 254 | + toggleTimelineItem.addItemListener(this); |
---|
| 255 | + } |
---|
| 256 | + |
---|
| 257 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 258 | +// toggleRootItem.addItemListener(this); |
---|
| 259 | +// toggleRootItem.setState(false); |
---|
| 260 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 261 | +// animationItem.addItemListener(this); |
---|
| 262 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 263 | + cameraMenu.add("-"); |
---|
| 264 | + cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
| 265 | + editCameraItem.addActionListener(this); |
---|
| 266 | + |
---|
| 267 | + if (Globals.ADVANCED) |
---|
| 268 | + { |
---|
152 | 269 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 270 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 271 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 277 | lookAtItem.addActionListener(this); |
---|
161 | 278 | //lookFromItem.addActinoListener(this); |
---|
162 | 279 | //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); |
---|
| 280 | + } |
---|
| 281 | + |
---|
| 282 | + oe.menuBar.add(menu = new Menu("Setting")); |
---|
| 283 | + if (Globals.ADVANCED) |
---|
| 284 | + { |
---|
196 | 285 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
197 | 286 | revertMeshItem.addActionListener(this); |
---|
198 | 287 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
199 | 288 | resetreferencesItem.addActionListener(this); |
---|
200 | 289 | menu.add("-"); |
---|
| 290 | + } |
---|
201 | 291 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
202 | 292 | overwriteGeoItem.addActionListener(this); |
---|
203 | 293 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
209 | 299 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
210 | 300 | overwriteUVItem.addActionListener(this); |
---|
211 | 301 | menu.add("-"); |
---|
| 302 | + if (Globals.ADVANCED) |
---|
| 303 | + { |
---|
212 | 304 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
213 | 305 | generateMeshItem.addActionListener(this); |
---|
214 | 306 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
215 | 307 | poseMeshItem.addActionListener(this); |
---|
216 | 308 | menu.add("-"); |
---|
| 309 | + } |
---|
217 | 310 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
218 | 311 | resetsupportItem.addActionListener(this); |
---|
219 | 312 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
220 | 313 | linkverticesItem.addActionListener(this); |
---|
| 314 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 315 | + relinkverticesItem.addActionListener(this); |
---|
| 316 | + |
---|
| 317 | + if (Globals.ADVANCED) |
---|
| 318 | + { |
---|
221 | 319 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
222 | 320 | setMasterItem.addActionListener(this); |
---|
| 321 | + } |
---|
223 | 322 | |
---|
224 | | - oe.menuBar.add(menu = new Menu("Object")); |
---|
| 323 | + oe.menuBar.add(menu = new Menu("Group")); |
---|
225 | 324 | grabItem = menu.add(new MenuItem("Grab")); |
---|
226 | 325 | grabItem.addActionListener(this); |
---|
227 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
228 | | - frontItem.addActionListener(this); |
---|
229 | 326 | backItem = menu.add(new MenuItem("Back")); |
---|
230 | 327 | backItem.addActionListener(this); |
---|
| 328 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 329 | + frontItem.addActionListener(this); |
---|
231 | 330 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
232 | 331 | compositeItem.addActionListener(this); |
---|
| 332 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 333 | + hideItem.addActionListener(this); |
---|
| 334 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 335 | + ungroupItem.addActionListener(this); |
---|
233 | 336 | menu.add("-"); |
---|
234 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 337 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
235 | 338 | 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 | 339 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
241 | 340 | switchGeoItem.addActionListener(this); |
---|
242 | 341 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
243 | 342 | switchTransfoItem.addActionListener(this); |
---|
244 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 343 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
245 | 344 | morphItem.addActionListener(this); |
---|
| 345 | + |
---|
| 346 | + if (Globals.ADVANCED) |
---|
| 347 | + { |
---|
| 348 | + menu.add("-"); |
---|
| 349 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 350 | + physicsItem.addActionListener(this); |
---|
| 351 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 352 | + frameselectorItem.addActionListener(this); |
---|
246 | 353 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
247 | 354 | scriptNodeItem.addActionListener(this); |
---|
248 | 355 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
249 | 356 | cameraItem.addActionListener(this); |
---|
250 | | - menu.add("-"); |
---|
| 357 | + } |
---|
| 358 | + |
---|
| 359 | + oe.menuBar.add(menu = new Menu("Object")); |
---|
251 | 360 | textureItem = menu.add(new MenuItem("Texture")); |
---|
252 | 361 | textureItem.addActionListener(this); |
---|
| 362 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 363 | + billboardItem.addActionListener(this); |
---|
253 | 364 | csgItem = menu.add(new MenuItem("CSG")); |
---|
254 | 365 | csgItem.addActionListener(this); |
---|
255 | 366 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
258 | 369 | shadowYItem.addActionListener(this); |
---|
259 | 370 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
260 | 371 | shadowZItem.addActionListener(this); |
---|
| 372 | + if (Globals.ADVANCED) |
---|
| 373 | + { |
---|
| 374 | + menu.add("-"); |
---|
261 | 375 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
262 | 376 | linkerItem.addActionListener(this); |
---|
263 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
264 | | - templateItem.addActionListener(this); |
---|
265 | 377 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
266 | 378 | attributeItem.addActionListener(this); |
---|
| 379 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 380 | + templateItem.addActionListener(this); |
---|
267 | 381 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
268 | 382 | pointflowItem.addActionListener(this); |
---|
| 383 | + } |
---|
269 | 384 | menu.add("-"); |
---|
270 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
271 | | - transformgeometryItem.addActionListener(this); |
---|
272 | 385 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
273 | 386 | resetTransformItem.addActionListener(this); |
---|
274 | 387 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
275 | 388 | resetCentroidItem.addActionListener(this); |
---|
276 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
277 | | - ungroupItem.addActionListener(this); |
---|
| 389 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 390 | + resetCentroidXZItem.addActionListener(this); |
---|
| 391 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 392 | + transformGeometryItem.addActionListener(this); |
---|
| 393 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 394 | + transformChildrenItem.addActionListener(this); |
---|
278 | 395 | |
---|
279 | 396 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
280 | 397 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
283 | 400 | genNormalsORGANItem.addActionListener(this); |
---|
284 | 401 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
285 | 402 | genNormalsCADItem.addActionListener(this); |
---|
| 403 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 404 | + genNormalsMESHItem.addActionListener(this); |
---|
| 405 | + if (Globals.ADVANCED) |
---|
| 406 | + { |
---|
| 407 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 408 | + genNormalsMINEItem.addActionListener(this); |
---|
| 409 | + } |
---|
286 | 410 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
287 | 411 | stripifyItem.addActionListener(this); |
---|
288 | 412 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
292 | 416 | untrimItem = menu.add(new MenuItem("Untrim")); |
---|
293 | 417 | untrimItem.addActionListener(this); |
---|
294 | 418 | menu.add("-"); |
---|
295 | | - clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
296 | | - clearMaterialsItem.addActionListener(this); |
---|
297 | 419 | clearColorsItem = menu.add(new MenuItem("Clear AO")); |
---|
298 | 420 | clearColorsItem.addActionListener(this); |
---|
299 | 421 | reverseNormalsItem = menu.add(new MenuItem("Reverse Normals")); |
---|
.. | .. |
---|
306 | 428 | reduce34MeshItem.addActionListener(this); |
---|
307 | 429 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 430 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 431 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 432 | clipMeshItem.addActionListener(this); |
---|
| 433 | + |
---|
| 434 | + if (Globals.ADVANCED) |
---|
| 435 | + { |
---|
| 436 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 437 | + smoothMeshItem.addActionListener(this); |
---|
| 438 | + } |
---|
| 439 | + |
---|
| 440 | + oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 441 | + clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
| 442 | + clearMaterialsItem.addActionListener(this); |
---|
| 443 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 444 | + resetAllItem.addActionListener(this); |
---|
| 445 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 446 | + stepAllItem.addActionListener(this); |
---|
313 | 447 | menu.add("-"); |
---|
314 | 448 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
315 | 449 | liveleavesItem.addActionListener(this); |
---|
316 | 450 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
317 | 451 | unliveleavesItem.addActionListener(this); |
---|
| 452 | + if (Globals.ADVANCED) |
---|
| 453 | + { |
---|
318 | 454 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
319 | 455 | supportleavesItem.addActionListener(this); |
---|
320 | 456 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
321 | 457 | unsupportleavesItem.addActionListener(this); |
---|
| 458 | + } |
---|
322 | 459 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
323 | 460 | hideleavesItem.addActionListener(this); |
---|
324 | 461 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
332 | 469 | flipVItem.addActionListener(this); |
---|
333 | 470 | unflipVItem = menu.add(new MenuItem("Unflip V")); |
---|
334 | 471 | unflipVItem.addActionListener(this); |
---|
335 | | - lowTexturesItem = menu.add(new MenuItem("Low Texture")); |
---|
| 472 | + lowTexturesItem = menu.add(new MenuItem("Low Texture (256)")); |
---|
336 | 473 | lowTexturesItem.addActionListener(this); |
---|
337 | | - normalTexturesItem = menu.add(new MenuItem("Normal Texture")); |
---|
| 474 | + normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)")); |
---|
338 | 475 | normalTexturesItem.addActionListener(this); |
---|
339 | | - highTexturesItem = menu.add(new MenuItem("High Texture")); |
---|
| 476 | + highTexturesItem = menu.add(new MenuItem("High Texture (1024)")); |
---|
340 | 477 | highTexturesItem.addActionListener(this); |
---|
341 | | - veryhighTexturesItem = menu.add(new MenuItem("Very high Texture")); |
---|
| 478 | + veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)")); |
---|
342 | 479 | veryhighTexturesItem.addActionListener(this); |
---|
343 | | - maxTexturesItem = menu.add(new MenuItem("Max Texture")); |
---|
| 480 | + maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)")); |
---|
344 | 481 | maxTexturesItem.addActionListener(this); |
---|
345 | | - panoTexturesItem = menu.add(new MenuItem("Panoramic Texture")); |
---|
| 482 | + panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)")); |
---|
346 | 483 | 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 | 484 | |
---|
357 | 485 | oe.menuBar.add(menu = new Menu("Selection")); |
---|
358 | 486 | attachPigmentItem = menu.add(new MenuItem("Attach Pigment...")); |
---|
.. | .. |
---|
370 | 498 | sortbysizeItem.addActionListener(this); |
---|
371 | 499 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
372 | 500 | sortbynameItem.addActionListener(this); |
---|
| 501 | + menu.add("-"); |
---|
| 502 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 503 | + shareGeometriesItem.addActionListener(this); |
---|
| 504 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 505 | + mergeGeometriesItem.addActionListener(this); |
---|
| 506 | + if (Globals.ADVANCED) |
---|
| 507 | + { |
---|
| 508 | + // Pretty much the same as duplicate and clone. |
---|
| 509 | + extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
| 510 | + extractGeometriesItem.addActionListener(this); |
---|
| 511 | + cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
| 512 | + cloneGeometriesItem.addActionListener(this); |
---|
| 513 | + } |
---|
| 514 | + |
---|
373 | 515 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
374 | 516 | buildCreateMenu(menu); |
---|
375 | | - oe.menuBar.add(menu = new Menu("Tools")); |
---|
| 517 | + |
---|
| 518 | + oe.menuBar.add(menu = new Menu("Tools")); |
---|
376 | 519 | buildToolsMenu(menu); |
---|
377 | 520 | } |
---|
378 | 521 | |
---|
.. | .. |
---|
406 | 549 | oe.radioPanel.add(dummyButton); |
---|
407 | 550 | oe.buttonGroup.add(dummyButton); |
---|
408 | 551 | */ |
---|
409 | | - aConstraints.gridy += 1; |
---|
410 | | - oe.aConstraints.gridwidth = 1; |
---|
411 | | - oe.aConstraints.gridx = 0; |
---|
| 552 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
412 | 553 | |
---|
413 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 554 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 555 | + liveCB.setToolTipText("Enable animation"); |
---|
414 | 556 | liveCB.addItemListener(this); |
---|
415 | 557 | |
---|
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); |
---|
| 558 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 559 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 560 | + oneStepButton.addActionListener(this); |
---|
| 561 | + |
---|
| 562 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 563 | + fastCB.setToolTipText("Fast mode"); |
---|
434 | 564 | 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); |
---|
| 565 | + |
---|
| 566 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 567 | + trackCB.setToolTipText("Enable tracking"); |
---|
476 | 568 | trackCB.addItemListener(this); |
---|
477 | 569 | |
---|
478 | | - oe.aConstraints.gridx += 1; |
---|
479 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 570 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 571 | + screenfitButton.setToolTipText("Screen fit"); |
---|
480 | 572 | screenfitButton.addActionListener(this); |
---|
481 | | - oe.aConstraints.gridx += 1; |
---|
| 573 | + |
---|
482 | 574 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
483 | 575 | // 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 | 576 | |
---|
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); |
---|
| 577 | + if (Globals.ADVANCED) |
---|
| 578 | + { |
---|
| 579 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + snapobjectButton.addActionListener(this); |
---|
| 581 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 582 | + } |
---|
| 583 | + |
---|
| 584 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 585 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
495 | 586 | flashSelectionButton.addActionListener(this); |
---|
496 | | - oe.aConstraints.gridx += 1; |
---|
497 | | - oe.aConstraints.weighty = 0; |
---|
498 | | - oe.aConstraints.gridwidth = 1; |
---|
499 | 587 | |
---|
500 | | - // |
---|
501 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 589 | + |
---|
| 590 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 591 | + twoButton.setToolTipText("Show center view only"); |
---|
502 | 592 | twoButton.addActionListener(this); |
---|
503 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 593 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 594 | fourButton.addActionListener(this); |
---|
505 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 595 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 596 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 597 | + sixButton.setToolTipText("2-column layout left"); |
---|
506 | 598 | sixButton.addActionListener(this); |
---|
507 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 599 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + threeButton.setToolTipText("2-column layout right"); |
---|
508 | 601 | threeButton.addActionListener(this); |
---|
509 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 602 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + sevenButton.setToolTipText("3-column layout"); |
---|
510 | 604 | sevenButton.addActionListener(this); |
---|
511 | 605 | // |
---|
512 | 606 | |
---|
513 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
514 | 609 | rootButton.addActionListener(this); |
---|
515 | | - oe.aConstraints.gridx += 1; |
---|
516 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + closeButton.setToolTipText("Close tab"); |
---|
517 | 613 | closeButton.addActionListener(this); |
---|
518 | 614 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
519 | 615 | //clearButton.addActionListener(this); |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | 616 | |
---|
522 | | - oe.aConstraints.gridx = 1; // |
---|
523 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 617 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 618 | + |
---|
| 619 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + editButton.setToolTipText("Edit selection"); |
---|
524 | 621 | editButton.addActionListener(this); |
---|
525 | | - oe.aConstraints.gridx += 1; |
---|
526 | | - oe.aConstraints.weighty = 0; |
---|
527 | | - oe.aConstraints.gridwidth = 1; |
---|
528 | 622 | |
---|
529 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 623 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + uneditButton.setToolTipText("Unedit selection"); |
---|
530 | 625 | uneditButton.addActionListener(this); |
---|
531 | 626 | |
---|
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); |
---|
| 627 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 628 | + allParamsButton.setToolTipText("Edit all params"); |
---|
544 | 629 | allParamsButton.addActionListener(this); |
---|
545 | 630 | |
---|
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); |
---|
| 631 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 633 | + clearPanelButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + unselectButton.setToolTipText("Unselect"); |
---|
551 | 637 | unselectButton.addActionListener(this); |
---|
552 | 638 | |
---|
| 639 | + commandsPanel.preferredHeight = 1; |
---|
| 640 | + |
---|
| 641 | + oe.treePanel.add(commandsPanel); |
---|
| 642 | + oe.treePanel.Return(); |
---|
| 643 | + |
---|
553 | 644 | // oe.aConstraints.gridx += 1; |
---|
554 | 645 | // oe.aConstraints.weighty = 0; |
---|
555 | 646 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
561 | 652 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
562 | 653 | // gcButton.addActionListener(this); |
---|
563 | 654 | |
---|
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; |
---|
| 655 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 656 | + |
---|
| 657 | + JScrollPane jSP; |
---|
575 | 658 | //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); |
---|
| 659 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
577 | 660 | ResetModel(); |
---|
578 | | - oe.aConstraints.weighty = 0.5; |
---|
579 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
580 | | - oe.aConstraints.gridy += 1; |
---|
581 | | - oe.aConstraints.gridwidth = 1; |
---|
| 661 | + |
---|
| 662 | + oe.treePanel.add(jSPPanel); |
---|
| 663 | + oe.treePanel.Return(); |
---|
582 | 664 | |
---|
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); |
---|
| 665 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 666 | + |
---|
| 667 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 668 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
587 | 669 | colorCB.addItemListener(this); |
---|
588 | | - oe.aConstraints.gridx += 2; |
---|
589 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 670 | + |
---|
| 671 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 672 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
590 | 673 | materialCB.addItemListener(this); |
---|
591 | | - oe.aConstraints.gridx += 2; |
---|
592 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 674 | + |
---|
| 675 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 676 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
593 | 677 | textureCB.addItemListener(this); |
---|
594 | 678 | |
---|
595 | | - oe.aConstraints.gridx = 0; |
---|
596 | | - oe.aConstraints.gridy += 1; |
---|
| 679 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 680 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 681 | + oe.treePanel.Return(); |
---|
597 | 682 | |
---|
| 683 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 684 | +// mainPanel.setResizeWeight(0.5); |
---|
| 685 | + |
---|
598 | 686 | //jList.addListSelectionListener(this); |
---|
599 | 687 | oe.jTree.addTreeSelectionListener(this); |
---|
600 | 688 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
616 | 704 | radio.layout = sevenButton; |
---|
617 | 705 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
618 | 706 | } |
---|
| 707 | + |
---|
| 708 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 709 | + { |
---|
| 710 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 711 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 712 | + boxCB.addItemListener(this); |
---|
| 713 | + |
---|
| 714 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 715 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 716 | + zoomBoxCB.addItemListener(this); |
---|
| 717 | + |
---|
| 718 | + if (true) // Globals.ADVANCED) |
---|
| 719 | + { |
---|
| 720 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 721 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 722 | + supportCB.addItemListener(this); |
---|
| 723 | + |
---|
| 724 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 725 | + // localCB.addItemListener(this); |
---|
| 726 | + |
---|
| 727 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 728 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 729 | + crowdCB.addItemListener(this); |
---|
| 730 | + |
---|
| 731 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 732 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 733 | + smoothCB.addItemListener(this); |
---|
| 734 | + |
---|
| 735 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 736 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 737 | + slowCB.addItemListener(this); |
---|
| 738 | + |
---|
| 739 | +// constraints.gridy += 1; |
---|
| 740 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 741 | +// speakerMocapCB.addItemListener(this); |
---|
| 742 | + |
---|
| 743 | + if (false) |
---|
| 744 | + { |
---|
| 745 | + // handled in scripts |
---|
| 746 | + //constraints.gridy += 1; |
---|
| 747 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 748 | + speakerCameraCB.addItemListener(this); |
---|
| 749 | + |
---|
| 750 | + //constraints.gridy += 1; |
---|
| 751 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 752 | + speakerFocusCB.addItemListener(this); |
---|
| 753 | + |
---|
| 754 | + //constraints.gridy += 1; |
---|
| 755 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 756 | + smoothfocusCB.addItemListener(this); |
---|
| 757 | + } |
---|
| 758 | + |
---|
| 759 | +//constraints.gridx += 1; |
---|
| 760 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 761 | +// debugCB.addItemListener(this); |
---|
| 762 | + |
---|
| 763 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 764 | + oeilCB.addItemListener(this); |
---|
| 765 | + |
---|
| 766 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 767 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 768 | + lookAtCB.addItemListener(this); |
---|
| 769 | + |
---|
| 770 | + } |
---|
| 771 | + |
---|
| 772 | + cGridBag fill = new cGridBag(); |
---|
| 773 | + |
---|
| 774 | + fill.preferredHeight = 200; |
---|
| 775 | + |
---|
| 776 | + panel.add(fill); |
---|
| 777 | + |
---|
| 778 | + } |
---|
619 | 779 | |
---|
620 | 780 | void EditObject(Object3D obj) |
---|
621 | 781 | { |
---|
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(); |
---|
| 782 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 783 | + radioButton.SetObject(obj); |
---|
| 784 | + radioButton.layout = sevenButton; |
---|
| 785 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 786 | + radioButton.addActionListener(this); |
---|
| 787 | + radioPanel.add(radioButton); |
---|
| 788 | + buttonGroup.add(radioButton); |
---|
| 789 | + radioButton.doClick(); |
---|
630 | 790 | } |
---|
| 791 | + |
---|
631 | 792 | void SetupViews(ObjEditor oe) |
---|
632 | 793 | { |
---|
633 | 794 | oe.SetupViews(); |
---|
.. | .. |
---|
646 | 807 | JCheckBox fastCB; |
---|
647 | 808 | JCheckBox slowCB; |
---|
648 | 809 | JCheckBox boxCB; |
---|
| 810 | + JCheckBox zoomBoxCB; |
---|
649 | 811 | JCheckBox trackCB; |
---|
650 | 812 | JCheckBox smoothfocusCB; |
---|
651 | 813 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
688 | 850 | dropAttributes |= Object3D.TEXTURE; |
---|
689 | 851 | else |
---|
690 | 852 | dropAttributes &= ~Object3D.TEXTURE; |
---|
691 | | - } |
---|
692 | | - else if(e.getSource() == liveCB) |
---|
| 853 | + } else if(e.getSource() == liveCB) |
---|
693 | 854 | { |
---|
694 | 855 | cameraView.ToggleLive(); |
---|
695 | 856 | } |
---|
.. | .. |
---|
726 | 887 | Recompile(); |
---|
727 | 888 | cameraView.repaint(); |
---|
728 | 889 | // refreshContents(); |
---|
| 890 | + } |
---|
| 891 | + else if(e.getSource() == zoomBoxCB) |
---|
| 892 | + { |
---|
| 893 | + cameraView.ToggleZoomBoxMode(); |
---|
729 | 894 | } |
---|
730 | 895 | else if(e.getSource() == smoothfocusCB) |
---|
731 | 896 | { |
---|
.. | .. |
---|
840 | 1005 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
841 | 1006 | // return; |
---|
842 | 1007 | // } |
---|
843 | | - if (string.charAt(0) == '/') |
---|
| 1008 | + |
---|
| 1009 | + // File path for Mac and Windows |
---|
| 1010 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
844 | 1011 | { |
---|
845 | 1012 | // file(s) |
---|
846 | 1013 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
867 | 1034 | |
---|
868 | 1035 | flashIt = false; |
---|
869 | 1036 | CameraPane pane = (CameraPane) target; |
---|
870 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1037 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
871 | 1038 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
872 | 1039 | |
---|
873 | 1040 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
894 | 1061 | { |
---|
895 | 1062 | loadClipboard(true); |
---|
896 | 1063 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
897 | | - pasteInto(false); |
---|
| 1064 | + pasteInto(false, false); |
---|
898 | 1065 | } else { |
---|
899 | 1066 | loadClipboard(false); |
---|
900 | 1067 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
901 | | - pasteInto(false); // true); // ??? |
---|
| 1068 | + pasteInto(false, false); // true); // ??? |
---|
902 | 1069 | } |
---|
903 | 1070 | } |
---|
904 | 1071 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1002 | 1169 | |
---|
1003 | 1170 | void buildCreateMenu(Menu menu) |
---|
1004 | 1171 | { |
---|
| 1172 | + //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
| 1173 | + //heightFieldItem.addActionListener(this); |
---|
1005 | 1174 | gridItem = menu.add(new MenuItem("Grid")); |
---|
1006 | 1175 | gridItem.addActionListener(this); |
---|
1007 | 1176 | rectoidItem = menu.add(new MenuItem("Box")); |
---|
.. | .. |
---|
1014 | 1183 | torusItem.addActionListener(this); |
---|
1015 | 1184 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1016 | 1185 | superItem.addActionListener(this); |
---|
| 1186 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1187 | + kleinItem.addActionListener(this); |
---|
1017 | 1188 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1018 | 1189 | particleItem.addActionListener(this); |
---|
| 1190 | + if (Globals.ADVANCED) |
---|
| 1191 | + { |
---|
1019 | 1192 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1020 | 1193 | ragdollItem.addActionListener(this); |
---|
1021 | 1194 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1022 | 1195 | ragdoll2Item.addActionListener(this); |
---|
| 1196 | + } |
---|
1023 | 1197 | menu.add("-"); |
---|
1024 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1198 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1025 | 1199 | meshItem.addActionListener(this); |
---|
1026 | 1200 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1027 | 1201 | // meshGroupItem.addActionListener(this); |
---|
| 1202 | + if (Globals.ADVANCED) |
---|
| 1203 | + { |
---|
1028 | 1204 | springItem = menu.add(new MenuItem("Spring")); |
---|
1029 | 1205 | springItem.addActionListener(this); |
---|
1030 | 1206 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1031 | 1207 | 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 | 1208 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1037 | 1209 | blobItem.addActionListener(this); |
---|
1038 | 1210 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1039 | 1211 | latheItem.addActionListener(this); |
---|
| 1212 | + } |
---|
| 1213 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1214 | + bezierItem.addActionListener(this); |
---|
| 1215 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1216 | + overlayItem.addActionListener(this); |
---|
1040 | 1217 | lightItem = menu.add(new MenuItem("Light")); |
---|
1041 | 1218 | lightItem.addActionListener(this); |
---|
1042 | 1219 | menu.add("-"); |
---|
.. | .. |
---|
1046 | 1223 | loopItem.addActionListener(this); |
---|
1047 | 1224 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1048 | 1225 | doubleItem.addActionListener(this); |
---|
| 1226 | + if (Globals.ADVANCED) |
---|
| 1227 | + { |
---|
1049 | 1228 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1050 | 1229 | 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); |
---|
| 1230 | + } |
---|
1060 | 1231 | } |
---|
1061 | 1232 | |
---|
1062 | 1233 | void buildToolsMenu(Menu menu) |
---|
1063 | 1234 | { |
---|
1064 | 1235 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1065 | 1236 | animationItem.addItemListener(this); |
---|
1066 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1237 | + animationItem.setState(Globals.ANIMATION); |
---|
1067 | 1238 | |
---|
1068 | 1239 | menu.add("-"); |
---|
1069 | 1240 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1070 | 1241 | parseverticesItem.addActionListener(this); |
---|
1071 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1242 | + textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
| 1243 | + textureFieldItem.addActionListener(this); |
---|
| 1244 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1072 | 1245 | alignItem.addActionListener(this); |
---|
1073 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1074 | | - mirrorItem.addActionListener(this); |
---|
1075 | 1246 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1076 | 1247 | reduceMorphItem.addActionListener(this); |
---|
1077 | 1248 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1078 | 1249 | reduce34MorphItem.addActionListener(this); |
---|
1079 | | - |
---|
| 1250 | + menu.add("-"); |
---|
1080 | 1251 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1081 | 1252 | computeAOItem.addActionListener(this); |
---|
1082 | | - menu.add("-"); |
---|
1083 | 1253 | |
---|
| 1254 | + if (Globals.ADVANCED) |
---|
| 1255 | + { |
---|
| 1256 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1257 | + mirrorItem.addActionListener(this); |
---|
| 1258 | + menu.add("-"); |
---|
1084 | 1259 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1085 | 1260 | memoryItem.addActionListener(this); |
---|
1086 | 1261 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1094 | 1269 | resetParentItem.addActionListener(this); |
---|
1095 | 1270 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1096 | 1271 | repairParentItem.addActionListener(this); |
---|
| 1272 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1273 | + repairShadowItem.addActionListener(this); |
---|
1097 | 1274 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1098 | 1275 | invariantsItem.addActionListener(this); |
---|
1099 | 1276 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1101 | 1278 | menu.add("-"); |
---|
1102 | 1279 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1103 | 1280 | editScriptItem.addActionListener(this); |
---|
| 1281 | + } |
---|
1104 | 1282 | } |
---|
1105 | 1283 | |
---|
1106 | 1284 | void ScreenFit() |
---|
.. | .. |
---|
1429 | 1607 | |
---|
1430 | 1608 | void Overwrite(int mask) |
---|
1431 | 1609 | { |
---|
1432 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1610 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1433 | 1611 | { |
---|
1434 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1612 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1435 | 1613 | |
---|
1436 | 1614 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1437 | 1615 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1454 | 1632 | // |
---|
1455 | 1633 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1456 | 1634 | { |
---|
| 1635 | + Object source = event.getSource(); |
---|
1457 | 1636 | /* |
---|
1458 | 1637 | if (event.getSource() == nameField) |
---|
1459 | 1638 | { |
---|
.. | .. |
---|
1465 | 1644 | } |
---|
1466 | 1645 | else |
---|
1467 | 1646 | */ |
---|
1468 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1647 | + if (source == lookAtItem || source == lookFromItem) |
---|
1469 | 1648 | { |
---|
1470 | 1649 | ScreenFit(); |
---|
1471 | 1650 | } else |
---|
1472 | | - if (event.getSource() == switchItem) |
---|
| 1651 | + if (source == switchItem) |
---|
1473 | 1652 | { |
---|
1474 | 1653 | cVector v1 = new cVector(); |
---|
1475 | 1654 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1478 | 1657 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1479 | 1658 | objEditor.cameraView.repaint(); |
---|
1480 | 1659 | } else |
---|
1481 | | - if (event.getSource() == rectoidItem) |
---|
| 1660 | + if (source == rectoidItem) |
---|
1482 | 1661 | { |
---|
1483 | 1662 | makeSomething(new Box()); |
---|
1484 | 1663 | } else |
---|
1485 | | - if (event.getSource() == particleItem) |
---|
| 1664 | + if (source == particleItem) |
---|
1486 | 1665 | { |
---|
1487 | 1666 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1488 | 1667 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1503 | 1682 | applyExample(particleGeom, "SMOKE"); |
---|
1504 | 1683 | makeSomething(particleGeom); |
---|
1505 | 1684 | } else |
---|
1506 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1685 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1507 | 1686 | { |
---|
1508 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1687 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1509 | 1688 | |
---|
1510 | 1689 | ragdoll.toParent = LA.newMatrix(); |
---|
1511 | 1690 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1521 | 1700 | makeSomething(ragdoll); |
---|
1522 | 1701 | //makeSomething(new VehicleDemo()); |
---|
1523 | 1702 | } else |
---|
1524 | | - if (event.getSource() == gridItem) |
---|
| 1703 | + /* |
---|
| 1704 | + */ |
---|
| 1705 | + if (source == heightFieldItem) |
---|
| 1706 | + { |
---|
| 1707 | + Object3D obj = new Object3D(); |
---|
| 1708 | + |
---|
| 1709 | + obj.CreateMaterial(); |
---|
| 1710 | + obj.bRep = new BoundaryRep(); |
---|
| 1711 | + |
---|
| 1712 | + obj.bRep.CreateMesh(new iHeightField() |
---|
| 1713 | + { |
---|
| 1714 | + public double f(double x, double y) |
---|
| 1715 | + { |
---|
| 1716 | + // The Mandelbrot set is represented by coloring |
---|
| 1717 | + // each point (x,y) according to the number of |
---|
| 1718 | + // iterations it takes before the while loop in |
---|
| 1719 | + // this method ends. For points that are actually |
---|
| 1720 | + // in the Mandelbrot set, or very close to it, the |
---|
| 1721 | + // count will reach the maximum value, 80. These |
---|
| 1722 | + // points will be colored purple. All other colors |
---|
| 1723 | + // represent points that are definitely NOT in the set. |
---|
| 1724 | + x -= 600; |
---|
| 1725 | + y -= 500; |
---|
| 1726 | + x /= 200; |
---|
| 1727 | + y /= 200; |
---|
| 1728 | + int count = 0; |
---|
| 1729 | + double zx = x; |
---|
| 1730 | + double zy = y; |
---|
| 1731 | + while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) { |
---|
| 1732 | + double new_zx = zx*zx - zy*zy + x; |
---|
| 1733 | + zy = 2*zx*zy + y; |
---|
| 1734 | + zx = new_zx; |
---|
| 1735 | + count++; |
---|
| 1736 | + } |
---|
| 1737 | + return count; // Math.sqrt(count); |
---|
| 1738 | + } |
---|
| 1739 | + }, 1000,1000); |
---|
| 1740 | + |
---|
| 1741 | + makeSomething(obj); |
---|
| 1742 | + } else |
---|
| 1743 | + if (source == gridItem) |
---|
1525 | 1744 | { |
---|
1526 | 1745 | makeSomething(new Grid()); |
---|
1527 | 1746 | } else |
---|
1528 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1747 | + if (source == ellipsoidItem) |
---|
1529 | 1748 | { |
---|
1530 | 1749 | makeSomething(new Sphere()); |
---|
1531 | 1750 | } else |
---|
1532 | | - if (event.getSource() == coneItem) |
---|
| 1751 | + if (source == coneItem) |
---|
1533 | 1752 | { |
---|
1534 | 1753 | makeSomething(new Cone()); |
---|
1535 | 1754 | } else |
---|
1536 | | - if (event.getSource() == torusItem) |
---|
| 1755 | + if (source == torusItem) |
---|
1537 | 1756 | { |
---|
1538 | 1757 | makeSomething(new Torus()); |
---|
1539 | 1758 | } else |
---|
1540 | | - if (event.getSource() == superItem) |
---|
| 1759 | + if (source == superItem) |
---|
1541 | 1760 | { |
---|
1542 | 1761 | makeSomething(new Superellipsoid()); |
---|
1543 | 1762 | } else |
---|
1544 | | - if (event.getSource() == blobItem) |
---|
| 1763 | + if (source == kleinItem) |
---|
| 1764 | + { |
---|
| 1765 | + makeSomething(new Klein()); |
---|
| 1766 | + } else |
---|
| 1767 | + if (source == blobItem) |
---|
1545 | 1768 | { |
---|
1546 | 1769 | Blob blob = new Blob(); |
---|
1547 | 1770 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1549 | 1772 | //blob.retile(); |
---|
1550 | 1773 | makeSomething(blob); |
---|
1551 | 1774 | } else |
---|
1552 | | - if (event.getSource() == latheItem) |
---|
| 1775 | + if (source == latheItem) |
---|
1553 | 1776 | { |
---|
1554 | 1777 | makeSomething(new Lathe()); |
---|
1555 | 1778 | } else |
---|
1556 | | - if (event.getSource() == bezierItem) |
---|
| 1779 | + if (source == bezierItem) |
---|
1557 | 1780 | { |
---|
1558 | 1781 | makeSomething(new BezierSurface()); |
---|
1559 | 1782 | } else |
---|
1560 | | - if (event.getSource() == checkerItem) |
---|
| 1783 | + if (source == overlayItem) |
---|
1561 | 1784 | { |
---|
1562 | 1785 | /* |
---|
1563 | 1786 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1570 | 1793 | LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent); |
---|
1571 | 1794 | LA.matInvert(obj.toParent, obj.fromParent); |
---|
1572 | 1795 | */ |
---|
1573 | | - makeSomething(new CheckerIG()); |
---|
| 1796 | + makeSomething(new Checker()); |
---|
1574 | 1797 | } else |
---|
1575 | | - if (event.getSource() == meshItem) |
---|
| 1798 | + if (source == meshItem) |
---|
1576 | 1799 | { |
---|
1577 | 1800 | Object3D itemtomake = new Object3D(); |
---|
1578 | 1801 | Object3D child; |
---|
.. | .. |
---|
1593 | 1816 | makeSomething(child); |
---|
1594 | 1817 | } |
---|
1595 | 1818 | } else |
---|
1596 | | - if (event.getSource() == springItem) |
---|
| 1819 | + if (source == springItem) |
---|
1597 | 1820 | { |
---|
1598 | 1821 | cSpring s = new cSpring(); |
---|
1599 | 1822 | s.setup(); |
---|
1600 | 1823 | makeSomething(s); |
---|
1601 | 1824 | } else |
---|
1602 | | - if (event.getSource() == flagItem) |
---|
| 1825 | + if (source == flagItem) |
---|
1603 | 1826 | { |
---|
1604 | 1827 | cSpring s = new cFlag(); |
---|
1605 | 1828 | s.setup(); |
---|
1606 | 1829 | makeSomething(s); |
---|
1607 | 1830 | } else |
---|
1608 | | - if (event.getSource() == lightItem) |
---|
| 1831 | + if (source == lightItem) |
---|
1609 | 1832 | { |
---|
1610 | 1833 | makeSomething(new Light()); |
---|
1611 | 1834 | } else |
---|
1612 | | - if (event.getSource() == csgItem) |
---|
| 1835 | + if (source == csgItem) |
---|
1613 | 1836 | { |
---|
1614 | 1837 | group(new CSG()); |
---|
1615 | 1838 | } else |
---|
1616 | | - if (event.getSource() == templateItem) |
---|
| 1839 | + if (source == templateItem) |
---|
1617 | 1840 | { |
---|
1618 | 1841 | group(new cTemplate()); |
---|
1619 | 1842 | } else |
---|
1620 | | - if (event.getSource() == attributeItem) |
---|
| 1843 | + if (source == attributeItem) |
---|
1621 | 1844 | { |
---|
1622 | 1845 | makeSomething(new Attribute()); |
---|
1623 | 1846 | } else |
---|
1624 | | - if (event.getSource() == pointflowItem) |
---|
| 1847 | + if (source == pointflowItem) |
---|
1625 | 1848 | { |
---|
1626 | 1849 | makeSomething(new PointFlow()); |
---|
1627 | 1850 | } else |
---|
.. | .. |
---|
1633 | 1856 | } else |
---|
1634 | 1857 | */ |
---|
1635 | 1858 | |
---|
1636 | | - if (event.getSource() == superLoopItem) |
---|
| 1859 | + if (source == superLoopItem) |
---|
1637 | 1860 | { |
---|
1638 | 1861 | Composite g = new cGroup(); |
---|
1639 | 1862 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1655 | 1878 | |
---|
1656 | 1879 | group(g); |
---|
1657 | 1880 | } else |
---|
1658 | | - if (event.getSource() == loopItem) |
---|
| 1881 | + if (source == loopItem) |
---|
1659 | 1882 | { |
---|
1660 | 1883 | Composite csg = new GroupLeaf(); |
---|
1661 | 1884 | csg.count = 5; |
---|
.. | .. |
---|
1664 | 1887 | csg.addChild(child); |
---|
1665 | 1888 | child.addChild(csg); |
---|
1666 | 1889 | } else |
---|
1667 | | - if (event.getSource() == doubleItem) |
---|
| 1890 | + if (source == doubleItem) |
---|
1668 | 1891 | { |
---|
1669 | 1892 | Composite csg = new GroupLeaf(); |
---|
1670 | 1893 | csg.count = 5; |
---|
.. | .. |
---|
1676 | 1899 | csg.addChild(child); |
---|
1677 | 1900 | child.addChild(csg); |
---|
1678 | 1901 | } else |
---|
1679 | | - if (event.getSource() == tripleItem) |
---|
| 1902 | + if (source == tripleItem) |
---|
1680 | 1903 | { |
---|
1681 | 1904 | Composite csg = new GroupLeaf(); |
---|
1682 | 1905 | csg.count = 4; |
---|
.. | .. |
---|
1691 | 1914 | csg.addChild(child); |
---|
1692 | 1915 | child.addChild(csg); |
---|
1693 | 1916 | } else |
---|
1694 | | - |
---|
1695 | | - if (event.getSource() == importGFDItem) |
---|
| 1917 | + if (source == computeAOItem) |
---|
1696 | 1918 | { |
---|
1697 | | - ImportGFD(); |
---|
| 1919 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1920 | + Globals.theRenderer.repaint(); |
---|
1698 | 1921 | } 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) |
---|
| 1922 | + if (source == recompileItem) |
---|
1717 | 1923 | { |
---|
1718 | 1924 | Recompile(); |
---|
1719 | 1925 | refreshContents(); |
---|
1720 | 1926 | } else |
---|
1721 | | - if (event.getSource() == editScriptItem) |
---|
| 1927 | + if (source == editScriptItem) |
---|
1722 | 1928 | { |
---|
1723 | 1929 | OpenDialog(); |
---|
1724 | 1930 | refreshContents(); |
---|
1725 | 1931 | } else |
---|
1726 | | - if (event.getSource() == invariantsItem) |
---|
| 1932 | + if (source == invariantsItem) |
---|
1727 | 1933 | { |
---|
1728 | 1934 | System.out.println("Invariants:"); |
---|
1729 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1935 | + Grafreed.grafreeD.universe.invariants(); |
---|
1730 | 1936 | } else |
---|
1731 | | - if (event.getSource() == memoryItem) |
---|
| 1937 | + if (source == memoryItem) |
---|
1732 | 1938 | { |
---|
1733 | 1939 | //System.out.println("Invariants:"); |
---|
1734 | 1940 | PrintMemory(); |
---|
1735 | 1941 | } else |
---|
1736 | | - if (event.getSource() == pathItem) |
---|
| 1942 | + if (source == pathItem) |
---|
1737 | 1943 | { |
---|
1738 | 1944 | PrintPath(); |
---|
1739 | 1945 | } else |
---|
1740 | | - if (event.getSource() == analyzeItem) |
---|
| 1946 | + if (source == analyzeItem) |
---|
1741 | 1947 | { |
---|
1742 | 1948 | AnalyzeObject(); |
---|
1743 | 1949 | } else |
---|
1744 | | - if (event.getSource() == dumpItem) |
---|
| 1950 | + if (source == dumpItem) |
---|
1745 | 1951 | { |
---|
1746 | 1952 | DumpObject(); |
---|
1747 | 1953 | } else |
---|
1748 | | - if (event.getSource() == screenfitButton) |
---|
| 1954 | + if (source == oneStepButton) |
---|
| 1955 | + { |
---|
| 1956 | + Globals.ONESTEP = true; |
---|
| 1957 | + cameraView.repaint(); |
---|
| 1958 | + } else |
---|
| 1959 | + if (source == screenfitButton) |
---|
1749 | 1960 | { |
---|
1750 | 1961 | //Reload(lastConverter, lastFilename, true); |
---|
1751 | 1962 | ScreenFit(); |
---|
1752 | 1963 | } else |
---|
1753 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1964 | + if (source == screenfitpointButton) |
---|
1754 | 1965 | { |
---|
1755 | 1966 | //Reload(lastConverter, lastFilename, true); |
---|
1756 | 1967 | ScreenFitPoint(); |
---|
1757 | 1968 | } else |
---|
1758 | | - if (event.getSource() == snapobjectButton) |
---|
| 1969 | + if (source == snapobjectButton) |
---|
1759 | 1970 | { |
---|
1760 | 1971 | //Reload(lastConverter, lastFilename, true); |
---|
1761 | 1972 | SnapObject(); |
---|
.. | .. |
---|
1766 | 1977 | // Recompile(); |
---|
1767 | 1978 | // refreshContents(); |
---|
1768 | 1979 | // } else |
---|
1769 | | - if (event.getSource() == gcButton) |
---|
| 1980 | + if (source == gcButton) |
---|
1770 | 1981 | { |
---|
1771 | 1982 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1772 | 1983 | System.gc(); |
---|
1773 | 1984 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1774 | 1985 | } else |
---|
1775 | | - if (event.getSource() == editLeafItem) |
---|
| 1986 | + if (source == editLeafItem) |
---|
1776 | 1987 | { |
---|
1777 | 1988 | Object3D obj; |
---|
1778 | 1989 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1786 | 1997 | } |
---|
1787 | 1998 | refreshContents(true); |
---|
1788 | 1999 | } else |
---|
1789 | | - if (event.getSource() == openWindowItem) |
---|
| 2000 | + if (source == openWindowItem) |
---|
1790 | 2001 | { |
---|
1791 | 2002 | EditSelection(true); |
---|
1792 | 2003 | } else |
---|
1793 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2004 | + if (source == cutItem || source == clearButton) |
---|
1794 | 2005 | { |
---|
1795 | 2006 | loadClipboard(true); |
---|
1796 | 2007 | } else |
---|
1797 | | - if (event.getSource() == duplicateItem) |
---|
| 2008 | + if (source == duplicateItem) |
---|
1798 | 2009 | { |
---|
1799 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 2010 | + Object3D keep = Grafreed.clipboard; |
---|
1800 | 2011 | loadClipboard(false); |
---|
1801 | 2012 | paste(false); |
---|
1802 | | - GraphreeD.clipboard = keep; |
---|
| 2013 | + Grafreed.clipboard = keep; |
---|
1803 | 2014 | } else |
---|
1804 | | - if (event.getSource() == cloneItem) |
---|
| 2015 | + if (source == cloneItem) |
---|
1805 | 2016 | { |
---|
1806 | 2017 | CloneSelection(false); |
---|
1807 | 2018 | } else |
---|
1808 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2019 | + if (source == cloneSupportItem) |
---|
1809 | 2020 | { |
---|
1810 | 2021 | CloneSelection(true); |
---|
1811 | 2022 | } else |
---|
1812 | | - if (event.getSource() == copyItem) |
---|
| 2023 | + if (source == copyItem) |
---|
1813 | 2024 | { |
---|
1814 | 2025 | loadClipboard(false); |
---|
1815 | 2026 | } else |
---|
1816 | | - if (event.getSource() == pasteItem) |
---|
| 2027 | + if (source == pasteItem) |
---|
1817 | 2028 | { |
---|
1818 | 2029 | paste(false); |
---|
1819 | 2030 | } else |
---|
1820 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2031 | + if (source == pasteIntoItem) |
---|
1821 | 2032 | { |
---|
1822 | | - pasteInto(false); |
---|
| 2033 | + pasteInto(true, false); |
---|
1823 | 2034 | } else |
---|
1824 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2035 | + if (source == pasteLinkItem) |
---|
1825 | 2036 | { |
---|
1826 | | - pasteInto(true); |
---|
| 2037 | + pasteInto(false, false); |
---|
1827 | 2038 | } else |
---|
1828 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2039 | + if (source == pasteCloneItem) |
---|
| 2040 | + { |
---|
| 2041 | + pasteInto(true, true); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == pasteExpandItem) |
---|
1829 | 2044 | { |
---|
1830 | 2045 | paste(true); |
---|
1831 | 2046 | } else |
---|
1832 | | - if (event.getSource() == synchronizeItem) |
---|
| 2047 | + if (source == synchronizeItem) |
---|
1833 | 2048 | { |
---|
1834 | 2049 | Overwrite(Object3D.TRANSFORM); |
---|
1835 | 2050 | } else |
---|
1836 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2051 | + if (source == overwriteNameItem) |
---|
1837 | 2052 | { |
---|
1838 | 2053 | Overwrite(Object3D.NAME); |
---|
1839 | 2054 | } else |
---|
1840 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2055 | + if (source == overwriteUVItem) |
---|
1841 | 2056 | { |
---|
1842 | 2057 | Overwrite(Object3D.UV); |
---|
1843 | 2058 | } else |
---|
1844 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2059 | + if (source == overwriteMatItem) |
---|
1845 | 2060 | { |
---|
| 2061 | + /* july 2015 |
---|
1846 | 2062 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1847 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2063 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1848 | 2064 | else |
---|
1849 | 2065 | { |
---|
1850 | 2066 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1856 | 2072 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1857 | 2073 | } |
---|
1858 | 2074 | } |
---|
| 2075 | + */ |
---|
| 2076 | + |
---|
| 2077 | + Overwrite(dropAttributes); |
---|
1859 | 2078 | } |
---|
1860 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2079 | + if (source == overwriteGeoItem) |
---|
1861 | 2080 | { |
---|
1862 | 2081 | Overwrite(Object3D.GEOMETRY); |
---|
1863 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2082 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1864 | 2083 | // { |
---|
1865 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2084 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1866 | 2085 | // |
---|
1867 | 2086 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1868 | 2087 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1874 | 2093 | // refreshContents(); |
---|
1875 | 2094 | // } |
---|
1876 | 2095 | } else |
---|
1877 | | - if (event.getSource() == generateMeshItem) |
---|
| 2096 | + if (source == generateMeshItem) |
---|
1878 | 2097 | { |
---|
1879 | 2098 | //if (group.selection.size() == 1) |
---|
1880 | 2099 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1885 | 2104 | ResetModel(); |
---|
1886 | 2105 | refreshContents(); |
---|
1887 | 2106 | } else |
---|
1888 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2107 | + if (source == extractGeometriesItem) |
---|
1889 | 2108 | { |
---|
1890 | 2109 | boolean one = false; |
---|
1891 | 2110 | |
---|
.. | .. |
---|
1912 | 2131 | ResetModel(); |
---|
1913 | 2132 | refreshContents(); |
---|
1914 | 2133 | } else |
---|
1915 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2134 | + if (source == cloneGeometriesItem) |
---|
1916 | 2135 | { |
---|
1917 | 2136 | boolean one = false; |
---|
1918 | 2137 | |
---|
.. | .. |
---|
1938 | 2157 | ResetModel(); |
---|
1939 | 2158 | refreshContents(); |
---|
1940 | 2159 | } else |
---|
1941 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2160 | + if (source == shareGeometriesItem) |
---|
1942 | 2161 | { |
---|
1943 | 2162 | boolean one = false; |
---|
1944 | 2163 | |
---|
1945 | 2164 | if (group.selection.size() == 1) |
---|
1946 | 2165 | one = true; |
---|
1947 | 2166 | |
---|
| 2167 | + Object3D merge = null; |
---|
| 2168 | + |
---|
1948 | 2169 | Object3D content = new cGroup(); |
---|
1949 | 2170 | |
---|
1950 | 2171 | for (int i=0; i<group.selection.size(); i++) |
---|
1951 | 2172 | { |
---|
1952 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2173 | + merge = new Merge(group.selection.get(i)); |
---|
1953 | 2174 | |
---|
1954 | 2175 | if (one) |
---|
1955 | | - makeSomething(sel, false); |
---|
| 2176 | + makeSomething(merge, false); |
---|
1956 | 2177 | else |
---|
1957 | | - content.addChild(sel); |
---|
| 2178 | + content.addChild(merge); |
---|
1958 | 2179 | } |
---|
1959 | 2180 | |
---|
1960 | 2181 | if (!one) |
---|
1961 | | - makeSomething(content, false); |
---|
1962 | | - |
---|
1963 | | - ResetModel(); |
---|
1964 | | - refreshContents(); |
---|
| 2182 | + makeSomething(content, true); |
---|
| 2183 | + else |
---|
| 2184 | + { |
---|
| 2185 | + ResetModel(); |
---|
| 2186 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2187 | + refreshContents(); |
---|
| 2188 | + } |
---|
1965 | 2189 | } else |
---|
1966 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2190 | + if (source == mergeGeometriesItem) |
---|
1967 | 2191 | { |
---|
1968 | 2192 | boolean one = false; |
---|
1969 | 2193 | |
---|
.. | .. |
---|
1993 | 2217 | ResetModel(); |
---|
1994 | 2218 | refreshContents(); |
---|
1995 | 2219 | } else |
---|
1996 | | - if (event.getSource() == linkverticesItem) |
---|
| 2220 | + if (source == linkverticesItem) |
---|
1997 | 2221 | { |
---|
1998 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2222 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
1999 | 2223 | // { |
---|
2000 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2224 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2001 | 2225 | // |
---|
2002 | 2226 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2003 | 2227 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2006 | 2230 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2007 | 2231 | // refreshContents(); |
---|
2008 | 2232 | // } |
---|
2009 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2233 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2010 | 2234 | { |
---|
2011 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2235 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2012 | 2236 | |
---|
2013 | 2237 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2014 | 2238 | content = ((cGroup)content).get(0); |
---|
2015 | 2239 | |
---|
2016 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2240 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2017 | 2241 | for (int i=0; i<group.selection.size(); i++) |
---|
2018 | 2242 | { |
---|
2019 | | - boolean random = CameraPane.RANDOM; |
---|
2020 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2243 | + boolean random = CameraPane.SWITCH; |
---|
| 2244 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2021 | 2245 | group.selection.get(i).linkVerticesThis(content); |
---|
2022 | 2246 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2023 | | - CameraPane.RANDOM = random; |
---|
| 2247 | + CameraPane.SWITCH = random; |
---|
2024 | 2248 | } |
---|
2025 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2249 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2026 | 2250 | refreshContents(); |
---|
2027 | 2251 | } |
---|
2028 | 2252 | } else |
---|
2029 | | - if (event.getSource() == resetsupportItem) |
---|
| 2253 | + if (source == resetsupportItem) |
---|
2030 | 2254 | { |
---|
2031 | 2255 | for (int i=0; i<group.selection.size(); i++) |
---|
2032 | 2256 | { |
---|
2033 | | - boolean random = CameraPane.RANDOM; |
---|
2034 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2257 | + boolean random = CameraPane.SWITCH; |
---|
| 2258 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2035 | 2259 | group.selection.get(i).linkVerticesThis(null); |
---|
2036 | | - CameraPane.RANDOM = random; |
---|
| 2260 | + CameraPane.SWITCH = random; |
---|
2037 | 2261 | } |
---|
2038 | 2262 | |
---|
2039 | 2263 | refreshContents(); |
---|
2040 | 2264 | } else |
---|
2041 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2265 | + if (source == relinkverticesItem) |
---|
| 2266 | + { |
---|
| 2267 | + boolean random = CameraPane.SWITCH; |
---|
| 2268 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2269 | + group.selection.RelinkToSupport(); |
---|
| 2270 | + CameraPane.SWITCH = random; |
---|
| 2271 | + |
---|
| 2272 | + refreshContents(); |
---|
| 2273 | + } else |
---|
| 2274 | + if (source == resetreferencesItem) |
---|
2042 | 2275 | { |
---|
2043 | 2276 | for (int i=0; i<group.selection.size(); i++) |
---|
2044 | 2277 | { |
---|
.. | .. |
---|
2047 | 2280 | |
---|
2048 | 2281 | refreshContents(); |
---|
2049 | 2282 | } else |
---|
2050 | | - if (event.getSource() == setMasterItem) |
---|
| 2283 | + if (source == setMasterItem) |
---|
2051 | 2284 | { |
---|
2052 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2285 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2053 | 2286 | { |
---|
2054 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2287 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2055 | 2288 | |
---|
2056 | 2289 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2057 | 2290 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2060 | 2293 | refreshContents(); |
---|
2061 | 2294 | } |
---|
2062 | 2295 | } else |
---|
2063 | | - if (event.getSource() == poseMeshItem) |
---|
| 2296 | + if (source == poseMeshItem) |
---|
2064 | 2297 | { |
---|
2065 | 2298 | if (group.selection.size() == 1) |
---|
2066 | 2299 | { |
---|
2067 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2300 | + if (Grafreed.clipboard.size() == 1) |
---|
2068 | 2301 | { |
---|
2069 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2302 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2070 | 2303 | |
---|
2071 | 2304 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2072 | 2305 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2079 | 2312 | } |
---|
2080 | 2313 | |
---|
2081 | 2314 | } else |
---|
2082 | | - if (event.getSource() == revertMeshItem) |
---|
| 2315 | + if (source == revertMeshItem) |
---|
2083 | 2316 | { |
---|
2084 | 2317 | RevertMeshes(); |
---|
2085 | 2318 | } else |
---|
2086 | | - if (event.getSource() == resetMeshItem) |
---|
| 2319 | + if (source == resetAllItem) |
---|
2087 | 2320 | { |
---|
2088 | 2321 | ResetAll(); |
---|
2089 | 2322 | } else |
---|
2090 | | - if (event.getSource() == stepAllItem) |
---|
| 2323 | + if (source == stepAllItem) |
---|
2091 | 2324 | { |
---|
2092 | 2325 | StepAll(); |
---|
2093 | 2326 | } else |
---|
2094 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2327 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2095 | 2328 | { |
---|
2096 | 2329 | //int indices[] = jList.getSelectedIndices(); |
---|
2097 | 2330 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2099 | 2332 | |
---|
2100 | 2333 | ClearSelection(false); |
---|
2101 | 2334 | } else |
---|
2102 | | - if (event.getSource() == clearAllItem) |
---|
| 2335 | + if (source == clearAllItem) |
---|
2103 | 2336 | { |
---|
2104 | 2337 | ClearSelection(true); |
---|
2105 | 2338 | } else |
---|
2106 | | - if (event.getSource() == grabItem) |
---|
| 2339 | + if (source == grabItem) |
---|
2107 | 2340 | { |
---|
2108 | 2341 | group(new cGroup(), true); |
---|
2109 | 2342 | } else |
---|
2110 | | - if (event.getSource() == frontItem) |
---|
| 2343 | + if (source == hideItem) |
---|
| 2344 | + { |
---|
| 2345 | + group(new HiddenObject()); |
---|
| 2346 | + } else |
---|
| 2347 | + if (source == frontItem) |
---|
2111 | 2348 | { |
---|
2112 | 2349 | front(); |
---|
2113 | 2350 | } else |
---|
2114 | | - if (event.getSource() == backItem) |
---|
| 2351 | + if (source == backItem) |
---|
2115 | 2352 | { |
---|
2116 | 2353 | back(); |
---|
2117 | 2354 | } else |
---|
2118 | | - if (event.getSource() == cameraItem) |
---|
| 2355 | + if (source == cameraItem) |
---|
2119 | 2356 | { |
---|
2120 | 2357 | makeSomething(new Camera()); |
---|
2121 | 2358 | } else |
---|
2122 | | - if (event.getSource() == compositeItem) |
---|
| 2359 | + if (source == compositeItem) |
---|
2123 | 2360 | { |
---|
2124 | 2361 | group(new Composite()); |
---|
2125 | 2362 | } else |
---|
2126 | | - if (event.getSource() == randomItem) |
---|
| 2363 | + if (source == randomItem) |
---|
2127 | 2364 | { |
---|
2128 | 2365 | RandomNode random = new RandomNode(); |
---|
2129 | 2366 | group(random); |
---|
2130 | 2367 | if (random.size() > 0) |
---|
2131 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2368 | + random.name = random.get(0).name + "Switch"; |
---|
2132 | 2369 | } else |
---|
2133 | | - if (event.getSource() == physicsItem) |
---|
| 2370 | + if (source == physicsItem) |
---|
2134 | 2371 | { |
---|
2135 | 2372 | group(new PhysicsNode()); |
---|
2136 | 2373 | } else |
---|
2137 | | - if (event.getSource() == frameselectorItem) |
---|
| 2374 | + if (source == frameselectorItem) |
---|
2138 | 2375 | { |
---|
2139 | 2376 | for (int i=0; i<group.selection.size(); i++) |
---|
2140 | 2377 | { |
---|
.. | .. |
---|
2146 | 2383 | ResetModel(); |
---|
2147 | 2384 | refreshContents(); |
---|
2148 | 2385 | } else |
---|
2149 | | - if (event.getSource() == switchGeoItem) |
---|
| 2386 | + if (source == switchGeoItem) |
---|
2150 | 2387 | { |
---|
2151 | 2388 | for (int i=0; i<group.selection.size(); i++) |
---|
2152 | 2389 | { |
---|
.. | .. |
---|
2158 | 2395 | ResetModel(); |
---|
2159 | 2396 | refreshContents(); |
---|
2160 | 2397 | } else |
---|
2161 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2398 | + if (source == switchTransfoItem) |
---|
2162 | 2399 | { |
---|
2163 | 2400 | for (int i=0; i<group.selection.size(); i++) |
---|
2164 | 2401 | { |
---|
.. | .. |
---|
2170 | 2407 | ResetModel(); |
---|
2171 | 2408 | refreshContents(); |
---|
2172 | 2409 | } else |
---|
2173 | | - if (event.getSource() == morphItem) |
---|
| 2410 | + if (source == morphItem) |
---|
2174 | 2411 | { |
---|
2175 | 2412 | for (int i=0; i<group.selection.size(); i++) |
---|
2176 | 2413 | { |
---|
.. | .. |
---|
2182 | 2419 | ResetModel(); |
---|
2183 | 2420 | refreshContents(); |
---|
2184 | 2421 | } else |
---|
2185 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2422 | + if (source == scriptNodeItem) |
---|
2186 | 2423 | { |
---|
2187 | 2424 | boolean atleastone = false; |
---|
2188 | 2425 | |
---|
.. | .. |
---|
2221 | 2458 | } |
---|
2222 | 2459 | } |
---|
2223 | 2460 | } else |
---|
2224 | | - if (event.getSource() == linkerItem) |
---|
| 2461 | + if (source == linkerItem) |
---|
2225 | 2462 | { |
---|
2226 | 2463 | group(new cLinker()); |
---|
2227 | 2464 | } else |
---|
2228 | | - if (event.getSource() == textureItem) |
---|
| 2465 | + if (source == textureItem) |
---|
2229 | 2466 | { |
---|
2230 | 2467 | group(new TextureNode()); |
---|
2231 | 2468 | } else |
---|
2232 | | - if (event.getSource() == shadowXItem) |
---|
| 2469 | + if (source == billboardItem) |
---|
| 2470 | + { |
---|
| 2471 | + group(new BillboardNode()); |
---|
| 2472 | + } else |
---|
| 2473 | + if (source == shadowXItem) |
---|
2233 | 2474 | { |
---|
2234 | 2475 | CastShadow(0); |
---|
2235 | 2476 | } else |
---|
2236 | | - if (event.getSource() == shadowYItem) |
---|
| 2477 | + if (source == shadowYItem) |
---|
2237 | 2478 | { |
---|
2238 | 2479 | CastShadow(1); |
---|
2239 | 2480 | } else |
---|
2240 | | - if (event.getSource() == shadowZItem) |
---|
| 2481 | + if (source == shadowZItem) |
---|
2241 | 2482 | { |
---|
2242 | 2483 | CastShadow(2); |
---|
2243 | 2484 | } else |
---|
2244 | | - if (event.getSource() == ungroupItem) |
---|
| 2485 | + if (source == ungroupItem) |
---|
2245 | 2486 | { |
---|
2246 | | - ungroup(); |
---|
| 2487 | + //ungroup(); |
---|
| 2488 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2489 | + { |
---|
| 2490 | + Ungroup(group.selection.get(i)); |
---|
| 2491 | + } |
---|
| 2492 | + |
---|
| 2493 | + ClearSelection(false); |
---|
| 2494 | + |
---|
| 2495 | + refreshContents(); |
---|
2247 | 2496 | } else |
---|
2248 | | - if (event.getSource() == genUVItem) |
---|
| 2497 | + if (source == genUVItem) |
---|
2249 | 2498 | { |
---|
2250 | 2499 | GenUV(); |
---|
2251 | 2500 | } else |
---|
2252 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2501 | + if (source == genNormalsCADItem) |
---|
2253 | 2502 | { |
---|
2254 | 2503 | GenNormals(true); |
---|
2255 | 2504 | } else |
---|
2256 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2505 | + if (source == genNormalsMESHItem) |
---|
| 2506 | + { |
---|
| 2507 | + GenNormals(true); // TODO |
---|
| 2508 | + } else |
---|
| 2509 | + if (source == genNormalsORGANItem) |
---|
2257 | 2510 | { |
---|
2258 | 2511 | GenNormals(false); |
---|
2259 | 2512 | } else |
---|
2260 | | - if (event.getSource() == stripifyItem) |
---|
| 2513 | + if (source == genNormalsMINEItem) |
---|
| 2514 | + { |
---|
| 2515 | + GenNormalsMINE(); |
---|
| 2516 | + } else |
---|
| 2517 | + if (source == stripifyItem) |
---|
2261 | 2518 | { |
---|
2262 | 2519 | Stripify(); |
---|
2263 | 2520 | } else |
---|
2264 | | - if (event.getSource() == unstripifyItem) |
---|
| 2521 | + if (source == unstripifyItem) |
---|
2265 | 2522 | { |
---|
2266 | 2523 | Unstripify(); |
---|
2267 | 2524 | } else |
---|
2268 | | - if (event.getSource() == trimItem) |
---|
| 2525 | + if (source == trimItem) |
---|
2269 | 2526 | { |
---|
2270 | 2527 | Trim(); |
---|
2271 | 2528 | } else |
---|
2272 | | - if (event.getSource() == untrimItem) |
---|
| 2529 | + if (source == untrimItem) |
---|
2273 | 2530 | { |
---|
2274 | 2531 | Untrim(); |
---|
2275 | 2532 | } else |
---|
2276 | | - if (event.getSource() == clearColorsItem) |
---|
| 2533 | + if (source == clearColorsItem) |
---|
2277 | 2534 | { |
---|
2278 | 2535 | ClearColors(); |
---|
2279 | 2536 | } else |
---|
2280 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2537 | + if (source == clearMaterialsItem) |
---|
2281 | 2538 | { |
---|
2282 | 2539 | ClearMaterials(); |
---|
2283 | 2540 | } else |
---|
2284 | | - if (event.getSource() == liveleavesItem) |
---|
| 2541 | + if (source == liveleavesItem) |
---|
2285 | 2542 | { |
---|
2286 | 2543 | LiveLeaves(true); |
---|
2287 | 2544 | } else |
---|
2288 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2545 | + if (source == unliveleavesItem) |
---|
2289 | 2546 | { |
---|
2290 | 2547 | LiveLeaves(false); |
---|
2291 | 2548 | } else |
---|
2292 | | - if (event.getSource() == supportleavesItem) |
---|
| 2549 | + if (source == supportleavesItem) |
---|
2293 | 2550 | { |
---|
2294 | 2551 | SupportLeaves(true); |
---|
2295 | 2552 | } else |
---|
2296 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2553 | + if (source == unsupportleavesItem) |
---|
2297 | 2554 | { |
---|
2298 | 2555 | SupportLeaves(false); |
---|
2299 | 2556 | } else |
---|
2300 | | - if (event.getSource() == hideleavesItem) |
---|
| 2557 | + if (source == hideleavesItem) |
---|
2301 | 2558 | { |
---|
2302 | 2559 | HideLeaves(true); |
---|
2303 | 2560 | } else |
---|
2304 | | - if (event.getSource() == showleavesItem) |
---|
| 2561 | + if (source == showleavesItem) |
---|
2305 | 2562 | { |
---|
2306 | 2563 | HideLeaves(false); |
---|
2307 | 2564 | } else |
---|
2308 | | - if (event.getSource() == markleavesItem) |
---|
| 2565 | + if (source == markleavesItem) |
---|
2309 | 2566 | { |
---|
2310 | 2567 | MarkLeaves(true); |
---|
2311 | 2568 | } else |
---|
2312 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2569 | + if (source == unmarkleavesItem) |
---|
2313 | 2570 | { |
---|
2314 | 2571 | MarkLeaves(false); |
---|
2315 | 2572 | } else |
---|
2316 | | - if (event.getSource() == flipVItem) |
---|
| 2573 | + if (source == flipVItem) |
---|
2317 | 2574 | { |
---|
2318 | 2575 | FlipV(true); |
---|
2319 | 2576 | } else |
---|
2320 | | - if (event.getSource() == unflipVItem) |
---|
| 2577 | + if (source == unflipVItem) |
---|
2321 | 2578 | { |
---|
2322 | 2579 | FlipV(false); |
---|
2323 | 2580 | } else |
---|
2324 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2581 | + if (source == lowTexturesItem) |
---|
2325 | 2582 | { |
---|
2326 | 2583 | SetTexRes(0); |
---|
2327 | 2584 | } else |
---|
2328 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2585 | + if (source == normalTexturesItem) |
---|
2329 | 2586 | { |
---|
2330 | 2587 | SetTexRes(1); |
---|
2331 | 2588 | } else |
---|
2332 | | - if (event.getSource() == highTexturesItem) |
---|
| 2589 | + if (source == highTexturesItem) |
---|
2333 | 2590 | { |
---|
2334 | 2591 | SetTexRes(2); |
---|
2335 | 2592 | } else |
---|
2336 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2593 | + if (source == veryhighTexturesItem) |
---|
2337 | 2594 | { |
---|
2338 | 2595 | SetTexRes(3); |
---|
2339 | 2596 | } else |
---|
2340 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2597 | + if (source == maxTexturesItem) |
---|
2341 | 2598 | { |
---|
2342 | 2599 | SetTexRes(4); |
---|
2343 | 2600 | } else |
---|
2344 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2601 | + if (source == panoTexturesItem) |
---|
2345 | 2602 | { |
---|
2346 | 2603 | SetTexRes(5); |
---|
2347 | 2604 | } else |
---|
2348 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2605 | + if (source == reverseNormalsItem) |
---|
2349 | 2606 | { |
---|
2350 | 2607 | ReverseNormals(); |
---|
2351 | 2608 | } else |
---|
2352 | | - if (event.getSource() == parseverticesItem) |
---|
| 2609 | + if (source == parseverticesItem) |
---|
2353 | 2610 | { |
---|
2354 | 2611 | ParseVertices(); |
---|
2355 | 2612 | } else |
---|
2356 | | - if (event.getSource() == alignItem) |
---|
| 2613 | + if (source == textureFieldItem) |
---|
| 2614 | + { |
---|
| 2615 | + TextureVertices(); |
---|
| 2616 | + } else |
---|
| 2617 | + if (source == alignItem) |
---|
2357 | 2618 | { |
---|
2358 | 2619 | Align(); |
---|
2359 | 2620 | } else |
---|
2360 | | - if (event.getSource() == mirrorItem) |
---|
| 2621 | + if (source == mirrorItem) |
---|
2361 | 2622 | { |
---|
2362 | 2623 | MirrorPoses(); |
---|
2363 | 2624 | } else |
---|
2364 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2625 | + if (source == reduceMorphItem) |
---|
2365 | 2626 | { |
---|
2366 | 2627 | MeshReduction(false); |
---|
2367 | 2628 | } else |
---|
2368 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2629 | + if (source == reduce34MorphItem) |
---|
2369 | 2630 | { |
---|
2370 | 2631 | MeshReduction(true); |
---|
2371 | 2632 | } else |
---|
2372 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2633 | + if (source == reverseTrianglesItem) |
---|
2373 | 2634 | { |
---|
2374 | 2635 | ReverseTriangles(); |
---|
2375 | 2636 | } else |
---|
2376 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2637 | + if (source == reduceMeshItem) |
---|
2377 | 2638 | { |
---|
2378 | 2639 | ReduceMesh(false); |
---|
2379 | 2640 | } else |
---|
2380 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2641 | + if (source == reduce34MeshItem) |
---|
2381 | 2642 | { |
---|
2382 | 2643 | ReduceMesh(true); |
---|
2383 | 2644 | } else |
---|
2384 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2645 | + if (source == increaseMeshItem) |
---|
2385 | 2646 | { |
---|
2386 | 2647 | IncreaseMesh(); |
---|
2387 | 2648 | } else |
---|
2388 | | - if (event.getSource() == clipMeshItem) |
---|
| 2649 | + if (source == clipMeshItem) |
---|
2389 | 2650 | { |
---|
2390 | 2651 | ClipMesh(); |
---|
2391 | 2652 | } else |
---|
2392 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2653 | + if (source == smoothMeshItem) |
---|
2393 | 2654 | { |
---|
2394 | 2655 | SmoothMesh(); |
---|
2395 | 2656 | } else |
---|
2396 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2657 | + if (source == transformGeometryItem) |
---|
2397 | 2658 | { |
---|
2398 | 2659 | TransformGeometry(); |
---|
2399 | 2660 | } else |
---|
2400 | | - if (event.getSource() == resetTransformItem) |
---|
| 2661 | + if (source == transformChildrenItem) |
---|
| 2662 | + { |
---|
| 2663 | + TransformChildren(); |
---|
| 2664 | + } else |
---|
| 2665 | + if (source == resetTransformItem) |
---|
2401 | 2666 | { |
---|
2402 | 2667 | ResetTransform(); |
---|
2403 | 2668 | } else |
---|
2404 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2669 | + if (source == resetCentroidItem) |
---|
2405 | 2670 | { |
---|
2406 | | - ResetCentroid(); |
---|
| 2671 | + ResetCentroid(true); |
---|
2407 | 2672 | } else |
---|
2408 | | - if (event.getSource() == resetParentItem) |
---|
| 2673 | + if (source == resetCentroidXZItem) |
---|
| 2674 | + { |
---|
| 2675 | + ResetCentroid(false); |
---|
| 2676 | + } else |
---|
| 2677 | + if (source == resetParentItem) |
---|
2409 | 2678 | { |
---|
2410 | 2679 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2411 | 2680 | { |
---|
.. | .. |
---|
2415 | 2684 | |
---|
2416 | 2685 | refreshContents(); |
---|
2417 | 2686 | } else |
---|
2418 | | - if (event.getSource() == repairParentItem) |
---|
| 2687 | + if (source == repairParentItem) |
---|
2419 | 2688 | { |
---|
2420 | 2689 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2421 | 2690 | { |
---|
.. | .. |
---|
2429 | 2698 | |
---|
2430 | 2699 | refreshContents(); |
---|
2431 | 2700 | } else |
---|
2432 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2701 | + if (source == repairShadowItem) |
---|
| 2702 | + { |
---|
| 2703 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2704 | + { |
---|
| 2705 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2706 | + obj.RepairShadow(); |
---|
| 2707 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2708 | +// { |
---|
| 2709 | +// obj.get(i).parent = obj; |
---|
| 2710 | +// } |
---|
| 2711 | + } |
---|
| 2712 | + |
---|
| 2713 | + refreshContents(); |
---|
| 2714 | + } else |
---|
| 2715 | + if (source == sortbysizeItem) |
---|
2433 | 2716 | { |
---|
2434 | 2717 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2435 | 2718 | { |
---|
.. | .. |
---|
2441 | 2724 | ResetModel(); |
---|
2442 | 2725 | refreshContents(); |
---|
2443 | 2726 | } else |
---|
2444 | | - if (event.getSource() == sortbynameItem) |
---|
| 2727 | + if (source == sortbynameItem) |
---|
2445 | 2728 | { |
---|
2446 | 2729 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2447 | 2730 | { |
---|
.. | .. |
---|
2453 | 2736 | ResetModel(); |
---|
2454 | 2737 | refreshContents(); |
---|
2455 | 2738 | } else |
---|
2456 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2739 | + if (source == attachPigmentItem) |
---|
2457 | 2740 | { |
---|
2458 | 2741 | String texture = GetFile("Attach pigment"); |
---|
2459 | 2742 | Object3D obj; |
---|
.. | .. |
---|
2465 | 2748 | |
---|
2466 | 2749 | refreshContents(); |
---|
2467 | 2750 | } else |
---|
2468 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2751 | + if (source == detachPigmentItem) |
---|
2469 | 2752 | { |
---|
2470 | 2753 | Object3D obj; |
---|
2471 | 2754 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2476 | 2759 | |
---|
2477 | 2760 | refreshContents(); |
---|
2478 | 2761 | } else |
---|
2479 | | - if (event.getSource() == attachBumpItem) |
---|
| 2762 | + if (source == attachBumpItem) |
---|
2480 | 2763 | { |
---|
2481 | 2764 | String texture = GetFile("Attach bump"); |
---|
2482 | 2765 | Object3D obj; |
---|
.. | .. |
---|
2488 | 2771 | |
---|
2489 | 2772 | refreshContents(); |
---|
2490 | 2773 | } else |
---|
2491 | | - if (event.getSource() == detachBumpItem) |
---|
| 2774 | + if (source == detachBumpItem) |
---|
2492 | 2775 | { |
---|
2493 | 2776 | Object3D obj; |
---|
2494 | 2777 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2499 | 2782 | |
---|
2500 | 2783 | refreshContents(); |
---|
2501 | 2784 | } else |
---|
2502 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2785 | + if (source == pigmentBumpItem) |
---|
2503 | 2786 | { |
---|
2504 | 2787 | Object3D obj; |
---|
2505 | 2788 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2510 | 2793 | |
---|
2511 | 2794 | refreshContents(); |
---|
2512 | 2795 | } else |
---|
2513 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2796 | + if (source == flashSelectionButton) |
---|
2514 | 2797 | { |
---|
2515 | 2798 | CameraPane.flash = true; |
---|
2516 | 2799 | refreshContents(); |
---|
2517 | 2800 | } else |
---|
2518 | | - if (event.getSource() == oneButton) |
---|
| 2801 | + if (source == oneButton) |
---|
2519 | 2802 | { |
---|
2520 | 2803 | } else |
---|
2521 | | - if (event.getSource() == twoButton) |
---|
| 2804 | + if (source == twoButton) |
---|
2522 | 2805 | { |
---|
2523 | 2806 | radio.layout = twoButton; |
---|
2524 | 2807 | // bug |
---|
2525 | 2808 | //gridPanel.setDividerLocation(1.0); |
---|
2526 | 2809 | //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(); |
---|
| 2810 | +// bigThree.remove(scenePanel); |
---|
| 2811 | +// bigThree.remove(centralPanel); |
---|
| 2812 | +// bigThree.remove(XYZPanel); |
---|
| 2813 | +// aWindowConstraints.gridx = 0; |
---|
| 2814 | +// aWindowConstraints.gridy = 0; |
---|
| 2815 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2816 | +// // aConstraints.gridheight = 3; |
---|
| 2817 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2818 | +// aWindowConstraints.weightx = 0; |
---|
| 2819 | +// aWindowConstraints.weighty = 1; |
---|
| 2820 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2821 | +// aWindowConstraints.weightx = 1; |
---|
| 2822 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2823 | +// // aConstraints.gridheight = 3; |
---|
| 2824 | +// aWindowConstraints.gridx = 1; |
---|
| 2825 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2826 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2827 | +// aWindowConstraints.weightx = 0; |
---|
| 2828 | +// aWindowConstraints.gridx = 4; |
---|
| 2829 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2830 | +// // aConstraints.gridheight = 3; |
---|
| 2831 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2832 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2833 | +// scenePanel.setVisible(false); |
---|
| 2834 | +// centralPanel.setVisible(true); |
---|
| 2835 | +// XYZPanel.setVisible(false); |
---|
| 2836 | + bigThree.ClearUI(); |
---|
| 2837 | + bigThree.add(centralPanel); |
---|
| 2838 | + bigThree.FlushUI(); |
---|
2551 | 2839 | } else |
---|
2552 | | - if (event.getSource() == threeButton) |
---|
| 2840 | + if (source == threeButton) |
---|
2553 | 2841 | { |
---|
2554 | 2842 | 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(); |
---|
| 2843 | + |
---|
| 2844 | +// bigThree.remove(scenePanel); |
---|
| 2845 | +// bigThree.remove(centralPanel); |
---|
| 2846 | +// bigThree.remove(XYZPanel); |
---|
| 2847 | +// aWindowConstraints.gridx = 0; |
---|
| 2848 | +// aWindowConstraints.gridy = 0; |
---|
| 2849 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2850 | +// // aConstraints.gridheight = 3; |
---|
| 2851 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2852 | +// aWindowConstraints.weightx = 0; |
---|
| 2853 | +// aWindowConstraints.weighty = 1; |
---|
| 2854 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2855 | +// aWindowConstraints.weightx = 1; |
---|
| 2856 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2857 | +// // aConstraints.gridheight = 3; |
---|
| 2858 | +// aWindowConstraints.gridx = 1; |
---|
| 2859 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2860 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2861 | +// aWindowConstraints.weightx = 0; |
---|
| 2862 | +// aWindowConstraints.gridx = 4; |
---|
| 2863 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2864 | +// // aConstraints.gridheight = 3; |
---|
| 2865 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2866 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2867 | +// bigThree.validate(); |
---|
| 2868 | +// scenePanel.setVisible(false); |
---|
| 2869 | +// centralPanel.setVisible(true); |
---|
| 2870 | +// XYZPanel.setVisible(true); |
---|
| 2871 | + bigThree.ClearUI(); |
---|
| 2872 | + bigThree.add(centralPanel); |
---|
| 2873 | + bigThree.add(XYZPanel); |
---|
| 2874 | + bigThree.FlushUI(); |
---|
2579 | 2875 | } else |
---|
2580 | | - if (event.getSource() == fourButton) |
---|
| 2876 | + if (source == fourButton) |
---|
2581 | 2877 | { |
---|
2582 | 2878 | 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(); |
---|
| 2879 | + |
---|
| 2880 | +// bigThree.remove(scenePanel); |
---|
| 2881 | +// bigThree.remove(centralPanel); |
---|
| 2882 | +// bigThree.remove(XYZPanel); |
---|
| 2883 | +// aWindowConstraints.gridx = 0; |
---|
| 2884 | +// aWindowConstraints.gridy = 0; |
---|
| 2885 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2886 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2887 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2888 | +// aWindowConstraints.weightx = 1; |
---|
| 2889 | +// aWindowConstraints.weighty = 1; |
---|
| 2890 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2891 | +// aWindowConstraints.weightx = 1; |
---|
| 2892 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2893 | +// // aConstraints.gridheight = 3; |
---|
| 2894 | +// aWindowConstraints.gridx = 1; |
---|
| 2895 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2896 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2897 | +// aWindowConstraints.weightx = 0; |
---|
| 2898 | +// aWindowConstraints.gridx = 4; |
---|
| 2899 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2900 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2901 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2902 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2903 | +// bigThree.validate(); |
---|
| 2904 | +// scenePanel.setVisible(true); |
---|
| 2905 | +// centralPanel.setVisible(false); |
---|
| 2906 | +// XYZPanel.setVisible(false); |
---|
| 2907 | + bigThree.ClearUI(); |
---|
| 2908 | + bigThree.add(scenePanel); |
---|
| 2909 | + bigThree.FlushUI(); |
---|
2607 | 2910 | } else |
---|
2608 | | - if (event.getSource() == sixButton) |
---|
| 2911 | + if (source == sixButton) |
---|
2609 | 2912 | { |
---|
2610 | 2913 | 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(); |
---|
| 2914 | + |
---|
| 2915 | +// bigThree.remove(scenePanel); |
---|
| 2916 | +// bigThree.remove(centralPanel); |
---|
| 2917 | +// bigThree.remove(XYZPanel); |
---|
| 2918 | +// aWindowConstraints.gridx = 0; |
---|
| 2919 | +// aWindowConstraints.gridy = 0; |
---|
| 2920 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2921 | +// // aConstraints.gridheight = 3; |
---|
| 2922 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2923 | +// aWindowConstraints.weightx = 0; |
---|
| 2924 | +// aWindowConstraints.weighty = 1; |
---|
| 2925 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2926 | +// aWindowConstraints.weightx = 1; |
---|
| 2927 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2928 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2929 | +// aWindowConstraints.gridx = 1; |
---|
| 2930 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2931 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2932 | +// aWindowConstraints.weightx = 0; |
---|
| 2933 | +// aWindowConstraints.gridx = 4; |
---|
| 2934 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2935 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2936 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2937 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2938 | +// bigThree.validate(); |
---|
| 2939 | +// scenePanel.setVisible(true); |
---|
| 2940 | +// centralPanel.setVisible(true); |
---|
| 2941 | +// XYZPanel.setVisible(false); |
---|
| 2942 | + bigThree.ClearUI(); |
---|
| 2943 | + bigThree.add(scenePanel); |
---|
| 2944 | + bigThree.add(centralPanel); |
---|
| 2945 | + bigThree.FlushUI(); |
---|
2635 | 2946 | } else |
---|
2636 | | - if (event.getSource() == sevenButton) |
---|
| 2947 | + if (source == sevenButton) |
---|
2637 | 2948 | { |
---|
2638 | 2949 | 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(); |
---|
| 2950 | + |
---|
| 2951 | +// bigThree.remove(scenePanel); |
---|
| 2952 | +// bigThree.remove(centralPanel); |
---|
| 2953 | +// bigThree.remove(XYZPanel); |
---|
| 2954 | +// aWindowConstraints.gridx = 0; |
---|
| 2955 | +// aWindowConstraints.gridy = 0; |
---|
| 2956 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2957 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2958 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2959 | +// aWindowConstraints.weightx = 0; |
---|
| 2960 | +// aWindowConstraints.weighty = 1; |
---|
| 2961 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2962 | +// aWindowConstraints.weightx = 1; |
---|
| 2963 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2964 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2965 | +// aWindowConstraints.gridx = 1; |
---|
| 2966 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2967 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2968 | +// aWindowConstraints.weightx = 0; |
---|
| 2969 | +// aWindowConstraints.gridx = 4; |
---|
| 2970 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2971 | +// // aConstraints.gridheight = 3; |
---|
| 2972 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2973 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2974 | +// bigThree.validate(); |
---|
| 2975 | +// scenePanel.setVisible(true); |
---|
| 2976 | +// centralPanel.setVisible(true); |
---|
| 2977 | +// XYZPanel.setVisible(true); |
---|
| 2978 | + bigThree.ClearUI(); |
---|
| 2979 | + bigThree.add(scenePanel); |
---|
| 2980 | + bigThree.add(centralPanel); |
---|
| 2981 | + bigThree.add(XYZPanel); |
---|
| 2982 | + bigThree.FlushUI(); |
---|
2663 | 2983 | } else |
---|
2664 | | - if (event.getSource() == rootButton) |
---|
| 2984 | + if (source == rootButton) |
---|
2665 | 2985 | { |
---|
2666 | 2986 | Object3D obj; |
---|
2667 | 2987 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2673 | 2993 | |
---|
2674 | 2994 | refreshContents(true); |
---|
2675 | 2995 | } else |
---|
2676 | | - if (event.getSource() == closeButton) |
---|
| 2996 | + if (source == closeButton) |
---|
2677 | 2997 | { |
---|
2678 | 2998 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2679 | 2999 | cRadio ab; |
---|
.. | .. |
---|
2694 | 3014 | } |
---|
2695 | 3015 | refreshContents(true); |
---|
2696 | 3016 | } else |
---|
2697 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3017 | + if (source == editItem || source == editButton) |
---|
2698 | 3018 | { |
---|
2699 | 3019 | EditSelection(false); |
---|
2700 | 3020 | } else |
---|
2701 | | - if (event.getSource() == uneditButton) |
---|
| 3021 | + if (source == uneditButton) |
---|
2702 | 3022 | { |
---|
2703 | 3023 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2704 | 3024 | { |
---|
.. | .. |
---|
2710 | 3030 | |
---|
2711 | 3031 | child.editWindow = null; // ??????????? |
---|
2712 | 3032 | } |
---|
2713 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3033 | + objEditor.ctrlPanel.FlushUI(); |
---|
2714 | 3034 | //objEditor.jTree.clearSelection(); |
---|
2715 | 3035 | //objEditor.ResetSliders(); |
---|
2716 | 3036 | refreshContents(true); |
---|
2717 | 3037 | } else |
---|
2718 | | - if (event.getSource() == clearPanelButton) |
---|
| 3038 | + if (source == clearPanelButton) |
---|
2719 | 3039 | { |
---|
2720 | 3040 | assert(copy == group); |
---|
2721 | 3041 | //copy.ClearUI(); |
---|
.. | .. |
---|
2726 | 3046 | listUI.clear(); |
---|
2727 | 3047 | refreshContents(true); |
---|
2728 | 3048 | } else |
---|
2729 | | - if (event.getSource() == allParamsButton) |
---|
| 3049 | + if (source == allParamsButton) |
---|
2730 | 3050 | { |
---|
2731 | 3051 | assert(copy == group); |
---|
2732 | 3052 | |
---|
.. | .. |
---|
2747 | 3067 | |
---|
2748 | 3068 | refreshContents(true); |
---|
2749 | 3069 | } else |
---|
2750 | | - if (event.getSource() == unselectButton) |
---|
| 3070 | + if (source == unselectButton) |
---|
2751 | 3071 | { |
---|
2752 | 3072 | objEditor.jTree.clearSelection(); |
---|
2753 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3073 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2754 | 3074 | objEditor.ResetSliders(); |
---|
2755 | 3075 | refreshContents(true); |
---|
2756 | 3076 | } else |
---|
2757 | | - if(event.getSource() instanceof cRadio) |
---|
| 3077 | + if(source instanceof cRadio) |
---|
2758 | 3078 | { |
---|
2759 | 3079 | group.parent = keepparent; |
---|
2760 | 3080 | group.attributes = 0; |
---|
2761 | 3081 | //group.editWindow = null; |
---|
2762 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3082 | + /*cRadio*/ radio = (cRadio)source; |
---|
2763 | 3083 | Object3D obj = radio.GetObject(); |
---|
2764 | 3084 | System.out.println("Edit " + obj); |
---|
2765 | 3085 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2779 | 3099 | } |
---|
2780 | 3100 | |
---|
2781 | 3101 | copy = group; |
---|
2782 | | - //CameraPane.theRenderer.object = group; |
---|
| 3102 | + //Globals.theRenderer.object = group; |
---|
2783 | 3103 | if(!useclient) |
---|
2784 | 3104 | { |
---|
2785 | 3105 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2788 | 3108 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2789 | 3109 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2790 | 3110 | cameraView.object = group; |
---|
2791 | | - cameraView.lighttouched = true; |
---|
| 3111 | + //cameraView.lighttouched = true; |
---|
| 3112 | + Globals.lighttouched = true; |
---|
2792 | 3113 | topView.object = group; |
---|
2793 | 3114 | frontView.object = group; |
---|
2794 | 3115 | sideView.object = group; |
---|
2795 | 3116 | } |
---|
2796 | | - group.editWindow = this; |
---|
| 3117 | + |
---|
| 3118 | +// fix "+" issue group.editWindow = this; |
---|
| 3119 | + |
---|
2797 | 3120 | /* |
---|
2798 | 3121 | currentLayout = radio.layout; |
---|
2799 | 3122 | if (currentLayout == null) |
---|
.. | .. |
---|
2806 | 3129 | //group.attributes = -1; |
---|
2807 | 3130 | ResetModel(); |
---|
2808 | 3131 | refreshContents(true); |
---|
2809 | | - } |
---|
| 3132 | + } else if (event.getSource() == editCameraItem) |
---|
| 3133 | + { |
---|
| 3134 | + cameraView.ProtectCamera(); |
---|
| 3135 | + cameraView.repaint(); |
---|
| 3136 | + return; |
---|
| 3137 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3138 | + { |
---|
| 3139 | + cameraView.RevertCamera(); |
---|
| 3140 | + cameraView.repaint(); |
---|
| 3141 | + return; |
---|
| 3142 | + // } else if (event.getSource() == textureButton) |
---|
| 3143 | + // { |
---|
| 3144 | + // return; // true; |
---|
| 3145 | + } |
---|
2810 | 3146 | else |
---|
2811 | 3147 | { |
---|
2812 | 3148 | //return super.action(event, arg); |
---|
.. | .. |
---|
2824 | 3160 | if (useclient) |
---|
2825 | 3161 | { |
---|
2826 | 3162 | cameraView.object = client; |
---|
2827 | | - cameraView.lighttouched = true; |
---|
| 3163 | + Globals.lighttouched = true; |
---|
2828 | 3164 | //topView.object = client; |
---|
2829 | 3165 | //frontView.object = client; |
---|
2830 | 3166 | //sideView.object = client; |
---|
.. | .. |
---|
2832 | 3168 | else |
---|
2833 | 3169 | { |
---|
2834 | 3170 | cameraView.object = group; |
---|
2835 | | - cameraView.lighttouched = true; |
---|
| 3171 | + Globals.lighttouched = true; |
---|
2836 | 3172 | //topView.object = group; |
---|
2837 | 3173 | //frontView.object = group; |
---|
2838 | 3174 | //sideView.object = group; |
---|
.. | .. |
---|
2867 | 3203 | refreshContents(); |
---|
2868 | 3204 | } |
---|
2869 | 3205 | |
---|
| 3206 | + void TransformChildren() |
---|
| 3207 | + { |
---|
| 3208 | + Object3D obj; |
---|
| 3209 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3210 | + { |
---|
| 3211 | + obj = (Object3D)e.nextElement(); |
---|
| 3212 | + obj.KeepTextureMatrices(); |
---|
| 3213 | + obj.TransformChildren(); |
---|
| 3214 | + obj.RestoreTextureMatrices(); |
---|
| 3215 | + |
---|
| 3216 | +// if (obj.parent == null) |
---|
| 3217 | +// { |
---|
| 3218 | +// System.out.println("NULL PARENT!"); |
---|
| 3219 | +// new Exception().printStackTrace(); |
---|
| 3220 | +// } |
---|
| 3221 | +// else |
---|
| 3222 | +// TouchTransform(obj); |
---|
| 3223 | +// //obj.parent.Touch(); |
---|
| 3224 | + } |
---|
| 3225 | + |
---|
| 3226 | + refreshContents(); |
---|
| 3227 | + } |
---|
2870 | 3228 | |
---|
2871 | 3229 | void ResetTransform() |
---|
2872 | 3230 | { |
---|
.. | .. |
---|
2979 | 3337 | refreshContents(); |
---|
2980 | 3338 | } |
---|
2981 | 3339 | |
---|
2982 | | - void ResetCentroid() |
---|
| 3340 | + void ResetCentroid(boolean full) |
---|
2983 | 3341 | { |
---|
2984 | 3342 | Object3D obj; |
---|
2985 | 3343 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2994 | 3352 | LA.matIdentity(Object3D.mat); |
---|
2995 | 3353 | obj.getBounds(minima, maxima, false); |
---|
2996 | 3354 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
2997 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3355 | + if (full) |
---|
| 3356 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
2998 | 3357 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
2999 | 3358 | obj.TransformMesh(Object3D.mat); |
---|
| 3359 | + |
---|
3000 | 3360 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3001 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3361 | + if (full) |
---|
| 3362 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3002 | 3363 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3364 | + |
---|
3003 | 3365 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3004 | 3366 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3005 | 3367 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3065 | 3427 | obj = (Object3D)e.nextElement(); |
---|
3066 | 3428 | |
---|
3067 | 3429 | System.out.println("Object is: " + obj); |
---|
3068 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3430 | + Grafreed.AnalyzeObject(obj); |
---|
3069 | 3431 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3070 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3432 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3071 | 3433 | |
---|
3072 | 3434 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3073 | 3435 | } |
---|
.. | .. |
---|
3109 | 3471 | void GenNormals(boolean crease) |
---|
3110 | 3472 | { |
---|
3111 | 3473 | group.GenNormalsS(crease); |
---|
| 3474 | + |
---|
| 3475 | + refreshContents(); |
---|
| 3476 | + } |
---|
| 3477 | + |
---|
| 3478 | + void GenNormalsMINE() |
---|
| 3479 | + { |
---|
| 3480 | + group.selection.GenNormalsMINE(); |
---|
3112 | 3481 | |
---|
3113 | 3482 | refreshContents(); |
---|
3114 | 3483 | } |
---|
.. | .. |
---|
3157 | 3526 | |
---|
3158 | 3527 | //Object3D buffer; |
---|
3159 | 3528 | 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 | | - |
---|
| 3529 | +// BoundaryRep temprep; |
---|
| 3530 | +// Object3D nodes; |
---|
| 3531 | +// Vector<Vertex> vertices; |
---|
| 3532 | +// |
---|
| 3533 | +// cGroup buffer; |
---|
| 3534 | +// |
---|
| 3535 | +// public void Vertex(Object3D node, Vertex v) |
---|
| 3536 | +// { |
---|
| 3537 | +//// vertices.add(v); |
---|
| 3538 | +//// nodes.addElement(node); |
---|
| 3539 | +//// |
---|
| 3540 | +//// if (temprep.GetCache(v) != null) |
---|
| 3541 | +//// { |
---|
| 3542 | +//// temprep.Remove(v); |
---|
| 3543 | +//// } else |
---|
| 3544 | +//// { |
---|
| 3545 | +//// temprep.Remember(v); |
---|
| 3546 | +//// } |
---|
| 3547 | +// |
---|
| 3548 | +// //Object3D node = nodes.get(index); |
---|
| 3549 | +// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3550 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3551 | +// |
---|
| 3552 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3553 | +// |
---|
| 3554 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3555 | +// |
---|
| 3556 | +// cGroup g = new cGroup(); |
---|
| 3557 | +// |
---|
| 3558 | +// if (g.toParent == null) |
---|
| 3559 | +// { |
---|
| 3560 | +// g.toParent = LA.newMatrix(); |
---|
| 3561 | +// g.fromParent = LA.newMatrix(); |
---|
| 3562 | +// } |
---|
| 3563 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3564 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3565 | +// |
---|
| 3566 | +// g.add(GrafreeD.clipboard); |
---|
| 3567 | +// |
---|
| 3568 | +// buffer.add(g); |
---|
| 3569 | +// } |
---|
| 3570 | +// |
---|
| 3571 | +// public void Face(Object3D node, Face f) |
---|
| 3572 | +// { |
---|
| 3573 | +// |
---|
| 3574 | +// } |
---|
| 3575 | +// |
---|
| 3576 | +// void ParseVerticesOld() // ?? |
---|
| 3577 | +// { |
---|
| 3578 | +// //if (group.selection.size() != 1) |
---|
| 3579 | +// // return; |
---|
| 3580 | +// |
---|
| 3581 | +// temprep = new BoundaryRep(); |
---|
| 3582 | +// nodes = new Object3D(); |
---|
| 3583 | +// vertices = new Vector<Vertex>(); |
---|
| 3584 | +// |
---|
| 3585 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3586 | +// GrafreeD.epsequal = true; |
---|
| 3587 | +// |
---|
| 3588 | +// for (int i=0; i<group.selection.size(); i++) |
---|
| 3589 | +// { |
---|
| 3590 | +// Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3591 | +// |
---|
| 3592 | +// group.selection.get(i).Parse( |
---|
| 3593 | +//this ); |
---|
| 3594 | +// |
---|
| 3595 | +// int repsize = temprep.VertexCount(); |
---|
| 3596 | +// int tablesize = temprep.vertextable.size(); |
---|
| 3597 | +// int nodesize = nodes.size(); |
---|
| 3598 | +// |
---|
| 3599 | +// assert(vertices.size() == nodes.size()); |
---|
| 3600 | +// |
---|
| 3601 | +// temprep.vertextable.elements(); |
---|
| 3602 | +// |
---|
| 3603 | +// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3604 | +// |
---|
| 3605 | +// for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
| 3606 | +// { |
---|
| 3607 | +// cGroup g = new cGroup(); |
---|
| 3608 | +// |
---|
| 3609 | +// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
| 3610 | +// |
---|
| 3611 | +// Object3D node = nodes.get(index); |
---|
| 3612 | +// temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3613 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3614 | +// |
---|
| 3615 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3616 | +// |
---|
| 3617 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3618 | +// |
---|
| 3619 | +// if (g.toParent == null) |
---|
| 3620 | +// { |
---|
| 3621 | +// g.toParent = LA.newMatrix(); |
---|
| 3622 | +// g.fromParent = LA.newMatrix(); |
---|
| 3623 | +// } |
---|
| 3624 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3625 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3626 | +// |
---|
| 3627 | +// g.add(GrafreeD.clipboard); |
---|
| 3628 | +// |
---|
| 3629 | +// buffer.add(g); |
---|
| 3630 | +// } |
---|
| 3631 | +// |
---|
| 3632 | +// makeSomething(buffer, i==group.selection.size()-1); |
---|
| 3633 | +// } |
---|
| 3634 | +// |
---|
| 3635 | +// GrafreeD.epsequal = epsequal; |
---|
| 3636 | +// |
---|
| 3637 | +// //buffer = null; |
---|
| 3638 | +// temprep = null; |
---|
| 3639 | +// nodes = null; |
---|
| 3640 | +// |
---|
| 3641 | +// refreshContents(); |
---|
| 3642 | +// } |
---|
| 3643 | + |
---|
3184 | 3644 | void ParseVertices() |
---|
3185 | 3645 | { |
---|
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; |
---|
| 3646 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3647 | + Grafreed.epsequal = true; |
---|
3195 | 3648 | |
---|
3196 | 3649 | for (int i=0; i<group.selection.size(); i++) |
---|
3197 | 3650 | { |
---|
3198 | | - Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3651 | + final cGroup buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
3199 | 3652 | |
---|
3200 | | - group.selection.get(i).Parse(this); |
---|
3201 | | - |
---|
3202 | | - int repsize = temprep.VertexCount(); |
---|
3203 | | - int tablesize = temprep.vertextable.size(); |
---|
3204 | | - int nodesize = nodes.size(); |
---|
| 3653 | + group.selection.get(i).Parse( |
---|
| 3654 | + |
---|
| 3655 | + new iParse() |
---|
| 3656 | + { |
---|
| 3657 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3658 | + { |
---|
| 3659 | + temp.set(v); |
---|
| 3660 | + LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3205 | 3661 | |
---|
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(); |
---|
| 3662 | + cGroup g = new cGroup(); |
---|
3211 | 3663 | |
---|
3212 | | - for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
3213 | | - { |
---|
3214 | | - cGroup g = new cGroup(); |
---|
| 3664 | + if (g.toParent == null) |
---|
| 3665 | + { |
---|
| 3666 | + g.toParent = LA.newMatrix(); |
---|
| 3667 | + g.fromParent = LA.newMatrix(); |
---|
| 3668 | + } |
---|
| 3669 | + LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3670 | + LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3215 | 3671 | |
---|
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); |
---|
| 3672 | + g.add(Grafreed.clipboard); |
---|
3220 | 3673 | |
---|
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); |
---|
| 3674 | + buffer.add(g); |
---|
| 3675 | + } |
---|
3232 | 3676 | |
---|
3233 | | - g.add(GraphreeD.clipboard); |
---|
| 3677 | + public void Face(Object3D node, Face f) |
---|
| 3678 | + { |
---|
3234 | 3679 | |
---|
3235 | | - buffer.add(g); |
---|
3236 | | - } |
---|
| 3680 | + } |
---|
| 3681 | + } |
---|
| 3682 | + ); |
---|
3237 | 3683 | |
---|
3238 | 3684 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3239 | 3685 | } |
---|
3240 | 3686 | |
---|
3241 | | - GraphreeD.epsequal = epsequal; |
---|
3242 | | - |
---|
3243 | | - //buffer = null; |
---|
3244 | | - temprep = null; |
---|
3245 | | - nodes = null; |
---|
| 3687 | + Grafreed.epsequal = epsequal; |
---|
3246 | 3688 | |
---|
3247 | 3689 | refreshContents(); |
---|
3248 | 3690 | } |
---|
3249 | | - |
---|
| 3691 | + |
---|
| 3692 | + void TextureVertices() |
---|
| 3693 | + { |
---|
| 3694 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3695 | + { |
---|
| 3696 | + group.selection.get(i).Parse( |
---|
| 3697 | + new iParse() |
---|
| 3698 | + { |
---|
| 3699 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3700 | + { |
---|
| 3701 | + cTexture tex = node.GetTextures(); |
---|
| 3702 | + String pigment = Object3D.GetPigment(tex); |
---|
| 3703 | + //String bump = Object3D.GetBump(tex); |
---|
| 3704 | + |
---|
| 3705 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3706 | + |
---|
| 3707 | + try |
---|
| 3708 | + { |
---|
| 3709 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3710 | + } |
---|
| 3711 | + catch (Exception e) |
---|
| 3712 | + { |
---|
| 3713 | + System.err.println("FAIL: " + node); |
---|
| 3714 | + } |
---|
| 3715 | + |
---|
| 3716 | + double s = v.s; |
---|
| 3717 | + |
---|
| 3718 | + if (s == 1) |
---|
| 3719 | + s = 0; |
---|
| 3720 | + |
---|
| 3721 | + double t = v.t; |
---|
| 3722 | + |
---|
| 3723 | + if (t == 1) |
---|
| 3724 | + t = 0; |
---|
| 3725 | + |
---|
| 3726 | + int indexs = (int) (texturedata.getWidth() * s); |
---|
| 3727 | + int indext = (int) (texturedata.getHeight() * t); |
---|
| 3728 | + |
---|
| 3729 | + int index = indext * texturedata.getWidth() + indexs; |
---|
| 3730 | + |
---|
| 3731 | + java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer(); |
---|
| 3732 | + |
---|
| 3733 | + int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3734 | + |
---|
| 3735 | + float scale = bytebuf.get(index*slide) & 0xFF; |
---|
| 3736 | + scale += bytebuf.get(index*slide+1) & 0xFF; |
---|
| 3737 | + scale += bytebuf.get(index*slide+2) & 0xFF; |
---|
| 3738 | + scale /= 3; |
---|
| 3739 | + |
---|
| 3740 | + scale /= 0xFF; |
---|
| 3741 | + // c'est quoi ca? scale /= 4; |
---|
| 3742 | + |
---|
| 3743 | + //v.AO = scale; |
---|
| 3744 | + |
---|
| 3745 | + v.x += v.norm.x * scale; |
---|
| 3746 | + v.y += v.norm.y * scale; |
---|
| 3747 | + v.z += v.norm.z * scale; |
---|
| 3748 | + } |
---|
| 3749 | + |
---|
| 3750 | + public void Face(Object3D node, Face f) |
---|
| 3751 | + { |
---|
| 3752 | + } |
---|
| 3753 | + } |
---|
| 3754 | + ); |
---|
| 3755 | + } |
---|
| 3756 | + |
---|
| 3757 | + refreshContents(); |
---|
| 3758 | + } |
---|
| 3759 | + |
---|
3250 | 3760 | void Align() |
---|
3251 | 3761 | { |
---|
| 3762 | + if (group.selection.size() == 0) |
---|
| 3763 | + return; |
---|
| 3764 | + |
---|
| 3765 | + cVector bbmin = new cVector(); |
---|
| 3766 | + cVector bbmax = new cVector(); |
---|
| 3767 | + |
---|
| 3768 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3769 | + |
---|
| 3770 | + double dx = bbmax.x - bbmin.x; |
---|
| 3771 | + double dy = bbmax.y - bbmin.y; |
---|
| 3772 | + double dz = bbmax.z - bbmin.z; |
---|
| 3773 | + |
---|
| 3774 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3775 | + |
---|
3252 | 3776 | for (int i=0; i<group.selection.size(); i++) |
---|
3253 | 3777 | { |
---|
3254 | 3778 | Object3D obj = group.selection.get(i); |
---|
3255 | 3779 | |
---|
3256 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3257 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3780 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3781 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3258 | 3782 | } |
---|
3259 | 3783 | |
---|
3260 | 3784 | refreshContents(); |
---|
.. | .. |
---|
3267 | 3791 | // ref.SaveSupports(); |
---|
3268 | 3792 | // Object3D par = ref.parent; |
---|
3269 | 3793 | // ref.parent = null; |
---|
3270 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3794 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3271 | 3795 | // ref.parent = par; |
---|
3272 | 3796 | // ref.RestoreSupports(); |
---|
3273 | 3797 | |
---|
.. | .. |
---|
3275 | 3799 | |
---|
3276 | 3800 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3277 | 3801 | |
---|
3278 | | - boolean random = CameraPane.RANDOM; |
---|
3279 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3802 | + boolean random = CameraPane.SWITCH; |
---|
| 3803 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3280 | 3804 | lowres.linkVerticesThis(null); |
---|
3281 | 3805 | lowres.linkVerticesThis(sn); |
---|
3282 | | - CameraPane.RANDOM = random; |
---|
| 3806 | + CameraPane.SWITCH = random; |
---|
3283 | 3807 | |
---|
3284 | 3808 | System.err.flush(); |
---|
3285 | 3809 | |
---|
.. | .. |
---|
3297 | 3821 | // lowres.SaveSupports(); |
---|
3298 | 3822 | // par = lowres.parent; |
---|
3299 | 3823 | // lowres.parent = null; |
---|
3300 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3824 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3301 | 3825 | Object3D newlow = CloneObject(lowres, false); |
---|
3302 | 3826 | newlow.name = sn.switchobject.get(i).name; |
---|
3303 | 3827 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3319 | 3843 | return; |
---|
3320 | 3844 | |
---|
3321 | 3845 | Object3D poses = group.selection.get(0); |
---|
3322 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3846 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3323 | 3847 | |
---|
3324 | 3848 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3325 | 3849 | |
---|
.. | .. |
---|
3488 | 4012 | group.selection.RelinkToSupport(); // july 2014 |
---|
3489 | 4013 | System.out.println("DONE."); |
---|
3490 | 4014 | refreshContents(); |
---|
3491 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4015 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3492 | 4016 | } |
---|
3493 | 4017 | |
---|
3494 | 4018 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3513 | 4037 | |
---|
3514 | 4038 | void ClipMesh() |
---|
3515 | 4039 | { |
---|
3516 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 4040 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3517 | 4041 | { |
---|
3518 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 4042 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3519 | 4043 | |
---|
3520 | 4044 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3521 | 4045 | content = ((cGroup)content).get(0); |
---|
3522 | 4046 | |
---|
3523 | 4047 | // for (int i=0; i<group.selection.size(); i++) |
---|
3524 | 4048 | // { |
---|
3525 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 4049 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3526 | 4050 | // } |
---|
3527 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4051 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3528 | 4052 | } |
---|
3529 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4053 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3530 | 4054 | System.out.println("DONE."); |
---|
3531 | 4055 | refreshContents(); |
---|
3532 | 4056 | } |
---|
.. | .. |
---|
3659 | 4183 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3660 | 4184 | |
---|
3661 | 4185 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3662 | | - if(elem != group) |
---|
| 4186 | + if(elem != group || !newWindow) |
---|
3663 | 4187 | { |
---|
3664 | 4188 | // if (!(elem instanceof Composite)) |
---|
3665 | 4189 | // newWindow = false; |
---|
.. | .. |
---|
3764 | 4288 | System.err.println("info : " + child.GetPath()); |
---|
3765 | 4289 | } |
---|
3766 | 4290 | } |
---|
3767 | | - else |
---|
3768 | | - { |
---|
3769 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3770 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3771 | | - System.err.println("info : " + group.GetPath()); |
---|
3772 | | - } |
---|
| 4291 | +// else |
---|
| 4292 | +// { |
---|
| 4293 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4294 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4295 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4296 | +// } |
---|
3773 | 4297 | |
---|
3774 | 4298 | objEditor.SetText(); // jan 2014 |
---|
3775 | 4299 | |
---|
3776 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4300 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
3777 | 4301 | CameraPane.flash = true; |
---|
3778 | 4302 | |
---|
3779 | 4303 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
3780 | 4304 | // a camera |
---|
3781 | 4305 | { |
---|
3782 | 4306 | 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; |
---|
| 4307 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4308 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4309 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3786 | 4310 | } |
---|
3787 | 4311 | |
---|
3788 | 4312 | refreshContents(); |
---|
.. | .. |
---|
3864 | 4388 | { |
---|
3865 | 4389 | if (group.selection.isEmpty()) |
---|
3866 | 4390 | return; |
---|
3867 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4391 | + Grafreed.clipboardIsTempGroup = false; |
---|
3868 | 4392 | Composite tGroup = null; |
---|
3869 | 4393 | if (group.selection.size() > 0) // 1) |
---|
3870 | 4394 | { |
---|
3871 | 4395 | tGroup = new cGroup(); |
---|
3872 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4396 | + Grafreed.clipboardIsTempGroup = true; |
---|
3873 | 4397 | } |
---|
3874 | 4398 | |
---|
3875 | 4399 | if (cut) |
---|
.. | .. |
---|
3909 | 4433 | //System.out.println("cut " + child); |
---|
3910 | 4434 | //System.out.println("parent = " + child.parent); |
---|
3911 | 4435 | // tmp.addChild(child); |
---|
3912 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4436 | + if (Grafreed.clipboardIsTempGroup) |
---|
3913 | 4437 | tGroup.add/*Child*/(tmp); |
---|
3914 | 4438 | else |
---|
3915 | | - GraphreeD.clipboard = tmp; |
---|
| 4439 | + Grafreed.clipboard = tmp; |
---|
3916 | 4440 | } |
---|
3917 | 4441 | else |
---|
3918 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4442 | + if (Grafreed.clipboardIsTempGroup) |
---|
3919 | 4443 | tGroup.add/*Child*/(child); |
---|
3920 | 4444 | else |
---|
3921 | | - GraphreeD.clipboard = child; |
---|
| 4445 | + Grafreed.clipboard = child; |
---|
3922 | 4446 | } |
---|
3923 | 4447 | |
---|
3924 | 4448 | //ResetModel(); |
---|
.. | .. |
---|
3950 | 4474 | //System.out.println("cut " + elem); |
---|
3951 | 4475 | //System.out.println("parent = " + elem.parent); |
---|
3952 | 4476 | // tmp.addChild(elem); |
---|
3953 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4477 | + if (Grafreed.clipboardIsTempGroup) |
---|
3954 | 4478 | tGroup.add/*Child*/(tmp); |
---|
3955 | 4479 | else |
---|
3956 | | - GraphreeD.clipboard = tmp; |
---|
| 4480 | + Grafreed.clipboard = tmp; |
---|
3957 | 4481 | } |
---|
3958 | 4482 | else |
---|
3959 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4483 | + if (Grafreed.clipboardIsTempGroup) |
---|
3960 | 4484 | tGroup.add/*Child*/(child); |
---|
3961 | 4485 | else |
---|
3962 | | - GraphreeD.clipboard = child; |
---|
| 4486 | + Grafreed.clipboard = child; |
---|
3963 | 4487 | } |
---|
3964 | 4488 | |
---|
3965 | 4489 | } |
---|
3966 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
3967 | | - GraphreeD.clipboard = tGroup; |
---|
| 4490 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4491 | + Grafreed.clipboard = tGroup; |
---|
3968 | 4492 | if (cut) |
---|
3969 | 4493 | { |
---|
3970 | 4494 | ResetModel(); |
---|
.. | .. |
---|
3974 | 4498 | |
---|
3975 | 4499 | void paste(boolean expand) |
---|
3976 | 4500 | { |
---|
3977 | | - // if (GraphreeD.clipboard == null) |
---|
| 4501 | + // if (GrafreeD.clipboard == null) |
---|
3978 | 4502 | // return; |
---|
3979 | 4503 | boolean first = true; |
---|
3980 | 4504 | |
---|
3981 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4505 | + if (Grafreed.clipboardIsTempGroup) |
---|
3982 | 4506 | { |
---|
3983 | 4507 | Composite temp; |
---|
3984 | 4508 | |
---|
.. | .. |
---|
3989 | 4513 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
3990 | 4514 | */ |
---|
3991 | 4515 | Object3D elem; |
---|
3992 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4516 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
3993 | 4517 | { |
---|
3994 | 4518 | Object3D child = (Object3D)e.nextElement(); |
---|
3995 | 4519 | |
---|
.. | .. |
---|
4003 | 4527 | else |
---|
4004 | 4528 | elem = child.deepCopy(); // ? |
---|
4005 | 4529 | child.parent = keepparent; |
---|
4006 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4530 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4007 | 4531 | // elem = elem.get(0); |
---|
4008 | 4532 | makeSomething(elem, true); // ?? first); |
---|
4009 | 4533 | //group.addChild(elem); |
---|
.. | .. |
---|
4023 | 4547 | //Object3D cb = Applet3D.clipboard; |
---|
4024 | 4548 | //temp.addChild(cb); |
---|
4025 | 4549 | //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()); |
---|
| 4550 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4551 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4552 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4553 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4554 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4031 | 4555 | else |
---|
4032 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4033 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4556 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4557 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4034 | 4558 | } |
---|
4035 | 4559 | |
---|
4036 | 4560 | ResetModel(); |
---|
4037 | 4561 | refreshContents(); |
---|
4038 | 4562 | } |
---|
4039 | 4563 | |
---|
4040 | | - void pasteInto(boolean copyit) |
---|
| 4564 | + void pasteInto(boolean copyit, boolean clone) |
---|
4041 | 4565 | { |
---|
4042 | | -// if (GraphreeD.clipboard == null) |
---|
| 4566 | +// if (GrafreeD.clipboard == null) |
---|
4043 | 4567 | // return; |
---|
4044 | 4568 | |
---|
4045 | 4569 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4066 | 4590 | if (copyit) |
---|
4067 | 4591 | { |
---|
4068 | 4592 | // paste(false); |
---|
4069 | | - CloneClipboard(false); // sept 2014 |
---|
| 4593 | + if (clone) |
---|
| 4594 | + { |
---|
| 4595 | + CloneClipboard(false); // sept 2014 |
---|
| 4596 | + } |
---|
| 4597 | + else |
---|
| 4598 | + { |
---|
| 4599 | + paste(false); |
---|
| 4600 | + } |
---|
4070 | 4601 | } |
---|
4071 | 4602 | else |
---|
4072 | 4603 | { |
---|
4073 | 4604 | boolean first = true; |
---|
4074 | 4605 | |
---|
4075 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4606 | + if (Grafreed.clipboardIsTempGroup) |
---|
4076 | 4607 | { |
---|
4077 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4608 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4078 | 4609 | Object3D copy; |
---|
4079 | 4610 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4080 | 4611 | { |
---|
.. | .. |
---|
4084 | 4615 | } |
---|
4085 | 4616 | } else |
---|
4086 | 4617 | { |
---|
4087 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4618 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4088 | 4619 | } |
---|
4089 | 4620 | } |
---|
4090 | 4621 | } |
---|
.. | .. |
---|
4276 | 4807 | makeSomething(csg); |
---|
4277 | 4808 | } |
---|
4278 | 4809 | |
---|
| 4810 | + void Ungroup(Object3D g) |
---|
| 4811 | + { |
---|
| 4812 | + if (g instanceof HiddenObject) |
---|
| 4813 | + { |
---|
| 4814 | + HiddenObject h = (HiddenObject) g; |
---|
| 4815 | + |
---|
| 4816 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4817 | + { |
---|
| 4818 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4819 | + } |
---|
| 4820 | + } |
---|
| 4821 | + else |
---|
| 4822 | + { |
---|
| 4823 | + for (int i=0; i<g.Size(); i++) |
---|
| 4824 | + { |
---|
| 4825 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4826 | + } |
---|
| 4827 | + } |
---|
| 4828 | + } |
---|
| 4829 | + |
---|
4279 | 4830 | void ungroup() |
---|
4280 | 4831 | { |
---|
4281 | 4832 | /* |
---|
.. | .. |
---|
4469 | 5020 | } |
---|
4470 | 5021 | */ |
---|
4471 | 5022 | |
---|
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 | 5023 | /* |
---|
4488 | 5024 | public void Callback(Object obj) |
---|
4489 | 5025 | { |
---|
.. | .. |
---|
4507 | 5043 | } |
---|
4508 | 5044 | */ |
---|
4509 | 5045 | |
---|
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 | 5046 | String GetFile(String dialogName) |
---|
4528 | 5047 | { |
---|
4529 | | - if (GraphreeD.standAlone) |
---|
| 5048 | + if (Grafreed.standAlone) |
---|
4530 | 5049 | { |
---|
4531 | 5050 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4532 | 5051 | browser.show(); |
---|
.. | .. |
---|
4590 | 5109 | cButton flashSelectionButton; |
---|
4591 | 5110 | cButton editButton; |
---|
4592 | 5111 | cButton uneditButton; |
---|
| 5112 | + JCheckBox allParamsButton; |
---|
4593 | 5113 | cButton clearpanelButton; |
---|
4594 | | - cButton allParamsButton; |
---|
4595 | 5114 | cButton unselectButton; |
---|
4596 | 5115 | |
---|
| 5116 | + cButton oneStepButton; |
---|
| 5117 | + |
---|
4597 | 5118 | cButton screenfitButton; |
---|
4598 | 5119 | cButton screenfitpointButton; |
---|
4599 | 5120 | cButton snapobjectButton; |
---|
.. | .. |
---|
4635 | 5156 | private MenuItem resetsupportItem; |
---|
4636 | 5157 | private MenuItem resetreferencesItem; |
---|
4637 | 5158 | private MenuItem linkverticesItem; |
---|
| 5159 | + private MenuItem relinkverticesItem; |
---|
4638 | 5160 | private MenuItem setMasterItem; |
---|
4639 | | - private MenuItem resetMeshItem; |
---|
| 5161 | + private MenuItem resetAllItem; |
---|
4640 | 5162 | private MenuItem stepAllItem; |
---|
4641 | 5163 | private MenuItem revertMeshItem; |
---|
4642 | 5164 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4647 | 5169 | private MenuItem mergeGeometriesItem; |
---|
4648 | 5170 | private MenuItem copyItem; |
---|
4649 | 5171 | private MenuItem pasteItem; |
---|
| 5172 | + private MenuItem pasteIntoItem; |
---|
4650 | 5173 | private MenuItem pasteLinkItem; |
---|
4651 | 5174 | private MenuItem pasteCloneItem; |
---|
4652 | 5175 | private MenuItem pasteExpandItem; |
---|
4653 | 5176 | private MenuItem clearItem; |
---|
4654 | 5177 | private MenuItem clearAllItem; |
---|
4655 | 5178 | private MenuItem genUVItem; |
---|
| 5179 | + private MenuItem genNormalsMESHItem; |
---|
4656 | 5180 | private MenuItem genNormalsCADItem; |
---|
4657 | 5181 | private MenuItem genNormalsORGANItem; |
---|
| 5182 | + private MenuItem genNormalsMINEItem; |
---|
4658 | 5183 | private MenuItem stripifyItem; |
---|
4659 | 5184 | private MenuItem unstripifyItem; |
---|
4660 | 5185 | private MenuItem trimItem; |
---|
.. | .. |
---|
4694 | 5219 | private MenuItem panoTexturesItem; |
---|
4695 | 5220 | |
---|
4696 | 5221 | private MenuItem resetCentroidItem; |
---|
4697 | | - private MenuItem transformgeometryItem; |
---|
| 5222 | + private MenuItem resetCentroidXZItem; |
---|
4698 | 5223 | private MenuItem resetTransformItem; |
---|
| 5224 | + private MenuItem transformGeometryItem; |
---|
| 5225 | + private MenuItem transformChildrenItem; |
---|
| 5226 | + private MenuItem hideItem; |
---|
4699 | 5227 | private MenuItem grabItem; |
---|
4700 | 5228 | private MenuItem backItem; |
---|
4701 | 5229 | private MenuItem frontItem; |
---|
.. | .. |
---|
4716 | 5244 | |
---|
4717 | 5245 | private MenuItem resetParentItem; |
---|
4718 | 5246 | private MenuItem repairParentItem; |
---|
| 5247 | + private MenuItem repairShadowItem; |
---|
4719 | 5248 | private MenuItem sortbysizeItem; |
---|
4720 | 5249 | private MenuItem sortbynameItem; |
---|
4721 | 5250 | |
---|
.. | .. |
---|
4728 | 5257 | private MenuItem particleItem; |
---|
4729 | 5258 | private MenuItem ragdollItem; |
---|
4730 | 5259 | private MenuItem ragdoll2Item; |
---|
| 5260 | + private MenuItem heightFieldItem; |
---|
| 5261 | + private MenuItem textureFieldItem; |
---|
4731 | 5262 | private MenuItem gridItem; |
---|
4732 | 5263 | private MenuItem rectoidItem; |
---|
4733 | 5264 | private MenuItem ellipsoidItem; |
---|
4734 | 5265 | private MenuItem coneItem; |
---|
4735 | 5266 | private MenuItem torusItem; |
---|
4736 | 5267 | private MenuItem superItem; |
---|
| 5268 | + private MenuItem kleinItem; |
---|
4737 | 5269 | private MenuItem blobItem; |
---|
4738 | 5270 | private MenuItem latheItem; |
---|
4739 | 5271 | private MenuItem bezierItem; |
---|
4740 | | - private MenuItem checkerItem; |
---|
| 5272 | + private MenuItem overlayItem; |
---|
4741 | 5273 | private MenuItem meshItem; |
---|
4742 | 5274 | // private MenuItem meshGroupItem; |
---|
4743 | 5275 | private MenuItem springItem; |
---|
.. | .. |
---|
4746 | 5278 | private MenuItem csgItem; |
---|
4747 | 5279 | private MenuItem templateItem; |
---|
4748 | 5280 | private MenuItem textureItem; |
---|
| 5281 | + private MenuItem billboardItem; |
---|
4749 | 5282 | private MenuItem shadowXItem; |
---|
4750 | 5283 | private MenuItem shadowYItem; |
---|
4751 | 5284 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4758 | 5291 | private MenuItem doubleItem; |
---|
4759 | 5292 | private MenuItem tripleItem; |
---|
4760 | 5293 | |
---|
4761 | | - private MenuItem importGFDItem; |
---|
4762 | | - private MenuItem importVRMLX3DItem; |
---|
4763 | | - private MenuItem import3DSItem; |
---|
4764 | | - private MenuItem importOBJItem; |
---|
4765 | | - |
---|
4766 | 5294 | private MenuItem computeAOItem; |
---|
4767 | 5295 | private MenuItem recompileItem; |
---|
4768 | 5296 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4772 | 5300 | private MenuItem analyzeItem; |
---|
4773 | 5301 | private MenuItem dumpItem; |
---|
4774 | 5302 | //boolean freezemodel = false; |
---|
| 5303 | + |
---|
| 5304 | + Menu cameraMenu; |
---|
| 5305 | + MenuItem editCameraItem; |
---|
| 5306 | + MenuItem revertCameraItem; |
---|
4775 | 5307 | } |
---|