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