From: Joel de Guzman (joel_at_[hidden])
Date: 2005-06-28 12:01:32
Anis Benyelloul wrote:
> Joel de Guzman <joel <at> boost-consulting.com> writes:
>>How do you plan to implement your regions? If your Points can use
>>native platform points, I assume your regions can also use native
>>platform regions? Or are we talking about different things?
>>I'm interested on how you can make it use the Macintosh classic Region,
> Well, let me think of it.... What is a region ? A collection of (non-
> overlapping ?) boxes. Now what is a collection of boxes ?
> - std::vector<box>
> - boost::array<box, 20>
> - box ; // Note: a single box !
> - XRegion ;// Maybe some pre-existing region object in other libraries
> As you see, the problem is quite the same: for one abstraction (region) being
> able to choose among many implementations, and just "plug" them in some
> convenient wrapper class.
> Actually, I haven't studied much the subject, but it doesn't seem of extrem
> complexity ...
Well, not so fast. Been there done that. The problem is how to
interoperate on two regions. Example: I need to XOR a YRegion
with a MacRegion. The thing is, a classic mac region is an
opaque data type (actually, it's not implemented as a collection
of boxes). The mere fact that it is opaque makes it impossible
to even copy a mac region to a YRegion.
-- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk