OpenCOVER
coDragNDrop.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 CO_DRAGNDROP_H
9#define CO_DRAGNDROP_H
10
11#include <list>
13
14namespace vrui
15{
16
17class vruiTransformNode;
18
19// ------------------------------------------------------------------
23class OPENVRUIEXPORT coDragNDrop
24{
25public:
27 enum
28 {
29 MEDIA_UNKNOWN = 0,
30 MEDIA_MENUITEM
31 };
32
37
38 // destructor
39 virtual ~coDragNDrop();
40
42 {
43 return mediaType;
44 }
45
46protected:
49
52
55 bool processHit();
56
59
60 // this one is supposed to be overloaded and do what
61 // the target wants to do!
62 // it should return if the operation was sucessful,
63 // so the item can be removed or not.
64 virtual bool dropOperation(coDragNDrop *) = 0;
65};
66
67// ------------------------------------------------------------------
72{
73public:
76
79
82
85
88
91
92 // pointer on myself as hook
94
95private:
96 // static global storage of grabbed elements
97 std::list<coDragNDrop *> selection;
98
99 // static global drag'n'drop classes, for update
100 std::list<coDragNDrop *> updateClasses;
101
102 bool update();
103};
104}
105#endif
collaborative interface manager
Definition: coVRCommunication.h:41
Definition: coDragNDrop.h:24
coDragNDrop(int)
constructor with specific media type
void dragOperation()
those two do the work and return if it worked :)
int mediaType
this objects media type
Definition: coDragNDrop.h:48
virtual ~coDragNDrop()
int getMediaType()
Definition: coDragNDrop.h:41
coDragNDrop()
simple constructor
vruiTransformNode * dragNode
this is the pfDCS that should be used for drag visualisation
Definition: coDragNDrop.h:51
virtual bool dropOperation(coDragNDrop *)=0
Definition: coDragNDrop.h:72
static coDragNDropManager ddManager
Definition: coDragNDrop.h:93
void drag(coDragNDrop *)
drag this item into the selection list
void signOn(coDragNDrop *)
register this item at the manager. It is updated then.
void drop(coDragNDrop *)
drop the item out of the list
void signOff(coDragNDrop *)
sign off from manager
coDragNDrop * first(int)
deliver the first item which fits on the media type
objects that are derived from this class are called once per frame
Definition: coUpdateManager.h:20
Definition: vruiTransformNode.h:18