summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-04 01:47:32 +0000
committerCampbell Barton <ideasman42@gmail.com>2012-10-04 01:47:32 +0000
commit864134765a33823e2040c012ec383bebd7dd5743 (patch)
treec96543a601418602694e3222b11151264e52d96a /src/live_effects
parentcode cleanup: add own includes to cpp files or make the functions static if t... (diff)
downloadinkscape-864134765a33823e2040c012ec383bebd7dd5743.tar.gz
inkscape-864134765a33823e2040c012ec383bebd7dd5743.zip
code cleanup: make more functions static or include their own headers.
(bzr r11736)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/lpe-gears.cpp3
-rw-r--r--src/live_effects/lpe-knot.cpp7
-rw-r--r--src/live_effects/lpe-powerstroke.cpp16
-rw-r--r--src/live_effects/lpe-rough-hatches.cpp4
-rw-r--r--src/live_effects/spiro.cpp8
5 files changed, 20 insertions, 18 deletions
diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp
index e57f5112e..003e22567 100644
--- a/src/live_effects/lpe-gears.cpp
+++ b/src/live_effects/lpe-gears.cpp
@@ -112,7 +112,8 @@ private:
}
};
-void makeContinuous(D2<SBasis> &a, Point const b) {
+static void
+makeContinuous(D2<SBasis> &a, Point const b) {
for(unsigned d=0;d<2;d++)
a[d][0][0] = b[d];
}
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index d3dd10d26..746dbbb7a 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -51,7 +51,7 @@ public:
};
-Geom::Path::size_type size_nondegenerate(Geom::Path const &path) {
+static Geom::Path::size_type size_nondegenerate(Geom::Path const &path) {
Geom::Path::size_type retval = path.size_open();
// if path is closed and closing segment is not degenerate
@@ -283,7 +283,7 @@ CrossingPoints::get(unsigned const i, unsigned const ni)
return CrossingPoint();
}
-unsigned
+static unsigned
idx_of_nearest(CrossingPoints const &cpts, Geom::Point const &p)
{
double dist=-1;
@@ -500,7 +500,8 @@ LPEKnot::doEffect_path (std::vector<Geom::Path> const &path_in)
//recursively collect gpaths and stroke widths (stolen from "sp-lpe_item.cpp").
-void collectPathsAndWidths (SPLPEItem const *lpeitem, std::vector<Geom::Path> &paths, std::vector<double> &stroke_widths){
+static void
+collectPathsAndWidths (SPLPEItem const *lpeitem, std::vector<Geom::Path> &paths, std::vector<double> &stroke_widths){
if (SP_IS_GROUP(lpeitem)) {
GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem));
for ( GSList const *iter = item_list; iter; iter = iter->next ) {
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp
index 88a20c68a..69d0808e4 100644
--- a/src/live_effects/lpe-powerstroke.cpp
+++ b/src/live_effects/lpe-powerstroke.cpp
@@ -36,7 +36,7 @@ namespace Geom {
/** Find the point where two straight lines cross.
*/
-boost::optional<Point> intersection_point( Point const & origin_a, Point const & vector_a,
+static boost::optional<Point> intersection_point( Point const & origin_a, Point const & vector_a,
Point const & origin_b, Point const & vector_b)
{
Coord denom = cross(vector_b, vector_a);
@@ -47,7 +47,7 @@ boost::optional<Point> intersection_point( Point const & origin_a, Point const &
return boost::none;
}
-Geom::CubicBezier sbasis_to_cubicbezier(Geom::D2<Geom::SBasis> const & sbasis_in)
+static Geom::CubicBezier sbasis_to_cubicbezier(Geom::D2<Geom::SBasis> const & sbasis_in)
{
std::vector<Geom::Point> temp;
sbasis_to_bezier(temp, sbasis_in, 4);
@@ -205,12 +205,12 @@ static bool compare_offsets (Geom::Point first, Geom::Point second)
return first[Geom::X] < second[Geom::X];
}
-Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise<Geom::D2<Geom::SBasis> > const & B,
- Geom::Piecewise<Geom::SBasis> const & y, // width path
- LineJoinType jointype,
- double miter_limit,
- bool /*forward_direction*/,
- double tol=Geom::EPSILON)
+static Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise<Geom::D2<Geom::SBasis> > const & B,
+ Geom::Piecewise<Geom::SBasis> const & y, // width path
+ LineJoinType jointype,
+ double miter_limit,
+ bool /*forward_direction*/,
+ double tol=Geom::EPSILON)
{
/* per definition, each discontinuity should be fixed with a join-ending, as defined by linejoin_type
*/
diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp
index de40d4fb5..f52977fcb 100644
--- a/src/live_effects/lpe-rough-hatches.cpp
+++ b/src/live_effects/lpe-rough-hatches.cpp
@@ -68,7 +68,7 @@ struct LevelCrossingInfoOrder {
typedef std::vector<LevelCrossing> LevelCrossings;
-std::vector<double>
+static std::vector<double>
discontinuities(Piecewise<D2<SBasis> > const &f){
std::vector<double> result;
if (f.size()==0) return result;
@@ -211,7 +211,7 @@ public:
// Bend a path...
//-------------------------------------------------------
-Piecewise<D2<SBasis> > bend(Piecewise<D2<SBasis> > const &f, Piecewise<SBasis> bending){
+static Piecewise<D2<SBasis> > bend(Piecewise<D2<SBasis> > const &f, Piecewise<SBasis> bending){
D2<Piecewise<SBasis> > ff = make_cuts_independent(f);
ff[X] += compose(bending, ff[Y]);
return sectionize(ff);
diff --git a/src/live_effects/spiro.cpp b/src/live_effects/spiro.cpp
index 14df5e92e..f50399a77 100644
--- a/src/live_effects/spiro.cpp
+++ b/src/live_effects/spiro.cpp
@@ -83,7 +83,7 @@ int n = 4;
#endif
/* Integrate polynomial spiral curve over range -.5 .. .5. */
-void
+static void
integrate_spiro(const double ks[4], double xy[2])
{
#if 0
@@ -631,7 +631,7 @@ banbks11(const bandmat *m, const int *perm, double *v, int n)
}
}
-int compute_jinc(char ty0, char ty1)
+static int compute_jinc(char ty0, char ty1)
{
if (ty0 == 'o' || ty1 == 'o' ||
ty0 == ']' || ty1 == '[')
@@ -645,7 +645,7 @@ int compute_jinc(char ty0, char ty1)
return 0;
}
-int count_vec(const spiro_seg *s, int nseg)
+static int count_vec(const spiro_seg *s, int nseg)
{
int i;
int n = 0;
@@ -807,7 +807,7 @@ spiro_iter(spiro_seg *s, bandmat *m, int *perm, double *v, int n)
return norm;
}
-int
+static int
solve_spiro(spiro_seg *s, int nseg)
{
bandmat *m;