Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!spock!kim From: kim@spock (Kim Letkeman) Newsgroups: comp.object Subject: Re: Should objects draw themselves? Message-ID: <4099@kim> Date: 9 Aug 90 16:02:47 GMT References: <12873@rouge.usl.edu> Organization: Mitel. Kanata (Ontario). Canada. Lines: 49 In-reply-to: pcb@gator.cacs.usl.edu's message of 8 Aug 90 18:21:04 GMT In article <12873@rouge.usl.edu>, pcb@gator.cacs.usl.edu (Peter C. Bahrs) writes: | I agree somewhat, but consider the following. What happens when these | objects have to draw themselves in relation to other objects, i.e. if | objects have priorities (such as in a graphics system where farther objects | are drawn first 'painters algorithm')? | | This is compicated when user defined objects contain the drawable primitives. | Suppose object A has a list of squares and circles and only N of the should | be drawn in state S. Now there are multiple objects like A and all of them | need theirselves represented in some relation R to each other. | | I guess some procedure sifts through all objects to be drawn, queries each | object by sending them some kind of 'where are you so I can compare you | to others and determine if you should really draw yourself now' message. | | The other technique is is to pass the drawing area to each object and | since each object must be made of primitive(s) that can draw themselves, | then this object can draw itself. | | What about 3D drawables...3d- to 2d conversion, perspective transformation? I feel that it is much too difficult to build this much understanding into the object itself. (Including the understanding of graphical versus textual representation as described in the posting to which the above is a response.) If an object is a square, then it should be able to display itself without thinking about the world in which it happens to exist at this time. It is, in fact, the rest of the world (i.e. other objects such as the world, the view port, the physical device in use ...) that must be able to interpret the displayed object and present it correctly. This requires that an intermediate graphical language be used that can render any object to the best level of detail required. The object may then be concerned with displaying itself in this known language and should never have to change. As well, additional (new) objects will have no effect on existing objects. Other objects that are stimulated by these graphical commands when an object is drawing itself would render it by whatever rules are in place at the time of drawing. (For example, a text window object might just display "4x4 yellow square at 4,21,5" where a graphical display window might render the same visually.) I am really impressed by the separation of function that can be achieved with OOP. But trying to teach every object about every other part of the system creates more problems than it solves. -- Kim Letkeman mitel!spock!kim@uunet.uu.net