David Scherer wrote:
> > Is it possible to subclass visual objects like "sphere" and "cone"?
>
> No, but there may be another way to accomplish your goal. Can you be more
> specific about what you want? Are you trying to change the rendering
> behavior of the objects, or just add methods and properties?
I know that it is possible to store additional attibutes in a visual object,
but subclassing would have been more elegant. The problem was this, that I
already had a class called "Mass" which had several attributes including x,
y, z. If the visual objects could have been subclassed, I would have derived
my Mass class from visual.sphere, and due to the usage of x, y, z in my Mass
class, I would have got visualization for free. Because this is not possible
I had to store a visual.sphere object in my Mass class and rewrote every
usage of x, y, z in my class to use the visual.sphere x,y,z instead.
Storing additional attributes in visual objects is nice, but in my case
subclassing would have been more elegant.
Do you think there is a better solution.
Thanks, and have fun,
Markus
--
|\/\/\/|
/------------------------------------------------------------------\ | |
| Markus GRITSCH | phone: +43 / 1 / 58801-36015 | | |
| Institute for Microelectronics | cellular: +43 / 676 / 4973431 | | (o)(o)
| Technical University of Vienna | fax: +43 / 1 / 58801-36099 | C _)
| Gusshausstrasse 27-29 / E360 | email: gr...@iu... | | ,___|
| A-1040 Vienna / AUSTRIA | SMS: 436...@ma... | | /
\------------------------------------------------------------------/ /____\
/ \
"Computers let you make more mistakes faster than any other invention in human
history, with the possible exception of handguns and tequila."
Mitch Radcliffe
|