Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!gatech!udel!rochester!cornell!uw-beaver!ssc-vax!housen From: housen@ssc-vax.UUCP (Kevin Housen) Newsgroups: comp.sys.mac.programmer Subject: Selecting objects in a drawing program Message-ID: <1997@ssc-vax.UUCP> Date: 9 Jun 88 20:01:39 GMT Organization: Boeing Aerospace Corp., Seattle WA Lines: 21 Im writing a program which will have certain aspects of an object-oriented drawing program, like MacDraw or MacDraft. The user will be able to draw some primitives like lines, arcs, circles, rects etc. and will be able to select objects and edit them. There could be lots of objects (>1000?). My question is - does anyone know of an efficient algorithm for detecting which object, if any, was selected when a mouse-down occurs? How do programs such as MacDraw, MacDraft, SuperPaint, etc do this? Also, what criteria do these programs use to determine when a polyline or polygon is selected? MacDraw and SuperPaint highlite the object when you click within a certain distance of one of the lines comprising an object. MacDrafts criterion isnt obvious. Any help or suggestions are appreciated. Thanks heaps... Kevin Housen