OpendTect-6_4  6.4
coltabindex.h
Go to the documentation of this file.
1 #ifndef coltabindex_h
2 #define coltabindex_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Sep 2007
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "coltab.h"
17 #include "typeset.h"
18 #include "uistring.h"
19 
20 
21 namespace ColTab
22 {
23 class Mapper;
24 class Sequence;
25 
33 { mODTextTranslationClass(IndexedLookUpTable);
34 public:
35 
36  IndexedLookUpTable(const Sequence&,int nrcols=0,
37  const Mapper* m=0);
38 
39  void update();
41 
42  inline Color color( float v ) const
43  { return colorForIndex( indexForValue(v) ); }
44  int indexForValue(float) const;
45  Color colorForIndex(int) const;
46 
47  void setMapper( const Mapper* m ) { mapper_ = m; }
48  void setNrCols( int n ) { nrcols_ = n; }
49  int nrCols() { return nrcols_; }
50 
51 protected:
52 
53  const Sequence& seq_;
54  const Mapper* mapper_;
55  int nrcols_;
57 
58  friend class Indexer;
59 
60 };
61 
62 } // namespace ColTab
63 
64 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Color color(float v) const
Definition: coltabindex.h:42
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Maps from [0,1] -> Color.
Definition: coltabsequence.h:37
const Sequence & seq_
Definition: coltabindex.h:53
void setMapper(const Mapper *m)
Definition: coltabindex.h:47
int nrcols_
Definition: coltabindex.h:55
Maps data values to colortable positions: [0,1].
Definition: coltabmapper.h:84
Looks up color for certain value. Keeps a pre-calc list of colors.
Definition: coltabindex.h:32
TypeSet< Color > cols_
Definition: coltabindex.h:56
Color Table
Definition: coltab.h:22
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
int nrCols()
Definition: coltabindex.h:49
void setNrCols(int n)
Definition: coltabindex.h:48
const Mapper * mapper_
Definition: coltabindex.h:54

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