![]() |
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 00022 #ifndef Tulip_GLCURVE_H 00023 #define Tulip_GLCURVE_H 00024 00025 #include <tulip/GlSimpleEntity.h> 00026 00027 namespace tlp { 00028 /** \brief This class is use to display an OpenGl curve 00029 * 00030 */ 00031 class TLP_GL_SCOPE GlCurve : public GlSimpleEntity { 00032 public: 00033 /** 00034 * Basic constructor with vector of coord, begin/end color and begin/end size 00035 */ 00036 GlCurve(const std::vector<tlp::Coord> &points, 00037 const Color &beginFColor, 00038 const Color &endFColor, 00039 const float &beginSize=0., 00040 const float &endSize=0.); 00041 00042 /** 00043 * Basic constructor with number of points 00044 */ 00045 GlCurve(const unsigned int nbPoints = 3u); 00046 virtual ~GlCurve(); 00047 00048 /** 00049 * Draw the curve 00050 */ 00051 void draw(float lod,Camera *camera); 00052 00053 /** 00054 * Set the texture of the curve (if you want texture) 00055 */ 00056 void setTexture(const std::string &texture); 00057 00058 /** 00059 * Change the number of points 00060 */ 00061 virtual void resizePoints(const unsigned int nbPoints); 00062 00063 /** 00064 * Return the ith coord 00065 */ 00066 virtual const tlp::Coord& point(const unsigned int i) const; 00067 /** 00068 * Return the ith coord 00069 */ 00070 virtual tlp::Coord& point(const unsigned int i); 00071 00072 /** 00073 * Translate entity 00074 */ 00075 virtual void translate(const Coord& mouvement); 00076 00077 /** 00078 * Function to export data in outString (in XML format) 00079 */ 00080 virtual void getXML(std::string &outString); 00081 00082 /** 00083 * Function to set data with inString (in XML format) 00084 */ 00085 virtual void setWithXML(const std::string &inString, unsigned int ¤tPosition); 00086 00087 protected: 00088 std::vector<tlp::Coord> _points; 00089 Color _beginFillColor; 00090 Color _endFillColor; 00091 float _beginSize; 00092 float _endSize; 00093 std::string texture; 00094 }; 00095 } 00096 #endif 00097 ///@endcond