~lib2geom-hackers/lib2geom/trunk

« back to all changes in this revision

Viewing changes to path-find-points-of-interest.h

  • Committer: njh
  • Date: 2006-05-22 11:50:24 UTC
  • Revision ID: svn-v4:4601daaa-0314-0410-9a8b-c964a3c23b6b:trunk/lib2geom:1
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "path.h"
 
2
#include <vector>
 
3
 
 
4
/*** Routines in this group return a path that looks the same, but
 
5
 * include extra knots for certain points of interest. */
 
6
 
 
7
/*** find_vector_extreme_points
 
8
 * extreme points . dir.
 
9
 */
 
10
 
 
11
std::vector<Geom::Path::PathLocation>
 
12
find_vector_extreme_points(Geom::Path p, Geom::Point dir);
 
13
 
 
14
std::vector<Geom::Path::PathLocation>
 
15
find_inflection_points(Geom::Path p);
 
16
std::vector<Geom::Path::PathLocation>
 
17
find_flat_points(Geom::Path p);
 
18
 
 
19
Geom::Path::PathLocation dim_extreme_points(Geom::Path::PathElem e);
 
20
 
 
21
template <class F>
 
22
std::vector<Geom::Path::PathLocation> find_points(Geom::Path p, F f) {
 
23
    std::vector<Geom::Path::PathLocation> result;
 
24
 
 
25
    for(Geom::Path::const_iterator iter(p.begin()), end(p.end()); 
 
26
        iter != end; ++iter) {
 
27
        std::vector<Geom::Path::PathLocation> v = f(*iter);
 
28
        
 
29
        result.insert(result.end(), v.begin(), v.end());
 
30
    }
 
31
    return result;
 
32
}
 
33
 
 
34
/*
 
35
  Local Variables:
 
36
  mode:c++
 
37
  c-file-style:"stroustrup"
 
38
  c-file-offsets:((innamespace . 0)(substatement-open . 0))
 
39
  indent-tabs-mode:nil
 
40
  c-brace-offset:0
 
41
  fill-column:99
 
42
  End:
 
43
  vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
 
44
*/