Re: Interesting interactions between objects and renderers



If it may be of any help... or trigger some new ideas...

Lars Clausen wrote on 24 Mar 2002 18:56:35 -0600:

When a line gets an arrow at the end, the endpoint of the line should be
moved backwards at least to the backside of the arrow, possibly to the
backside of the stem, if such is used.  I did this in the renderer, and it
worked well.  There were some problems with it though:

My first thoughts given your general descriptions of the problems (and
earlier discussions) were taking me in the direction of applying a
Decorator pattern to this problem. In that case, all this "arrow
related" logic would go into a special (preferrably generic) Arrow
Decorator which would also be responsible for any endpoint translations,
mouse click & bb coordinate transformations, etc...

The renderer interface might require some adaptions to support this
paradigm though, considering especially...
3) We can't just move the actual endpoint of the line, as some renderers
   (xfig, pstricks?) will want to render the line as 'line with arrow'
   rather than 'line' and 'arrowhead'.  They would want to know the
   original points.

But IIRC, you Lars -- or was it Cyrille? -- also had an idea earlier of
making "overridable methods" in the renderer in such a way that the
"default" (base method) would do things the hard way, doing everything
itself, while concrete renderers could override and implement the
advanced functions (like "arrow with arrowheads" and "bezier") if their
target would support that directly.


Any ideas are welcome!

Just some quick thoughts, you're problably more into the details and its
specific problems here than I am right now, Lars.


BTW, as Cyrille Chepelov wrote on Mon, 25 Mar 2002 07:42:56 +0100:
aware of the transforms the objects is applying onto itself -- I really can
see this going as a generic layer over the existing routines, for the
general case of whole-object transforms.

...which is also along the ways of the Decorator idea, more or less,
isn't it?



Regards,

-+-Ben-+-



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