Yes it is a bit confusing - to be honest I think having a hasChanged() function on a class that doesn't have some kind of update() function is a little unclear as to when we're interested in the changes having happened.

If the functions already public though then my suggestion would be similar to your comment:
- Mark bHasChanged as true whenever functions are called that logically change the object - the same time as when bCacheIsDirty is set to true.
- Only update bCacheIsDirty when the cache then gets updated.
- Either 1. Set bHasChanged back to false when hasChanged is called, or 2. Add a function clearHasChangedFlag() or something.

The problem with 1 is that the function can only be used in one place - also the name of the function suggests it's just reading a value rather than modifying the object. But 2 may cause compatibility problems as it's a change in how the class behaves.

Prob best to go with 1. Is there a more general OF standard on this?

Tim

On 21 May 2013, at 12:25 pm, Memo Akten wrote:

> In libs/openFrameworks/graphics/ofPolyline.h:
> 
> > @@ -124,22 +127,70 @@ class ofPolyline {
> >  
> >  	vector<ofPoint> & getVertices();
> >  
> > -	float getPerimeter() const;
> > +	float getPerimeter();
> Yes there is a public hasChanged() method, and it does clear the bHasChanged flag. this is potentially problematic. having a separate bCacheIsDirty flag makes sense (which is not visible from outside in any way). However then when is the bHasChanged flag cleared? There is actually a comment thread about this very issue https://github.com/openframeworks/openFrameworks/pull/2053#issuecomment-18007250 I'm happy to make the changes as soon as this issue is resolved.
> —
> Reply to this email directly or view it on GitHub.
>