Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveSecondarySelectable.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEveSecondarySelectable
13 #define ROOT_TEveSecondarySelectable
14 
15 #include "Rtypes.h"
16 
17 #include <set>
18 
19 class TGLSelectRecord;
20 
21 
22 class TEveSecondarySelectable
23 {
24 private:
25  TEveSecondarySelectable(const TEveSecondarySelectable&); // Not implemented
26  TEveSecondarySelectable& operator=(const TEveSecondarySelectable&); // Not implemented
27 
28 public:
29  typedef std::set<Int_t> SelectionSet_t;
30  typedef SelectionSet_t::iterator SelectionSet_i;
31  typedef SelectionSet_t::const_iterator SelectionSet_ci;
32 
33 
34 protected:
35  Bool_t fAlwaysSecSelect; // Always do secondary-selection in GL.
36 
37  SelectionSet_t fSelectedSet; // Selected indices.
38  SelectionSet_t fHighlightedSet; // Highlighted indices.
39 
40  void ProcessGLSelectionInternal(TGLSelectRecord& rec, SelectionSet_t& sset);
41 
42 public:
43  TEveSecondarySelectable();
44  virtual ~TEveSecondarySelectable() {}
45 
46  Bool_t GetAlwaysSecSelect() const { return fAlwaysSecSelect; }
47  void SetAlwaysSecSelect(Bool_t f) { fAlwaysSecSelect = f; }
48 
49  const SelectionSet_t& RefSelectedSet() const { return fSelectedSet; }
50  const SelectionSet_t& RefHighlightedSet() const { return fHighlightedSet; }
51 
52  void ProcessGLSelection(TGLSelectRecord& rec);
53 
54  ClassDef(TEveSecondarySelectable, 0); // Semi-abstract interface for classes supporting secondary-selection.
55 };
56 
57 #endif