21 #ifndef GL_CONVEX_HULL_H 22 #define GL_CONVEX_HULL_H 26 #include <tulip/Color.h> 27 #include <tulip/GlComposite.h> 31 struct ConvexHullItem;
39 class TLP_GL_SCOPE GlConvexHull :
public GlComposite {
49 GlConvexHull(
const std::vector<Coord> &points,
const std::vector<Color> &fillColors,
50 const std::vector<Color> &outlineColors,
const bool filled,
const bool outlined,
51 const std::string &name,
bool computeHull =
true);
53 ~GlConvexHull()
override {}
58 void acceptVisitor(GlSceneVisitor *visitor)
override {
59 if (boundingBox.isValid()) {
63 for (std::list<GlSimpleEntity *>::iterator it = _sortedElements.begin();
64 it != _sortedElements.end(); ++it) {
65 (*it)->acceptVisitor(visitor);
72 std::string getName() {
79 void draw(
float lod, Camera *camera)
override;
84 static ConvexHullItem *buildConvexHullsFromHierarchy(Graph *graph, std::vector<Color> fColors,
85 std::vector<Color> oColors,
86 bool deduceFromChilds =
true,
87 Graph *root =
nullptr,
88 unsigned int depth = 0);
93 void translate(
const Coord &mouvement)
override;
98 void getXML(std::string &outString)
override;
103 void setWithXML(
const std::string &inString,
unsigned int ¤tPosition)
override;
108 std::vector<Coord> _points;
109 std::vector<Color> _fillColors;
110 std::vector<Color> _outlineColors;
116 struct ConvexHullItem {
120 std::vector<ConvexHullItem *> children;