00001 // @(#)root/eve:$Id: TEveSecondarySelectable.h 33124 2010-04-21 20:04:42Z matevz $ 00002 // Author: Matevz Tadel 2007 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TEveSecondarySelectable 00013 #define ROOT_TEveSecondarySelectable 00014 00015 #include "Rtypes.h" 00016 00017 #include <set> 00018 00019 class TGLSelectRecord; 00020 00021 00022 class TEveSecondarySelectable 00023 { 00024 private: 00025 TEveSecondarySelectable(const TEveSecondarySelectable&); // Not implemented 00026 TEveSecondarySelectable& operator=(const TEveSecondarySelectable&); // Not implemented 00027 00028 public: 00029 typedef std::set<Int_t> SelectionSet_t; 00030 typedef SelectionSet_t::iterator SelectionSet_i; 00031 typedef SelectionSet_t::const_iterator SelectionSet_ci; 00032 00033 00034 protected: 00035 Bool_t fAlwaysSecSelect; // Always do secondary-selection in GL. 00036 00037 SelectionSet_t fSelectedSet; // Selected indices. 00038 SelectionSet_t fHighlightedSet; // Highlighted indices. 00039 00040 void ProcessGLSelectionInternal(TGLSelectRecord& rec, SelectionSet_t& sset); 00041 00042 public: 00043 TEveSecondarySelectable(); 00044 virtual ~TEveSecondarySelectable() {} 00045 00046 Bool_t GetAlwaysSecSelect() const { return fAlwaysSecSelect; } 00047 void SetAlwaysSecSelect(Bool_t f) { fAlwaysSecSelect = f; } 00048 00049 const SelectionSet_t& RefSelectedSet() const { return fSelectedSet; } 00050 const SelectionSet_t& RefHighlightedSet() const { return fHighlightedSet; } 00051 00052 void ProcessGLSelection(TGLSelectRecord& rec); 00053 00054 ClassDef(TEveSecondarySelectable, 0); // Semi-abstract interface for classes supporting secondary-selection. 00055 }; 00056 00057 #endif