Tulip  5.2.0
Large graphs analysis and drawing
EdgeExtremityGlyph.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 #ifndef EDGEEXTREMITYGLYPH_H_
22 #define EDGEEXTREMITYGLYPH_H_
23 
24 #include <tulip/Size.h>
25 #include <tulip/Coord.h>
26 #include <tulip/Matrix.h>
27 #include <tulip/Plugin.h>
28 
29 namespace tlp {
30 
31 class Color;
32 
33 static const std::string EEGLYPH_CATEGORY = "Edge extremity";
34 
35 typedef Matrix<float, 4> MatrixGL;
36 class GlGraphInputData;
37 
38 class TLP_GL_SCOPE EdgeExtremityGlyph : public Plugin {
39 public:
40  std::string category() const override {
41  return EEGLYPH_CATEGORY;
42  }
43  std::string icon() const override {
44  return ":/tulip/gui/icons/32/plugin_glyph.png";
45  }
46 
47  EdgeExtremityGlyph(const tlp::PluginContext *context);
48  ~EdgeExtremityGlyph() override;
49  virtual void draw(edge e, node n, const Color &glyphColor, const Color &borderColor,
50  float lod) = 0;
51  void get2DTransformationMatrix(const Coord &src, const Coord &dest, const Size &glyphSize,
52  MatrixGL &transformationMatrix, MatrixGL &scalingMatrix);
53  void get3DTransformationMatrix(const Coord &src, const Coord &dest, const Size &glyphSize,
54  MatrixGL &transformationMatrix, MatrixGL &scalingMatrix);
55 
56 protected:
57  GlGraphInputData *edgeExtGlGraphInputData;
58 };
59 }
60 
61 #endif /* EDGEEXTREMITYGLYPH_H_ */
62 ///@endcond
Contains runtime parameters for a plugin.
Definition: PluginContext.h:42