/usr/include/tulip/AbstractGlCurve.h is in libtulip-dev 4.6.0dfsg-2+b5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | /*
*
* This file is part of Tulip (www.tulip-software.org)
*
* Authors: David Auber and the Tulip development Team
* from LaBRI, University of Bordeaux
*
* Tulip is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Tulip is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
*/
///@cond DOXYGEN_HIDDEN
#ifndef ABSTRACTGLCURVE_H
#define ABSTRACTGLCURVE_H
#if defined(_MSC_VER)
#include <Windows.h>
#endif
#if defined(__APPLE__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
//# if defined(__WIN32__)
//# include <GL/glext.h>
//# endif
#endif
#include <map>
#include <tulip/GlSimpleEntity.h>
#include <tulip/Color.h>
namespace tlp {
class GlShaderProgram;
class GlShader;
class TLP_GL_SCOPE AbstractGlCurve : public GlSimpleEntity {
public :
AbstractGlCurve(const std::string &shaderProgramName, const std::string &curveSpecificShaderCode);
AbstractGlCurve(const std::string &shaderProgramName, const std::string &curveSpecificShaderCode, const std::vector<Coord> &controlPoints,
const Color &startColor, const Color &endColor, const float startSize, const float endSize, const unsigned int nbCurvePoints);
virtual ~AbstractGlCurve();
void draw(float lod, Camera *camera);
void translate(const Coord &move);
virtual void setTexture(const std::string &texture) {
this->texture = texture;
}
virtual void setOutlined(const bool outlined) {
this->outlined = outlined;
}
virtual void setOutlineColor(const Color &outlineColor) {
this->outlineColor = outlineColor;
}
/**
* If set to true, the curve quad outlines will have the same colors
* than the curve quad
*/
virtual void setOutlineColorInterpolation(const bool outlineColorInterpolation) {
this->outlineColorInterpolation = outlineColorInterpolation;
}
/**
* If set to true, the curve is drawn as a line and not as a thick quad
*/
void setLineCurve(const bool lineCurve) {
this->lineCurve = lineCurve;
}
void setCurveLineWidth(const float curveLineWidth) {
this->curveLineWidth = curveLineWidth;
}
void setCurveQuadBordersWidth(const float curveQuadBorderWidth) {
this->curveQuadBordersWidth = curveQuadBorderWidth;
}
virtual void setBillboardCurve(const bool billboardCurve) {
this->billboardCurve = billboardCurve;
}
virtual void setLookDir(const Coord &lookDir) {
this->lookDir = lookDir;
}
void getXML(std::string &);
void setWithXML(const std::string &,unsigned int &);
virtual void drawCurve(std::vector<Coord> &controlPoints, const Color &startColor, const Color &endColor, const float startSize, const float endSize, const unsigned int nbCurvePoints=100);
protected:
virtual void setCurveVertexShaderRenderingSpecificParameters() {}
virtual void cleanupAfterCurveVertexShaderRendering() {}
virtual Coord computeCurvePointOnCPU(const std::vector<Coord> &controlPoints, float t) = 0;
virtual void computeCurvePointsOnCPU(const std::vector<Coord> &controlPoints, std::vector<Coord> &curvePoints, unsigned int nbCurvePoints) = 0;
static void buildCurveVertexBuffers(const unsigned int nbCurvePoints, bool vboOk);
void initShader(const std::string &shaderProgramName, const std::string &curveSpecificShaderCode);
static std::map<unsigned int, GLfloat *> curveVertexBuffersData;
static std::map<unsigned int, std::vector<GLushort *> > curveVertexBuffersIndices;
static std::map<unsigned int, GLuint* > curveVertexBuffersObject;
static std::map<std::string, GlShaderProgram *> curvesShadersMap;
static std::map<std::string, GlShaderProgram *> curvesBillboardShadersMap;
static GlShader *curveVertexShaderNormalMain;
static GlShader *curveVertexShaderBillboardMain;
static GlShader *fisheyeDistortionVertexShader;
static bool canUseGeometryShader;
static std::map<std::string, std::pair<GlShaderProgram *, GlShaderProgram *> > curvesGeometryShadersMap;
static GlShader *curveVertexGeometryShaderNormalMain;
static std::map<std::string, std::pair<GlShaderProgram *, GlShaderProgram *> > curvesBillboardGeometryShadersMap;
std::string shaderProgramName;
GlShaderProgram *curveShaderProgramNormal;
GlShaderProgram *curveShaderProgramBillboard;
GlShaderProgram *curveShaderProgram;
std::vector<Coord> controlPoints;
Color startColor;
Color endColor;
float startSize;
float endSize;
unsigned int nbCurvePoints;
bool outlined;
Color outlineColor;
std::string texture;
float texCoordFactor;
bool billboardCurve;
Coord lookDir;
bool lineCurve;
float curveLineWidth;
float curveQuadBordersWidth;
bool outlineColorInterpolation;
};
}
#endif
///@endcond
|