Fresco/Berlin/modules/Figures FigureKitImpl.cc,1.23,1.24
Tobias Hunger <[email protected]>
| Newsgroups | gmane.comp.video.fresco.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/fresco/Fresco/Berlin/modules/Figures
In directory purcel:/tmp/cvs-serv9995/Berlin/modules/Figures
Modified Files:
FigureKitImpl.cc
Log Message:
Cleanup the cleanup.
A new template create_and_set_body added to KitImpl. That gets us around the
need to define a temporary in most places, shortening the code even further.
Index: FigureKitImpl.cc
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/modules/Figures/FigureKitImpl.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- FigureKitImpl.cc 23 Jan 2003 22:31:03 -0000 1.23
+++ FigureKitImpl.cc 25 Jan 2003 22:37:01 -0000 1.24
@@ -41,15 +41,14 @@
Graphic_ptr FigureKitImpl::root(Graphic_ptr g)
{
- Graphic_ptr res =
- create<Graphic>(new TransformAllocator(Alignment(0.5),
- Alignment(0.5),
- Alignment(0.5),
- Alignment(0.5),
- Alignment(0.5),
- Alignment(0.5)));
- res->body(g);
- return res;
+ return
+ create_and_set_body<Graphic>(new TransformAllocator(Alignment(0.5),
+ Alignment(0.5),
+ Alignment(0.5),
+ Alignment(0.5),
+ Alignment(0.5),
+ Alignment(0.5)),
+ g);
}
Graphic_ptr FigureKitImpl::fitter(Graphic_ptr g)
@@ -125,16 +124,12 @@
Graphic_ptr FigureKitImpl::texture(Graphic_ptr g, Raster_ptr raster)
{
- Graphic_ptr res = create<Graphic>(new Texture(raster));
- res->body(g);
- return res;
+ return create_and_set_body<Graphic>(new Texture(raster), g);
}
Graphic_ptr FigureKitImpl::transformer(Graphic_ptr g)
{
- Graphic_ptr res = create<Graphic>(new Transformer);
- res->body(g);
- return res;
+ return create_and_set_body<Graphic>(new Transformer, g);
}