/usr/include/tulip/GlQuad.h is in libtulip-ogl-dev 3.1.2-2.3ubuntu3.
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 | //-*-c++-*-
/**
Authors: David Auber, Patrick Mary, Morgan Mathiaut
from the LaBRI Visualization Team
Email : auber@tulip-software.org
Last modification : 13/03/2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
#ifndef _GLQUAD_H
#define _GLQUAD_H
#include <tulip/Coord.h>
#include <tulip/Color.h>
#include "tulip/GlSimpleEntity.h"
#define N_QUAD_POINTS 4 /**< Constant indicating the number of points in a quad (stupid isn't it ? :D) */
namespace tlp {
/**
* \brief General class to render quads as augmented displays.
*
* This class is a generic class to render quads as augmented displays.
* It doens't uses the basic parameters of the GlAugmentedDisplay(position and color)
* but it's own set of positions and colors.
*/
class TLP_GL_SCOPE GlQuad : public GlSimpleEntity
{
protected:
Coord* positions[N_QUAD_POINTS]; /**< The position of the points of the Quad */
Color* colors[N_QUAD_POINTS]; /**< The colors of the points of the Quad */
std::string textureName;
/**
* Accessor in writing to the basic position of GlAugmentedDisplay
*
* \attention As you can see, this function is forbidden to the user to avoid him setting an unused parameter.
*/
void setPosition(const Coord& position);
public:
/**
* Constructor
*/
GlQuad();
/**
* Constructor
*
* \param positions Array indicating the position of the points. The first point is the top-left one. The next points are winding in clockwise order.
* \param color A single color indicating the color for every point of the Quad.
*/
GlQuad(Coord positions[N_QUAD_POINTS], const Color &color);
/**
* Constructor
*
* \param positions Array indicating the position of the points. The first point is the top-left one. The next points are winding in clockwise order.
* \param colors Array indicating the color of the points. The order is the same as for the positions.
*/
GlQuad(Coord positions[N_QUAD_POINTS], Color colors[N_QUAD_POINTS]);
/**
* Destructor
*/
virtual ~GlQuad();
/**
* Virtual function used to draw the quad.
*/
virtual void draw(float lod,Camera *camera);
/**
* Accessor in writing to the position.
* \param idPosition Indicates which point we want to move.
*/
void setPosition(int idPosition, const Coord &position);
/**
* Accessor in writing to the color.
* \param idColor Indicates which point we want to colorize.
*/
void setColor(int idColor, const Color &color);
/**
* Accessor in writing to the basic color of GlAugmentedDisplay
*
* \attention As you can see, this function is forbidden to the user to avoid him setting an unused parameter.
*/
void setColor(const Color& color);
/**
* Accessor in reading to the position.
* \param idPosition Indicates which point we want to get the position.
*/
Coord* getPosition(int idPosition) const;
/**
* Accessor in reading to the color.
* \param idColor Indicates which point we want to get the color.
*/
Color* getColor(int idColor) const;
/**
* Accessor in reading to the texture.
*/
void setTextureName(const std::string &name);
/**
* Accessor in reading to the texture.
*/
std::string getTextureName() const;
/**
* Translate entity
*/
virtual void translate(const Coord& mouvement);
/**
* Function to export data in XML
*/
virtual void getXML(xmlNodePtr rootNode);
/**
* Function to set data with XML
*/
virtual void setWithXML(xmlNodePtr rootNode);
};
}
#endif
|