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

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