Re: [chlor-develop] CSegment
Status: Pre-Alpha
Brought to you by:
lenny222
|
From: <chl...@li...> - 2006-03-19 20:16:35
|
>> Fair enough, I 'll add it back. > > Thanks. > >> out of sync with the object. We need to decide if we will prevent >> changing internal objects (change certain objects to immutable >> objects) or create the boundingbox always dynamically. >> I prefer the first, a little overhead at first but when carefully >> constructed, the easiest to work with. Creating a bounding box >> everytime when needed, might be too > > I prefer the first as well. > >> A third possibility where a parent is notified everytime a child >> object is modified, adds too much complexity and can fail very >> easily. > > I don't see the contradiction here. If a visitor modifies a > segment, the parental path needs to be informed. The segment can do > that, like we currently have it. We just should prevent direct > access to the NSMutableArrays. In the first option, all changes are made through the Path instance. A node of the path is moved using a method of Path moveNode. Segments and nodes don't have any methods that can change their content. (no moveTo or wathever). Although this makes changing a path a bit more difficult, it helps to keep things simple and consistent. A bounding box at node or segment level is absolutely not needed. In the third option, it is possible to change the content of a node or segment through moveTo or other methods. The parent path object listens on changes and changes its state accordingly. This complicates things heavily as each child node or segment needs to keep a reference to its parent. Kind regards, Marc |