On Mon, 18 Jun 2001, Cyrille Chepelov wrote:
> Le dim, jun 17, 2001, à 10:41:24 +0000, James K. Lowden a écrit:
>
> > It seems to me it should be possible to use Dia to create Dia shapes.
>
> [snip]
>
> > Does anyone think this is infeasible? Worthwhile?
>
> infeasible, certainly not. In fact, dia already has a shape export plug-in,
> which isn't bad for producing a "first shot" suitable for hand-tuning.
> Worthwile ? Certainly !
>
> I'm not sure having automatic editing of sheets saves more trouble than it
> brings service -- I have no firm idea on that though. That could certainly make
> sense in a "more power to the user" policy.
>
> Having a connection point tool in the toolbox could be interesting -- in
> fact, it should be trivial to do: an empty shape with a single connection
> point (just one thing to do: check that the custom code doesn't break
> because of the emptiness of such a shape). The shape export plug-in could be
> tweaked to export only shape connection points (from the CP shape I just
> described) if there are any CP shapes -- or work as it currently does if the
> user didn't bring any CP shapes.
>
> Hmmm, thinking again on it, it might be good to write the standalone CP as a
> full-fledged object, just so that its colour could be different -- a shade
> of red, for instance. This requires to check renderer->isinteractive in
> the standalonecp_draw() method. (deriving from an element definitely sounds
> like the better choice).
Sounds like a great idea. So the `connection point' shape would only draw
itself if the renderer was interactive. This would mean that the shape
export plugin would not include the connection points in the SVG part of
the shape file it exports. It could then walk the diagram tree a second
time looking for connection point objects and use their locations in the
resulting sheet file (these two steps may be reversed).
Designed like this, CP objects would also be invisible when printed, which
is probably the desired behaviour. It might also be useful to have a
property to make a CP always visible.
I think the easiest way of doing this would be to define the new CP
object in the shape export plugin itself (so that the shape export plugin
has a reference to the CP object ops struct, which makes it easy to check
if an object is a CP).
James.