Tulip  5.2.0
Large graphs analysis and drawing
Curves.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 CURVES_H
22 #define CURVES_H
23 #ifndef DOXYGEN_NOTFOR_DEVEL
24 
25 #include <tulip/OpenGlIncludes.h>
26 
27 #include <tulip/Coord.h>
28 #include <tulip/Color.h>
29 #include <tulip/tulipconf.h>
30 
31 #include <vector>
32 
33 namespace tlp {
34 
35 template <typename T, size_t N>
36 class Matrix;
37 //====================================================================
38 // return vertices, update startN and endN to prevent bad edge drawing
39 TLP_GL_SCOPE void computeCleanVertices(const std::vector<Coord> &bends, const Coord &startPoint,
40  const Coord &endPoint, Coord &startN, Coord &endN,
41  std::vector<Coord> &);
42 TLP_GL_SCOPE void polyLine(const std::vector<Coord> &, /* polyline vertices */
43  const Color &, /* start color */
44  const Color &); /* end color */
45 TLP_GL_SCOPE void
46 polyQuad(const std::vector<Coord> &, /* polyline vertces */
47  const Color &, /* start color */
48  const Color &, /* end color */
49  const float, /* start size */
50  const float, /* end size */
51  const Coord &, /* normal to the begin of the curve */
52  const Coord &, /* normal to the end curve */
53  bool, /* if true : use start and end color to border lines, if false : use borderColor*/
54  const Color &, /* border color */
55  const std::string &textureName = "", /* textureName */
56  const float outlineWidth = 0);
57 TLP_GL_SCOPE void
58 simpleQuad(const std::vector<Coord> &, /* quad vertces */
59  const Color &, /* start color */
60  const Color &, /* end color */
61  const float, /* start size */
62  const float, /* end size */
63  const Coord &, /* normal to the begin of the curve */
64  const Coord &, /* normal to the end curve */
65  const Coord &, /* direction of the camera*/
66  bool, /* if true : use start and end color to border lines, if false : use borderColor*/
67  const Color &, /* border color */
68  const std::string &textureName = "", const float outlineWidth = 0); /* textureName */
69 TLP_GL_SCOPE void splineQuad(const std::vector<Coord> &, /* polyline vertces */
70  const Color &, /* start color */
71  const Color &, /* end color */
72  const float, /* start size */
73  const float, /* end size */
74  const Coord &, /* nomal to the begin of the curve */
75  const Coord &); /* nomal to the end curve */
76 TLP_GL_SCOPE void splineLine(const std::vector<Coord> &, /* polyline vertces */
77  const Color &, /* start color */
78  const Color &); /* end color */
79 //====================================================================
80 TLP_GL_SCOPE void getColors(const Coord *line, unsigned int lineSize, const Color &c1,
81  const Color &c2, std::vector<Color> &);
82 TLP_GL_SCOPE void getSizes(const std::vector<Coord> &line, float s1, float s2,
83  std::vector<float> &);
84 TLP_GL_SCOPE GLfloat *buildCurvePoints(const std::vector<Coord> &vertices,
85  const std::vector<float> &sizes, const Coord &startN,
86  const Coord &endN, unsigned int &resultSize,
87  std::vector<unsigned int> *dec = nullptr);
88 TLP_GL_SCOPE void buildCurvePoints(const std::vector<Coord> &vertices,
89  const std::vector<float> &sizes, const Coord &startN,
90  const Coord &endN, std::vector<Coord> &result);
91 }
92 #endif // DOXYGEN_NOTFOR_DEVEL
93 #endif
94 ///@endcond