OpendTect  6.3
vishorizonsection.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: March 2009
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "vishorizonsectiondef.h"
15 #include "visobject.h"
16 #include "arrayndimpl.h"
17 #include "rowcol.h"
18 #include "geomelement.h"
19 
20 class BinIDValueSet;
21 class DataPointSet;
22 class ZAxisTransform;
23 namespace Geometry { class BinIDSurface; }
24 namespace osgGeo { class LayeredTexture; }
25 namespace osg { class CullStack; }
26 
27 namespace visBase
28 {
29 
30 class TextureChannel2RGBA;
31 class HorizonSectionTile;
32 class TextureChannels;
33 class HorizonSectionDataHandler;
34 class HorizonTextureHandler;
35 class HorTilesCreatorAndUpdator;
36 
37 
46 {
47  class TextureCallbackHandler;
48  class NodeCallbackHandler;
49 
50 public:
52 
53  void setDisplayTransformation(const mVisTrans*);
54  const mVisTrans* getDisplayTransformation() const;
55  void setZAxisTransform(ZAxisTransform*,TaskRunner*);
56  ZAxisTransform* getZAxisTransform() { return zaxistransform_; }
57 
58  //Texture information
59  void useChannel(bool);
60  int nrChannels() const;
61  void addChannel();
62  void removeChannel(int);
63  void swapChannels(int,int);
64 
65  int nrVersions(int channel) const;
66  void setNrVersions(int channel,int);
67  int activeVersion(int channel) const;
68  void selectActiveVersion(int channel,int);
69 
70  void setColTabSequence(int channel,
71  const ColTab::Sequence&);
72  const ColTab::Sequence& getColTabSequence(int channel) const;
73  void setColTabMapper(int channel,
74  const ColTab::Mapper&,
75  TaskRunner*);
76  const ColTab::Mapper& getColTabMapper(int channel) const;
77 
78  void setTransparency(int ch,unsigned char yn);
79  unsigned char getTransparency(int ch) const;
80 
81  void getDataPositions(DataPointSet&,
82  double zoff /*untransformed*/,
83  int sid,TaskRunner*) const;
84  void setTextureData(int channel,const DataPointSet*,
85  int sid,TaskRunner*);
86  const BinIDValueSet* getCache(int channel) const;
87  void inValidateCache(int channel);
88 
89  void setChannels2RGBA(TextureChannel2RGBA*);
91  TextureChannel2RGBA* getChannels2RGBA();
92  const TextureChannel2RGBA* getChannels2RGBA() const;
93  TextureChannels* getChannels() const;
94 
95  void setTextureHandler(HorizonTextureHandler&);
97  HorizonTextureHandler& getTextureHandler();
98 
99  //Geometry stuff
100  void setSurface(Geometry::BinIDSurface*,bool conn,
101  TaskRunner*);
102  Geometry::BinIDSurface* getSurface() const { return geometry_; }
103  StepInterval<int> displayedRowRange() const;
104  StepInterval<int> displayedColRange() const;
105  void setDisplayRange(const StepInterval<int>&,
106  const StepInterval<int>&);
107  void setTextureRange(const StepInterval<int>&,
108  const StepInterval<int>&);
109 
110  char nrResolutions() const;
111  char currentResolution() const;
112  void setResolution(char,TaskRunner*);
113 
114  void setWireframeColor(Color col);
115  osgGeo::LayeredTexture* getOsgTexture() const;
116  void updatePrimitiveSets();
117  void turnOsgOn( bool );
118  void enableGeometryTypeDisplay(GeometryType type,
119  bool yn);
122  bool isWireframeDisplayed() const
123  { return wireframedisplayed_ ; }
124 
125  void forceRedraw(bool=true);
126  bool executePendingUpdates();
127 
128  int getNrTitles() const;
129  const unsigned char* getTextureData(int titleidx,int& w,int& h)const;
130  bool getTitleTextureCoordinates(
131  int titleidx,TypeSet<Coord2f>&) const;
132  int getTexturePixelSizeInBits() const;
133  void setUsingNeighborsInIsolatedLine(bool);
134  bool usingNeighborsInIsolatedLine() const;
135 
136 
137 protected:
138  ~HorizonSection();
139 
140  friend class HorizonSectionTile;
142  friend class TileResolutionData;
144  friend class HorizonTextureHandler;
148  friend class TileCoordinatesUpdator;
150 
151  void surfaceChangeCB(CallBacker*);
152  void surfaceChange(const TypeSet<GeomPosID>*,
153  TaskRunner*);
154  void removeZTransform();
155  void updateZAxisVOI();
156 
157  void configSizeParameters();
158  void updateAutoResolution( const osg::CullStack* );
159  HorizonSectionTile* getTitle(int idx);
160  bool checkTileIndex(int) const;
161 
162  void setUpdateVar(bool& var,bool yn);
164 
165  bool forceupdate_; // Only set via setUpdateVar(.)
166 
167 
170 
178 
182 
183  NodeCallbackHandler* nodecallbackhandler_;
184  TextureCallbackHandler* texturecallbackhandler_;
187 
188 
190 
192 
196 
200 
204 
205  int queueid_;
206 
211 
212  osg::Group* osghorizon_;
214 
219 
220 };
221 
222 } // namespace visBase
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
TypeSet< int > spacing_
Definition: vishorizonsection.h:207
Definition: vishorizonsection.h:45
Geometry::BinIDSurface * getSurface() const
Definition: vishorizonsection.h:102
Definition: vishorizonsectiontileglue.h:35
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:51
Definition: vistexturechannels.h:46
float rowdistance_
Definition: vishorizonsection.h:197
Set of data points with group selection.
Definition: datapointset.h:47
Array2DImpl< HorizonSectionTile * > tiles_
Definition: vishorizonsection.h:189
ZAxisTransform * zaxistransform_
Definition: vishorizonsection.h:213
Threads::SpinLock spinlock_
Definition: vishorizonsection.h:177
int totalnormalsize_
Definition: vishorizonsection.h:203
A series of color control points able to give an (interpolated) color for every position [0...
Definition: coltabsequence.h:37
Threads::Mutex updatelock_
Definition: vishorizonsection.h:176
StepInterval< int > texturecolrg_
Definition: vishorizonsection.h:175
int tilesidesize_
Definition: vishorizonsection.h:202
Definition: vishordatahandler.h:27
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:35
Implementation of Array2D.
Definition: arrayndimpl.h:101
int nrcoordspertileside_
Definition: vishorizonsection.h:201
bool isWireframeDisplayed() const
Definition: vishorizonsection.h:122
TypeSet< int > normalstartidx_
Definition: vishorizonsection.h:209
Definition: vishortilescreatorandupdator.h:31
char nrhorsectnrres_
Definition: vishorizonsection.h:195
GeometryType
Definition: vishorizonsectiondef.h:30
bool useneighbors_
Definition: vishorizonsection.h:218
StepInterval< int > texturerowrg_
Definition: vishorizonsection.h:174
Maps data values to color sequence positions: [0,1].
Definition: coltabmapper.h:33
HorTilesCreatorAndUpdator * hortilescreatorandupdator_
Definition: vishorizonsection.h:181
char lowestresidx_
Definition: vishorizonsection.h:193
bool isredrawing_
Definition: vishorizonsection.h:186
Definition: vistexturechannel2rgba.h:33
Set of pointers to objects.
Definition: commontypes.h:28
StepInterval< int > displaycrg_
Definition: vishorizonsection.h:173
Set of (small) copyable elements.
Definition: commontypes.h:26
Geometry::BinIDSurface * geometry_
Definition: vishorizonsection.h:168
char desiredresolution_
Definition: vishorizonsection.h:194
Class that can execute a task.
Definition: task.h:193
bool wireframedisplayed_
Definition: vishorizonsection.h:217
Is an alternative to Mutex. It is a lock which causes a thread trying to acquire it to simply wait in...
Definition: atomic.h:130
HorizonSectionDataHandler * hordatahandler_
Definition: vishorizonsection.h:179
TypeSet< int > normalsidesize_
Definition: vishorizonsection.h:210
int queueid_
Definition: vishorizonsection.h:205
const visBase::Transformation * transformation_
Definition: vishorizonsection.h:191
#define mVisTrans
Definition: visdata.h:25
ObjectSet< HorizonSectionTile > updatedtiles_
Definition: vishorizonsection.h:215
bool userchangedisplayrg_
Definition: vishorizonsection.h:171
Definition: vishorizontexturehandler.h:29
Definition: vishorizonsectiontile.h:49
IdxPair used for its row() and col().
Definition: rowcol.h:23
Definition: visannot.h:40
bool forceupdate_
Will trigger redraw request if necessary.
Definition: vishorizonsection.h:165
static uiHor3DInterpol * create(uiParent *)
Definition: binidsurface.h:25
HorizonTextureHandler * hortexturehandler_
Definition: vishorizonsection.h:180
HorizonTileResolutionTesselator class is an independent usage for tesselating coordinates, normals and primitive set of horizon tiles. it is specifically for exporting horizon to Pdf3D in which the exported horizon has no relation with the existing displayed horizon in coordinates, normals and primitive set. thus we can export horizon into different resolution without influence current displayed horizon in the secne. note: the class doesn&#39;t do anything with texture.
Definition: vishorthreadworks.h:41
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
TypeSet< int > nrcells_
Definition: vishorizonsection.h:208
Open Scene Graph.
Definition: visannot.h:26
RowCol origin_
Definition: vishorizonsection.h:169
A Pos::IdxPairValueSet with BinIDs.
Definition: binidvalset.h:21
NodeCallbackHandler * nodecallbackhandler_
Definition: vishorizonsection.h:183
StepInterval< int > displayrrg_
Definition: vishorizonsection.h:172
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
TextureCallbackHandler * texturecallbackhandler_
Definition: vishorizonsection.h:184
#define mCreateDataObj(clss)
Definition: visdata.h:210
Threads::Lock redrawlock_
Definition: vishorizonsection.h:185
Definition: visobject.h:67
Definition: vishorthreadworks.h:69
Base class for z-axis transforms.
Definition: zaxistransform.h:35
bool tesselationlock_
Definition: vishorizonsection.h:199
Definition: vishorthreadworks.h:111
float coldistance_
Definition: vishorizonsection.h:198
Definition: vishortileresolutiondata.h:45
Definition: arraytesselator.h:19
osg::Group * osghorizon_
Definition: vishorizonsection.h:212
TypeSet< int > updatedtileresolutions_
Definition: vishorizonsection.h:216

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