OpendTect-6_4  6.4
explfaultsticksurface.h
Go to the documentation of this file.
1 #ifndef explfaultsticksurface_h
2 #define explfaultsticksurface_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: J.C. Glas
9  Date: October 2007
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "geometrymod.h"
16 #include "indexedshape.h"
17 #include "enums.h"
18 #include "position.h"
19 #include "rowcol.h"
20 #include "datapack.h"
21 #include "binidvalue.h"
22 
23 class DataPointSet;
24 
25 namespace Geometry
26 {
27 
28 class FaultStickSurface;
29 class ExplFaultStickTexturePositionExtracter;
30 
34 #define mFltTriProj Geometry::ExplFaultStickSurface::TriProjection
35 
36 
38  public CallBacker
39 {
40 public:
42  float zscale=mUdf(float));
44 
45  void setSceneIdx(int idx) { sceneidx_ = idx; }
46 
47  bool needsUpdate() const { return needsupdate_; }
48 
49  enum TriProjection { None=0, Inline=1, Crossline=2, ZSlice=3 };
51  TriProjection triangulateAlg() const { return trialg_; }
52  void triangulateAlg(TriProjection);
53 
54  void setSurface(FaultStickSurface*);
55  FaultStickSurface* getSurface() { return surface_; }
56  const FaultStickSurface* getSurface() const { return surface_; }
57 
58  void setZScale( float );
59 
60  void display(bool sticks,bool panels);
61  bool areSticksDisplayed() const { return displaysticks_; }
62  bool arePanelsDisplayed() const { return displaypanels_; }
63 
64  bool createsNormals() const { return true; }
65  bool createsTextureCoords() const { return true; }
66 
67  void setMaximumTextureSize(int);
68  void setTexturePowerOfTwo(bool yn);
69  void setTextureSampling(const BinIDValue&);
70  const RowCol& getTextureSize() const;
71  void needUpdateTexture(bool yn);
72  bool needsUpdateTexture() const;
73 
74  bool update(bool forceall,TaskRunner*);
75 
76  void addToGeometries(IndexedGeometry*);
77  void removeFromGeometries(const IndexedGeometry*);
78 
79  bool getTexturePositions(DataPointSet&,
80  TaskRunner*);
81  const BinIDValue getBinIDValue() { return texturesampling_; }
82 
83  static const char* sKeyTextureI() { return "Fault texture i column"; }
84  static const char* sKeyTextureJ() { return "Fault texture j column"; }
85 
86 protected:
87 
88  friend class ExplFaultStickSurfaceUpdater;
89  friend class ExplFaultStickTexturePositionExtracter;
90 
91  void removeAll(bool);
92  void insertAll();
93 
94  void emptyStick(int stickidx);
95  void fillStick(int stickidx);
96  void removeStick(int stickidx);
97  void insertStick(int stickidx);
98 
99  void emptyPanel(int panelidx);
100  void fillPanel(int panelidx);
101  void removePanel(int panelidx);
102  void insertPanel(int panelidx);
103 
104  void surfaceChange(CallBacker*);
105  void surfaceMovement(CallBacker*);
106 
107  void updateTextureCoords();
108  bool updateTextureSize();
109  int textureColSz(const int panelidx);
110  int sampleSize(const Coord3& p0,const Coord3& p1);
111  int point2LineSampleSz(const Coord3& point,
112  const Coord3& linept0,
113  const Coord3& linept1);
114  Coord3 getCoord(int stickidx,int texturerow) const;
115  float getAvgDistance(int stickidx,
116  const TypeSet<int>& shift,int extra) const;
117  void shiftStick(int stickidx,int nrunits);
118  void updateStickShifting();
119  bool reTriangulateSurface();
120  bool setProjTexturePositions(DataPointSet& dpset,int id=-1);
121 
122  void addTriangle(IndexedGeometry*,int a,int b,int c);
123 
126 
130 
134 
138 
145 
146 public:
147 
148  bool getTexturePositions(DataPointSet&,int id,
149  TaskRunner*);
150 };
151 
152 };
153 
154 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Definition: indexedshape.h:182
bool needsUpdate() const
Definition: explfaultsticksurface.h:47
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
int sceneidx_
Definition: explfaultsticksurface.h:129
BinIDValue texturesampling_
Definition: explfaultsticksurface.h:144
Set of data points with group selection.
Definition: datapointset.h:48
bool displaypanels_
Definition: explfaultsticksurface.h:125
ObjectSet< IndexedGeometry > paneltriangles_
Definition: explfaultsticksurface.h:136
bool createsNormals() const
Definition: explfaultsticksurface.h:64
ObjectSet< IndexedGeometry > sticks_
Definition: explfaultsticksurface.h:135
RowCol texturesize_
Definition: explfaultsticksurface.h:142
const BinIDValue getBinIDValue()
Definition: explfaultsticksurface.h:81
FixedString Crossline()
Definition: keystrs.h:50
bool areSticksDisplayed() const
Definition: explfaultsticksurface.h:61
bool needsupdate_
Definition: explfaultsticksurface.h:131
const FaultStickSurface * getSurface() const
Definition: explfaultsticksurface.h:56
Definition: indexedshape.h:126
Definition: faultsticksurface.h:20
FixedString Inline()
Definition: keystrs.h:75
bool arePanelsDisplayed() const
Definition: explfaultsticksurface.h:62
void setSceneIdx(int idx)
Definition: explfaultsticksurface.h:45
Definition: oduicommon.h:36
static const char * sKeyTextureI()
Definition: explfaultsticksurface.h:83
TriProjection triangulateAlg() const
Definition: explfaultsticksurface.h:51
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
FixedString None()
Definition: keystrs.h:90
ObjectSet< IndexedGeometry > panellines_
Definition: explfaultsticksurface.h:137
Set of pointers to objects.
Definition: commontypes.h:32
bool createsTextureCoords() const
Definition: explfaultsticksurface.h:65
static const char * sKeyTextureJ()
Definition: explfaultsticksurface.h:84
void removeAll()
bool needsupdatetexture_
Definition: explfaultsticksurface.h:132
Class that can execute a task.
Definition: task.h:169
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
FaultStickSurface * getSurface()
Definition: explfaultsticksurface.h:55
BinID and a value.
Definition: binidvalue.h:31
TypeSet< int > texturecolcoords_
Definition: explfaultsticksurface.h:139
Coord3 scalefacs_
Definition: explfaultsticksurface.h:128
A cartesian coordinate in 3D space.
Definition: coord.h:72
IdxPair used for its row() and col().
Definition: rowcol.h:25
TriProjection trialg_
Definition: explfaultsticksurface.h:133
bool texturepot_
Definition: explfaultsticksurface.h:143
Definition: explfaultsticksurface.h:37
TriProjection
Definition: explfaultsticksurface.h:49
ObjectSet< TypeSet< int > > textureknotcoords_
Definition: explfaultsticksurface.h:140
int maximumtexturesize_
Definition: explfaultsticksurface.h:141
Definition: arraytesselator.h:21
FaultStickSurface * surface_
Definition: explfaultsticksurface.h:127
bool displaysticks_
Definition: explfaultsticksurface.h:124

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