On Thu, 28 Oct 1999, Cyrille Chepelov (home) wrote:

> 
> Hi all,
> 
> In order to draw Substances-Field Model (SFM) diagrams, I need some new
> line types ; SFM modeling makes a heavy use of "wobbling" or "waved"
> lines, and currently dia is unable to represent them.
> 
> At first thought (and begin of implementation), I just thought about
> simply adding new line types (ZIGZAG, WAVED) to the current LineStyle
> enum. However, there's a problem : in fact, the line geometry is quite
> independent from its drawing style ; some folk may want a dotted waved
> line, after all. 
> This requires either to make the line style a struct of enums, or adding a
> whole new property to each function drawing mono or polylines. Anyone has
> an advice on what's the best way (new line styles, LineStyle becomes
> struct LineStyle, or add a LineGeometry property).

Don't add this to the renderer interface. That should only contain the
"low-level" operations. It's mostly the intersection between X and
postscript operations, although bezier curves has been added because they
are needed.

> This brings me to another question : not all renderers know how to draw
> some features, say, Bezier lines or waved lines. Some do. Those which
> don't usually try to "manually" approach these features using more
> primitive er, primitives.  
> I think it should be great to have a "renderhelper" module with default
> implementations for those "not so" primitives (Beziers, zig-zag'ed lines,
> etc.). This brings me to have a small complaint : some renderers (I
> seriously looked at only the GTK one) drop the "coord" units once they
> converted coordinates into their implementation's system. When I want to
> draw a zig-zag line using the helper functions, bing ! I need to know the
> line width, in dia units (because I draw using generic renderer
> primitives). 
> I think all renderers should save the *original* arguments to
> set_foo_property() somewhere in struct Renderer, so that the idea of
> helper functions is feasible...

Well. I see no reason to move the gdk bezier renderer to a higher level
of abstraction. It's performance and implementation demands that it work
on pixel level instead of coordinate level.

I look at the renderer as the "low-level" drawing api, much like
assembler. If you want to do higher level drawing, like i.e. arrows or
wobbly lines, you make helper functions for this and place them in lib/.
This way you minimize the work to port a renderer and can re-use the
render-independent code.
 
> I'll probably have a 2-day coding block this week end (if NZ wins, which
> is unfortunately quite probable), so I might tackle one or more of these
> issues (I find the CVS tree is rarely in a compilable state, so I'll start
> by using 0.80)

If the cvs tree doesn't compile (and you got the correct version of
libtool, automake and autoconf) this is a *bug*, and i will not find out
it if someone doesn't tell me. I try to always keep cvs in a buildable
(and usable) state. (This has been untrue a while when i implemented undo,
but should be true now.) Please tell me when stuff breaks. 

There has been a lot of bugfixes in the cvs tree. It's a fair bit more
stable. I plan to fix one more thing, and then i have a person running
purify on Dia, so I might have some bugfixes from that too. Then i'm gonna
release 0.81 in the weekend.
 
> Oh, also, I'll have to build a GRAFCET sheet and a European logic diagram
> sheet (I use dia to teach industrial automatisms, and I'm required to not
> use ANSI ones). One feature I'd really like is to be able to specify the
> bounding box of a text, and have the font size adjust automatically (so
> that when an object in a group is enlarged, the text does likewise).
> Ooops, no time.
 This should be possible. Just a small matter of coding.

> Last feature request, this one must be a quite common one, I want to be
> able to rotate about anything, at least by 90° increments (arbitrary
> increments would make me really really happy, but it's not yet Christmas) 
> Ooops, large changes, I fear.
This one is hard i fear. See my recent posting to dia-list. The problem
is that X doesn't allow drawing rotated text or ellipses.
 
> Well, I'll first see GRAFCET, logic diagrams and waved arrows, this is
> almost "emergency" stuff for me right now.

 Hack on!

/ Alex

Reply via email to