Subject: Re: [boost] Preview 4 of the Generic Geometry Library (ggl)
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2009-02-23 18:00:14
Barend Gehrels wrote:
> So conceptually Box might be seen a refinement of a Polygon. In
> all algorithms for a box (keep in mind that Box here means an axis
> aligned box) are different. We've also defined different, pragmatic,
> access algorithms for it such as getting the min/max corners. And we
> didn't implement the polygon operations on it such as the outer ring,
> inner rings, etc because it makes no sense. So no, the Box in our code
> is not a refinement for a Polygon. The box was just an example but in
> the end: refinements seem not applicable (besides Const/non Const)
Hmm, my rectangle can be viewed as a const polygon (refinement of polygon) because I have implemented a generic specialization of the polygon traits for any object that models rectangle, but like you I don't use it that way most of the time and do what you describe with accessors and algorithms that are specific to rectangle. I tend to special case rectangles out, most VLSI layout data is rectangles, so rectangles are really special to us.
When you say refinements seem not applicable, do you mean refinements in general, or just in the case of rectangle/polygon? I have been curious about how you might implement refinement in your tag dispatching based API as I understand it, and I couldn't come up with an answer. If refinement used/supported by your API, or do you think it is not needed except for Const/non Const? I'm curious to hear you elaborate on that.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk