OpenCOVER
coVRSelectionManager.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef COVR_SELECTION_LIST_H
9#define COVR_SELECTION_LIST_H
10#include <util/common.h>
11#include <osg/Node>
13
14namespace vrui
15{
16class coNavInteraction;
17}
18namespace covise {
19class TokenBuffer;
20}
21namespace opencover
22{
23
24class COVEREXPORT coSelectionListener
25{
26public:
28 {
29 }
30 virtual bool selectionChanged() = 0;
31 virtual bool pickedObjChanged() = 0;
32};
33
34class COVEREXPORT coVRSelectionManager : public vrui::coUpdateable
35{
36 static coVRSelectionManager *s_instance;
38
39public:
46 void removeNode(osg::Node *);
47 osg::BoundingSphere getBoundingSphere(osg::Node *);
48
49 virtual bool update();
50
52 {
56 ANNOTATION
57 };
58
60
61 std::list<osg::ref_ptr<osg::Node> > getSelectionList()
62 {
63 return selectedNodeList;
64 };
65 std::list<osg::ref_ptr<osg::Group> > getSelectedParentList()
66 {
67 return selectedParentList;
68 };
69
70 void addSelection(osg::Group *parent, osg::Node *selectedNode, bool send = true);
71 void receiveAdd(covise::TokenBuffer &messageData);
73 void clearSelection(bool send = true);
74
75 static void insertHelperNode(osg::Group *parent, osg::Node *child, osg::Group *insertNode, HelperNodeType type, bool show = true);
76 static osg::Group *getHelperNode(osg::Group *parent, osg::Node *child, HelperNodeType type);
77 static bool isHelperNode(osg::Node *);
78
79 static osg::Node *validPath(std::string);
80 static std::string generatePath(osg::Node *);
81 static std::string generateNames(osg::Node *);
82
83 void setSelectionColor(float R, float G, float B);
87
88 static void markAsHelperNode(osg::Node *);
89
90private:
91 vrui::coUpdateManager *updateManager;
92
93 list<coSelectionListener *> listenerList;
94
95 float SelRed, SelGreen, SelBlue;
96 int SelWire;
97 int SelOnOff;
98
99 std::list<osg::ref_ptr<osg::Node> > selectedNodeList;
100 std::list<osg::ref_ptr<osg::Group> > selectedParentList;
101 std::list<osg::ref_ptr<osg::Group> > selectionNodeList;
102
103 static bool hasType(osg::Node *);
104
105 static bool haveToDelete(osg::Node *, osg::Node *);
106
107 static int getHelperType(osg::Node *);
108};
109}
110#endif
Definition: ARToolKit.h:33
Definition: coTabletUI.h:51
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coVRSelectionManager.h:25
virtual bool pickedObjChanged()=0
virtual ~coSelectionListener()
Definition: coVRSelectionManager.h:27
virtual bool selectionChanged()=0
Definition: coVRSelectionManager.h:35
static bool isHelperNode(osg::Node *)
static void insertHelperNode(osg::Group *parent, osg::Node *child, osg::Group *insertNode, HelperNodeType type, bool show=true)
std::list< osg::ref_ptr< osg::Node > > getSelectionList()
Definition: coVRSelectionManager.h:61
static void markAsHelperNode(osg::Node *)
osg::BoundingSphere getBoundingSphere(osg::Node *)
std::list< osg::ref_ptr< osg::Group > > getSelectedParentList()
Definition: coVRSelectionManager.h:65
void addSelection(osg::Group *parent, osg::Node *selectedNode, bool send=true)
HelperNodeType
Definition: coVRSelectionManager.h:52
@ MOVE
Definition: coVRSelectionManager.h:53
@ SELECTION
Definition: coVRSelectionManager.h:55
@ SHOWHIDE
Definition: coVRSelectionManager.h:54
static std::string generatePath(osg::Node *)
static osg::Group * getHelperNode(osg::Group *parent, osg::Node *child, HelperNodeType type)
void clearSelection(bool send=true)
void setSelectionColor(float R, float G, float B)
void removeListener(coSelectionListener *)
static osg::Node * validPath(std::string)
void addListener(coSelectionListener *)
static coVRSelectionManager * instance()
vrui::coNavInteraction * selectionInteractionA
Definition: coVRSelectionManager.h:59
static std::string generateNames(osg::Node *)
void receiveAdd(covise::TokenBuffer &messageData)
Definition: coNavInteraction.h:19
objects that are derived from this class are called once per frame
Definition: coUpdateManager.h:20
Definition: coUpdateManager.h:42