OpendTect-6_4  6.4
flatview.h
Go to the documentation of this file.
1 #ifndef flatview_h
2 #define flatview_h
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H. Bril
8  Date: Dec 2005
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "coltabmapper.h"
16 #include "datapackbase.h"
17 #include "draw.h"
18 #include "mousecursor.h"
19 
20 class FlatView_CB_Rcvr;
21 class ZAxisTransform;
22 namespace ZDomain { class Def; }
23 namespace FlatView
24 {
25 
28 
35 {
36 public:
37 
42  {
43  public:
44  EditPermissions();
45 
46  bool onoff_;
47  bool namepos_;
48  bool linestyle_;
49  bool linecolor_;
50  bool fillcolor_;
53  bool x1rg_;
54  bool x2rg_;
55  };
56 
57 
58  virtual ~AuxData();
59  virtual AuxData* clone() const { return new AuxData(*this); }
60  virtual void touch() {}
61 
63 
64  bool enabled_;
67  int namepos_;
68  bool fitnameinview_;
72 
86  int zvalue_;
88 
89  bool close_;
90 
91  void setFillPattern( const FillPattern& fp )
92  { fillpattern_ = fp; }
93  bool isEmpty() const;
94  void empty();
95  bool turnon_;
97 
98  // should be protected, don't use.
99  AuxData( const char* nm );
100  AuxData( const AuxData& );
101  friend class Viewer;
102 };
103 
104 
110 {
111 public:
112 
113 
116  mStruct(General) AxisData
117  {
118  AxisData();
119 
120  BufferString name_;
121  SamplingData<float> sampling_;
122  bool showannot_;
123  bool showgridlines_;
124  bool reversed_;
125  bool annotinint_;
126  int factor_;
127  bool showauxannot_;
128  uiString auxlabel_;
129  OD::LineStyle auxlinestyle_;
130  OD::LineStyle auxhllinestyle_;
131  TypeSet<PlotAnnotation> auxannot_;
132  int auxPosIdx(float pos,float eps) const;
133  void showAll(bool yn);
134  };
135 
136 
137  Annotation(bool darkbg);
138  ~Annotation();
139 
142  AxisData x1_;
143  AxisData x2_;
144 
145  bool showaux_;
147  bool editable_;
150 
151  inline void setAxesAnnot( bool yn )
152  { x1_.showAll(yn); x2_.showAll(yn); }
153  inline bool haveTitle() const
154  { return !title_.isEmpty(); }
155  inline bool haveAxisAnnot( bool x1dir ) const
156  { return color_.isVisible()
157  && ( ( x1dir && x1_.showannot_)
158  || (!x1dir && x2_.showannot_)); }
159  inline bool haveGridLines( bool x1dir ) const
160  { return color_.isVisible()
161  && ( ( x1dir && x1_.showgridlines_)
162  || (!x1dir && x2_.showgridlines_)); }
163  //bool haveAux() const;
164 
165  void fillPar(IOPar&) const;
166  void usePar(const IOPar&);
167 
168  static const char* sKeyAxes();
169  static const char* sKeyX1Sampl();
170  static const char* sKeyX2Sampl();
171  static const char* sKeyShwAnnot();
172  static const char* sKeyShwGridLines();
173  static const char* sKeyIsRev();
174  static const char* sKeyShwAux();
175 };
176 
177 
188 {
189 public:
190 
192  mExpClass(General) Common
193  {
194  public:
195  Common();
196 
197  bool show_; // default=true
198  bool blocky_; // default=false
202  };
203 
205  mExpClass(General) VD : public Common
206  {
207  public:
208 
209  VD()
210  : lininterp_(false) {}
211 
213  bool lininterp_; // Use bi-linear interpol, not poly
214  };
216  mExpClass(General) WVA : public Common
217  {
218  public:
219 
220  WVA()
221  : wigg_(Color::Black())
222  , refline_(Color::NoColor())
223  , lowfill_(Color::NoColor())
224  , highfill_(Color::Black())
225  , overlap_(1)
226  , reflinevalue_(mUdf(float)) {}
227 
232  float overlap_;
234  };
235 
237 
240  void show( bool wva, bool vd )
241  { wva_.show_ = wva; vd_.show_ = vd; }
242 
243  void fillPar(IOPar&) const;
244  void usePar(const IOPar&);
245 
246  static const char* sKeyVD();
247  static const char* sKeyWVA();
248  static const char* sKeyShow();
249  static const char* sKeyDispRg();
250  static const char* sKeyColTab();
251  static const char* sKeyFlipSequence();
252  static const char* sKeyLinearInter();
253  static const char* sKeyBlocky();
254  static const char* sKeyAutoScale();
255  static const char* sKeyClipPerc();
256  static const char* sKeyWiggCol();
257  static const char* sKeyRefLineCol();
258  static const char* sKeyLowFillCol();
259  static const char* sKeyHighFillCol();
260  static const char* sKeyOverlap();
261  static const char* sKeySymMidValue();
262  static const char* sKeyRefLineValue();
263 };
264 
265 
271 {
272 public:
273  Appearance( bool drkbg=true )
274  : darkbg_(drkbg)
275  , annot_(drkbg)
276  , secondsetaxes_(drkbg)
277  , anglewithset1_(0) {}
278 
279  virtual ~Appearance() {}
280 
281  virtual void fillPar(IOPar&) const;
282  virtual void usePar(const IOPar&);
283 
286 
287  //Second set of axes, especially handy in case flat viewer is horizontal
290 
291  void setDarkBG(bool yn);
292  bool darkBG() const { return darkbg_; }
293 
294  void setGeoDefaults(bool isvert);
295 
296 protected:
297 
298  bool darkbg_;
299 };
302 
303 
325 {
326 public:
327 
328  Viewer();
329  virtual ~Viewer();
330 
331  virtual Appearance& appearance();
332  const Appearance& appearance() const
333  { return const_cast<Viewer*>(this)->appearance(); }
334 
336  { return datatransform_; }
337  bool setZAxisTransform(ZAxisTransform*);
338  bool hasZAxisTransform() const
339  { return datatransform_; }
340 
341  void addPack(::DataPack::ID);
345  void usePack(bool wva,::DataPack::ID,bool usedefs=true );
347  void removePack(::DataPack::ID);
349  void setPack(bool wva,::DataPack::ID id,bool usedefs=true)
350  { addPack( id ); usePack( wva, id, usedefs ); }
351  void clearAllPacks();
352 
353  const FlatDataPack* obtainPack(bool wva,bool checkother=false) const;
361  bool hasPack(bool wva) const
362  { return packID(wva)!=DataPack::cNoID(); }
363  DataPack::ID packID(bool wva) const;
364 
365  const TypeSet< ::DataPack::ID>& availablePacks() const { return ids_; }
366 
367  virtual bool isVertical() const { return true; }
368  bool isVisible(bool wva) const;
369  void setVisible(bool wva, bool visibility);
372 
373  Coord3 getCoord(const Point&) const;
374 
375  enum DataChangeType { All=0xFFFFFFFF, BitmapData=0x0001, DisplayPars=0x0002,
376  Annot=0x0004, Auxdata=0x0008 };
377  virtual void handleChange(unsigned int datachangetype) = 0;
381  virtual void fillAppearancePar( IOPar& iop ) const
383  { appearance().fillPar( iop ); }
386  virtual void useAppearancePar( const IOPar& iop )
387  { appearance().usePar( iop ); }
388 
389  void storeDefaults(const char* key) const;
390  void useStoredDefaults(const char* key);
391 
392  void getAuxInfo(const Point&,IOPar&) const;
393  virtual void showAuxDataObjects(AuxData&,bool) {}
394  virtual void updateProperties(const AuxData&) {}
395  virtual void reGenerate(AuxData&) {}
396  virtual void remove(const AuxData&) {}
397 
398  StepInterval<double> getDataPackRange(bool forx1) const;
399  virtual Interval<float> getDataRange(bool wva) const;
400 
401  virtual AuxData* createAuxData(const char* nm) const = 0;
402 
403  virtual int nrAuxData() const = 0;
404  virtual AuxData* getAuxData(int idx) = 0;
405  virtual const AuxData* getAuxData(int idx) const = 0;
406  virtual void addAuxData(AuxData* a) = 0;
407  virtual AuxData* removeAuxData(AuxData* a) = 0;
408  virtual AuxData* removeAuxData(int idx) = 0;
409  void removeAuxDatas(ObjectSet<AuxData>&);
410  void removeAllAuxData();
411  virtual void setAnnotChoice(int selannot) {}
412  virtual int getAnnotChoice(BufferStringSet&) const
413  { return -1; }
415  { needstatusbarupd_ = true; }
417  { needstatusbarupd_ = false; }
418  bool needStatusBarUpdate() const
419  { return needstatusbarupd_; }
420  void setSeisGeomidsToViewer(TypeSet<Pos::GeomID>&);
421  const TypeSet<Pos::GeomID>& getAllSeisGeomids() const;
422  void setZDomain(const ZDomain::Def&);
423  const ZDomain::Info& zDomain() const;
424 
425 protected:
426 
431  FlatView_CB_Rcvr* cbrcvr_;
435 
436  void addAuxInfo(bool,const Point&,IOPar&) const;
437 
438 private:
439 
443 
444 public:
445 };
446 
447 } // namespace FlatView
448 
449 #endif
#define mExpClass(module)
Definition: commondefs.h:160
bool linestyle_
Definition: flatview.h:48
Color wigg_
Definition: flatview.h:228
ZDomain::Info * zdinfo_
Definition: flatview.h:434
Class that represents non-bitmap data to be displayed in a flatviewer, such as markers, lines and more.
Definition: flatview.h:34
WVA()
Definition: flatview.h:220
bool close_
Definition: flatview.h:89
bool show_
Definition: flatview.h:197
bool haveTitle() const
Definition: flatview.h:153
Definition: draw.h:146
void show(bool wva, bool vd)
Definition: flatview.h:240
const FlatDataPack * wvapack_
Definition: flatview.h:440
Definition of a mouse cursor, can be either a predefined shape (from the enum, or a file...
Definition: mousecursor.h:26
Appearance * defapp_
Definition: flatview.h:428
FillPattern fillpattern_
Definition: flatview.h:85
bool markerstyle_
Definition: flatview.h:51
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
Definition: draw.h:21
Color fillcolor_
Definition: flatview.h:84
static ID cNoID()
Definition: datapack.h:64
Annotation data for flatviewers.
Definition: flatview.h:109
#define mStruct(module)
Definition: commondefs.h:165
bool needStatusBarUpdate() const
Definition: flatview.h:418
bool turnon_
Definition: flatview.h:95
BufferString ctab_
Definition: flatview.h:212
const TypeSet< ::DataPack::ID > & availablePacks() const
Definition: flatview.h:365
Wiggle/Variable Area parameters.
Definition: flatview.h:216
bool darkBG() const
Definition: flatview.h:292
virtual int getAnnotChoice(BufferStringSet &) const
Definition: flatview.h:412
Common to VD and WVA.
Definition: flatview.h:192
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
BufferString name_
Definition: flatview.h:65
Definition: draw.h:118
Annotation secondsetaxes_
Definition: flatview.h:288
bool needstatusbarupd_
Definition: flatview.h:433
void setFillPattern(const FillPattern &fp)
Definition: flatview.h:91
bool fillcolor_
Definition: flatview.h:50
Interval< double > * x1rg_
if 0, use viewer&#39;s rg & zoom
Definition: flatview.h:70
EditPermissions * editpermissions_
If null no editing allowed.
Definition: flatview.h:62
WVA wva_
Definition: flatview.h:239
Explains what part of an AuxData&#39;s appearance may be edited by the user.
Definition: flatview.h:41
AxisData x1_
Definition: flatview.h:142
BufferString title_
color not settable
Definition: flatview.h:140
bool namepos_
Definition: flatview.h:47
int zvalue_
overlay zvalue ( max=on top )
Definition: flatview.h:86
Definition: uistring.h:89
bool haveAxisAnnot(bool x1dir) const
Definition: flatview.h:155
Set of BufferString objects.
Definition: bufstringset.h:28
DataDispPars ddpars_
Definition: flatview.h:285
int ID
Definition: datapack.h:38
Threads::Lock lock_
Definition: flatview.h:432
Data display parameters.
Definition: flatview.h:187
Color refline_
Definition: flatview.h:229
Flat Viewer using FlatView::Data and FlatView::Appearance.
Definition: flatview.h:324
bool allowuserchangedata_
Definition: flatview.h:200
void setAxesAnnot(bool yn)
Definition: flatview.h:151
Set of pointers to objects.
Definition: commontypes.h:32
bool x1rg_
Definition: flatview.h:53
Manages DataPacks.
Definition: datapack.h:141
FlatView_CB_Rcvr * cbrcvr_
Definition: flatview.h:431
bool x2rg_
Definition: flatview.h:54
float anglewithset1_
Definition: flatview.h:289
TypeSet< ::DataPack::ID > ids_
Definition: flatview.h:427
Definition: vishorizonsectiondef.h:31
Color highfill_
Definition: flatview.h:231
TypeSet< MarkerStyle2D > markerstyles_
Definition: flatview.h:74
const Appearance & appearance() const
Definition: flatview.h:332
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
void setPack(bool wva,::DataPack::ID id, bool usedefs=true)
Definition: flatview.h:349
Variable Density (=color-bar driven) parameters.
Definition: flatview.h:205
Interval< double > * x2rg_
if 0, use viewer&#39;s rg & zoom
Definition: flatview.h:71
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
bool hasPack(bool wva) const
Definition: flatview.h:361
VD vd_
Definition: flatview.h:238
DataDispPars()
Definition: flatview.h:236
int namepos_
center=0, after last=1
Definition: flatview.h:67
DataPackMgr & dpm_
Definition: flatview.h:429
bool showscalebar_
Definition: flatview.h:146
VD()
Definition: flatview.h:209
const FlatDataPack * vdpack_
Definition: flatview.h:441
Appearance(bool drkbg=true)
Definition: flatview.h:273
FixedString All()
Definition: keystrs.h:36
MouseCursor cursor_
Definition: flatview.h:87
ColTab::MapperSetup mappersetup_
Definition: flatview.h:201
bool enabled_
Turns on/off everything.
Definition: flatview.h:64
bool hasZAxisTransform() const
Definition: flatview.h:338
Setup class for colortable Mapper.
Definition: coltabmapper.h:35
void disableStatusBarUpdate()
Definition: flatview.h:416
Color color_
For axes.
Definition: flatview.h:141
DataChangeType
Definition: flatview.h:375
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
bool markercolor_
Definition: flatview.h:52
ZAxisTransform * datatransform_
Definition: flatview.h:430
Alignment namealignment_
Definition: flatview.h:66
void enableStatusBarUpdate()
Definition: flatview.h:414
OD::LineStyle linestyle_
Definition: flatview.h:83
A cartesian coordinate in 3D space.
Definition: coord.h:72
Annotation annot_
Definition: flatview.h:284
float reflinevalue_
Definition: flatview.h:233
TypeSet< Pos::GeomID > geom2dids_
Definition: flatview.h:442
virtual void updateProperties(const AuxData &)
Definition: flatview.h:394
ZAxisTransform * getZAxisTransform() const
Definition: flatview.h:335
virtual void fillPar(IOPar &) const
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool isEmpty() const
Definition: odstring.h:51
TypeSet< Point > poly_
Definition: flatview.h:73
float overlap_
Definition: flatview.h:232
bool isVisible() const
virtual void setAnnotChoice(int selannot)
Definition: flatview.h:411
bool onoff_
Definition: flatview.h:46
bool allowuserchange_
Definition: flatview.h:199
virtual bool isVertical() const
Definition: flatview.h:367
virtual void usePar(const IOPar &)
bool lininterp_
Definition: flatview.h:213
virtual ~Appearance()
Definition: flatview.h:279
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
bool darkbg_
Definition: flatview.h:298
DataPack for flat data.
Definition: datapackbase.h:64
Flatviewer appearance.
Definition: flatview.h:270
virtual void touch()
Definition: flatview.h:60
bool allowuserchange_
Definition: flatview.h:148
bool haveGridLines(bool x1dir) const
Definition: flatview.h:159
virtual void useAppearancePar(const IOPar &iop)
Definition: flatview.h:386
bool isEmpty(const NLAModel *mdl)
virtual void reGenerate(AuxData &)
Definition: flatview.h:395
Base class for z-axis transforms.
Definition: zaxistransform.h:37
Color lowfill_
Definition: flatview.h:230
Definition: bitmap2rgb.h:18
bool allowuserchangereversedaxis_
Definition: flatview.h:149
bool needsupdatelines_
Definition: flatview.h:96
bool showaux_
Definition: flatview.h:145
Definition of z-domain.
Definition: zdomain.h:41
virtual void showAuxDataObjects(AuxData &, bool)
Definition: flatview.h:393
bool editable_
Definition: flatview.h:147
virtual AuxData * clone() const
Definition: flatview.h:59
bool linecolor_
Definition: flatview.h:49
Information of z-domain.
Definition: zdomain.h:91
Geom::PosRectangle< double > Rect
Definition: flatview.h:27
AxisData x2_
Definition: flatview.h:143
Definition: zdomain.h:20
bool blocky_
Definition: flatview.h:198

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