OpendTect  6.3
coltabsequence.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H. Bril
8  Date: 23-3-2000
9 ________________________________________________________________________
10 
11 -*/
12 
13 
14 #include "coltab.h"
15 #include "enums.h"
16 #include "uistring.h"
17 #include "sharedobject.h"
18 
19 
20 namespace ColTab
21 {
22 
23 class SequenceManager;
24 
25 
37 mExpClass(General) Sequence : public SharedObject
38 {
39 public:
40 
42  typedef size_type IdxType;
43  typedef unsigned char CompType;
44  typedef std::pair<PosType,CompType> TranspPtType;
45 
46  enum Status { System, Edited, Added };
48 
49  Sequence();
50  Sequence(const char*);
53 
54  Color color(PosType) const;
55 
56  Status status() const;
57  inline bool isSys() const { return status()==System; }
58  mImplSimpleMonitoredGetSet(inline,disabled,setDisabled,bool,disabled_,
59  cStatusChange())
60  uiString statusDispStr() const;
61 
62  inline bool isEmpty() const { return size() < 1; }
63  size_type size() const;
64  PosType position(IdxType) const;
65  CompType r(IdxType) const;
66  CompType g(IdxType) const;
67  CompType b(IdxType) const;
68 
69  size_type transparencySize() const;
70  TranspPtType transparency(IdxType) const;
71  CompType transparencyAt(PosType) const;
72  void setTransparency(TranspPtType);
73  void changeTransparency(IdxType,TranspPtType);
74  void removeTransparencies();
75  void removeTransparencyAt(IdxType);
76  bool hasTransparency() const;
77 
78  mImplSimpleMonitoredGetSet(inline,nrSegments,setNrSegments,size_type,
79  nrsegments_,cSegmentationChange())
83  bool isSegmentized() const { return nrSegments(); }
84 
85  void changeColor(IdxType,CompType,CompType,CompType);
86  void changePos(IdxType,PosType);
87  IdxType setColor(PosType,
88  CompType,CompType,CompType);
89  void removeColor(IdxType);
90  void removeAllColors();
91 
92  void fillPar(IOPar&) const;
93  bool usePar(const IOPar&);
94 
95  mImplSimpleMonitoredGetSet(inline,undefColor,setUndefColor,
96  Color,undefcolor_,cUdfColChange())
97  mImplSimpleMonitoredGetSet(inline,markColor,setMarkColor,
98  Color,markcolor_,cMarkColChange())
99 
100  static ChangeType cStatusChange() { return 3; }
101  static ChangeType cColorChange() { return 4; }
102  static ChangeType cTransparencyChange() { return 5; }
103  static ChangeType cSegmentationChange() { return 6; }
104  static ChangeType cMarkColChange() { return 7; }
105  static ChangeType cUdfColChange() { return 8; }
106 
107  static const char* sKeyValCol();
108  static const char* sKeyMarkColor();
109  static const char* sKeyUdfColor();
110  static const char* sKeyTransparency();
111  static const char* sKeyCtbl();
112  static const char* sKeyNrSegments();
113  static const char* sKeyDisabled();
114  static const char* sDefaultName(bool for_seismics=false);
115 
116 protected:
117 
118  ~Sequence();
119 
125 
126  size_type nrsegments_ = 0;
127  Color undefcolor_ = Color::LightGrey();
128  Color markcolor_ = Color::DgbColor();
129  bool disabled_ = false;
130 
131  inline size_type gtSize() const { return x_.size(); }
132 
133  PosType snapToSegmentCenter(PosType) const;
134  CompType gtTransparencyAt(PosType) const;
135  bool chgColor(IdxType,CompType,CompType,CompType);
136  bool rmColor(IdxType);
137  void emitStatusChg() const;
138 
139  friend class SequenceManager;
140 
141 };
142 
143 
144 } // namespace ColTab
#define mExpClass(module)
Definition: commondefs.h:157
TypeSet< TranspPtType > tr_
Definition: coltabsequence.h:124
int ChangeType
Definition: monitorable.h:80
static ChangeType cMarkColChange()
Definition: coltabsequence.h:104
A series of color control points able to give an (interpolated) color for every position [0...
Definition: coltabsequence.h:37
Definition: coltabsequence.h:46
bool isSys() const
Definition: coltabsequence.h:57
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
Definition: sharedobject.h:18
Definition: uistring.h:88
std::pair< PosType, CompType > TranspPtType
Definition: coltabsequence.h:44
static ChangeType cTransparencyChange()
Definition: coltabsequence.h:102
Manages Sequences; reads/writes system or user-defined.
Definition: coltabseqmgr.h:33
#define mDeclMonitorableAssignment(clss)
like mDeclAbstractMonitorableAssignment but for non-abstract subclasses. Implements the clone() metho...
Definition: monitor.h:111
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:188
#define mDeclInstanceCreatedNotifierAccess(clss)
Definition: notify.h:235
Set of (small) copyable elements.
Definition: commontypes.h:26
TypeSet< PosType > x_
Definition: coltabsequence.h:120
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
#define mImplSimpleMonitoredGetSet(pfx, fnnmget, fnnmset, typ, memb, chgtyp)
Defines simple MT-safe copyable member access.
Definition: monitor.h:39
TypeSet< CompType > b_
Definition: coltabsequence.h:123
size_type gtSize() const
Definition: coltabsequence.h:131
TypeSet< CompType > r_
Definition: coltabsequence.h:121
TypeSet< PosType >::size_type size_type
Definition: coltabsequence.h:41
mImplSimpleMonitoredGetSet(inline, nrSegments, setNrSegments, size_type, nrsegments_, cSegmentationChange()) bool isSegmentized() const
Definition: coltabsequence.h:78
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
static Color LightGrey()
Definition: color.h:80
Definition: issuereporter.h:17
size_type size() const
Definition: typeset.h:263
static Color DgbColor()
Definition: color.h:78
bool isEmpty() const
Definition: coltabsequence.h:62
size_type IdxType
Definition: coltabsequence.h:42
static ChangeType cSegmentationChange()
Definition: coltabsequence.h:103
Definition: coltab.h:20
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
unsigned char CompType
Definition: coltabsequence.h:43
static ChangeType cUdfColChange()
Definition: coltabsequence.h:105
float PosType
Definition: coltab.h:24
Status
Definition: coltabsequence.h:46
static ChangeType cColorChange()
Definition: coltabsequence.h:101
TypeSet< CompType > g_
Definition: coltabsequence.h:122

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