Tulip  4.7.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlCurve.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
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 Tulip_GLCURVE_H
23 #define Tulip_GLCURVE_H
24 
25 #include <tulip/GlSimpleEntity.h>
26 
27 namespace tlp {
28 /** \brief This class is use to display an OpenGl curve
29  *
30  */
31 class TLP_GL_SCOPE GlCurve : public GlSimpleEntity {
32 public:
33  /**
34  * Basic constructor with vector of coord, begin/end color and begin/end size
35  */
36  GlCurve(const std::vector<tlp::Coord> &points,
37  const Color &beginFColor,
38  const Color &endFColor,
39  const float &beginSize=0.,
40  const float &endSize=0.);
41 
42  /**
43  * Basic constructor with number of points
44  */
45  GlCurve(const unsigned int nbPoints = 3u);
46  virtual ~GlCurve();
47 
48  /**
49  * Draw the curve
50  */
51  void draw(float lod,Camera *camera);
52 
53  /**
54  * Set the texture of the curve (if you want texture)
55  */
56  void setTexture(const std::string &texture);
57 
58  /**
59  * Change the number of points
60  */
61  virtual void resizePoints(const unsigned int nbPoints);
62 
63  /**
64  * Return the ith coord
65  */
66  virtual const tlp::Coord& point(const unsigned int i) const;
67  /**
68  * Return the ith coord
69  */
70  virtual tlp::Coord& point(const unsigned int i);
71 
72  /**
73  * Translate entity
74  */
75  virtual void translate(const Coord& mouvement);
76 
77  /**
78  * Function to export data in outString (in XML format)
79  */
80  virtual void getXML(std::string &outString);
81 
82  /**
83  * Function to set data with inString (in XML format)
84  */
85  virtual void setWithXML(const std::string &inString, unsigned int &currentPosition);
86 
87 protected:
88  std::vector<tlp::Coord> _points;
89  Color _beginFillColor;
90  Color _endFillColor;
91  float _beginSize;
92  float _endSize;
93  std::string texture;
94 };
95 }
96 #endif
97 ///@endcond