OpendTect-6_4  6.4
embodyoperator.h
Go to the documentation of this file.
1 #ifndef embodyoperator_h
2 #define embodyoperator_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Yuancheng Liu
9  Date: Feb 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "earthmodelmod.h"
17 #include "arrayndinfo.h"
18 #include "enums.h"
19 #include "iopar.h"
20 #include "multiid.h"
21 #include "paralleltask.h"
22 #include "trigonometry.h"
23 
24 class TaskRunner;
25 class Plane3;
26 class DAGTetrahedraTree;
27 
28 template<class T> class Array3D;
29 
30 namespace EM
31 {
32 
33 class Body;
34 class ImplicitBody;
35 
42 {
43 public:
44  BodyOperator();
45  ~BodyOperator();
46  enum Action { Union, IntSect, Minus };
48 
49  bool isOK() const;
50 
51  bool createImplicitBody(ImplicitBody*&,TaskRunner*) const;
52  /*<Make a body using b0 u/n/- b1. If use "Minus"
53  b0-b1,it means the body part in b0 but not in b1.
54  Set two inputs and one Action before use it. */
55 
56  ImplicitBody* createImplicitBody(const TypeSet<Coord3>& bodypts,
57  TaskRunner* tr=0) const;
58  /*<This is an independent function which creates an
59  implicite body with position value -1,0,1 depends on
60  the position is inside, on or outside the
61  triangulated body for a set of random points. Users
62  don't have to set any action or body. */
63 
64  void setInput(bool body0,const MultiID&);
65  void setInput(bool body0,BodyOperator*);
67  BodyOperator* getChildOprt(bool body0) const;
68  bool getChildOprt(int freeid,BodyOperator&);
69 
70  void setAction(Action);
71  Action getAction() const { return action_; }
72  int getID() const { return id_; }
73  /*<If id_ is 0, it is on the top of a tree struct. */
74  static int getFreeID();
75 
76  bool usePar(const IOPar&);
77  void fillPar(IOPar&);
78 
79  static const char* sKeyID() { return "ID"; }
80  static const char* sKeyAction() { return "Action"; }
81  static const char* sKeyBodyID0() { return "BodyID0"; }
82  static const char* sKeyBodyID1() { return "BodyID1"; }
83 
84 protected:
85 
86  ImplicitBody* getOperandBody(bool body0,TaskRunner* tr) const;
87 
89  BodyOperator* inputbodyop0_;
90 
92  BodyOperator* inputbodyop1_;
93 
94  int id_;
96 };
97 
98 
99 /*
100 \brief Converts an explicit body to implicit.
101 
102  Given a triangulated body, extract position value on each trace based on
103  threshhold value. The arr's size is based on inlrg, crlrg, zrg. The value at
104  each point is the min distance to the body, inside to be negative, and
105  outside to be positive.
106 */
107 
109 {
110 public:
112  const StepInterval<int>& inlrg,
113  const StepInterval<int>& crlrg,
114  const StepInterval<float>& zrg,
115  Array3D<float>& arr);
116 
117  od_int64 nrIterations() const;
118 
119 private:
120 
121  bool doPrepare(int nrthreads);
122  bool doWork(od_int64,od_int64,int);
123 
131 };
132 
133 } // namespace EM
134 
135 #endif
#define mExpClass(module)
Definition: commondefs.h:160
static const char * sKeyBodyID1()
Definition: embodyoperator.h:82
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
#define od_int64
Definition: plftypes.h:36
Definition: embodyoperator.h:46
A Plane3 is a plane in space, with the equation: Ax + By + Cz + D = 0.
Definition: trigonometry.h:484
int getID() const
Definition: embodyoperator.h:72
Delaunay triangulation for 3D points. Should make sure all the points are defined.
Definition: delaunay3d.h:25
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
Operators for implicit body. Each BodyOperator has two children, either a Body or a BodyOperator...
Definition: embodyoperator.h:41
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
static const char * sKeyID()
Definition: embodyoperator.h:79
const StepInterval< int > & crlrg_
Definition: embodyoperator.h:127
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Class that can execute a task.
Definition: task.h:169
static const char * sKeyBodyID0()
Definition: embodyoperator.h:81
BodyOperator * inputbodyop0_
Definition: embodyoperator.h:89
const DAGTetrahedraTree & tree_
Definition: embodyoperator.h:124
Action action_
Definition: embodyoperator.h:95
TypeSet< Plane3 > planes_
Definition: embodyoperator.h:130
int id_
Definition: embodyoperator.h:94
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Action
Definition: embodyoperator.h:46
FixedString Body()
Definition: keystrs.h:43
Array3D< float > & arr_
Definition: embodyoperator.h:128
StepInterval< float > zrg_
Definition: embodyoperator.h:125
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:25
Implicit representation of a body.
Definition: embody.h:32
Action getAction() const
Definition: embodyoperator.h:71
const StepInterval< int > & inlrg_
Definition: embodyoperator.h:126
static const char * sKeyAction()
Definition: embodyoperator.h:80
TypeSet< int > tri_
Definition: embodyoperator.h:129
Definition: embodyoperator.h:108
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
MultiID inputbody1_
Definition: embodyoperator.h:91
Compound key consisting of ints.
Definition: multiid.h:25
MultiID inputbody0_
Definition: embodyoperator.h:88
BodyOperator * inputbodyop1_
Definition: embodyoperator.h:92

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