Code

add verticalpattern checkbox to path-along-path and some parameters that are not...
authorjohanengelen <johanengelen@users.sourceforge.net>
Sat, 15 Sep 2007 21:45:42 +0000 (21:45 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sat, 15 Sep 2007 21:45:42 +0000 (21:45 +0000)
src/live_effects/lpe-skeletalstrokes.cpp
src/live_effects/lpe-skeletalstrokes.h
src/live_effects/parameter/parameter.cpp

index e1c54b4cf9c15e9102f0d24387090073e8cfdf99..31d4cfc2f556d3b7470e4d0814682cd8fcd4a1aa 100644 (file)
@@ -62,12 +62,20 @@ LPESkeletalStrokes::LPESkeletalStrokes(LivePathEffectObject *lpeobject) :
     pattern(_("Pattern source"), _("Path to put along the skeleton path"), "pattern", &wr, this, "M0,0 L1,0"),\r
     copytype(_("Pattern copies"), _("How many pattern copies to place along the skeleton path"), "copytype", SkelCopyTypeConverter, &wr, this, SSCT_SINGLE_STRETCHED),\r
     prop_scale(_("Width"), _("Width of the pattern"), "prop_scale", &wr, this, 1),\r
-    scale_y_rel(_("Width in units of length"), _("Scale the width of the pattern in units of its length"), "scale_y_rel", &wr, this, false)\r
+    scale_y_rel(_("Width in units of length"), _("Scale the width of the pattern in units of its length"), "scale_y_rel", &wr, this, false),\r
+    spacing(_("Spacing"), _("Space between copies of the pattern"), "spacing", &wr, this, 0),\r
+    normal_offset(_("Normal offset"), "", "normal_offset", &wr, this, 0),\r
+    tang_offset(_("Tangential offset"), "", "tang_offset", &wr, this, 0),\r
+    vertical_pattern(_("Pattern is vertical"), "", "vertical_pattern", &wr, this, false)\r
 {\r
     registerParameter( dynamic_cast<Parameter *>(&pattern) );\r
     registerParameter( dynamic_cast<Parameter *>(&copytype) );\r
     registerParameter( dynamic_cast<Parameter *>(&prop_scale) );\r
     registerParameter( dynamic_cast<Parameter *>(&scale_y_rel) );\r
+//    registerParameter( dynamic_cast<Parameter *>(&spacing) );\r
+//    registerParameter( dynamic_cast<Parameter *>(&normal_offset) );\r
+//    registerParameter( dynamic_cast<Parameter *>(&tang_offset) );\r
+    registerParameter( dynamic_cast<Parameter *>(&vertical_pattern) );\r
 \r
     prop_scale.param_set_digits(3);\r
     prop_scale.param_set_increments(0.01, 0.10);\r
@@ -94,8 +102,8 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in
     n = force_continuity(remove_short_cuts(n,.1));\r
 \r
     D2<Piecewise<SBasis> > patternd2 = make_cuts_independant(pattern);\r
-    Piecewise<SBasis> x=Piecewise<SBasis>(patternd2[0]);\r
-    Piecewise<SBasis> y=Piecewise<SBasis>(patternd2[1]);\r
+    Piecewise<SBasis> x = vertical_pattern.get_value() ? Piecewise<SBasis>(patternd2[1]) : Piecewise<SBasis>(patternd2[0]);\r
+    Piecewise<SBasis> y = vertical_pattern.get_value() ? Piecewise<SBasis>(patternd2[0]) : Piecewise<SBasis>(patternd2[1]);\r
     Interval pattBnds = bounds_exact(x);\r
     x -= pattBnds.min();\r
     Interval pattBndsY = bounds_exact(y);\r
index 1bd28668053876f55989632e11043d178aa805bc..919f09b8ec15d83c4a8f56bbc5ca862fb2823b15 100644 (file)
@@ -37,6 +37,10 @@ private:
     EnumParam<SkelCopyType> copytype;\r
     ScalarParam  prop_scale;\r
     BoolParam scale_y_rel;\r
+    ScalarParam  spacing;\r
+    ScalarParam  normal_offset;\r
+    ScalarParam  tang_offset;\r
+    BoolParam    vertical_pattern;\r
 \r
     void on_pattern_pasted();\r
 \r
index bb7ea4c9e7f4dca3cb2b0c47230e4296c18fc066..faed7c389d6cce0d725544f3e157dcada07a2fce 100644 (file)
@@ -120,9 +120,12 @@ void
 ScalarParam::param_make_integer(bool yes)\r
 {\r
     integer = yes;\r
+    digits = 0;\r
+    inc_step = 1;\r
+    inc_page = 10;\r
     if (rsu) {\r
-        rsu->getS()->setDigits(0);\r
-        rsu->getS()->setIncrements(1, 10);\r
+        rsu->getS()->setDigits(digits);\r
+        rsu->getS()->setIncrements(inc_step, inc_page);\r
     }\r
 }\r
 \r
@@ -133,8 +136,6 @@ ScalarParam::param_getWidget()
         rsu = new Inkscape::UI::Widget::RegisteredScalar();\r
         rsu->init(param_label, param_tooltip, param_key, *param_wr, param_effect->getRepr(), param_effect->getSPDoc());\r
         rsu->setValue(value);\r
-        if (integer)\r
-            param_make_integer();\r
         rsu->getS()->setDigits(digits);\r
         rsu->getS()->setIncrements(inc_step, inc_page);\r
 \r