OpendTect  6.3
visselman.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Kris Tingdahl
8  Date: Jan 2002
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 
15 #include "visbasecommon.h"
16 #include "notify.h"
17 
18 namespace Threads { class Mutex; }
19 
20 namespace visBase
21 {
22 
23 class Scene;
24 class DataObject;
25 class DataManager;
26 class Selectable;
27 
38 {
39 public:
41  virtual ~SelectionManager();
42 
43  void setAllowMultiple(bool yn);
44  bool allowMultiple() const { return allowmultiple_; }
45 
46  void select(int id,bool keepoldsel=false)
47  { select( id, keepoldsel, true ); }
48  void deSelect(int id) { deSelect( id, true ); }
49  void deSelectAll() { deSelectAll( true ); }
50  void updateSel(int id) { updateSel( id, true ); }
51 
52  const TypeSet<int>& selected() const { return selectedids_; }
53 
57 
58  // for implementing pick-based reselection
60 
61  void fillPar(IOPar&,TypeSet<int>&) const {}
62  void usePar(const IOPar&) {}
63 
64 protected:
65  void select(int id,bool keep,bool lock);
66  void deSelect(int id,bool lock);
67  void deSelectAll(bool lock);
68  void updateSel(int id,bool lock);
69 
73 };
74 
75 } // namespace visBase
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
bool allowMultiple() const
Definition: visselman.h:44
const TypeSet< int > & selected() const
Definition: visselman.h:52
CNotifier< SelectionManager, int > selnotifier
Definition: visselman.h:54
void deSelect(int id)
Definition: visselman.h:48
void select(int id, bool keepoldsel=false)
Definition: visselman.h:46
CNotifier< SelectionManager, int > reselnotifier
Definition: visselman.h:59
interface to threads that should be portable.
Definition: atomic.h:24
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
SelectionManager handles DataObject that can be selected. If an object can be selected, it has to register himself with regSelObject. At registration it has to give two objects, first of all, he gives the object that outside users will associate him with when they want to add their CB to detect his selection.
Definition: visselman.h:37
void fillPar(IOPar &, TypeSet< int > &) const
Definition: visselman.h:61
void updateSel(int id)
Definition: visselman.h:50
void deSelectAll()
Definition: visselman.h:49
CNotifier< SelectionManager, int > deselnotifier
Definition: visselman.h:55
Definition: visannot.h:40
CNotifier< SelectionManager, int > updateselnotifier
Definition: visselman.h:56
Threads::Mutex & mutex_
Definition: visselman.h:72
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
Notifier with automatic capsule creation.
Definition: notify.h:166
void usePar(const IOPar &)
Definition: visselman.h:62
TypeSet< int > selectedids_
Definition: visselman.h:70
bool allowmultiple_
Definition: visselman.h:71

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017