[Clam-devel] Copy & Paste processings on canvas patch

David García Garzón dgarcia at iua.upf.edu
Fri Jun 13 08:01:32 PDT 2008


On Divendres 13 Juny 2008, Pau Arumí Albó wrote:
> El dv 13 de 06 de 2008 a les 15:13 +0200, en/na David García Garzón va
>
> escriure:
> > > >  Also that
> > > > way of doing will ask for every processing even if you don't have
> > > > geometry for it (transition period, see previous comment) so you
> > > > don't have a way to know whether (0,0,0,0) was a real geometry or
> > > > just it hadnt geometry at all.
> > >
> > > Easy, let (*,*,0,0) be a non-existing geometry (we don't want invisible
> > > boxes).
> >
> > Yes, Pau but you should compare the size with zero in order to use the
> > one in the pos file. For me is even clearer to iterate along a map and
> > set just the ones that are present. At that point it is just a matter of
> > taste.
> >
> > if (posfile exist)
> > 	load pos file
> > dict = network.GetAndClearGeometries()
> > for key, geometry in dict
> > 	boxes[key].setGeometry(geometry)
> >
> > c++ code would be not that clear but i like this procedure.
>
> I also like this scheme, but the point is "do we want to couple the
> Canvas with two new Network types?"
> Specially when we are in the process of abstracting the Canvas so it can
> be used with an abstract Model interface (that is, in non NetworkEditor
> contexts)
>
> What about that? Do you buy it?
>
> for key in Canvas:
>         int x,y, w,h
>         bool exists
>
>         network.getGeometry(x,y,w,h,exists)
>         if not exists: continue
>         boxes[key].setGeometry(x,y,w,h)
>
> P

This is already network coupled code. I mean, having to load or storing a clam 
network is something in ClamNetworkCanvas, not the abstract NetworkCanvas.


-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080613/511aadf3/attachment-0003.pgp>


More information about the clam-devel mailing list