OpendTect-6_4  6.4
faulttrace.h
Go to the documentation of this file.
1 #ifndef faulttrace_h
2 #define faulttrace_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Nanne Hemstra
9  Date: October 2008
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "earthmodelmod.h"
16 #include "executor.h"
17 #include "paralleltask.h"
18 #include "trckeysampling.h"
19 #include "multiid.h"
20 #include "positionlist.h"
21 #include "sets.h"
22 #include "posinfo2dsurv.h"
23 #include "trigonometry.h"
24 #include "threadlock.h"
25 
26 namespace EM { class Fault; class Horizon; }
27 namespace Geometry { class ExplFaultStickSurface; }
28 namespace PosInfo { class Line2DData; }
29 class BinIDValueSet;
30 
35 mExpClass(EarthModel) FaultTrace : public Coord3List
37 public:
38 
39  int nextID(int) const;
40  int add(const Coord3&);
41  int add(const Coord3&,float trcnr);
42  Coord3 get(int) const;
43  const TypeSet<int>& getIndices() const;
44  float getTrcNr(int) const;
45  void set(int,const Coord3&);
46  void set(int,const Coord3&,float);
47  void setIndices(const TypeSet<int>&);
48  void remove(int);
49  void remove(const TypeSet<int>&) {}
50  bool isDefined(int) const;
51  int size() const { return coords_.size(); }
52  FaultTrace* clone() const;
53 
54  bool isInl() const { return isinl_; }
55  bool isEditedOnCrl() const { return editedoncrl_; }
56  int lineNr() const { return nr_; }
57  const Interval<int>& trcRange() const { return trcrange_; }
58  const Interval<float>& zRange() const { return zrange_; }
59  void setIsInl(bool yn) { isinl_ = yn; }
60  void setEditedOnCrl(bool yn) { editedoncrl_ = yn; }
61  void setLineNr(int nr) { nr_ = nr; }
62 
63  bool isCrossing(const BinID&,float,const BinID&,float) const;
64  bool getIntersection(const BinID&,float,const BinID&,float,
65  BinID&,float&,
66  const StepInterval<int>* trcrg=0,
67  bool snappositive=true) const;
68  bool getHorCrossings(const BinIDValueSet&,
69  Interval<float>& topzvals,
70  Interval<float>& botzvals) const;
71  bool getHorIntersection(const EM::Horizon&,BinID&) const;
72 
73  bool getCoordsBetween(int trc0,float z0,int trc1,float z1,
74  TypeSet<Coord>& coords) const;
75  bool getIntersectionZs(int trcnr,TypeSet<float>& zs) const;
76  bool getIntersectionTraces(float zval,
77  TypeSet<int>& trcs) const;
78  bool getFaultTraceIntersection(const FaultTrace&,
79  int& trace,float& zval) const;
80 
81  bool getHorizonIntersectionInfo(const EM::Horizon& hor,
82  Pos::GeomID geomid,
83  TypeSet<BinID>& pos1bids,TypeSet<float>& pos1zs,
84  TypeSet<BinID>& pos2bids,TypeSet<float>& pos2zs,
85  TypeSet<Coord>& intersections,
86  bool findfirstonly=true,
87  bool allowextention=false) const;
88  bool getImage(const BinID& srcbid,float srcz,
89  const Interval<float>& tophorzvals,
90  const Interval<float>& bothorzvals,
91  const StepInterval<int>& trcrg,BinID& imgbid,
92  float& imgz,bool forward) const;
93 
94  float getZValFor(const BinID&) const;
95  bool isOnPosSide(const BinID&,float) const;
96  void addValue(int id,const Coord3&) {}
97  void computeRange();
98  bool includes(const BinID&) const;
99  bool isOK() const;
100  bool isOnFault(const BinID&,float z,float threshold) const;
101  // threshold dist in measured in BinID units
102 
103  enum Act { AllowCrossing, ForbidCrossing,
104  ForbidCrossHigher, ForbidCrossLower,
105  AllowMinTraceToFault, AllowMaxTraceToFault,
106  AllowMinInlToFault, AllowMaxInlToFault,
107  AllowMinCrlToFault, AllowMaxCrlToFault };
108  static void getAllActNames(BufferStringSet&);
109  static void getActNames(BufferStringSet&,bool is2d);
110  static const char* sKeyFaultAct() { return "Fault Act"; }
111 
112 protected:
113 
115 
116  void computeTraceSegments();
117  Coord getIntersection(const BinID&,float,
118  const BinID&,float) const;
119  bool handleUntrimmed(const BinIDValueSet&,Interval<float>&,
120  const BinID&,const BinID&,bool) const;
121 
122  bool isinl_;
124  int nr_;
127  TypeSet<float> trcnrs_; // For 2D only;
131 
133 };
134 
135 
141 { mODTextTranslationClass(FaultTrcHolder);
142 public:
143  FaultTrcHolder();
144  ~FaultTrcHolder();
145 
146  const FaultTrace* getTrc(int linenr,bool isinl) const;
147  int indexOf(int linenr,bool isinl) const;
148 
149  bool isEditedOnCrl() const;
150 
152  /*For 3D: one for each inline followed by
153  one for each crossline.
154  For 2D: One for each stick.*/
155 
157 };
158 
159 
166 public:
169 
170  uiString uiMessage() const;
171 
172 protected:
173 
174  virtual bool extractFaultTrace(int) = 0;
175  virtual od_int64 nrIterations() const;
176  virtual bool doPrepare(int);
177  virtual bool doWork(od_int64,od_int64,int);
178  virtual bool doFinish(bool) { return true; }
179 
184 };
185 
186 
189 public:
192 
193 protected:
194 
195  bool extractFaultTrace(int);
196 
197  virtual bool doPrepare(int);
198 
200 
201 };
202 
203 
206 public:
208  Pos::GeomID);
210 
211 protected:
212 
213  bool extractFaultTrace(int);
214  virtual bool doPrepare(int);
215  virtual bool doFinish(bool);
216 
218 };
219 
220 
226 { mODTextTranslationClass(FaultTrcDataProvider);
227 public:
228  FaultTrcDataProvider();
229  FaultTrcDataProvider(Pos::GeomID);
230  ~FaultTrcDataProvider();
231 
232  bool init(const TypeSet<MultiID>&,const TrcKeySampling&,
233  TaskRunner* =0);
234 
235  bool is2D() const { return is2d_; }
236  int nrFaults() const;
237  TrcKeySampling range(int) const;
238  int nrSticks(int fltidx) const;
239  bool isEditedOnCrl(int fltidx) const;
240 
241  bool hasFaults(const BinID&) const;
242  const FaultTrace* getFaultTrace(int fltidx,int trcnr,bool isinl) const;
243  const FaultTrace* getFaultTrace2D(int fltidx,int stickidx) const;
244  bool isCrossingFault(const BinID& b1,float z1,
245  const BinID& b2,float z2) const;
246  bool getFaultZVals(const BinID&,TypeSet<float>&) const;
247  bool isOnFault(const BinID&,float z,float threshold) const;
248 
249  void clear();
250  bool isEmpty() const;
251  uiString errMsg() const;
252 
253 protected:
254 
255  bool calcFaultBBox(const EM::Fault&,TrcKeySampling&) const;
256  bool get2DTraces(const TypeSet<MultiID>&,TaskRunner*);
257 
259 
262  bool is2d_;
263 };
264 
265 #endif
#define mExpClass(module)
Definition: commondefs.h:160
od_int64 totalnr_
Definition: faulttrace.h:183
bool isinl_
Definition: faulttrace.h:122
Interface for a list of Coord3 with automatically maintained IDs.
Definition: positionlist.h:72
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
Fault Surface base class.
Definition: emfault.h:84
Threads::Lock lock_
Definition: faulttrace.h:132
TrcKeySampling hs_
Definition: faulttrace.h:156
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
const Interval< int > & trcRange() const
Definition: faulttrace.h:57
Geometry::ExplFaultStickSurface * fltsurf_
Definition: faulttrace.h:199
bool is2d_
Definition: faulttrace.h:262
#define od_int64
Definition: plftypes.h:36
Definition: faulttrace.h:106
bool isEditedOnCrl() const
Definition: faulttrace.h:55
bool init()
TypeSet< Line2 > tracesegs_
Definition: faulttrace.h:130
Interval< float > zrange_
Definition: faulttrace.h:129
void clear(std::ios &)
bool includes(const IdxPair &ip) const
Definition: posidxpairvalset.h:144
Pos::GeomID geomid_
Definition: faulttrace.h:217
void setEditedOnCrl(bool yn)
Definition: faulttrace.h:60
int nr_
Definition: faulttrace.h:124
int lineNr() const
Definition: faulttrace.h:56
uiString errmsg_
Definition: faulttrace.h:261
Definition: faulttrace.h:204
static const char * sKeyFaultAct()
Definition: faulttrace.h:110
Definition: uistring.h:89
A cartesian coordinate in 2D space.
Definition: coord.h:25
Set of BufferString objects.
Definition: bufstringset.h:28
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
Definition: faulttrace.h:107
FaultTrace holder.
Definition: faulttrace.h:140
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
SPos add(const IdxPair &, const float *vs=0)
Either pass sufficient data or pass null.
Definition: faulttrace.h:105
TypeSet< Coord3 > coords_
Definition: faulttrace.h:125
Definition: faulttrace.h:103
void addValue(int id, const Coord3 &)
Adds value to existing value at id.
Definition: faulttrace.h:96
Class that can execute a task.
Definition: task.h:169
const Interval< float > & zRange() const
Definition: faulttrace.h:58
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
FaultTrace extractor.
Definition: faulttrace.h:164
bool isInl() const
Definition: faulttrace.h:54
ObjectSet< FaultTrace > traces_
Definition: faulttrace.h:151
FixedString Horizon()
Definition: keystrs.h:72
void setLineNr(int nr)
Definition: faulttrace.h:61
int size() const
Definition: faulttrace.h:51
void setIsInl(bool yn)
Definition: faulttrace.h:59
TypeSet< float > trcnrs_
Definition: faulttrace.h:127
A cartesian coordinate in 3D space.
Definition: coord.h:72
Index_Type GeomID
Definition: commontypes.h:52
FixedString Fault()
Definition: keystrs.h:65
Position info, often segmented.
Definition: posinfo.h:40
FaultTrcHolder & holder_
Definition: faulttrace.h:181
Interval< int > trcrange_
Definition: faulttrace.h:128
Definition: faulttrace.h:187
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
bool editedoncrl_
Definition: faulttrace.h:182
Definition: faulttrace.h:104
Definition: explfaultsticksurface.h:37
FaultTrace data provider.
Definition: faulttrace.h:225
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:25
A Pos::IdxPairValueSet with BinIDs.
Definition: binidvalset.h:23
bool editedoncrl_
Definition: faulttrace.h:123
const char * errMsg() const
Definition: horizontracker.h:61
TypeSet< int > coordindices_
Definition: faulttrace.h:126
Act
Definition: faulttrace.h:103
bool isEmpty(const NLAModel *mdl)
~FaultTrace()
Definition: faulttrace.h:114
const EM::Fault & fault_
Definition: faulttrace.h:180
ObjectSet< FaultTrcHolder > holders_
Definition: faulttrace.h:258
Definition: arraytesselator.h:21
bool is2D() const
Definition: faulttrace.h:235
Horizon Surface.
Definition: emhorizon.h:47
Subclass of Coord3List that represents a fault trace.
Definition: faulttrace.h:35
Pos::GeomID geomid_
Definition: faulttrace.h:260
virtual bool doFinish(bool)
Definition: faulttrace.h:178

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