Tulip  4.8.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlSelectSceneVisitor.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
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 {
29  SelectSimpleEntities=1,
30  SelectNodes=2,
31  SelectEdges=4
32 };
33 
34 class GlGraphInputData;
35 class GlLODCalculator;
36 
37 /**
38  * This visitor is use when we want to select an entity in scene
39  */
40 class TLP_GL_SCOPE GlSelectSceneVisitor : public GlSceneVisitor {
41 
42 public:
43 
44  /**
45  * Constructor with SelectionFlac (SelectSimpleEntity, SelectNodes and SelectEdges), GlGraphInputData and GlLODCalculator
46  */
47  GlSelectSceneVisitor(SelectionFlag flag,GlGraphInputData* inputData,GlLODCalculator *calculator);
48 
49  /**
50  * Visit a simple entity
51  */
52  virtual void visit(GlSimpleEntity *entity);
53  /**
54  * Visit a node
55  */
56  virtual void visit(GlNode *glNode);
57  /**
58  * Visit an edge
59  */
60  virtual void visit(GlEdge *glEdge);
61  /**
62  * Visit a layer
63  */
64  virtual void visit(GlLayer *layer);
65 
66 private:
67 
68  SelectionFlag selectionFlag;
69 
70  GlGraphInputData* inputData;
71 
72  GlLODCalculator* calculator;
73 
74 };
75 
76 }
77 
78 #endif // Tulip_GLSELECTSCENEVISITOR_H
79 ///@endcond