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

David García Garzón dgarcia at iua.upf.edu
Fri Jun 13 06:13:33 PDT 2008


On Divendres 13 Juny 2008, Pau Arumí Albó wrote:
> El dv 13 de 06 de 2008 a les 13:38 +0200, en/na David García Garzón va
> > > A different issue:
> > >
> > > Have you considered not passing the geometryMap between Network and
> > > Canvas?
> > > The network could offer two methods with a processing key, like this.
> > >
> > >         Network::AddProcessingGeometry(processing, geometry)
> > >         ProcessingGeometry =
> > > Network::GetProcessingGeometry(processing) Wouldn't this be simpler (in
> > > terms of interface and avoiding coupling)? But maybe I'am missing
> > > something. Natanael, David, please go on with your opinions.
> >
> > I would like the setter and moreover it it was
> > AddProcessingGeometry(name,x,y,w,h) as we remove the coupling with a
> > network structure, but the getter is the one that clears the geometry if
> > we do getter call in a per processing basis we would need a explicit
> > clear call.
>
> Yes -- and I like being explicit :)

And it was explicit on a previously proposed name:

Network::GetAndClearGeometries()




> >  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.







-- 
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/bf4918d9/attachment-0003.pgp>


More information about the clam-devel mailing list