Re: redesign of layers?



At 05.08.2011 12:43, Arigead wrote:
[...] So one female banana might be on 5 "pages/layers" as it's
connected to 5 different circuits. It's only shown on the master diagram once
with a lot of interconnections but for clarity you can view just the
"page/layer" you're interested in to figure out what you're looking at.

The big problem with the above in terms of Dia is that it is the complete
opposite of the hierarchy of the Dia data structure when saved to file
diagram.dia.
Yes, it sounds like turning everything upside down. Does not look very feasible to me.

At present the<objects>  of the diagram are children of the
<layer>. So layer one has five children objects.

<dia:layer name="Background" visible="true" active="true">
     <dia:object type="Circuit - Vertical Resistor" version="1" id="O0">
      </dia:object>
     <dia:object type="Circuit - Vertical Resistor (European)" version="1"
id="O1">
      </dia:object>
     .
     .
     .
</dia:layer>


The way I'm talking the object is the parent and has a list of layers on which
it can be seen:

<dia:object type="Circuit - Vertical Resistor" version="1" id="O0">
       <dia:attribute name="layers">
           <dia:layer val="background"/>
           <dia:layer val="Heating Circuit"/>
       </dia:attribute>

That is a major change in how things are done, and humans hate change.
That change would break a lot of things. Not only forward/backward compatibility of exisiting diagrams. But also drawing order, layer specific selections, ...

I'm new
here so I'm not seeing the bigger picture. There is obviously a reason why
things are the way that they are, even if I'm too green to see it. In addition
there might well be a very good reason why what I have suggested is complete
madness in a drawing package like Dia.

I would not even design it that way if starting from scratch for your use case. If I understand correctly there are only some objects which would be available on every (or many) layers. In a multi layer circuit board the circuit pathes are on a dedicated layer. Only at some spots there would be a connection between layers.

I'd be interested in hearing the experts opinions. I've not started looking
into the code to see how much would have to be changed. I'd imagine a fair bit
but it's not going to effect the core of the Dia drawing code.
Dia is drawing it's layers from bottom to top and not by global object order so the core (and plugin drawing code would be affected.

The load and
save routines which read and write the ".dia" files and the code for viewing
layers. Instead of a layer having a list of visable objects the code would
have to check all objects to see if they're on a visable layer. Slower I know
but hopefully not too slow.

Maybe you should grep the Dia source for 'layer' to adjust your expectations.

As an aside when I think of my "pages" I think a tabbed window of the pages
might be logical. That's another days work though ;-)

Sorry I don't get why you call the layers "pages". What's wrong with layers [ http://en.wikipedia.org/wiki/2D_computer_graphics#Layers ]

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



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