Tulip  5.4.0
Large graphs analysis and drawing
AroundTexturedSphere.h
1 /**
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #include <tulip/Glyph.h>
22 
23 using namespace std;
24 using namespace tlp;
25 
26 namespace tlp {
27 
28 struct BoundingBox;
29 
30 /** \addtogroup glyph */
31 /*@{*/
32 /// A 3D glyph.
33 /**
34  * This glyph draws a sphere using the "viewColor" node property value.
35  * and apply a texture around it
36  */
37 class TLP_GL_SCOPE AroundTexturedSphere : public NoShaderGlyph {
38  const std::string textureFile;
39  const unsigned char alpha;
40 
41 public:
42  AroundTexturedSphere(const tlp::PluginContext *context = nullptr,
43  const std::string &aroundTextureFile = "", unsigned char alphaVal = 255)
44  : NoShaderGlyph(context), textureFile(aroundTextureFile), alpha(alphaVal) {}
45  void getIncludeBoundingBox(BoundingBox &boundingBox, node) override;
46  void draw(node n, float) override;
47  static void drawGlyph(const Color &glyphColor, const Size &glyphSize, const string &texture,
48  const string &texturePath, const string &aroundTextureFile,
49  unsigned char alpha = 255);
50 };
51 } // end of namespace tlp
52 
53 ///@endcond
Definition: TlpTools.h:48
The node struct represents a node in a Graph object.
Definition: Node.h:40
This class represents the 3D bounding box of an object. It is mostly used to determine whether or not...
Definition: BoundingBox.h:67
Contains runtime parameters for a plugin.
Definition: PluginContext.h:42