21 #ifndef _DRAWINGTOOLS_H
22 #define _DRAWINGTOOLS_H
25 #include <tulip/Node.h>
26 #include <tulip/Edge.h>
27 #include <tulip/Coord.h>
28 #include <tulip/BoundingBox.h>
29 #include <tulip/Matrix.h>
30 #include <tulip/Size.h>
34 template<
class itType >
41 class BooleanProperty;
43 typedef Matrix<float, 3> Mat3f;
51 TLP_SCOPE BoundingBox computeBoundingBox(
const Graph *graph,
52 const LayoutProperty *layout,
53 const SizeProperty *size,
54 const DoubleProperty *rotation,
55 const BooleanProperty *selection = NULL);
65 TLP_SCOPE BoundingBox computeBoundingBox(Iterator<node> *itN,
67 const LayoutProperty *layout,
68 const SizeProperty *size,
69 const DoubleProperty *rotation,
70 const BooleanProperty *selection = NULL);
86 TLP_SCOPE std::pair<Coord, Coord> computeBoundingRadius (
const Graph *graph,
87 const LayoutProperty *layout,
88 const SizeProperty *size,
89 const DoubleProperty *rotation,
90 const BooleanProperty *selection = NULL);
102 TLP_SCOPE std::vector<Coord> computeConvexHull (
const Graph *graph,
103 const LayoutProperty *layout,
104 const SizeProperty *size,
105 const DoubleProperty *rotation,
106 const BooleanProperty *selection = NULL);
118 TLP_SCOPE std::vector<Coord> computeConvexHull(
const std::vector<tlp::Coord> &points);
128 TLP_SCOPE
bool computeLinesIntersection(
const std::pair<tlp::Coord, tlp::Coord> &line1,
129 const std::pair<tlp::Coord, tlp::Coord> &line2,
130 tlp::Coord &intersectionPoint);
139 TLP_SCOPE tlp::Coord computePolygonCentroid(
const std::vector<tlp::Coord> &points);
149 TLP_SCOPE
bool isLayoutCoPlanar(
const std::vector<Coord> &points, Mat3f &invTransformMatrix);
167 TLP_SCOPE std::vector<tlp::Coord> computeRegularPolygon(
unsigned int numberOfSides,
const tlp::Coord ¢er,
168 const tlp::Size &size,
float startAngle = 0);