OpendTect  6.6
vistexturechannels.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: Kristofer Tingdahl
8  Date: Jun 2008
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 
13 -*/
14 
15 #include "visbasemod.h"
16 #include "visdata.h"
17 #include "odmemory.h"
18 
19 class SbImagei32;
20 class TaskRunner;
21 namespace osgGeo { class LayeredTexture; }
22 namespace ColTab { class Mapper; class MapperSetup; };
23 
24 namespace visBase
25 {
26 class MappedTextureDataSet;
27 class TextureChannel2RGBA;
28 class ChannelInfo;
29 
50 {
51  class TextureCallbackHandler;
52 
53 public:
56 
57  virtual bool turnOn(bool yn);
58  virtual bool isOn() const;
59 
60  int nrChannels() const;
61  int addChannel();
62  int insertChannel(int);
63  void removeChannel(int);
64  void swapChannels(int,int);
65 
66  void setColTabMapperSetup(int channel,
67  const ColTab::MapperSetup&);
69  const ColTab::MapperSetup& getColTabMapperSetup(int channel,
70  int version) const;
71  const ColTab::Mapper& getColTabMapper(int channel,int version) const;
72  void reMapData(int channel,bool dontreclip,
73  TaskRunner*);
74  const TypeSet<float>* getHistogram(int channel) const;
75 
76  void setSize(int channel,int sz0,int sz1,int sz2);
77  int getSize(int channel,unsigned char dim) const;
78 
79  void setOrigin(int channel,const Coord& origin);
80  const Coord& getOrigin(int channel) const;
81  void setScale(int channel,const Coord& scale);
82  const Coord& getScale(int channel) const;
83 
84  void setNrComponents(int channel,int nrcomp);
85  int getNrComponents(int channel) const;
86 
87  void setNrVersions(int channel,int nrvers);
88  int nrVersions(int channel) const;
89  int currentVersion(int channel) const;
90  void setCurrentVersion(int channel,int version);
91 
92  bool isCurrentDataPremapped(int channel) const;
93 
94  bool setUnMappedVSData(int channel,int version,
95  const ValueSeries<float>*, OD::PtrPolicy,
96  TaskRunner*,bool skipclip=false);
97  bool setUnMappedData(int channel,int version,
98  const float*, OD::PtrPolicy,
99  TaskRunner*,bool skipclip=false);
100  bool setMappedData(int channel,int version,
101  unsigned char*, OD::PtrPolicy);
102  void unfreezeOldData(int channel);
103 
104  bool setChannels2RGBA(TextureChannel2RGBA*);
105  TextureChannel2RGBA* getChannels2RGBA();
106  const TextureChannel2RGBA* getChannels2RGBA() const;
107 
108  const SbImagei32* getChannels() const;
109  void touchMappedData();
110 
111  osgGeo::LayeredTexture* getOsgTexture() { return osgtexture_; }
112  const osgGeo::LayeredTexture* getOsgTexture() const { return osgtexture_; }
113  const TypeSet<int>* getOsgIDs(int channel) const;
114 
117 
120 
121  unsigned char nrDataBands() const;
122  inline unsigned char nrUdfBands() const { return 1; }
123  inline unsigned char nrTextureBands() const
124  { return nrDataBands() + nrUdfBands(); }
125 
126 
127 protected:
128  friend class ChannelInfo;
129  void update(int channel,bool freezeifnodata=true);
130  void update(ChannelInfo*);
132 
133  TextureCallbackHandler* texturecallbackhandler_;
135 
137  osgGeo::LayeredTexture* osgtexture_;
139 
140 public:
141  StepInterval<float> getEnvelopeRange(unsigned char dim) const;
142 };
143 
144 
145 }; // Namespace
146 
ValueSeries
Interface to a series of values.
Definition: odmemory.h:16
visBase::TextureChannels::interpolatetexture_
bool interpolatetexture_
Definition: vistexturechannels.h:138
visBase::TextureChannels::update
void update(ChannelInfo *)
visBase::TextureChannel2RGBA
Definition: vistexturechannel2rgba.h:36
visBase::TextureChannels::create
static TextureChannels * create()
Definition: vistexturechannels.h:54
visBase::TextureChannels::osgtexture_
osgGeo::LayeredTexture * osgtexture_
Definition: vistexturechannels.h:137
odmemory.h
ObjectSet< ChannelInfo >
ColTab
Color Table
Definition: coltab.h:22
visBase
Definition: visannot.h:43
OD
OpendTect.
Definition: commontypes.h:28
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
visBase::TextureChannels::nrTextureBands
unsigned char nrTextureBands() const
Definition: vistexturechannels.h:123
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::TextureChannels::~TextureChannels
~TextureChannels()
visBase::TextureChannels::getNonShaderResolution
int getNonShaderResolution() const
visBase::TextureChannels::getEnvelopeRange
StepInterval< float > getEnvelopeRange(unsigned char dim) const
StepInterval< float >
Coord
A cartesian coordinate in 2D space.
Definition: coord.h:25
visBase::TextureChannels
Definition: vistexturechannels.h:50
visBase::TextureChannels::tc2rgba_
TextureChannel2RGBA * tc2rgba_
Definition: vistexturechannels.h:136
visBase::TextureChannels::getOsgIDs
const TypeSet< int > * getOsgIDs(int channel) const
visBase::TextureChannels::setNonShaderResolution
void setNonShaderResolution(int)
TaskRunner
Class that can execute a task.
Definition: task.h:170
DBG::turnOn
void turnOn(int flag)
Overrides the envirnonment variable.
visdata.h
DBG::isOn
bool isOn(int flag=0xffff)
visBase::TextureChannels::channelinfo_
ObjectSet< ChannelInfo > channelinfo_
Definition: vistexturechannels.h:134
visBase::TextureChannels::nrUdfBands
unsigned char nrUdfBands() const
Definition: vistexturechannels.h:122
visBase::TextureChannels::nrDataBands
unsigned char nrDataBands() const
osgGeo
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:38
mCreateDataObj
#define mCreateDataObj(clss)
Definition: visdata.h:214
visBase::TextureChannels::texturecallbackhandler_
TextureCallbackHandler * texturecallbackhandler_
Definition: vistexturechannels.h:133
OD::PtrPolicy
PtrPolicy
Definition: odmemory.h:21
visBase::TextureChannels::update
void update(int channel, bool freezeifnodata=true)
visBase::TextureChannels::getOsgTexture
const osgGeo::LayeredTexture * getOsgTexture() const
Definition: vistexturechannels.h:112
visBase::TextureChannels::enableTextureInterpolation
void enableTextureInterpolation(bool)
TypeSet
Sets of (small) copyable elements.
Definition: commontypes.h:29
visBase::TextureChannels::textureInterpolationEnabled
bool textureInterpolationEnabled() const

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