mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2025-04-21 12:27:27 +03:00
cameo/: new commands "remove" and "keep" for path filtering (untested)
This commit is contained in:
21
cameo/path.c
21
cameo/path.c
@@ -75,7 +75,7 @@ static struct path *path_from(const struct path *old)
|
||||
}
|
||||
|
||||
|
||||
static struct point *clone_point(struct point *p)
|
||||
static struct point *clone_point(const struct point *p)
|
||||
{
|
||||
struct point *n;
|
||||
|
||||
@@ -156,6 +156,25 @@ struct path *path_reverse(const struct path *path)
|
||||
}
|
||||
|
||||
|
||||
struct path *path_clone(const struct path *path)
|
||||
{
|
||||
struct path *new;
|
||||
const struct point *p;
|
||||
struct point *n;
|
||||
|
||||
new = path_from(path);
|
||||
for (p = path->first; p; p = p->next) {
|
||||
n = clone_point(p);
|
||||
if (new->first)
|
||||
new->last->next = n;
|
||||
else
|
||||
new->first = n;
|
||||
new->last = n;
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
|
||||
static void path_reverse_inplace(struct path *path)
|
||||
{
|
||||
struct point *points = NULL, *p, *next;
|
||||
|
||||
Reference in New Issue
Block a user