OpendTect-6_4  6.4
ctxtioobj.h
Go to the documentation of this file.
1 #ifndef ctxtioobj_h
2 #define ctxtioobj_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: 7-1-1996
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "namedobj.h"
17 #include "multiid.h"
18 #include "enums.h"
19 #include "ioobj.h"
20 #include "iopar.h"
21 
22 class TranslatorGroup;
23 class IOStream;
24 
30 {
31 public:
32 
33  IOObjSelConstraints();
34  IOObjSelConstraints(const IOObjSelConstraints&);
35  ~IOObjSelConstraints();
36  IOObjSelConstraints& operator =(const IOObjSelConstraints&);
37 
40 
43 
44  bool isGood(const IOObj&,bool forread=true) const;
45  void clear();
46 
47  static bool isAllowedTranslator(const char* tnm,const char* allowd);
48 
49 };
50 
51 
63 {
64 public:
65 
66  enum StdSelType { Seis=0, Surf, Loc, Feat, WllInf, NLA, Misc, Attr, Mdl,
67  Geom, None };
69 
71  const char* prefname=0);
72  IOObjContext(const IOObjContext&);
73 
74  IOObjContext& operator =(const IOObjContext&);
75 
80  bool multi_;
81 
83  bool forread_;
85  bool maydooper_;
88 
89  bool validIOObj(const IOObj&) const;
90 
91  struct StdDirData
92  {
93  StdDirData(const char*,const char*,
94  const char*);
95 
96  const char* id_;
97  const char* dirnm_;
98  const char* desc_;
100 
101  mDeprecated const char*& id;
102  mDeprecated const char*& dirnm;
103  mDeprecated const char*& desc;
104  };
105 
106  static int totalNrStdDirs();
107  static const StdDirData* getStdDirData(StdSelType);
108  static BufferString getDataDirName(StdSelType);
110 
111  const char* objectTypeName() const;
112  inline bool hasStdSelKey() const { return stdseltype_ != None; }
113  MultiID getSelKey() const;
114  IOStream* crDefaultWriteObj(const Translator&,
115  const MultiID&) const;
116  void fillTrGroup() const;
119  void fixTranslator( const char* trusrnm )
120  { deftransl_ = toselect_.allowtransls_ = trusrnm; }
121 
131 };
132 
133 
142 mExpClass(General) CtxtIOObj : public NamedObject
143 {
144 public:
146  CtxtIOObj( const IOObjContext& ct, IOObj* o=0 )
147  : NamedObject(""), ctxt_(ct), ioobj_(o), iopar_(0)
148  , ctxt(ctxt_), ioobj(ioobj_), iopar(iopar_)
149  { setLinkedTo(&ctxt_); }
150  CtxtIOObj( const CtxtIOObj& ct )
151  : NamedObject(""), ctxt_(ct.ctxt_)
152  , ioobj_(ct.ioobj_?ct.ioobj_->clone():0)
153  , iopar_(ct.iopar_?new IOPar(*ct.iopar_):0)
154  , ctxt(ctxt_), ioobj(ioobj_), iopar(iopar_)
155  { setLinkedTo(&ctxt_); }
157  void destroyAll();
158 
159  void setObj(IOObj*);
160  void setObj(const MultiID&);
161  void setPar(IOPar*);
162  int fillObj(bool mktmpifnew=false,int translidxfornew=-1);
165  void fillIfOnlyOne();
168  void fillDefault(bool alsoifonlyone=true);
170  void fillDefaultWithKey(const char*,bool alsoifonlyone=true);
172 
176 
177  //Legacy
181 };
182 
183 
184 #endif
#define mExpClass(module)
Definition: commondefs.h:160
const char * id_
Definition: ctxtioobj.h:96
Summary for a Seismic object.
Definition: segydirectdef.h:23
Definition: ioobj.h:58
const TranslatorGroup * trgroup_
Mandatory, must never be 0.
Definition: ctxtioobj.h:78
Definition: iostrm.h:26
mDeprecated bool & maydooper
Definition: ctxtioobj.h:128
mDeprecated IOObjSelConstraints & toselect
Definition: ctxtioobj.h:130
Definition: ctxtioobj.h:91
void clear(std::ios &)
IOObj * ioobj_
Definition: ctxtioobj.h:174
Holds an IOObjCtxt plus a pointer to an IOObj and/or an IOPar.
Definition: ctxtioobj.h:142
IOPar * iopar_
Definition: ctxtioobj.h:175
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
FixedString None()
Definition: keystrs.h:90
mDeprecated IOObjContext & ctxt
Definition: ctxtioobj.h:178
MultiID selkey_
If set, overrules the &#39;standard&#39;.
Definition: ctxtioobj.h:84
bool maydooper_
Will we allow add/remove etc?
Definition: ctxtioobj.h:85
Holds constraints on IOObj selection.
Definition: ctxtioobj.h:29
mDeprecated const TranslatorGroup *& trgroup
Definition: ctxtioobj.h:123
mDeprecated const char *& id
Definition: ctxtioobj.h:101
IOObjSelConstraints toselect_
Definition: ctxtioobj.h:87
Group of Translators. Has a static factory.
Definition: transl.h:56
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
#define mStartAllowDeprecatedSection
Definition: plfdefs.h:235
bool allownonuserselectable_
allow &#39;alien&#39; like SEG-Y
Definition: ctxtioobj.h:42
StdSelType
Definition: ctxtioobj.h:66
mDeprecated const char *& desc
Definition: ctxtioobj.h:103
#define mStopAllowDeprecatedSection
Definition: plfdefs.h:236
void fixTranslator(const char *trusrnm)
Definition: ctxtioobj.h:119
mStartAllowDeprecatedSection CtxtIOObj(const IOObjContext &ct, IOObj *o=0)
Definition: ctxtioobj.h:146
mDeprecated IOObj *& ioobj
Definition: ctxtioobj.h:179
const char * dirnm_
Definition: ctxtioobj.h:97
mDeprecated MultiID & selkey
Definition: ctxtioobj.h:127
mDeprecated bool & forread
Definition: ctxtioobj.h:126
CtxtIOObj(const CtxtIOObj &ct)
Definition: ctxtioobj.h:150
I/O Interpreter class for a certain object type.
Definition: transl.h:123
bool forread_
this selection only
Definition: ctxtioobj.h:83
const char * desc_
Can be converted to StdSelType.
Definition: ctxtioobj.h:98
#define mDeprecated
Definition: plfdefs.h:233
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
mDeprecated StdSelType & stdseltype
Definition: ctxtioobj.h:122
BufferString allowtransls_
FileMultiString of glob expressions.
Definition: ctxtioobj.h:41
IOPar & require_
Definition: ctxtioobj.h:38
mDeprecated const char *& dirnm
Definition: ctxtioobj.h:102
Object with a name.
Definition: namedobj.h:35
bool hasStdSelKey() const
Definition: ctxtioobj.h:112
Definition: ctxtioobj.h:66
int newonlevel_
level 0 is survey dir
Definition: ctxtioobj.h:79
StdSelType stdseltype_
intrinsics
Definition: ctxtioobj.h:77
IOObjContext ctxt_
Definition: ctxtioobj.h:173
mDeprecated IOPar *& iopar
Definition: ctxtioobj.h:180
Definition: geometry.h:19
IOPar & dontallow_
Definition: ctxtioobj.h:39
mDeprecated bool & multi
Definition: ctxtioobj.h:125
mDeprecated int & newonlevel
Definition: ctxtioobj.h:124
Compound key consisting of ints.
Definition: multiid.h:25
mDeprecated BufferString & deftransl
Definition: ctxtioobj.h:129
bool multi_
If true, multi allowed.
Definition: ctxtioobj.h:80
Holds the context for selecting and/or creating IOObjs.
Definition: ctxtioobj.h:62
BufferString deftransl_
Translator to use for new entry.
Definition: ctxtioobj.h:86

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