Tulip  4.6.0
Better Visualization Through Research
library/tulip-ogl/include/tulip/Curves.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 #ifndef CURVES_H
00022 #define CURVES_H
00023 #ifndef DOXYGEN_NOTFOR_DEVEL
00024 
00025 #if defined(_MSC_VER)
00026 #include <Windows.h>
00027 #endif
00028 
00029 #if defined(__APPLE__)
00030 #include <OpenGL/gl.h>
00031 #include <OpenGL/glu.h>
00032 #else
00033 #include <GL/gl.h>
00034 #include <GL/glu.h>
00035 #endif
00036 
00037 #include <tulip/Coord.h>
00038 #include <tulip/Color.h>
00039 #include <tulip/tulipconf.h>
00040 
00041 #include <vector>
00042 
00043 namespace tlp {
00044 
00045 template<typename T, unsigned int N>
00046 class Matrix;
00047 //====================================================================
00048 //return vertices, update startN and endN to prevent bad edge drawing
00049 TLP_GL_SCOPE void computeCleanVertices(const std::vector<Coord> &bends,
00050                                        const Coord &startPoint, const Coord &endPoint,
00051                                        Coord &startN, Coord &endN,std::vector<Coord> &);
00052 TLP_GL_SCOPE void polyLine(const std::vector<Coord> &,/* polyline vertices */
00053                            const Color &,             /* start color */
00054                            const Color &);            /* end color */
00055 TLP_GL_SCOPE void polyQuad(const std::vector<Coord> &, /* polyline vertces */
00056                            const Color &,            /* start color */
00057                            const Color &,            /* end color */
00058                            const float,              /* start size */
00059                            const float,              /* end size */
00060                            const Coord &,            /* normal to the begin of the curve */
00061                            const Coord &,            /* normal to the end curve */
00062                            bool,         /* if true : use start and end color to border lines, if false : use borderColor*/
00063                            const Color &,      /* border color */
00064                            const std::string &textureName="", /* textureName */
00065                            const float outlineWidth=0);
00066 TLP_GL_SCOPE void simpleQuad(const std::vector<Coord> &, /* quad vertces */
00067                              const Color &,            /* start color */
00068                              const Color &,            /* end color */
00069                              const float,              /* start size */
00070                              const float,              /* end size */
00071                              const Coord &,            /* normal to the begin of the curve */
00072                              const Coord &,            /* normal to the end curve */
00073                              const Coord &,            /* direction of the camera*/
00074                              bool,         /* if true : use start and end color to border lines, if false : use borderColor*/
00075                              const Color &,      /* border color */
00076                              const std::string &textureName="");     /* textureName */
00077 TLP_GL_SCOPE void splineQuad(const std::vector<Coord> &,  /* polyline vertces */
00078                              const Color &,          /* start color */
00079                              const Color &,          /* end color */
00080                              const float,            /* start size */
00081                              const float,            /* end size */
00082                              const Coord &,          /* nomal to the begin of the curve */
00083                              const Coord &);         /* nomal to the end curve */
00084 TLP_GL_SCOPE void splineLine(const std::vector<Coord> &,  /* polyline vertces */
00085                              const Color &,          /* start color */
00086                              const Color &);          /* end color */
00087 //====================================================================
00088 TLP_GL_SCOPE void getColors(const Coord *line,unsigned int lineSize, const Color &c1, const Color &c2,std::vector<Color> &);
00089 TLP_GL_SCOPE void getSizes(const std::vector<Coord> &line, float s1, float s2, std::vector<float> &);
00090 TLP_GL_SCOPE GLfloat* buildCurvePoints (const std::vector<Coord> &vertices,
00091                                         const std::vector<float> &sizes,
00092                                         const Coord &startN,
00093                                         const Coord &endN,
00094                                         unsigned int &resultSize,
00095                                         std::vector<unsigned int> *dec=NULL);
00096 TLP_GL_SCOPE void buildCurvePoints (const std::vector<Coord> &vertices,
00097                                     const std::vector<float> &sizes,
00098                                     const Coord &startN,
00099                                     const Coord &endN,
00100                                     std::vector<Coord> &result);
00101 
00102 }
00103 #endif //DOXYGEN_NOTFOR_DEVEL
00104 #endif
00105 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties