Tulip  5.1.0
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 
22 #ifndef GLCONVEXGRAPHHULL_H_
23 #define GLCONVEXGRAPHHULL_H_
24 
25 #include <tulip/Color.h>
26 #include <tulip/tulipconf.h>
27 
28 namespace tlp {
29 
30 class GlComposite;
31 class GlSimpleEntity;
32 class Camera;
33 class Graph;
34 class LayoutProperty;
35 class SizeProperty;
36 class DoubleProperty;
37 class GlComplexPolygon;
38 
39 /**
40  * @brief This class draws a convex hull around a graph.
41  *
42  * Given a graph, this class computes the various control points of a convex hull that embraces the nodes and edges present into the graph.
43  * If this entity is translated using the translate method, every element of the linked graph will be translated as well.
44  *
45  * @warning The graph or any of the properties linked to a GlConvexGraphHull should never be deleted before the entity. Such a thing should be
46  * reported to the user in debug mode, raising an assertion.
47  */
48 class TLP_GL_SCOPE GlConvexGraphHull {
49 public:
50 
51  /**
52  * @brief ...
53  *
54  * @param parent ...
55  * @param name ...
56  * @param fcolor The color used to fill the hull.
57  * @param graph The graph whose elements should be inside the hull.
58  * @param layout The property used to layout the elements in the graph.
59  * @param size The property defining the graph's elements' sizes.
60  * @param rotation The property defining the graph's elements' rotation.
61  **/
62  GlConvexGraphHull(GlComposite* parent, const std::string& name, const tlp::Color &fcolor, Graph *graph, LayoutProperty *layout, SizeProperty *size, DoubleProperty *rotation);
63 
64  ~GlConvexGraphHull();
65 
66  /**
67  * Recomputes the whole Hull
68  */
69  void updateHull();
70 
71  void setVisible(bool visible);
72  bool isVisible();
73 private:
74  GlComposite* _parent;
75  std::string _name;
76  Color _fcolor;
77  GlComplexPolygon* _polygon;
78  Graph *graph;
79  LayoutProperty *layout;
80  SizeProperty *size;
81  DoubleProperty *rotation;
82  static int bezierValue;
83 };
84 }
85 
86 #endif /* GLCONVEXGRAPHHULL_H_ */
87 ///@endcond