home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18044 < prev    next >
Encoding:
Internet Message Format  |  1992-11-06  |  1.4 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!uwm.edu!daffy!uwvax!heurikon!vme.heurikon.com!kah
  2. From: kah@vme.heurikon.com (Ken Heitke)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Object Drawing question
  5. Message-ID: <1848@heurikon.heurikon.com>
  6. Date: 5 Nov 92 16:19:04 GMT
  7. Sender: news@heurikon.heurikon.com
  8. Reply-To: kah@heurikon.heurikon.com (Ken Heitke)
  9. Distribution: na
  10. Organization: Heurikon Corporation, Madison, WI
  11. Lines: 18
  12.  
  13. I have been tinkering around with a simple object drawing program and have
  14. been wondering about the best data structures to use to handle quick selection
  15. and update of objects.  I want to be able to handle several hundred objects.
  16.  
  17. The brute force method would be to maintain a simple list of all the objects and
  18. then traverse the list check if the point is in the object (I know how to do
  19. this).  I would rather store the objects to reduce the number of objects that
  20. have to be tested (sorted list, Btree, etc).
  21.  
  22. Also when it comes to update events, the brute force method is to erase
  23. everything and then traverse the list and draw each object in the list.  I would
  24. again like to minimize the number of objects to be tested and redrawn.
  25.  
  26. How is this usually handled or is the brute force method sufficient.  Any
  27. pointers to books, articles, code samples, etc would be appreciated.
  28.  
  29.                 thanks,
  30.                 Ken Heitke    ken.heitke@heurikon.com
  31.