/usr/include/tulip/GlAbstractPolygon.h is in libtulip-dev 4.8.0dfsg-2build2.
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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | /*
*
* 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.
*
*/
#ifndef GLABSTRACTPOLYGON_H
#define GLABSTRACTPOLYGON_H
#include <vector>
#include <tulip/Color.h>
#include <tulip/Coord.h>
#include <tulip/Size.h>
#include <tulip/GlSimpleEntity.h>
#if defined(_MSC_VER)
#include <Windows.h>
#endif
#if defined(__APPLE__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
namespace tlp {
/**
* @ingroup OpenGL
* @brief class to create a abstract polygon
* @warning You don't have to use this class, it's only a base class for some others entities
*/
class TLP_GL_SCOPE GlAbstractPolygon : public GlSimpleEntity {
public:
///@cond DOXYGEN_HIDDEN
/**
* Constructor
*/
GlAbstractPolygon();
/**
* Default empty destructor
*/
virtual ~GlAbstractPolygon();
enum PolygonMode {POLYGON = 0, QUAD_STRIP = 1};
/**
* Get the polygon mode (see PolygonMode enum)
*/
PolygonMode getPolygonMode();
/**
* Set the polygon mode (see PolygonMode enum)
*/
void setPolygonMode(PolygonMode mode);
/**
* Get if the polygon is filled or not
*/
bool getFillMode();
/**
* Set if the polygon is filled or not
*/
void setFillMode(const bool);
/**
* Get if the polygon is outlined or not
*/
bool getOutlineMode();
/**
* Set if the polygon is outlined or not
*/
void setOutlineMode(const bool);
/**
* Get if the polygon use light or not
*/
bool getLightingMode();
/**
* Set if the polygon use light or not
*/
void setLightingMode(const bool);
/**
* Get the ith color used to filling the polygon
*/
Color getFillColor(unsigned int i);
/**
* Set the ith color used to filling the polygon
*/
void setFillColor(unsigned int i, const Color &color);
///@endcond
/**
* @brief Set color used to filling the whole polygon
*/
void setFillColor(const Color &color);
///@cond DOXYGEN_HIDDEN
/**
* Get the ith color used to outlining the polygon
*/
Color getOutlineColor(unsigned int i);
/**
* Set the ith color used to outlining the polygon
*/
void setOutlineColor(unsigned int i, const Color &color);
///@endcond
/**
* @brief Set the color used to outlining the whole polygon
*/
void setOutlineColor(const Color &color);
/**
* @brief Get the textureName
*/
std::string getTextureName();
/**
* @brief Set the textureName
*/
void setTextureName(const std::string &name);
/**
* @brief Get the outline size
*/
float getOutlineSize();
/**
* @brief Set the outline size
*/
void setOutlineSize(float size);
///@cond DOXYGEN_HIDDEN
/**
* Get the lod outline value, below this lod value outline will not be displayed
*/
float getHideOutlineLod();
/**
* Set the lod outline value, below this lod value outline will not be displayed
*/
void setHideOutlineLod(float lod);
/**
* Sets if the y texture coordinates have to be inversed
*/
void setInvertYTexture(bool invertYTexture);
/**
* Draw the polygon
*/
virtual void draw(float lod,Camera *camera);
/**
* Translate entity
*/
virtual void translate(const Coord& mouvement);
/**
* Scale entity
*/
virtual void scale(const tlp::Size& factor);
/**
* Function to export data and type in outString (in XML format)
*/
virtual void getXML(std::string &outString);
/**
* Function to export data in outString (in XML format)
*/
virtual void getXMLOnlyData(std::string &outString);
/**
* Function to set data with inString (in XML format)
*/
virtual void setWithXML(const std::string &outString, unsigned int ¤tPosition);
///@endcond
protected:
///@cond DOXYGEN_HIDDEN
/**
* set Coords of the polygon
*/
virtual void setPoints(const std::vector<Coord> &points);
/**
* set ith Coord of the polygon
*/
virtual void setPoint(unsigned int index, const Coord &point);
/**
* set fill colors of the polygon
*/
virtual void setFillColors(const std::vector<Color> &colors);
/**
* set outline colors of the polygon
*/
virtual void setOutlineColors(const std::vector<Color> &colors);
/**
* Clear previous bounding box and expand bounding box with polygons' points
*/
virtual void recomputeBoundingBox();
/**
* Clear previously generated VBO
*/
virtual void clearGenerated();
///@endcond
PolygonMode polygonMode;
std::vector<Coord> points;
std::vector<Color> fillColors;
std::vector<Color> outlineColors;
bool filled;
bool outlined;
bool lighting;
bool invertYTexture;
std::string textureName;
float outlineSize;
float hideOutlineLod;
std::vector<Coord> normalArray;
GLubyte *indices;
GLubyte *auxIndices;
GLfloat *texArray;
bool generated;
GLuint buffers[7];
};
}
#endif
|