![]() |
Tulip
4.6.0
Better Visualization Through Research
|
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 _GLQUAD_H 00022 #define _GLQUAD_H 00023 00024 #include <tulip/Coord.h> 00025 #include <tulip/Color.h> 00026 00027 #include <tulip/GlPolygon.h> 00028 00029 namespace tlp { 00030 /** 00031 * @ingroup OpenGL 00032 * \brief Utility class to render a quadrilateral . 00033 * 00034 * This is an utility class class for rendering a quadrilateral. 00035 */ 00036 class TLP_GL_SCOPE GlQuad : public GlPolygon { 00037 00038 public: 00039 00040 /** 00041 * Constructor 00042 */ 00043 GlQuad(); 00044 00045 00046 /** 00047 * Constructor 00048 * 00049 * Initializes a quadrilateral with 4 points winding in clockwise order and a single color. 00050 * 00051 * \param p1 the first quad vertex 00052 * \param p2 the second quad vertex 00053 * \param p3 the third quad vertex 00054 * \param p4 the fourth quad vertex 00055 * \param color A single color indicating the color for every point of the quadrilateral. 00056 */ 00057 GlQuad(const Coord &p1, const Coord &p2, const Coord &p3, const Coord &p4, 00058 const Color &color); 00059 00060 /* Constructor 00061 * 00062 * Initializes a quadrilateral with 4 points winding in clockwise order and a color attached to each point. 00063 * 00064 * \param p1 the first quad vertex 00065 * \param p2 the second quad vertex 00066 * \param p3 the third quad vertex 00067 * \param p4 the fourth quad vertex 00068 * \param c1 the color of the first quad vertex 00069 * \param c2 the color of the second quad vertex 00070 * \param c3 the color of the third quad vertex 00071 * \param c4 the color of the fourth quad vertex 00072 */ 00073 GlQuad(const Coord &p1, const Coord &p2, const Coord &p3, const Coord &p4, 00074 const Color &c1, const Color &c2, const Color &c3, const Color &c4); 00075 00076 /** 00077 * Destructor 00078 */ 00079 virtual ~GlQuad(); 00080 00081 /** 00082 * Accessor in writing to the position. 00083 * \param idPosition Indicates which point we want to move. 00084 */ 00085 void setPosition(const int idPosition, const Coord &position); 00086 00087 /** 00088 * Accessor in writing to the color. 00089 * \param idColor Indicates which point we want to colorize. 00090 */ 00091 void setColor(const int idColor, const Color &color); 00092 00093 /** 00094 * Accessor in writing to the basic color of GlAugmentedDisplay 00095 */ 00096 void setColor(const Color& color); 00097 00098 /** 00099 * Accessor in reading to the position. 00100 * \param idPosition Indicates which point we want to get the position. 00101 */ 00102 const Coord& getPosition(const int idPosition) const; 00103 00104 /** 00105 * Accessor in reading to the color. 00106 * \param idColor Indicates which point we want to get the color. 00107 */ 00108 const Color& getColor(const int idColor) const; 00109 00110 /** 00111 * Function to export data in outString (in XML format) 00112 */ 00113 virtual void getXML(std::string &outString); 00114 00115 /** 00116 * Function to set data with inString (in XML format) 00117 */ 00118 virtual void setWithXML(const std::string &inString, unsigned int ¤tPosition); 00119 00120 00121 }; 00122 00123 } 00124 #endif 00125 ///@endcond