OpendTect-6_4  6.4
visvolrenscalarfield.h
Go to the documentation of this file.
1 #ifndef visvolrenscalarfield_h
2 #define visvolrenscalarfield_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: January 2007
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "visbasemod.h"
16 #include "color.h"
17 #include "ranges.h"
18 #include "trckeyzsampling.h"
19 #include "visdata.h"
20 #include "coltabmapper.h"
21 #include "coltabsequence.h"
22 #include "visosg.h"
23 
24 class TaskRunner;
25 template <class T> class Array3D;
26 template <class T> class ValueSeries;
27 
28 
29 namespace osgVolume { class Volume; class VolumeTile; class ImageLayer;
30  class TransparencyProperty; }
31 namespace osg { class Switch; class Image; class TransferFunction1D; }
32 namespace osgGeo { class RayTracedTechnique; }
33 
34 
35 
36 namespace visBase
37 {
38  class Material;
39  class TextureChannel2RGBA;
40 
42 {
43 public:
44 
47 
48  void setChannels2RGBA(visBase::TextureChannel2RGBA*);
49  TextureChannel2RGBA* getChannels2RGBA();
50  const TextureChannel2RGBA* getChannels2RGBA() const;
51 
52  void setScalarField(int attr,const Array3D<float>*,
53  bool mine,TaskRunner*); // obsolete
54 
55  void setColTabMapperSetup(int attr,
56  const ColTab::MapperSetup&,
57  TaskRunner* tr );
58  const ColTab::Mapper& getColTabMapper(int attr);
59 
60  const TypeSet<float>& getHistogram(int attr) const;
61 
62  const char* writeVolumeFile(int attr,od_ostream&) const;
64 
65  static bool isShadingSupported();
66  void allowShading(bool yn);
67  bool usesShading() const;
68 
69  bool turnOn(bool);
70  bool isOn() const;
71 
72  void setTexVolumeTransform(const Coord3& trans,
73  const Coord3& rotvec,double rotangle,
74  const Coord3& scale);
75  void setROIVolumeTransform(const Coord3& trans,
76  const Coord3& rotvec,double rotangle,
77  const Coord3& scale);
82  bool textureInterpolationEnabled() const;
83  void enableTextureInterpolation(bool);
84 
85  void setMaterial(Material*);
86 
89  void makeColorTables(int attr);
90  void enableAttrib(int attr,bool yn);
91  void swapAttribs(int attr0,int attr1);
92  void setAttribTransparency(int attr,unsigned char);
93 
94  void setRightHandSystem(bool);
95  bool isRightHandSystem() const;
96 
97 protected:
98  ~VolumeRenderScalarField();
99 
100  void makeIndices(int attr,bool doset,TaskRunner*);
101  // doset argument obsolete now
102  void clipData(int attr,TaskRunner*);
103 
104  void updateFragShaderType();
105  void updateVolumeSlicing();
106  void updateTransparencyRescaling();
107 
108  void setDefaultRGBAValue(int channel);
109 
111  {
112  AttribData();
113  ~AttribData();
114 
115  od_int64 totalSz() const; // obsolete
116  bool isInVolumeCache() const;
117 
118  int sz0_, sz1_, sz2_; // obsolete
120  unsigned char* indexcache_;
126 
127  void clearDataCache();
128  void clearIndexCache();
129  void clearResizeCache();
130 
134  };
135 
137 
139  bool isrgba_;
140 
143 
145 
146  osgVolume::VolumeTile* osgvoltile_;
147  osg::Switch* osgvolroot_;
149  osgVolume::ImageLayer* osgimagelayer_;
150  osg::Image* osgvoldata_;
151  osg::TransferFunction1D* osgtransfunc_;
152  osgVolume::TransparencyProperty* osgtransprop_;
153  osgGeo::RayTracedTechnique* raytt_;
154 
155  void updateResizeCache(int attr,TaskRunner*);
156 public:
157  void setScalarField(int attr,const Array3D<float>*,
158  bool mine,const TrcKeyZSampling&,
159  TaskRunner*);
160  TrcKeyZSampling getMultiAttribTrcKeyZSampling() const;
161 };
162 
163 }
164 
165 #endif
osgGeo::RayTracedTechnique * raytt_
Definition: visvolrenscalarfield.h:153
osgVolume::Volume * osgvolume_
Definition: visvolrenscalarfield.h:148
#define mExpClass(module)
Definition: commondefs.h:160
void turnOn(int flag)
Overrides the envirnonment variable.
osgVolume::VolumeTile * osgvoltile_
Definition: visvolrenscalarfield.h:146
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
bool ownsdatacache_
Definition: visvolrenscalarfield.h:124
bool useshading_
Definition: visvolrenscalarfield.h:142
int sz2_
Definition: visvolrenscalarfield.h:118
Material * material_
Definition: visvolrenscalarfield.h:141
#define od_int64
Definition: plftypes.h:36
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:65
bool isrgba_
Definition: visvolrenscalarfield.h:139
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:38
osg::Image * osgvoldata_
Definition: visvolrenscalarfield.h:150
TextureChannel2RGBA * channels2rgba_
Definition: visvolrenscalarfield.h:138
Maps data values to colortable positions: [0,1].
Definition: coltabmapper.h:84
Definition: vistexturechannel2rgba.h:36
bool ownsresizecache_
Definition: visvolrenscalarfield.h:133
const ValueSeries< float > * datacache_
Definition: visvolrenscalarfield.h:123
Set of pointers to objects.
Definition: commontypes.h:32
const ValueSeries< float > * resizecache_
Definition: visvolrenscalarfield.h:132
struct(General) A2DBitMapGenPars
Array2D Bitmap generation parameters.
Definition: array2dbitmap.h:28
Set of (small) copyable elements.
Definition: commontypes.h:30
ObjectSet< AttribData > attribs_
Definition: visvolrenscalarfield.h:136
bool ownsindexcache_
Definition: visvolrenscalarfield.h:122
bool isOn(int flag=0xffff)
Class that can execute a task.
Definition: task.h:169
osg::TransferFunction1D * osgtransfunc_
Definition: visvolrenscalarfield.h:151
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
Interface to a series of values.
Definition: odmemory.h:17
ColTab::Mapper mapper_
Definition: visvolrenscalarfield.h:119
Definition: vismaterial.h:37
TrcKeyZSampling datatkzs_
Definition: visvolrenscalarfield.h:131
A cartesian coordinate in 3D space.
Definition: coord.h:72
static VolumeRenderScalarField * create()
Definition: visvolrenscalarfield.h:45
Definition: visannot.h:43
osgVolume::ImageLayer * osgimagelayer_
Definition: visvolrenscalarfield.h:149
bool isrighthandsystem_
Definition: visvolrenscalarfield.h:144
FixedString Volume()
Definition: keystrs.h:148
TypeSet< float > histogram_
Definition: visvolrenscalarfield.h:125
osgVolume::TransparencyProperty * osgtransprop_
Definition: visvolrenscalarfield.h:152
Open Scene Graph.
Definition: visannot.h:29
Definition: visvolrenscalarfield.h:29
Color Table
Definition: coltab.h:22
#define mCreateDataObj(clss)
Definition: visdata.h:209
int indexcachestep_
Definition: visvolrenscalarfield.h:121
Definition: visvolrenscalarfield.h:41
Definition: visvolrenscalarfield.h:110
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
unsigned char * indexcache_
Definition: visvolrenscalarfield.h:120
osg::Switch * osgvolroot_
Definition: visvolrenscalarfield.h:147

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