[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [Gnash-dev] invalidated bounds redesign - advice needed

From: Udo Giacomozzi
Subject: Re[2]: [Gnash-dev] invalidated bounds redesign - advice needed
Date: Tue, 13 Feb 2007 18:41:24 +0100

Hello strk,

Tuesday, February 13, 2007, 4:08:33 PM, you wrote:
s>         template <class T>
s>         class SnappingRanges<T> // how do you like the name ? :)
s>         {
s>         public:

s>                 typedef Range2d<T> RangeType;

s>                 // Add a Range to the set, merging when
s>                 // possible and appropriate
s>                 //
s>                 add(const RangeType& range);

Looks good. This function would go through the list of ranges and see
if it intersects somewhere. If not, the range is added to the list.

As a final step all stored ranges are compared against each other (to
see if they intersect) and are merged again, if necessary.

This step could be done with each add() call, but it probably takes up
more CPU and won't save much memory.

s>                 // Substract a Range (needed? hope not!)
s>                 substract(const RangeType& range);

No, that's unnecessary.

s>                 /// Visit the current Ranges set
s>                 //
s>                 /// Visitor instance will be invoked
s>                 /// for each RangeType in the current set.
s>                 ///
s>                 template <class V> void visit(V& v) const;

What's this?

s>         private:

s>                 typedef std::list<RangeType> RangeList;

s>                 // The current Ranges list
s>                 RangeList _ranges;

s>         };

Seems like a nice class to me :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]