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