Code

Rename LPE: mirror reflect --> mirror symmetry
[inkscape.git] / src / live_effects / lpe-vonkoch.cpp
index 760295ed7867b724409346d8cb70db2520380a2f..e448682909149d022d4385141fb7ba8fccf54f36 100644 (file)
@@ -9,15 +9,9 @@
 #include <cstdio>
 
 #include "live_effects/lpe-vonkoch.h"
-#include "sp-shape.h"
-#include "sp-item.h"
-#include "sp-path.h"
-#include "display/curve.h"
-#include <libnr/n-art-bpath.h>
-#include <libnr/nr-matrix-fns.h>
-#include "live_effects/n-art-bpath-2geom.h"
 #include "svg/svg.h"
 #include "ui/widget/scalar.h"
+#include "nodepath.h"
 
 #include <2geom/sbasis.h>
 #include <2geom/sbasis-geometric.h>
@@ -41,7 +35,7 @@ void
 VonKochPathParam::param_setup_nodepath(Inkscape::NodePath::Path *np)
 {  
     PathParam::param_setup_nodepath(np);
-    np->straight_path = true;
+    sp_nodepath_make_straight_path(np);
 }
 
 static const Util::EnumData<VonKochRefType> VonKochRefTypeData[VKREF_END] = {
@@ -76,7 +70,7 @@ LPEVonKoch::~LPEVonKoch()
 }
 
 std::vector<Geom::Path>
-LPEVonKoch::doEffect_path (std::vector<Geom::Path> & path_in)
+LPEVonKoch::doEffect_path (std::vector<Geom::Path> const & path_in)
 {
     using namespace Geom;
     std::vector<Geom::Path> generating_path = path_from_piecewise(generator.get_pwd2(),.01);//TODO what should that tolerance be?
@@ -165,12 +159,12 @@ LPEVonKoch::resetDefaults(SPItem * item)
 
     // set the bend path to run horizontally in the middle of the bounding box of the original path
     Piecewise<D2<SBasis> > pwd2;
-    std::vector<Geom::Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d"));
+    std::vector<Geom::Path> temppath = sp_svg_read_pathv( SP_OBJECT_REPR(item)->attribute("inkscape:original-d"));
     for (unsigned int i=0; i < temppath.size(); i++) {
         pwd2.concat( temppath[i].toPwSb() );
     }
 
-    D2<Piecewise<SBasis> > d2pw = make_cuts_independant(pwd2);
+    D2<Piecewise<SBasis> > d2pw = make_cuts_independent(pwd2);
     Interval bndsX = bounds_exact(d2pw[0]);
     Interval bndsY = bounds_exact(d2pw[1]);
     Point start(bndsX.min(), (bndsY.max()+bndsY.min())/2);