Tulip  5.2.1
Large graphs analysis and drawing
GlConvexGraphHull.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef GLCONVEXGRAPHHULL_H_
22 #define GLCONVEXGRAPHHULL_H_
23 
24 #include <tulip/Color.h>
25 #include <tulip/tulipconf.h>
26 
27 namespace tlp {
28 
29 class GlComposite;
30 class GlSimpleEntity;
31 class Camera;
32 class Graph;
33 class LayoutProperty;
34 class SizeProperty;
35 class DoubleProperty;
36 class GlComplexPolygon;
37 
38 /**
39  * @brief This class draws a convex hull around a graph.
40  *
41  * Given a graph, this class computes the various control points of a convex hull that embraces the
42  * nodes and edges present into the graph.
43  * If this entity is translated using the translate method, every element of the linked graph will
44  * be translated as well.
45  *
46  * @warning The graph or any of the properties linked to a GlConvexGraphHull should never be deleted
47  * before the entity. Such a thing should be
48  * reported to the user in debug mode, raising an assertion.
49  */
50 class TLP_GL_SCOPE GlConvexGraphHull {
51 public:
52  /**
53  * @brief ...
54  *
55  * @param parent ...
56  * @param name ...
57  * @param fcolor The color used to fill the hull.
58  * @param graph The graph whose elements should be inside the hull.
59  * @param layout The property used to layout the elements in the graph.
60  * @param size The property defining the graph's elements' sizes.
61  * @param rotation The property defining the graph's elements' rotation.
62  **/
63  GlConvexGraphHull(GlComposite *parent, const std::string &name, const tlp::Color &fcolor,
64  Graph *graph, LayoutProperty *layout, SizeProperty *size,
65  DoubleProperty *rotation);
66 
67  ~GlConvexGraphHull();
68 
69  /**
70  * Recomputes the whole Hull
71  */
72  void updateHull();
73 
74  void setVisible(bool visible);
75  bool isVisible();
76 
77 private:
78  GlComposite *_parent;
79  std::string _name;
80  Color _fcolor;
81  GlComplexPolygon *_polygon;
82  Graph *graph;
83  LayoutProperty *layout;
84  SizeProperty *size;
85  DoubleProperty *rotation;
86  static int bezierValue;
87 };
88 } // namespace tlp
89 
90 #endif /* GLCONVEXGRAPHHULL_H_ */
91 ///@endcond