OpendTect-6_4  6.4
posfilterstd.h
Go to the documentation of this file.
1 #ifndef posfilterstd_h
2 #define posfilterstd_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Feb 2008
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "algomod.h"
17 #include "posfilter.h"
18 
19 
20 namespace Pos
21 {
22 
27 mExpClass(Algo) RandomFilter : public virtual Filter
28 {
29 public:
30 
32  : passratio_(0.01) {}
34  : passratio_(rf.passratio_) {}
35 
36  bool initialize( TaskRunner* tr=0 ) { reset(); return true; }
37  void reset() { initStats(); }
38 
39  virtual void usePar(const IOPar&);
40  virtual void fillPar(IOPar&) const;
41  virtual void getSummary(BufferString&) const;
42  virtual float estRatio(const Provider&) const { return passratio_; }
43 
44  float passratio_;
45 
46  static const char* typeStr();
47  static const char* ratioStr();
48 
49 protected:
50 
51  void initStats();
52  bool drawRes() const;
53 };
54 
55 
56 #define mSimpPosFilterDefFnsBase \
57 const char* factoryKeyword() const { return type(); } \
58 virtual const char* type() const { return typeStr(); } \
59 virtual bool includes(const Coord&,float z=1e30) const { return drawRes(); } \
60 static void initClass()
61 
62 #define mSimpPosFilterDefFns3D(clssnm) \
63 virtual bool includes(const BinID&,float z=1e30) const { return drawRes(); } \
64 virtual bool is2D() const { return false; } \
65 virtual Filter* clone() const { return new clssnm##Filter3D(*this); } \
66 static Filter3D* create() { return new clssnm##Filter3D; } \
67 mSimpPosFilterDefFnsBase
68 
69 #define mSimpPosFilterDefFns2D(clssnm) \
70 virtual bool includes(int,float z=1e30,int nr=0) const { return drawRes(); } \
71 virtual bool is2D() const { return false; } \
72 virtual Filter* clone() const { return new clssnm##Filter2D(*this); } \
73 static Filter2D* create() { return new clssnm##Filter2D; } \
74 mSimpPosFilterDefFnsBase
75 
76 
82  , public RandomFilter
83 {
84 public:
85 
87 
88 };
89 
90 
96  , public RandomFilter
97 {
98 public:
99 
101 
102 };
103 
104 
109 mExpClass(Algo) SubsampFilter : public virtual Filter
110 {
111 public:
112 
114  : each_(2), seqnr_(0) {}
116  : each_(sf.each_), seqnr_(sf.seqnr_) {}
117 
118  void reset() { seqnr_ = 0; }
119 
120  virtual void usePar(const IOPar&);
121  virtual void fillPar(IOPar&) const;
122  virtual void getSummary(BufferString&) const;
123  virtual float estRatio(const Provider&) const { return 1.f/each_; }
124 
125  int each_;
126 
127  static const char* typeStr();
128  static const char* eachStr();
129 
130 protected:
131 
132  mutable int seqnr_;
133 
134  bool drawRes() const;
135 };
136 
137 
143  , public SubsampFilter
144 {
145 public:
146 
148 
149 };
150 
151 
157  , public SubsampFilter
158 {
159 public:
160 
162 
163 };
164 
165 } // namespace
166 
167 #endif
#define mExpClass(module)
Definition: commondefs.h:160
void reset()
Definition: posfilterstd.h:37
virtual float estRatio(const Provider &) const
Definition: posfilterstd.h:42
Passes each nth position.
Definition: posfilterstd.h:109
Provides a series of positions; can also be used for subselection.
Definition: posprovider.h:33
float passratio_
Definition: posfilterstd.h:44
virtual float estRatio(const Provider &) const
Definition: posfilterstd.h:123
FixedString Random()
Definition: keystrs.h:106
int seqnr_
Definition: posfilterstd.h:132
Passes each nth position (2D).
Definition: posfilterstd.h:156
RandomFilter(const RandomFilter &rf)
Definition: posfilterstd.h:33
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
SubsampFilter(const SubsampFilter &sf)
Definition: posfilterstd.h:115
Provides a filter related to 3D data.
Definition: posfilter.h:79
Passes a percentage of the positions (3D).
Definition: posfilterstd.h:81
Decides whether a given position should be included.
Definition: posfilter.h:45
Passes a percentage of the positions.
Definition: posfilterstd.h:27
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Class that can execute a task.
Definition: task.h:169
RandomFilter()
Definition: posfilterstd.h:31
Position.
Definition: commontypes.h:42
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
#define mSimpPosFilterDefFns2D(clssnm)
Definition: posfilterstd.h:69
Provides a filter related to 2D seismic data.
Definition: posfilter.h:98
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Passes each nth position (3D).
Definition: posfilterstd.h:142
void reset()
Definition: posfilterstd.h:118
#define mSimpPosFilterDefFns3D(clssnm)
Definition: posfilterstd.h:62
Passes a percentage of the positions (2D).
Definition: posfilterstd.h:95
SubsampFilter()
Definition: posfilterstd.h:113
bool initialize(TaskRunner *tr=0)
Definition: posfilterstd.h:36
int each_
Definition: posfilterstd.h:125

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