OpendTect-6_4  6.4
vishorizonsectiontile.h
Go to the documentation of this file.
1 #ifndef vishorizonsectiontile_h
2 #define vishorizonsectiontile_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: March 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 // this header file only be used in the classes related to Horzonsection .
17 // don't include it in somewhere else !!!
18 
19 #include "callback.h"
20 #include "thread.h"
21 #include "position.h"
22 #include "color.h"
23 #include "rowcol.h"
24 #include "visdata.h"
25 #include "vishorizonsection.h"
26 
27 #if defined(visBase_EXPORTS) || defined(VISBASE_EXPORTS)
28 #include <osg/BoundingBox>
29 #endif
30 
31 namespace osg
32 {
33  class CullStack;
34  class StateSet;
35  class Array;
36  class Switch;
37  class Geode;
38  class Geometry;
39  class DrawElementsUShort;
40 }
41 
42 namespace visBase
43 {
44  class HorizonSectionTilePosSetup;
45  class HorizonSection;
46  class TileResolutionData;
47  class HorizonSectionTileGlue;
48  class Coordinates;
49 //A tile with 65x65 nodes.
50 
52 {
53 public:
56  char getActualResolution() const;
57  void updateAutoResolution(const osg::CullStack*);
58  /*<Update only when the resolution is -1. */
59  void setPos(int row,int col, const Coord3&);
60  void setPositions(const TypeSet<Coord3>&);
61  //Call by the end of each render
62  //Makes object ready for render
63  void tesselateResolution(char,bool onlyifabsness);
64  void applyTesselation(char res);
66  void ensureGlueTesselated();
67  void setWireframeColor(Color& color);
68  void setTexture( const Coord& origin,
69  const Coord& opposite );
71  void addTileTesselator( int res );
72  void addTileGlueTesselator();
74  { return tileresolutiondata_; }
75  void turnOnGlue(bool);
76  void setLineWidth(int);
77 
78 protected:
79 
80  void setNeighbor(int neighbor,HorizonSectionTile*);
82 
83  void setResolution(char);
86  bool hasDefinedCoordinates(int idx) const;
90  const HorizonSectionTile* getNeighborTile(int idx) const;
92 
93  void enableGeometryTypeDisplay(GeometryType type,
94  bool yn);
98  void updatePrimitiveSets();
99  bool getResolutionNormals(TypeSet<Coord3>&) const;
100  bool getResolutionTextureCoordinates(
101  TypeSet<Coord>&) const;
102  bool getResolutionPrimitiveSet(
103  TypeSet<int>&,GeometryType) const;
105  bool getResolutionPrimitiveSet( char res,
106  TypeSet<int>&,GeometryType) const;
107  bool getResolutionCoordinates(TypeSet<Coord3>&)const;
108 
109  void dirtyGeometry();
110 
111  void setNrTexCoordLayers(int nrlayers);
112  void initTexCoordLayers();
113  osg::Array* getNormals() { return normals_; }
114  osg::Array* getOsgVertexArray(){ return osgvertices_; }
115 
116 protected:
117 
119  friend class TileTesselator;
120  friend class HorizonSection;
121  friend class TileResolutionData;
124  friend class HorizonTextureHandler;
125  friend class TileCoordinatesUpdator;
127 
128  void updateBBox();
129  void buildOsgGeometries();
130  void setActualResolution(char);
131  char getAutoResolution(const osg::CullStack*);
132  double calcGradient(int row,int col,
133  const StepInterval<int>& rcrange,
134  bool isrow);
135  void computeNormal(int nmidx, osg::Vec3&);
136  void initvertices();
137 
138  HorizonSectionTile* neighbors_[9];
139 
142 
143  osg::BoundingBox bbox_;
147 
150 
153 
157 
158  osg::StateSet* stateset_;
160 
162  osg::Switch* osgswitchnode_;
165  osg::Vec2f txorigin_;
166  osg::Vec2f txoppsite_;
167  std::vector<osg::Array*> txcoords_;
168  osg::Array* normals_;
169  osg::Array* osgvertices_;
170 
171  const double cosanglexinl_, sinanglexinl_;
172 };
173 
174 } // namespace visBase
175 
176 #endif
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Definition: vishorizonsection.h:51
Definition: vishorizonsectiontileglue.h:37
const double sinanglexinl_
Definition: vishorizonsectiontile.h:171
ObjectSet< TileResolutionData > & getResolutionData()
Definition: vishorizonsectiontile.h:73
bool wireframedisplayed_
Definition: vishorizonsectiontile.h:146
osg::Vec2f txorigin_
Definition: vishorizonsectiontile.h:165
Definition: vishortilescreatorandupdator.h:35
osg::BoundingBox bbox_
Definition: vishorizonsectiontile.h:143
A cartesian coordinate in 2D space.
Definition: coord.h:25
GeometryType
Definition: vishorizonsectiondef.h:31
Set of pointers to objects.
Definition: commontypes.h:32
osg::Array * normals_
Definition: vishorizonsectiontile.h:168
TypeSet< int > txunits_
Definition: vishorizonsectiontile.h:159
bool resolutionhaschanged_
Definition: vishorizonsectiontile.h:151
std::vector< osg::Array * > txcoords_
Definition: vishorizonsectiontile.h:167
Definition: vishorizontexturehandler.h:33
Definition: vishorizonsectiontile.h:51
ObjectSet< TileResolutionData > tileresolutiondata_
Definition: vishorizonsectiontile.h:161
osg::StateSet * stateset_
Definition: vishorizonsectiontile.h:158
int nrdefinedvertices_
Definition: vishorizonsectiontile.h:149
A cartesian coordinate in 3D space.
Definition: coord.h:72
osg::Array * osgvertices_
Definition: vishorizonsectiontile.h:169
IdxPair used for its row() and col().
Definition: rowcol.h:25
Definition: visannot.h:43
char desiredresolution_
Definition: vishorizonsectiontile.h:148
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:44
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
const RowCol origin_
Definition: vishorizonsectiontile.h:144
Open Scene Graph.
Definition: visannot.h:29
HorizonSectionTileGlue * bottomtileglue_
Definition: vishorizonsectiontile.h:141
osg::Vec2f txoppsite_
Definition: vishorizonsectiontile.h:166
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
osg::Array * getNormals()
Definition: vishorizonsectiontile.h:113
bool needsupdatebbox_
Definition: vishorizonsectiontile.h:152
const HorizonSection & hrsection_
Definition: vishorizonsectiontile.h:145
osg::Array * getOsgVertexArray()
Definition: vishorizonsectiontile.h:114
Definition: vishorthreadworks.h:102
osg::Switch * osgswitchnode_
Definition: vishorizonsectiontile.h:162
char glueneedsretesselation_
0 - updated, 1 - needs update, 2 - dont disp
Definition: vishorizonsectiontile.h:155
Definition: vishorthreadworks.h:114
Definition: vishortileresolutiondata.h:47
Definition: arraytesselator.h:21
HorizonSectionTileGlue * righttileglue_
Definition: vishorizonsectiontile.h:140
int tesselationqueueid_
Definition: vishorizonsectiontile.h:154
Threads::Mutex datalock_
Definition: vishorizonsectiontile.h:163
bool updatenewpoint_
Definition: vishorizonsectiontile.h:164

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