Tulip  4.6.0
Better Visualization Through Research
library/tulip-ogl/include/tulip/GlCircle.h
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 
00021 #ifndef GLCIRCLE_H
00022 #define GLCIRCLE_H
00023 
00024 #include <tulip/Color.h>
00025 #include <tulip/Coord.h>
00026 #include <tulip/GlRegularPolygon.h>
00027 
00028 namespace tlp {
00029 
00030 /**
00031  * @ingroup OpenGL
00032  * @brief Class used to render circles as GlEntity.
00033  *
00034  * If you want a circle : use this class
00035  */
00036 class TLP_GL_SCOPE GlCircle : public GlRegularPolygon {
00037 public:
00038   /**
00039    * @brief Constructor
00040    *
00041    * @param startAngle if start angle is equal to 0, the circle construction begin with the top center point
00042    * @param segment number of triangle used to render the circle
00043    */
00044   GlCircle(const Coord &center = Coord(0,0,0),
00045            float radius = 1.,
00046            const Color &outlineColor = Color(255, 0 , 0 , 255),
00047            const Color &fillColor = Color (0, 0, 255,255),
00048            bool filled = false,
00049            bool outlined = true,
00050            float startAngle = 0.0,
00051            unsigned int segments = 10);
00052 
00053   /**
00054    * @brief Write-acess Accessor to the center, the radius and the startAngle of the circle.
00055    */
00056   void set(const Coord &center, float radius, float startAngle);
00057 
00058   /**
00059    * @brief Function to export data in XML
00060    */
00061   virtual void getXML(std::string &outString);
00062 };
00063 
00064 }
00065 
00066 #endif
 All Classes Files Functions Variables Enumerations Enumerator Properties