OpendTect-6_4  6.4
vishorizondisplay.h
Go to the documentation of this file.
1 #ifndef vishorizondisplay_h
2 #define vishorizondisplay_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: May 2004
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "vissurveymod.h"
17 #include "visemobjdisplay.h"
18 #include "coltabmapper.h"
19 #include "coltabsequence.h"
20 #include "factory.h"
21 #include "uistring.h"
22 
23 namespace ColTab{ class Sequence; class MapperSetup; }
24 namespace visBase
25 {
26  class HorizonSection;
27  class HorizonTextureHandler;
28  class MarkerSet;
29  class PointSet;
30  class TextureChannel2RGBA;
31  class VertexShape;
32  class PolyLine;
33 }
34 
35 namespace visSurvey
36 {
37 
40 
41  friend class HorizonPathIntersector;
42 
43 public:
47  "HorizonDisplay",
48  toUiString(sFactoryKeyword()))
49 
50  void setDisplayTransformation(const mVisTrans*);
51  void setSceneEventCatcher(visBase::EventCatcher*);
52 
53  void enableTextureInterpolation(bool);
55  { return enabletextureinterp_; }
57  { return true; }
58 
59  bool setZAxisTransform(ZAxisTransform*,TaskRunner*);
60 
61  visBase::Material* getMaterial();
62  void setIntersectLineMaterial(visBase::Material*);
63 
64  bool setEMObject(const EM::ObjectID&,TaskRunner*);
65  bool updateFromEM(TaskRunner*);
66  void updateFromMPE();
67 
68  StepInterval<int> geometryRowRange() const;
69  StepInterval<int> geometryColRange() const;
70  visBase::HorizonSection* getHorizonSection(const EM::SectionID&);
71  TypeSet<EM::SectionID> getSectionIDs() const { return sids_; }
72 
73  void useTexture(bool yn,bool trigger=false);
74  bool usesTexture() const;
75  bool showsTexture() const;
76  bool canShowTexture() const;
77 
78  void setOnlyAtSectionsDisplay(bool yn);
79  bool displayedOnlyAtSections() const;
80 
81  void displaySurfaceData(int attrib,int auxdatanr);
82 
83  virtual bool canHaveMultipleAttribs() const;
84  virtual int nrTextures(int attrib) const;
85  virtual void selectTexture(int attrib,int textureidx);
86  virtual int selectedTexture(int attrib) const;
87 
88  SurveyObject::AttribFormat getAttributeFormat(int attrib) const;
90  { return Both2DAnd3D; }
91 
92  int nrAttribs() const;
93  bool addAttrib();
94  bool canAddAttrib(int nrattribstoadd=1) const;
95  bool removeAttrib(int attrib);
96  bool canRemoveAttrib() const;
97  bool swapAttribs(int attrib0,int attrib1);
98  void setAttribTransparency(int,unsigned char);
99  unsigned char getAttribTransparency(int) const;
100  void enableAttrib(int attrib,bool yn);
101  bool isAttribEnabled(int attrib) const;
102  bool hasSingleColorFallback() const { return true; }
103  Color singleColor() const;
104 
105  void allowShading(bool);
106  const Attrib::SelSpec* getSelSpec(int channel,int version=0) const;
107  const TypeSet<Attrib::SelSpec>* getSelSpecs(int attrib) const;
108 
109  void setSelSpec(int,const Attrib::SelSpec&);
110  void setSelSpecs(int attrib,
111  const TypeSet<Attrib::SelSpec>&);
112  void setDepthAsAttrib(int);
113  void setDisplayDataPackIDs(int attrib,
114  const TypeSet<DataPack::ID>&);
115  DataPack::ID getDataPackID(int attrib) const;
116  DataPack::ID getDisplayedDataPackID(int attrib) const;
118  { return DataPackMgr::FlatID(); }
119 
120  bool allowMaterialEdit() const { return true; }
121  bool hasColor() const { return true; }
122  bool usesColor() const;
123 
124  EM::SectionID getSectionID(int visid) const;
125 
126  void getRandomPos(DataPointSet&,TaskRunner*) const;
127  void getRandomPosCache(int,DataPointSet&) const;
128  void setRandomPosData( int,const DataPointSet*,
129  TaskRunner*);
130 
131  void setLineStyle(const OD::LineStyle&);
134  bool hasStoredAttrib(int attrib) const;
135  bool hasDepth(int attrib) const;
136 
137  int nrResolutions() const;
138  BufferString getResolutionName(int) const;
139  int getResolution() const;
140  bool displaysSurfaceGrid() const;
141  void displaysSurfaceGrid(bool);
142  void setResolution(int,TaskRunner*);
145  bool allowsPicks() const { return true; }
147  IOPar& i ) const
148  { return EMObjectDisplay::getMousePosInfo(e,i);}
149  void getMousePosInfo(const visBase::EventInfo& pos,
150  Coord3&,
151  BufferString& val,
152  BufferString& info) const;
153  float calcDist(const Coord3&) const;
154  float maxDist() const;
155 
156  const ColTab::Sequence* getColTabSequence(int attr) const;
157  bool canSetColTabSequence() const;
158  void setColTabSequence(int attr,
159  const ColTab::Sequence&,TaskRunner*);
160  const ColTab::MapperSetup* getColTabMapperSetup(int attr,int v=0) const;
161  void setColTabMapperSetup(int attr,
163  const TypeSet<float>* getHistogram(int) const;
164 
165  Coord3 getTranslation() const;
166  void setTranslation(const Coord3&);
167 
168  bool setChannels2RGBA(visBase::TextureChannel2RGBA*);
169  visBase::TextureChannel2RGBA* getChannels2RGBA();
170  const visBase::TextureChannel2RGBA* getChannels2RGBA() const;
171 
172  void fillPar(IOPar&) const;
173  bool usePar(const IOPar&);
174 
175  bool canBDispOn2DViewer() const { return false;}
176  bool isVerticalPlane() const { return false;}
177 
178  void setAttribShift(int channel,
179  const TypeSet<float>& shifts);
183  const ObjectSet<visBase::VertexShape>& getIntersectionLines() const;
184 
185  void displayIntersectionLines(bool);
186  bool displaysIntersectionLines() const;
187  const visBase::HorizonSection* getSection(int id) const;
188 
189  static HorizonDisplay* getHorizonDisplay(const MultiID&);
190 
191  void doOtherObjectsMoved(
193  int whichobj );
194  virtual void setPixelDensity(float);
195 
196  void setSectionDisplayRestore(bool);
197  BufferString getSectionName(int secidx) const;
198 
199  void selectParent(const TrcKey&);
200  void selectChildren(const TrcKey&);
201  void selectChildren();
202  void showParentLine(bool);
203  void showSelections(bool);
204  void showLocked(bool);
205  bool lockedShown() const;
206  virtual void clearSelections();
207  void updateAuxData();
208  virtual bool canBeRemoved() const;
209 
210 private:
211  ~HorizonDisplay();
212  void removeEMStuff();
213 
214  EM::PosID findClosestNode(const Coord3&) const;
215  void createDisplayDataPacks(
216  int attrib,const DataPointSet*);
217 
218  void removeSectionDisplay(const EM::SectionID&);
219  visBase::VisualObject* createSection(const EM::SectionID&) const;
220  bool addSection(const EM::SectionID&,TaskRunner*);
221  void emChangeCB(CallBacker*);
222  int getChannelIndex(const char* nm) const;
223  void updateIntersectionLines(
225  int whichobj );
226  void updateSectionSeeds(
228  int whichobj );
229  void otherObjectsMoved(
231  int whichobj );
232  void updateSingleColor();
233 
234  void calculateLockedPoints();
235  void initSelectionDisplay(bool erase);
236  virtual void updateSelections();
237  void handleEmChange(const EM::EMObjectCallbackData&);
238  void updateLockedPointsColor();
239 
243 
247 
249  {
251  ~IntersectionData();
252  void addLine(const TypeSet<Coord3>&);
253  void clear();
254 
255  void setPixelDensity(float);
256  void setDisplayTransformation(const mVisTrans*);
257  void updateDataTransform(const TrcKeyZSampling&,
258  ZAxisTransform*);
259  void setSceneEventCatcher(visBase::EventCatcher*);
260  void setMaterial(visBase::Material*);
261  RefMan<visBase::VertexShape> setLineStyle(const OD::LineStyle&);
262  //Returns old line if replaced
263 
264 
268  int voiid_;
269  int objid_;
270  };
271 
272  IntersectionData* getOrCreateIntersectionData(
275 
276  void traverseLine(const TrcKeyPath&,
277  const TypeSet<Coord>&,
278  const Interval<float>& zrg,
280  IntersectionData&) const;
283  void drawHorizonOnZSlice(const TrcKeyZSampling&,
284  const EM::SectionID&,
285  IntersectionData&) const;
286 
287  bool isValidIntersectionObject(
289  int& objidx,int objid) const;
295  //One per object we intersect with
296 
299 
304 
307 
311 
315 
317 
325 
329 
332  bool showlock_;
333 
334  static const char* sKeyTexture();
335  static const char* sKeyShift();
336  static const char* sKeyResolution();
337  static const char* sKeyRowRange();
338  static const char* sKeyColRange();
339  static const char* sKeyIntersectLineMaterialID();
340  static const char* sKeySurfaceGrid();
341  static const char* sKeySectionID();
342  static const char* sKeyZValues();
343 };
344 
345 } // namespace visSurvey
346 
347 #endif
Definition: visobject.h:37
bool usestexture_
Definition: vishorizondisplay.h:312
od_int16 SectionID
Definition: emposid.h:25
#define mExpClass(module)
Definition: commondefs.h:160
od_int32 ObjectID
Definition: emposid.h:24
bool showlock_
Definition: vishorizondisplay.h:332
TypeSet< EM::SectionID > getSectionIDs() const
Definition: vishorizondisplay.h:71
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Definition: vishorizonsection.h:51
ZAxisTransform * zaxistransform_
Definition: vishorizondisplay.h:267
int voiid_
Definition: vishorizondisplay.h:268
Definition: visemobjdisplay.h:69
Set of data points with group selection.
Definition: datapointset.h:48
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Export_Basic uiString toUiString(ViewStyle)
Maps from [0,1] -> Color.
Definition: coltabsequence.h:37
ObjectSet< visBase::HorizonTextureHandler > oldhortexhandlers_
Definition: vishorizondisplay.h:330
Is an identifier for each position in the earthmodel.
Definition: emposid.h:37
bool hasSingleColorFallback() const
Definition: vishorizondisplay.h:102
bool enabletextureinterp_
Definition: vishorizondisplay.h:310
TypeSet< BufferString > secnames_
Definition: vishorizondisplay.h:245
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Definition: draw.h:118
ObjectSet< TypeSet< Attrib::SelSpec > > as_
Definition: vishorizondisplay.h:318
Definition: vispointset.h:26
ObjectSet< visBase::HorizonSection > sections_
Definition: vishorizondisplay.h:244
int ID
Each Mgr has its own ID.
Definition: datapack.h:147
void clear(std::ios &)
ObjectSet< TypeSet< float > > shifts_
Definition: vishorizondisplay.h:322
#define mDefaultFactoryInstantiation(baseclss, clss, keywrd, usernm)
Definition: factory.h:289
visBase::Material * intersectionlinematerial_
Definition: vishorizondisplay.h:298
BoolTypeSet enabled_
Definition: vishorizondisplay.h:320
TypeSet< ColTab::Sequence > coltabsequences_
Definition: vishorizondisplay.h:309
int ID
Definition: datapack.h:38
Used for displaying a polyline, preview for a random line created throught well path.
Definition: visarrowdisplay.h:20
bool allowshading_
Definition: vishorizondisplay.h:240
static ID FlatID()
Flat (N1xN2) data: 4.
Definition: vistexturechannel2rgba.h:36
visBase::PointSet * selections_
Definition: vishorizondisplay.h:300
ManagedObjectSet< IntersectionData > intersectiondata_
Definition: vishorizondisplay.h:294
visBase::VertexShape * parentline_
Definition: vishorizondisplay.h:303
bool displayintersectionlines_
Definition: vishorizondisplay.h:316
Set of pointers to objects.
Definition: commontypes.h:32
int curtextureidx_
Definition: vishorizondisplay.h:314
Definition: commontypes.h:39
bool isVerticalPlane() const
Definition: vishorizondisplay.h:176
TypeSet< StepInterval< int > > olddisplayedcolranges_
Definition: vishorizondisplay.h:328
Definition: vishorizondisplay.h:38
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
StepInterval< int > parrowrg_
Definition: vishorizondisplay.h:305
Class that can execute a task.
Definition: task.h:169
bool canEnableTextureInterpolation() const
Definition: vishorizondisplay.h:56
char resolution_
Definition: vishorizondisplay.h:313
#define mVisTrans
Definition: visdata.h:31
TypeSet< EM::SectionID > sids_
Definition: vishorizondisplay.h:246
TypeSet< int > curshiftidx_
Definition: vishorizondisplay.h:321
bool validtexture_
Definition: vishorizondisplay.h:323
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
Pol2D3D
Definition: commontypes.h:39
bool allowMaterialEdit() const
Definition: vishorizondisplay.h:120
Definition: vismaterial.h:37
Pol2D3D getAllowedDataType() const
Definition: vishorizondisplay.h:89
Coord3 translationpos_
Definition: vishorizondisplay.h:242
mVisTrans * translation_
Definition: vishorizondisplay.h:241
bool allowsPicks() const
Definition: vishorizondisplay.h:145
Setup class for colortable Mapper.
Definition: coltabmapper.h:35
float maxintersectionlinethickness_
Definition: vishorizondisplay.h:297
bool canBDispOn2DViewer() const
Definition: vishorizondisplay.h:175
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
A cartesian coordinate in 3D space.
Definition: coord.h:72
bool hasColor() const
Definition: vishorizondisplay.h:121
visBase::VertexShape * line_
Definition: vishorizondisplay.h:265
bool textureInterpolationEnabled() const
Definition: vishorizondisplay.h:54
void getMousePosInfo(const visBase::EventInfo &e, IOPar &i) const
Definition: vishorizondisplay.h:146
Definition: visannot.h:43
StepInterval< int > parcolrg_
Definition: vishorizondisplay.h:306
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
visBase::PointSet * sectionlockedpts_
Definition: vishorizondisplay.h:302
bool displaysurfacegrid_
Definition: vishorizondisplay.h:324
int objid_
Definition: vishorizondisplay.h:269
TypeSet< ColTab::MapperSetup > coltabmappersetups_
Definition: vishorizondisplay.h:308
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
EM object callback data.
Definition: emobject.h:46
Base class for all &#39;Display&#39; objects.
Definition: vissurvobj.h:58
Definition: visevent.h:44
AttribFormat
Definition: vissurvobj.h:175
Color Table
Definition: coltab.h:22
Specifies an attribute selection (ID or output number of NN).
Definition: attribsel.h:45
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
Definition: vishorizondisplay.h:248
visBase::PointSet * lockedpts_
Definition: vishorizondisplay.h:301
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
TypeSet< EM::SectionID > oldsectionids_
Definition: vishorizondisplay.h:326
TypeSet< StepInterval< int > > olddisplayedrowranges_
Definition: vishorizondisplay.h:327
Definition: visshape.h:83
Base class for z-axis transforms.
Definition: zaxistransform.h:37
ObjectSet where the objects contained are owned by this set.
Definition: manobjectset.h:23
virtual DataPackMgr::ID getDataPackMgrID() const
Definition: vishorizondisplay.h:117
MarkerSet is a set of basic pickmarker with a constant size on screen. Size and shape are settable...
Definition: vismarkerset.h:36
Threads::Mutex * locker_
Definition: vishorizondisplay.h:331
Definition: visevent.h:87
visBase::MarkerSet * markerset_
Definition: vishorizondisplay.h:266
Compound key consisting of ints.
Definition: multiid.h:25
ObjectSet< TypeSet< DataPack::ID > > dispdatapackids_
Definition: vishorizondisplay.h:319
Definition: ptrman.h:168

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