OpendTect  6.6
vistexturechannel2rgba.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: K. Tingdahl
8  Date: Sep 2008
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 
13 -*/
14 
15 #include "visbasemod.h"
16 #include "visdata.h"
17 
18 
19 namespace ColTab { class Sequence; }
20 namespace osgGeo { class LayeredTexture; class ColorSequence; }
21 namespace osg { class Image; }
22 
23 namespace visBase
24 {
25 
26 class TextureChannels;
27 class MappedTextureDataSet;
28 
37 public:
39 
40  virtual void setChannels(TextureChannels*);
41  virtual void notifyChannelChange() {}
42  virtual void notifyChannelInsert(int ch) {}
43  virtual void notifyChannelRemove(int ch) {}
44 
45  virtual const osg::Image* createRGBA() const;
49  virtual bool canSetSequence() const { return false;}
50  virtual void setSequence(int,const ColTab::Sequence&){}
51  virtual const ColTab::Sequence* getSequence(int) const { return 0; }
52 
53  virtual void swapChannels(int ch0,int ch1) {}
54  virtual void setEnabled(int ch,bool yn) {}
55  virtual bool isEnabled(int ch) const { return true; }
56 
57  virtual bool canUseShading() const;
58  virtual void allowShading(bool);
59  virtual bool usesShading() const;
60 
61  virtual int maxNrChannels() const = 0;
62  virtual int minNrChannels() const { return 1; }
63  virtual void getChannelName(int,uiString&) const;
64 
66  const unsigned char* getTextureData() const;
67  int getTextureWidth() const;
68  int getTextureHeight() const;
69 
70 protected:
72 
74  osgGeo::LayeredTexture* laytex_;
75 };
76 
77 
82 {
83 public:
84  virtual int nrChannels() const = 0;
85  virtual bool addChannel() = 0;
86  virtual bool enableNotify(bool) = 0;
88  virtual void touch() = 0;
89  virtual void setNrChannels(int) = 0;
90 };
91 
92 
93 
99 {
100 public:
103 
104  void swapChannels(int ch0,int ch1);
105 
106  bool canSetSequence() const { return true;}
107  void setSequence(int ch,const ColTab::Sequence&);
108  const ColTab::Sequence* getSequence(int ch) const;
109 
110  void setEnabled(int ch,bool yn);
111  bool isEnabled(int ch) const;
112 
113  void setTransparency(int ch,unsigned char yn);
114  unsigned char getTransparency(int ch) const;
115 
116  int maxNrChannels() const;
117 
118 protected:
119  void notifyChannelInsert(int ch);
120  void notifyChannelRemove(int ch);
121 
124 
126 
127  void update();
128  void getColors(int channel,
129  TypeSet<unsigned char>&) const;
130 
134 
137 };
138 
139 } //namespace
140 
visBase::ColTabTextureChannel2RGBA::setTransparency
void setTransparency(int ch, unsigned char yn)
visBase::TextureChannel2RGBA::setSequence
virtual void setSequence(int, const ColTab::Sequence &)
Definition: vistexturechannel2rgba.h:50
visBase::MappedTextureDataSet
Definition: vistexturechannel2rgba.h:82
visBase::TextureChannel2RGBA::mODTextTranslationClass
mODTextTranslationClass(TextureChannel2RGBA)
visBase::TextureChannel2RGBA
Definition: vistexturechannel2rgba.h:36
visBase::MappedTextureDataSet::setNrChannels
virtual void setNrChannels(int)=0
visBase::TextureChannel2RGBA::getSequence
virtual const ColTab::Sequence * getSequence(int) const
Definition: vistexturechannel2rgba.h:51
visBase::ColTabTextureChannel2RGBA::enabled_
BoolTypeSet enabled_
Definition: vistexturechannel2rgba.h:132
visBase::TextureChannel2RGBA::getChannelName
virtual void getChannelName(int, uiString &) const
ObjectSet< ColTab::Sequence >
visBase::ColTabTextureChannel2RGBA::isEnabled
bool isEnabled(int ch) const
ColTab
Color Table
Definition: coltab.h:22
visBase::TextureChannel2RGBA::createMappedDataSet
virtual MappedTextureDataSet * createMappedDataSet() const
visBase
Definition: visannot.h:43
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
osg
Open Scene Graph.
Definition: visannot.h:29
visBase::DataObject
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:63
visBase::ColTabTextureChannel2RGBA::setChannels
void setChannels(TextureChannels *)
visBase::MappedTextureDataSet::addChannel
virtual bool addChannel()=0
visBase::TextureChannel2RGBA::getTextureHeight
int getTextureHeight() const
visBase::ColTabTextureChannel2RGBA::update
void update()
visBase::TextureChannel2RGBA::getTextureData
const unsigned char * getTextureData() const
visBase::TextureChannel2RGBA::getTexturePixelSizeInBits
int getTexturePixelSizeInBits() const
visBase::ColTabTextureChannel2RGBA::create
static ColTabTextureChannel2RGBA * create()
Definition: vistexturechannel2rgba.h:101
visBase::MappedTextureDataSet::nrChannels
virtual int nrChannels() const =0
visBase::TextureChannel2RGBA::notifyChannelChange
virtual void notifyChannelChange()
Definition: vistexturechannel2rgba.h:41
visBase::ColTabTextureChannel2RGBA::~ColTabTextureChannel2RGBA
~ColTabTextureChannel2RGBA()
ColTab::Sequence
Maps from [0,1] -> Color.
Definition: coltabsequence.h:37
visBase::TextureChannels
Definition: vistexturechannels.h:50
visBase::ColTabTextureChannel2RGBA::setEnabled
void setEnabled(int ch, bool yn)
visBase::TextureChannel2RGBA::notifyChannelRemove
virtual void notifyChannelRemove(int ch)
Definition: vistexturechannel2rgba.h:43
visBase::ColTabTextureChannel2RGBA::osgcolsequences_
ObjectSet< osgGeo::ColorSequence > osgcolsequences_
Definition: vistexturechannel2rgba.h:135
visBase::TextureChannel2RGBA::maxNrChannels
virtual int maxNrChannels() const =0
visBase::MappedTextureDataSet::enableNotify
virtual bool enableNotify(bool)=0
visBase::ColTabTextureChannel2RGBA::adjustNrChannels
void adjustNrChannels()
visBase::TextureChannel2RGBA::usesShading
virtual bool usesShading() const
visBase::ColTabTextureChannel2RGBA::getColors
void getColors(int channel, TypeSet< unsigned char > &) const
visBase::MappedTextureDataSet::touch
virtual void touch()=0
visBase::TextureChannel2RGBA::swapChannels
virtual void swapChannels(int ch0, int ch1)
Definition: vistexturechannel2rgba.h:53
visBase::ColTabTextureChannel2RGBA::osgcolseqarrays_
ObjectSet< TypeSet< unsigned char > > osgcolseqarrays_
Definition: vistexturechannel2rgba.h:136
visBase::ColTabTextureChannel2RGBA::notifyChannelInsert
void notifyChannelInsert(int ch)
visBase::TextureChannel2RGBA::isEnabled
virtual bool isEnabled(int ch) const
Definition: vistexturechannel2rgba.h:55
visBase::ColTabTextureChannel2RGBA
Definition: vistexturechannel2rgba.h:99
visBase::TextureChannel2RGBA::notifyChannelInsert
virtual void notifyChannelInsert(int ch)
Definition: vistexturechannel2rgba.h:42
visBase::ColTabTextureChannel2RGBA::coltabs_
ObjectSet< ColTab::Sequence > coltabs_
Definition: vistexturechannel2rgba.h:131
visdata.h
visBase::ColTabTextureChannel2RGBA::getTransparency
unsigned char getTransparency(int ch) const
visBase::TextureChannel2RGBA::minNrChannels
virtual int minNrChannels() const
Definition: vistexturechannel2rgba.h:62
visBase::TextureChannel2RGBA::TextureChannel2RGBA
TextureChannel2RGBA()
visBase::ColTabTextureChannel2RGBA::notifyChannelRemove
void notifyChannelRemove(int ch)
visBase::TextureChannel2RGBA::canSetSequence
virtual bool canSetSequence() const
Definition: vistexturechannel2rgba.h:49
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
visBase::TextureChannel2RGBA::getTextureWidth
int getTextureWidth() const
visBase::ColTabTextureChannel2RGBA::maxNrChannels
int maxNrChannels() const
osgGeo
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:38
mCreateDataObj
#define mCreateDataObj(clss)
Definition: visdata.h:214
visBase::TextureChannel2RGBA::createRGBA
virtual const osg::Image * createRGBA() const
visBase::TextureChannel2RGBA::setEnabled
virtual void setEnabled(int ch, bool yn)
Definition: vistexturechannel2rgba.h:54
visBase::ColTabTextureChannel2RGBA::getSequence
const ColTab::Sequence * getSequence(int ch) const
visBase::TextureChannel2RGBA::setChannels
virtual void setChannels(TextureChannels *)
visBase::ColTabTextureChannel2RGBA::opacity_
TypeSet< unsigned char > opacity_
Definition: vistexturechannel2rgba.h:133
visBase::TextureChannel2RGBA::allowShading
virtual void allowShading(bool)
visBase::TextureChannel2RGBA::canUseShading
virtual bool canUseShading() const
visBase::ColTabTextureChannel2RGBA::setSequence
void setSequence(int ch, const ColTab::Sequence &)
TypeSet< unsigned char >
visBase::TextureChannel2RGBA::laytex_
osgGeo::LayeredTexture * laytex_
Definition: vistexturechannel2rgba.h:74
visBase::TextureChannel2RGBA::channels_
TextureChannels * channels_
Definition: vistexturechannel2rgba.h:73

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