Tulip  5.1.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, unsigned int 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,
40  const Coord &startPoint, const Coord &endPoint,
41  Coord &startN, Coord &endN,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 polyQuad(const std::vector<Coord> &, /* polyline vertces */
46  const Color &, /* start color */
47  const Color &, /* end color */
48  const float, /* start size */
49  const float, /* end size */
50  const Coord &, /* normal to the begin of the curve */
51  const Coord &, /* normal to the end curve */
52  bool, /* if true : use start and end color to border lines, if false : use borderColor*/
53  const Color &, /* border color */
54  const std::string &textureName="", /* textureName */
55  const float outlineWidth=0);
56 TLP_GL_SCOPE void simpleQuad(const std::vector<Coord> &, /* quad vertces */
57  const Color &, /* start color */
58  const Color &, /* end color */
59  const float, /* start size */
60  const float, /* end size */
61  const Coord &, /* normal to the begin of the curve */
62  const Coord &, /* normal to the end curve */
63  const Coord &, /* direction of the camera*/
64  bool, /* if true : use start and end color to border lines, if false : use borderColor*/
65  const Color &, /* border color */
66  const std::string &textureName="",
67  const float outlineWidth=0); /* textureName */
68 TLP_GL_SCOPE void splineQuad(const std::vector<Coord> &, /* polyline vertces */
69  const Color &, /* start color */
70  const Color &, /* end color */
71  const float, /* start size */
72  const float, /* end size */
73  const Coord &, /* nomal to the begin of the curve */
74  const Coord &); /* nomal to the end curve */
75 TLP_GL_SCOPE void splineLine(const std::vector<Coord> &, /* polyline vertces */
76  const Color &, /* start color */
77  const Color &); /* end color */
78 //====================================================================
79 TLP_GL_SCOPE void getColors(const Coord *line,unsigned int lineSize, const Color &c1, const Color &c2,std::vector<Color> &);
80 TLP_GL_SCOPE void getSizes(const std::vector<Coord> &line, float s1, float s2, std::vector<float> &);
81 TLP_GL_SCOPE GLfloat* buildCurvePoints (const std::vector<Coord> &vertices,
82  const std::vector<float> &sizes,
83  const Coord &startN,
84  const Coord &endN,
85  unsigned int &resultSize,
86  std::vector<unsigned int> *dec=NULL);
87 TLP_GL_SCOPE void buildCurvePoints (const std::vector<Coord> &vertices,
88  const std::vector<float> &sizes,
89  const Coord &startN,
90  const Coord &endN,
91  std::vector<Coord> &result);
92 
93 }
94 #endif //DOXYGEN_NOTFOR_DEVEL
95 #endif
96 ///@endcond