OpendTect-6_4  6.4
visvolumedisplay.h
Go to the documentation of this file.
1 #ifndef visvolumedisplay_h
2 #define visvolumedisplay_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: N. Hemstra
9  Date: August 2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 
17 #include "vissurveymod.h"
18 #include "vissurvobj.h"
19 #include "visobject.h"
20 #include "mousecursor.h"
21 #include "vissurvobj.h"
22 #include "ranges.h"
23 
24 
27 class TaskRunner;
28 class TrcKeyZSampling;
29 class ZAxisTransform;
30 class ZAxisTransformer;
31 template <class T> class Array3D;
32 
33 namespace Attrib { class SelSpec; }
34 
35 namespace visBase
36 {
38  class Material;
39  class BoxDragger;
40  class VolumeRenderScalarField;
41  class OrthogonalSlice;
42  class TextureChannel2RGBA;
43 }
44 
45 
46 namespace visSurvey
47 {
48 
49 class Scene;
50 
52  public SurveyObject
53 {
54 public:
55  VolumeDisplay();
58  "VolumeDisplay",
59  toUiString(sFactoryKeyword()));
60 
61  bool isInlCrl() const { return true; }
62 
63  static int cInLine() { return 2; }
64  static int cCrossLine() { return 1; }
65  static int cTimeSlice() { return 0; }
66 
67  int addSlice(int dim);
69  void showVolRen(bool yn);
70  bool isVolRenShown() const;
71  int volRenID() const;
72 
73  int addIsoSurface(TaskRunner* = 0,
74  bool updateisosurface = true);
76  void removeChild(int displayid);
77 
78  visBase::MarchingCubesSurface* getIsoSurface(int idx);
79  void updateIsoSurface(int,TaskRunner* = 0);
80  int getNrIsoSurfaces();
81  int getIsoSurfaceIdx(
82  const visBase::MarchingCubesSurface*) const;
83  float defaultIsoValue() const;
84  float isoValue(
85  const visBase::MarchingCubesSurface*) const;
86  /*<Set isovalue and do update. */
87  void setIsoValue(
89  float,TaskRunner* =0);
90 
91  /*<Seed based settings. set only, no update. */
92  char isFullMode(
93  const visBase::MarchingCubesSurface*)const;
94  /*<Return -1 if undefined, 1 if full,
95  0 if seed based. */
96  void setFullMode(
98  bool full=1);
99  /*<If 0, it is seed based. */
100  char seedAboveIsovalue(
101  const visBase::MarchingCubesSurface*) const;
102  /*<-1 undefined, 1 above, 0 below. */
103  void setSeedAboveIsovalue(
104  const visBase::MarchingCubesSurface*,bool);
105  MultiID getSeedsID(
106  const visBase::MarchingCubesSurface*) const;
107  void setSeedsID(const visBase::MarchingCubesSurface*,
108  MultiID);
109 
110  bool turnOn(bool yn);
111  bool isOn() const;
112  bool hasPosModeManipulator() const { return true; }
113  void showManipulator(bool yn);
114  bool isManipulatorShown() const;
115  bool isManipulated() const;
116  bool canResetManipulation() const;
117  void resetManipulation();
118  void acceptManipulation();
119  NotifierAccess* getMovementNotifier() { return &boxMoving; }
120  NotifierAccess* getManipulationNotifier() { return &boxMoving; }
121  BufferString getManipulationString() const;
122 
123  SurveyObject::AttribFormat getAttributeFormat(int attrib) const;
124  const TypeSet<Attrib::SelSpec>* getSelSpecs(int attrib) const;
125  const Attrib::SelSpec* getSelSpec(int attrib,int version=0) const;
126  const TypeSet<float>* getHistogram(int attrib) const;
127  void setSelSpec(int attrib,const Attrib::SelSpec&);
128  void setSelSpecs(int attrib,
129  const TypeSet<Attrib::SelSpec>&);
130 
131  bool canHaveMultipleAttribs() const { return true; }
132  int nrAttribs() const;
133  bool canAddAttrib(int nrattribstoadd=1) const;
134  bool addAttrib();
135  bool canRemoveAttrib() const;
136  bool removeAttrib(int attrib);
137  bool swapAttribs(int attrib0,int attrib1);
138  void enableAttrib(int attrib,bool yn);
139  bool isAttribEnabled(int attrib) const;
140  void setAttribTransparency(int attrib,unsigned char);
141  unsigned char getAttribTransparency(int attrib) const;
142 
143  bool setChannels2RGBA(visBase::TextureChannel2RGBA*);
144 
145  visBase::TextureChannel2RGBA* getChannels2RGBA();
146  const visBase::TextureChannel2RGBA* getChannels2RGBA() const;
147 
148  float slicePosition(visBase::OrthogonalSlice*) const;
149  void setSlicePosition(visBase::OrthogonalSlice*,
150  const TrcKeyZSampling&);
151  TrcKeyZSampling sliceSampling(visBase::OrthogonalSlice*) const;
152  visBase::OrthogonalSlice* getSelectedSlice() const;
153 
154  float getValue(int attrib,const Coord3&) const;
155 
156  TrcKeyZSampling getTrcKeyZSampling(int attrib) const;
157  TrcKeyZSampling getTrcKeyZSampling(bool manippos,
158  bool displayspace,
159  int attrib) const;
160  void setTrcKeyZSampling(const TrcKeyZSampling&,
161  bool dragmode=false);
162  bool setDataVolume(int attrib,
163  const RegularSeisDataPack*,
164  TaskRunner*);
165  const RegularSeisDataPack* getCacheVolume(int attrib) const;
166  bool setDataPackID(int attrib,DataPack::ID,
167  TaskRunner*);
168  DataPack::ID getDataPackID(int attrib) const;
170  { return DataPackMgr::SeisID(); }
171 
173  IOPar& iop ) const
174  { return SurveyObject::getMousePosInfo(ei,iop);}
175  void getMousePosInfo(const visBase::EventInfo&,
176  Coord3&,BufferString& val,
177  BufferString& info) const;
178  void getObjectInfo(BufferString&) const;
179  void getTreeObjectInfo(uiString&) const;
180 
181  const ColTab::MapperSetup* getColTabMapperSetup(int attrib,
182  int version=0) const;
183  void setColTabMapperSetup(int attrib,
185  const ColTab::Sequence* getColTabSequence(int attrib) const;
186  void setColTabSequence(int attrib,
187  const ColTab::Sequence&,TaskRunner*);
188  bool canSetColTabSequence() const;
189 
190  void setMaterial(visBase::Material*);
191  bool allowMaterialEdit() const { return true; }
192  virtual bool allowsPicks() const;
193  bool canDuplicate() const { return usesShading();}
194  visSurvey::SurveyObject* duplicate(TaskRunner*) const;
195 
196  static bool canUseVolRenShading();
197  void allowShading(bool yn);
198  bool usesShading() const;
199 
200  void getChildren(TypeSet<int>&) const;
201 
202  bool setZAxisTransform(ZAxisTransform*,TaskRunner*);
203  const ZAxisTransform* getZAxisTransform() const;
204 
205  void setRightHandSystem(bool yn);
206 
207  virtual void fillPar(IOPar&) const;
208  virtual bool usePar(const IOPar&);
209  const char* errMsg() const { return errmsg_.str(); }
210 
211  bool writeVolume(int attrib,const char* fnm) const;
212 
213  void setDisplayTransformation(const mVisTrans*);
214 
215  bool canEnableTextureInterpolation() const;
216  bool textureInterpolationEnabled() const;
217  void enableTextureInterpolation(bool);
218 
219  static const char* sKeyVolDepthKey() { return "VolDepthKey";}
220  static const char* sKeyVolPlaneKey() { return "VolPlaneKey";}
221  static const char* sKeyInDepthVolResize()
222  { return "InDepthVolResize"; }
223 
224 protected:
225  ~VolumeDisplay();
226 
228 
229  bool updateSeedBasedSurface(int,TaskRunner* = 0);
230  void materialChange(CallBacker*);
231  void updateIsoSurfColor();
232  bool pickable() const { return true; }
233  bool rightClickable() const { return true; }
234  bool selectable() const { return true; }
235  bool isSelected() const;
236  const MouseCursor* getMouseCursor() const { return &mousecursor_; }
237  void setScene(Scene*);
238  void updateAttribEnabling();
239  void getObjectInfoText(uiString& info,
240  bool compact) const;
241 
245 /* OSG_TODO: Replace VolrenDisplay with OSG equivalent
246  visBase::VolrenDisplay* volren_;
247 */
251  {
253  bool operator==(const IsosurfaceSetting&) const;
254  IsosurfaceSetting& operator=(const IsosurfaceSetting&);
255 
256  float isovalue_;
257  char mode_;
260  };
261 
264 
265  void draggerStartCB(CallBacker*);
266  void draggerMoveCB(CallBacker*);
267  void draggerFinishCB(CallBacker*);
268  void updateDraggerLimits(bool dragmode=false);
272 
273  void sliceMoving(CallBacker*);
274  void setData(const RegularSeisDataPack*,
275  int datatype=0);
276 
277  void dataTransformCB(CallBacker*);
278  void updateRanges(bool updateic,bool updatez);
279  void updateMouseCursorCB(CallBacker*);
280  void setSceneEventCatcher(visBase::EventCatcher*);
281 
284 
285  struct AttribData
286  {
287  AttribData();
288  ~AttribData();
289 
293  };
294 
296 
300 
303 
304  bool isinited_;
305  bool ismanip_;
307 
309 
310  static const char* sKeyVolumeID();
311  static const char* sKeyInline();
312  static const char* sKeyCrossLine();
313  static const char* sKeyTime();
314  static const char* sKeyVolRen();
315  static const char* sKeyNrSlices();
316  static const char* sKeySlice();
317  static const char* sKeyTexture();
318 
319  static const char* sKeyNrIsoSurfaces();
320  static const char* sKeyIsoValueStart();
321  static const char* sKeyIsoOnStart();
322  static const char* sKeySurfMode();
323  static const char* sKeySeedsMid();
324  static const char* sKeySeedsAboveIsov();
325 };
326 
327 } // namespace visSurvey
328 
329 
330 #endif
ObjectSet< visBase::OrthogonalSlice > slices_
Definition: visvolumedisplay.h:248
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
void turnOn(int flag)
Overrides the envirnonment variable.
visBase::TextureChannel2RGBA * texchannel2rgba_
Definition: visvolumedisplay.h:244
TrcKeyZSampling csfromsession_
Definition: visvolumedisplay.h:299
bool allowMaterialEdit() const
Definition: visvolumedisplay.h:191
const char * str() const
Definition: odstring.h:48
Definition of a mouse cursor, can be either a predefined shape (from the enum, or a file...
Definition: mousecursor.h:26
Notifier< VolumeDisplay > boxMoving
Definition: visvolumedisplay.h:227
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
Slice that cuts orthogonal through a VolumeData.
Definition: visvolorthoslice.h:30
Export_Basic uiString toUiString(ViewStyle)
Maps from [0,1] -> Color.
Definition: coltabsequence.h:37
Definition: visboxdragger.h:31
Interface class for Notifier. See comments there.
Definition: callback.h:161
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
static const char * sKeyVolPlaneKey()
Definition: visvolumedisplay.h:220
bool pickable() const
Definition: visvolumedisplay.h:232
int ID
Each Mgr has its own ID.
Definition: datapack.h:147
static int cCrossLine()
Definition: visvolumedisplay.h:64
ZAxisTransformer * datatransformer_
Definition: visvolumedisplay.h:283
bool selectable() const
Definition: visvolumedisplay.h:234
#define mDefaultFactoryInstantiation(baseclss, clss, keywrd, usernm)
Definition: factory.h:289
SeisDataPack for 2D and 3D seismic data.
Definition: seisdatapack.h:28
bool canDuplicate() const
Definition: visvolumedisplay.h:193
static int cInLine()
Definition: visvolumedisplay.h:63
Definition: uistring.h:89
bool rightClickable() const
Definition: visvolumedisplay.h:233
static ID SeisID()
Cube/Block (N1xN2xN3) data: 3.
TypeSet< char > sections_
Definition: visvolumedisplay.h:263
static const char * sKeyVolDepthKey()
Definition: visvolumedisplay.h:219
bool keepdraggerinsidetexture_
Definition: visvolumedisplay.h:269
int ID
Definition: datapack.h:38
Used for displaying a polyline, preview for a random line created throught well path.
Definition: visarrowdisplay.h:20
BufferString sliceposition_
Definition: visvolumedisplay.h:297
Definition: vistexturechannel2rgba.h:36
Transforms an Array3D with a ZAxisTransform. It is assumed that the first dimension in the array is i...
Definition: zaxistransformer.h:29
const RegularSeisDataPack * cache_
Definition: visvolumedisplay.h:292
Definition: callback.h:254
Definition: marchingcubes.h:82
visBase::BoxDragger * boxdragger_
Definition: visvolumedisplay.h:242
VisualObjectImpl
Definition: visobject.h:128
Definition: vismarchingcubessurface.h:32
Definition: visvolumedisplay.h:285
ZAxisTransform * datatransform_
Definition: visvolumedisplay.h:282
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
bool isOn(int flag=0xffff)
Class that can execute a task.
Definition: task.h:169
Definition: visvolumedisplay.h:250
Attrib::SelSpec & as_
Definition: visvolumedisplay.h:291
#define mVisTrans
Definition: visdata.h:31
char mode_
Definition: visvolumedisplay.h:257
const char * errMsg() const
Definition: visvolumedisplay.h:209
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
Definition: vismaterial.h:37
Database for 3D objects.
Definition: vissurvscene.h:76
bool ismanip_
Definition: visvolumedisplay.h:305
const char * sKeyTime()
bool canHaveMultipleAttribs() const
Definition: visvolumedisplay.h:131
Setup class for colortable Mapper.
Definition: coltabmapper.h:35
float isovalue_
Definition: visvolumedisplay.h:256
bool hasPosModeManipulator() const
Definition: visvolumedisplay.h:112
TypeSet< Attrib::SelSpec > * selspec_
Definition: visvolumedisplay.h:290
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
ObjectSet< AttribData > attribs_
Definition: visvolumedisplay.h:295
ObjectSet< visBase::MarchingCubesSurface > isosurfaces_
Definition: visvolumedisplay.h:249
A cartesian coordinate in 3D space.
Definition: coord.h:72
TypeSet< IsosurfaceSetting > isosurfsettings_
Definition: visvolumedisplay.h:262
Definition: visannot.h:43
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
BufferString errmsg_
Definition: horizontracker.h:119
BufferString slicename_
Definition: visvolumedisplay.h:298
virtual DataPackMgr::ID getDataPackMgrID() const
Definition: visvolumedisplay.h:169
visBase::EventCatcher * eventcatcher_
Definition: visvolumedisplay.h:302
Base class for all &#39;Display&#39; objects.
Definition: vissurvobj.h:58
Definition: visevent.h:44
NotifierAccess * getMovementNotifier()
Definition: visvolumedisplay.h:119
AttribFormat
Definition: vissurvobj.h:175
Specifies an attribute selection (ID or output number of NN).
Definition: attribsel.h:45
TrcKeyZSampling texturecs_
Definition: visvolumedisplay.h:271
bool isInlCrl() const
Definition: visvolumedisplay.h:61
RefMan< const mVisTrans > displaytrans_
Definition: visvolumedisplay.h:308
MultiID seedsid_
Definition: visvolumedisplay.h:259
bool onoffstatus_
Definition: visvolumedisplay.h:306
Definition: visvolrenscalarfield.h:41
static int cTimeSlice()
Definition: visvolumedisplay.h:65
void getMousePosInfo(const visBase::EventInfo &ei, IOPar &iop) const
Definition: visvolumedisplay.h:172
Base class for z-axis transforms.
Definition: zaxistransform.h:37
TrcKeyZSampling draggerstartcs_
Definition: visvolumedisplay.h:270
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
char seedsaboveisoval_
Definition: visvolumedisplay.h:258
static const char * sKeyInDepthVolResize()
Definition: visvolumedisplay.h:221
bool isinited_
Definition: visvolumedisplay.h:304
visBase::VolumeRenderScalarField * scalarfield_
Definition: visvolumedisplay.h:243
Definition: visevent.h:87
Compound key consisting of ints.
Definition: multiid.h:25
NotifierAccess * getManipulationNotifier()
Definition: visvolumedisplay.h:120
Semblance Attribute.
Definition: attribdataholder.h:25
const MouseCursor * getMouseCursor() const
Definition: visvolumedisplay.h:236
MouseCursor mousecursor_
Definition: visvolumedisplay.h:301
Definition: visvolumedisplay.h:51

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