summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5e39da)
raw | patch | inline | side by side (parent: c5e39da)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 1 Apr 2006 03:04:55 +0000 (03:04 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 1 Apr 2006 03:04:55 +0000 (03:04 +0000) |
src/splivarot.cpp | patch | blob | history | |
src/splivarot.h | patch | blob | history |
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index df5b82710f419980843e6144a49df6d080d03145..8dbdcdfd79afe19b3358604019f1edc7a79292c2 100644 (file)
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
#include "livarot/Path.h"
#include "livarot/Shape.h"
-Path *Path_for_item(SPItem *item, bool doTransformation, bool transformFull = true);
+#include "splivarot.h"
+
bool Ancetre(Inkscape::XML::Node *a, Inkscape::XML::Node *who);
void sp_selected_path_boolop(bool_op bop);
return dest;
}
-NR::Maybe<Path::cut_position> get_nearest_position_on_Path(SPItem *item, NR::Point p)
+NR::Maybe<Path::cut_position> get_nearest_position_on_Path(Path *path, NR::Point p)
{
- //Create and initialize a livarot Path
- Path *path = Path_for_item(item, true, true);
- if (path == NULL) {
- return NR::Nothing();
- }
- path->ConvertWithBackData(0.01);
-
//get nearest position on path
Path::cut_position pos = path->PointToCurvilignPosition(p);
- delete path;
return pos;
}
-NR::Point get_point_on_Path(SPItem *item, int piece, double t)
+NR::Point get_point_on_Path(Path *path, int piece, double t)
{
- //Create and initialize a livarot Path
- Path *path = Path_for_item(item, true, true);
- path->ConvertWithBackData(0.01);
-
- //get nearest position on path
NR::Point p;
path->PointAt(piece, t, p);
- delete path;
return p;
}
diff --git a/src/splivarot.h b/src/splivarot.h
index ae83d22bbc52cd228737a1da7a765c2321a83a4a..4e73eac9f913ed20b943a45370f9c87e97287d70 100644 (file)
--- a/src/splivarot.h
+++ b/src/splivarot.h
// simplifies a path (removes small segments and the like)
void sp_selected_path_simplify ();
-NR::Maybe<Path::cut_position> get_nearest_position_on_Path(SPItem *item, NR::Point p);
-NR::Point get_point_on_Path(SPItem *item, int piece, double t);
+Path *Path_for_item(SPItem *item, bool doTransformation, bool transformFull = true);
+NR::Maybe<Path::cut_position> get_nearest_position_on_Path(Path *path, NR::Point p);
+NR::Point get_point_on_Path(Path *path, int piece, double t);
#endif