Tulip  5.7.4
Large graphs analysis and drawing
GlSelectSceneVisitor.h
1 /*
2  *
3  * This file is part of Tulip (https://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 Tulip_GLSELECTSCENEVISITOR_H
22 #define Tulip_GLSELECTSCENEVISITOR_H
23 
24 #include <tulip/GlSceneVisitor.h>
25 
26 namespace tlp {
27 
28 enum SelectionFlag { SelectSimpleEntities = 1, SelectNodes = 2, SelectEdges = 4 };
29 
30 class GlGraphInputData;
31 class GlLODCalculator;
32 
33 /**
34  * This visitor is use when we want to select an entity in scene
35  */
36 class TLP_GL_SCOPE GlSelectSceneVisitor : public GlSceneVisitor {
37 
38 public:
39  /**
40  * Constructor with SelectionFlac (SelectSimpleEntity, SelectNodes and SelectEdges),
41  * GlGraphInputData and GlLODCalculator
42  */
43  GlSelectSceneVisitor(SelectionFlag flag, GlGraphInputData *inputData,
44  GlLODCalculator *calculator);
45 
46  /**
47  * Visit a simple entity
48  */
49  void visit(GlSimpleEntity *entity) override;
50  /**
51  * Visit a node
52  */
53  void visit(GlNode *glNode) override;
54  /**
55  * Visit an edge
56  */
57  void visit(GlEdge *glEdge) override;
58  /**
59  * Visit a layer
60  */
61  void visit(GlLayer *layer) override;
62 
63 private:
64  SelectionFlag selectionFlag;
65 
66  GlGraphInputData *inputData;
67 
68  GlLODCalculator *calculator;
69 };
70 } // namespace tlp
71 
72 #endif // Tulip_GLSELECTSCENEVISITOR_H
73 ///@endcond