Tulip  4.1.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 1 and Inria Bordeaux - Sud Ouest
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 <vector>
25 #include <utility>
26 
27 #include <tulip/GlSceneVisitor.h>
28 #include <tulip/GlNode.h>
29 #include <tulip/GlEdge.h>
30 #include <tulip/GlLODCalculator.h>
31 
32 namespace tlp {
33 
34 enum SelectionFlag {
35  SelectSimpleEntities=1,
36  SelectNodes=2,
37  SelectEdges=4
38 };
39 
40 /**
41  * This visitor is use when we want to select an entity in scene
42  */
43 class TLP_GL_SCOPE GlSelectSceneVisitor : public GlSceneVisitor {
44 
45 public:
46 
47  /**
48  * Constructor with SelectionFlac (SelectSimpleEntity, SelectNodes and SelectEdges), GlGraphInputData and GlLODCalculator
49  */
50  GlSelectSceneVisitor(SelectionFlag flag,GlGraphInputData* inputData,GlLODCalculator *calculator)
51  :selectionFlag(flag),inputData(inputData),calculator(calculator) {}
52 
53  /**
54  * Visit a simple entity
55  */
56  virtual void visit(GlSimpleEntity *entity);
57  /**
58  * Visit a node
59  */
60  virtual void visit(GlNode *glNode);
61  /**
62  * Visit an edge
63  */
64  virtual void visit(GlEdge *glEdge);
65  /**
66  * Visit a layer
67  */
68  virtual void visit(GlLayer *layer);
69 
70 private:
71 
72  SelectionFlag selectionFlag;
73 
74  GlGraphInputData* inputData;
75 
76  GlLODCalculator* calculator;
77 
78 };
79 
80 }
81 
82 #endif // Tulip_GLSELECTSCENEVISITOR_H
83 ///@endcond