OpendTect  6.3
picksetchangerecorder.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: Bert
8  Date: June 2016
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "generalmod.h"
14 #include "monitorchangerecorder.h"
15 #include "pickset.h"
16 #include "perthreadrepos.h"
17 
18 
19 namespace Pick
20 {
21 
22 
25 mExpClass(General) SetChangeRecord : public ChangeRecorder::Record
26 {
27 public:
28 
29  typedef Set::LocID LocID;
31 
32  LocID locid_;
34 
35  virtual bool apply(Monitorable&,Action) const;
36  virtual bool isValid() const { return locid_.isValid();}
37  static const SetChangeRecord& udf();
38 
39 protected:
40 
41  SetChangeRecord( LocID id, const Location& loc )
42  : locid_(id), loc_(loc) {}
43 
44  void replaceID(Set&,LocID tmpid,LocID realid) const;
45  virtual void doApply(Set&,bool) const = 0;
46 
47 };
48 
49 
51 {
52 public:
53 
54  SetLocCreateRecord( LocID id, const Location& loc,
55  LocID beforeid=LocID::getInvalid() )
56  : SetChangeRecord(id,loc)
57  , beforeid_(beforeid) {}
58 
59  LocID beforeid_;
60 
61  virtual Record* clone() const { return new SetLocCreateRecord(*this);}
62  virtual uiString name() const;
63  virtual void doApply(Set&,bool) const;
64 
65 };
66 
67 
68 mExpClass(General) SetLocMoveRecord : public SetChangeRecord
69 {
70 public:
71 
72  SetLocMoveRecord( LocID id, const Location& from,
73  const Location& to )
74  : SetChangeRecord(id,to)
75  , prevloc_(from) {}
76 
78 
79  virtual Record* clone() const { return new SetLocMoveRecord(*this); }
80  virtual uiString name() const;
81  virtual void doApply(Set&,bool) const;
82 
83 };
84 
85 
86 mExpClass(General) SetLocRemoveRecord : public SetChangeRecord
87 {
88 public:
89 
90  SetLocRemoveRecord( LocID id, const Location& loc,
91  LocID beforeid )
92  : SetChangeRecord(id,loc)
93  , beforeid_(beforeid) {}
94 
95  LocID beforeid_;
96 
97  virtual Record* clone() const { return new SetLocRemoveRecord(*this);}
98  virtual uiString name() const;
99  virtual void doApply(Set&,bool) const;
100 
101 };
102 
103 
104 
108 {
109 public:
110 
111  typedef Set::LocID LocID;
112 
114  SetChangeRecorder(const Set&);
116 
117 protected:
118 
120 
121  void handleObjChange(const ChangeData&);
122 
123 };
124 
125 } // namespace Pick
#define mExpClass(module)
Definition: commondefs.h:157
virtual Record * clone() const
Definition: picksetchangerecorder.h:97
Object that can be MT-safely monitored from cradle to grave.
Definition: monitorable.h:76
LocID locid_
Definition: picksetchangerecorder.h:32
T to(const F &fr)
Definition: convert.h:31
Pick location in space,.
Definition: picklocation.h:44
Definition: picksetchangerecorder.h:50
Location loc_
Definition: picksetchangerecorder.h:33
ChangeRecorder::Action Action
Definition: picksetchangerecorder.h:30
virtual Record * clone() const
Definition: picksetchangerecorder.h:79
Definition: picksetchangerecorder.h:86
Definition: uistring.h:88
virtual bool isValid() const
Definition: picksetchangerecorder.h:36
PerThreadObjectRepository< Location > movestartloc_
Definition: picksetchangerecorder.h:119
SetLocMoveRecord(LocID id, const Location &from, const Location &to)
Definition: picksetchangerecorder.h:72
#define mDeclMonitorableAssignment(clss)
like mDeclAbstractMonitorableAssignment but for non-abstract subclasses. Implements the clone() metho...
Definition: monitor.h:111
LocID beforeid_
Definition: picksetchangerecorder.h:95
Monitorable set of pick locations.
Definition: pickset.h:41
SetLocCreateRecord(LocID id, const Location &loc, LocID beforeid=LocID::getInvalid())
Definition: picksetchangerecorder.h:54
base class for recorder of changes in a Monitorable
Definition: monitorchangerecorder.h:20
Action
Definition: monitorchangerecorder.h:29
virtual Record * clone() const
Definition: picksetchangerecorder.h:61
SetChangeRecord(LocID id, const Location &loc)
Definition: picksetchangerecorder.h:41
LocID beforeid_
Definition: picksetchangerecorder.h:59
SetLocRemoveRecord(LocID id, const Location &loc, LocID beforeid)
Definition: picksetchangerecorder.h:90
Class that keeps one object per thread. This enables temporary passing of objects (such as strings) w...
Definition: perthreadrepos.h:26
Set::LocID LocID
Definition: picksetchangerecorder.h:111
Holds one change in a Pick::Set.
Definition: picksetchangerecorder.h:25
Definition: picklocation.h:19
Definition: picksetchangerecorder.h:68
Definition: monitorable.h:113
Set::LocID LocID
Definition: picksetchangerecorder.h:29
Keeps track of changes in a Pick::Set.
Definition: picksetchangerecorder.h:107
Location prevloc_
Definition: picksetchangerecorder.h:77

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