OpendTect  6.3
viswell.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: Nanne Hemstra
8  Date: October 2003
9 ________________________________________________________________________
10 
11 -*/
12 
13 
14 #include "visobject.h"
15 #include "color.h"
16 #include "fontdata.h"
17 #include "ranges.h"
18 #include "scaler.h"
19 #include "coltab.h"
20 
21 namespace OD { class LineStyle; };
22 class VisColorTab;
23 class ZAxisTransform;
24 
25 
26 namespace osgGeo
27 {
28  class WellLog;
29 }
30 
31 
32 namespace visBase
33 {
34 
35 class PolyLine3D;
36 class PolyLine;
37 class PolyLineBase;
38 class Text2;
39 class Text;
40 class Transformation;
41 class MarkerSet;
42 
43 
47 {
48 public:
49 
50  typedef std::pair<Coord3,float> Coord3Value;
51 
52  static Well* create()
54 
55  enum Side { Left=0, Right };
56 
57  enum LogStyle { Welllog, Seismic, Logtube };
58 
59  mStruct(visBase) BasicParams
60  {
61  BasicParams(){}
62  uiString name_;
63  Color col_;
64  int size_;
65  };
66 
67  //Well
68  mStruct(visBase) TrackParams : public BasicParams
69  {
70  TrackParams()
71  {}
72  Coord3* toppos_;
73  Coord3* botpos_;
74  bool isdispabove_;
75  bool isdispbelow_;
76  FontData font_;
77  };
78 
79  void setTrack(const TypeSet<Coord3>&);
80  void setWellName(const TrackParams&);
81  void showWellTopName(bool);
82  void showWellBotName(bool);
83  bool wellTopNameShown() const;
84  bool wellBotNameShown() const;
85  const PolyLine* getTrack() const { return track_; }
86 
87  //Markers
88  mStruct(visBase) MarkerParams : public BasicParams
89  {
90  MarkerParams()
91  {}
92  int shapeint_;
93  int cylinderheight_;
94  FontData font_;
95  Color namecol_;
96  Coord3* pos_;
97  };
98 
99  void setMarkerSetParams(const MarkerParams&);
100  void addMarker(const MarkerParams&);
101 
102  bool canShowMarkers() const;
103  void showMarkers(bool);
104  int markerScreenSize() const;
105  bool markersShown() const;
106  void showMarkerName(bool);
107  bool markerNameShown() const;
108  const visBase::Text2* getMarkerNames() const { return markernames_; }
109  void removeAllMarkers();
110  void setMarkerScreenSize(int);
111 
112  //logs
113  mStruct(visBase) LogParams : public BasicParams
114  {
115  LogParams()
116  {}
117  float cliprate_;
118  bool isdatarange_;
119  bool islinedisplayed_;
120  bool islogarithmic_;
121  bool issinglcol_;
122  bool isleftfilled_;
123  bool isrightfilled_;
124  bool isblock_;
125  int logwidth_;
126  int logidx_;
127  Well::Side side_;
128  Interval<float> range_;
129  Interval<float> valrange_;
130  bool sclog_;
131  ColTab::SeqUseMode sequsemode_;
132 
133  int filllogidx_;
134  BufferString fillname_;
135  Interval<float> fillrange_;
136  Interval<float> valfillrange_;
137  BufferString seqname_;
138 
139  int repeat_;
140  float ovlap_;
141  Color seiscolor_;
142  LogStyle style_;
143  };
144 
145  const OD::LineStyle& lineStyle() const;
146  void setLineStyle(const OD::LineStyle&);
147 
148  void initializeData(const LogParams&,int);
149  float getValue(const TypeSet<Coord3Value>&,int,bool,
150  const LinScaler&) const;
151  Coord3 getPos(const TypeSet<Coord3Value>&,int) const;
152  void setLogColor(const Color&,Side);
153  const Color& logColor(Side) const;
154  const Color& logFillColor(int) const;
155  void clearLog(Side);
156 
157  void setLogLineDisplayed(bool,Side);
158  bool logLineDisplayed(Side) const;
159  void setLogWidth(float,Side);
160  float getLogWidth(Side) const;
161  void setLogLineWidth(int,Side);
162  int getLogLineWidth() const;
163  void showLogs(bool);
164  void showLog(bool,Side);
165  bool logsShown() const;
166  void showLogName(bool);
167  bool logNameShown() const;
168  void setLogStyle(int,Side);
169  void setLogFill(bool,Side);
170  void setLogBlock(bool,int);
171  void setOverlapp(float,Side);
172  void setRepeat( int,Side );
173  void removeLogs();
174  void setTrackProperties(Color&,int);
175  void setLogFillColorTab(const LogParams&,Side);
176 
177  void setDisplayTransformation(const mVisTrans*);
178  const mVisTrans* getDisplayTransformation() const;
179  void setPixelDensity(float);
180  float getPixelDensity() const { return pixeldensity_;}
181  void setZAxisTransform(ZAxisTransform*,TaskRunner*);
182 
183  void setLogData(const TypeSet<Coord3Value>& crdvals,
184  const TypeSet<Coord3Value>& crdvalsF,
185  const LogParams& lp, bool isFilled );
186  void setLogTubeDisplay(Side side,bool yn);
187 
188  void fillPar(IOPar&) const;
189  bool usePar(const IOPar& par);
191 
192  static const char* linestylestr();
193  static const char* showwelltopnmstr();
194  static const char* showwellbotnmstr();
195  static const char* showmarkerstr();
196  static const char* markerszstr();
197  static const char* showmarknmstr();
198  static const char* showlogsstr();
199  static const char* showlognmstr();
200  static const char* logwidthstr();
201 
203  const visBase::MarkerSet* getMarkerSet() const { return markerset_; }
204  bool hasLog(Side side) const;
205  uiString getLogName(Side side) const;
206  bool getLogOsgData(LogStyle style,Side side,
207  TypeSet<Coord3>&coords,
208  TypeSet<Color>& colors,
209  TypeSet<TypeSet<int> >& pss,
210  TypeSet<Coord3>& normals,
211  bool path) const;
212  void getLogStyle(Side,int&) const;
213  unsigned int getRepeat(Side side) const;
214  float getRepeatStep(Side side) const;
215  const Text2* getWellTopText() const { return welltoptxt_; }
216  const Text2* getWellBottomText() const{ return wellbottxt_; }
217 
218 
219 protected:
220 
221  void transformZIfNeeded(Coord3&) const;
222 
223  ~Well();
226  osgGeo::WellLog* leftlogdisplay_;
227  osgGeo::WellLog* rightlogdisplay_;
228 
233 
235  bool showlogs_;
236 
239  int voiidx_;
240  bool displaytube_[2];
241  bool displaylog_[2];
243 
244 private:
245 
246  void updateText(Text* tx, const uiString& chr,
247  const Coord3* pos,
248  const FontData& fnt);
249 
250  void getLinScale(const LogParams&,
251  LinScaler&,
252  bool isFill = true);
253  void getLinScaleRange( const LinScaler&,
254  Interval<float>&, float&, float&, bool);
255  void updateMakerSize(float sizefactor);
256  void updateMakerNamePosition(Side side,
257  float sizefactor);
258 
259 
260 };
261 
262 } // namespace visBase
#define mExpClass(module)
Definition: commondefs.h:157
const Text2 * getWellTopText() const
Definition: viswell.h:215
float pixeldensity_
Definition: viswell.h:237
Definition: file.h:109
MarkerSet * markerset_
Definition: viswell.h:225
#define mStruct(module)
Definition: commondefs.h:162
int markersize_
Definition: viswell.h:190
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
Definition: draw.h:119
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:35
const Text2 * getWellBottomText() const
Definition: viswell.h:216
const PolyLine * getTrack() const
Definition: viswell.h:85
Definition: uistring.h:88
Definition: viswell.h:57
Definition: vistext.h:30
Data needed to make an actual font.
Definition: fontdata.h:18
FixedString LineStyle()
Definition: keystrs.h:80
3D point or vector
Definition: commontypes.h:57
Set of (small) copyable elements.
Definition: commontypes.h:26
const visBase::MarkerSet * getMarkerSet() const
for pdf3d
Definition: viswell.h:203
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
LogStyle
Definition: viswell.h:57
Class that can execute a task.
Definition: task.h:193
osgGeo::WellLog * leftlogdisplay_
Definition: viswell.h:226
#define mVisTrans
Definition: visdata.h:25
Definition: vispolyline.h:33
Definition: vistext.h:98
Definition: wellcommon.h:16
osgGeo::WellLog * rightlogdisplay_
Definition: viswell.h:227
Side
Definition: viswell.h:55
ZAxisTransform * zaxistransform_
Definition: viswell.h:238
PolyLine * track_
Definition: viswell.h:224
Text2 * welltoptxt_
Definition: viswell.h:229
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
SeqUseMode
Definition: coltab.h:27
int voiidx_
Definition: viswell.h:239
bool showlogs_
Definition: viswell.h:235
Definition: visannot.h:40
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
const visBase::Text2 * getMarkerNames() const
Definition: viswell.h:108
float getPixelDensity() const
Definition: viswell.h:180
std::pair< Coord3, float > Coord3Value
Definition: viswell.h:50
OpendTect.
Definition: commontypes.h:25
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
static Well * create()
Definition: viswell.h:52
Definition: uistring.h:235
#define mCreateDataObj(clss)
Definition: visdata.h:210
Text2 * markernames_
Definition: viswell.h:231
bool showmarkers_
Definition: viswell.h:234
Definition: visobject.h:67
Base class for z-axis transforms.
Definition: zaxistransform.h:35
MarkerSet is a set of basic pickmarker with a constant size on screen. Size and shape are settable...
Definition: vismarkerset.h:33
uiStringSet lognames_
Definition: viswell.h:242
Linear scaling.
Definition: scaler.h:55
Text2 * wellbottxt_
Definition: viswell.h:230
const visBase::Transformation * transformation_
Definition: viswell.h:232

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