OpendTect  6.6
coltabindex.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: Bert
8  Date: Sep 2007
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "coltab.h"
16 #include "typeset.h"
17 #include "uistring.h"
18 
19 
20 namespace ColTab
21 {
22 class Mapper;
23 class Sequence;
24 
33 public:
34 
35  IndexedLookUpTable(const Sequence&,int nrcols=0,
36  const Mapper* m=0);
37 
38  void update();
40 
41  inline Color color( float v ) const
42  { return colorForIndex( indexForValue(v) ); }
43  int indexForValue(float) const;
44  Color colorForIndex(int) const;
45 
46  void setMapper( const Mapper* m ) { mapper_ = m; }
47  void setNrCols( int n ) { nrcols_ = n; }
48  int nrCols() { return nrcols_; }
49 
50 protected:
51 
52  const Sequence& seq_;
53  const Mapper* mapper_;
54  int nrcols_;
56 
57  friend class Indexer;
58 
59 };
60 
61 } // namespace ColTab
62 
ColTab::IndexedLookUpTable::setMapper
void setMapper(const Mapper *m)
Definition: coltabindex.h:46
ColTab::IndexedLookUpTable
Looks up color for certain value. Keeps a pre-calc list of colors.
Definition: coltabindex.h:32
uistring.h
ColTab
Color Table
Definition: coltab.h:22
ColTab::IndexedLookUpTable::nrcols_
int nrcols_
Definition: coltabindex.h:54
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
ColTab::IndexedLookUpTable::nrCols
int nrCols()
Definition: coltabindex.h:48
typeset.h
ColTab::IndexedLookUpTable::setNrCols
void setNrCols(int n)
Definition: coltabindex.h:47
ColTab::IndexedLookUpTable::colorForIndex
Color colorForIndex(int) const
ColTab::IndexedLookUpTable::update
void update()
Call when sequence, mapper, or nr cols changed.
ColTab::Sequence
Maps from [0,1] -> Color.
Definition: coltabsequence.h:37
coltab.h
ColTab::IndexedLookUpTable::IndexedLookUpTable
IndexedLookUpTable(const Sequence &, int nrcols=0, const Mapper *m=0)
ColTab::Mapper
Maps data values to colortable positions: [0,1].
Definition: coltabmapper.h:84
ColTab::IndexedLookUpTable::mapper_
const Mapper * mapper_
Definition: coltabindex.h:53
ColTab::IndexedLookUpTable::mODTextTranslationClass
mODTextTranslationClass(IndexedLookUpTable)
ColTab::IndexedLookUpTable::indexForValue
int indexForValue(float) const
ColTab::IndexedLookUpTable::seq_
const Sequence & seq_
Definition: coltabindex.h:52
Color
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer,...
Definition: color.h:26
ColTab::IndexedLookUpTable::cols_
TypeSet< Color > cols_
Definition: coltabindex.h:55
ColTab::IndexedLookUpTable::color
Color color(float v) const
Definition: coltabindex.h:41
TypeSet< Color >

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