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 00020 #ifndef GLREGULARPOLYGON_H 00021 #define GLREGULARPOLYGON_H 00022 00023 #include <tulip/GlPolygon.h> 00024 #include <tulip/Size.h> 00025 00026 namespace tlp { 00027 00028 /** 00029 * @ingroup OpenGL 00030 * @brief class to create a regular polygon 00031 */ 00032 class TLP_GL_SCOPE GlRegularPolygon : public GlPolygon { 00033 public: 00034 /** 00035 * @brief Constructor 00036 * 00037 * The outline is the border of the regular polygon 00038 * 00039 * The fill is inside the regular polygon 00040 */ 00041 GlRegularPolygon(const Coord &position, 00042 const Size &size, 00043 unsigned int numberOfSides, 00044 const Color &outlineColor = Color(255, 0 , 0 , 255), 00045 const Color &fillColor = Color (0, 0, 255,255), 00046 bool filled = true, 00047 bool outlined =true, 00048 const std::string &textureName="", 00049 float outlineSize=1.); 00050 /** 00051 * @brief Destructor 00052 */ 00053 virtual ~GlRegularPolygon(); 00054 00055 /** 00056 * @brief Set the start angle in degree 00057 * 00058 * If the start angle is 0 : the regular polygon begin at the top middle point 00059 */ 00060 void setStartAngle(float angle); 00061 00062 /** 00063 * @brief Get the number of Sides 00064 */ 00065 unsigned int getNumberOfSides(); 00066 00067 /** 00068 * @brief Set the number of sides (use setNumberOfSides) 00069 */ 00070 void resizePoints(const unsigned int number); 00071 00072 /** 00073 * @brief Set the number of sides 00074 */ 00075 void setNumberOfSides(unsigned int number); 00076 00077 protected : 00078 00079 void computePolygon(); 00080 00081 00082 Coord position; 00083 Size size; 00084 unsigned int numberOfSides; 00085 float startAngle; 00086 00087 }; 00088 00089 } 00090 #endif