source: geovis/trunk/Picker.h @ 6672

Last change on this file since 6672 was 6281, checked in by ldelgass, 8 years ago

Update select protocol response to use add|delete|set sub-command

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2015  HUBzero Foundation, LLC
4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7#ifndef GEOVIS_PICKER_H
8#define GEOVIS_PICKER_H
9
10#include <osgEarth/Picker>
11#include <osgEarth/ObjectIndex>
12
13namespace GeoVis {
14
15class Renderer;
16
17struct HoverCallback : public osgEarth::Picker::Callback {
18public:
19    HoverCallback(Renderer *renderer);
20
21    void onHit(osgEarth::ObjectID id);
22    void onMiss();
23    bool accept(const osgGA::GUIEventAdapter& ea, const osgGA::GUIActionAdapter& aa);
24
25private:
26    Renderer *_renderer;
27};
28
29struct SelectCallback : public osgEarth::Picker::Callback {
30public:
31    SelectCallback(Renderer *renderer);
32
33    void onHit(osgEarth::ObjectID id);
34    void onMiss();
35    bool accept(const osgGA::GUIEventAdapter& ea, const osgGA::GUIActionAdapter& aa);
36
37private:
38    Renderer *_renderer;
39    float _x, _y;
40    bool _modifier;
41    osgEarth::GeoPoint _pickPoint;
42};
43
44struct DeleteCallback : public osgEarth::Picker::Callback {
45public:
46    DeleteCallback(Renderer *renderer) :
47        _renderer(renderer)
48    {}
49
50    void onHit(osgEarth::ObjectID id);
51
52private:
53    Renderer *_renderer;
54};
55
56extern void setHighlightByObjectID(osgEarth::ObjectID id);
57extern void clearHighlight();
58
59}
60
61#endif
Note: See TracBrowser for help on using the repository browser.