OpendTect-6_4  6.4
horizonrelation.h
Go to the documentation of this file.
1 #ifndef horizonrelation_h
2 #define horizonrelation_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Raman K Singh
9  Date: Jul 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 
16 #include "earthmodelmod.h"
17 #include "multiid.h"
18 #include "objectset.h"
19 
20 class FileMultiString;
21 
22 
23 namespace EM
24 {
25 
32 {
33 public:
34 
35  mExpClass(EarthModel) Node
36  {
37  public:
38  Node(const MultiID&);
39 
43 
44  bool hasChild(const Node* descendant) const;
45 
46  void fillPar(IOPar&) const;
47  void fillChildren(const FileMultiString&,
48  const RelationTree&);
49 
50  static const char* sKeyChildIDs();
51  static const char* sKeyLastModified();
52  };
53 
54 
55  RelationTree(bool is2d,bool read=true);
56  ~RelationTree();
57 
58  const RelationTree::Node* getNode(const MultiID&) const;
59  void getParents(int,TypeSet<int>&) const;
60  void removeNode(const MultiID&,bool write=true);
61  void addRelation(const MultiID& id1,
62  const MultiID& id2,bool write=true);
63  // id1 is above id2
64 
65  int findRelation(const MultiID&,
66  const MultiID&) const;
67  /* 0 -> no relation
68  1 -> first horizon is at the top
69  2 -> second horizon is at the top */
70  bool getSorted(const TypeSet<MultiID>& unsortedids,
71  TypeSet<MultiID>& sortedids ) const;
72 
73  bool read() { return read(true); }
74  bool write() const;
75 
76 protected:
77 
79  bool is2d_;
80 
81  int findNode(const MultiID&) const;
82 
83  static const char* sKeyHorizonRelations();
84 
85  bool read(bool removeoutdated);
86 
87 public:
88  static bool clear(bool is2d,bool dowrite=true);
89  static bool sortHorizons(bool is2d,
90  const TypeSet<MultiID>& unsortedids,
91  TypeSet<MultiID>& sortedids);
96  static bool getSorted(bool is2d,TypeSet<MultiID>&);
97  static bool getSorted(bool is2d,BufferStringSet&);
98  static bool update(bool id2d,
99  const TypeSet<MultiID>& sortedids);
100 };
101 
102 } // namespace EM
103 
104 #endif
#define mExpClass(module)
Definition: commondefs.h:160
bool is2d_
Definition: horizonrelation.h:79
void clear(std::ios &)
ObjectSet< RelationTree::Node > nodes_
Definition: horizonrelation.h:78
A Relation tree where a parent-child relationship means a top-bottom relationship for the horizons...
Definition: horizonrelation.h:31
Set of BufferString objects.
Definition: bufstringset.h:28
BufferString datestamp_
Definition: horizonrelation.h:42
SeparString with backquotes as separators, use in most ascii files.
Definition: separstr.h:119
Set of pointers to objects.
Definition: commontypes.h:32
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
ObjectSet< const Node > children_
Definition: horizonrelation.h:41
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Definition: horizonrelation.h:35
MultiID id_
Definition: horizonrelation.h:40
Earth Model objects like horizons, faults, fault-sticks and bodies.
Definition: embody.h:25
bool read()
Definition: horizonrelation.h:73
Compound key consisting of ints.
Definition: multiid.h:25

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