Scribus
Open source desktop publishing at your fingertips
geom.h
Go to the documentation of this file.
1 
34 #ifndef LIB2GEOM_SEEN_GEOM_H
35 #define LIB2GEOM_SEEN_GEOM_H
36 
37 //TODO: move somewhere else
38 
39 #include <vector>
40 #include "point.h"
41 
42 namespace Geom {
43 
44 enum IntersectorKind {
45  intersects = 0,
46  parallel,
47  coincident,
48  no_intersection
49 };
50 
51 int
52 intersector_ccw(const Geom::Point& p0, const Geom::Point& p1,
53  const Geom::Point& p2);
54 
55 /* intersectors */
56 
57 IntersectorKind
58 line_intersection(Geom::Point const &n0, double const d0,
59  Geom::Point const &n1, double const d1,
60  Geom::Point &result);
61 
62 IntersectorKind
63 segment_intersect(Geom::Point const &p00, Geom::Point const &p01,
64  Geom::Point const &p10, Geom::Point const &p11,
65  Geom::Point &result);
66 
67 IntersectorKind
68 line_twopoint_intersect(Geom::Point const &p00, Geom::Point const &p01,
69  Geom::Point const &p10, Geom::Point const &p11,
70  Geom::Point &result);
71 
72 int centroid(std::vector<Geom::Point> p, Geom::Point& centroid, double &area);
73 
74 }
75 
76 #endif
Definition: angle.h:38
IntersectorKind segment_intersect(Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result)
Definition: geom.cpp:143
IntersectorKind line_intersection(Geom::Point const &n0, double const d0, Geom::Point const &n1, double const d1, Geom::Point &result)
Definition: geom.cpp:59
IntersectorKind line_twopoint_intersect(Geom::Point const &p00, Geom::Point const &p01, Geom::Point const &p10, Geom::Point const &p11, Geom::Point &result)
Definition: geom.cpp:166
Cartesian point.
Definition: point.h:20
int centroid(std::vector< Geom::Point > p, Geom::Point &centroid, double &area)
Definition: geom.cpp:192