Code

Extensions. XAML export improvements.
[inkscape.git] / src / livarot / sweep-tree-list.cpp
1 #include <glib/gmem.h>
2 #include "livarot/sweep-tree.h"
3 #include "livarot/sweep-tree-list.h"
6 SweepTreeList::SweepTreeList(int s) :
7     nbTree(0),
8     maxTree(s),
9     trees((SweepTree *) g_malloc(s * sizeof(SweepTree))),
10     racine(NULL)
11 {
12     /* FIXME: Use new[] for trees initializer above, but watch out for bad things happening when
13      * SweepTree::~SweepTree is called.
14      */
15 }
18 SweepTreeList::~SweepTreeList()
19 {
20     g_free(trees);
21     trees = NULL;
22 }
25 SweepTree *SweepTreeList::add(Shape *iSrc, int iBord, int iWeight, int iStartPoint, Shape */*iDst*/)
26 {
27     if (nbTree >= maxTree) {
28         return NULL;
29     }
31     int const n = nbTree++;
32     trees[n].MakeNew(iSrc, iBord, iWeight, iStartPoint);
34     return trees + n;
35 }
38 /*
39   Local Variables:
40   mode:c++
41   c-file-style:"stroustrup"
42   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
43   indent-tabs-mode:nil
44   fill-column:99
45   End:
46 */
47 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :