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,
const LayoutProperty *layout,
52 const SizeProperty *size,
const DoubleProperty *rotation,
53 const BooleanProperty *selection =
nullptr);
63 TLP_SCOPE BoundingBox computeBoundingBox(
const std::vector<node> &nodes,
64 const std::vector<edge> &edges,
65 const LayoutProperty *layout,
const SizeProperty *size,
66 const DoubleProperty *rotation,
67 const BooleanProperty *selection =
nullptr);
86 TLP_SCOPE std::pair<Coord, Coord>
87 computeBoundingRadius(
const Graph *graph,
const LayoutProperty *layout,
const SizeProperty *size,
88 const DoubleProperty *rotation,
const BooleanProperty *selection =
nullptr);
101 TLP_SCOPE std::vector<Coord> computeConvexHull(
const Graph *graph,
const LayoutProperty *layout,
102 const SizeProperty *size,
103 const DoubleProperty *rotation,
104 const BooleanProperty *selection =
nullptr);
117 TLP_SCOPE std::vector<Coord> computeConvexHull(
const std::vector<tlp::Coord> &points);
126 TLP_SCOPE
bool computeLinesIntersection(
const std::pair<tlp::Coord, tlp::Coord> &line1,
127 const std::pair<tlp::Coord, tlp::Coord> &line2,
128 tlp::Coord &intersectionPoint);
137 TLP_SCOPE tlp::Coord computePolygonCentroid(
const std::vector<tlp::Coord> &points);
147 TLP_SCOPE
bool isLayoutCoPlanar(
const std::vector<Coord> &points, Mat3f &invTransformMatrix);
165 TLP_SCOPE std::vector<tlp::Coord> computeRegularPolygon(
unsigned int numberOfSides,
166 const tlp::Coord ¢er,
167 const tlp::Size &size,
168 float startAngle = 0);