Tulip  5.2.1
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 #include <tulip/TlpTools.h>
20 #include <tulip/Graph.h>
21 #include <tulip/Glyph.h>
22 #include <tulip/EdgeExtremityGlyph.h>
23 #include <tulip/ColorProperty.h>
24 #include <tulip/SizeProperty.h>
25 #include <tulip/GlTextureManager.h>
26 #include <tulip/GlTools.h>
27 #include <tulip/GlGraphRenderingParameters.h>
28 #include <tulip/GlGraphInputData.h>
29 #include <tulip/TulipViewSettings.h>
30 #include <tulip/GlSphere.h>
31 #include <tulip/GlRect.h>
32 
33 using namespace std;
34 using namespace tlp;
35 
36 namespace tlp {
37 
38 /** \addtogroup glyph */
39 /*@{*/
40 /// A 3D glyph.
41 /**
42  * This glyph draws a sphere using the "viewColor" node property value.
43  * and apply a texture around it
44  */
45 class TLP_GL_SCOPE AroundTexturedSphere : public NoShaderGlyph {
46  const std::string textureFile;
47  const unsigned char alpha;
48 
49 public:
50  AroundTexturedSphere(const tlp::PluginContext *context = nullptr,
51  const std::string &aroundTextureFile = "", unsigned char alphaVal = 255)
52  : NoShaderGlyph(context), textureFile(aroundTextureFile), alpha(alphaVal) {}
53  void getIncludeBoundingBox(BoundingBox &boundingBox, node) override;
54  void draw(node n, float) override;
55  static void drawGlyph(const Color &glyphColor, const Size &glyphSize, const string &texture,
56  const string &texturePath, const string &aroundTextureFile,
57  unsigned char alpha = 255);
58 };
59 } // end of namespace tlp
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:66
Contains runtime parameters for a plugin.
Definition: PluginContext.h:42