Tulip  4.6.0
Better Visualization Through Research
library/tulip-ogl/include/tulip/GlConvexGraphHull.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 
00022 #ifndef GLCONVEXGRAPHHULL_H_
00023 #define GLCONVEXGRAPHHULL_H_
00024 
00025 #include <tulip/Color.h>
00026 #include <tulip/tulipconf.h>
00027 
00028 namespace tlp {
00029 
00030 class GlComposite;
00031 class GlSimpleEntity;
00032 class Camera;
00033 class Graph;
00034 class LayoutProperty;
00035 class SizeProperty;
00036 class DoubleProperty;
00037 class GlComplexPolygon;
00038 
00039 /**
00040  * @brief This class draws a convex hull around a graph.
00041  *
00042  * Given a graph, this class computes the various control points of a convex hull that embraces the nodes and edges present into the graph.
00043  * If this entity is translated using the translate method, every element of the linked graph will be translated as well.
00044  *
00045  * @warning The graph or any of the properties linked to a GlConvexGraphHull should never be deleted before the entity. Such a thing should be
00046  * reported to the user in debug mode, raising an assertion.
00047  */
00048 class TLP_GL_SCOPE GlConvexGraphHull {
00049 public:
00050 
00051   /**
00052    * @brief ...
00053    *
00054    * @param parent ...
00055    * @param name ...
00056    * @param fcolor The color used to fill the hull.
00057    * @param graph The graph whose elements should be inside the hull.
00058    * @param layout The property used to layout the elements in the graph.
00059    * @param size The property defining the graph's elements' sizes.
00060    * @param rotation The property defining the graph's elements' rotation.
00061    **/
00062   GlConvexGraphHull(GlComposite* parent, const std::string& name, const tlp::Color &fcolor, Graph *graph, LayoutProperty *layout, SizeProperty *size, DoubleProperty *rotation);
00063 
00064   ~GlConvexGraphHull();
00065 
00066   /**
00067   * Recomputes the whole Hull
00068   */
00069   void updateHull();
00070 
00071   void setVisible(bool visible);
00072   bool isVisible();
00073 private:
00074   GlComposite* _parent;
00075   std::string _name;
00076   Color _fcolor;
00077   GlComplexPolygon* _polygon;
00078   Graph *graph;
00079   LayoutProperty *layout;
00080   SizeProperty *size;
00081   DoubleProperty *rotation;
00082   static int bezierValue;
00083 };
00084 }
00085 
00086 #endif /* GLCONVEXGRAPHHULL_H_ */
00087 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties