source: geovis/trunk/Picker.h @ 6002

Last change on this file since 6002 was 6002, checked in by ldelgass, 9 years ago

Add 'select clear' protocol command, clear previous selection on 'select
feature...' command

  • Property svn:eol-style set to native
File size: 1.2 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    osgEarth::GeoPoint _pickPoint;
40};
41
42struct DeleteCallback : public osgEarth::Picker::Callback {
43public:
44    DeleteCallback(Renderer *renderer) :
45        _renderer(renderer)
46    {}
47
48    void onHit(osgEarth::ObjectID id);
49
50private:
51    Renderer *_renderer;
52};
53
54extern void setHighlightByObjectID(osgEarth::ObjectID id);
55extern void clearHighlight();
56
57}
58
59#endif
Note: See TracBrowser for help on using the repository browser.