OpenCOVER
ModuleFeedbackPlugin.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 MODULE_FEEDBACK_PLUGIN_H_
9#define MODULE_FEEDBACK_PLUGIN_H_
10
11#include <util/DLinkList.h>
12#include <util/coTypes.h>
13#include <cover/coVRPlugin.h>
14
15namespace opencover
16{
17class ModuleFeedbackManager;
18class coInteractor;
19class RenderObject;
20}
21
22// ModuleFeedbackPlugin is a base class for plugins which have feedback to covise modules
23// the derived plugin class, for example TracerPlugin, handles the feedback to all Tracer Modules
24// the class ModuleFeedbackPlugin keeps a list of ModuleFeedbackManagers
25// the class ModuleFeedbackManager handles the feedback to a module
26namespace opencover
27{
28
29class PLUGIN_UTILEXPORT ModuleFeedbackPlugin : public opencover::coVRPlugin
30{
31public:
34
35 // if a ModuleFeedbackManager object is already present in
36 // the list ComplexModuleList for the module from which
37 // container and inter have originated, then that ModuleFeedbackManager
38 // object is updated (this produces menu updates, for instance),
39 // if no such object is available, a new ModuleFeedbackManager object is
40 // created and appended to the list
41 void add(const opencover::RenderObject *container, opencover::coInteractor *inter);
42 void add(const opencover::RenderObject *container, const opencover::RenderObject *geomObj);
43
44 // removes the ModuleFeedbackManager object from the list
45 void remove(const char *objName);
46
47 // calls preFrame for all module feedback manager objects in the list which belong to that plugin
48 void preFrame();
49
50 // set visibility of an object from Gui
51 void handleGeoVisibleMsg(const char *objectName, bool hide);
52
53 //set Transformation of an object
54 void setMatrix(const char *objectName, float *row0, float *row1, float *row2, float *row3);
55
56 // if the case name is set from Gui the item is moved from the Covise menu to a case menu
57 void handleSetCaseMsg(const char *objectName, const char *casename);
58
59 // if the name is set from Gui the item name and menu title has to be changed
60 void handleSetNameMsg(const char *coviseObjectName, const char *newName);
61
62 // change the dcs of a a node
63 void addNodeToCase(const char *objectName, osg::Node *node);
64
65 // handle adding interactors to colorbars
66 void newInteractor(const RenderObject *container, coInteractor *i);
67
68protected:
69 // factory method that returns pointers to object of derived classes of
70 // ModuleFeedbackManager
72
73 // unique global list of all interactions
74 static covise::DLinkList<opencover::ModuleFeedbackManager *> _ComplexModuleList;
75
76 // list of all interaction of the derived class plugin
77 covise::DLinkList<opencover::ModuleFeedbackManager *> myInteractions_;
78
79public:
80 virtual void getSyncInteractors(coInteractor *inter_); // collect all interactors from other modules which should be syncronized with this one
81 // the following methods will set parameters on all those intersctors
82 std::list<coInteractor *> interactors;
84 virtual void executeModule();
85
87 virtual void setBooleanParam(const char *name, int val);
88
90 virtual void setScalarParam(const char *name, float val);
91
93 virtual void setScalarParam(const char *name, int val);
94
96 virtual void setSliderParam(const char *name, float min, float max, float value);
97
99 virtual void setSliderParam(const char *name, int min, int max, int value);
100
102 virtual void setVectorParam(const char *name, int numElem, float *field);
103 virtual void setVectorParam(const char *name, float u, float v, float w);
104
106 virtual void setVectorParam(const char *name, int numElem, int *field);
107 virtual void setVectorParam(const char *name, int u, int v, int w);
108
110 virtual void setStringParam(const char *name, const char *val);
111
113 virtual void setChoiceParam(const char *name, int pos);
114 virtual void setChoiceParam(const char *name, int num, const char *const *list, int pos);
115};
116}
117#endif
OpenCOVER plugin interface, derive plugins from coVRPlugin.
Definition: ARToolKit.h:33
abstract feedback class for interacting with parameters of visualization modules (e....
Definition: coInteractor.h:37
make sure to clean up properly in the plugin's dtor
Definition: coVRPlugin.h:73
base class for data received from visualization systems (e.g. COVISE or Vistle)
Definition: RenderObject.h:147
Definition: ModuleFeedbackManager.h:45
Definition: ModuleFeedbackPlugin.h:30
virtual void setStringParam(const char *name, const char *val)
set string parameter
virtual void setChoiceParam(const char *name, int pos)
set choice parameter, pos starts with 0
virtual void setVectorParam(const char *name, int numElem, float *field)
set float Vector Param
virtual void setChoiceParam(const char *name, int num, const char *const *list, int pos)
void setMatrix(const char *objectName, float *row0, float *row1, float *row2, float *row3)
void handleSetCaseMsg(const char *objectName, const char *casename)
void add(const opencover::RenderObject *container, const opencover::RenderObject *geomObj)
void remove(const char *objName)
void preFrame()
this function is called from the main thread before rendering a frame
covise::DLinkList< opencover::ModuleFeedbackManager * > myInteractions_
Definition: ModuleFeedbackPlugin.h:77
virtual void setVectorParam(const char *name, int numElem, int *field)
set int vector parameter
virtual void getSyncInteractors(coInteractor *inter_)
virtual void setBooleanParam(const char *name, int val)
set Boolean Parameter
void handleGeoVisibleMsg(const char *objectName, bool hide)
virtual void setScalarParam(const char *name, int val)
set int scalar parameter
virtual void setSliderParam(const char *name, int min, int max, int value)
set int slider parameter
virtual void setVectorParam(const char *name, int u, int v, int w)
void addNodeToCase(const char *objectName, osg::Node *node)
void newInteractor(const RenderObject *container, coInteractor *i)
this function is called when COVER gets a new COVISE object with feedback attributes
void add(const opencover::RenderObject *container, opencover::coInteractor *inter)
static covise::DLinkList< opencover::ModuleFeedbackManager * > _ComplexModuleList
Definition: ModuleFeedbackPlugin.h:74
virtual void setScalarParam(const char *name, float val)
set float scalar parameter
void handleSetNameMsg(const char *coviseObjectName, const char *newName)
virtual opencover::ModuleFeedbackManager * NewModuleFeedbackManager(const opencover::RenderObject *, opencover::coInteractor *, const opencover::RenderObject *, const char *)=0
virtual void setVectorParam(const char *name, float u, float v, float w)
std::list< coInteractor * > interactors
Definition: ModuleFeedbackPlugin.h:82
virtual void executeModule()
execute the Modules
virtual void setSliderParam(const char *name, float min, float max, float value)
set float slider parameter