OpenCOVER
BoxSelectionInteractor.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 _BOX_SELECTION_INTERACTOR_H
9#define _BOX_SELECTION_INTERACTOR_H
10
11#include <util/coExport.h>
12#include <osg/MatrixTransform>
13#include <osg/Geode>
14#include <osg/StateSet>
15
16#include "BoxSelection.h"
17
19
20namespace opencover
21{
22
24{
25public:
26 // create the scene graph for a movable, scalable wireframe cube
28
29 // destroy the cube scene graph
31
32 // start the interaction
34
35 // ongoing interaction
37 void registerInteractionRunningCallback(void (*interactionRunning)());
39
40 // stop the interaction
42 void registerInteractionFinishedCallback(void (*interactionFinished)());
44
45 void getBox(float &minX, float &minY, float &minZ, float &maxX, float &maxY, float &maxZ);
46
47private:
48 osg::Vec3 m_min, m_max;
49 osg::Vec3 m_worldCoordMin, m_worldCoordMax;
50 osg::Geode *m_cubeGeode;
51 osg::ref_ptr<osg::Group> m_root;
52 bool m_animationWasRunning;
53 void (*m_interactionFinished)();
54 void (*m_interactionRunning)();
55
56 osg::Geometry *createWireframeBox(osg::Vec3 min, osg::Vec3 max);
57 osg::StateSet *createBoxMaterial();
58
59 void updateBox(osg::Vec3 min, osg::Vec3 max);
60};
61}
62#endif
Definition: ARToolKit.h:33
Definition: BoxSelectionInteractor.h:24
void getBox(float &minX, float &minY, float &minZ, float &maxX, float &maxY, float &maxZ)
void registerInteractionRunningCallback(void(*interactionRunning)())
BoxSelectionInteractor(vrui::coInteraction::InteractionType type, const char *name, vrui::coInteraction::InteractionPriority priority)
void registerInteractionFinishedCallback(void(*interactionFinished)())
InteractionType
Definition: coInteraction.h:45
InteractionPriority
Definition: coInteraction.h:34
Definition: coTrackerButtonInteraction.h:21